query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
On List view item Click
public S<T> itemClick(OnItemClickListener listener){ if(t instanceof ListView){ ((ListView) t).setOnItemClickListener(listener); } return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onListItemClicked(int position) {\n\n }", "@Override\n public void onItemClick(View view, ListItem obj, int position) {\n }", "public void onListItemClick( ListView l, View v, int position, long id )\n {\n }", "@Override\r\n public void onListItemClick(ListView l, View v, int position, long id) {\n }", "void onListClick();", "@Override\n\tpublic void onListItemClick(ListView l, View v, int position, long id) {\n\t \n\t }", "@Override\n protected void onListItemClick(ListView l, View v, int position, long id) {\n \t\n \t\n }", "void onItemClick(int position);", "public void onItemClick(View view, int position);", "@Override\n public void OnItemClick(int position) {\n }", "@Override\n public void onItemClick(int pos) {\n }", "@Override\n public void onClick(View view) { listener.onItemClick(view, getPosition()); }", "void onItemClick(View view, int position);", "@Override\n public void onClick(View v) {\n //getAdapterPosition() get's an Integer based on which the position of the current\n //ViewHolder (this) in the Adapter. This is how we get the correct Data.\n ListItem listItem = listOfData.get(\n this.getAdapterPosition()\n );\n\n controller.onListItemClick(\n listItem,\n v\n );\n\n }", "@Override\n public void onClick(View view) {\n clickListener.onItemClicked(getBindingAdapterPosition());\n }", "abstract public void onSingleItemClick(View view);", "public void onItemClick(View view, int position) {\n\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position,\n long id) {\n\n\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n }", "@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {\n }", "@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {\n }", "@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(int position) {\n }", "@Override\n public void onItemClick(Nson parent, View view, int position) {\n }", "public void onListItemClick(ListView l, \n\t\t\tView v, int position, long id) {\n\t}", "@Override\n public void onListItemClick(ListView l, View v, int position, long id) {\n Log.i(\"LoaderCustom\", \"Item clicked: \" + id);\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(View view, int position) {\n }", "@Override\n public void onItemClick(View view, int position) {\n }", "@Override\n\t\t\t\t\t\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\n\t\t\t\t\t\t\t\t\t\tint position, long id) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}", "@Override\n\t\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1,\n\t\t\t\t\t\tint arg2, long arg3) {\n\t\t\t\t\t\n\t\t\t\t\t Log.i(\"MyListViewBase\", \"你点击了ListView条目\"+arg2);\n\t\t\t\t}", "@Override\n public void onItemClick(int position) {\n }", "@Override\n public void onItemClick(int position) {\n }", "@Override\n public void onItemClick(View view, int position) {\n\n }", "@Override\n public void onClick(View v) {\n listener.onItemClick(v, position);\n }", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\t\t\t\t\n\t\t\t}", "@Override\n public void onItemClick(View view, String data) {\n }", "@Override\n\tpublic void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n\t}", "@Override\n\tpublic void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n\t}", "@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t\t\n\t}", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\n\t\t\t}", "@Override\n public void onItemClick(AdapterView<?> parent, View view,\n int position, long id) {\n }", "@Override\n\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\tlong arg3) {\n\t\t\t\n\t\t}", "@Override\r\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t\t\r\n\t}", "@Override\n public void itemClick(int pos) {\n }", "@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t}", "@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\n\t}", "@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\n\t}", "@Override\n public void onItemClick(View view, int position){\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position,\n long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position,\n long id) {\n }", "@Override\n public void onItemClicked(int itemPosition, Object dataObject) {\n }", "@Override\n public void onClick(View v) {\n if (mListener != null){\n mListener.onItemClick(itemView, getLayoutPosition());\n }\n }", "@Override\n\tprotected void onListItemClick(ListView l, View v, int position, long id) {\n\t\tToast.makeText(this, String.format(\"Clicked on item #%d with text %s\",\n\t\t\tposition, mAdapter.getItem(position)), Toast.LENGTH_SHORT).show();\n\t}", "@Override\n\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\tlong arg3) {\n\t\t\t\t\n\t\t\tToast.makeText(getBaseContext(), list.get(arg2),\n\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t}", "@Override\n public void onClick(View v) {\n this.itemClickListener.onItemClick(v, getLayoutPosition());\n }", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\t\t\t\t\tlong arg3) {\n\t\t\t}", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n Log.w(TAG , \"POSITION : \" + position);\n\n itemClick(position);\n }", "@Override\n public void onClick(View v) {\n\n listener.onItemClick(getAdapterPosition(),v);\n }", "void onClick(View item, View widget, int position, int which);", "void onItemClick(Note note);", "@Override\n\tprotected void onListItemClick(ListView l, View v, int position, long id) {\n\t\tsuper.onListItemClick(l, v, position, id);\n\t}", "void onItemClickListener(View view, int postion);", "public void onListItemClick(ListView list, View v, int position, long id)\n {\n Intent intent = new Intent(MainActivity.this, EventActivities.class);\n intent.putExtra(\"c\", position);\n startActivity(intent);\n }", "@Override\r\n public void onClick(View view) {\n Intent intent = new Intent(context, DetailActivity.class);\r\n intent.putExtra(\"item\", itemList.get(position));\r\n context.startActivity(intent);\r\n }", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\n\t\t\t}", "@Override\n public void onClick(View view) {\n itemInterface.OnItemClickedListener(tracks, getAdapterPosition());\n }", "@Override\r\n\tpublic void onItemClick(AdapterView<?> parent, View view, int position,\r\n\t\t\tlong id) {\n\r\n\t}", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\t\t\t}", "@Override\r\n\t\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\r\n\t\t\t\t\t\tint position, long id) {\n\t\t\t\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tif (itemClicked != null)\n\t\t\t\t\titemClicked.OnItemClicked((BusinessType)item.getTag(), item);\n\t\t\t}", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tpulllist();\n\t\t\t}", "@Override\n public void onItemClick(AdapterView<?> a, View v, int position, long id) {\n Toast.makeText(getApplicationContext(), \"Selected :\" + \" \" + listData.get(position), Toast.LENGTH_LONG).show();\n }", "@Override\n public void onClick(View v) {\n if (listener != null)\n listener.onItemClick(itemView, getPosition());\n }", "@Override\r\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\r\n\t\t\t\t\tlong arg3) {\n\r\n\t\t\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\titemClickListener.Callback(itemInfo);\n\t\n\t\t\t}", "@Override\n\tpublic void onItemClick(AdapterView<?> parent, View view, int position,\n\t\t\tlong id) {\n\t\t\n\t}", "@Override\n public void onListItemClick(ListView l, View v, int position, long id) {\n \tsuper.onListItemClick(l, v, position, id);\n \tLog.i(TAG, \"Position: \" + position);\n \t/*String item = (String) getListAdapter().getItem(position);\n \tnew AlertDialog.Builder(this)\n \t .setTitle(\"Test\")\n \t .setMessage(item)\n \t .setPositiveButton(\"OK\",\n \t new DialogInterface.OnClickListener() {\n \t public void onClick(DialogInterface dialog, int which) {}}\n \t )\n \t .show();\n \t\n Toast.makeText(this, item + \" selected\", Toast.LENGTH_LONG).show();*/\n }", "@Override\n public void onClick(View v) {\n clickListener.onItemClick(getAdapterPosition(), v, st_name.getText().toString(),\n st_phone.getText().toString());\n }", "@Override\n public void onClick(View v) {\n itemClickListener.itemClicked(movieId, v);\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tlistener.clickDisplaylistMethod(position, item.getCategory()\n\t\t\t\t\t\t.getArrCookMethods());\n\t\t\t}", "@Override\n\tpublic void onItemClick(Object o, int position) {\n\n\t}", "@Override\n\tpublic void onItemClick(AdapterView<?> parent, View view, int position,\n\t\t\tlong id) {\n\n\t}", "public void onListItemClicked(int listviewIndex){\n int id = mIndexList.get(listviewIndex);\n changeFragment(new LebensmittelDetailFragment(), id);\n }", "@Override\r\n\t\t\tpublic void onItemClick(AdapterView<?> adapter, View view, int position,\r\n\t\t\t\t\tlong arg3) {\n\t\t\t\t\r\n\t\t\t}", "@Override\n public void onListItemClick(ListView l, View v, int position, long id) {\n super.onListItemClick(l, v, position, id);\n SkillModel md = (SkillModel) l.getAdapter().getItem(position);\n //SkillModel md = ((pro_adapter)getListAdapter()).getItem(position);\n String pos = Integer.toString(position);\n Log.d(\"click\", pos);\n com.itemSelected(md.id);\n\n\n\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view,\n int position, long id) {\n\n clickedValue = teams.get(position).name.toString();\n\n Intent intent = new Intent(teamSelection.this, Signup.class);\n\n intent.putExtra(\"ListViewClickedValue\", clickedValue);\n startActivity(intent);\n\n }", "void onChamaItemClicked(int position);", "@Override\n public void onListItemClick(ListView l, View v, int position, long id) {\n //Recipe recipe = recipes.get(position);\n mListener.onListInteraction(position, false);\n }", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t\t\t\tBaseData.item = (String[]) adapter.getItem(arg2);\n\t\t\t\tListIntentActivity.goActivity(ListActivity.this);\n\t\t\t}", "@Override\n public void onClick(View v) {\n customItemClickListener.onItemClick(inflatedView, holder.getAdapterPosition());\n }" ]
[ "0.8451844", "0.8265355", "0.8188207", "0.81116223", "0.80736715", "0.79638165", "0.79471093", "0.7922318", "0.79078054", "0.79023874", "0.78929937", "0.7888397", "0.7885299", "0.7867285", "0.78229326", "0.78183615", "0.77959865", "0.77784497", "0.77527267", "0.77453053", "0.77453053", "0.77337307", "0.7732678", "0.7732678", "0.7732678", "0.77308387", "0.77308387", "0.77308387", "0.77308387", "0.77308387", "0.77282065", "0.7703847", "0.76846564", "0.76729774", "0.7672662", "0.7672662", "0.76632404", "0.76632404", "0.76569164", "0.7653051", "0.7651604", "0.7651604", "0.7643762", "0.76378196", "0.7630811", "0.763013", "0.7629901", "0.7629901", "0.76275903", "0.76196045", "0.7612022", "0.7606162", "0.75931585", "0.7581874", "0.7581524", "0.755777", "0.755777", "0.75526565", "0.7545426", "0.7545426", "0.7539693", "0.7534406", "0.7532453", "0.75261176", "0.75005317", "0.7495984", "0.7495403", "0.74884456", "0.7487915", "0.7486732", "0.74860376", "0.74792093", "0.7467946", "0.7466871", "0.74587", "0.74587", "0.74581814", "0.7457663", "0.7453911", "0.7452627", "0.74408", "0.74325097", "0.7430594", "0.7420806", "0.73950857", "0.7389648", "0.7388548", "0.7377961", "0.73745245", "0.73631763", "0.7357863", "0.7344808", "0.7337257", "0.7330591", "0.73282075", "0.73160976", "0.73075706", "0.7301609", "0.72951925", "0.7282111", "0.72810847" ]
0.0
-1
Gets the int from the view (edittext, button,..)
public int toInt(){ String s = txt().trim(); int i; try{ i = Integer.parseInt(s); }catch(NumberFormatException exp){ exp.printStackTrace(); return 0; } return i; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getViewId();", "private int getValueOfField(int reference){\n Object obj = getView().findViewById(reference);\n if (obj instanceof EditText)\n if (!((EditText) obj).getText().toString().equalsIgnoreCase(\"\"))\n return Integer.parseInt(((EditText) obj).getText().toString());\n else\n return 0;\n else if (obj instanceof Button)\n if (!((Button) obj).getText().toString().equalsIgnoreCase(\"\"))\n return Integer.parseInt(((Button) obj).getText().toString());\n else\n return 0;\n else\n return -1;\n }", "public static Integer getNumber(TextView view) {\n Integer result;\n if (!isEmpty(view)) {\n try {\n result = Integer.parseInt(getString(view));\n } catch (Exception e) {\n result = null;\n }\n } else {\n result = null;\n }\n return result;\n }", "public int getViewId() {\n return 123456;\n }", "public static int getInt(EditText et) {\n String text = getText(et);\n return convertToInt(text);\n }", "public static int getViewId() {\n\t\tviewId += 0x00000001;\n\t\treturn viewId;\n\t}", "public Integer getViewID()\n {\n String x = center.east() + \"_\" + center.north() + \"_\" + scale + \"_\" +\n getWidth() + \"_\" + getHeight();\n java.util.zip.CRC32 id = new java.util.zip.CRC32();\n id.update(x.getBytes());\n return new Long(id.getValue()).intValue();\n }", "protected abstract int getContentView();", "public abstract int getContentView();", "public void numberEvent(View view) {\n if (isNewOp)\n input.setText(\"\");\n isNewOp = false;\n String number = input.getText().toString();\n switch (view.getId()) {\n case R.id.oneBTN:\n number += \"1\";\n break;\n case R.id.twoBTN:\n number += \"2\";\n break;\n case R.id.threeBTN:\n number += \"3\";\n break;\n case R.id.fourBTN:\n number += \"4\";\n break;\n case R.id.fiveBTN:\n number += \"5\";\n break;\n case R.id.sixBTN:\n number += \"6\";\n break;\n case R.id.sevenBTN:\n number += \"7\";\n break;\n case R.id.eightBTN:\n number += \"8\";\n break;\n case R.id.nineBTN:\n number += \"9\";\n break;\n case R.id.zeroBTN:\n number += \"0\";\n break;\n case R.id.pointBTN:\n number += \".\";\n break;\n }\n input.setText(number);\n }", "public int getContentViewId() {\n return R.id.tv_content;\n }", "int getItemViewLayoutId();", "public int getCatalogEditIDEntry(){\n int entry = 0;\n try{\n if(Integer.parseInt(catalogEditID.getText()) > 0) \n entry = Integer.parseInt(catalogEditID.getText());\n else {\n entry = 0;\n //if(!errorOverride)\n // alert.error(\"Input is not a valid integer - catalogEditID is zero or less than - getCatalogEditIDEntry()\"); //caught elsewhere unneeded\n }\n } catch(NumberFormatException ex) {\n entry = 0;\n // if(!errorOverride) \n alert.error(\"Input is not a valid integer - NumberFormatException - getCatalogEditIDEntry()\");\n alert.error(\"getCatalogEditIDEntry() - Entry: >\"+catalogEditID.getText()+\"<\");\n\n }\n return entry;\n }", "private int getResult(){\n\t\t\t\tButtonModel\tbtnModel = btnGroup.getSelection();\r\n \t\t\tif(btnModel!=null){\r\n \t\t\t\treturn Integer.parseInt(btnModel.getActionCommand());\r\n\t\t\t\t}\r\n\t\t\t\treturn -10; //return -10 if user did not fill selection\r\n\t\t\t}", "protected abstract int getLayoutViewId();", "String getUview_id();", "public int getButtonViewId() {\n return R.id.tv_dismiss;\n }", "@LayoutRes\n protected abstract int getContentViewId(Bundle savedInstanceState);", "public int getInt()\n\t{\n\t\tfinal String text = getText();\n\t\tif (text == null || text.length() == 0)\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\treturn Integer.parseInt(text);\n\t}", "Integer getTxtOrent();", "public int getAddEditMenuText();", "public void onEditItem(View view) {\n Intent data = new Intent(EditItemActivity.this, MainActivity.class);\n data.putExtra(\"position\", elementId);\n data.putExtra(\"text\", etText.getText().toString());\n setResult(RESULT_OK, data);\n finish();\n }", "public void onClick(View view) {\n // this is from the activity main\n TextView tv = (TextView) findViewById(R.id.tv1);\n EditText et = (EditText) findViewById(R.id.et1);\n\n }", "public static int generateViewId() {\n return View.generateViewId();\n }", "public void bouton(View view) {\n int numero;\n Button bouton = (Button) view;\n numero = Integer.parseInt(bouton.getText().toString());\n ecrire_chiffre(numero);\n }", "public int e() {\n return R.id.load_more_load_fail_view;\n }", "private int getNumeroCaras(View btn) {\n int caras = btn.getId();\n switch (caras) {\n case R.id.buttond2:\n caras=2;\n break;\n case R.id.buttond3:\n caras=3;\n break;\n case R.id.buttond4:\n caras=4;\n break;\n case R.id.buttond6:\n caras=6;\n break;\n case R.id.buttond8:\n caras=8;\n break;\n case R.id.buttond10:\n caras=10;\n break;\n case R.id.buttond12:\n caras=12;\n break;\n case R.id.buttond20:\n caras=20;\n break;\n case R.id.buttond24:\n caras=24;\n break;\n case R.id.buttond100:\n caras=100;\n break;\n }\n return caras;\n }", "public interface OpenClassRoomsExercise {\n\n /**\n * How crashes were solved:\n * 1. Modified the id of the view from activity_second_activity_text_view_main\n * to activity_main_activity_text_view_quantity\n * 2. Add String.valueOf() to convert int to String\n */\n\n}", "@Test\n public void testEditTextHasCorrectID(){\n ViewInteraction appCompatEditTextView = onView(withId(R.id.input));\n appCompatEditTextView.perform(replaceText(\"testEditTextHasCorrectID\"), closeSoftKeyboard());\n onView(withId(R.id.fab)).perform(click());\n EditText input = messagesActivity.input;\n int ID = input.getId();\n int expectedID = R.id.input;\n assertEquals(ID, expectedID);\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tgeti();\n\t\t\t}", "public void editHandler(View v) {\n LinearLayout vwParentRow = (LinearLayout)v.getParent();\n TextView id =(TextView) vwParentRow.findViewById(R.id._id);\n Intent intent = new Intent(Hates.this, Formulario.class);\n\n intent.putExtra(C_MODO, C_EDITAR);\n intent.putExtra(C_TIPO, love_hate);\n intent.putExtra(mDbHelper.ID, Long.valueOf((String)id.getText()));\n\n\n this.startActivityForResult(intent, C_EDITAR);\n }", "@Override\n\tpublic void onClick(View v) {\n\t\tint id = v.getId();\n\t\tswitch (id) {\n\t\tcase R.id.et1:\n\t\t\tedit(et1, 1);\n\t\t\tbreak;\n\t\tcase R.id.et2:\n\t\t\tedit(et2, 2);\n\t\t\tbreak;\n\t\tcase R.id.et3:\n\t\t\tedit(et3, 3);\n\t\t\tbreak;\n\t\tcase R.id.et4:\n\t\t\tedit(et4, 4);\n\t\t\tbreak;\n\t\tcase R.id.et5:\n\t\t\tedit(et5, 5);\n\t\t\tbreak;\n\t\tcase R.id.et6:\n\t\t\tedit(et6, 6);\n\t\t\tbreak;\n\t\tcase R.id.et7:\n\t\t\tedit(et7, 7);\n\t\t\tbreak;\n\t\tcase R.id.et8:\n\t\t\tedit(et8, 8);\n\t\t\tbreak;\n\t\tcase R.id.et9:\n\t\t\tedit(et9, 9);\n\t\t\tbreak;\n\t\tcase R.id.et10:\n\t\t\tedit(et10, 10);\n\t\t\tbreak;\n\t\tcase R.id.et11:\n\t\t\tedit(et11, 11);\n\t\t\tbreak;\n\t\tcase R.id.et12:\n\t\t\tedit(et12, 12);\n\t\t\tbreak;\n\t\tcase R.id.et13:\n\t\t\tedit(et13, 13);\n\t\t\tbreak;\n\t\tcase R.id.et14:\n\t\t\tedit(et14, 14);\n\t\t\tbreak;\n\t\t}\n\t}", "public int getItemIntValue(){\n return itemIntValue;\n }", "public Integer _i(int res_id) {\n\t\treturn mContext.getResources().getInteger(res_id);\n\t}", "public void Number_Button(int i){\n\t}", "private int getTextAns() {\n EditText tempAns = findViewById(R.id.answer0);\n if (tempAns.getText().toString().toLowerCase().equals(\"addition\")) {\n return 1;\n } else {\n return 0;\n }\n }", "public void randomMe(View view){\n Intent randomIntent = new Intent(this, RandomCountActivity.class);\n TextView countTextView = (TextView) findViewById(R.id.numberBox);\n String countString = countTextView.getText().toString();\n Integer count = Integer.parseInt(countString);\n randomIntent.putExtra(TOTAL_COUNT, count);\n startActivity(randomIntent);\n }", "public <T extends View> T mo8518a(int i) {\n return this.f1798c.findViewById(i);\n }", "public int getTxtViewRow(TextView aTxtView) {\n\t\tfor (int rowIndex = 0; rowIndex < gridTxtViews.length; rowIndex++) {\n\t\t\tfor (int colIndex = 0; colIndex < gridTxtViews[0].length; colIndex++) {\n\t\t\t\tif (aTxtView == this.gridTxtViews[rowIndex][colIndex]) {\n\t\t\t\t\treturn rowIndex;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn -1;\n\t}", "int getContents(JTextField tf) {\r\n\t\tString contents = tf.getText();\r\n\t\tif (contents == null || contents.isEmpty()) {\r\n\t\t\t\r\n\t\t\tif (!tf.hasFocus()) {\r\n\t\t\t\ttf.setText(\"00\");\r\n\t\t\t}\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\treturn Integer.parseInt(contents);\r\n\t}", "public View e() {\n this.i = this.h.findViewById(c.e.popup_window_view);\n return this.i;\n }", "void onInputEvent(View view, int buttons);", "public int getSelection() {\n \tcheckWidget();\n \treturn selection;\n }", "public Object getEditorValue() {\r\n\t try{\r\n\t\treturn new Integer(getText());\r\n\t }catch(Exception e){}\r\n\t return null;\r\n\t}", "@Override\r\n\tpublic void updateView(int parseInt, int parseInt2, String string) {\n\r\n\t}", "protected abstract int getItemLayoutId();", "public int getBindViewId() {\n return mBindViewId;\n }", "public View mo78146a(int i) {\n if (this.f53724A == null) {\n this.f53724A = new HashMap();\n }\n View view = (View) this.f53724A.get(Integer.valueOf(i));\n if (view != null) {\n return view;\n }\n View view2 = getView();\n if (view2 == null) {\n return null;\n }\n View findViewById = view2.findViewById(i);\n this.f53724A.put(Integer.valueOf(i), findViewById);\n return findViewById;\n }", "public void countMe(View view){\n //get the middle number\n TextView showCountTextView = (TextView) findViewById(R.id.numberBox);\n\n //get the value of the text view, convert it to a number and increment it.\n String countString = showCountTextView.getText().toString();\n Integer count = Integer.parseInt(countString);\n count++;\n\n //update the text view with the new number\n showCountTextView.setText(count.toString());\n }", "public int getTxtViewCol(TextView aTxtView) {\n\n\t\tint row = this.getTxtViewRow(aTxtView);\n\n\t\tif (row > 0 && row < gridTxtViews.length) {\n\t\t\tfor (int colIndex = 0; colIndex < gridTxtViews[row].length; colIndex++) {\n\t\t\t\tif (aTxtView == this.gridTxtViews[row][colIndex]) {\n\t\t\t\t\treturn colIndex;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn -1;\n\t}", "private int getNumber(String taskInfo) throws EditNoIndexException {\n try {\n int numberNextSlash = taskInfo.indexOf(\"/\");\n int number = Integer.parseInt(taskInfo.substring(0, (numberNextSlash - 2)));\n return number;\n } catch (StringIndexOutOfBoundsException | NumberFormatException e) {\n throw new EditNoIndexException();\n }\n }", "public int getOfYourChoiceInput() {\n return ofYourChoiceInput;\n }", "static String getPageViewId() {\n if (PAGEVIEW_ID == null) {\n PAGEVIEW_ID = generateRandomId();\n }\n return PAGEVIEW_ID;\n }", "protected abstract int getLayoutResourceId();", "public void clickFunction(View view){\n Toast.makeText(MainActivity.this, \"Hi there!\", Toast.LENGTH_LONG).show();\n\n // here we've created a variable \"myTextField\" of type \"EditText\" which collect the data from the ID i.e \"myTextField\" and convert the view ID into EditText type and stores into the variable.\n EditText myTextField = (EditText) findViewById(R.id.myTextField);\n\n // here the Log.i function is used to show the info to the logcat terminal which required two fields i.e Tag & the data to show (here the data is taken from the myTextField variable created above.\n Log.i(\"Info\",myTextField.getText().toString());\n }", "public int getContentBoxViewId() {\n return R.id.content_box;\n }", "public int mo91958z() {\n return R.layout.pc;\n }", "public void OnNumberButtonClick (View v){\n try {\n Button b = (Button) v;\n if (mIsCalculating == false)\n expressionView.setText(\"\");\n if (mIsTyping == false) {\n resultView.setText(b.getText());\n mIsTyping = true;\n } else {\n resultView.setText(resultView.getText().toString() + b.getText());\n }\n } catch (Exception e) {\n\n }\n }", "public int getTitleViewId() {\n return R.id.tv_title;\n }", "void mo4671a(View view, int i, int i2, int i3, int i4);", "public int get_int() {\n return local_int;\n }", "public View findViewById(int viewId){\r\n return AppContext.getCurrent().getActivity().getCurrentView().findViewById(viewId);\r\n }", "public void onPressNumber(View view) {\r\n CallHelper.callNumber(this, event.contactNumber);\r\n }", "public View invoke() {\n return this.f64323a.findViewById(R.id.bt0);\n }", "public void viewHandler(View v) {\n LinearLayout vwParentRow = (LinearLayout)v.getParent();\n TextView id =(TextView) vwParentRow.findViewById(R.id._id);\n Intent intent = new Intent(Hates.this, Formulario.class);\n\n intent.putExtra(C_MODO, C_VISUALIZAR);\n intent.putExtra(mDbHelper.ID, Long.valueOf((String)id.getText()));\n\n\n this.startActivityForResult(intent, C_VISUALIZAR);\n }", "@Override\n public void onClick(View v) {\n Integer amount_tries = (Integer.parseInt(tries_tv.getText().toString()) + 1);\n // putting it back as a String\n String new_tries = amount_tries.toString();\n // updating the tries textview to incremented value\n tries_tv.setText(new_tries);\n\n }", "public abstract int getFragmentView();", "public int getButtonID(){return i_ButtonID;}", "public void editTest(View v) {\n\t \t int value = (Integer) v.getTag();\n\t \t Intent intent = new Intent(this, EditTestActivity.class);\n\t \t intent.putExtra(\"Test value\", testList);\n\t \t intent.putExtra(\"int value\", value);\n\t \t startActivity(intent);\n\t }", "@Override\n public int getValue() {\n return Integer.parseInt(gValue.getText());\n }", "public int getSelectionIndex() {\n checkWidget();\n return selectedIndex;\n }", "public int getTxtViewCol(TextView aTxtView, int row) {\n\t\tif (row > 0 && row < gridTxtViews.length) {\n\t\t\tfor (int colIndex = 0; colIndex < gridTxtViews[row].length; colIndex++) {\n\t\t\t\tif (aTxtView == this.gridTxtViews[row][colIndex]) {\n\t\t\t\t\treturn row;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn -1;\n\t}", "public final int getEditingIndex() {\n\n return this.getWrappedControl().getEditingIndex();\n }", "public int getSelectionIndex () {\r\n\tcheckWidget();\r\n\tint [] args = {OS.Pt_ARG_PG_CURRENT_INDEX, 0, 0};\r\n\tOS.PtGetResources (handle, args.length / 3, args);\r\n\treturn args [1] == OS.Pt_PG_INVALID ? -1 : args [1];\r\n}", "public ViewIdentificator getView() {\r\n return view;\r\n }", "String getEditore();", "@Override\n public void onClick(View view) {\n switch (view.getId()) {\n case R.id.rc_view:\n break;\n\n }\n }", "private int getMenuSelection() {\n return view.printMenuAndGetSelection();\n }", "public int getIncrement() {\n \tcheckWidget();\n \treturn increment;\n }", "public abstract int convertRowIndexToView(int index);", "public int getViewType()\n {\n return this.viewType;\n }", "public TextView getCounterView() {\n return mCounterView;\n }", "public void displayQuestionNumber(int questionNumber) {\n\n TextView questionView = (TextView) findViewById(R.id.question_number);\n questionView.setText(String.valueOf(questionNumber));\n\n\n }", "private void findView() {\n\t\tibtn_trigger = (ImageButton) findViewById(R.id.ibtn_right_menu);\n\t}", "int leerCodigoIngreso(){\n\t\treturn Integer.parseInt(cboCodigoIngreso.getSelectedItem().toString());\n\t}", "public int deleteView(View view) {\n LinearLayout parentPage = (LinearLayout) view.getParent().getParent().getParent();\n LinearLayout slot = (LinearLayout) view.getParent().getParent();\n int index = parentPage.indexOfChild(slot);\n parentPage.removeViewAt(index);\n Context context = App.getContext();\n LogManager.reportStatus(context, \"TEMPLATEEDITOR\", \"onDelete\");\n return index;\n }", "@Override\n public void onClick(View v) {\n String textoDigitado = caixaTexto.getText().toString();\n\n if (textoDigitado.isEmpty()) {\n // String vazia\n AlertDialog.Builder dialogo = new AlertDialog.Builder(MainActivity.this);\n dialogo.setMessage(\"Digite a idade do Cachorro!\");\n dialogo.setNeutralButton(\"Ok\", null);\n dialogo.show();\n\n } else {\n\n int valorDigitado = Integer.parseInt(textoDigitado);\n int resultadoFinal = valorDigitado * 7;\n\n resultadoIdade.setText(\"A idade do cachorro em anos humanos é \" + resultadoFinal + \" ano(s)\");\n\n }\n }", "@Override\n public void onClick(View view) {\n //switch statement to determine which button was cliked\n switch (view.getId()){\n //case when number one was clicked\n case R.id.one:\n //if the the screen shows 0 then we just replace the 0 with 1, and set currentNumber\n if(screen.getText().toString().equals(\"0\")) {\n screen.setText(one.getText().toString());\n currentNumber = one.getText().toString();\n }else{\n //if the screen shows something besides 0, we concatenate whatever was on the\n //screen before plus the 1, and put it on the screen, and update current number\n //accordingly\n screen.setText(screen.getText().toString() + one.getText().toString());\n currentNumber = currentNumber + one.getText().toString();\n }\n break;\n\n //cases two - zero are same as case one except the number changes\n case R.id.two:\n if(screen.getText().toString().equals(\"0\")) {\n screen.setText(two.getText().toString());\n currentNumber = two.getText().toString();\n }else{\n screen.setText(screen.getText().toString() + two.getText().toString());\n currentNumber = currentNumber + two.getText().toString();\n }\n break;\n\n case R.id.three:\n if(screen.getText().toString().equals(\"0\")) {\n screen.setText(three.getText().toString());\n currentNumber = three.getText().toString();\n }else{\n screen.setText(screen.getText().toString() + three.getText().toString());\n currentNumber = currentNumber + three.getText().toString();\n }\n break;\n\n case R.id.four:\n if(screen.getText().toString().equals(\"0\")) {\n screen.setText(four.getText().toString());\n currentNumber = four.getText().toString();\n }else{\n screen.setText(screen.getText().toString() + four.getText().toString());\n currentNumber = currentNumber + four.getText().toString();\n }\n break;\n\n case R.id.five:\n if(screen.getText().toString().equals(\"0\")) {\n screen.setText(five.getText().toString());\n currentNumber = five.getText().toString();\n }else{\n screen.setText(screen.getText().toString() + five.getText().toString());\n currentNumber = currentNumber + five.getText().toString();\n }\n break;\n\n case R.id.six:\n if(screen.getText().toString().equals(\"0\")) {\n screen.setText(six.getText().toString());\n currentNumber = six.getText().toString();\n }else{\n screen.setText(screen.getText().toString() + six.getText().toString());\n currentNumber = currentNumber + six.getText().toString();\n }\n break;\n\n case R.id.seven:\n if(screen.getText().toString().equals(\"0\")) {\n screen.setText(seven.getText().toString());\n currentNumber = seven.getText().toString();\n }else{\n screen.setText(screen.getText().toString() + seven.getText().toString());\n currentNumber = currentNumber + seven.getText().toString();\n }\n break;\n\n case R.id.eight:\n if(screen.getText().toString().equals(\"0\")) {\n screen.setText(eight.getText().toString());\n currentNumber = eight.getText().toString();\n }else{\n screen.setText(screen.getText().toString() + eight.getText().toString());\n currentNumber = currentNumber + eight.getText().toString();\n }\n break;\n\n case R.id.nine:\n if(screen.getText().toString().equals(\"0\")) {\n screen.setText(nine.getText().toString());\n currentNumber = nine.getText().toString();\n }else{\n screen.setText(screen.getText().toString() + nine.getText().toString());\n currentNumber = currentNumber + nine.getText().toString();\n }\n break;\n\n case R.id.zero:\n if(screen.getText().toString().equals(\"0\")) {\n screen.setText(zero.getText().toString());\n currentNumber = zero.getText().toString();\n }else{\n screen.setText(screen.getText().toString() + zero.getText().toString());\n currentNumber = currentNumber + zero.getText().toString();\n\n }\n break;\n\n //case plus, minus, multiply, and divide are very similar, so comments here can be used\n //for all\n //When plus is clicked we will add the current number and plus sign to the numberAndOperands array\n //and update the screen accordingly\n case R.id.plus:\n //if the user is not performing operation on a result of a previous calculation\n //then this if statement will run\n if(!isContinueFromResult) {\n //if current number is not equal to \"\" that means user has a number before this\n //plus sign.\n if(!currentNumber.equals(\"\")) {\n //so we add the currentNumber and the + sign to the array list of Operands\n //and numbers and update the screen accordingly\n numbersAndOperands.add(currentNumber);\n numbersAndOperands.add(\"+\");\n screen.setText(screen.getText().toString() + plus.getText().toString());\n }\n //if the current number is \"\" that means that the user is trying to click an\n //operand right after another operand. So in that case we do the following\n else{\n //replace the last operand with current operand\n String newScreen = screen.getText().toString().substring(0, screen.getText().toString().length() - 1) + \"+\";\n numbersAndOperands.remove(numbersAndOperands.size() - 1);\n numbersAndOperands.add(\"+\");\n screen.setText(newScreen);\n }\n }\n //else means that the user is performing an operation on a result from previous\n //calculations\n else{\n if(!currentNumber.equals(\"\")) {\n numbersAndOperands.add(currentNumber);\n numbersAndOperands.add(\"+\");\n //so instead of updating the screen from what it already had, we update it\n //with current number and the operand, because inside the equals case the\n //current number is being set to the result of calculations\n screen.setText(currentNumber + plus.getText().toString());\n isContinueFromResult = false;\n }\n }\n //in the end we set the current number to \"\" because we want to keep track of\n //when the user is clicking numbers are Operands\n currentNumber = \"\";\n break;\n\n case R.id.minus:\n if(!isContinueFromResult) {\n if(!currentNumber.equals(\"\")) {\n numbersAndOperands.add(currentNumber);\n numbersAndOperands.add(\"-\");\n screen.setText(screen.getText().toString() + minus.getText().toString());\n }else{\n //replace the last operand with current\n String newScreen = screen.getText().toString().substring(0, screen.getText().toString().length() - 1) + \"-\";\n numbersAndOperands.remove(numbersAndOperands.size() - 1);\n numbersAndOperands.add(\"-\");\n screen.setText(newScreen);\n }\n }else {\n if(!currentNumber.equals(\"\")) {\n numbersAndOperands.add(currentNumber);\n numbersAndOperands.add(\"-\");\n screen.setText(currentNumber + minus.getText().toString());\n isContinueFromResult = false;\n }\n }\n currentNumber = \"\";\n break;\n\n case R.id.multiply:\n if(!isContinueFromResult) {\n if(!currentNumber.equals(\"\")) {\n numbersAndOperands.add(currentNumber);\n numbersAndOperands.add(\"*\");\n screen.setText(screen.getText().toString() + multiply.getText().toString());\n }else{\n //replace the last operand with current\n String newScreen = screen.getText().toString().substring(0, screen.getText().toString().length() - 1) + \"*\";\n numbersAndOperands.remove(numbersAndOperands.size() - 1);\n numbersAndOperands.add(\"*\");\n screen.setText(newScreen);\n }\n }else {\n if(!currentNumber.equals(\"\")) {\n numbersAndOperands.add(currentNumber);\n numbersAndOperands.add(\"*\");\n screen.setText(currentNumber + multiply.getText().toString());\n isContinueFromResult = false;\n }\n }\n currentNumber = \"\";\n break;\n\n case R.id.divide:\n if(!isContinueFromResult) {\n if(!currentNumber.equals(\"\")) {\n numbersAndOperands.add(currentNumber);\n numbersAndOperands.add(\"/\");\n screen.setText(screen.getText().toString() + divide.getText().toString());\n }else{\n //replace the last operand with current\n String newScreen = screen.getText().toString().substring(0, screen.getText().toString().length() - 1) + \"/\";\n numbersAndOperands.remove(numbersAndOperands.size() - 1);\n numbersAndOperands.add(\"/\");\n screen.setText(newScreen);\n }\n }else{\n if(!currentNumber.equals(\"\")) {\n numbersAndOperands.add(currentNumber);\n numbersAndOperands.add(\"/\");\n screen.setText(currentNumber + divide.getText().toString());\n isContinueFromResult = false;\n }\n }\n currentNumber = \"\";\n break;\n\n\n\n case R.id.equals:\n //the following if statement will add the last number to the numbersAndOperands array\n if(!currentNumber.equals(\"\")){\n numbersAndOperands.add(currentNumber);\n }\n\n //if the last thing in the array numbersAndOperands is +-*/ that means it is an invalid\n //and we tell the user and it is invalid and do not do any calculations\n if(numbersAndOperands.get(numbersAndOperands.size() - 1).equals(\"+\") ||\n numbersAndOperands.get(numbersAndOperands.size() - 1).equals(\"-\") ||\n numbersAndOperands.get(numbersAndOperands.size() - 1).equals(\"*\") ||\n numbersAndOperands.get(numbersAndOperands.size() - 1).equals(\"/\")){\n Toast.makeText(getActivity(), \"Invalid\", Toast.LENGTH_SHORT).show();\n }\n //When the last thing in the array of numbersAndOperands is a number then we can\n //do the following and calculate the result\n else {\n numbersAndOperands.add(\"=\");\n currentNumber = \"\";\n screen.setText(screen.getText().toString() + equals.getText().toString());\n\n //find all the multiplications and divisions first, and do the calculations\n for (int i = 1; i < numbersAndOperands.size(); i++) {\n if (numbersAndOperands.get(i).equals(\"*\") || numbersAndOperands.get(i).equals(\"/\")) {\n if (numbersAndOperands.get(i).equals(\"*\")) {\n double n1 = Double.parseDouble(numbersAndOperands.get(i - 1));\n double n2 = Double.parseDouble(numbersAndOperands.get(i + 1));\n double result = n1 * n2;\n\n numbersAndOperands.remove(i);\n numbersAndOperands.remove(i);\n numbersAndOperands.remove(i - 1);\n numbersAndOperands.add(i - 1, result + \"\");\n i--;\n\n } else {\n double n1 = Double.parseDouble(numbersAndOperands.get(i - 1));\n double n2 = Double.parseDouble(numbersAndOperands.get(i + 1));\n double result = n1 / n2;\n\n numbersAndOperands.remove(i);\n numbersAndOperands.remove(i);\n numbersAndOperands.remove(i - 1);\n numbersAndOperands.add(i - 1, result + \"\");\n i--;\n }\n }\n }\n\n //find all the plus and minus and do the calculations\n for (int i = 1; i < numbersAndOperands.size(); i++) {\n if (numbersAndOperands.get(i).equals(\"+\") || numbersAndOperands.get(i).equals(\"-\")) {\n if (numbersAndOperands.get(i).equals(\"+\")) {\n double n1 = Double.parseDouble(numbersAndOperands.get(i - 1));\n double n2 = Double.parseDouble(numbersAndOperands.get(i + 1));\n double result = n1 + n2;\n\n numbersAndOperands.remove(i);\n numbersAndOperands.remove(i);\n numbersAndOperands.remove(i - 1);\n numbersAndOperands.add(i - 1, result + \"\");\n i--;\n } else {\n\n double n1 = Double.parseDouble(numbersAndOperands.get(i - 1));\n double n2 = Double.parseDouble(numbersAndOperands.get(i + 1));\n double result = n1 - n2;\n\n numbersAndOperands.remove(i);\n numbersAndOperands.remove(i);\n numbersAndOperands.remove(i - 1);\n numbersAndOperands.add(i - 1, result + \"\");\n i--;\n }\n }\n }\n\n //display the answer and prepare for the next round of the calculations if\n //the user were to perform calculations on the result\n screen.setText(screen.getText().toString() + numbersAndOperands.get(0));\n currentNumber = numbersAndOperands.get(0);\n numbersAndOperands.clear();\n isContinueFromResult = true;\n }\n break;\n\n //here we reset everything we are using to keep track of order of operations and all\n case R.id.clear:\n numbersAndOperands.clear();\n currentNumber = \"0\";\n screen.setText(\"0\");\n break;\n }\n\n\n }", "public int mo19863f() {\n return R.layout.activity_web;\n }", "int getLayoutId();", "@Override\n public void onClick(View v) {\n switch (v.getId()) {\n case R.id.btn_1:\n num = (num*10) + 1;\n break;\n case R.id.btn_2:\n num = (num*10) + 2;\n break;\n case R.id.btn_3:\n num = (num*10) + 3;\n break;\n case R.id.btn_4:\n num = (num*10) + 4;\n break;\n case R.id.btn_5:\n num = (num*10) + 5;\n break;\n case R.id.btn_6:\n num = (num*10) + 6;\n break;\n case R.id.btn_7:\n num = (num*10) + 7;\n break;\n case R.id.btn_8:\n num = (num*10) + 8;\n break;\n case R.id.btn_9:\n num = (num*10) + 9;\n break;\n case R.id.btn_0:\n num = (num*10);\n break;\n case R.id.btn_clr:\n num = 0;\n break;\n case R.id.btn_bck:\n num = num/10;\n break;\n default:\n break;\n }\n\n prepareContactData(num);\n dialerView.setText(String.valueOf(num));\n }", "public int getButton() {\n\t\t//Check what button it is then return the value\n\t\tif (this.isLeftButton)\n\t\t\treturn 0;\n\t\telse if (this.isRightButton)\n\t\t\treturn 1;\n\t\telse if (this.isMiddleButton)\n\t\t\treturn 2;\n\t\telse\n\t\t\treturn -1;\n\t}", "public int getFieldOfView() {\r\n\t\treturn fieldOfView;\r\n\t}", "public View mo75897b(int i) {\n if (this.f51593c == null) {\n this.f51593c = new HashMap();\n }\n View view = (View) this.f51593c.get(Integer.valueOf(i));\n if (view != null) {\n return view;\n }\n View findViewById = findViewById(i);\n this.f51593c.put(Integer.valueOf(i), findViewById);\n return findViewById;\n }", "public void editDoc(View view) {\n Intent intent = new Intent(this, EditActivity.class);\n intent.putExtra(\"text\", doc);\n startActivityForResult(intent, EDIT_DOC);//CTRL+ALT+C per canviar de 0 a una variable\n }", "@Override\n public void onClick(View v) {\n count++;\n TextView countTV = activity.findViewById(R.id.countTV);\n countTV.setText(\"\"+count); // String.valueOf(count)\n }", "public int getPosition()\n {\n return getInt(\"Position\");\n }", "public int getIndexNumber(){\n return id;\r\n }", "@Override\n public void onClick(View v) {\n if(!txtCampo1.getText().toString().equals(\"\")){\n //transformar o valor do campo1 para INTEIRO\n int num1 = Integer.parseInt(txtCampo1.getText().toString());\n int num2 = Integer.parseInt(txtCampo2.getText().toString());\n\n //String.valueOf(numero aqui) = transformar um número em String\n int resultado;\n int[] numeros = {num1, num2};\n resultado = Tools.somarInteiros(numeros);\n\n lblTexto.setText(String.valueOf(resultado));\n\n Tools.exibirMensagem(context,\"Resultado = \" + resultado);\n }\n }", "void onEditItem(E itemElementView);", "@Override\n public void onClick(View view) {\n if (view.getId() == R.id.btnSubmit) {\n tableNum = String.valueOf(textInput.getText());\n Intent intent = new Intent(this, PizzeriaMainActivity.class);\n intent.putExtra(CLE_DONNEES, tableNum);\n startActivity(intent);\n }\n }" ]
[ "0.6991846", "0.6989682", "0.6964724", "0.6630327", "0.66117525", "0.65776676", "0.629829", "0.6221148", "0.61526775", "0.61449313", "0.6061556", "0.60532504", "0.6052917", "0.5997806", "0.5971378", "0.5907438", "0.59045166", "0.5879818", "0.58610225", "0.5826909", "0.5775281", "0.5752189", "0.57358015", "0.5635533", "0.55993724", "0.5592112", "0.558988", "0.5561709", "0.55350626", "0.5533113", "0.5524148", "0.55165243", "0.55133605", "0.55123043", "0.550855", "0.54963076", "0.54829574", "0.5482028", "0.5455651", "0.5454699", "0.54381084", "0.5436947", "0.543421", "0.5432837", "0.54291356", "0.54281306", "0.54190505", "0.54189456", "0.53836966", "0.538322", "0.5381971", "0.5375512", "0.5360247", "0.5358504", "0.5356156", "0.53554493", "0.534974", "0.53397876", "0.53395754", "0.5334889", "0.53321207", "0.5323426", "0.53232193", "0.5317559", "0.5312325", "0.5311542", "0.5310364", "0.5307389", "0.5292746", "0.5292617", "0.5285225", "0.5282703", "0.5282518", "0.5279178", "0.52560955", "0.5239993", "0.5233764", "0.5230084", "0.522394", "0.52131003", "0.5209131", "0.52033436", "0.5195335", "0.51888096", "0.51806283", "0.51795423", "0.5166", "0.5164461", "0.5158192", "0.515695", "0.5156739", "0.51438004", "0.5142935", "0.514002", "0.51352394", "0.5134724", "0.5129175", "0.51290166", "0.5124758", "0.5122453", "0.51188034" ]
0.0
-1
Gets the float from the view (edittext, button,..)
public float toFloat(){ String s = txt().trim(); float i; try{ i = Float.parseFloat(s); }catch(NumberFormatException exp){ exp.printStackTrace(); return 0f; } return i; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "double getFloatingPointField();", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tfloat n1=Float.parseFloat(a.getText().toString());\n\t\t float n2=Float.parseFloat(b.getText().toString());\n\t\t\n\t\t\t\top.setText(String.valueOf(n1/n2));\n\t\t\t}", "@Override\n public float getAmount() {\n return Float.parseFloat(inputAmount.getText());\n }", "public interface FloatView {\n}", "float getValue();", "float getValue();", "float getValue();", "public float readFloat() {\n\t\tif(!isInit) return 0F;\n\t\tfloat result = 0F;\n\t\tisListening = true;\n\t\twriteLine(\"Waiting for Float input...\");\n\t\twhile(isListening) {\n\t\t\ttry {\n\t\t\t\tresult = Float.parseFloat(inputArea.getText());\n\t\t\t} catch(NumberFormatException nfe) {\n\t\t\t\tresult= 0F;\n\t\t\t}\n\t\t}\n\t\tinputArea.setText(\"\");\n\t\twriteLine(\"Input: \" + result);\n\t\treturn result;\n\t}", "public float getFloat(String key)\n {\n return getFloat(key, 0);\n }", "public void mo22486a(@C0193h0 View view, float f) {\n }", "public static float getValueFloat()\n {\n return Util.valueFloat;\n }", "@Override\r\n\tpublic float getFloat(int pos) {\n\t\treturn buffer.getFloat(pos);\r\n\t}", "public float getFieldAsFloat(int tag) {\n return getFieldAsFloat(tag, 0);\n }", "public float get_float() {\n return local_float;\n }", "@Override\n public void onClick(View v) {\n float calculate = Float.valueOf(et_cal.getText().toString().trim());\n Float mutiply = Float.parseFloat(sub);\n\n float x = (float) (calculate * mutiply);\n\n result.setText(calculate+\"\"+\" USD = \"+x+\"\" + \" MMK\");\n date.setText(\"Indicative Rate as on \"+date_time);\n btnOk.setVisibility(View.VISIBLE);\n\n // Toast.makeText(getActivity(),\"work\",Toast.LENGTH_SHORT).show();\n\n\n\n }", "public Float getFloatAttribute();", "protected void calculate(View view ){\n EditText input =(EditText) findViewById(R.id.editText );\n TextView output =(TextView) findViewById(R.id.textViewoutput);\n //process data..\n int base=Integer.valueOf(input.getText().toString());\n int result=base*base;\n String formatedResult=String.format(\"%d\",result);\n //output the result\n output.setText(\"Result:\"+ formatedResult);\n\n\n }", "float getEFloat();", "public float floatValue() {\r\n return (float) intValue();\r\n }", "float getField2();", "@Override\r\n public float floatValue() {\r\n return (float) this.m_current;\r\n }", "public void updateDisplay(View view) {\n if(!EditText_isEmpty(total_bill) && !EditText_isEmpty(tip)) {\n float total_bill_value = Float.valueOf(total_bill.getText().toString());\n float tip_value = Float.valueOf(tip.getText().toString());\n float total_to_pay_value = total_bill_value * (1+tip_value/100);\n total_to_pay.setText(\"$\" + String.format(\"%.2f\", total_to_pay_value));\n\n float total_tip_value = total_bill_value * (tip_value/100);\n total_tip.setText(\"$\" + String.format(\"%.2f\", total_tip_value));\n\n if(!EditText_isEmpty(split_bill)) {\n float split_bill_value = Float.valueOf(split_bill.getText().toString());\n float total_per_person_value = total_to_pay_value/split_bill_value;\n total_per_person.setText(\"$\" + String.format(\"%.2f\", total_per_person_value));\n }\n }\n else {\n total_to_pay.setText(\"\");\n total_tip.setText(\"\");\n total_per_person.setText(\"\");\n }\n }", "private int getValueOfField(int reference){\n Object obj = getView().findViewById(reference);\n if (obj instanceof EditText)\n if (!((EditText) obj).getText().toString().equalsIgnoreCase(\"\"))\n return Integer.parseInt(((EditText) obj).getText().toString());\n else\n return 0;\n else if (obj instanceof Button)\n if (!((Button) obj).getText().toString().equalsIgnoreCase(\"\"))\n return Integer.parseInt(((Button) obj).getText().toString());\n else\n return 0;\n else\n return -1;\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tfloat n1=Float.parseFloat(a.getText().toString());\n\t\t float n2=Float.parseFloat(b.getText().toString());\n\n\t\t\t\top.setText(String.valueOf(n1-n2));\n\t\t\t}", "public Float getFloat(String key)\n\t{\n\t\tDouble d = getDouble(key);\n\t\tif(d == null)\n\t\t\treturn null;\n\t\treturn d.floatValue();\n\t}", "public Float getFloatData(String key) {\n return pref.getFloat(key, 0);\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tfloat n1=Float.parseFloat(a.getText().toString());\n\t\t float n2=Float.parseFloat(b.getText().toString());\n\t\t\n\t\t\t\top.setText(String.valueOf(n1*n2));\n\t\t\t}", "public float getProperty(View view) {\n return view.getScaleX();\n }", "public static float getFloatProperty(String key) {\r\n\t\treturn getFloatProperty(key, 0);\r\n\t}", "@Override\n public void onClick(View v) {\n if (txu.getText().toString().equals(\"\")){\n txu.setText(\"0\");\n }\n\n TextView txu = (TextView) findViewById(R.id.total);\n TextView txtBolus = (TextView) findViewById(R.id.txtBC);\n TextView txtCarbos = (TextView) findViewById(R.id.txtCH);\n TextView textView = (TextView) findViewById(R.id.numcal);\n TextView bolusCorreccion = (TextView) findViewById(R.id.numBC);\n TextView bolusCarbos = (TextView) findViewById(R.id.numCH);\n TextView glucosa = (TextView) findViewById(R.id.input_nombre);\n TextView carbos = (TextView) findViewById(R.id.input_apellido2);\n TextView ratio = (TextView) findViewById(R.id.edit3);\n TextView sensibilidad = (TextView) findViewById(R.id.edit4);\n TextView rango = (TextView) findViewById(R.id.edit5);\n totalCarb = Float.parseFloat(txu.getText().toString());\n glucosaActual = Integer.parseInt(glucosa.getText().toString());\n carbosCons = Integer.parseInt(carbos.getText().toString());\n ratioS = Integer.parseInt(ratio.getText().toString());\n sensibilidadS = Integer.parseInt(sensibilidad.getText().toString());\n rangoS = Integer.parseInt(rango.getText().toString());\n correcion = ((glucosaActual - rangoS)/sensibilidadS);\n ch = (carbosCons +totalCarb) / ratioS;\n total = correcion + ch;\n bolusCorreccion.setText(String.format(\"%.2f\", correcion));\n bolusCarbos.setText(String.format(\"%.2f\", ch));\n textView.setText(String.format(\"%.2f\", total));\n textView.setVisibility(View.VISIBLE);\n bolusCorreccion.setVisibility(View.VISIBLE);\n bolusCarbos.setVisibility(View.VISIBLE);\n txtBolus.setVisibility(View.VISIBLE);\n txtCarbos.setVisibility(View.VISIBLE);\n\n }", "public float getFloat(String key) {\n\t\tfloat defaultValue = 0;\n\t\tif (getDefault(key) != null)\n\t\t\tdefaultValue = (Float) getDefault(key);\n\t\tString sp = internal.getProperty(key);\n\t\tif (sp == null) {\n\t\t\treturn defaultValue;\n\t\t}\n\t\tfloat value;\n\t\ttry {\n\t\t\tvalue = Float.parseFloat(sp);\n\t\t} catch (NumberFormatException ex) {\n\t\t\tsetFloat(key, defaultValue);\n\t\t\treturn defaultValue;\n\t\t}\n\t\treturn value;\n\t}", "public void calculateAndDisplay() {\n fromUnitString = fromUnitEditText.getText().toString();\r\n if (fromUnitString.equals(\"\")) {\r\n fromValue = 0;\r\n }\r\n else {\r\n fromValue = Float.parseFloat(fromUnitString);\r\n }\r\n\r\n // calculate the \"to\" value\r\n toValue = fromValue * ratio;\r\n\r\n // display the results with formatting\r\n NumberFormat number = NumberFormat.getNumberInstance();\r\n number.setMaximumFractionDigits(2);\r\n number.setMinimumFractionDigits(2);\r\n toUnitTextView.setText(number.format(toValue));\r\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_empuxo, container, false);\n\n txtDensidade = (EditText)view.findViewById(R.id.txtEnpuxo1);\n txtVolume = (EditText)view.findViewById(R.id.txtenpuxo2);\n txtGravidade = (EditText)view.findViewById(R.id.txtEnpuxo3);\n txtEnpuxo = (TextView)view.findViewById(R.id.txtenpuxo4);\n btnenpuxo = (Button)view.findViewById(R.id.btnEnpuxo);\n\n btnenpuxo.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view2) {\n float d=0,V=0,g=0,E=0;\n if((txtDensidade.getText().toString().length()>0)&&(txtVolume.getText().toString().length()>0)&&(txtGravidade.getText().toString().length()>0)){\n\n d = Float.parseFloat(txtDensidade.getText().toString());\n V = Float.parseFloat(txtVolume.getText().toString());\n g = Float.parseFloat(txtGravidade.getText().toString());\n E=(d*V*g);\n txtEnpuxo.setText(\"E = \"+E+\"N\");\n }\n }\n });\n\n return view;\n }", "public float getValue()\r\n {\r\n return getSemanticObject().getFloatProperty(swps_floatValue);\r\n }", "public float getAsFloat(){\n return (new Float(getAsCents()) / 100);\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tfloat n1=Float.parseFloat(a.getText().toString());\n\t\t float n2=Float.parseFloat(b.getText().toString());\n\n\t\t\t\top.setText(String.valueOf(n1+n2));\n\t\t\t}", "@Nullable\r\n public Float getFloat(String key) {\r\n return getFloat(key, null);\r\n }", "public abstract float getasFloat(int tuple, int val);", "public float getFloat(int columnIndex) throws SQLException\n {\n return m_rs.getFloat(columnIndex);\n }", "float mo18284b(ViewGroup viewGroup, View view);", "private static float m36210f(View view) {\n if (view == null) {\n return 0.0f;\n }\n return m36211g(view);\n }", "public void calcular(View view) {\n int quilos = Integer.valueOf(editTextQuantidade.getText().toString());\n int total = (quilos *1000)/500;\n \n String message = \"Com \" + quilos + \"kg de chocolate da para fazer \" + total + \" ovos de 500g.\";\n textViewTotal.setText(message);\n }", "protected abstract float getValue(Entity e,FloatTrait t);", "public static Double getDouble(TextView view) {\n Double result;\n if (!isEmpty(view)) {\n try {\n result = Double.parseDouble(getString(view));\n } catch (Exception e) {\n result = null;\n }\n } else {\n result = null;\n }\n return result;\n }", "private JTextField buildFloatTextField() {\r\n final JTextField textField = new JTextField();\r\n textField.setInputVerifier(new FloatTextFieldInputVerifier());\r\n textField.addKeyListener(new FloatTextFieldKeyListener());\r\n textField.addFocusListener(new FocusAdapter() {\r\n public void focusLost(FocusEvent e) {\r\n Object src = e.getSource();\r\n if (src == null)\r\n return;\r\n if (src == textField) {\r\n String fieldValue = textField.getText();\r\n // empty string, no problem we can allow that.\r\n if (\"\".equals(fieldValue)) {\r\n return;\r\n }\r\n float currentValue = Float.parseFloat(fieldValue);\r\n textField.setText(String.valueOf(currentValue));\r\n }\r\n }\r\n });\r\n\r\n return textField;\r\n }", "public float floatValue() {\n return (float) m_value;\n }", "public float getFloat(String subExpression) {\n return (float)getNumber(subExpression);\n }", "final public float getFloatAttr() {\r\n\t\t\tif(mName.length() == 0)\r\n\t\t\t\treturn -1;\r\n\t\t\tif(mSaveAttr == null)\r\n\t\t\t\treturn getAttr(mName).Value;\r\n\t\t\treturn mSaveAttr.Value;\r\n\t\t}", "public abstract float getValue();", "void mo2268a(View view, PointF pointF, float f);", "public final void mo60691a(View view, float f) {\n }", "public float getFloatValue() {\n \t\treturn floatValue;\n \t}", "float mo18281c(ViewGroup viewGroup, View view);", "@Override\n public Float calc() {\n\treturn null;\n }", "float readFloat();", "public void getTip(View v)\n {\n EditText billEditText = (EditText) findViewById(R.id.billEditText);\n EditText percentEditText = (EditText) findViewById(R.id.percentEditText);\n TextView tipTextView = (TextView) findViewById(R.id.tipTextView);\n TextView totalTextView = (TextView) findViewById(R.id.totalTextView);\n\n //get the values from the EditText boxes and convert them to double data types\n double bill = Double.parseDouble(billEditText.getText().toString());\n double percent = Double.parseDouble(percentEditText.getText().toString());\n //double total = Double.parseDouble(totalTextView.getText().toString());\n\n //calculate tip\n percent = percent/100;\n double tip = bill*percent;\n double total = bill + tip;\n\n tipTextView.setText(\"Tip: \" + tip);\n totalTextView.setText(\"Total: \" + total);\n\n\n\n\n }", "@Override\n public String getFormattedValue(float value, Entry entry, int dataSetIndex, ViewPortHandler viewPortHandler) {\n return \"\";\n }", "@Override\n public void onClick(View v) {\n float num1 = 0;\n float num2 = 0;\n float result = 0;\n\n // Проверяем поля на пустоту\n if (TextUtils.isEmpty(etNum1.getText().toString())\n || TextUtils.isEmpty(etNum2.getText().toString())) {\n return;\n }\n\n // читаем EditText и заполняем переменные числами\n num1 = Float.parseFloat(etNum1.getText().toString());\n num2 = Float.parseFloat(etNum2.getText().toString());\n\n // определяем нажатую кнопку и выполняем соответствующую операцию\n // в oper пишем операцию, потом будем использовать в выводе\n switch (v.getId()) {\n case R.id.button:\n oper = \"+\";\n result = num1 + num2;\n break;\n case R.id.button5:\n oper = \"-\";\n result = num1 - num2;\n break;\n case R.id.button6:\n oper = \"*\";\n result = num1 * num2;\n break;\n case R.id.button7:\n oper = \"/\";\n result = num1 / num2;\n break;\n default:\n break;\n }\n\n // формируем строку вывода\n tvResult.setText(num1 + \" \" + oper + \" \" + num2 + \" = \" + result);\n }", "public float toFloat() {\n return this.toFloatArray()[0];\n }", "public Float getValue () {\r\n\t\treturn (Float) getStateHelper().eval(PropertyKeys.value);\r\n\t}", "Double getStartFloat();", "public float floatValue() {\n return this.value;\n }", "Double getTotalFloat();", "public float getFloat(int pos) {\n return Tuples.toFloat(getObject(pos));\n }", "public float floatValue() {\n return (float) value;\n }", "float mo195b(ViewGroup viewGroup, View view);", "public float getFloatValue(float dft)\n {\n return StringTools.parseFloat(this.getValue(), dft);\n }", "static float queryFloat (String prompt)\n\t{\n\t\tString entry ;\n\t\tfloat entryFloat ;\n\t\tSystem.out.print (prompt) ;\n\t\tentry = scanIn.nextLine() ;\n\t\tif (entry.length() == 0)\n\t\t{\n\t\t\tentryFloat = 0f ;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tentryFloat = Float.parseFloat (entry) ;\n\t\t}\n\n\t\treturn entryFloat ;\n\t}", "public void calculateAndDisplay(int position) {\n convertOrigin = conversionEditText.getText().toString();\n float originAmount;\n\n if(convertOrigin.equals(\"\")) {\n originAmount = 0;\n }\n else {\n originAmount = Float.parseFloat(convertOrigin);\n }\n\n switch(position) {\n case 0:\n originAmount * 1.6093;\n break;\n case 1:\n originAmount * 0.6214;\n break;\n case 2:\n originAmount * 2.54;\n break;\n case 3:\n originAmount * 0.3937;\n break;\n default:\n originAmount * 1.6093;\n break;\n }\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_celcius_to_fahrenheit, container, false);\n\n et1 = v.findViewById(R.id.et1);\n btn = v.findViewById(R.id.ftc);\n tv1 = v.findViewById(R.id.tv1);\n tv2 = v.findViewById(R.id.tv2);\n\n Bundle b = getArguments();\n sid = b.getString(\"sid\");\n tv1.setText(sid);\n\n btn.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n f = Float.valueOf(et1.getText().toString());\n c = (f-32) * 5/9;\n tv2.setText(\"\"+c);\n }\n });\n\n return v;\n }", "public Float getFloat(String attr) {\n return (Float) super.get(attr);\n }", "public float getValue() {\n return value_;\n }", "float mo196a(ViewGroup viewGroup, View view);", "public static double getFloat(Tag tag){\n makeInstance();\n return settingsFile.getFloat(tag);\n }", "public Float getFloat(float defaultVal) {\n return get(ContentType.FloatType, defaultVal);\n }", "public float floatValue()\n\t\t{\n\t\t\treturn (float) doubleValue();\n\t\t}", "public float floatValue() {\n return ( (Float) getAllele()).floatValue();\n }", "public float getFloat(String column)\n {\n return FloatType.instance.compose(get(column));\n }", "public synchronized float getProgressFloat() {\n BigDecimal bigDecimal = BigDecimal.valueOf(mProgress);\n return bigDecimal.setScale(mScale, BigDecimal.ROUND_HALF_UP).floatValue();\n }", "private void weightConverter(){\n poundWeight.setOnFocusChangeListener(new View.OnFocusChangeListener() {\n @Override\n public void onFocusChange(View v, boolean hasFocus) {\n if (hasFocus) {\n poundWeight.setHint(\" \");\n }\n }\n });\n\n //change the hint based of slider position\n xmlSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {\n public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n if (isChecked) {\n switchCheck = true;\n poundWeight.setHint(\"Pounds\");\n } else {\n switchCheck = false;\n poundWeight.setHint(\"Kilograms\");\n }\n }\n });\n\n // calculate either pounds or kgs based on slider position\n submit1.setOnClickListener(new View.OnClickListener() {\n public void onClick(View view) {\n\n if (view != null) {\n InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);\n imm.hideSoftInputFromWindow(view.getWindowToken(), 0);\n }\n\n if(!switchCheck) {\n\n poundCalc = Double.valueOf( poundWeight.getText().toString());\n\n convertedWeight = poundCalc * 2.20462;\n\n lastDigit = (int) convertedWeight; // get the last digit as well as the decimals\n\n // show the picture of the weight\n image.setVisibility(View.VISIBLE);\n\n result.setText((df.format(lastDigit)) + \"Lb\" + \"\\n\");\n result.setTextSize(80);\n\n }\n else{\n\n poundCalc = Double.valueOf(poundWeight.getText().toString());\n\n convertedWeight = poundCalc / 2.20462;\n\n lastDigit = (int) convertedWeight; // get the last digit as well as the decimals\n\n // show the picture of the weight\n image.setVisibility(View.VISIBLE);\n\n result.setText((df.format(lastDigit)) + \"Kg\" + \"\\n\");\n result.setTextSize(80);\n }\n\n }\n });\n\n }", "public Float getFloat(final int index) {\n Object returnable = this.get(index);\n if (returnable == null) {\n return null;\n }\n if (returnable instanceof String) {\n /* A String can be used to construct a BigDecimal. */\n returnable = new BigDecimal((String) returnable);\n }\n return ((Number) returnable).floatValue();\n }", "public abstract float read_float();", "public Float getFloat(String key) throws AgentBuilderRuntimeException {\n\t\tif (!extContainsKey(key))\n\t\t\tthrow new AgentBuilderRuntimeException(\n\t\t\t\t\t\"Dictionary does not contain key \\\"\" + key + \"\\\"\");\n\t\treturn (Float) extGet(key);\n\t}", "public float evaluateAsFloat();", "@Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n root_v = inflater.inflate(R.layout.tab_five_sales_calc, container, false);\n\n loaduielements();\n\n\n bt_previous.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n GSTMainActivity.setfrgmnt(3);\n }\n });\n\n bt_add.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n\n GetTextData();\n }\n });\n\n bt_next.setOnClickListener(new View.OnClickListener() {\n @SuppressLint(\"NewApi\")\n @Override\n public void onClick(View v) {\n\n if (addFinalData.size() > 0) {\n sharedPreferenceManager = new SharedPreferenceManager();\n i = 1;\n txt_sr_no.setText(String.valueOf(i));\n\n\n for (int i = 0; i < addFinalData.size(); i++) {\n\n double getAMount = Double.parseDouble(addFinalData.get(i).get(\"f_amount\"));\n Log.e(\"getAMount:\\n \", String.valueOf(getAMount));\n Amount = Amount + getAMount;\n }\n\n Log.e(\"Amount:->> \", String.valueOf(Amount));\n\n txt_after_discount.setText(\"\" + String.valueOf(Amount));\n\n GSTMainActivity.setfrgmnt(5);\n\n } else {\n Warning();\n }\n }\n });\n\n\n Et_rate.addTextChangedListener(new TextWatcher() {\n @Override\n public void beforeTextChanged(CharSequence s, int start, int count, int after) {\n\n }\n\n @Override\n public void onTextChanged(CharSequence s, int start, int before, int count) {\n try {\n\n double qty = Double.parseDouble(Et_qty.getText().toString());\n double rate = Double.parseDouble(Et_rate.getText().toString());\n if (!Et_qty.getText().toString().isEmpty() || !Et_rate.getText().toString().isEmpty()) {\n double calc = qty * rate;\n Txt_amount.setText(\"\" + calc);\n }\n } catch (NumberFormatException e) {\n e.printStackTrace();\n }\n\n }\n\n @Override\n public void afterTextChanged(Editable s) {\n\n }\n });\n\n\n Et_qty.addTextChangedListener(new TextWatcher() {\n @Override\n public void beforeTextChanged(CharSequence s, int start, int count, int after) {\n\n }\n\n @Override\n public void onTextChanged(CharSequence s, int start, int before, int count) {\n try {\n\n double qty = Double.parseDouble(Et_qty.getText().toString());\n double rate = Double.parseDouble(Et_rate.getText().toString());\n\n if (!Et_qty.getText().toString().isEmpty() || !Et_rate.getText().toString().isEmpty()) {\n double calc = qty * rate;\n Txt_amount.setText(\"\" + calc);\n }\n\n } catch (NumberFormatException e) {\n e.printStackTrace();\n }\n\n }\n\n @Override\n public void afterTextChanged(Editable s) {\n\n }\n });\n\n return root_v;\n }", "public float floatValue() {\n\t\treturn (float) mDouble;\n\t}", "public float getVlValor() {\n return vlValor;\n }", "public static double readFloat() {\n return Float.parseFloat(readString());\n }", "final float getFloatPropertyValue(int index) {\n return mFloatValues[index];\n }", "@Override\n public String getFormattedValue(float value, Entry entry, int dataSetIndex, ViewPortHandler viewPortHandler) {\n return mFormat.format((int)value) + \" kcal\"; // e.g. append a dollar-sign\n }", "public float leerFloat() throws IOException\r\n {\r\n return maestro.readFloat(); \r\n }", "@Override\n\tpublic void modifyView(TipCalcModel tipCalcModel) {\n\t\t\tDecimalFormat dFormat=new DecimalFormat(\"#.##\");\n\t\t\tTipCalcView.getInstance().totalTip.setText(String.valueOf(dFormat.format(tipCalcModel.getTotalTip())));\n\t\t\tTipCalcView.getInstance().totalBill.setText(String.valueOf(dFormat.format(tipCalcModel.getTotalBill())));\n\t\t\t\n\t\t\n\t\t\n\t}", "public Float vi(Number number) {\n return Float.valueOf(number.floatValue());\n }", "public void numberEvent(View view) {\n if (isNewOp)\n input.setText(\"\");\n isNewOp = false;\n String number = input.getText().toString();\n switch (view.getId()) {\n case R.id.oneBTN:\n number += \"1\";\n break;\n case R.id.twoBTN:\n number += \"2\";\n break;\n case R.id.threeBTN:\n number += \"3\";\n break;\n case R.id.fourBTN:\n number += \"4\";\n break;\n case R.id.fiveBTN:\n number += \"5\";\n break;\n case R.id.sixBTN:\n number += \"6\";\n break;\n case R.id.sevenBTN:\n number += \"7\";\n break;\n case R.id.eightBTN:\n number += \"8\";\n break;\n case R.id.nineBTN:\n number += \"9\";\n break;\n case R.id.zeroBTN:\n number += \"0\";\n break;\n case R.id.pointBTN:\n number += \".\";\n break;\n }\n input.setText(number);\n }", "public static float readFloat()\n \n {\n float f=0.0f;\n String wort=\"xxxx\";\n try {\n wort=eingabe.readLine();\n f=Float.valueOf(wort).floatValue() ;\n } catch(IOException e1) {\n System.out.println(\"Eingabefehler, bitte noch einmal!\");\n f=readFloat();\n } catch(NumberFormatException e2) {\n if(wort.equals(\"\"))\n System.out.println(\"Bitte etwas eingeben, noch einmal:\");\n else {\n System.out.print(\"Fehler beim Format, \");\n System.out.println(\"bitte noch einmal!\");}\n f=readFloat();\n }\n return f;\n }", "public float getFloatValue(int stNum){\n return Stations[stNum].instruction.dest.floatValue;\r\n }", "@Override\n public float getFloat(String key, float defaultVal) {\n return mSharedPreferences.getFloat(key, defaultVal);\n }", "public float getValue() {\n return value;\n }", "@Override\n public void onClick(View view) {\n switch (view.getId()) {\n /*\n *Caso para botton calcular\n */\n case R.id.calcular_button:\n\n /*\n *Detecto los EditText en XML\n */\n\n etAltura = (EditText) activity.findViewById(R.id.altura_et);\n etPeso = (EditText) activity.findViewById(R.id.peso_et);\n\n /*\n * Defino dos String que captura lo texto introducido en EditText\n */\n String altura = etAltura.getText().toString();\n String peso = etPeso.getText().toString();\n\n /*\n * Si usario no introduce ningun valor entra en bucle.\n * Si usario introduce peso o altura no adecuado entra en bucle.\n */\n if (altura.trim().equals(\"\") || peso.trim().equals(\"\") || Float.parseFloat(altura)< 100\n || Float.parseFloat(altura)>250 || Float.parseFloat(peso)< 20 || Float.parseFloat(peso)>250) {\n Log.d(getClass().getCanonicalName(), \"Preparo Toast: \" + altura + \"(cm)\" + peso+ \"(kg)\");\n\n /*\n * Construyo el Toast Message\n */\n Toast toast=Toast.makeText(activity, R.string.comrueba_peso_altura, Toast.LENGTH_LONG);\n\n /*\n * Defino LinearLayout para poder personalizar el Toast Message\n */\n LinearLayout layout = (LinearLayout) toast.getView();\n\n\n if (layout.getChildCount() > 0) {\n TextView textView = (TextView) layout.getChildAt(0);\n\n /*\n * Personalizo textView. TextAligment center.\n */\n textView.setGravity(Gravity.CENTER_VERTICAL | Gravity.CENTER_HORIZONTAL);\n }\n\n /*\n * El Toast Message aparecera en el centro de pantalla.\n */\n toast.setGravity(Gravity.CENTER, 0,0);\n toast.show();\n return;\n }\n\n /*\n *Si Usario introducido altura y peso adecuado entro en bucle\n */\n if (peso.length() > 0 && altura.length() > 0) {\n Log.d(getClass().getCanonicalName(), \"Preparo Intent: \");\n Intent intent = new Intent(activity, ResultadoActivity.class);\n intent.putExtra(\"PESO\", peso);\n intent.putExtra(\"ALTURA\", altura);\n activity.startActivity(intent);\n }break;\n\n /*\n *Caso para botton Ver Tabla.\n */\n case R.id.ver_tabla_button:\n activity.startActivity(new Intent(activity, TablaActivity.class));\n break;\n /*\n *Caso para botton Volver. Vuelve a Main Activity\n */\n case R.id.volver_button:\n activity.finish();\n break;\n }\n }", "public float getFloatValue() {\n if (getValueIndex() <= 0)\n return 0F;\n return ((FloatEntry) getPool().getEntry(getValueIndex())).getValue();\n }" ]
[ "0.6126889", "0.6118096", "0.60125375", "0.5979316", "0.59422004", "0.59422004", "0.59422004", "0.5941957", "0.5914668", "0.5910378", "0.58565784", "0.5856563", "0.5853361", "0.58476347", "0.5834355", "0.5819245", "0.58111924", "0.5793685", "0.5767068", "0.5766039", "0.5765922", "0.57503265", "0.5743915", "0.5737661", "0.5730565", "0.57273394", "0.5723842", "0.5722495", "0.57130283", "0.5711781", "0.570763", "0.5704402", "0.5703472", "0.5678237", "0.5676311", "0.56707275", "0.5666172", "0.5657787", "0.5653898", "0.5653517", "0.56521666", "0.5647445", "0.5645815", "0.56400144", "0.56342155", "0.5626687", "0.5603176", "0.5596994", "0.5592422", "0.55923533", "0.5589757", "0.5588911", "0.5587753", "0.5585306", "0.5581253", "0.55719227", "0.55694723", "0.5568196", "0.55668414", "0.55654603", "0.556491", "0.5562437", "0.5556515", "0.5552639", "0.55381286", "0.552819", "0.552625", "0.551958", "0.5515685", "0.55074567", "0.5505838", "0.55044234", "0.5503567", "0.5499604", "0.5480995", "0.5480968", "0.5469852", "0.5466243", "0.5456881", "0.54562986", "0.54440415", "0.54428124", "0.5438629", "0.5437542", "0.5436474", "0.54247314", "0.5421442", "0.5418073", "0.54168487", "0.5414271", "0.5413234", "0.5413044", "0.5411518", "0.5411085", "0.5407517", "0.54048866", "0.53999114", "0.5390447", "0.53890073", "0.53872937" ]
0.602824
2
Gets the boolean from the view (edittext, button,..)
public Boolean toBool(){ String s = txt().trim(); Boolean i; try{ i = Boolean.parseBoolean(s); }catch(NumberFormatException exp){ exp.printStackTrace(); return false; } return i; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public java.lang.Boolean getView() {\n return view;\n }", "protected boolean isEdit(){\n\t\treturn getArguments().getBoolean(ARG_KEY_IS_EDIT);\n\t}", "boolean isEdit();", "boolean isInview();", "boolean hasClickView();", "boolean getBoolean();", "boolean getBoolean();", "boolean isEditable();", "public boolean getBoolean();", "@DISPID(-2147417078)\n @PropGet\n boolean isTextEdit();", "public boolean shouldEditButtonBePresent();", "public Byte getIsView() {\n return isView;\n }", "boolean hasActiveView();", "boolean isValid(View view);", "boolean getBoolValue();", "boolean getBoolValue();", "boolean getIsChecked();", "public boolean obtenerSesion(){\n SharedPreferences preferences = getSharedPreferences(STRING_PREFERENCES,MODE_PRIVATE);\n return preferences.getBoolean(PREFERENCE_ESTADO_BUTTON_SESION,false);\n }", "public boolean isViewable()\n {\n return this.isEditable() || this.viewable;\n }", "public Boolean getEditFlag() {\n return editFlag;\n }", "public java.lang.Boolean getEdit() {\n return edit;\n }", "@Override\n public void onClick(View view) {\n switch (view.getId()){\n case R.id.temp_rbt:\n isTemp = true;\n break;\n case R.id.temp_rbf:\n isTemp = false;\n break;\n case R.id.idf_rbt:\n isIdf = true;\n break;\n case R.id.idf_rbf:\n isIdf = false;\n break;\n case R.id.sig_rbt:\n isSig = true;\n break;\n case R.id.sig_rbf:\n isSig = false;\n break;\n case R.id.healthcode_rbt:\n isHcode = true;\n break;\n case R.id.healthcode_rbf:\n isHcode = false;\n break;\n }\n }", "private boolean checkPropertyUpdateView() {\n \t\treturn Boolean.getBoolean(PROPERTY_RIENA_LNF_UPDATE_VIEW);\n \t}", "Boolean getIsEditable() {\n\t\treturn isEditable;\n\t}", "boolean hasSearchTermView();", "public boolean getAButton() {\n\t\treturn getRawButton(A_Button);\n\t}", "boolean hasKeywordView();", "boolean hasFeedPlaceholderView();", "public boolean getBoolean(){\r\n try{return kd.getJSONObject(ug).getBoolean(udn);}\r\n catch(JSONException e){return false;}\r\n }", "abstract public boolean getAsBoolean();", "Boolean getIsPosted();", "boolean getCheckState();", "boolean getValue();", "boolean readBoolean();", "public abstract void checkEditing();", "public abstract boolean read_boolean();", "public boolean isGettersOfBoolean() {\n final boolean result = cbBoolean.getModel().isSelected();\n paramBoolean = result;\n return result;\n }", "public Boolean getreadFlag() {\r\n if(this.getShowFlag()!=null && this.getShowFlag().trim().equalsIgnoreCase(\"NO\")){\r\n return true; \r\n }\r\n else{\r\n return false;\r\n }\r\n }", "public boolean getIsChosen();", "@DSComment(\"ToggleButton, check callbacks modeled\")\n @DSSafe(DSCat.GUI)\n @DSSource({DSSourceKind.SENSITIVE_UNCATEGORIZED})\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:31:45.972 -0500\", hash_original_method = \"6D31016C3EFADAD00849C6FB753C3139\", hash_generated_method = \"94B57183344FE551C5A82AD82F7E846A\")\n \npublic TextView getText1() {\n return mText1;\n }", "public Boolean getCanEdit() {\r\n return getAttributeAsBoolean(\"canEdit\");\r\n }", "boolean contentViewable();", "public boolean isEditable() {\n \treturn model.isEditable();\n }", "public boolean getIsClick() {return isClick;}", "public boolean getButton(XboxController.Button inputButton) {\n\t\treturn this.getRawButton(inputButton.value);\n\t}", "public native boolean isEditable() /*-{\n\t\tvar jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();\n\t\treturn jso.editable;\n }-*/;", "public boolean getAButton() {\n\t\treturn getRawButton(A_BUTTON);\n\t}", "public boolean isCValueEditable();", "boolean hasDisplayKeywordView();", "public boolean buttonNemo(View v) { return (v.getId() == R.id.bestRated); }", "public boolean get() {\n\t\t\tint i = 0; \n\t\t\twhile(i < buttons.length) {\n\t\t\t\tif (!buttons[i].get()) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t}\n\t\t\treturn true;\n\t\t}", "public boolean getPressRV()\n\t{\n\t\treturn pressRV;\n\t}", "@DSComment(\"ToggleButton, check callbacks modeled\")\n @DSSafe(DSCat.GUI)\n @DSSource({DSSourceKind.SENSITIVE_UNCATEGORIZED})\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:31:45.973 -0500\", hash_original_method = \"3E15133DBF34E1DA0E6FF67809AEAC81\", hash_generated_method = \"68589246CEB40B35E20815867173DA1D\")\n \npublic TextView getText2() {\n return mText2;\n }", "boolean get();", "BooleanProperty getOn();", "private static boolean m36208d(View view) {\n return view != null && view.hasWindowFocus();\n }", "@Override\n public boolean isInEditMode() {\n return mEditable;\n }", "@Override\n public boolean isInEditMode() {\n return mEditable;\n }", "public Boolean getBooleanAttribute();", "protected final Boolean getBoolean(final String key) {\n try {\n if (!jo.isNull(key)) {\n return jo.getBoolean(key);\n }\n } catch (JSONException e) {\n }\n return Boolean.FALSE;\n }", "public void euroTrue(View view) {\n euro = true;\n }", "public boolean getSelection () {\r\n\tcheckWidget();\r\n\tif ((style & (SWT.CHECK | SWT.RADIO | SWT.TOGGLE)) == 0) return false;\r\n\treturn (OS.PtWidgetFlags (handle) & OS.Pt_SET) != 0;\r\n}", "public boolean isOkClicked() {\r\n return okClicked;\r\n }", "public boolean isOkClicked() {\r\n return okClicked;\r\n }", "public boolean isOkClicked() {\r\n return okClicked;\r\n }", "public boolean isOkClicked() {\r\n return okClicked;\r\n }", "boolean openPageInEditMode();", "public boolean getEditing() {\r\n return this.editing;\r\n }", "public boolean isOkClicked(){\n\t\treturn okClicked;\n\t}", "boolean hasCallView();", "public boolean getEditando() {\n return this.aluno.getId() != null;\n }", "public final boolean mo5379l() {\n RecyclerView recyclerView = this.f9709b;\n return recyclerView != null && recyclerView.hasFocus();\n }", "public boolean isOkClicked() {\n return okClicked;\n }", "public boolean isOkClicked() {\n return okClicked;\n }", "private boolean isEnableConfigBtn() {\n int count = mAutoItemArray.size();\n for (int i = 0; i < count; i++) {\n ListViewItem item = mAutoItemArray.get(i);\n if (item.mNeedCheckBox && item.mIsChecked) {\n return true;\n }\n }\n return false;\n }", "public boolean getValue();", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tToast.makeText(Test.this, Boolean.toString(tagButton.getStatus()), Toast.LENGTH_SHORT).show();\n\t\t\t}", "public static boolean getButton(int index) {\n\t\treturn SmartDashboard.getBoolean(\"DB/Button \" + index, false);\n\t}", "Boolean getIsAnswered();", "protected abstract boolean onOkClicked();", "void setUserIsActiveEditable(boolean b);", "public boolean isEditable()\n\t{ return editable; }", "org.apache.xmlbeans.XmlBoolean xgetBox();", "@java.lang.Override\n public boolean getBoolValue() {\n if (typeCase_ == 2) {\n return (java.lang.Boolean) type_;\n }\n return false;\n }", "public boolean isEditable()\n {\n return this.editable;\n }", "public Boolean getIsselected() {\n return isselected;\n }", "public Boolean getIsselected() {\n return isselected;\n }", "public EBooleanElements getEBooleanAccess() {\n\t\treturn pEBoolean;\n\t}", "public boolean onKeskeytetty()\n\t{\n\t\treturn keskeytetty;\n\t}", "public TBooleanElements getTBooleanAccess() {\n\t\treturn unknownRuleTBoolean;\n\t}", "public Button getYes() {\n return yes;\n }", "@Nullable\r\n public Boolean getBoolean(String key) {\r\n return getTyped(key, Boolean.class, null);\r\n }", "protected Boolean geBoolValue() {\n return boolValue;\n }", "public Boolean getABoolean()\n {\n return aBoolean;\n }", "@Override\n public void onClick(View view) {\n if (!flag) {\n\n check_passwd_text.setTransformationMethod(SingleLineTransformationMethod.getInstance());\n flag = !flag;\n } else {\n check_passwd_text.setTransformationMethod(PasswordTransformationMethod.getInstance());\n flag = !flag;\n }\n }", "boolean getStartupFocusPref();", "public boolean readBoolean() {\n\t\tif(!isInit) return false;\n\t\tboolean result = false;\n\t\tisListening = true;\n\t\twriteLine(\"Waiting for Boolean input...\");\n\t\twhile(isListening) {\n\t\t\ttry {\n\t\t\t\tresult = Boolean.parseBoolean(inputArea.getText());\n\t\t\t} catch(NumberFormatException nfe) {\n\t\t\t\tresult= false;\n\t\t\t}\n\t\t}\n\t\tinputArea.setText(\"\");\n\t\twriteLine(\"Input: \" + result);\n\t\treturn result;\n\t}", "void onCheckViewedComplete(boolean isViewed);", "public final boolean getEditable() {\n return this.editableProperty().getValue();\n }", "protected boolean getIMEStatus() {\r\n\t\tInputMethodManager inputManager = (InputMethodManager) getSystemService (Context.INPUT_METHOD_SERVICE);\r\n\t\tList<InputMethodInfo> inputMethodInfoList = inputManager.getEnabledInputMethodList();\r\n\t\tString myPackageName = this.getClass().getPackage().getName();\r\n\t\t\r\n\t\tfor (InputMethodInfo i : inputMethodInfoList) {\r\n\t\t if (i.getPackageName().equals(myPackageName))\r\n\t\t \treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public boolean isEditable()\n {\n return editable;\n }" ]
[ "0.66380394", "0.65964305", "0.6550207", "0.6528316", "0.6467529", "0.627373", "0.627373", "0.62289333", "0.6216802", "0.6199609", "0.6183694", "0.615714", "0.6099737", "0.6067814", "0.6039378", "0.6039378", "0.60224235", "0.6005239", "0.5999729", "0.59594613", "0.5953225", "0.5929653", "0.5880501", "0.5875147", "0.58523995", "0.5829706", "0.5801215", "0.57712275", "0.57694614", "0.5768909", "0.5758009", "0.5751336", "0.57495874", "0.5732335", "0.5726009", "0.5717712", "0.57012206", "0.56812966", "0.5680092", "0.56756026", "0.56727964", "0.56689847", "0.56626946", "0.56572616", "0.5655688", "0.5645007", "0.5634554", "0.563242", "0.5628693", "0.562827", "0.5627534", "0.5627243", "0.5621947", "0.56184745", "0.560373", "0.5600403", "0.5597613", "0.5597613", "0.55909", "0.558839", "0.55867296", "0.5579914", "0.55750215", "0.55750215", "0.55750215", "0.55750215", "0.5574283", "0.556276", "0.55576605", "0.55540985", "0.55539984", "0.5552245", "0.5530457", "0.5530457", "0.55202085", "0.55164814", "0.55131394", "0.5512766", "0.5511723", "0.5509153", "0.55064434", "0.55062354", "0.55015683", "0.5492696", "0.54847336", "0.5477842", "0.5477842", "0.54763204", "0.5473894", "0.5473199", "0.5471339", "0.54702866", "0.54674506", "0.5463355", "0.5462592", "0.54599416", "0.54571307", "0.54523325", "0.54509926", "0.5445586", "0.5445042" ]
0.0
-1
Hide the view (Gone)
public S<T> gone(){ ((View)t).setVisibility(View.GONE); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void hide() {\n hidden = true;\n }", "public void hide() {\n visible=false;\n }", "public void hide() {\n\t\thidden = true;\n\t}", "public void hide() {\n // TODO(mschillaci): Add a FrameLayout wrapper so the view can be removed.\n if (mView != null && mView.getVisibility() == View.VISIBLE) {\n Animation animation = getOutAnimation();\n mView.startAnimation(animation);\n mView.setVisibility(View.GONE);\n }\n }", "public void hideIt(){\n this.setVisible(false);\n }", "private void hide() {\n\t}", "void hide();", "@Override\r\n\tpublic void hide() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void hide() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void hide() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void hide() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void hide() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void hide() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void hide() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void hide() {\n\t\t\r\n\t}", "public void hide() {\n super.hide();\n }", "public void hide() {\n }", "@Override\r\n public void hide() {\r\n\r\n }", "@Override\r\n public void hide() {\n }", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\n\t}", "@Override\n\tpublic void hide() {\n\n\t}", "@Override\n\tpublic void hide() {\n\n\t}", "@Override\n\tpublic void hide() {\n\n\t}", "@Override\n\tpublic void hide() {\n\n\t}", "@Override\n\tpublic void hide() {\n\n\t}", "@Override\n\tpublic void hide() {\n\n\t}", "@Override\n\tpublic void hide() {\n\n\t}", "@Override\n\tpublic void hide() {\n\n\t}", "@Override\n\tpublic void hide() {\n\n\t}", "public void hide() {\n\t\tLinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) mContentView\n\t\t\t\t.getLayoutParams();\n\t\tlp.height = 0;\n\t\tmContentView.setLayoutParams(lp);\n\t}", "@Override\n\tpublic void hide() {\n\t}", "@Override\n\tpublic void hide() {\n\t}", "@Override\n\tpublic void hide() {\n\t}", "@Override\n\tpublic void hide() {\n\t}", "@Override\n\tpublic void hide()\n\t{\n\n\t}", "@Override\n\tpublic void hide()\n\t{\n\n\t}", "@Override\n public void hide() {\n\n }", "@Override\n public void hide() {\n\n }", "@Override\n public void hide() {\n\n }", "protected void hideViewContents() {\n\t\tnoData.heightHint = -1;\n\t\tyesData.heightHint = 0;\n\n\t\tnoData.exclude = false;\n\t\tyesData.exclude = true;\n\n\t\tnoLabel.setVisible(true);\n\t\tyesComposite.setVisible(false);\n\t\tredraw();\n\t}", "@Override\r\n\tpublic void hide() {\n\r\n\t}", "@Override\r\n\tpublic void hide() {\n\r\n\t}", "@Override\r\n\tpublic void hide() {\n\r\n\t}", "@Override\r\n\tpublic void hide() {\n\r\n\t}", "@Override\n public void hide() {\n \n }", "@Override\r\n\tpublic void hide() {\n\t\tthis.dispose();\r\n\t\t\r\n\t}", "@Override\n\tpublic void hide() {\n\t\tdispose();\n\n\t}", "@Override\n\tpublic void hide() {\n\t\tdispose();\n\t}", "public void setHide()\n\t{\n\t\tMainController.getInstance().setVisible(name, false);\n\t}", "@Override\n public void hide() {\n mHandler.post(mHide);\n }", "public void hide() {\n \t\tmContext.unregisterReceiver(mHUDController.mConfigChangeReceiver);\n \t\tmHighlighter.hide();\n \t\tmHUDController.hide();\n \t}", "public void hideGebruikersBeheerPanel() {gebruikersBeheerView.setVisible(false);}", "@Override\r\n public void hide() {\r\n dispose();\r\n }", "@Override\n\tpublic void unsetShowing() {\n\t\tshowing = false;\n\t}", "default void hide() { }", "public void hideChat() {\n eventView.setVisible(false);\n }", "@Override\n public void hide() {\n if (!unit.player.isPlayerDead) {\n MyPreference.setIsNewGame(false);\n saves.Save();\n }\n GameController.allFalse();\n dispose();\n }", "@Override\n public void wasHidden() {\n hide();\n }", "public void hide(){\n developmentGroup.setVisible(false);\n }", "@Override\n\tpublic void onHide() {\n\n\t}", "private void anullerAction()\r\n\t{\r\n\t\tthis.hide();\r\n\t}", "void hideNoneParametersView();", "public void hide(){\n background.setOpacity(0);\n text.setOpacity(0);\n }", "public void show() {\n hidden = false;\n }", "public void hide() {\n isVisible = false;\n this.saveBorderColor(Color.BLACK);\n this.setBorderColor(Color.BLACK);\n }", "@Override\n public void makeHidden(Player viewer) {\n \n }", "private void hide() {\n if (inflatedView != null && activityWeakReference != null && activityWeakReference.get() != null) {\n inflatedView.startAnimation(hideAnimation);\n inflatedView = null;\n } else {\n Timber.e(\"Trying to call hide() on a null view InternetIndicatorOverlay.\");\n }\n }", "public void hide() {\n getRoot().hide();\n }", "public void hide() {\r\n\t\tif (item != null) { \r\n\t ShowCaseStandalone.slog(Level.FINEST, \"Hiding showcase: \" + getSHA1());\r\n\t item.remove();\r\n\t \r\n\t int\t\tx\t= getSpawnLocation().getBlockX();\r\n\t int \ty \t= 0;\r\n\t int \tz\t= getSpawnLocation().getBlockZ();\r\n\t World\tw\t= getSpawnLocation().getWorld();\r\n\t \r\n\t item.teleport(new Location(w, x, y, z));\r\n\t\t\titem \t= null;\r\n\t\t}\r\n\t\tisVisible\t= false;\r\n\t}", "@Override\n\tpublic void hide() {\n\t\tGdx.app.log(\"GameScreen\", \"Hidden\");\n\n\t}", "@Override\n\tpublic void unsetVisible() {\n\t\tviewer.setVisible(false);\n\t\tscrollbar.setVisible(false);\n\t}", "private void hideMe() {\n\t\tthis.setVisible(false);\n\t\ttxtName.setText(\"\");\n\t\ttxtEmail.setText(\"\");\n\t\ttxtPhone.setText(\"\");\n\t}", "private void switchToNoContentView() {\n no_content.setVisibility(View.VISIBLE);\n mRecyclerView.setVisibility(View.GONE);\n }", "public void makeInvisible() {\n\t\t\n\t\theadShape.setVisible(false);\n\t\tspine.setVisible(false);\n\t\tleftArmLine.setVisible(false);\n\t\trightArmLine.setVisible(false);\n\t\tleftLegLine.setVisible(false);\n\t\trightLegLine.setVisible(false);\n\t\tplayAgain.setVisible(false);\n\t\trevealLabel.setVisible(false);\n\t\t\n\t\t\n\t}", "public void hide() {\n\t\t// Useless if called in outside animation loop\n\t\tactive = false;\n\t}", "@Override\n\tpublic void hide() {\n\t\tGdx.app.log(\"GameScreen\", \"hide called\"); \n\t}", "@Override\n\tpublic void hide() {\n\t\thits.remove();\n\t\ttimeLeft.remove();\n\t\tdarken.remove();\n\t\tcontainer.remove();\n\t\ttimer = null;\n\t\ttrainingBag = null;\n\t}", "private void hideElements(){\n question.setVisibility(View.GONE);\n yes_for_joke.setVisibility(View.GONE);\n no_for_joke.setVisibility(View.GONE);\n progressBar.setVisibility(View.VISIBLE);\n }", "public void hideScreen() {\n\t}" ]
[ "0.820624", "0.8179247", "0.8142407", "0.81404924", "0.8103188", "0.80699646", "0.80388784", "0.8038414", "0.8038414", "0.8038414", "0.8038414", "0.8038414", "0.8038414", "0.8038414", "0.8038414", "0.803622", "0.8024958", "0.80046374", "0.7950481", "0.7934398", "0.7934398", "0.7934398", "0.7934398", "0.7934398", "0.7934398", "0.7934398", "0.7934398", "0.7934398", "0.7934398", "0.7934398", "0.7934398", "0.7934398", "0.7934398", "0.7934398", "0.7934398", "0.7934398", "0.7934398", "0.7934398", "0.7934398", "0.7934398", "0.7934398", "0.7932483", "0.7932483", "0.7932483", "0.7932483", "0.7932483", "0.7932483", "0.7932483", "0.7932483", "0.7932483", "0.7932483", "0.7905157", "0.78952384", "0.78952384", "0.78952384", "0.78952384", "0.78886986", "0.78886986", "0.7843691", "0.7843691", "0.7843691", "0.78050905", "0.78032744", "0.78032744", "0.78032744", "0.78032744", "0.7795028", "0.77031595", "0.7699899", "0.76970917", "0.76315016", "0.7590233", "0.7517281", "0.7508786", "0.74022543", "0.73987705", "0.7393777", "0.7382513", "0.7379985", "0.7365607", "0.7357146", "0.7312684", "0.7269594", "0.7266384", "0.722517", "0.7224806", "0.7223382", "0.7218465", "0.721191", "0.72006035", "0.7184092", "0.71769583", "0.7152892", "0.7152873", "0.71515757", "0.7144777", "0.71443087", "0.71368", "0.71344763", "0.7091469", "0.7073613" ]
0.0
-1
sets the width of the view in dp
public S<T> widthDp(int width){ ((View)t).getLayoutParams().width = (int) pxToDp(width); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@BindingAdapter({\"layout_width\"})\n public static void setWidth(View view, int width) {\n view.getLayoutParams().width = Math.round(width * view.getContext().getResources().getDisplayMetrics().density);\n }", "void setWidth(int width);", "void setWidth(int width);", "@Before\n public void setDimension() {\n this.view.setDimension(new Dimension(WITDH, HEIGHT));\n }", "public void setWidth(int w)\n {\n width = w;\n }", "public void setWidth(int w){\n \twidth = w;\n }", "void setFitWidth(short width);", "private void setWidth() {\n\n for (int i = 0; i < historicList.size(); i++) {\n RelativeLayout layout = layoutsList.get(i);\n\n ViewGroup.LayoutParams params = layout.getLayoutParams();\n int position = historicList.get(i).position;\n if (position > 4) {\n position = 4;\n } else if (position < 0) {\n position = 0;\n }\n WidthScreen(position, params);\n }\n }", "public int getWidth() {\n return viewWidth;\n }", "public void setWidth(int w) {\n this.width = w;\n }", "public void setWidth(double w)\n { this.widthDefault = w; }", "@Override\n\tpublic void setWidth(float width) {\n\n\t}", "public void setWidth(int w) {\n this.W = w;\n }", "private int viewWidth(View view) {\n view.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);\n return view.getMeasuredWidth();\n }", "public void setWitdh(int newValue)\n {\n width = newValue;\n }", "@Override\r\n\tpublic void setWidth(int width) {\n\t\t\r\n\t}", "public void configure(T aView) { aView.setMinSize(80,22); }", "public void setWidth(int w){ widthRadius = w; }", "public void setWidth(double value) {\n this.width = value;\n }", "public void configure(T aView) { aView.setMinSize(120,60); }", "public void configure(T aView) { aView.setMinSize(120,60); }", "public void configure(T aView) { aView.setMinSize(120,60); }", "public void configure(T aView) { aView.setMinSize(120,60); }", "public void configure(T aView) { aView.setMinSize(120,60); }", "public void configure(T aView) { aView.setMinSize(120,60); }", "public void setWidth(int width) {\n this.width = width;\n }", "public Builder setWidth(int value) {\n \n width_ = value;\n onChanged();\n return this;\n }", "public void setWidth(int w) {\n\t\twidth = w;\n\t}", "public void setWidth(int width)\n {\n this.width = width;\n }", "private void WidthScreen(int position, ViewGroup.LayoutParams params) {\n\n int widthScreen = getWidthScreen();\n\n switch (position) {\n\n case 0:\n params.width = widthScreen / 5;\n break;\n\n case 1:\n params.width = (2 * widthScreen) / 5;\n break;\n case 2:\n params.width = (3 * widthScreen) / 5;\n break;\n case 3:\n params.width = (4 * widthScreen) / 5;\n break;\n case 4:\n params.width = widthScreen;\n break;\n }\n }", "public void configure(T aView) { aView.setMinSize(100,60); }", "public void configure(T aView) { aView.setMinSize(100,60); }", "public void configure(T aView) { aView.setPrefSize(110,20); }", "public void setWidth(int width) {\n\tthis.width = width;\n\tcalculateWidthRatio();\n }", "@Override\n\tprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n int widthSize = MeasureSpec.getSize(widthMeasureSpec);\n// int heightSize = MeasureSpec.getSize(heightMeasureSpec);\n \n setMeasuredDimension(widthSize, widthSize/11);\n\t}", "@Override\n protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n super.onMeasure(widthMeasureSpec, heightMeasureSpec);\n //Snap to width\n setMeasuredDimension(getMeasuredWidth(), getMeasuredWidth());\n }", "@Override\n @SimpleProperty()\n public void Width(int width) {\n if (width == LENGTH_PREFERRED) {\n width = LENGTH_FILL_PARENT;\n }\n super.Width(width);\n }", "public void setWidth(Integer width) {\n this.width = width;\n control.draw();\n }", "@Override\n\tpublic void setWidth(int newWidth) {\n\t\tint width = (int) (newWidth * 0.5);\n\t\tif (width > mainContainer.getMinWidth()) {\n\t\t\tscreenWidth = width;\n\t\t\tmainContainer.setPrefWidth(screenWidth);\n\t\t}\n\t\tcenterScreenX(newWidth);\n\t}", "private void setDimensionesPantalla()\n {\n DisplayMetrics metrics = new DisplayMetrics();\n \n getWindowManager().getDefaultDisplay().getMetrics(metrics);\n mScreenWidth = metrics.widthPixels;\n mScreenHeight = metrics.heightPixels;\n }", "public void setWidth (int width) {\r\n\tcheckWidget();\r\n\tif ((style & SWT.SEPARATOR) == 0) return;\r\n\tif (width < 0) return;\r\n\tOS.PtSetResource (handle, OS.Pt_ARG_WIDTH, width, 0);\r\n\tif (control != null && !control.isDisposed ()) {\r\n\t\tcontrol.setBounds (getBounds ());\r\n\t}\r\n}", "public void setWidth(double width) {\n this.width = width;\n }", "public Builder setWidth(int value) {\n bitField0_ |= 0x00000004;\n width_ = value;\n onChanged();\n return this;\n }", "public void setWidth(double width) {\r\n this.width = width;\r\n }", "public void SetHeightWidth(View view, double width, double height) {\n try {\n if (width == 0) {\n ViewGroup.LayoutParams params = view.getLayoutParams();\n params.height = (int) ((appsingleton.deviceheight) * height);\n } else if (height == 0) {\n ViewGroup.LayoutParams params = view.getLayoutParams();\n params.width = (int) ((appsingleton.devicewidth) * height);\n } else {\n ViewGroup.LayoutParams params = view.getLayoutParams();\n params.width = (int) ((appsingleton.devicewidth) * width);\n params.height = (int) ((appsingleton.deviceheight) * height);\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "@Override\r\n\tpublic int setWidth() {\n\t\treturn 0;\r\n\t}", "public void settings() { size(1200, 800); }", "public abstract int layoutWidth();", "public void setWidth(double width) {\n this.width = width;\n }", "void rootViewSizeChange()\n {\n int rootW = (int) Math.ceil(_rootView.getWidth());\n int rootH = (int) Math.ceil(_rootView.getHeight());\n _canvas.setWidth(rootW*_scale); _canvas.setHeight(rootH*_scale);\n }", "private void setDimension() {\n float videoProportion = getVideoProportion();\n int screenWidth = getResources().getDisplayMetrics().widthPixels;\n int screenHeight = getResources().getDisplayMetrics().heightPixels;\n float screenProportion = (float) screenHeight / (float) screenWidth;\n ViewGroup.LayoutParams lp = mVideoPlayer.getLayoutParams();\n\n if (videoProportion < screenProportion) {\n lp.height = screenHeight;\n lp.width = (int) ((float) screenHeight / videoProportion);\n } else {\n lp.width = screenWidth;\n lp.height = (int) ((float) screenWidth * videoProportion);\n }\n mVideoPlayer.setLayoutParams(lp);\n }", "void setWidthHeight() {\n\t\tsetWidthHeight(getNcols() * grid().gridW, getNvisibleRows() * grid().gridH);\n\t}", "@Override\n\tprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n int widthSize = MeasureSpec.getSize(widthMeasureSpec);\n// int heightSize = MeasureSpec.getSize(heightMeasureSpec);\n \n setMeasuredDimension(widthSize, widthSize/8);\n\t}", "void setMyWidth()\n\t{\n\t\tfor(int i =0 ; i<editRow.getChildCount();i++)\n\t\t{\n\t\t\t\n\t\t\t((EditText)editRow.getChildAt(i)).setMinWidth(colWidth[i]);\n\t\t\t((EditText)editRow.getChildAt(i)).setMaxWidth(colWidth[i]);\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t}", "@Override\n public int width()\n {\n return widthCent; //Charlie Gao helped me debug the issue here\n }", "public void setWidth(final int theWidth) {\n myWidth = theWidth;\n }", "public void setWidth(int newWidth) {\n roomWidth = newWidth;\n }", "public void setWidth(int width) {\n\t\tw = width;\n\t}", "public void setWidth(double w) {\n\t\t\twidth.set(clamp(w, WIDTH_MIN, WIDTH_MAX));\n\t\t}", "@Override\n public int getWidth() {\n return 260;\n }", "public void setWidth(int width) {\n if (width > 0) {\n this.width = width;\n }\n }", "public static void m24643a(View view, int i) {\n if (view != null) {\n LayoutParams layoutParams = view.getLayoutParams();\n if (layoutParams != null) {\n layoutParams.width = i;\n }\n view.requestLayout();\n }\n }", "public void setPrefWidth(double aWidth)\n{\n double w = aWidth<=0? 0 : aWidth; if(w==getPrefWidth()) return;\n firePropertyChange(\"PrefWidth\", put(\"PrefWidth\", w), w, -1);\n}", "public void setWidth( int width ) {\n\t\t_width = width;\n\t}", "public void adjustWidth() {\n int width = Short.MIN_VALUE;\n\n for (final TextBox tb : getAllTextBox()) {\n final int tbWidth = tb.getTextDim().width;\n\n if (tbWidth > width) width = tbWidth; // get the longer content\n }\n\n if (fullWidthStereotype > width) width = fullWidthStereotype;\n\n Change.push(new BufferBounds(this));\n\n setBounds(new Rectangle(\n bounds.x, bounds.y, width + GraphicView.getGridSize() + 15, bounds.height));\n\n Change.push(new BufferBounds(this));\n }", "private void setWindowWidth(int width) {\n this.width = width;\n }", "void setDimension(double width, double height);", "public void setWidth(int width) {\n\t\tthis.width = width;\n\t}", "public void setAutosizing(String aValue) { setLayoutInfo(aValue); }", "public void setWidth(float width) {\n this.xRadius = width/2f;\n }", "private void setWidthAndHeight(View view, int width, int height) {\n ViewGroup.LayoutParams params = view.getLayoutParams();\n if (width >= 0) {\n params.width = width;\n }\n if (height >= 0) {\n params.height = height;\n }\n }", "@Override\n\tprotected float getDrawRatioX(){\n\t\treturn getWidth() / (float)getDefaultTODA() * getRatioOnScreen();\n\t}", "@Override\n int width();", "public int setColumns(int width) {\n\n Display display = getActivity().getWindowManager().getDefaultDisplay();\n DisplayMetrics outMetrics = new DisplayMetrics();\n display.getMetrics(outMetrics);\n\n float density = getResources().getDisplayMetrics().density;\n float dpWidth = outMetrics.widthPixels / density;\n\n return Math.round(dpWidth / width);\n }", "public S<T> width(int width){\n\t\t((View)t).getLayoutParams().width = width;\n\t\treturn this;\n\t}", "public void resetPaddleWidth(){\n myRectangle.setWidth(myLength);\n }", "@Override\n protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n mWidth = getMeasuredDimension(widthMeasureSpec);\n mHeight = getMeasuredDimension(heightMeasureSpec);\n mCanvasSize = Math.min(mWidth, mHeight);\n\n /*Without this your layout will not be inflated\n Here the the width and height parameters are the same that you\n have given in your XML layout\n */\n setMeasuredDimension(mWidth, mHeight);\n }", "@Override\n\tpublic float getPrefWidth() {\n\t\treturn windowSize * 1.2f;\n\t}", "private void setTargetWidth(int width)\r\n\t{\r\n\t\tsynchronized (mMutex)\r\n\t\t{\r\n\t\t\tmTargetWidth = width;\r\n\t\t}\r\n\t}", "@Override\n public int getWidth() {\n return width;\n }", "@Override\n public int getWidth() {\n return width;\n }", "public void setWidth(double width) {\n\t\tthis.width = width;\n\t}", "public void setWidth(double width) {\n\t\tthis.width = width;\n\t}", "public void setRrWidth(int width) {\n rrWidth = width;\n }", "private void setWidth(long value) {\n bitField0_ |= 0x00000004;\n width_ = value;\n }", "public abstract Builder setOutputWidth(int value);", "private void setCurrentWidth(int width)\r\n\t{\r\n\t\tsynchronized (mMutex)\r\n\t\t{\r\n\t\t\tmCurrentWidth = width;\r\n\t\t}\r\n\t}", "private void setUpView(int width, int height){\n addKeyListener(new KeyPadListener());\n setFocusable(true);\n setLayout(null);\n setBounds(0,0,width,height);\n setBackground(new Color(0,0,0,0));\n requestFocus();\n addMouseListener(new MouseCatcher());\n }", "@Override\r\n public void setWidth(String width) {\n }", "public int getWidth() { return width; }", "public int getWidth() { return width; }", "@Override\r\n public int getWidth() {\r\n if(mBaseView != null)\r\n return mBaseView.getWidth();\r\n else\r\n return 0;\r\n }", "@Override\n public void settings(){\n size(500, 500);\n }", "public void setViewPortWidth(double viewPortWidth) {\n this.viewPortWidth = viewPortWidth;\n }", "public void settings() {\r\n size(750, 550);\r\n }", "private float ScreenWidth() {\n RelativeLayout linBoardGame = (RelativeLayout) ((Activity) context).findViewById(R.id.gridContainer);\n Resources r = linBoardGame.getResources();\n DisplayMetrics d = r.getDisplayMetrics();\n return d.widthPixels;\n }", "public int getAdViewWidth() {\n return (tozAdViewWidth);\n }", "@Override\r\n\tprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n\t\tint minw = getPaddingLeft() + getPaddingRight() + getSuggestedMinimumWidth();\r\n\t\tint measuredWidth = resolveSize(minw, widthMeasureSpec);\r\n\r\n\t\tint minh = getPaddingTop() + getPaddingBottom() + getSuggestedMinimumHeight();\r\n\t\tint measuredHeight = resolveSize(minh, heightMeasureSpec);\r\n\t\tsetMeasuredDimension(measuredWidth, measuredHeight);\r\n\t\t// super.onMeasure(widthMeasureSpec, heightMeasureSpec);\r\n\r\n\t}", "public int getWidth(){\n return width;\n }", "public abstract int getDisplayWidth();" ]
[ "0.7352664", "0.69194734", "0.69194734", "0.68703204", "0.68654156", "0.6845199", "0.6812087", "0.6760432", "0.6727031", "0.6710027", "0.6683389", "0.66386974", "0.66368014", "0.6617872", "0.66059834", "0.6581122", "0.65250814", "0.64999616", "0.64828646", "0.6482582", "0.6482582", "0.6482582", "0.6482582", "0.6482582", "0.6482582", "0.6482122", "0.64783746", "0.6472394", "0.6471416", "0.64580435", "0.6445568", "0.6445568", "0.6421646", "0.64066803", "0.6401912", "0.6373331", "0.6373051", "0.6367503", "0.63591075", "0.6335104", "0.6331924", "0.63289535", "0.63158965", "0.6315353", "0.6308343", "0.6297481", "0.62883157", "0.62650007", "0.62327445", "0.62209415", "0.6218523", "0.6209604", "0.61887014", "0.61883897", "0.6183783", "0.618218", "0.61748505", "0.6173475", "0.61552143", "0.61428994", "0.61382353", "0.61364776", "0.61258346", "0.6099221", "0.60949314", "0.60936034", "0.60903955", "0.6090051", "0.6084626", "0.60787666", "0.605778", "0.603388", "0.6029177", "0.60259134", "0.6025479", "0.6018546", "0.60090643", "0.59946233", "0.5989681", "0.5979006", "0.5979006", "0.5967187", "0.5967187", "0.59405375", "0.5937688", "0.5928206", "0.59280074", "0.5921264", "0.58980995", "0.58832633", "0.58832633", "0.5872539", "0.5870796", "0.5870412", "0.58580285", "0.5841104", "0.58385426", "0.5832743", "0.58213484", "0.58165187" ]
0.6872152
3
sets the height of the view in dp
public S<T> heightDp(int height){ ((View)t).getLayoutParams().height = (int) pxToDp(height); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setHeight(int height);", "public void setHeight(int height);", "@BindingAdapter({\"layout_height\"})\n public static void setHeight(View view, int height) {\n view.getLayoutParams().height = Math.round(height * view.getContext().getResources().getDisplayMetrics().density);\n }", "void setHeight(int height);", "void setHeight(int height);", "@Override\n protected void setHeight(Context context, Integer heightInDp) {\n }", "void setHeight(VariableAmount height);", "public void setHeight(int h)\n {\n height = h;\n }", "public void setHeight(int value) {\n this.height = value;\n }", "void setFitHeight(short height);", "public void setHeight(int h) {\n this.H = h;\n }", "public void setHeight(int l){\n \theight = l;\n }", "public void setHeight(double value) {\n this.height = value;\n }", "private void setHeight(float height){\n this.height = height;\n }", "@Override\n\tpublic void setHeight(float height) {\n\n\t}", "public void setHeight(double height){\n h=height;\r\n }", "public abstract int layoutHeight();", "@Override\r\n\tpublic void setHeight(int height) {\n\t\t\r\n\t}", "public void setHeight(int newValue)\n {\n height = newValue;\n }", "@Override\n\t\tpublic void onMeasure (int widthMeasureSpec, int heightMeasureSpec) {\n\t\t\t\n\t\t\tif (isExpanded ()) {\n\t\t\t\t\n\t\t\t\t// Calculate entire height by providing a very large height hint.\n\t\t\t\t// View.MEASURED_SIZE_MASK represents the largest height possible.\n\t\t\t\t\n\t\t\t\tint expandSpec = MeasureSpec.makeMeasureSpec (/*MEASURED_SIZE_MASK*/ 0x00ffffff, MeasureSpec.AT_MOST); // SUPPORT 11\n\t\t\t\t\n\t\t\t\tsuper.onMeasure (widthMeasureSpec, expandSpec);\n\t\t\t\t\n\t\t\t\tViewGroup.LayoutParams params = getLayoutParams ();\n\t\t\t\tparams.height = getMeasuredHeight ();\n\t\t\t\t\n\t\t\t} else super.onMeasure (widthMeasureSpec, heightMeasureSpec);\n\t\t\t\n\t\t}", "public void setHeight(int height) {\n this.height = height;\n }", "default void setHeight(int height) {\n setHeight(VariableAmount.fixed(height));\n }", "@Before\n public void setDimension() {\n this.view.setDimension(new Dimension(WITDH, HEIGHT));\n }", "@Override\r\n\tpublic int setHeight() {\n\t\treturn 0;\r\n\t}", "public void setHeight(int height) {\r\n this.height = height;\r\n }", "public void setHeight(Integer height) {\n this.height = height;\n control.draw();\n }", "private void setRecyclerViewHeight() {\n\n if (isCalculateRVHeight||myRV == null) return;\n\n isCalculateRVHeight = true;\n\n// Get ItemView height\n RecyclerView.LayoutParams layoutParams = (RecyclerView.LayoutParams) myItemView.getLayoutParams();\n// Get ItemView num\n int itemCount = getItemCount();\n int recyclerViewHeight = layoutParams.height*itemCount;\n// Set recyclerView height\n LinearLayout.LayoutParams recyclerViewLayoutParams = (LinearLayout.LayoutParams) myRV.getLayoutParams();\n recyclerViewLayoutParams.height = recyclerViewHeight;\n myRV.setLayoutParams(recyclerViewLayoutParams);\n }", "public Builder setHeight(int value) {\n bitField0_ |= 0x00000008;\n height_ = value;\n onChanged();\n return this;\n }", "public void setHeight(double height) {\n this.height = height;\n }", "public void configure(T aView) { aView.setPrefSize(110,20); }", "public void setHeight(int height) {\n this.height = height;\n }", "public void setHeight(int height) {\n this.height = height;\n }", "@Override\n\tpublic void setHeight(short arg0) {\n\t\t\n\t}", "public void setBestHeight() { setHeight(getBestHeight()); }", "private int viewHeight(View view) {\n view.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);\n return view.getMeasuredHeight();\n }", "public void setHeight(double height) {\r\n this.height = height;\r\n }", "public void setHeight(int h){ heightRadius = h; }", "public void SetHeightWidth(View view, double width, double height) {\n try {\n if (width == 0) {\n ViewGroup.LayoutParams params = view.getLayoutParams();\n params.height = (int) ((appsingleton.deviceheight) * height);\n } else if (height == 0) {\n ViewGroup.LayoutParams params = view.getLayoutParams();\n params.width = (int) ((appsingleton.devicewidth) * height);\n } else {\n ViewGroup.LayoutParams params = view.getLayoutParams();\n params.width = (int) ((appsingleton.devicewidth) * width);\n params.height = (int) ((appsingleton.deviceheight) * height);\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void setHeight(double height) {\n this.height = height;\n }", "public void setHeight(int height) {\r\n\t\tthis.height = height;\r\n\t}", "public void computeHeight() {\n\t\tif (getContext().getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {\n\t\t\tint screenHeight = ScreenUtils.getScreenHeight(getContext());\n\t\t\tif (DisplayHelper.isTabModel(getContext())) {\n\t\t\t\tsetHeight(screenHeight * 3 / 4);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tsetHeight(screenHeight * 4 / 5);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tint screenHeight = ScreenUtils.getScreenHeight(getContext());\n\t\t\tif (DisplayHelper.isTabModel(getContext())) {\n\t\t\t\tsetHeight(screenHeight * 2 / 3);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tsetHeight(screenHeight - 80);\n\t\t\t}\n\t\t}\n\t}", "public void setHeight(int height) {\n\tthis.height = height;\n\tcalculateHeightRatio();\n }", "public abstract int getDisplayHeight();", "@Override\n\tprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n int widthSize = MeasureSpec.getSize(widthMeasureSpec);\n// int heightSize = MeasureSpec.getSize(heightMeasureSpec);\n \n setMeasuredDimension(widthSize, widthSize/8);\n\t}", "@Override\n\tprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n\t\tsuper.onMeasure(widthMeasureSpec, heightMeasureSpec);\n\t\tmScreenHeight=getScreenHeight(getContext());\n\t\theight=getHeight();\n\t\thalfHeight=height/2;\n\t\twrapper=(LinearLayout) this.getChildAt(0);\n\t\tviewGroup1=(ViewGroup) wrapper.getChildAt(0);\n\t\tviewGroup2=(ViewGroup) wrapper.getChildAt(1);\n\t\tviewGroup1.getLayoutParams().height=height;\n\t\tviewGroup2.getLayoutParams().height=height;\n\t}", "public int getHeight() {return height;}", "Builder height(VariableAmount height);", "@Override\n public int getHeight() {\n return height;\n }", "@Override\n public int getHeight() {\n return height;\n }", "private void setHeightInCollapse()\n {\n ViewGroup.LayoutParams icom=incompleteRv.getLayoutParams();\n icom.height=0;\n incompleteRv.setLayoutParams(icom);\n\n ViewGroup.LayoutParams actual=movieRecyclerView.getLayoutParams();\n actual.height = actual.MATCH_PARENT;\n movieRecyclerView.setLayoutParams(actual);\n }", "private void updateMapViewHeight() {\n\t\tint screenHeight = getActivity().getWindowManager().getDefaultDisplay()\n\t\t\t\t.getHeight();\n\n\t\tint coordinatesContainerHeight = 0;\n\t\tif (mEditMode) {\n\t\t\tmDiveSiteCoordinatesEditContainer.measure(MeasureSpec.UNSPECIFIED,\n\t\t\t\t\tMeasureSpec.UNSPECIFIED);\n\t\t\tcoordinatesContainerHeight = mDiveSiteCoordinatesEditContainer\n\t\t\t\t\t.getMeasuredHeight();\n\t\t}\n\n\t\tmMapView.getLayoutParams().height = screenHeight - getTitleBarHeight()\n\t\t\t\t- getStatusBarHeight() - coordinatesContainerHeight\n\t\t\t\t- MAPVIEW_HEIGHT_BUFFER;\n\t}", "public void setHeight(double h) {\n\t\t\theight.set(clamp(h, HEIGHT_MIN, HEIGHT_MAX));\n\t\t}", "@Override\n\tprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n int widthSize = MeasureSpec.getSize(widthMeasureSpec);\n// int heightSize = MeasureSpec.getSize(heightMeasureSpec);\n \n setMeasuredDimension(widthSize, widthSize/11);\n\t}", "int getHeight() {return height;}", "private void setWindowHeight(int height) {\n this.height = height;\n }", "public void setHeight(int height) {\n if (height > 0) {\n this.height = height;\n }\n }", "public void setHeight (int height) {\n if (height < 10) {\n Log.warning(\"Attempted to set a checkbox height of less than 10 pixels.\");\n return;\n }\n\n synchronized (this) {\n this.height = height;\n }\n }", "public int getHeight() { return height; }", "@Override\n protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n heightMeasureSpec = MeasureSpec.makeMeasureSpec(65536,\n MeasureSpec.AT_MOST);\n super.onMeasure(widthMeasureSpec, heightMeasureSpec);\n }", "public void setHeight(int newValue)\r\n {\r\n seatHeight = newValue;\r\n }", "@Override\r\n public int getHeight() {\r\n if(mBaseView != null)\r\n return mBaseView.getHeight();\r\n else\r\n return 0;\r\n }", "default Builder height(int height) {\n return height(VariableAmount.fixed(height));\n }", "public void setHeight(int newValue) {\n seatHeight = newValue;\n }", "public void setViewPortHeight(double viewPortHeight) {\n this.viewPortHeight = viewPortHeight;\n }", "public void setHeight(int height) {\n\t\th = height;\n\t}", "public void setHeight(float height) {\n this.yRadius = 0.5f * height;\n }", "private void setWidthAndHeight(View view, int width, int height) {\n ViewGroup.LayoutParams params = view.getLayoutParams();\n if (width >= 0) {\n params.width = width;\n }\n if (height >= 0) {\n params.height = height;\n }\n }", "public int getHeight() {\n return (int) (this.height * ViewHandlerImpl.getScaleModifier());\n }", "public void setHeight( int height ) {\n\t\t_height = height;\n\t}", "public void setHeight(int height) {\n\t\tthis.height = height;\n\t}", "public void setHeight(int height) {\n\t\tthis.height = height;\n\t}", "@Override\n protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n int width = measureWidth(widthMeasureSpec);\n int height = measureHeight(heightMeasureSpec);\n setMeasuredDimension(width, height);\n }", "public abstract Builder setOutputHeight(int value);", "public void setHeight(int height) {\n int oldValue = mHeight;\n mHeight = height;\n pcs.firePropertyChange(PROP_HEIGHT, oldValue, mHeight);\n }", "public void setCurrentHeight(final int currentHeight);", "public void setHeight(int newHeight) {\n roomHeight = newHeight;\n }", "public void setHeight(double height) {\n\t\tthis.height = height;\n\t}", "public void setHeight(double height) {\n\t\tthis.height = height;\n\t}", "public void setHeight(double height) {\n\t\tthis.height = height;\n\t}", "double getNewHeight();", "public void setItemHeight(int height) {\n if (height == mItemHeight) {\n return;\n }\n// mItemHeight = height;\n// mImageViewLayoutParams = new RelativeLayout.LayoutParams(\n// ViewGroup.LayoutParams.MATCH_PARENT, mItemHeight);\n notifyDataSetChanged();\n }", "private void setHeight(long value) {\n bitField0_ |= 0x00000008;\n height_ = value;\n }", "public void configure(T aView) { aView.setMinSize(80,22); }", "@Override\n public void onGlobalLayout() {\n scrollView.getViewTreeObserver().removeOnGlobalLayoutListener(this);\n\n // Get visible height of scroll view\n Rect rect = new Rect();\n scrollView.getLocalVisibleRect(rect);\n int height = rect.height() - DimensionUtils.dpToPx(16, mActivity);\n\n // Set min height\n layoutContainer.setMinimumHeight(height);\n }", "public void configure(T aView) { aView.setMinSize(120,60); }", "public void configure(T aView) { aView.setMinSize(120,60); }", "public void configure(T aView) { aView.setMinSize(120,60); }", "public void configure(T aView) { aView.setMinSize(120,60); }", "public void configure(T aView) { aView.setMinSize(120,60); }", "public void configure(T aView) { aView.setMinSize(120,60); }", "public void setHeight(Short height) {\r\n this.height = height;\r\n }", "public void setHeight(float top, float bottom) {\n this.top = top;\n this.bottom = bottom;\n }", "public void setHeight(double height) {\n\t\t this.height = height;\n\t }", "@Override\n protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n mWidth = getMeasuredDimension(widthMeasureSpec);\n mHeight = getMeasuredDimension(heightMeasureSpec);\n mCanvasSize = Math.min(mWidth, mHeight);\n\n /*Without this your layout will not be inflated\n Here the the width and height parameters are the same that you\n have given in your XML layout\n */\n setMeasuredDimension(mWidth, mHeight);\n }", "private void setDimension() {\n float videoProportion = getVideoProportion();\n int screenWidth = getResources().getDisplayMetrics().widthPixels;\n int screenHeight = getResources().getDisplayMetrics().heightPixels;\n float screenProportion = (float) screenHeight / (float) screenWidth;\n ViewGroup.LayoutParams lp = mVideoPlayer.getLayoutParams();\n\n if (videoProportion < screenProportion) {\n lp.height = screenHeight;\n lp.width = (int) ((float) screenHeight / videoProportion);\n } else {\n lp.width = screenWidth;\n lp.height = (int) ((float) screenWidth * videoProportion);\n }\n mVideoPlayer.setLayoutParams(lp);\n }", "private void setUpView(int width, int height){\n addKeyListener(new KeyPadListener());\n setFocusable(true);\n setLayout(null);\n setBounds(0,0,width,height);\n setBackground(new Color(0,0,0,0));\n requestFocus();\n addMouseListener(new MouseCatcher());\n }", "int getheight();", "public void configure(T aView) { aView.setMinSize(100,60); }", "public void configure(T aView) { aView.setMinSize(100,60); }", "public void updateHeight() {\n Rectangle repaintBounds = getBounds();\n parent.getScene().paintImmediately(repaintBounds);\n\n // set new height compute while repainting.\n setBounds(new Rectangle(bounds));\n\n parent.getScene().repaint(repaintBounds);\n setChanged();\n notifyObservers();\n }" ]
[ "0.7486779", "0.7486779", "0.73958933", "0.7360908", "0.7360908", "0.7279553", "0.7131601", "0.7094161", "0.7061213", "0.70441824", "0.6919675", "0.6842436", "0.6817453", "0.68128306", "0.67780185", "0.6755641", "0.6747307", "0.6742625", "0.6738597", "0.6735096", "0.6697307", "0.66886306", "0.66828626", "0.6679718", "0.66782904", "0.66655797", "0.66158485", "0.6603676", "0.65977806", "0.65903866", "0.65746903", "0.65746903", "0.65680283", "0.65577924", "0.6557445", "0.6552976", "0.65123653", "0.6488396", "0.6471442", "0.64316696", "0.6408175", "0.63997793", "0.6385067", "0.6364482", "0.63529265", "0.6349672", "0.6346797", "0.6342606", "0.6342606", "0.63312656", "0.6289949", "0.6288981", "0.62862915", "0.62757736", "0.62744826", "0.6272241", "0.62605274", "0.6260258", "0.6256632", "0.6254913", "0.6252158", "0.6243549", "0.62420857", "0.6239823", "0.6239683", "0.6237465", "0.6231377", "0.6230132", "0.62239146", "0.6222869", "0.6222869", "0.6221211", "0.62013775", "0.6200633", "0.6196091", "0.6183193", "0.6182705", "0.6182705", "0.6182705", "0.617425", "0.61665535", "0.61638707", "0.61545545", "0.61529404", "0.61511934", "0.61511934", "0.61511934", "0.61511934", "0.61511934", "0.61511934", "0.61450726", "0.61385936", "0.61347026", "0.61312085", "0.6125481", "0.6124701", "0.6122363", "0.6113703", "0.6113703", "0.6102853" ]
0.669097
21
sets the x of the view in dp
@SuppressLint("NewApi") public S<T> XDp(int x){ ((View)t).setX((int) pxToDp(x)); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setX(float x)\n {\n getBounds().offsetTo(x - positionAnchor.x, getBounds().top);\n notifyParentOfPositionChange();\n conditionallyRelayout();\n }", "@SuppressLint(\"NewApi\")\n\tpublic S<T> X(int x){\n\t\t((View)t).setX(x);\n\t\treturn this;\n\t}", "void setX(int x) {\n position = position.setX(x);\n }", "public void setX(double x)\r\n\t{\t\r\n\t\tvirtualDxfPoint.setTransformationX(x);\r\n\t\tAnchor.setX(x);\r\n\t}", "public void setX(float x) {\r\n\t\tleft = x - width / 2;\r\n\t}", "@Override\n\tpublic void setX(int x) {\n\t\txPos = x;\n\t}", "public void setX(int x){ xPosition = x; }", "public void setX(int x)\n\t{\n\t\tthis.x = x;\t\t\t\t\t\t\t\t\t\t\t\t\t// Update point's x-coordinate\n\t}", "@Override\n\tpublic void setX(int x) {\n\t\t\n\t}", "public int dptopx(float dp){\n final float scale = getActivity().getResources().getDisplayMetrics().density;\n // Convert the dps to pixels, based on density scale\n return ((int) (dp * scale + 0.5f));\n }", "public void setX(float x){\n hitBox.offsetTo(x,hitBox.top);\n //this.x=x;\n }", "@Override\n\tpublic void setX(int x) {\n\n\t}", "public void setX(double d) {\n\t\tthis.x = (int)d;\n\t}", "public Builder setX(int value) {\n \n x_ = value;\n onChanged();\n return this;\n }", "void setX(int newX) {\n this.xPos = newX;\n }", "public PlotPosition setX( double x )\n {\n return setX( x, 1 );\n }", "public void setX(double value) {\n origin.setX(value);\n }", "public void setXCoordinate(int newValue)\n {\n x = newValue;\n }", "public void setStartX(double x)\n {\n startxcoord=x; \n }", "@Override\r\n\tpublic void setX(float x) {\n\t\t\r\n\t}", "public void setX( int x ) {\n\t\t//not checking if x is valid because that depends on the coordinate system\n\t\tthis.x = x;\n\t}", "public void setX(int xpos) {\r\n this.xpos = xpos;\r\n }", "public void setX(double x) {\n this.x = x;\r\n }", "public void setX(int x ){\n if(x>0){\n this.x=x;\n }\n \n }", "public void setX(int x) {\r\n\t\tthis.x = x;\r\n\t}", "public void setX(int x) {\r\n\t\tthis.x = x;\r\n\t}", "public void setX(int x) {\r\n\t\tthis.x = x;\r\n\t}", "public void setX(int x) {\r\n\t\tthis.x = x;\r\n\t}", "public void setX(int x) {\n\tbaseXCoord = x;\n}", "public void setX(double value) {\n this.x = value;\n }", "@Override\n\tpublic void setX(float x) {\n\n\t}", "public void setX(int x){\r\n\t\tthis.x = x;\r\n\t}", "public void setX(int xs)\r\n\t{\r\n\t\tx = xs;\r\n\t}", "public void setX(double d) {\n\t\tthis.x = d;\n\t}", "protected float getX(float x) {\r\n\t\treturn ((x - viewStart.x) * parent.pixelsPerUnit);\r\n\t}", "default void setX(double x)\n {\n getAxis().setX(x);\n }", "public void setX(int x) {\n this.x = x;\r\n }", "public void setDimX (int value)\n {\n m_dim_x = value;\n }", "public void setX(int x) {\n\t\tthis.x = x;\n\t}", "public void setX(int x) {\n\t\tthis.x = x;\n\t}", "public void setX(int x) {\n\t\tthis.x = x;\n\t}", "public void setX(int x) {\n\t\tthis.x = x;\n\t}", "public void setX(int x) {\n\t\tthis.x = x;\n\t}", "public void setX(double x){\n this.x = x;\n }", "public void setX(double x){\n this.x = x;\n }", "public void setPivotX(float f) {\n this.pivotX = f;\n }", "public Builder setPositionX(double value) {\n bitField0_ |= 0x00000008;\n positionX_ = value;\n onChanged();\n return this;\n }", "public void setX(double val) {\r\n\t\t this.xCoord = val;\r\n\t }", "public void setX(double value) {\n\t\tthis.x = value;\n\t}", "public void setX(double value) {\n\t\t\t\tthis.x = value;\n\t\t\t}", "public Builder setX(float value) {\n \n x_ = value;\n onChanged();\n return this;\n }", "public Builder setX(float value) {\n \n x_ = value;\n onChanged();\n return this;\n }", "public Builder setX(float value) {\n \n x_ = value;\n onChanged();\n return this;\n }", "public Builder setPositionX(double value) {\n bitField0_ |= 0x00000004;\n positionX_ = value;\n onChanged();\n return this;\n }", "public void setX(int xPos){\t\t\n\t\tx = new Integer(xPos);\n\t}", "void setX(double x){\r\n\t\tthis.x=x;\r\n\t}", "final void setX(double d) {\n x = d;\n }", "public void setX(double x)\n {\n this.x = x;\n }", "public void setX(int x) {\n\t\tthis.X = x;\n\t}", "public void setX(double x) {\n this.x = x;\n }", "public void setX(double x) {\n this.x = x;\n }", "public void setX(double x) {\n this.x = x;\n }", "public void setX(double point) {\n this.x = point;\n }", "public void setX(double X)\r\n {\r\n curX = X;\r\n }", "public void setX(int x) {\n this.x = x;\n }", "public void setX(int x) {\n this.x = x;\n }", "public void setX(double pX) {\n mX = pX;\n }", "public Builder setPositionX(double value) {\n bitField0_ |= 0x00000040;\n positionX_ = value;\n onChanged();\n return this;\n }", "public void setStartPoint(int x) {\n\t\tthis.x = x;\n\n\t}", "void setPlayerXRelative(int x) {\n }", "void setGridX(int i);", "void setX(float x) {\n _x = x;\n }", "public void setX(double x)\n\t{\n\t\tthis.x = x;\n\t}", "public void setX(int newX)\r\n {\r\n xCoord = newX;\r\n }", "public void setX(double x) {\n\t\tthis.x = x;\n\t}", "public void setStartX(double val) {\r\n startx = val;\r\n }", "private void setXscale() {\n\t}", "public void setX(int x)\r\n {\r\n this.x = x;\r\n }", "public void setX(int x){\n this.x = x;\n }", "public void setX(int x){\n this.x = x;\n }", "public void setX(int x){\n this.x = x;\n }", "public void setX(int x){\n this.x = x;\n }", "@Override\n\tpublic void move_x() {\n\t\tif(mX < 0){\n\t \tdirection *= -1 ;\n\t \t setScale(-1, 1);\n\t }else if (mX > activity.getCameraWidth()-64){\n\t \tdirection *= -1 ;\n\t \tsetScale(1, 1);\n\t } \n\t\tmove_x(direction);\n\t}", "public void setXPosition(double x)\n\t{\n\t\tthis.xPosition = x;\n\t}", "@Model\n\tprotected void advanceX(double dt) throws IllegalArgumentException {\n\t\tif (!isValidDt(dt)) {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\t\n\t\tdouble max_s = maxAdvanceX(dt);\n\t\t// This second formula can be changed, the first one is static.\n\t\tdouble actual_s = maxAdvanceX(dt);\n\t\tdouble newx = getX() + Math.min(max_s, actual_s);\n\t\t\n\t\tsetXWithinBounds(newx);\n\t}", "public void setX(int x)\n {\n this.x = x;\n }", "@Override\n\tpublic void setX(float x) \n\t{\n\t\t_x = x;\n\t}", "private void previewXY() {\n Viewport tempViewport = new Viewport(chart.getMaximumViewport());\n // Make temp viewport smaller.\n float dx = tempViewport.width() / 4;\n float dy = tempViewport.height() / 4;\n tempViewport.inset(dx, dy);\n previewChart.setCurrentViewportWithAnimation(tempViewport);\n }", "public void setX(float x) {\n this.x = x;\n }", "public void setX(int position) {\r\n\t\tif(position<5 && position>=0) {\r\n\t\t\tthis.xcoord = position;\r\n\t\t}\r\n\t\telse {\r\n\t\t\trandomX();\r\n\t\t}\r\n\t}", "public void setX(int x) {\r\n this.x = x;\r\n\r\n this.slot = Slot.fromXY(x, getY());\r\n }", "public void setX(final int x) {\n\n this.x = x;\n }", "protected void setX(final Number x) {\n this.xCoordinate = x;\n }", "@Override\n public void setX(int x) {\n this.x=x;\n }", "public void setX(float x) {\r\n\t\tthis.x = x;\r\n\t}", "public void setCenterX(double x) { centerX.set(clamp(x, X_MIN, X_MAX)); }", "private double xPos(double xMetres){\r\n\t\treturn xMetres*14+canvas.getWidth()/2;\r\n\t}", "public void setFrameX(double anX) { double x = _x + anX - getFrameX(); setX(x); }", "@Override\n\tprotected float getDrawRatioX(){\n\t\treturn getWidth() / (float)getDefaultTODA() * getRatioOnScreen();\n\t}", "public void setXPos(int x) {\n // from MoveEventHandler\n // convert to real x coord\n // x = xP * (xmaxr - xminR) / (xmaxP - xminP)\n double tmp = config.getMaximumRealX() + (x - config.getMaximumPixelX())*(config.getMaximumRealX() - config.getMinimumRealX())/(config.getMaximumPixelX() - config.getMinimumPixelX());\n xpos.setText(formatter.format(tmp));\n }" ]
[ "0.70142853", "0.68526155", "0.682512", "0.66153735", "0.66038585", "0.6542402", "0.6477202", "0.64752156", "0.6442462", "0.6442087", "0.64357173", "0.64302844", "0.64241254", "0.6424014", "0.6419445", "0.64142144", "0.64067715", "0.6406502", "0.6402102", "0.63997936", "0.63881016", "0.6380287", "0.63504994", "0.6345814", "0.6341973", "0.6341973", "0.6341973", "0.6341973", "0.6337397", "0.63373184", "0.6336358", "0.6332772", "0.6332535", "0.6329384", "0.63226306", "0.63207364", "0.63061255", "0.63037235", "0.6294549", "0.6294549", "0.6294549", "0.6294549", "0.6294549", "0.6293893", "0.6293893", "0.62902397", "0.62803936", "0.6278702", "0.626638", "0.6261874", "0.6260852", "0.6260852", "0.6260852", "0.62585634", "0.62584096", "0.62477994", "0.62412727", "0.62383735", "0.6233607", "0.62304425", "0.62304425", "0.62304425", "0.6229299", "0.6206585", "0.6205854", "0.6205854", "0.61908275", "0.6177268", "0.6170181", "0.61589515", "0.6156245", "0.6150328", "0.6119229", "0.61180836", "0.6114508", "0.6103183", "0.6096626", "0.6092843", "0.60860026", "0.60860026", "0.60860026", "0.60860026", "0.6082236", "0.60819024", "0.60765886", "0.60754937", "0.6073061", "0.60724777", "0.6065534", "0.60645026", "0.60336024", "0.6019848", "0.6016331", "0.6015643", "0.6006232", "0.6001608", "0.6000791", "0.59999084", "0.599493", "0.5994726" ]
0.8007961
0
sets the y of the view in dp
@SuppressLint("NewApi") public S<T> YDp(int y){ ((View)t).setY((int) pxToDp(y)); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setY(float y)\n {\n getBounds().offsetTo(getBounds().left, y - positionAnchor.y);\n notifyParentOfPositionChange();\n conditionallyRelayout();\n }", "public void setY(int y){ yPosition = y; }", "void setY(int y) {\n position = position.setY(y);\n }", "@Override\n\tpublic void setY(int y) {\n\t\t\n\t}", "@Override\n\tpublic void setY(int y) {\n\n\t}", "public void setY(int value) {\n this.y = value;\n }", "public void setY(int y) {\n this.y = y;\r\n }", "public void resetY() {this.startY = 11.3f;}", "@Override\n public void setY(int y) {\n this.y=y;\n }", "public void setY(int y){\r\n\t\tthis.y = y;\r\n\t}", "public void setY(int y) {\n this.y = y;\n }", "public void setY(int y) {\n this.y = y;\n }", "public void setY(int y) {\n this.y = y;\n }", "public void setY(int y)\n {\n this.y = y;\n }", "public void setY(double y)\r\n\t{\t\r\n\t\tvirtualDxfPoint.setTransformationY(y);\r\n\t\tAnchor.setY(y);\r\n\t}", "public void setY(int y){\n this.y = y;\n }", "public void setY(int y){\n this.y = y;\n }", "public void setY(int y){\n this.y = y;\n }", "public void setY(int y) {\r\n\t\tthis.y = y;\r\n\t}", "public void setY(int y) {\r\n\t\tthis.y = y;\r\n\t}", "public void setY(int y) {\r\n\t\tthis.y = y;\r\n\t}", "public void setY(int y) {\r\n\t\tthis.y = y;\r\n\t}", "public void setY(int y) { this.y=y; }", "@SuppressLint(\"NewApi\")\n\tpublic S<T> Y(int y){\n\t\t((View)t).setY(y);\n\t\treturn this;\n\t}", "void setY(int y) {\n this.y = y;\n }", "public void setY(int y ){\n if(y>0){\n this.y=y;\n }\n \n }", "public void setY(int y) {\n\t\tthis.y = y;\n\t}", "public void setY(int y) {\n\t\tthis.y = y;\n\t}", "public void setY(int y) {\n\t\tthis.y = y;\n\t}", "public void setY(int y) {\n\t\tthis.y = y;\n\t}", "public void setY(double value) {\n origin.setY(value);\n }", "public void setY(int y) { loc.y = y; }", "public void setY(double value) {\n this.y = value;\n }", "public void setY(int y) {\n\t\tthis.Y = y;\n\t}", "void setY(int newY) {\n this.yPos = newY;\n }", "public void setY(final int y) {\n\n this.y = y;\n }", "@Override\n\tpublic void setY(float y) {\n\n\t}", "@Override\n\tpublic void setY(int y) {\n\t\tyPos = y;\n\t}", "@Override\r\n\tpublic void setY(float y) {\n\t\t\r\n\t}", "public void setY(int y) {\n\tbaseYCoord = y;\n}", "public void setY(int theY)\r\n {\r\n y = theY;\r\n }", "public void setY(int y)\n\t{\n\t\tthis.y = y;\t\t\t\t\t\t\t\t\t\t\t\t\t// Update point's y-coordinate \n\t}", "public void setY(int y) {\r\n this.y = y;\r\n\r\n this.slot = Slot.fromXY(getX(), y);\r\n }", "public void setY(double y){\n this.y = y;\n }", "public void setY(double y){\n this.y = y;\n }", "public void setYCoordinate(int newValue)\n {\n y = newValue;\n }", "public void setY(int y){\n\t\tthis.y_location = y;\n\t}", "public void setY(double y)\n {\n this.y = y;\n }", "public void setY(long y){\n this.y = y;\n }", "public void setY(double y) {\n this.y = y;\r\n }", "public void setY(float y){\n hitBox.offsetTo(hitBox.left,y);\n //this.y=y;\n }", "default void setY(double y)\n {\n getAxis().setY(y);\n }", "public void setY(double val) {\r\n\t\t this.yCoord = val;\r\n\t }", "public void setY(float y){\n this.y = y;\n }", "public void setY(double y) {\n this.y = y;\n }", "public void setY(double y) {\n this.y = y;\n }", "public void setY(double y) {\n this.y = y;\n }", "public void setY(int yPos){\t\t\n\t\ty = new Integer(yPos);\n\t}", "public void setYPosition(double y)\n\t{\n\t\tthis.yPosition = y;\n\t}", "public void setY(int value)\n\t{\n\t\tgetWorldPosition().setY(value);\n\t}", "void setY(double y){\r\n\t\tthis.y=y;\r\n\t}", "public void setYPos(int y) {\n // from MoveEventHandler\n // convert to real y coord\n // y = yP * (ymaxR - yminr) / (ymaxP - yminP)\n double tmp = config.getMaximumRealY() + (y - config.getMaximumPixelY())*(config.getMaximumRealY() - config.getMinimumRealY())/(config.getMaximumPixelY() - config.getMinimumPixelY());\n ypos.setText(formatter.format(tmp));\n }", "public void setY(double d) {\n\t\tthis.y = d;\n\t}", "void setY(float y) {\n _y = y;\n }", "public void setY(double d) {\n\t\tthis.y = (int)d;\n\t}", "public void setY(Double y);", "public double fixY( double y )\n {\n return pageSize.getHeight() - y;\n }", "public void setEndY(double y)\n {\n endycoord=y; \n }", "public PlotPosition setY( double y )\n {\n return setY( y, 1 );\n }", "public void setProgresionY(int i){\n this.ubicacion.y=i;\n }", "public void setY(double pY) {\n mY = pY;\n }", "public Builder setY(float value) {\n \n y_ = value;\n onChanged();\n return this;\n }", "public Builder setY(float value) {\n \n y_ = value;\n onChanged();\n return this;\n }", "public Builder setY(float value) {\n \n y_ = value;\n onChanged();\n return this;\n }", "public void setY(double y)\n\t{\n\t\tthis.y = y;\n\t}", "void scrollToY(int y) {\n double adjustedY = (double) y - scrollButtonTotalHeight;\n double percentage = adjustedY / (pastSize.height - scrollButtonTotalHeight);\n int minimum = getScrollBar().getModel().getMinimum();\n int maximum = getScrollBar().getModel().getMaximum();\n double range = (double) maximum - (double) minimum;\n int modelValue = (int) (percentage * range);\n getScrollBar().getModel().setValue(modelValue);\n }", "protected float getY(float y) {\r\n\t\treturn this.getHeight() - ((y - viewStart.y) * parent.pixelsPerUnit);\r\n\t}", "void setPlayerYRelative(int y) {\n }", "public void setY( int y ) {\n\t\t//not checking if y is valid because that depends on the coordinate system\n\t\tthis.y = y;\n\t}", "@Override\n\tpublic void setY(float y) \n\t{\n\t\t_y = y;\n\t}", "public void setY(float y) {\n this.y = y;\n }", "public void setFrameY(double aY) { double y = _y + aY - getFrameY(); setY(y); }", "public void setY(double y) {\n\t\tthis.y = y;\n\t}", "final void setY(double d) {\n y = d;\n }", "public void updateGridY();", "static void setY(int j) {\n\t\tpx = j;\n\t}", "public void setDimY (int value)\n {\n m_dim_y = value;\n }", "public void setY(int newY)\r\n {\r\n yCoord = newY;\r\n }", "public double getY() { return _height<0? _y + _height : _y; }", "public void changeHeight(double y)\r\n {\n }", "public void setY(double point) {\n this.y = point;\n }", "public void setStartY(double y)\n {\n startycoord=y; \n }", "public void setY( double Y)\r\n {\r\n curY = Y;\r\n }", "public void setY(int ys)\r\n\t{\r\n\t\ty = ys;\r\n\t}", "public void setY(float y) {\r\n\t\tthis.y = y;\r\n\t}", "void setY(final Number y) {\n this.yCoordinate = y;\n }", "public void setYCoordinates(double newY) { this.yCoordinates = newY; }", "@Override\n\tpublic void setHeight(int y) {\n\t\tdelegate.setHeight(y);\n\t}", "public void setExtendedY(float y) {\n mMaximumTop = (int) y;\n }", "@Override\n\tpublic void setOffsetY(int y)\n\t{\n\t}" ]
[ "0.716626", "0.7061205", "0.70486754", "0.70124483", "0.7011362", "0.6949926", "0.6932716", "0.6895207", "0.6889294", "0.6888065", "0.68788314", "0.68788314", "0.68788314", "0.68756527", "0.6862392", "0.68594366", "0.68594366", "0.68594366", "0.6841113", "0.6841113", "0.6841113", "0.6841113", "0.6834566", "0.6809372", "0.67820585", "0.677265", "0.67476684", "0.67476684", "0.67476684", "0.67476684", "0.67307705", "0.6698487", "0.6692372", "0.6688633", "0.66833735", "0.66784763", "0.66757435", "0.6655403", "0.66519356", "0.66490424", "0.66448", "0.6639909", "0.66382384", "0.6621432", "0.6621432", "0.66192", "0.66074663", "0.6586359", "0.65815854", "0.6580852", "0.656769", "0.65454966", "0.6535808", "0.65313756", "0.6528145", "0.6528145", "0.6528145", "0.6517585", "0.65164465", "0.6514905", "0.65136653", "0.6512859", "0.650776", "0.65071344", "0.6506759", "0.6493429", "0.6483918", "0.64728796", "0.6471459", "0.6468668", "0.64588493", "0.64338285", "0.64338285", "0.64338285", "0.64315504", "0.6430521", "0.6421818", "0.64162105", "0.6414528", "0.64065737", "0.63952297", "0.63928366", "0.6386566", "0.63846487", "0.6377244", "0.6374915", "0.63718563", "0.63673246", "0.6366319", "0.63571984", "0.6354125", "0.6335389", "0.6334591", "0.6329693", "0.6314931", "0.62928474", "0.628892", "0.62830687", "0.62687653", "0.62633026" ]
0.7735487
0
sets the width of the view in px
public S<T> width(int width){ ((View)t).getLayoutParams().width = width; return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void setWidth(int width);", "void setWidth(int width);", "public void setWidth(int w){\n \twidth = w;\n }", "public void setWidth(int w)\n {\n width = w;\n }", "public void setWidth(int w) {\n this.width = w;\n }", "@BindingAdapter({\"layout_width\"})\n public static void setWidth(View view, int width) {\n view.getLayoutParams().width = Math.round(width * view.getContext().getResources().getDisplayMetrics().density);\n }", "@Override\r\n\tpublic void setWidth(int width) {\n\t\t\r\n\t}", "public void setWidth(int width)\n {\n this.width = width;\n }", "public void setWidth(int width) {\n this.width = width;\n }", "public void setWidth(int w) {\n this.W = w;\n }", "@Override\n\tpublic void setWidth(float width) {\n\n\t}", "public void setWidth(int width) {\n\tthis.width = width;\n\tcalculateWidthRatio();\n }", "private void setWindowWidth(int width) {\n this.width = width;\n }", "public void setWidth(int w) {\n\t\twidth = w;\n\t}", "public void setWidth(final int theWidth) {\n myWidth = theWidth;\n }", "@Override\n\tpublic void setWidth(int newWidth) {\n\t\tint width = (int) (newWidth * 0.5);\n\t\tif (width > mainContainer.getMinWidth()) {\n\t\t\tscreenWidth = width;\n\t\t\tmainContainer.setPrefWidth(screenWidth);\n\t\t}\n\t\tcenterScreenX(newWidth);\n\t}", "public void setWidth(int width) {\n\t\tw = width;\n\t}", "public void setWidth(double w)\n { this.widthDefault = w; }", "private void setWidth() {\n\n for (int i = 0; i < historicList.size(); i++) {\n RelativeLayout layout = layoutsList.get(i);\n\n ViewGroup.LayoutParams params = layout.getLayoutParams();\n int position = historicList.get(i).position;\n if (position > 4) {\n position = 4;\n } else if (position < 0) {\n position = 0;\n }\n WidthScreen(position, params);\n }\n }", "public void setWidth(Integer width) {\n this.width = width;\n control.draw();\n }", "public void setWidth(int width) {\n if (width > 0) {\n this.width = width;\n }\n }", "public void setWidth( int width ) {\n\t\t_width = width;\n\t}", "public void setWidth(double width) {\r\n this.width = width;\r\n }", "public void setWidth(int width) {\n\t\tthis.width = width;\n\t}", "public void setWidth(double width) {\n this.width = width;\n }", "public Builder setWidth(int value) {\n \n width_ = value;\n onChanged();\n return this;\n }", "public int getWidth() {\n return viewWidth;\n }", "public void setWidth(double width) {\n this.width = width;\n }", "public void setWidth(double value) {\n this.width = value;\n }", "public void setWitdh(int newValue)\n {\n width = newValue;\n }", "public void setWidth(int w){ widthRadius = w; }", "public void setWidth (int width) {\r\n\tcheckWidget();\r\n\tif ((style & SWT.SEPARATOR) == 0) return;\r\n\tif (width < 0) return;\r\n\tOS.PtSetResource (handle, OS.Pt_ARG_WIDTH, width, 0);\r\n\tif (control != null && !control.isDisposed ()) {\r\n\t\tcontrol.setBounds (getBounds ());\r\n\t}\r\n}", "@Override\r\n\tpublic int setWidth() {\n\t\treturn 0;\r\n\t}", "void setFitWidth(short width);", "public void setWidth(int newWidth) {\n roomWidth = newWidth;\n }", "public void setWidth(Integer width)\n {\n getStateHelper().put(PropertyKeys.width, width);\n }", "public void setWidth(float width) {\n this.xRadius = width/2f;\n }", "@JsProperty\n public void setWidth(int width);", "public void setWidth(double width) {\n\t\tthis.width = width;\n\t}", "public void setWidth(double width) {\n\t\tthis.width = width;\n\t}", "public void setWidth(Integer width) {\n\t\tthis.width = width;\n\t\tthis.handleConfig(\"width\", width);\n\t}", "private void setCurrentWidth(int width)\r\n\t{\r\n\t\tsynchronized (mMutex)\r\n\t\t{\r\n\t\t\tmCurrentWidth = width;\r\n\t\t}\r\n\t}", "public Builder setWidth(int value) {\n bitField0_ |= 0x00000004;\n width_ = value;\n onChanged();\n return this;\n }", "@Before\n public void setDimension() {\n this.view.setDimension(new Dimension(WITDH, HEIGHT));\n }", "public void setWidth(double w) {\n\t\t\twidth.set(clamp(w, WIDTH_MIN, WIDTH_MAX));\n\t\t}", "@Override\r\n public void setWidth(String width) {\n }", "public final native void setWidth(double width) /*-{\n this.setWidth(width);\n }-*/;", "@Override\n @SimpleProperty()\n public void Width(int width) {\n if (width == LENGTH_PREFERRED) {\n width = LENGTH_FILL_PARENT;\n }\n super.Width(width);\n }", "public void setWidth(final String value)\n {\n width = value;\n }", "@Override\n public int width()\n {\n return widthCent; //Charlie Gao helped me debug the issue here\n }", "private void setTargetWidth(int width)\r\n\t{\r\n\t\tsynchronized (mMutex)\r\n\t\t{\r\n\t\t\tmTargetWidth = width;\r\n\t\t}\r\n\t}", "@Override\n public int getWidth() {\n return width;\n }", "@Override\n public int getWidth() {\n return width;\n }", "public S<T> widthDp(int width){\n\t\t((View)t).getLayoutParams().width = (int) pxToDp(width);\n\t\treturn this;\n\t}", "public void setWidth(String width) {\r\n this.width = width;\r\n }", "void setWidthHeight() {\n\t\tsetWidthHeight(getNcols() * grid().gridW, getNvisibleRows() * grid().gridH);\n\t}", "public void setCurrentWidth(final int currentWidth);", "@Override\n int width();", "public void setPrefWidth(double aWidth)\n{\n double w = aWidth<=0? 0 : aWidth; if(w==getPrefWidth()) return;\n firePropertyChange(\"PrefWidth\", put(\"PrefWidth\", w), w, -1);\n}", "public void setWidth( int width )\n {\n int charWidth = ChatMenuAPI.getCharacterWidth( getCharacter( ) );\n length = width / charWidth;\n }", "public void setWidth(int width) {\n\t\tif (width <= 0)\n\t\t\tthrow new IllegalArgumentException(\"width must be > 0\");\n\n\t\tthis.width = width;\n\t}", "public void setRrWidth(int width) {\n rrWidth = width;\n }", "void setMyWidth()\n\t{\n\t\tfor(int i =0 ; i<editRow.getChildCount();i++)\n\t\t{\n\t\t\t\n\t\t\t((EditText)editRow.getChildAt(i)).setMinWidth(colWidth[i]);\n\t\t\t((EditText)editRow.getChildAt(i)).setMaxWidth(colWidth[i]);\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t}", "public void setWidth(final int width) {\n\t\tthis.width = width;\n\t\tthis.widthString = \"%-\" + width + \"s\";\n\t}", "public int getWidth() { return width; }", "public int getWidth() { return width; }", "public void updateWidth() {\n\t\t// Update width\n\t\tif (this.getFamily() != null) {\n\t\t\tthis.getFamily().updateFamilyWidth();\n\t\t\tthis.setWidth(this.getFamily().getWidth()\n\t\t\t\t\t+ this.getFamily().getNextWidth());\n\t\t} else {\n\t\t\tthis.setWidth(1);\n\t\t}\n\t}", "public int getWidth(){\n return width;\n }", "public void setTrackWidth(int width){\n this.mTrackWidth = Utils.dp2px(mContext, width);\n progressPaint.setStrokeWidth(width);\n updateTheTrack();\n refreshTheView();\n }", "public void setWidth(Double width) {\n\t\tthis.width = width;\n\t}", "public int getWidth(){\n return width;\n }", "public void setWidth(int width) {\n this.width = width;\n this.rightEdge = RRConstants.getRightEdge(width);\n }", "private int viewWidth(View view) {\n view.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);\n return view.getMeasuredWidth();\n }", "public int getWidth(){\n \treturn width;\n }", "public int getWidth()\n {return width;}", "public void setRefreshWidth(int width) {\n if (width > 0) {\n m_userRefreshWidth = width;\n }\n }", "private void WidthScreen(int position, ViewGroup.LayoutParams params) {\n\n int widthScreen = getWidthScreen();\n\n switch (position) {\n\n case 0:\n params.width = widthScreen / 5;\n break;\n\n case 1:\n params.width = (2 * widthScreen) / 5;\n break;\n case 2:\n params.width = (3 * widthScreen) / 5;\n break;\n case 3:\n params.width = (4 * widthScreen) / 5;\n break;\n case 4:\n params.width = widthScreen;\n break;\n }\n }", "int getWidth() {return width;}", "public int width() {\n \treturn width;\n }", "public void settings() { size(1200, 800); }", "private void setWidth(long value) {\n bitField0_ |= 0x00000004;\n width_ = value;\n }", "public Builder setWidth(long value) {\n copyOnWrite();\n instance.setWidth(value);\n return this;\n }", "public void adjustWidth() {\n int width = Short.MIN_VALUE;\n\n for (final TextBox tb : getAllTextBox()) {\n final int tbWidth = tb.getTextDim().width;\n\n if (tbWidth > width) width = tbWidth; // get the longer content\n }\n\n if (fullWidthStereotype > width) width = fullWidthStereotype;\n\n Change.push(new BufferBounds(this));\n\n setBounds(new Rectangle(\n bounds.x, bounds.y, width + GraphicView.getGridSize() + 15, bounds.height));\n\n Change.push(new BufferBounds(this));\n }", "@Override\n public int getWidth() {\n return 260;\n }", "public void setCameraWidth(float width) {\n setValueInTransaction(PROP_CAMERA_WIDTH, width);\n }", "public void setMinWidth(double aWidth)\n{\n double w = aWidth<=0? 0 : aWidth; if(w==getMinWidth()) return;\n firePropertyChange(\"MinWidth\", put(\"MinWidth\", w), w, -1);\n}", "public void setWidth(int width) {\n if(width < 0) throw new NegativeSizeException(\"Negative width\");\n \tthis.width = width;\n }", "@Override\n\tpublic int getWidth() {\n\t\treturn windowWidth;\n\t}", "public void updateMainViewWidth(int width) {\n mRecyclerViewWidth = width;\n }", "public final int getWidth(){\n return width_;\n }", "public void setViewPortWidth(double viewPortWidth) {\n this.viewPortWidth = viewPortWidth;\n }", "public void setClientWidth(Integer clientWidth) {\n this.clientWidth = clientWidth;\n }", "public int getWidth() {\n return width;\n }", "public int getWidth() {\n return width;\n }", "public void setMinWidth(int width) {\n setMinSize(width, minHeight);\n }", "public void setTrackWidth(int width) {\n invalidateRect.set(thumbOffset.getPointXToInt() - thumbCurvature, 0, thumbOffset.getPointXToInt() + thumbWidth, recyclerView.getHeight());\n trackWidth = width;\n updateThumbPath();\n invalidateRect.fuse(thumbOffset.getPointXToInt() - thumbCurvature, 0, thumbOffset.getPointXToInt() + thumbWidth, recyclerView.getHeight());\n recyclerView.invalidate();\n }", "public int getWidth() {\r\n return width;\r\n }", "public void setWidth(int n){ // Setter method\n \n width = n; // set the class attribute (variable) radius equal to num\n }", "public abstract int layoutWidth();", "public void changeFrameWidth(int frameWidth) {\r\n ViewGroup.LayoutParams params = gameFrame.getLayoutParams();\r\n params.width = frameWidth;\r\n gameFrame.setLayoutParams(params);\r\n }" ]
[ "0.79522747", "0.79522747", "0.7942926", "0.7894188", "0.7721916", "0.77111584", "0.76561964", "0.7641702", "0.7640195", "0.76195896", "0.7611326", "0.7599909", "0.7576342", "0.754246", "0.7445078", "0.74264705", "0.7416549", "0.73970497", "0.7383697", "0.73784065", "0.7362781", "0.7341321", "0.7326414", "0.7310467", "0.7306492", "0.7298016", "0.7262452", "0.72494566", "0.72207147", "0.7206116", "0.7167332", "0.71334267", "0.70874226", "0.70868665", "0.70686865", "0.7051104", "0.70478106", "0.70374966", "0.7014249", "0.7014249", "0.7012569", "0.6999775", "0.69900423", "0.69772345", "0.69549066", "0.69518673", "0.6822294", "0.681523", "0.6796226", "0.6782604", "0.6766671", "0.67596257", "0.67596257", "0.67531055", "0.6751306", "0.67499983", "0.6739197", "0.67382145", "0.67179316", "0.6697165", "0.66759115", "0.66733295", "0.6656213", "0.665348", "0.665094", "0.665094", "0.66449165", "0.66446567", "0.6644325", "0.66390324", "0.663579", "0.66218853", "0.66033536", "0.659322", "0.65872574", "0.65830487", "0.6580021", "0.65672415", "0.6546181", "0.65411526", "0.65333176", "0.6530998", "0.65285397", "0.6517419", "0.6511742", "0.65003836", "0.648104", "0.6454164", "0.64528126", "0.64465255", "0.643443", "0.64325684", "0.64265656", "0.64265656", "0.64087677", "0.64037776", "0.64013076", "0.6400167", "0.63902664", "0.6389302" ]
0.71198136
32
sets the height of the view in px
public S<T> height(int height){ ((View)t).getLayoutParams().height = height; return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setHeight(int height);", "public void setHeight(int height);", "void setHeight(int height);", "void setHeight(int height);", "public void setHeight(int h)\n {\n height = h;\n }", "public void setHeight(int value) {\n this.height = value;\n }", "public void setHeight(int h) {\n this.H = h;\n }", "private void setHeight(float height){\n this.height = height;\n }", "void setHeight(VariableAmount height);", "@Override\r\n\tpublic void setHeight(int height) {\n\t\t\r\n\t}", "public void setHeight(int height) {\n this.height = height;\n }", "public void setHeight(int height) {\r\n this.height = height;\r\n }", "@BindingAdapter({\"layout_height\"})\n public static void setHeight(View view, int height) {\n view.getLayoutParams().height = Math.round(height * view.getContext().getResources().getDisplayMetrics().density);\n }", "public void setHeight(int l){\n \theight = l;\n }", "public void setHeight(int height) {\n this.height = height;\n }", "public void setHeight(int height) {\n this.height = height;\n }", "public void setHeight(double value) {\n this.height = value;\n }", "public void setHeight(double height){\n h=height;\r\n }", "public void setHeight(int newValue)\n {\n height = newValue;\n }", "@Override\n\tpublic void setHeight(float height) {\n\n\t}", "default void setHeight(int height) {\n setHeight(VariableAmount.fixed(height));\n }", "public void setHeight(Integer height) {\n this.height = height;\n control.draw();\n }", "public void setHeight(double height) {\n this.height = height;\n }", "@Override\r\n\tpublic int setHeight() {\n\t\treturn 0;\r\n\t}", "public void setHeight(double height) {\r\n this.height = height;\r\n }", "public void setHeight(int height) {\r\n\t\tthis.height = height;\r\n\t}", "@Override\n protected void setHeight(Context context, Integer heightInDp) {\n }", "public void setHeight(double height) {\n this.height = height;\n }", "private void setWindowHeight(int height) {\n this.height = height;\n }", "public Builder setHeight(int value) {\n bitField0_ |= 0x00000008;\n height_ = value;\n onChanged();\n return this;\n }", "@Override\n\tpublic void setHeight(short arg0) {\n\t\t\n\t}", "public void setHeight( int height ) {\n\t\t_height = height;\n\t}", "public void setHeight(int height) {\n\t\th = height;\n\t}", "public void setHeight(int height) {\n if (height > 0) {\n this.height = height;\n }\n }", "public void setHeight(int height) {\n\tthis.height = height;\n\tcalculateHeightRatio();\n }", "public void setHeight(int height) {\n\t\tthis.height = height;\n\t}", "public void setHeight(int height) {\n\t\tthis.height = height;\n\t}", "@Override\n public int getHeight() {\n return height;\n }", "@Override\n public int getHeight() {\n return height;\n }", "public void setHeight(int height) {\n int oldValue = mHeight;\n mHeight = height;\n pcs.firePropertyChange(PROP_HEIGHT, oldValue, mHeight);\n }", "public void setHeight(double height) {\n\t\tthis.height = height;\n\t}", "public void setHeight(double height) {\n\t\tthis.height = height;\n\t}", "public void setHeight(double height) {\n\t\tthis.height = height;\n\t}", "public void setHeight(double height) {\n\t\t this.height = height;\n\t }", "public void setHeight (int height) {\n if (height < 10) {\n Log.warning(\"Attempted to set a checkbox height of less than 10 pixels.\");\n return;\n }\n\n synchronized (this) {\n this.height = height;\n }\n }", "public void setCurrentHeight(final int currentHeight);", "void setFitHeight(short height);", "public int getHeight() {return height;}", "public void setHeight(Integer height)\n {\n getStateHelper().put(PropertyKeys.height, height);\n }", "public void setHeight(int h){ heightRadius = h; }", "public void setHeight(int newValue)\r\n {\r\n seatHeight = newValue;\r\n }", "public void setHeight(int newValue) {\n seatHeight = newValue;\n }", "public void setHeight(float height) {\n this.yRadius = 0.5f * height;\n }", "public void setHeight(Short height) {\r\n this.height = height;\r\n }", "public void setHeight(int newHeight) {\n roomHeight = newHeight;\n }", "public int getHeight() { return height; }", "public final native void setHeight(double height) /*-{\n this.setHeight(height);\n }-*/;", "public void setHeight(double h) {\n\t\t\theight.set(clamp(h, HEIGHT_MIN, HEIGHT_MAX));\n\t\t}", "@Override\r\n public void setHeight(String height) {\n }", "@Override\n\tpublic void height() {\n\t\t\n\t}", "int getHeight() {return height;}", "public int getHeight()\n {return height;}", "int getheight();", "private void setHeight(long value) {\n bitField0_ |= 0x00000008;\n height_ = value;\n }", "public int getHeight(){\n return height;\n }", "public int getHeight(){\n \treturn height;\n }", "public void setHeight(float top, float bottom) {\n this.top = top;\n this.bottom = bottom;\n }", "public int Height(){\r\n return height;\r\n }", "public Builder setHeight(long value) {\n copyOnWrite();\n instance.setHeight(value);\n return this;\n }", "public void setHeight(final String value)\n {\n height = value;\n }", "@Override\n\tpublic void setHeight(int y) {\n\t\tdelegate.setHeight(y);\n\t}", "@Override\r\n public void changeSocialWindowHeight(int newHeight) {\r\n\r\n ViewGroup.LayoutParams layoutParams = unifiedSocialWindowView.getLayoutParams();\r\n layoutParams.height = newHeight;\r\n unifiedSocialWindowView.setLayoutParams(layoutParams);\r\n }", "public int getHeight(){\n return height;\n }", "public void setBestHeight() { setHeight(getBestHeight()); }", "void update(){\r\n\t\twindowHeight = this.getHeight();\r\n\t}", "public void updateHeight() {\n Rectangle repaintBounds = getBounds();\n parent.getScene().paintImmediately(repaintBounds);\n\n // set new height compute while repainting.\n setBounds(new Rectangle(bounds));\n\n parent.getScene().repaint(repaintBounds);\n setChanged();\n notifyObservers();\n }", "@Override\r\n public int getHeight() {\r\n if(mBaseView != null)\r\n return mBaseView.getHeight();\r\n else\r\n return 0;\r\n }", "public abstract int layoutHeight();", "public int getHeight() {\n return height;\n }", "public int getHeight() {\n return height;\n }", "public int getHeight() {\n return height;\n }", "double getNewHeight();", "public int getHeight() {\n return height;\n }", "@Override\n\tpublic int getHeight() {\n\t\treturn windowHeight;\n\t}", "@Override\n public int getHeight() {\n return this.height;\n }", "public abstract int getDisplayHeight();", "public void setHeight(int inches) {\n if (inches >= 24 && inches <= 84)\n this.height = inches;\n }", "public void setViewPortHeight(double viewPortHeight) {\n this.viewPortHeight = viewPortHeight;\n }", "@Override\n\tpublic double getRenderHeight() {\n\t\treturn height;\n\t}", "private void updateMapViewHeight() {\n\t\tint screenHeight = getActivity().getWindowManager().getDefaultDisplay()\n\t\t\t\t.getHeight();\n\n\t\tint coordinatesContainerHeight = 0;\n\t\tif (mEditMode) {\n\t\t\tmDiveSiteCoordinatesEditContainer.measure(MeasureSpec.UNSPECIFIED,\n\t\t\t\t\tMeasureSpec.UNSPECIFIED);\n\t\t\tcoordinatesContainerHeight = mDiveSiteCoordinatesEditContainer\n\t\t\t\t\t.getMeasuredHeight();\n\t\t}\n\n\t\tmMapView.getLayoutParams().height = screenHeight - getTitleBarHeight()\n\t\t\t\t- getStatusBarHeight() - coordinatesContainerHeight\n\t\t\t\t- MAPVIEW_HEIGHT_BUFFER;\n\t}", "public int getHeight() {\n return height;\n }", "public int getHeight() {\n return height;\n }", "public int getHeight() {\n return height;\n }", "public int getHeight() {\n return height;\n }", "public int getHeight() {\n return height;\n }", "public int getHeight() {\n return height;\n }", "public int getHeight() {\n return height;\n }", "public int getHeight() {\n return height;\n }", "public int getHeight() {\n return height;\n }", "public int getHeight() {\n return height;\n }" ]
[ "0.81521344", "0.81521344", "0.806137", "0.806137", "0.78561157", "0.7825908", "0.7658526", "0.7611477", "0.7562713", "0.7552825", "0.7547704", "0.7545646", "0.75021595", "0.74800617", "0.74571073", "0.74571073", "0.7454246", "0.7453136", "0.7440745", "0.74396634", "0.7348894", "0.73444265", "0.7343392", "0.73312837", "0.7319862", "0.7297406", "0.7258287", "0.725546", "0.72314674", "0.7157946", "0.7151839", "0.7138626", "0.7126676", "0.7116562", "0.70979357", "0.70964897", "0.70964897", "0.7017292", "0.7017292", "0.6987649", "0.69607776", "0.69607776", "0.69607776", "0.6955143", "0.69499016", "0.69335663", "0.6929923", "0.69089895", "0.68825793", "0.6881628", "0.68701726", "0.68629664", "0.6859733", "0.68566036", "0.6849267", "0.683904", "0.6798764", "0.67918575", "0.6787466", "0.6784438", "0.67823374", "0.6764079", "0.67557335", "0.6734938", "0.6732131", "0.67214024", "0.67159826", "0.67051804", "0.6693494", "0.6690669", "0.66864586", "0.6684354", "0.6670191", "0.666971", "0.66674954", "0.6665134", "0.6658341", "0.6625001", "0.6623696", "0.6623696", "0.6623696", "0.6623219", "0.6619058", "0.66147536", "0.6613962", "0.6609581", "0.6604332", "0.6604063", "0.6591593", "0.65899557", "0.6586798", "0.6586798", "0.6586798", "0.6586798", "0.6586798", "0.6586798", "0.6586798", "0.6586798", "0.6586798", "0.6586798" ]
0.67180765
66
sets the x of the view in px
@SuppressLint("NewApi") public S<T> X(int x){ ((View)t).setX(x); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void setX(int x) {\n position = position.setX(x);\n }", "public void setX(float x)\n {\n getBounds().offsetTo(x - positionAnchor.x, getBounds().top);\n notifyParentOfPositionChange();\n conditionallyRelayout();\n }", "@Override\n\tpublic void setX(int x) {\n\t\txPos = x;\n\t}", "public void setX(float x) {\r\n\t\tleft = x - width / 2;\r\n\t}", "public void setX(float x){\n hitBox.offsetTo(x,hitBox.top);\n //this.x=x;\n }", "public void setX( int x ) {\n\t\t//not checking if x is valid because that depends on the coordinate system\n\t\tthis.x = x;\n\t}", "@SuppressLint(\"NewApi\")\n\tpublic S<T> XDp(int x){\n\t\t((View)t).setX((int) pxToDp(x));\n\t\treturn this;\n\t}", "public void setXLoc(int xLoc){\n myRectangle.setX(xLoc);\n }", "public void setStartX(double x)\n {\n startxcoord=x; \n }", "public void setX(int x)\n\t{\n\t\tgetWorldPosition().setX(x);\n\t}", "public void setX(int x) {\n\tbaseXCoord = x;\n}", "public void setX(int x)\n\t{\n\t\tthis.x = x;\t\t\t\t\t\t\t\t\t\t\t\t\t// Update point's x-coordinate\n\t}", "@Override\r\n\tpublic void setX(float x) {\n\t\t\r\n\t}", "public void setX(int xpos) {\r\n this.xpos = xpos;\r\n }", "void setX(int newX) {\n this.xPos = newX;\n }", "public void setX(int x){ xPosition = x; }", "@Override\n\tpublic void setX(float x) {\n\n\t}", "public void setXCoordinate(int newValue)\n {\n x = newValue;\n }", "public void setX(int x) {\r\n\t\tthis.x = x;\r\n\t}", "public void setX(int x) {\r\n\t\tthis.x = x;\r\n\t}", "public void setX(int x) {\r\n\t\tthis.x = x;\r\n\t}", "public void setX(int x) {\r\n\t\tthis.x = x;\r\n\t}", "@Override\n\tpublic void setX(int x) {\n\t\t\n\t}", "public void setX(int x){\r\n\t\tthis.x = x;\r\n\t}", "@Override\n\tpublic void setX(int x) {\n\n\t}", "public void setX(int x) {\n\t\tthis.x = x;\n\t}", "public void setX(int x) {\n\t\tthis.x = x;\n\t}", "public void setX(int x) {\n\t\tthis.x = x;\n\t}", "public void setX(int x) {\n\t\tthis.x = x;\n\t}", "public void setX(int x) {\n\t\tthis.x = x;\n\t}", "public void setXPosition(double x)\n\t{\n\t\tthis.xPosition = x;\n\t}", "public void setXPos(int x) {\n // from MoveEventHandler\n // convert to real x coord\n // x = xP * (xmaxr - xminR) / (xmaxP - xminP)\n double tmp = config.getMaximumRealX() + (x - config.getMaximumPixelX())*(config.getMaximumRealX() - config.getMinimumRealX())/(config.getMaximumPixelX() - config.getMinimumPixelX());\n xpos.setText(formatter.format(tmp));\n }", "public void setX(int x) {\n synchronized (this.xLock) {\n this.movementComposer.setXPosition(x);\n }\n }", "public void setX(int x) {\n this.x = x;\r\n }", "void setPlayerXRelative(int x) {\n }", "public void setX(float x) {\n this.x = x;\n }", "@Override\n\tpublic void setX(float x) \n\t{\n\t\t_x = x;\n\t}", "public void setxPos(int xPos) {\r\n \tthis.xPos = xPos;\r\n }", "public void setX(int xPos){\t\t\n\t\tx = new Integer(xPos);\n\t}", "public void setX(int x) {\n\t\tthis.X = x;\n\t}", "public void setX(int x) {\n this.x = x;\n }", "public void setX(int x) {\n this.x = x;\n }", "public void setX(float x) {\r\n\t\tthis.x = x;\r\n\t}", "public PlotPosition setX( double x )\n {\n return setX( x, 1 );\n }", "protected float getX(float x) {\r\n\t\treturn ((x - viewStart.x) * parent.pixelsPerUnit);\r\n\t}", "default void setX(double x)\n {\n getAxis().setX(x);\n }", "public void setX(int x ){\n if(x>0){\n this.x=x;\n }\n \n }", "protected void setX(final Number x) {\n this.xCoordinate = x;\n }", "public void setX(double x)\r\n\t{\t\r\n\t\tvirtualDxfPoint.setTransformationX(x);\r\n\t\tAnchor.setX(x);\r\n\t}", "public void setX(int newX)\r\n {\r\n xCoord = newX;\r\n }", "void setX(float x) {\n _x = x;\n }", "public void setStartX(float startX) {this.startX = startX;}", "public void setStartPoint(int x) {\n\t\tthis.x = x;\n\n\t}", "public float placeXOnScreen(float x) {\r\n\t\tx -= this.getXPos();\r\n\t\treturn x;\r\n\t}", "public void setX(double x) {\n this.x = x;\r\n }", "public Builder setX(float value) {\n \n x_ = value;\n onChanged();\n return this;\n }", "public Builder setX(float value) {\n \n x_ = value;\n onChanged();\n return this;\n }", "public Builder setX(float value) {\n \n x_ = value;\n onChanged();\n return this;\n }", "public void setCenterX(double x) { centerX.set(clamp(x, X_MIN, X_MAX)); }", "public void setX(double val) {\r\n\t\t this.xCoord = val;\r\n\t }", "public void setX(int x)\n {\n this.x = x;\n }", "public void setX(int x)\r\n {\r\n this.x = x;\r\n }", "public Builder setPositionX(double value) {\n bitField0_ |= 0x00000008;\n positionX_ = value;\n onChanged();\n return this;\n }", "public void setX(int position) {\r\n\t\tif(position<5 && position>=0) {\r\n\t\t\tthis.xcoord = position;\r\n\t\t}\r\n\t\telse {\r\n\t\t\trandomX();\r\n\t\t}\r\n\t}", "public void setX(int xcoord) {\n\t\tx = xcoord;\n\t}", "public Builder setPositionX(double value) {\n bitField0_ |= 0x00000004;\n positionX_ = value;\n onChanged();\n return this;\n }", "public void setX(int x){\n this.x = x;\n }", "public void setX(int x){\n this.x = x;\n }", "public void setX(int x){\n this.x = x;\n }", "public void setX(int x){\n this.x = x;\n }", "public int calculateScreenX(float x) {\n return Math.round(center.x + x - position.x);\n }", "public Builder setPositionX(double value) {\n bitField0_ |= 0x00000040;\n positionX_ = value;\n onChanged();\n return this;\n }", "public void setX(double value) {\n origin.setX(value);\n }", "public void setX(Float x) {\n\t\tthis.x = x;\n\t}", "public Builder setX(int value) {\n \n x_ = value;\n onChanged();\n return this;\n }", "public void setX(int xs)\r\n\t{\r\n\t\tx = xs;\r\n\t}", "public void setX(final int x) {\n\n this.x = x;\n }", "public void setX(int x) {\r\n this.x = x;\r\n\r\n this.slot = Slot.fromXY(x, getY());\r\n }", "public void setX(double x) {\n this.x = x;\n }", "public void setX(double x) {\n this.x = x;\n }", "public void setX(double x) {\n this.x = x;\n }", "public void setExtendedX(float x) {\n mLeft = (int) x;\n }", "public void setX(double point) {\n this.x = point;\n }", "public void setX(double x){\n this.x = x;\n }", "public void setX(double x){\n this.x = x;\n }", "public void setX(double value) {\n this.x = value;\n }", "public void setXPosition( int xCoordinate ) {\n xPosition = xCoordinate;\n }", "public void setX(double x)\n {\n this.x = x;\n }", "public void setX(int xCoord) {\n this.xCoord = xCoord;\n }", "public void setX(double value) {\n\t\t\t\tthis.x = value;\n\t\t\t}", "public void setX(double x) {\n\t\tthis.x = x;\n\t}", "public void setX(double value) {\n\t\tthis.x = value;\n\t}", "public void setStartX(double val) {\r\n startx = val;\r\n }", "public final MotionUpdateEvent setX(double x) {\n pos.setX(x);\n return this;\n }", "@Override\n\tpublic void move_x() {\n\t\tif(mX < 0){\n\t \tdirection *= -1 ;\n\t \t setScale(-1, 1);\n\t }else if (mX > activity.getCameraWidth()-64){\n\t \tdirection *= -1 ;\n\t \tsetScale(1, 1);\n\t } \n\t\tmove_x(direction);\n\t}", "private int get_x() {\n return center_x;\n }", "public void setxPos(int xPos) \n\t{\n\t\tthis.xPos = xPos;\n\t}", "public void setxPosition(int xPosition) {\n\t\tthis.xPosition = xPosition;\n\t}", "public void setX(double x)\n\t{\n\t\tthis.x = x;\n\t}", "void setX(double x){\r\n\t\tthis.x=x;\r\n\t}" ]
[ "0.7829695", "0.779522", "0.7766334", "0.7753047", "0.76700217", "0.76357776", "0.76235527", "0.7495087", "0.74932414", "0.74881816", "0.7454841", "0.7435037", "0.74340147", "0.73990506", "0.7382199", "0.7377872", "0.7347913", "0.73260874", "0.7309478", "0.7309478", "0.7309478", "0.7309478", "0.7274883", "0.72668755", "0.7263263", "0.72602236", "0.72602236", "0.72602236", "0.72602236", "0.72602236", "0.72423446", "0.72097707", "0.7198858", "0.71938294", "0.7187029", "0.7176595", "0.71668255", "0.716135", "0.71608335", "0.7155183", "0.7145872", "0.7145872", "0.7145401", "0.7134094", "0.7111675", "0.7105097", "0.7104039", "0.7085046", "0.7084885", "0.7080015", "0.7056081", "0.70440054", "0.7041622", "0.7001419", "0.69685876", "0.6964548", "0.6964548", "0.6964548", "0.696391", "0.6960216", "0.69524634", "0.6946188", "0.6945824", "0.6945003", "0.69394", "0.69330955", "0.6929772", "0.6929772", "0.6929772", "0.6929772", "0.6923344", "0.6921988", "0.691716", "0.6908873", "0.69072706", "0.6905437", "0.6896347", "0.6890223", "0.6884942", "0.6884942", "0.6884942", "0.6876734", "0.6867828", "0.6863362", "0.6863362", "0.6861068", "0.68420833", "0.6835615", "0.68178177", "0.68126297", "0.6805251", "0.67971927", "0.6792072", "0.6783012", "0.6771495", "0.6769214", "0.6761369", "0.6757174", "0.67543894", "0.67419124" ]
0.764655
5
sets the y of the view in px
@SuppressLint("NewApi") public S<T> Y(int y){ ((View)t).setY(y); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setY(int y){ yPosition = y; }", "void setY(int y) {\n position = position.setY(y);\n }", "public void setY(int value) {\n this.y = value;\n }", "public void setY(int y) {\n this.y = y;\r\n }", "public void setY(int y){\r\n\t\tthis.y = y;\r\n\t}", "public void setY(int y) {\n this.y = y;\n }", "public void setY(int y) {\n this.y = y;\n }", "public void setY(int y) {\n this.y = y;\n }", "public void setY(int y){\n\t\tthis.y_location = y;\n\t}", "@Override\n\tpublic void setY(int y) {\n\t\t\n\t}", "public void setY(int y) {\r\n\t\tthis.y = y;\r\n\t}", "public void setY(int y) {\r\n\t\tthis.y = y;\r\n\t}", "public void setY(int y) {\r\n\t\tthis.y = y;\r\n\t}", "public void setY(int y) {\r\n\t\tthis.y = y;\r\n\t}", "@Override\n\tpublic void setY(int y) {\n\n\t}", "public void setY(int y)\n {\n this.y = y;\n }", "@Override\n\tpublic void setY(int y) {\n\t\tyPos = y;\n\t}", "public void setY(int y){\n this.y = y;\n }", "public void setY(int y){\n this.y = y;\n }", "public void setY(int y){\n this.y = y;\n }", "public void setY(int value)\n\t{\n\t\tgetWorldPosition().setY(value);\n\t}", "void setY(int y) {\n this.y = y;\n }", "void setY(int newY) {\n this.yPos = newY;\n }", "public void setY(int y) {\n\t\tthis.y = y;\n\t}", "public void setY(int y) {\n\t\tthis.y = y;\n\t}", "public void setY(int y) {\n\t\tthis.y = y;\n\t}", "public void setY(int y) {\n\t\tthis.y = y;\n\t}", "@Override\n public void setY(int y) {\n this.y=y;\n }", "public void setY(int y)\n\t{\n\t\tthis.y = y;\t\t\t\t\t\t\t\t\t\t\t\t\t// Update point's y-coordinate \n\t}", "public void setY(int y) {\n\tbaseYCoord = y;\n}", "public void setY(int y ){\n if(y>0){\n this.y=y;\n }\n \n }", "public void setY(int y) { loc.y = y; }", "public void setY(int y) { this.y=y; }", "public void setY(int theY)\r\n {\r\n y = theY;\r\n }", "public void setY(float y)\n {\n getBounds().offsetTo(getBounds().left, y - positionAnchor.y);\n notifyParentOfPositionChange();\n conditionallyRelayout();\n }", "public void setY(final int y) {\n\n this.y = y;\n }", "@SuppressLint(\"NewApi\")\n\tpublic S<T> YDp(int y){\n\t\t((View)t).setY((int) pxToDp(y));\n\t\treturn this;\n\t}", "public void setY(int y) {\n\t\tthis.Y = y;\n\t}", "public void setY( int y ) {\n\t\t//not checking if y is valid because that depends on the coordinate system\n\t\tthis.y = y;\n\t}", "public void setY(float y){\n hitBox.offsetTo(hitBox.left,y);\n //this.y=y;\n }", "@Override\r\n\tpublic void setY(float y) {\n\t\t\r\n\t}", "@Override\n\tpublic void setY(float y) {\n\n\t}", "public void setYPosition(double y)\n\t{\n\t\tthis.yPosition = y;\n\t}", "public void setY(float y){\n this.y = y;\n }", "public void setY(int yPos){\t\t\n\t\ty = new Integer(yPos);\n\t}", "void setY(float y) {\n _y = y;\n }", "public void setY(long y){\n this.y = y;\n }", "public void setYCoordinate(int newValue)\n {\n y = newValue;\n }", "public void setY(int y) {\r\n this.y = y;\r\n\r\n this.slot = Slot.fromXY(getX(), y);\r\n }", "public void setY(double value) {\n this.y = value;\n }", "public void setY(float y) {\n this.y = y;\n }", "public void setY(double y)\r\n\t{\t\r\n\t\tvirtualDxfPoint.setTransformationY(y);\r\n\t\tAnchor.setY(y);\r\n\t}", "public void setYPos(int y) {\n // from MoveEventHandler\n // convert to real y coord\n // y = yP * (ymaxR - yminr) / (ymaxP - yminP)\n double tmp = config.getMaximumRealY() + (y - config.getMaximumPixelY())*(config.getMaximumRealY() - config.getMinimumRealY())/(config.getMaximumPixelY() - config.getMinimumPixelY());\n ypos.setText(formatter.format(tmp));\n }", "public void setY(double y){\n this.y = y;\n }", "public void setY(double y){\n this.y = y;\n }", "public void setY(double value) {\n origin.setY(value);\n }", "@Override\n\tpublic void setY(float y) \n\t{\n\t\t_y = y;\n\t}", "public void setY(double y) {\n this.y = y;\r\n }", "public void setY(int newY)\r\n {\r\n yCoord = newY;\r\n }", "public void setY(float y) {\r\n\t\tthis.y = y;\r\n\t}", "public void setY(double y)\n {\n this.y = y;\n }", "void setY(final Number y) {\n this.yCoordinate = y;\n }", "public void setY(double y) {\n this.y = y;\n }", "public void setY(double y) {\n this.y = y;\n }", "public void setY(double y) {\n this.y = y;\n }", "public void resetY() {this.startY = 11.3f;}", "public void setY(double val) {\r\n\t\t this.yCoord = val;\r\n\t }", "public void setY(double point) {\n this.y = point;\n }", "void setY(double y){\r\n\t\tthis.y=y;\r\n\t}", "public void setEndY(double y)\n {\n endycoord=y; \n }", "public void setY(int ypos) {\r\n this.ypos = ypos;\r\n }", "public void setY(Float y) {\n\t\tthis.y = y;\n\t}", "public void setY(double y) {\n\t\tthis.y = y;\n\t}", "public void setY(int ycoord) {\n\t\ty = ycoord;\n\t}", "public void setY(double y)\n\t{\n\t\tthis.y = y;\n\t}", "void setPlayerYRelative(int y) {\n }", "static void setY(int j) {\n\t\tpx = j;\n\t}", "default void setY(double y)\n {\n getAxis().setY(y);\n }", "public PlotPosition setY( double y )\n {\n return setY( y, 1 );\n }", "public void setyPos(int yPos) {\r\n this.yPos = yPos;\r\n }", "public void setYCoordinates(double newY) { this.yCoordinates = newY; }", "public Builder setY(float value) {\n \n y_ = value;\n onChanged();\n return this;\n }", "public Builder setY(float value) {\n \n y_ = value;\n onChanged();\n return this;\n }", "public Builder setY(float value) {\n \n y_ = value;\n onChanged();\n return this;\n }", "public void setStartY(double y)\n {\n startycoord=y; \n }", "public void setY(int yCoord) {\n this.yCoord = yCoord;\n }", "public void setPositionY(float y) {\n\t\tthis.position.set(this.position.x, y, 0);\n\t}", "public Builder setPositionY(double value) {\n bitField0_ |= 0x00000008;\n positionY_ = value;\n onChanged();\n return this;\n }", "public Builder setPositionY(double value) {\n bitField0_ |= 0x00000080;\n positionY_ = value;\n onChanged();\n return this;\n }", "public void setFrameY(double aY) { double y = _y + aY - getFrameY(); setY(y); }", "public void setYPosition(int newY) {\n this.yPosition = newY;\n }", "public Builder setPositionY(double value) {\n bitField0_ |= 0x00000010;\n positionY_ = value;\n onChanged();\n return this;\n }", "public void setCurrentYPosition(int y) {\n\t\tthis.currentYPosition = y;\n\t\tthis.currentXPosition = this.floats.leftIntersectionPoint(this.box.getAbsoluteX()\n\t\t\t\t+ this.box.marginLeft + this.box.paddingLeft, this.box.getAbsoluteY() + y\n\t\t\t\t+ this.box.marginTop + this.box.paddingTop, this.currentRowMaxWidth, this.box);\n\t}", "public void setY(int y) {\n collider.setLocation((int) collider.getX(), y);\n }", "public void setyCoord(Location l) {\n\t\t\n\t}", "public void setY(double pY) {\n mY = pY;\n }", "protected float getY(float y) {\r\n\t\treturn this.getHeight() - ((y - viewStart.y) * parent.pixelsPerUnit);\r\n\t}", "public void setY(Double y);", "@Override\n\tpublic float getY() {\n\t\treturn lilyPosY;\n\t}", "public void setYPosition( int yCoordinate ) {\n yPosition = yCoordinate;\n }" ]
[ "0.8044129", "0.79825485", "0.78182524", "0.78158176", "0.7813725", "0.779391", "0.779391", "0.779391", "0.7793563", "0.77717537", "0.7770396", "0.7770396", "0.7770396", "0.7770396", "0.77537686", "0.7752974", "0.7737049", "0.7736766", "0.7736766", "0.7736766", "0.7691667", "0.7685565", "0.767755", "0.7670234", "0.7670234", "0.7670234", "0.7670234", "0.76610655", "0.76365167", "0.76283926", "0.7612773", "0.7588589", "0.7587047", "0.75793695", "0.7576565", "0.75591457", "0.754336", "0.7538404", "0.75289863", "0.75209486", "0.75056255", "0.7484295", "0.7475909", "0.7475316", "0.74715394", "0.7446611", "0.7435924", "0.74039537", "0.74000233", "0.739307", "0.7382475", "0.73718095", "0.736961", "0.7351546", "0.7351546", "0.734082", "0.7338625", "0.73338085", "0.7320236", "0.73199177", "0.7319729", "0.7312645", "0.730072", "0.730072", "0.730072", "0.7267292", "0.723647", "0.72244734", "0.72034764", "0.7195814", "0.71870136", "0.71745527", "0.7161129", "0.7159399", "0.7153622", "0.7151167", "0.71455973", "0.7134983", "0.7132271", "0.71293736", "0.7127906", "0.7124821", "0.7124821", "0.7124821", "0.70903945", "0.70825416", "0.7074559", "0.7058046", "0.7055589", "0.7051348", "0.7040895", "0.7032199", "0.70246446", "0.7013977", "0.70076495", "0.70065564", "0.6995801", "0.6986802", "0.69849306", "0.6965046" ]
0.74288076
47
gets the screen width
public int sWidth(){ int Measuredwidth = 0; Point size = new Point(); WindowManager w = activity.getWindowManager(); if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { w.getDefaultDisplay().getSize(size); Measuredwidth = size.x; }else{ Display d = w.getDefaultDisplay(); Measuredwidth = d.getWidth(); } return Measuredwidth; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getScreenWidth();", "public int getScreenWidth();", "public int getScreenWidth() {\n return this.screenWidth;\n }", "public int getWidthScreen(){\n return widthScreen ;\n }", "public int getScreenWidth()\r\n\t{\r\n\t\treturn mScreen.getWidth();\r\n\t}", "private void findScreenWidth() {\n DisplayMetrics dm = new DisplayMetrics();\n getActivity().getWindowManager().getDefaultDisplay().getMetrics(dm);\n screenWidth = dm.widthPixels;\n }", "private float ScreenWidth() {\n RelativeLayout linBoardGame = (RelativeLayout) ((Activity) context).findViewById(R.id.gridContainer);\n Resources r = linBoardGame.getResources();\n DisplayMetrics d = r.getDisplayMetrics();\n return d.widthPixels;\n }", "public int getWidth(){\n Window w = vc.getFullScreenWindow();\n if(w != null){\n return w.getWidth();\n } else {\n return 0;\n }\n }", "public int getDisplayWidth() {\n return isHiRes() ? 640 : 320;\n }", "public static int getScreenWidth(Context context) {\n return context.getResources().getDisplayMetrics().widthPixels;\n }", "public static int getScreenWidth(Context context) {\n return context.getResources().getDisplayMetrics().widthPixels;\n }", "public static int getWidth() {\r\n\t\treturn 1280;\r\n\t}", "public int getScreenWidth(Activity activity)\n {\n return activity.getResources().getDisplayMetrics().widthPixels;\n }", "public static double getDisplayWidth() {\n\t\treturn javafx.stage.Screen.getPrimary().getVisualBounds().getWidth();\n\t}", "public int getWidth() {\r\n return Display.getWidth();\r\n }", "public abstract int getDisplayWidth();", "protected double getWindowWidth() {\n\t\treturn m_windowWidth;\n\t}", "public static int screenWidthPixel(Context context) {\n int sScreenWidthPixels;\n WindowManager windowManager = (WindowManager) context.getSystemService(\n Context.WINDOW_SERVICE);\n Display display = windowManager.getDefaultDisplay();\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {\n Point outPoint = new Point();\n display.getRealSize(outPoint);\n sScreenWidthPixels = outPoint.x;\n } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n Point outPoint = new Point();\n display.getSize(outPoint);\n sScreenWidthPixels = outPoint.x;\n } else {\n sScreenWidthPixels = display.getWidth();\n }\n return sScreenWidthPixels;\n }", "public static int resWidth() {\n\t\t\n\t\treturn (int)resolution.getWidth();\n\t\t\n\t}", "@Override\n\tpublic int getWidth() {\n\t\treturn windowWidth;\n\t}", "private void getScreenSize() {\n WindowManager wm = getWindowManager();\n Display disp = wm.getDefaultDisplay();\n Point size = new Point();\n disp.getSize(size);\n screenWidth = size.x;\n screenHeight = size.y;\n }", "public static int getWidth()\r\n\t{\r\n\t\treturn width;\r\n\t}", "public int getScreenSize() {\r\n\t\treturn SCREEN_SIZE;\r\n\t}", "public int getDesktopWidth() {\n\t\treturn getClientWidth(PROGRAM_MANAGER);\n\t}", "public int getWidth () {\r\n\tcheckWidget();\r\n\tint [] args = {OS.Pt_ARG_WIDTH, 0, 0};\r\n\tOS.PtGetResources (handle, args.length / 3, args);\r\n\treturn args [1];\r\n}", "private Point getScreenDim() {\n \t\tDisplay display = this.getWindowManager().getDefaultDisplay();\n \n \t\t@SuppressWarnings( \"deprecation\" )\n \t\tPoint size = new Point( display.getWidth(), display.getHeight() );\n \t\treturn size;\n \t}", "public int getDisplayWidth() {\n\t\treturn displayWidth;\n\t}", "public static int getScreenWidth(Activity activity) {\n\t\tDisplayMetrics dm = new DisplayMetrics();\n\t\tactivity.getWindowManager().getDefaultDisplay().getMetrics(dm);\n\t\treturn (dm.widthPixels);\n\t}", "public int getCurrentWidth();", "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();", "public static double getRawDisplayWidth() {\n\t\treturn javafx.stage.Screen.getPrimary().getBounds().getWidth();\n\t}", "public int getScreenSize() {\n screensize = getResources().getConfiguration().screenLayout &\n Configuration.SCREENLAYOUT_SIZE_MASK;\n return screensize;\n }", "Integer getCurrentWidth();", "int getHorizontalResolution();", "public double getSceneWidth() {\n return this.applicationScene.getWidth();\n }", "public int getMyWidth() { RTComponent.RTRenderContext myrc = getRTComponent().rc; if (myrc != null) return myrc.getRCWidth(); else return getRTComponent().getWidth(); }", "public int getScreenSize(){\n\t \n\t //get screen soe promatticaly so we can set the layout gallery view at runtome\n\t int screenSize = this.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK;\n\t \n\t switch(screenSize){\n\t \n\t case Configuration.SCREENLAYOUT_SIZE_XLARGE:\n\t\t return 1;\n\tcase Configuration.SCREENLAYOUT_SIZE_NORMAL:\n\t \t\treturn 2;\n\tcase Configuration.SCREENLAYOUT_SIZE_LARGE:\n\t\t//at east 480dp\n \t\treturn 3;\n\t\t \n\t \n\t \n\t }\n\t return 0;//if neither 1 or 2\n }", "long getWidth();", "public int getScreenW() {\n return wEcran;\n }", "private void getScreenDimensions() {\n DisplayMetrics metrics = Resources.getSystem().getDisplayMetrics();\n mScreenWidth = metrics.widthPixels;\n mScreenHeight = metrics.heightPixels;\n mScreenDensity = metrics.densityDpi;\n }", "protected int getSurfaceWidth() {\n assertActivityNotNull();\n return mActivity.getWidth();\n }", "public int getViewportWidth() {\n return viewport.getWidth();\n }", "public static int getWidth(Display display){\n int width;\n if (Build.VERSION.SDK_INT > Build.VERSION_CODES.HONEYCOMB_MR1) { // > API 12\n Point size = new Point();\n display.getSize(size);\n width = size.x;\n } else {\n width = display.getWidth();\n }\n return width;\n }", "public static int getDisplayWidthPixel(Context context) {\n Display display = ((WindowManager)context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();\n DisplayMetrics metrics = new DisplayMetrics();\n display.getMetrics(metrics);\n\n return metrics.widthPixels;\n }", "public final int getWidth() {\r\n return config.width;\r\n }", "public int getWidth()\r\n\t{\r\n\t\treturn WIDTH;\r\n\t}", "public int getWidth()\n {\n return width;\n }", "public int getWidth()\n {\n return width;\n }", "public int getWidth()\n {\n return width;\n }", "public int getWidth();", "public int getWidth();", "public int getWidth();", "public int getGameWidth() {\r\n return myGameWidth;\r\n }", "@Override\n\tpublic float getPrefWidth() {\n\t\treturn windowSize * 1.2f;\n\t}", "public int getW() {\n\t\treturn this.width;\n\t}", "public int getWidth() {\r\n return width;\r\n }", "@SuppressWarnings(\"deprecation\")\n public static int getWidth(Activity activity) {\n WindowManager window = activity.getWindowManager();\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n Point size = new Point();\n window.getDefaultDisplay().getSize(size);\n return size.x;\n } else {\n return window.getDefaultDisplay().getWidth();\n }\n }", "public int getWidth() {\r\n return width;\r\n }", "int getWindowSize();", "public int getWidth()\n {\n\treturn width;\n }", "int getWidth() {return width;}", "public int getWidth() {\n return width;\n }", "public int getWidth() {\n return width;\n }", "public int getWidth() {\n return width;\n }", "public int getWidth() {\n return width;\n }", "public int getWidth() {\n return width;\n }", "public int getWidth() {\n return width;\n }", "public int getWidth() {\n return width;\n }", "public int getWidth() {\n return width;\n }", "public int getWidth() {\n return width;\n }", "public int getWidth() {\n return width;\n }", "public int getWidth() {\n return width;\n }", "public int getWidth() {\n return width;\n }", "public int getWidth() {\n return width;\n }", "int getWidth()\n {\n return width;\n }", "public int getWidth(){\n return width;\n }", "public int getWidth() {\n return (int) Math.round(width);\n }", "public int getWidth(){\n\t\treturn width;\n\t}", "public int getWidth(){\n \treturn width;\n }", "public final int getWidth() {\r\n return width;\r\n }", "public int getWidth() \n\t{\n\t\treturn width;\n\t}", "public int getWidth()\r\n\t{\r\n\t\treturn width;\r\n\t}", "public int getWidth() {\n return (roomWidth);\n }", "public int getWidth() {\n return width;\n }" ]
[ "0.9048443", "0.9048443", "0.847956", "0.84341586", "0.8433663", "0.8081581", "0.7908456", "0.7823574", "0.7743224", "0.7742621", "0.7742621", "0.7670237", "0.76614213", "0.74767834", "0.74684674", "0.73656887", "0.7316542", "0.7277201", "0.72617275", "0.72265714", "0.7219203", "0.71460277", "0.7144007", "0.70928484", "0.7020101", "0.70172364", "0.70077926", "0.69859725", "0.6982042", "0.69798326", "0.69798326", "0.69798326", "0.69798326", "0.69798326", "0.69798326", "0.69798326", "0.69798326", "0.69798326", "0.69798326", "0.69798326", "0.69798326", "0.69798326", "0.69798326", "0.69798326", "0.69798326", "0.69798326", "0.69546676", "0.6943239", "0.6940611", "0.69116884", "0.68944776", "0.68932116", "0.6892837", "0.68865263", "0.6885148", "0.6877276", "0.68710357", "0.68630546", "0.6815693", "0.6810237", "0.6776372", "0.6772813", "0.6771828", "0.6771828", "0.6771828", "0.67667687", "0.67667687", "0.67667687", "0.6764712", "0.67645985", "0.67574614", "0.67552304", "0.67542994", "0.6742072", "0.6737823", "0.67369473", "0.67368937", "0.6733035", "0.6733035", "0.6733035", "0.6733035", "0.6733035", "0.6733035", "0.6733035", "0.6733035", "0.6733035", "0.6733035", "0.6733035", "0.6733035", "0.6733035", "0.67265165", "0.6724755", "0.67226464", "0.671082", "0.6707421", "0.67036206", "0.67024356", "0.66998035", "0.6694714", "0.6690177" ]
0.756193
13
gets the screen height
public int sHeight(){ int Measuredheight = 0; Point size = new Point(); WindowManager w = activity.getWindowManager(); if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { w.getDefaultDisplay().getSize(size); Measuredheight = size.y; }else{ Display d = w.getDefaultDisplay(); Measuredheight = d.getHeight(); } return Measuredheight; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getScreenHeight();", "public int getScreenHeight();", "public int getScreenHeight() {\n return this.screenHeight;\n }", "public int getHeightScreen(){\n return heightScreen ;\n }", "public int getScreenHeight()\r\n\t{\r\n\t\treturn mScreen.getHeight();\r\n\t}", "public int getHeight(){\n Window w = vc.getFullScreenWindow();\n if(w != null){\n return w.getHeight();\n } else {\n return 0;\n }\n }", "private int getWindowHeight() {\n DisplayMetrics displayMetrics = new DisplayMetrics();\n ((Activity) getContext()).getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);\n return displayMetrics.heightPixels;\n }", "public int getHeight() {\r\n return Display.getHeight();\r\n }", "public static double getDisplayHeight() {\n\t\treturn javafx.stage.Screen.getPrimary().getVisualBounds().getHeight();\n\t}", "public static int getScreenHeight(Context context) {\n return context.getResources().getDisplayMetrics().heightPixels;\n }", "public abstract int getDisplayHeight();", "public int getDisplayHeight()\n {\n if ( amiga.isPAL() ) {\n return isInterlaced() ? 512 : 256;\n }\n return isInterlaced() ? 400 : 200;\n }", "public int getScreenHeight(Activity activity)\n {\n return activity.getResources().getDisplayMetrics().heightPixels;\n }", "public int getDisplayHeight() {\n\t\treturn displayHeight;\n\t}", "@Override\n\tpublic int getHeight() {\n\t\treturn windowHeight;\n\t}", "protected double getWindowHeight() {\n\t\treturn m_windowHeight;\n\t}", "public int getDesktopHeight() {\n\t\treturn getClientHeight(PROGRAM_MANAGER);\n\t}", "float getSurfaceHeight();", "int getheight();", "public static int getHeight()\r\n\t{\r\n\t\treturn height;\r\n\t}", "public int getViewportHeight() {\n return viewport.getHeight();\n }", "public int getHeight() {\n\t\treturn WORLD_HEIGHT;\n\t}", "public int getDisplayY() {\n DisplayMetrics dm = new DisplayMetrics();\n ((WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay()\n .getMetrics(dm);\n return dm.heightPixels;\n }", "Integer getCurrentHeight();", "private void getScreenSize() {\n WindowManager wm = getWindowManager();\n Display disp = wm.getDefaultDisplay();\n Point size = new Point();\n disp.getSize(size);\n screenWidth = size.x;\n screenHeight = size.y;\n }", "public static int getDisplayHeightPixel(Context context) {\n Display display = ((WindowManager)context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();\n DisplayMetrics metrics = new DisplayMetrics();\n display.getMetrics(metrics);\n\n return metrics.heightPixels;\n }", "public int getCurrentHeight();", "public void computeHeight() {\n\t\tif (getContext().getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {\n\t\t\tint screenHeight = ScreenUtils.getScreenHeight(getContext());\n\t\t\tif (DisplayHelper.isTabModel(getContext())) {\n\t\t\t\tsetHeight(screenHeight * 3 / 4);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tsetHeight(screenHeight * 4 / 5);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tint screenHeight = ScreenUtils.getScreenHeight(getContext());\n\t\t\tif (DisplayHelper.isTabModel(getContext())) {\n\t\t\t\tsetHeight(screenHeight * 2 / 3);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tsetHeight(screenHeight - 80);\n\t\t\t}\n\t\t}\n\t}", "public static double getRawDisplayHeight() {\n\t\treturn javafx.stage.Screen.getPrimary().getBounds().getHeight();\n\t}", "public final int getHeight() {\r\n return config.height;\r\n }", "public int getHeight() {\n return (roomHeight);\n }", "public int getHeight() {\n\t\treturn canvasHeight;\n\t}", "public static int getWindowHeight(Context context) {\n /*\n int measuredHeight = 0;\n Point size = new Point();\n WindowManager w = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n w.getDefaultDisplay().getSize(size);\n measuredHeight = size.y;\n } else {\n Display d = w.getDefaultDisplay();\n measuredHeight = d.getHeight();\n }\n return measuredHeight;\n */\n\n WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);\n Display display = windowManager.getDefaultDisplay();\n int realWidth;\n int realHeight;\n\n if (Build.VERSION.SDK_INT >= 17) {\n //new pleasant way to get real metrics\n DisplayMetrics realMetrics = new DisplayMetrics();\n display.getRealMetrics(realMetrics);\n realWidth = realMetrics.widthPixels;\n realHeight = realMetrics.heightPixels;\n\n } else if (Build.VERSION.SDK_INT >= 14) {\n //reflection for this weird in-between time\n try {\n Method mGetRawH = Display.class.getMethod(\"getRawHeight\");\n Method mGetRawW = Display.class.getMethod(\"getRawWidth\");\n realWidth = (Integer) mGetRawW.invoke(display);\n realHeight = (Integer) mGetRawH.invoke(display);\n } catch (Exception e) {\n //this may not be 100% accurate, but it's all we've got\n realWidth = display.getWidth();\n realHeight = display.getHeight();\n Log.e(\"Display Info\", \"Couldn't use reflection to get the real display metrics.\");\n }\n\n } else {\n //This should be close, as lower API devices should not have window navigation bars\n realWidth = display.getWidth();\n realHeight = display.getHeight();\n }\n return realHeight;\n }", "protected int getSurfaceHeight() {\n assertActivityNotNull();\n return mActivity.getHeight();\n }", "public static int resHeight() {\n\t\t\n\t\treturn (int)resolution.getHeight();\n\t}", "@Override\n\tpublic float getPrefHeight() {\n\t\treturn windowSize * 0.6f;\n\t}", "public int getHeight() {\n return mPresentationEngine.getHeight();\n }", "public int getHeight()\n {\n \treturn height;\n }", "@Override\n public int getHeight() {\n return graphicsEnvironmentImpl.getHeight(canvas);\n }", "private float getCurrentDisplayedHeight() {\n if (getDrawable() != null)\n return getDrawable().getIntrinsicHeight() * matrixValues[Matrix.MSCALE_Y];\n else\n return 0;\n }", "public static int getHeight(Display display){\n int height;\n if (Build.VERSION.SDK_INT > Build.VERSION_CODES.HONEYCOMB_MR1) { // > API 12\n Point size = new Point();\n display.getSize(size);\n height = size.y;\n } else {\n height = display.getHeight();\n }\n return height;\n }", "public int getHeight()\r\n\t{\r\n\t\treturn HEIGHT;\r\n\t}", "public int getGameHeight() {\r\n return myGameHeight;\r\n }", "public int getHeight()\r\n\t{\r\n\t\treturn height;\r\n\t}", "public int getHeight() {\n return height;\n }", "public int getHeight() \n\t{\n\t\treturn height;\n\t}", "public int getHeight()\n\t{\n\t\treturn height;\n\t}", "public int getHeight()\n\t{\n\t\treturn height;\n\t}", "public int getHeight() {\n return height;\n }", "public int getHeight() {\n return height;\n }", "public int getHeight() {\n return height;\n }", "public int getHeight() {\n return height;\n }", "public int getHeight() {\n return height;\n }", "public int getHeight() {\n return height;\n }", "public int getHeight() {\n return height;\n }", "public int getHeight() {\n return height;\n }", "public int getHeight() {\n return height;\n }", "public int getHeight() {\n return height;\n }", "public int getHeight() {\n return height;\n }", "public final int getHeight() {\r\n return height;\r\n }", "public int getHeight()\n {\n return height;\n }", "public int getHeight() {\r\n\t\treturn height;\r\n\t}", "public int getHeight() {\r\n\t\treturn height;\r\n\t}", "public int getHeight(){\n \treturn height;\n }", "private void getWidthAndHeight() {\n DisplayMetrics displaymetrics = new DisplayMetrics();\n getActivity().getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);\n screenHeight = displaymetrics.heightPixels;\n screenWidth = displaymetrics.widthPixels;\n }", "public int getHeight() {\r\n\t\t\r\n\t\treturn height;\r\n\t}", "public int getHeight() {\n\t\treturn height;\n\t}", "public int getHeight() {\n\t\treturn height;\n\t}", "public int getHeight() {\n\t\treturn height;\n\t}", "public int getHeight() {\n\t\treturn height;\n\t}", "public int getHeight() {\n\t\treturn height;\n\t}", "public int getHeight() {\n\t\treturn height;\n\t}", "public int getHeight() {\n\t\treturn height;\n\t}", "public int getHeight() {\n\t\treturn height;\n\t}", "public int getHeight() {\n\t\treturn height;\n\t}", "public int getHeight() {\n\t\treturn height;\n\t}", "public int getHeight() {\n\t\treturn height;\n\t}", "public int getHeight() {\n\t\t\treturn height;\n\t\t}", "public int getHeight() {\n return (int) Math.round(height);\n }", "public float getHeight()\n {\n return getUpperRightY() - getLowerLeftY();\n }", "public int getHeight() {\n return height;\n }", "public int getHeight() {\n return height;\n }", "public int getHeight() {\n return height;\n }", "public int getScreenSize() {\r\n\t\treturn SCREEN_SIZE;\r\n\t}", "public float getHeight() {\n return height;\n }", "long getHeight();", "private double getHeight() {\n\t\treturn height;\n\t}", "public int getMyHeight() { RTComponent.RTRenderContext myrc = getRTComponent().rc; if (myrc != null) return myrc.getRCHeight(); else return getRTComponent().getHeight(); }", "public double getHeight () {\n return height;\n }", "public float getHeight() {\r\n\t\treturn height;\r\n\t}", "public float getHeight();", "public int getHeight() {\r\n return Height;\r\n }", "public int getHeight() {\n return (int) (this.height * ViewHandlerImpl.getScaleModifier());\n }", "public int getHeight(){\n return height;\n }", "public float getHeight() {\n\t\treturn height;\n\t}", "int getHeight();", "int getHeight();", "int getHeight();", "int getHeight();", "int getHeight();" ]
[ "0.9142474", "0.9142474", "0.87411", "0.8657026", "0.8624278", "0.8043536", "0.7925607", "0.789469", "0.7867734", "0.7798695", "0.7793279", "0.77708966", "0.7743249", "0.7726855", "0.77184474", "0.7637553", "0.7468296", "0.7433321", "0.740046", "0.738701", "0.7382098", "0.73520106", "0.7322121", "0.73142296", "0.72872394", "0.72681606", "0.72643316", "0.7253971", "0.7214487", "0.7202519", "0.7184801", "0.71826905", "0.71815836", "0.717179", "0.71643406", "0.71402043", "0.7136331", "0.7128849", "0.7128821", "0.7121864", "0.7121548", "0.71078116", "0.7102698", "0.70874953", "0.7085363", "0.7085128", "0.7075815", "0.7075815", "0.70748496", "0.70748496", "0.70748496", "0.70748496", "0.70748496", "0.70748496", "0.70748496", "0.70748496", "0.70748496", "0.70748496", "0.70748496", "0.7068332", "0.70622313", "0.70570254", "0.70570254", "0.7055994", "0.704163", "0.70277697", "0.7020503", "0.7020503", "0.7020503", "0.7020503", "0.7020503", "0.7020503", "0.7020503", "0.7020503", "0.7020503", "0.7020503", "0.7020503", "0.7010488", "0.70101273", "0.69944686", "0.69938767", "0.69938767", "0.69938767", "0.69927907", "0.6988341", "0.6984193", "0.69809157", "0.6974816", "0.6974332", "0.69728076", "0.69617957", "0.69609296", "0.69541043", "0.69540876", "0.69401264", "0.69393206", "0.69393206", "0.69393206", "0.69393206", "0.69393206" ]
0.778951
11
Makes a short Toast
public S<T> toast(String text){ Toast t = Toast.makeText(activity, text, Toast.LENGTH_SHORT); t.show(); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void showToast(String message);", "void showToast(String message);", "void toast(CharSequence sequence);", "static void makeToast(Context ctx, String s){\n Toast.makeText(ctx, s, Toast.LENGTH_SHORT).show();\n }", "void toast(int resId);", "protected void toast() {\n }", "private void makeToast(String msg)\n {\n FinanceApp.serviceFactory.getUtil().makeAToast(this, msg);\n }", "void showToast(String value);", "@Override\n\tpublic void createToast(String slogan, float duration) {\n\t\tif (Gdx.app.getType() == ApplicationType.Android) {\n\t\t\tgGame.iFunctions.createToast(slogan, duration);\n\t\t} else\n\t\tsuper.createToast(slogan, duration);\n\t}", "private void toast(String aToast) {\n Toast.makeText(getApplicationContext(), aToast, Toast.LENGTH_LONG).show();\n }", "public void showToast(String string, int length) {\n System.out.println(\"toast:\" + string);\n }", "public void ToastPopper(String t){\n Context context = getApplicationContext();\n CharSequence text = t;\n int duration = Toast.LENGTH_LONG;\n\n Toast toast = Toast.makeText(context, text, duration);\n toast.show();\n try {\n Thread.sleep(3000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "private void makeToast(String message, boolean longToast) {\n\t\tif (longToast)\t{ Toast.makeText(this, message, Toast.LENGTH_LONG).show(); }\n\t\telse\t\t\t{ Toast.makeText(this, message, Toast.LENGTH_SHORT).show(); }\n\t}", "public void toast(String toast) {\n\t\t// TODO Auto-generated method stub\n\t\t Toast toast1 = Toast.makeText(getApplicationContext(), toast, \n Toast.LENGTH_LONG); \n\t\t toast1.setDuration(1);\n\t\t toast1.show();\n\t\t \n\t}", "public void toast (String msg, boolean longLength)\n {\n Toast.makeText (getApplicationContext(), msg,\n (longLength ? Toast.LENGTH_LONG : Toast.LENGTH_SHORT)\n ).show ();\n }", "public void ToastMessage() {\n\n // create toast message object\n final Toast toast = Toast.makeText(Product_Details_Page_Type_4.this,\n \"Product added to cart\",Toast.LENGTH_LONG);\n // show method call to show Toast message\n toast.show();\n\n // create handler to set duration for toast message\n Handler handler = new Handler() {\n\n @Override\n public void close() {\n // set duration for toast message\n toast.setDuration(100);\n // cancel toast message\n toast.cancel();\n }\n @Override\n public void flush() {}\n\n @Override\n public void publish(LogRecord record) {}\n };\n }", "public void toast (String msg)\n\t{\n\t\tToast.makeText (getApplicationContext(), msg, Toast.LENGTH_SHORT).show ();\n\t}", "private void toast(String string){\n Toast.makeText(this, string, Toast.LENGTH_SHORT).show();\n }", "public void makeToast(String name,int time){\n toast = new Toast(context);\n// toast.setGravity(Gravity.BOTTOM|Gravity.CENTER_HORIZONTAL , 0, SecretMessageApplication.get720WScale(240));\n toast.setDuration(time);\n// toast.setView(layout);\n toast.show();\n\n }", "public void notificacionToast(String mensaje){\n Toast toast = Toast.makeText(getApplicationContext(),mensaje,Toast.LENGTH_LONG);\n toast.setGravity(Gravity.CENTER_HORIZONTAL, 0, 0);\n toast.show();\n }", "private void makeToast(String string) {\n\t\tToast.makeText(this, string, Toast.LENGTH_SHORT).show();\r\n\r\n\t}", "@Override\n public void onClick(View v) {\n String toastText = \"Hello World\";\n\n // This is how long we want to show the toast\n int duration = Toast.LENGTH_SHORT;\n\n // Get the context\n Context context = getApplicationContext();\n\n // Create the toast\n Toast toast = Toast.makeText(context, toastText, duration);\n\n // Show the toast\n toast.show();\n }", "private void displayToast(CharSequence text){\n Context context = getApplicationContext();\n int duration = Toast.LENGTH_SHORT;\n Toast toast = Toast.makeText(context, text, duration);\n toast.show();\n }", "public void showToast(String msg){\n Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();\n }", "private void showToast(final String message, final int toastLength) {\n post(new Runnable() {\n @Override\n public void run() {\n Toast.makeText(getActivity(), message, toastLength).show();\n }\n });\n }", "public void makeToast(String string) {\n Toast.makeText(this, string, Toast.LENGTH_LONG).show();\n }", "private void doToast() {\n\t\tEditText editText = (EditText) findViewById(R.id.edit_message);\r\n\t\tString message = editText.getText().toString();\r\n\t\t\r\n\t\t// Create and send toast\r\n\t\tContext context = getApplicationContext();\r\n\t\tint duration = Toast.LENGTH_SHORT;\r\n\t\tToast toast = Toast.makeText(context, message, duration);\r\n\t\ttoast.show();\r\n\t}", "public void ting(String msg) {\r\n\t\tToast.makeText(this, msg, Toast.LENGTH_SHORT).show();\r\n\t}", "private void showToast(final int resid) {\n\t\tm_toastHandler.post(new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\tToast.makeText(InstrumentService.this, resid, Toast.LENGTH_SHORT).show();\n\t\t\t}\n\t\t});\n\t}", "public void toastMsg(View v){\n String msg = \"Message Sent!\";\n Toast toast = Toast.makeText(this,msg,Toast.LENGTH_SHORT);\n toast.show();\n }", "@Override\n public void toastText(String s){\n Toast.makeText(getApplicationContext(), s, Toast.LENGTH_SHORT).show();\n }", "public static void toastText(Context context, String s)\n\t{\n\t\tif(Utils.ConstantVars.canToastDebugText) \n\t\t\tToast.makeText(context, s, 2 * Toast.LENGTH_LONG).show();\n\t}", "private void showToast(String message){\n\n Toast.makeText(this, message, Toast.LENGTH_SHORT).show();\n }", "private void showToast(String msg) {\n Toast.makeText(getBaseContext(), msg, Toast.LENGTH_LONG).show();\n }", "protected void toastshow() {\n \n\t\tToast toast=new Toast(getApplicationContext());\n\t\tImageView imageView=new ImageView(getApplicationContext());\n\t\timageView.setImageResource(R.drawable.icon);\n\t\ttoast.setView(imageView);\n\t\ttoast.show();\t\n\t}", "protected void showToast(CharSequence text) {\r\n\t Context context = getApplicationContext();\r\n\t int duration = Toast.LENGTH_SHORT;\r\n\t \r\n\t Toast toast = Toast.makeText(context, text, duration);\r\n\t toast.show();\r\n\t}", "private void toast(String bread) {\n Toast.makeText(getActivity(), bread, Toast.LENGTH_SHORT).show();\n }", "private void toastMessage (String message){\n Toast.makeText(this, message, Toast.LENGTH_SHORT).show();\n }", "private void showErrorToast() {\n }", "private void msg(String s)\n {\n Toast.makeText(getApplicationContext(),s,Toast.LENGTH_LONG).show();\n }", "private void msg(String s)\n {\n Toast.makeText(getApplicationContext(),s,Toast.LENGTH_LONG).show();\n }", "private void toastMessage(String message){\n Toast.makeText(this,message, Toast.LENGTH_SHORT).show();\n }", "private void toastMessage(String message){\n Toast.makeText(this,message, Toast.LENGTH_SHORT).show();\n }", "protected void showToast(String message) {\n\tToast.makeText(this, message, Toast.LENGTH_SHORT).show();\n}", "public void showToast(String text){\n Toast.makeText(this,text,Toast.LENGTH_SHORT).show();\n }", "private static void showToastText(String infoStr, int TOAST_LENGTH) {\n Context context = null;\n\t\ttoast = getToast(context);\n\t\tTextView textView = (TextView) toast.getView().findViewById(R.id.tv_toast);\n\t\ttextView.setText(infoStr);\n textView.setTypeface(Typeface.SANS_SERIF);\n\t\ttoast.setDuration(TOAST_LENGTH);\n\t\ttoast.show();\n\t}", "static void displayToast(Handler handler, final Context con, final String text, final int toast_length){\n\t\thandler.post(new Runnable(){\n\t\t\tpublic void run(){\n\t\t\t\tToast.makeText(con, text, toast_length).show();\n\t\t\t}\n\t\t});\n\t}", "private void msg(String s) {\n Toast.makeText(getApplicationContext(), s, Toast.LENGTH_LONG).show();\n }", "private void msg(String s) {\n Toast.makeText(getApplicationContext(), s, Toast.LENGTH_LONG).show();\n }", "private void msg(String s) {\n Toast.makeText(getApplicationContext(), s, Toast.LENGTH_LONG).show();\n }", "public void cT(String s) { \r\n\t\tToast.makeText(this, s, Toast.LENGTH_SHORT).show();\r\n\t}", "protected void toastshow1() {\n \n\t\tToast toast=Toast.makeText(this, \"image and text\", Toast.LENGTH_LONG);\n\t\t\n\t\tLinearLayout linearLayout=new LinearLayout(this);\n\t\tlinearLayout.setOrientation(LinearLayout.VERTICAL);\n\t\tImageView imageView=new ImageView(this);\n\t\timageView.setImageResource(R.drawable.icon);\n\t\tButton button=new Button(this);\n\t\tbutton.setText(\"progress over\");\n\t\tView toastView=toast.getView();\n\t\tlinearLayout.addView(imageView);\n\t\tlinearLayout.addView(button);\n\t\tlinearLayout.addView(toastView);\n\t\t\n\t\ttoast.setView(linearLayout);\n\t\ttoast.show();\n\t\t\n\t}", "private void displayToast(String message) {\n Toast.makeText(getApplicationContext(), message, Toast.LENGTH_SHORT).show();\n }", "public static void displayToast(Context context, String msg) {\n Toast.makeText(context, msg, Toast.LENGTH_LONG).show();\n\n }", "public void DisplayToast(String msg) {\n Toast.makeText(getBaseContext(), msg, Toast.LENGTH_SHORT).show();\n }", "private void makeToast(String message){\n Toast.makeText(SettingsActivity.this, message, Toast.LENGTH_LONG).show();\n }", "public void yell(String message){\n Toast.makeText(getApplicationContext(), message, Toast.LENGTH_SHORT).show();\n }", "private static void showToast(String stringToDisplay, Context context) {\n Toast.makeText(context, stringToDisplay, Toast.LENGTH_SHORT).show();\n }", "@JavascriptInterface\n public void showToast(String toast) {\n Toast.makeText(mContext, toast, Toast.LENGTH_LONG).show();\n }", "public void showToast(View view) {\n // Initialize an object named 'toast' using the 'Toast' class\n Toast toast = Toast.makeText(this, R.string.toast_message, Toast.LENGTH_SHORT);\n\n // Use the method 'show()' under the 'Toast' class to show a message\n toast.show();\n }", "public static void showToast(Context context, String msg) {\n Toast.makeText(context, \"\" + msg, Toast.LENGTH_LONG).show();\n\n }", "private void showToast(String msg) {\r\n Toast.makeText(Imprimir.this, msg, Toast.LENGTH_LONG).show();\r\n }", "@JavascriptInterface\n public void showToast(String toast) {\n Toast.makeText(mContext, toast, Toast.LENGTH_SHORT).show();\n }", "@JavascriptInterface\n public void showToast(String toast) {\n Toast.makeText(mContext, toast, Toast.LENGTH_SHORT).show();\n }", "void onMessageToast(String string);", "public static void toastIt(Context context, Toast toast, CharSequence msg) {\n if(toast !=null){\n toast.cancel();\n }\n\n //Make and display new toast\n toast = Toast.makeText(context, msg, Toast.LENGTH_SHORT);\n toast.show();\n }", "@JavascriptInterface\n public void showToast(String toast) {\n Toast.makeText(mContext, toast, Toast.LENGTH_SHORT).show();\n }", "@JavascriptInterface\n public void showToast(String toast) {\n Toast.makeText(mContext, toast, Toast.LENGTH_SHORT).show();\n }", "private void showToast(String text, int length) {\r\n if (toast != null)\r\n toast.cancel();\r\n\r\n toast = Toast.makeText(this, text, length);\r\n toast.show();\r\n }", "protected void showToast(String string)\r\n\t{\n\t\tToast.makeText(MainActivity.this, string, Toast.LENGTH_SHORT).show();\r\n\t}", "private void displayToast(String message) {\n Toast.makeText(OptionActivity.this, message, Toast.LENGTH_SHORT).show();\n }", "@JavascriptInterface\r\n\t public void showToast(String toast) {\r\n\t Toast.makeText(mContext, toast, Toast.LENGTH_SHORT).show();\r\n\t }", "public void showToast(View clickedButton) {\n String greetingText = getString(R.string.greeting_text);\n Toast tempMessage\n = Toast.makeText(this, greetingText,\n Toast.LENGTH_SHORT);\n tempMessage.show();\n }", "private void showToast(String message) {\n\t\tToast toast = Toast.makeText(getApplicationContext(), message,\n\t\t\t\tToast.LENGTH_SHORT);\n\n\t\ttoast.setGravity(Gravity.CENTER | Gravity.CENTER_HORIZONTAL, 0, 0);\n\t\ttoast.show();\n\t}", "private void toastMessage(String message) {\n Toast.makeText(this, message, Toast.LENGTH_SHORT).show();\n\n }", "public static void showToast(Context context, String message, int duration) {\n\n if (message.contains(\"任务\") && !getTopActivity(context).contains(\"HomeActivity\")) {\n return;\n }\n\n if (sIsAllowShow) {\n Toast toast = new Toast(context);\n View view = LayoutInflater.from(context).inflate(R.layout.toast_universal, null);\n TextView messageText = view.findViewById(R.id.toast_universal_message_text);\n messageText.setText(message);\n toast.setDuration(duration);\n toast.setView(view);\n toast.setGravity(Gravity.CENTER, 0, 0);\n toast.show();\n }\n }", "public void onToast (View view)\r\n\t{\r\n\t\t// Respond to the button click\r\n\t\tdoToast ();\r\n\t}", "public void displayToast(String message) {\n displayToast(message, true);\n }", "public void showToast(String text)\n {\n Text icon = GlyphsDude.createIcon(FontAwesomeIconName.CHECK_CIRCLE,\"1.5em\");\n icon.setFill(Color.WHITE);\n Label l = new Label(text) ;\n l.setTextFill(Color.WHITE);\n l.setGraphic(icon);\n snackbar = new JFXSnackbar(PrinciplePane);\n snackbar.enqueue( new JFXSnackbar.SnackbarEvent(l));\n }", "private void displayToast(String paintingDescription) {\n Toast.makeText(this, paintingDescription, Toast.LENGTH_SHORT).show();\n }", "private void mostrarToast () {\n Toast.makeText(this, \"Imagen guardada en la galería.\", Toast.LENGTH_SHORT).show();\n }", "public void showToastMessage(String str) {\n Toast.makeText(self, str, Toast.LENGTH_SHORT).show();\n }", "public static void showToast(Context context, String msg) {\n Toast.makeText(context, msg, Toast.LENGTH_LONG).show();\n }", "public void showToast(final String message, final int length) {\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n Toast.makeText(getApplicationContext(), message, length).show();\n }\n });\n }", "@Override\n public void onClick(View v) {\n\n Toast toast = Toast.makeText(getApplicationContext(), \"Coming soon.\", Toast.LENGTH_SHORT);\n toast.show();\n\n }", "public static void showToast(Context context, String text) {\n //Toast.makeText(context, text, Toast.LENGTH_SHORT).show();\n showToastAtCenter(context, text);\n }", "public static void showToast(Context context, CharSequence message) {\n Toast.makeText(context, message, Toast.LENGTH_SHORT).show();\n }", "@SuppressLint(\"StringFormatMatches\")\n private String createToast(double grade) {\n String message;\n Resources res = getResources();\n message = res.getString(R.string.toast_message, grade);\n return message;\n }", "public void toastKickoff(String message) {\n Toast.makeText(this, message, Toast.LENGTH_LONG).show();\n }", "public void showToastMessage(Context mContext, String msg, int duration) {\n\n //If the call wants to use the default time\n if(duration == -1) {\n duration = LONG;\n }\n\n Toast toast = Toast.makeText(mContext, msg, duration);\n toast.show();\n }", "public void displayToast(String message) {\n Toast.makeText(getApplicationContext(), message,\n Toast.LENGTH_SHORT).show();\n }", "private void toastmessage(String message){\n Toast.makeText(Accountinfo.this,message,Toast.LENGTH_SHORT).show();\n }", "private void showShortMessage(String message) {\n\t\tToast.makeText(getApplicationContext(), message, Toast.LENGTH_SHORT)\n\t\t\t\t.show();\n\t}", "public void displayToastMessage(String msg) {\n\t\tToast toast = Toast.makeText(context, msg, Toast.LENGTH_SHORT);\n\t\ttoast.setGravity(Gravity.CENTER, 0, 0);\n\t\ttoast.show();\n\t}", "public void tong(String msg) {\r\n\t\tToast.makeText(this, msg, Toast.LENGTH_LONG).show();\r\n\t}", "public void toastSuccess(String mensagem){\n\n Context context = getApplicationContext();\n CharSequence text = mensagem;\n int duration = Toast.LENGTH_LONG;\n\n Toast toast = Toast.makeText(context, text, duration);\n\n View view = toast.getView();\n\n //Obtém o plano de fundo oval real do Toast e, em seguida, define o filtro de cores\n view.getBackground().setColorFilter(getResources().getColor(R.color.colorSuccess), PorterDuff.Mode.SRC_IN);\n\n //Obtém o TextView do Toast para que ele possa ser editado\n TextView newText = view.findViewById(android.R.id.message);\n newText.setShadowLayer(0, 0, 0, Color.TRANSPARENT);\n newText.setTextColor(getResources().getColor(R.color.colorWhite));\n\n toast.show();\n\n }", "@Override\n public void onClick(View v) {\n\n String s = v.getTag().toString();\n int duration = Toast.LENGTH_SHORT;\n Toast toast = Toast.makeText(context, s, duration);\n toast.show();\n }", "public void toast(String message) {\n Toast.makeText(mContext, message, Toast.LENGTH_LONG).show();\n }", "public void showToast(final String message){\n\t runOnUiThread(new Runnable() {\n\t public void run()\n\t {\n\t Toast.makeText(VisitMultiplayerGame.this, message, Toast.LENGTH_SHORT).show();\n\t }\n\t });\n\t}", "private static StyleableToast makeToast(String text, @ToastLength int length) {\n StyleableToast st = new StyleableToast(BaseApplication.getInstance(), text, length);\n st.setBackgroundColor(BaseApplication.getInstance().getResources().getColor(R.color.colorPrimary));\n st.setTextColor(Color.WHITE);\n st.setIcon(R.drawable.ic_shape_square_plus_white_24dp);\n st.spinIcon();\n //st.setMaxAlpha();\n //st.show();\n\n return st;\n }", "public void showMessage(String text)\n {\n Toast.makeText(this, text, Toast.LENGTH_SHORT).show();\n }" ]
[ "0.8182652", "0.8182652", "0.8042267", "0.7978238", "0.79541975", "0.79015243", "0.78502", "0.78342235", "0.7810392", "0.7793739", "0.77505296", "0.7710682", "0.76861924", "0.7674831", "0.76509964", "0.76202166", "0.76141113", "0.76095825", "0.7590704", "0.7536439", "0.7532469", "0.7510635", "0.74935704", "0.74842966", "0.7478197", "0.74666107", "0.7460872", "0.7444688", "0.7440933", "0.74408233", "0.7431987", "0.74098885", "0.7402725", "0.739745", "0.73865384", "0.7385236", "0.73783803", "0.73718846", "0.7359339", "0.7347745", "0.7347745", "0.7341919", "0.7341919", "0.73355186", "0.7332374", "0.73050493", "0.7304441", "0.7303541", "0.7303541", "0.7303541", "0.7297317", "0.728068", "0.72715294", "0.7265985", "0.72658396", "0.72564226", "0.72531146", "0.7246511", "0.7245141", "0.7235836", "0.72296166", "0.7219643", "0.7216135", "0.7216135", "0.72014076", "0.7199393", "0.7194803", "0.7194803", "0.71945643", "0.71874166", "0.7178614", "0.7170194", "0.7150445", "0.7132807", "0.7125796", "0.711442", "0.7113389", "0.70978284", "0.70929205", "0.7087745", "0.70779234", "0.70637155", "0.70520437", "0.70439184", "0.7039429", "0.7037363", "0.70357525", "0.70136285", "0.7007956", "0.6997638", "0.6992282", "0.69800156", "0.697874", "0.6978601", "0.6971728", "0.69480515", "0.6938497", "0.69366664", "0.69144464", "0.6894817", "0.6890701" ]
0.0
-1
Makes a Long Toast
public S<T> Ltoast(String text){ Toast t = Toast.makeText(activity, text, Toast.LENGTH_LONG); t.show(); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void toast (String msg, boolean longLength)\n {\n Toast.makeText (getApplicationContext(), msg,\n (longLength ? Toast.LENGTH_LONG : Toast.LENGTH_SHORT)\n ).show ();\n }", "private void makeToast(String message, boolean longToast) {\n\t\tif (longToast)\t{ Toast.makeText(this, message, Toast.LENGTH_LONG).show(); }\n\t\telse\t\t\t{ Toast.makeText(this, message, Toast.LENGTH_SHORT).show(); }\n\t}", "private void showLongToast(final String msg) {\n this.runOnUiThread(new Runnable() {\n @Override\n public void run() {\n Toast.makeText(getApplicationContext(), msg, Toast.LENGTH_LONG).show();\n }\n });\n }", "public void makeToast(String name,int time){\n toast = new Toast(context);\n// toast.setGravity(Gravity.BOTTOM|Gravity.CENTER_HORIZONTAL , 0, SecretMessageApplication.get720WScale(240));\n toast.setDuration(time);\n// toast.setView(layout);\n toast.show();\n\n }", "private void showToast(final String message, final int toastLength) {\n post(new Runnable() {\n @Override\n public void run() {\n Toast.makeText(getActivity(), message, toastLength).show();\n }\n });\n }", "public void ToastPopper(String t){\n Context context = getApplicationContext();\n CharSequence text = t;\n int duration = Toast.LENGTH_LONG;\n\n Toast toast = Toast.makeText(context, text, duration);\n toast.show();\n try {\n Thread.sleep(3000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "@Override\n\tpublic void createToast(String slogan, float duration) {\n\t\tif (Gdx.app.getType() == ApplicationType.Android) {\n\t\t\tgGame.iFunctions.createToast(slogan, duration);\n\t\t} else\n\t\tsuper.createToast(slogan, duration);\n\t}", "public void ToastMessage() {\n\n // create toast message object\n final Toast toast = Toast.makeText(Product_Details_Page_Type_4.this,\n \"Product added to cart\",Toast.LENGTH_LONG);\n // show method call to show Toast message\n toast.show();\n\n // create handler to set duration for toast message\n Handler handler = new Handler() {\n\n @Override\n public void close() {\n // set duration for toast message\n toast.setDuration(100);\n // cancel toast message\n toast.cancel();\n }\n @Override\n public void flush() {}\n\n @Override\n public void publish(LogRecord record) {}\n };\n }", "void toast(int resId);", "static void displayToast(Handler handler, final Context con, final String text, final int toast_length){\n\t\thandler.post(new Runnable(){\n\t\t\tpublic void run(){\n\t\t\t\tToast.makeText(con, text, toast_length).show();\n\t\t\t}\n\t\t});\n\t}", "public void showToast(String string, int length) {\n System.out.println(\"toast:\" + string);\n }", "void toast(CharSequence sequence);", "void showToast(String message);", "void showToast(String message);", "public void tong(String msg) {\r\n\t\tToast.makeText(this, msg, Toast.LENGTH_LONG).show();\r\n\t}", "public void toast(String toast) {\n\t\t// TODO Auto-generated method stub\n\t\t Toast toast1 = Toast.makeText(getApplicationContext(), toast, \n Toast.LENGTH_LONG); \n\t\t toast1.setDuration(1);\n\t\t toast1.show();\n\t\t \n\t}", "static void makeToast(Context ctx, String s){\n Toast.makeText(ctx, s, Toast.LENGTH_SHORT).show();\n }", "private void toast(String aToast) {\n Toast.makeText(getApplicationContext(), aToast, Toast.LENGTH_LONG).show();\n }", "public void notificacionToast(String mensaje){\n Toast toast = Toast.makeText(getApplicationContext(),mensaje,Toast.LENGTH_LONG);\n toast.setGravity(Gravity.CENTER_HORIZONTAL, 0, 0);\n toast.show();\n }", "static public void show(String message, boolean isLongDuration) {\n new UNToast().showInternal(message, isLongDuration);\n }", "private static void showToastText(String infoStr, int TOAST_LENGTH) {\n Context context = null;\n\t\ttoast = getToast(context);\n\t\tTextView textView = (TextView) toast.getView().findViewById(R.id.tv_toast);\n\t\ttextView.setText(infoStr);\n textView.setTypeface(Typeface.SANS_SERIF);\n\t\ttoast.setDuration(TOAST_LENGTH);\n\t\ttoast.show();\n\t}", "private void toastWithTimer(String toToast, boolean important)\n {\n Date timeNow = new Date();\n boolean isAfter = timeNow.after(lastToastFinishes); //did we already pass the last toast finish time?\n\n int toastTime = important ? (int) ((toToast.length() / 75.0) * 2500 + 1000)\n : 1000;\n if (toastTime > 3500) // max toast time is 3500...\n toastTime = 3500;\n\n final int toastTimeFinal = toastTime;\n final Toast toast = Toast.makeText(this, toToast,\n Toast.LENGTH_LONG);\n\n\n if (isAfter)\n {\n toast.show();\n {\n Handler toastCanceller = new Handler();\n toastCanceller.postDelayed(new Runnable()\n {\n @Override\n public void run()\n {\n toast.cancel();\n }\n }, toastTimeFinal);\n }\n // set for when this toast will finish\n lastToastFinishes = simpleUtils.addMillisec(timeNow, toastTime);\n }\n else // if not, need to take care of delay for start as well\n {\n int startIn = simpleUtils.subtractDatesInMillisec(lastToastFinishes, timeNow);//lastToastFinishes - timeNow;\n Handler toastStarter = new Handler();\n toastStarter.postDelayed(new Runnable()\n {\n @Override\n public void run()\n {\n toast.show();\n Handler toastCanceller = new Handler();\n toastCanceller.postDelayed(new Runnable()\n {\n @Override\n public void run()\n {\n toast.cancel();\n }\n }, toastTimeFinal);\n\n }\n }, startIn);\n // set for when this toast will finish\n lastToastFinishes = simpleUtils.addMillisec(lastToastFinishes, toastTime);\n }\n\n }", "private void makeToast(String msg)\n {\n FinanceApp.serviceFactory.getUtil().makeAToast(this, msg);\n }", "private void showToast(String text, int length) {\r\n if (toast != null)\r\n toast.cancel();\r\n\r\n toast = Toast.makeText(this, text, length);\r\n toast.show();\r\n }", "protected void toast() {\n }", "public void showToast(String message, int wordCount) {\n int toastDurationInMilliSeconds = wordCount * 330;\n final Toast mToastToShow = Toast.makeText(getBaseContext(), message, Toast.LENGTH_LONG);\n\n // Set the countdown to display the toast\n CountDownTimer toastCountDown;\n toastCountDown = new CountDownTimer(toastDurationInMilliSeconds, 500 /*Tick duration*/) {\n public void onTick(long millisUntilFinished) {\n mToastToShow.show();\n }\n public void onFinish() {\n mToastToShow.cancel();\n }\n };\n\n // Show the toast and starts the countdown\n mToastToShow.show();\n toastCountDown.start();\n }", "private void showInternal(final String message, final boolean isLongDuration) {\n getCurrentActivity().runOnUiThread(new Runnable() {\n @Override\n public void run() {\n Toast.makeText(getCurrentActivity().getApplicationContext(), message, isLongDuration ? Toast.LENGTH_LONG : Toast.LENGTH_SHORT).show();\n }\n });\n }", "public void showToast(final String message, final int length) {\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n Toast.makeText(getApplicationContext(), message, length).show();\n }\n });\n }", "private void displayToast(CharSequence text){\n Context context = getApplicationContext();\n int duration = Toast.LENGTH_SHORT;\n Toast toast = Toast.makeText(context, text, duration);\n toast.show();\n }", "public void showToastMessage(Context mContext, String msg, int duration) {\n\n //If the call wants to use the default time\n if(duration == -1) {\n duration = LONG;\n }\n\n Toast toast = Toast.makeText(mContext, msg, duration);\n toast.show();\n }", "private void showToast(final int resid) {\n\t\tm_toastHandler.post(new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\tToast.makeText(InstrumentService.this, resid, Toast.LENGTH_SHORT).show();\n\t\t\t}\n\t\t});\n\t}", "void showToast(String value);", "private static StyleableToast makeToast(String text, @ToastLength int length) {\n StyleableToast st = new StyleableToast(BaseApplication.getInstance(), text, length);\n st.setBackgroundColor(BaseApplication.getInstance().getResources().getColor(R.color.colorPrimary));\n st.setTextColor(Color.WHITE);\n st.setIcon(R.drawable.ic_shape_square_plus_white_24dp);\n st.spinIcon();\n //st.setMaxAlpha();\n //st.show();\n\n return st;\n }", "protected void toastshow1() {\n \n\t\tToast toast=Toast.makeText(this, \"image and text\", Toast.LENGTH_LONG);\n\t\t\n\t\tLinearLayout linearLayout=new LinearLayout(this);\n\t\tlinearLayout.setOrientation(LinearLayout.VERTICAL);\n\t\tImageView imageView=new ImageView(this);\n\t\timageView.setImageResource(R.drawable.icon);\n\t\tButton button=new Button(this);\n\t\tbutton.setText(\"progress over\");\n\t\tView toastView=toast.getView();\n\t\tlinearLayout.addView(imageView);\n\t\tlinearLayout.addView(button);\n\t\tlinearLayout.addView(toastView);\n\t\t\n\t\ttoast.setView(linearLayout);\n\t\ttoast.show();\n\t\t\n\t}", "private void showToast(String msg) {\n Toast.makeText(getBaseContext(), msg, Toast.LENGTH_LONG).show();\n }", "protected void showThemedToast(@StringRes final int resourceId, final int length) {\n Toast hint = Toast.makeText(getApplicationContext(), resourceId, length);\n final View hintView = hint.getView();\n hintView.setBackgroundColor(getResources().getColor(R.color.blende_red));\n if (hintView instanceof TextView) {\n ((TextView) hintView).setTextColor(getResources().getColor(android.R.color.white));\n }\n hint.show();\n }", "@Override\n public void onClick(View v) {\n String toastText = \"Hello World\";\n\n // This is how long we want to show the toast\n int duration = Toast.LENGTH_SHORT;\n\n // Get the context\n Context context = getApplicationContext();\n\n // Create the toast\n Toast toast = Toast.makeText(context, toastText, duration);\n\n // Show the toast\n toast.show();\n }", "private void doToast() {\n\t\tEditText editText = (EditText) findViewById(R.id.edit_message);\r\n\t\tString message = editText.getText().toString();\r\n\t\t\r\n\t\t// Create and send toast\r\n\t\tContext context = getApplicationContext();\r\n\t\tint duration = Toast.LENGTH_SHORT;\r\n\t\tToast toast = Toast.makeText(context, message, duration);\r\n\t\ttoast.show();\r\n\t}", "public void toast (String msg)\n\t{\n\t\tToast.makeText (getApplicationContext(), msg, Toast.LENGTH_SHORT).show ();\n\t}", "public void makeToast(String string) {\n Toast.makeText(this, string, Toast.LENGTH_LONG).show();\n }", "public static void toastText(Context context, String s)\n\t{\n\t\tif(Utils.ConstantVars.canToastDebugText) \n\t\t\tToast.makeText(context, s, 2 * Toast.LENGTH_LONG).show();\n\t}", "protected void showToast(CharSequence text) {\r\n\t Context context = getApplicationContext();\r\n\t int duration = Toast.LENGTH_SHORT;\r\n\t \r\n\t Toast toast = Toast.makeText(context, text, duration);\r\n\t toast.show();\r\n\t}", "public static void showToast(Context context, String message, int duration) {\n\n if (message.contains(\"任务\") && !getTopActivity(context).contains(\"HomeActivity\")) {\n return;\n }\n\n if (sIsAllowShow) {\n Toast toast = new Toast(context);\n View view = LayoutInflater.from(context).inflate(R.layout.toast_universal, null);\n TextView messageText = view.findViewById(R.id.toast_universal_message_text);\n messageText.setText(message);\n toast.setDuration(duration);\n toast.setView(view);\n toast.setGravity(Gravity.CENTER, 0, 0);\n toast.show();\n }\n }", "private void makeToast(String string) {\n\t\tToast.makeText(this, string, Toast.LENGTH_SHORT).show();\r\n\r\n\t}", "private void msg(String s)\n {\n Toast.makeText(getApplicationContext(),s,Toast.LENGTH_LONG).show();\n }", "private void msg(String s)\n {\n Toast.makeText(getApplicationContext(),s,Toast.LENGTH_LONG).show();\n }", "protected void toastshow() {\n \n\t\tToast toast=new Toast(getApplicationContext());\n\t\tImageView imageView=new ImageView(getApplicationContext());\n\t\timageView.setImageResource(R.drawable.icon);\n\t\ttoast.setView(imageView);\n\t\ttoast.show();\t\n\t}", "private void toast(String string){\n Toast.makeText(this, string, Toast.LENGTH_SHORT).show();\n }", "public void ting(String msg) {\r\n\t\tToast.makeText(this, msg, Toast.LENGTH_SHORT).show();\r\n\t}", "@Override\n public void toastText(String s){\n Toast.makeText(getApplicationContext(), s, Toast.LENGTH_SHORT).show();\n }", "@JavascriptInterface\n public void showToast(String toast) {\n Toast.makeText(mContext, toast, Toast.LENGTH_LONG).show();\n }", "public void showToast(String msg){\n Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();\n }", "private void toast(String bread) {\n Toast.makeText(getActivity(), bread, Toast.LENGTH_SHORT).show();\n }", "public void showMessage(int i) {\n ToastHelper.showLongToast(getContext().getString(i));\n }", "public void yell(String message){\n Toast.makeText(getApplicationContext(), message, Toast.LENGTH_SHORT).show();\n }", "public void toastMsg(View v){\n String msg = \"Message Sent!\";\n Toast toast = Toast.makeText(this,msg,Toast.LENGTH_SHORT);\n toast.show();\n }", "private static void showToast(String stringToDisplay, Context context) {\n Toast.makeText(context, stringToDisplay, Toast.LENGTH_SHORT).show();\n }", "public static void toastIt(Context context, Toast toast, CharSequence msg) {\n if(toast !=null){\n toast.cancel();\n }\n\n //Make and display new toast\n toast = Toast.makeText(context, msg, Toast.LENGTH_SHORT);\n toast.show();\n }", "public static void displayToast(Context context, String msg) {\n Toast.makeText(context, msg, Toast.LENGTH_LONG).show();\n\n }", "private void msg(String s) {\n Toast.makeText(getApplicationContext(), s, Toast.LENGTH_LONG).show();\n }", "private void msg(String s) {\n Toast.makeText(getApplicationContext(), s, Toast.LENGTH_LONG).show();\n }", "private void msg(String s) {\n Toast.makeText(getApplicationContext(), s, Toast.LENGTH_LONG).show();\n }", "private void displayToast(String paintingDescription) {\n Toast.makeText(this, paintingDescription, Toast.LENGTH_SHORT).show();\n }", "public static void showToast(Context context, String msg) {\n Toast.makeText(context, \"\" + msg, Toast.LENGTH_LONG).show();\n\n }", "@SuppressLint({\"NewApi\"})\n private void showPasteMessage(String str) {\n if (Build.VERSION.SDK_INT >= 11) {\n Toast makeText = Toast.makeText(this.webView.getContext(), str, 1);\n makeText.setGravity(17, 0, 0);\n makeText.show();\n }\n }", "private void toastMessage (String message){\n Toast.makeText(this, message, Toast.LENGTH_SHORT).show();\n }", "private void showErrorToast() {\n }", "private void showToast(String msg) {\r\n Toast.makeText(Imprimir.this, msg, Toast.LENGTH_LONG).show();\r\n }", "@SuppressLint(\"StringFormatMatches\")\n private String createToast(double grade) {\n String message;\n Resources res = getResources();\n message = res.getString(R.string.toast_message, grade);\n return message;\n }", "private void toastMessage(String message){\n Toast.makeText(this,message, Toast.LENGTH_SHORT).show();\n }", "private void toastMessage(String message){\n Toast.makeText(this,message, Toast.LENGTH_SHORT).show();\n }", "@JavascriptInterface\n public void showToast(String toast) {\n Toast.makeText(mContext, toast, Toast.LENGTH_SHORT).show();\n }", "@JavascriptInterface\n public void showToast(String toast) {\n Toast.makeText(mContext, toast, Toast.LENGTH_SHORT).show();\n }", "@JavascriptInterface\n public void showToast(String toast) {\n Toast.makeText(mContext, toast, Toast.LENGTH_SHORT).show();\n }", "@JavascriptInterface\n public void showToast(String toast) {\n Toast.makeText(mContext, toast, Toast.LENGTH_SHORT).show();\n }", "@JavascriptInterface\r\n\t public void showToast(String toast) {\r\n\t Toast.makeText(mContext, toast, Toast.LENGTH_SHORT).show();\r\n\t }", "private void showToast(String message){\n\n Toast.makeText(this, message, Toast.LENGTH_SHORT).show();\n }", "private void displayToast(String message) {\n Toast.makeText(OptionActivity.this, message, Toast.LENGTH_SHORT).show();\n }", "private void makeToast(String message){\n Toast.makeText(SettingsActivity.this, message, Toast.LENGTH_LONG).show();\n }", "public void showToast(String text){\n Toast.makeText(this,text,Toast.LENGTH_SHORT).show();\n }", "public void toastKickoff(String message) {\n Toast.makeText(this, message, Toast.LENGTH_LONG).show();\n }", "void onMessageToast(String string);", "public static void pop(String tart) {\n JWindow toast = Toaster.push(tart);\n\n toast.setOpacity(1);\n toast.setVisible(true);\n\n long startTime = System.currentTimeMillis();\n long endTime = startTime + Constants.TOAST_LIFESPAN;\n\n Timer timer = new Timer(40, (ActionEvent e) -> {\n long currentTime = e.getWhen();\n\n if (currentTime >= endTime) {\n ((Timer) e.getSource()).stop();\n toast.setVisible(false);\n toast.dispose();\n } else {\n long elapsedTime = currentTime - startTime;\n float newOpacity = 1 - ((float) elapsedTime / Constants.TOAST_LIFESPAN);\n toast.setOpacity(newOpacity);\n }\n });\n\n timer.start();\n }", "public static void showToast(@CheckForNull final String msg, final int duration) {\n showToast(msg, duration, false);\n }", "public void DisplayToast(String msg) {\n Toast.makeText(getBaseContext(), msg, Toast.LENGTH_SHORT).show();\n }", "private void showShortMessage(String message) {\n\t\tToast.makeText(getApplicationContext(), message, Toast.LENGTH_SHORT)\n\t\t\t\t.show();\n\t}", "private void displayToast(String message) {\n Toast.makeText(getApplicationContext(), message, Toast.LENGTH_SHORT).show();\n }", "public void cT(String s) { \r\n\t\tToast.makeText(this, s, Toast.LENGTH_SHORT).show();\r\n\t}", "@Override\n public void onClick(View v) {\n\n String s = v.getTag().toString();\n int duration = Toast.LENGTH_SHORT;\n Toast toast = Toast.makeText(context, s, duration);\n toast.show();\n }", "private void showToast(@StringRes int resId) {\n mHandler.post(\n () -> Toast.makeText(mWindowContext, getText(resId), Toast.LENGTH_LONG).show());\n }", "private void showToast(String message) {\n\t\tToast toast = Toast.makeText(getApplicationContext(), message,\n\t\t\t\tToast.LENGTH_SHORT);\n\n\t\ttoast.setGravity(Gravity.CENTER | Gravity.CENTER_HORIZONTAL, 0, 0);\n\t\ttoast.show();\n\t}", "protected void showToast(String message) {\n\tToast.makeText(this, message, Toast.LENGTH_SHORT).show();\n}", "public static void showToast(Context context, String msg) {\n Toast.makeText(context, msg, Toast.LENGTH_LONG).show();\n }", "public void displayToastMessage(String msg) {\n\t\tToast toast = Toast.makeText(context, msg, Toast.LENGTH_SHORT);\n\t\ttoast.setGravity(Gravity.CENTER, 0, 0);\n\t\ttoast.show();\n\t}", "public void showToastMessage(String str) {\n Toast.makeText(self, str, Toast.LENGTH_SHORT).show();\n }", "public void showToast(View view) {\n // Initialize an object named 'toast' using the 'Toast' class\n Toast toast = Toast.makeText(this, R.string.toast_message, Toast.LENGTH_SHORT);\n\n // Use the method 'show()' under the 'Toast' class to show a message\n toast.show();\n }", "private void yell(String str){\n Toast.makeText(this, str, Toast.LENGTH_SHORT).show();\n }", "private void displayToast(String message) {\n\n //get the LayoutInflater and inflate the custom_toast layout\n LayoutInflater view = getLayoutInflater();\n View layout = view.inflate(R.layout.toast, null);\n\n //get the TextView from the custom_toast layout\n TextView text = layout.findViewById(R.id.txtMessage);\n text.setText(message);\n\n //create the toast object, set display duration,\n //set the view as layout that's inflated above and then call show()\n Toast toast = new Toast(getApplicationContext());\n toast.setDuration(Toast.LENGTH_LONG);\n toast.setView(layout);\n toast.show();\n }", "@Override\n public void onClick(View v) {\n\n Toast toast = Toast.makeText(getApplicationContext(), \"Coming soon.\", Toast.LENGTH_SHORT);\n toast.show();\n\n }", "public void displayToast(int resId) {\n displayToast(getString(resId));\n }", "private void toastMessage(String message) {\n Toast.makeText(this, message, Toast.LENGTH_SHORT).show();\n\n }" ]
[ "0.8054911", "0.7958544", "0.7571246", "0.75538874", "0.7521791", "0.75153136", "0.7449814", "0.7411637", "0.7401493", "0.73386896", "0.7338432", "0.7327076", "0.7278404", "0.7278404", "0.7254079", "0.7241294", "0.7224204", "0.7190176", "0.71724725", "0.71639186", "0.7162808", "0.71531415", "0.7144486", "0.7104853", "0.70999146", "0.7051946", "0.7032075", "0.69871825", "0.6978591", "0.69638896", "0.6948199", "0.6943875", "0.6874896", "0.6872941", "0.68715394", "0.685103", "0.68411016", "0.68352574", "0.6833958", "0.6831822", "0.6831082", "0.6822742", "0.6806463", "0.68025416", "0.6802097", "0.6802097", "0.679366", "0.6778061", "0.67571163", "0.6749653", "0.67458063", "0.6734347", "0.6731277", "0.6728375", "0.6720642", "0.67112845", "0.66868", "0.6679776", "0.6674617", "0.66725844", "0.66725844", "0.66725844", "0.6643081", "0.6642258", "0.663646", "0.663494", "0.6631197", "0.66291386", "0.6626707", "0.661654", "0.661654", "0.6613598", "0.6613598", "0.661331", "0.661331", "0.66111755", "0.66087973", "0.6591766", "0.6580347", "0.65673286", "0.65655017", "0.6564132", "0.654674", "0.6536018", "0.6533031", "0.65269583", "0.6526053", "0.6524416", "0.6510617", "0.6501226", "0.6500742", "0.6500197", "0.6492869", "0.6473038", "0.6471322", "0.6464168", "0.64634347", "0.6442757", "0.644072", "0.6426651", "0.6418047" ]
0.0
-1
Makes an alert dialog
public S<T> alert(String title,String text){ AlertDialog alertDialog = new AlertDialog.Builder(activity).create(); alertDialog.setTitle(title); alertDialog.setMessage(text); alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, "OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); alertDialog.show(); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void alert(String message);", "void showAlert(String message);", "private void alert(String title, String msj){\n android.app.AlertDialog.Builder alertDialog = new android.app.AlertDialog.Builder(getActivity());\n alertDialog.setTitle(title);\n alertDialog.setMessage(msj);\n alertDialog.setPositiveButton(getString(R.string.alert_accept), new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n }\n });\n alertDialog.show();\n }", "private void showAlert() {\n AlertDialog.Builder alert = new AlertDialog.Builder(this);\n alert.setMessage(\"Error al autenticar usuario\");\n alert.setPositiveButton(\"Aceptar\", null);\n AlertDialog pop = alert.create();\n alert.show();\n }", "public static void showAlert(String message, Activity context) {\n\n AlertDialog.Builder builder = new AlertDialog.Builder(context);\n builder.setMessage(message).setCancelable(false)\n .setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n\n\n }\n });\n try {\n builder.show();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\n\t\t\t\tdialog.show();\n\t\t\t\t//alert.show();\n\t\t\t\t\n\t\t\t}", "private void show_Alert(String msg) {\n ((TextView) dialog.findViewById(R.id.tv_text)).setText(msg);\n dialog.findViewById(R.id.tv_ok).setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n dialog.dismiss();\n }\n });\n dialog.show();\n }", "private void alert(String title, String message) {\n UIAlertView alertView = new UIAlertView(title, message, null, \"OK\");\n alertView.show();\n }", "public void msgErreur(){\n \n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Entrée invalide\");\n alert.setHeaderText(\"Corriger les entrées invalides.\");\n alert.setContentText(\"Les informations entrées sont erronnées\");\n\n alert.showAndWait();\n \n\n}", "public static void alert(Alert alert) {\n alerter.alert(alert);\n }", "private Alert alert(String AlertText) {\n Alert alert = new Alert(ERROR, AlertText, OK);\n DialogPane dialogPane = alert.getDialogPane();\n dialogPane.getStylesheets().add(getClass().getResource(\"login.css\").toExternalForm());\n dialogPane.getStyleClass().add(\"myDialog\");\n alert.show();\n return alert;\n }", "@SuppressWarnings(\"deprecation\")\n\t\tprivate void alertDialog(String msg) \n\t\t{\n\t\t\tAlertDialog alertDialog = new AlertDialog.Builder(LoginScreenActivity.this).create();\n\t alertDialog.setTitle(\"StyleZ\");\n\t alertDialog.setMessage(msg);\n\t alertDialog.setButton(\"OK\", new DialogInterface.OnClickListener() \n\t {\n\t public void onClick(DialogInterface dialog, int which) {\n\t \t\n\t // Write your code here to execute after dialog closed\n\t dialog.dismiss();\n\t \n\t if(strstatus.equals(\"success\"))\n\t {\n\t Intent i=new Intent(LoginScreenActivity.this,StyleZTab.class);\n\t startActivity(i);\n\t finish();\n\t }\n\t else\n\t {\n\t \t imgviewloginon.setVisibility(View.GONE);\n\t imgviewloginoff.setVisibility(View.VISIBLE);\n\t }\n\t }\n\t });\n\t alertDialog.show();\n\t\t}", "public void alertDialogBasico() {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\r\n\r\n // 2. Encadenar varios métodos setter para ajustar las características del diálogo\r\n builder.setMessage(R.string.dialog_message);\r\n\r\n\r\n builder.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {\r\n public void onClick(DialogInterface dialog, int id) {\r\n\r\n }\r\n });\r\n\r\n\r\n builder.show();\r\n\r\n }", "private void showAlert() {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\r\n builder.setTitle(\"Info..\");\r\n builder.setMessage(\"Your password reset email has been sent!\\n\" +\r\n \"\\n\" +\r\n \"We have sent a password reset email to your email address:\\n\" +\r\n \"\\n\" +\r\n input_email.getText().toString()+\"\\n\" +\r\n \"\\n\" +\r\n \"Please check your inbox to continue.\");\r\n\r\n builder.setPositiveButton(\"Ok\", new DialogInterface.OnClickListener() {\r\n @Override\r\n public void onClick(DialogInterface dialog, int which) {\r\n dialog.dismiss();\r\n finish();\r\n }\r\n });\r\n /* builder.setNegativeButton(\"cancel\", new DialogInterface.OnClickListener() {\r\n @Override\r\n public void onClick(DialogInterface dialog, int which) {\r\n dialog.dismiss();\r\n }\r\n });*/\r\n // create and show the alert dialog\r\n AlertDialog dialog = builder.create();\r\n dialog.show();\r\n }", "public void alert(View view){\n\n show(AppDialog.TAG_ALERT);\n }", "public void alert(String msg) {\n new Alert(msg, \"alertDone\");\n }", "private void showCheckDialog() {\n AlertDialog.Builder showAuditAlert = new AlertDialog.Builder(this); // Create Alert dialog\n showAuditAlert.setTitle(\"Total prize\"); // Set title\n showAuditAlert.setMessage(\"= \"+mydb.getResultDayAudit(year,month,day).intValue()+\"\"); // Set message\n\n showAuditAlert.setPositiveButton(\"Done\",\n new DialogInterface.OnClickListener()\n { // Can hear \"CLICK\"\n @Override\n public void onClick(DialogInterface dialog,int which)\n {\n \tdialog.dismiss(); // CLICK then disappear\n }\n }\n );\n showAuditAlert.show(); // Show dialog that created upper this line\n }", "@Override\n public void onClick(View v) {\n builder.setMessage(R.string.alertMessage)\n .setCancelable(false)\n .setPositiveButton(\"Yes\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n //buClick();\n //finish();\n dialog.cancel();\n calculat();\n\n }\n })\n .setNegativeButton(\"No\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n // Action for 'NO' Button\n dialog.cancel();\n\n }\n });\n //Creating dialog box\n AlertDialog alert = builder.create();\n //Setting the title manually\n alert.setTitle(R.string.alertTitle);\n alert.show();\n }", "public static void alert(String title, String message, AlertType a) {\r\n Alert alert = new Alert(a);\r\n alert.setTitle(title);\r\n alert.setHeaderText(null);\r\n alert.setContentText(message);\r\n //Optional<ButtonType> result = alert.showAndWait();\r\n alert.showAndWait();\r\n }", "private void showDialog() {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(\"User created successfully\");\n builder.setIcon(R.drawable.ic_shield);\n builder.setCancelable(true);\n builder.setPositiveButton(\n \"Continue\",\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n finish();\n }\n });\n AlertDialog alert11 = builder.create();\n alert11.show();\n Window window = alert11.getWindow();\n assert window != null;\n WindowManager.LayoutParams wlp = window.getAttributes();\n wlp.gravity = Gravity.CENTER;\n wlp.y = 270;\n wlp.flags &= ~WindowManager.LayoutParams.FLAG_DIM_BEHIND;\n window.setAttributes(wlp);\n }", "DialogResult show();", "private void showDialog(String msg) {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setMessage(msg)\n .setCancelable(false)\n .setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n }\n });\n AlertDialog alert = builder.create();\n alert.show();\n }", "public static void alert(String message) {\r\n\t Stage window = new Stage();\r\n\r\n\t // Blokira klikanje na druge povrsine sem pop-up\r\n\t window.initModality(Modality.APPLICATION_MODAL);\r\n\t window.setTitle(\"Alert\");\r\n\t window.setMinWidth(250);\r\n\t window.setMinHeight(100);\r\n\t \r\n\t // Label\r\n\t Label label = new Label();\r\n\t label.setText(message);\r\n\t Button closeButton = new Button(\"Close\");\r\n\t closeButton.setOnAction(e -> window.close());\r\n\r\n\t // Layout\r\n\t VBox layout = new VBox(10);\r\n\t layout.getChildren().addAll(label, closeButton);\r\n\t layout.setAlignment(Pos.CENTER);\r\n\r\n\t // Pop-up ostaje aktivan\r\n\t Scene scene = new Scene(layout);\r\n\t window.setScene(scene);\r\n\t window.showAndWait();\r\n\t }", "public void Report_User_alert(){\n final AlertDialog.Builder alert=new AlertDialog.Builder(context,R.style.DialogStyle);\n alert.setTitle(\"Report\")\n .setMessage(\"Are you sure to Report this user?\")\n .setNegativeButton(\"No\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n dialog.dismiss();\n }\n })\n .setPositiveButton(\"yes\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n Send_report();\n }\n });\n\n alert.setCancelable(true);\n alert.show();\n }", "public AlertDialog createAlert(String title,String message) {\n Builder builder = new Builder(currentContext);\n builder.setTitle(title);\n builder.setMessage(message);\n builder.setCancelable(true);\n builder.setPositiveButton(ok, this.new OkOnClickListener());\n alertDialog = builder.create();\n alertDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);\n alertDialog.setCanceledOnTouchOutside(true);\n alertDialog.setCancelable(true);\n if (null != activity && !activity.isFinishing()) {\n alertDialog.show();\n }\n return alertDialog;\n }", "protected void alert(String message) {\n\t\talertWindow.setContentText(message);\n\t\talertWindow.show();\n\t}", "public void createAlertDialog(String msg) {\n\t\tAlertDialog.Builder alertbox = new AlertDialog.Builder(\n\t\t\t\tMainActivity.this);\n\t\talertbox.setTitle(\"Response Message\");\n\t\talertbox.setMessage(msg);\n\t\talertbox.setPositiveButton(\"Ok\", new DialogInterface.OnClickListener() {\n\t\t\t// do something when the button is clicked\n\t\t\tpublic void onClick(DialogInterface arg0, int arg1) {\n\t\t\t}\n\t\t});\n\t\talertbox.show();\n\t}", "public void onClickShowAlert(View view) {\n AlertDialog.Builder myAlertBuilder = new\n AlertDialog.Builder(MainActivity.this);\n // Set the dialog title and message.\n myAlertBuilder.setTitle(\"Alert\");\n myAlertBuilder.setMessage(\"Click OK to continue, or Cancel to stop:\");\n // Add the dialog buttons.\n myAlertBuilder.setPositiveButton(\"OK\", new\n DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n // User clicked OK button.\n Toast.makeText(getApplicationContext(), \"Pressed OK\",\n Toast.LENGTH_SHORT).show();\n }\n });\n myAlertBuilder.setNegativeButton(\"Cancel\", new\n DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n // User cancelled the dialog.\n Toast.makeText(getApplicationContext(), \"Pressed Cancel\",\n Toast.LENGTH_SHORT).show();\n }\n });\n // Create and show the AlertDialog.\n myAlertBuilder.show();\n }", "private void showAlert(String msg) {\n\t\tAlertDialog.Builder builder = new AlertDialog.Builder(this);\n\t\tbuilder.setMessage(msg).setCancelable(false).setPositiveButton(\"Ok\", new DialogInterface.OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(DialogInterface dialog, int id) {\n\t\t\t\tdialog.cancel();\n\t\t\t}\n\t\t});\n\t\tAlertDialog alert = builder.create();\n\t\talert.show();\n\t}", "private void doDialogMsgBuilder() {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setMessage(getResources().getString(R.string.OverAge))\n .setCancelable(false)\n .setPositiveButton(getResources().getString(R.string.ok),\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n finish();\n }\n });\n\n AlertDialog alert = builder.create();\n alert.show();\n }", "private void showAlert(String message) {\n\t\tAlertDialog.Builder builder = new AlertDialog.Builder(this);\n\t\tbuilder.setMessage(message).setTitle(\"Response from Yourcare\")\n\t\t\t\t.setCancelable(false)\n\t\t\t\t.setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n\t\t\t\t\tpublic void onClick(DialogInterface dialog, int id) {\n\t\t\t\t\t\t// do nothing\n\t\t\t\t\t\t\n\n\t\t\t\t\t\tIntent intent = new Intent(getApplicationContext(),CapturePrescriptionActivity.class);\n\t\t\t\t\t\tstartActivity(intent);\n\t\t\t\t\t\tfinish();\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t});\n\t\tAlertDialog alert = builder.create();\n\t\talert.show();\n\t}", "private void alert(String message) {\n\t\tAlertDialog alert = new AlertDialog.Builder(this).setTitle(getString(R.string.warning)).setMessage(message)\n\t\t\t\t.setNeutralButton(getString(R.string.ok), new DialogInterface.OnClickListener() {\n\t\t\t\t\tpublic void onClick(DialogInterface dialog, int id) {\n\t\t\t\t\t\t// TODO maybe implement ? controller.connect();\n\t\t\t\t\t\tdialog.cancel();\n\t\t\t\t\t}\n\t\t\t\t}).create();\n\t\talert.show();\n\t}", "public void CustomAlertSave2(String msg) {\n\t\tfinal Dialog dialog = new Dialog(context);\r\n\t\t// hide to default title for Dialog\r\n\t\tdialog.requestWindowFeature(Window.FEATURE_NO_TITLE);\r\n\t\t// inflate the layout dialog_layout.xml and set it as contentView\r\n\t\tLayoutInflater inflater = (LayoutInflater) context\r\n\t\t\t\t.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\r\n\t\tView view = inflater.inflate(R.layout.dialog_layout, null, false);\r\n\t\tdialog.setCanceledOnTouchOutside(true);\r\n\t\tdialog.setContentView(view);\r\n\t\tdialog.getWindow().setBackgroundDrawable(new ColorDrawable(0));\r\n\t\tTextView txtTitle = (TextView) dialog\r\n\t\t\t\t.findViewById(R.id.txt_alert_message);\r\n\t\ttxtTitle.setText(msg);\r\n\r\n\t\tButton btn_ok = (Button) dialog.findViewById(R.id.btn_ok);\r\n\t\tbtn_ok.setOnClickListener(new android.view.View.OnClickListener() {\r\n\r\n\t\t\tpublic void onClick(View v) {\r\n\t\t\t\tdialog.dismiss();\r\n\r\n\t\t\t}\r\n\r\n\t\t});\r\n\t\tdialog.show();\r\n\t}", "private void alert(String string) {\n\r\n\t}", "public static void alertDialog(final String message) {\r\n _app.invokeLater(new Runnable() {\r\n public void run() {\r\n Dialog.alert(message);\r\n }\r\n });\r\n }", "private void showAlert(String message) {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setMessage(message);\n builder.show();\n }", "AlertDialog getAlertDialog();", "private void alert(String title, String msg) {\n if (title.isEmpty() || msg.isEmpty()) {\n return;\n }\n if (isFinishing()) {\n return;\n }\n new AlertDialog.Builder(this).setTitle(title).setMessage(msg)\n .setIcon(android.R.drawable.ic_dialog_info)\n .setNeutralButton(R.string.ok, null).show();\n }", "public static native void alert(String texto)/*-{\n\t\t\t\n\t\t\t$wnd.bootbox.alert(texto);\t\n\t\n\t\n\t}-*/;", "public static void alert(String title, String header, String message, AlertType a) {\r\n Alert alert = new Alert(a);\r\n alert.setTitle(title);\r\n alert.setHeaderText(header);\r\n alert.setContentText(message);\r\n //Optional<ButtonType> result = alert.showAndWait();\r\n alert.showAndWait();\r\n }", "static void showAlert(final Context con, final String title, final String msg){\n \tAlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(con);\n \n\t\t\t// set title\n\t\talertDialogBuilder.setTitle(title);\n\t\talertDialogBuilder.setMessage(msg).setCancelable(true)\n\t\t\t\t.setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n\n\t\t @Override\n\t\t public void onClick(DialogInterface dialog, int which) {\n\t\t // TODO Auto-generated method stub\n\t\t // Do something\n\t\t dialog.dismiss();\n\t\t }\n\t\t });\n\t\t\n\t\tAlertDialog alertDialog = alertDialogBuilder.create();\n\t\talertDialog.show();\n }", "private void alertDialog(int title, int message, int icon) {\n tst_Message.cancel();\n tst_Message = null;\n AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);\n builder.setTitle(title);\n builder.setMessage(message);\n builder.setIcon(icon);\n builder.setPositiveButton(R.string.dialog_pos_btn, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n reset();\n }\n });\n builder.show();\n }", "private void alertBox(String title, String message) {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setMessage(\"GPS Anda tampaknya dinonaktifkan, apakah Anda ingin mengaktifkannya?\")\n .setCancelable(false)\n .setTitle(\"STATUS GPS\")\n .setPositiveButton(\n \"YA\",\n new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n /* this gonna call class of settings then dialog interface disappeared */\n Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);\n startActivity(intent);\n dialog.cancel();\n }\n }\n )\n .setNegativeButton(\"TIDAK\", new DialogInterface.OnClickListener() {\n public void onClick(final DialogInterface dialog, @SuppressWarnings(\"unused\") final int id) {\n dialog.cancel();\n }\n }\n );\n AlertDialog alertDialog = builder.create();\n alertDialog.show();\n }", "private void showAlert(String message) {\n\n if (message.equals(\"Uploaded Successfully...\")) {\n // this.dismiss();\n commmunicator.onDialogMessage(new MessageDetails());\n this.dismiss();\n\n } else {\n\n AlertDialog.Builder builder = new AlertDialog.Builder(form.getContext());\n builder.setMessage(message).setTitle(\"Response from Servers\")\n .setCancelable(false)\n .setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n // do nothing\n }\n });\n AlertDialog alert = builder.create();\n alert.show();\n }\n }", "private void alertDialoge() {\n builder.setMessage(R.string.dialoge_desc).setTitle(R.string.we_request_again);\n\n builder.setCancelable(false)\n .setPositiveButton(R.string.give_permissions, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n requestPermission();\n }\n })\n .setNegativeButton(R.string.dont_ask_again, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n // Action for 'Don't Ask Again' Button\n // the sharedpreferences value is true\n editor.putBoolean(getResources().getString(R.string.dont_ask_again), true);\n editor.commit();\n dialog.cancel();\n }\n });\n //Creating dialog box\n AlertDialog alert = builder.create();\n alert.show();\n }", "public void alert(String txtMsg, final String action, final View btn_view)\n {\n LayoutInflater inflator = LayoutInflater.from(BookingDetailsActivity.this);\n final View yourCustomView = inflator.inflate(R.layout.custom_dialog, null);\n //endregion\n\n //region (2) init dialogue\n final AlertDialog dialog = new AlertDialog.Builder(BookingDetailsActivity.this)\n .setTitle(\"Do you want to proceed ?\")//replace w \"txtMsg\"\n .setView(yourCustomView)\n .create();\n //endregion\n\n //region (3) set onClicks for custom dialog btns\n yourCustomView.findViewById(R.id.btn_yes).setOnClickListener(new View.OnClickListener()\n {\n @Override\n public void onClick(View view)\n {\n switch (action)\n {\n case \"save\":\n SaveAppoint(btn_view);\n break;\n case \"cancel\":\n CancelAppoint(btn_view);\n break;\n }\n }\n });\n yourCustomView.findViewById(R.id.btn_no).setOnClickListener(new View.OnClickListener()\n {\n @Override\n public void onClick(View view)\n {\n dialog.dismiss();\n }\n });\n //endregion\n\n //region (4) Display dialogue\n dialog.show();\n //endregion\n }", "private void showAlertDialog() {\n new AlertDialog.Builder(getActivity())\n .setMessage(R.string.feedback_sharing_data_alert)\n .setCancelable(false)\n .setPositiveButton(R.string.ok, (dialog, which) -> {\n sendFeedback();\n })\n .show();\n }", "@Override\n public void handle(ActionEvent event) {\n alert = new Alert(AlertType.CONFIRMATION);\n //Optional title. If not used the standard title \"Confiramation\" will be displayed\n //To remove the title use alert.setTitle(null);\n alert.setTitle(\"Confirmation Dialog\");\n //Optional header.If not used the standard header \"Confiramation\" will be displayed\n //To remove the title use alert.setHeaderText(null); \n alert.setHeaderText(\"Please answer the question!\");\n alert.setContentText(initText);\n //Display the dialog and get the result from the user action\n Optional<ButtonType> result = alert.showAndWait();\n if (result.get() == ButtonType.OK){\n // the user clicked OK\n alert = new Alert(AlertType.INFORMATION);\n alert.setTitle(\"Information Dialog\");\n alert.setHeaderText(\"Important message for you!\");\n alert.setContentText(\"Happiness is ephemeral!\");\n alert.showAndWait(); \n //the user clocked Cancel\n } else {\n // ... user chose CANCEL or closed the dialog\n //Warning Dialog\n alert = new Alert(AlertType.WARNING);\n alert.setTitle(\"Warning Dialog\");\n alert.setHeaderText(\"Read the Warning!\");\n alert.setContentText(\"You must like Java - Shall make you Happy!\");\n alert.showAndWait(); \n }\n }", "private void showAlert(String message) {\n //Builds an AlertDialog with message, title, if cancellable, and what the positive button does\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n builder.setMessage(message).setTitle(\"Response from Servers\")\n .setCancelable(false)\n .setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n // do nothing\n }\n });\n AlertDialog alert = builder.create();\n alert.show();\n// String errorMessage = null;\n// try {\n// JSONObject arr = new JSONObject(message);\n// errorMessage = arr.getString(\"error\");\n// } catch (JSONException e) {\n// e.printStackTrace();\n// }\n// Toast.makeText(getActivity(), errorMessage, Toast.LENGTH_LONG).show();\n\n }", "private void showAlert(){\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity())\n .setTitle(\"Your further details please:\")\n .setView(view);\n builder.setPositiveButton(\"Proceed\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n Intent it = new Intent(getActivity(), StudentFurtherDetails.class);\n getActivity().startActivity(it);\n }\n\n });\n //call api for insertion\n builder.setNegativeButton(\"Later\", null)\n .setCancelable(false);\n AlertDialog alert = builder.create();\n alert.show();\n }", "public static void alertbox_Accept() throws CheetahException {\n\t\ttry {\n\t\t\tSystem.out.println(\"Step into alert box\");\n\t\t\tAlert simpleAlert = CheetahEngine.getDriverInstance().switchTo().alert();\n\t\t\tsimpleAlert.accept();\n\t\t} catch (Exception e) {\n\t\t\tthrow new CheetahException(e);\n\t\t}\n\t}", "void AlertaValidacion(String title, String message){\n AlertDialog.Builder builder = new AlertDialog.Builder(RegisterActivity.this);\n builder.setTitle(title);\n builder.setMessage(message).setPositiveButton(\"ACEPTAR\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n\n }\n });\n AlertDialog alert = builder.create();\n alert.show();\n }", "private void showAlert(String status, String msg){\n android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(HostelRequestActivity.this)\n .setTitle(status)\n .setMessage(msg);\n builder.setPositiveButton(\"Ok\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n onBackPressed();\n }\n\n });\n //call api for insertion\n builder.setCancelable(false);\n android.app.AlertDialog alert = builder.create();\n alert.show();\n }", "private void showAlertDialog(String message) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity())\n .setTitle(\"QR Scanner\")\n .setMessage(message)\n .setPositiveButton(\"OKAY\", (dialog, which) -> {\n dialog.dismiss();\n });\n AlertDialog alertDialog = builder.create();\n alertDialog.show();\n }", "public void showAlert(String cadena, Context ctx){\n AlertDialog.Builder alertbox = new AlertDialog.Builder(ctx);\n //seleccionamos la cadena a mostrar\n alertbox.setMessage(cadena);\n alertbox.show();\n\n }", "public AlertDialog createSimpleDialog() {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(\"Code with love by\")\n .setMessage(\"Alvaro Velasco & Jose Alberto del Val\");\n return builder.create();\n }", "public static void crearAlerta(String titulo,String mensaje){\n Alert alert=new Alert(Alert.AlertType.WARNING);\n alert.setHeaderText(null);\n alert.setTitle(titulo);\n alert.setContentText(mensaje);\n alert.showAndWait();\n }", "public static void AlertAccept() {\n\t\tAlert alt = Browser.Driver.switchTo().alert();\n\t\talt.accept();\n\t}", "private void alertBox_service(String title, String msg) {\r\n\t\tAlertDialog.Builder service_alert = new AlertDialog.Builder(this.mContext);\r\n\t\tservice_alert.setTitle(title);\r\n\t\tservice_alert.setMessage(msg);\r\n\t\tservice_alert.setNeutralButton(\"OK\",new DialogInterface.OnClickListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onClick(DialogInterface dialog, int which) {\r\n\t\t\t\tdialog.dismiss();\r\n\r\n\t\t\t}\r\n\t\t});\r\n\t\tservice_alert.show();\r\n\t}", "public static native void alert(String msg) /*-{\r\n $wnd.alert(msg);\r\n }-*/;", "public void alertForOuitMessage() {\n final AlertDialog.Builder builder = new AlertDialog.Builder(context);\n final AlertDialog alert = builder.create();\n alert.getWindow().getAttributes().windowAnimations = R.style.alertAnimation;\n View view = alert.getLayoutInflater().inflate(R.layout.quiz_quit_alert, null);\n TextView title1 = (TextView) view.findViewById(R.id.title1);\n title1.setText(context.getString(R.string.quiz_quit_are));\n title1.setTypeface(VodafoneRg);\n TextView title2 = (TextView) view.findViewById(R.id.title2);\n title2.setText(context.getString(R.string.quiz_quit_progress));\n title2.setTypeface(VodafoneRg);\n TextView quiz_text = (TextView) view.findViewById(R.id.quit_text);\n quiz_text.setTypeface(VodafoneRg);\n LinearLayout quit_layout = (LinearLayout) view.findViewById(R.id.quit_layout);\n alert.setCustomTitle(view);\n TextView quit_icon = (TextView) view.findViewById(R.id.quit_icon);\n quit_icon.setTypeface(materialdesignicons_font);\n quit_icon.setText(Html.fromHtml(\"&#xf425;\"));\n quit_layout.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n alert.dismiss();\n finish();\n }\n });\n alert.show();\n }", "@SuppressWarnings(\"deprecation\")\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tAlertDialog alertDialog = new AlertDialog.Builder(GameInitializerActivity.this).create();\n\t\t\t\tLayoutInflater factory = LayoutInflater.from(GameInitializerActivity.this);\n\t\t\t\tfinal View view = factory.inflate(R.layout.activity_about_popupwindow, null);\n\t\t\t\talertDialog.setView(view);\n\t\t\t\talertDialog.setButton3(\"OK. I Got this !!\", dialogClickListener);\n\t\t\t\talertDialog.show();\t\t\t\t\n\t\t\t\t\n\t\t\t}", "public void showAlertDialog(String title, String message) {\n\n\t\t// Create an object of alert class for an activity\n\t\tAlertDialog alertDialog = new AlertDialog.Builder(objContext).create();\n\n\t\t// Setting Dialog Title\n\t\talertDialog.setTitle(title);\n\n\t\t// Setting Dialog Message\n\t\talertDialog.setMessage(message);\n\n\t\t// Setting Icon to Dialog\n\t\talertDialog.setIcon(R.drawable.ic_launcher);\n\n\t\talertDialog.setButton(DialogInterface.BUTTON_POSITIVE, \"Ok\", new DialogInterface.OnClickListener() {\n\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\tdialog.dismiss();\n\t\t\t}\n\t\t});\n\t\talertDialog.show();\n\t}", "public void showAlertMessage(String message) {\n AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(context);\n alertDialogBuilder.setMessage(message).setCancelable(false).setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n }\n });\n AlertDialog alertdialog = alertDialogBuilder.create();\n alertdialog.show();\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 }", "public void showMessage(){\n final AlertDialog.Builder alert = new AlertDialog.Builder(context);\n alert.setMessage(message);\n alert.setTitle(title);\n alert.setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n alert.create().dismiss();\n }\n });\n alert.create().show();\n }", "public S<T> alert(String text){\n\t\t\n\t\tAlertDialog alertDialog = new AlertDialog.Builder(activity).create();\n\t\talertDialog.setTitle(\"Alert\");\n\t\talertDialog.setMessage(text);\n\t\talertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, \"OK\",\n\t\t new DialogInterface.OnClickListener() {\n\t\t public void onClick(DialogInterface dialog, int which) {\n\t\t dialog.dismiss();\n\t\t }\n\t\t });\n\t\talertDialog.show();\n\t\treturn this;\n\t}", "private AlertDialog alertBuilder() {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setMessage(\"Missing Arduino Unit, go to Settings?\").\n setCancelable(false).setPositiveButton(\n \"Yes\", new DialogInterface.OnClickListener() {\n\n public void onClick(DialogInterface dialog, int id) {\n //call qr scan intent\n Intent prefScreen = new Intent(TempMeasure.this, Preferences.class);\n startActivityForResult(prefScreen, 0);\n }\n }).setNegativeButton(\"No\", new DialogInterface.OnClickListener() {\n\n public void onClick(DialogInterface dialog, int id) {\n dialog.cancel();\n }\n });\n AlertDialog alert = builder.create();\n return alert;\n }", "private void alertDialogBuilder(String message) {\n\t\tAlertDialog.Builder builder = new AlertDialog.Builder(this);\n\t\tbuilder.setMessage(message)\n\t\t\t\t.setCancelable(false)\n\t\t\t\t.setPositiveButton(\"Yes\",\n\t\t\t\t\t\tnew DialogInterface.OnClickListener() {\n\t\t\t\t\t\t\tpublic void onClick(DialogInterface dialog, int id) {\n\t\t\t\t\t\t\t\tdbHelper.clearResults();\n\t\t\t\t\t\t\t\tfillData();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t.setNegativeButton(\"No\", new DialogInterface.OnClickListener() {\n\t\t\t\t\tpublic void onClick(DialogInterface dialog, int id) {\n\t\t\t\t\t\tdialog.cancel();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\tAlertDialog alert = builder.create();\n\t\talert.show();\n\t}", "private void showLoserDialog() {\n Alert alert = new Alert(Alert.AlertType.CONFIRMATION, \"You Have Been Defeated \" + player1.getName() + \",Computer Wins!!\", new ButtonType(\"Close\", ButtonBar.ButtonData.NO), new ButtonType(\"Try Again?\", ButtonBar.ButtonData.YES));\n alert.setGraphic(new ImageView(new Image(this.getClass().getResourceAsStream(\"/Images/bronze.png\"))));\n alert.setHeaderText(null);\n alert.setTitle(\"Computer Wins\");\n alert.showAndWait();\n if (alert.getResult().getButtonData() == ButtonBar.ButtonData.YES) {\n onReset();\n }\n }", "public void alert(String msg) {\n\t\tJOptionPane.showMessageDialog(rootPane, msg);\n\t}", "public static void aboutApp(){\n\t\tAlert alertDialog = new Alert(Alert.AlertType.INFORMATION);\n\t\talertDialog.setTitle(\"My first java Desktop App\");\n\t\talertDialog.setHeaderText(\"Learning JavaFX\");\n\t\talertDialog.setContentText(\"I'm a beginner and soon i'll be a pro\");\n\n\t\t//to make custom buttons\n\t\tButtonType yesBtn = new ButtonType(\"yes\");\n\t\tButtonType noBtn = new ButtonType(\"No\");\n\t\talertDialog.getButtonTypes().setAll(yesBtn,noBtn);\n\n\t\t//to perform click event on buttons of the dilague box that opens and make buttons\n\t\tOptional<ButtonType> clickBtn=alertDialog.showAndWait();\n\t\tif(clickBtn.isPresent()&&clickBtn.get()==yesBtn){\n\t\t\t// code .......\n\t\t}\n\t\tif(clickBtn.get()==noBtn){\n\t\t\t//code..........\n\t\t}\n\n\t\talertDialog.show();\n\t}", "public void acceptAlert() {\n\t\tAlert popUp = null;\n\t\ttry {\n\t\t\tpopUp = getDriver().switchTo().alert();\n\t\t\tpopUp.accept();\n\t\t} catch (NoAlertPresentException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "private void SuccessfulBox(View v){\n \t//create an alert box with specified properties\n \tnew AlertDialog.Builder(this)\n \t.setTitle(\"Submit Successfully!\")\n \t.setMessage(\"New prescription information has been added to\" + \" \" +item)\n \t.setNeutralButton(\"ok\", null)\n \t.show();\n }", "private void showErrorAlert()\n {\n \tAlertDialog.Builder builder = new AlertDialog.Builder(this);\n \tbuilder.setMessage(getResources().getString(R.string.app_error_str))\n \t .setCancelable(false)\n \t .setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n \t public void onClick(DialogInterface dialog, int id) {\n \t dialog.cancel();\n \t }\n \t });\n \t \n \tAlertDialog alert = builder.create();\n \talert.show();\n }", "@When(\"^User will click on show alert box$\")\r\n\tpublic void user_will_click_on_show_alert_box() throws Throwable {\n\t\tSystem.out.println(\"User will click on alert button\");\r\n\t}", "public void acceptPopUp(WebDriver driver)\r\n\t{\n\t\tAlert alert=driver.switchTo().alert();\r\n\t\t\t\r\n\t\t//accept the alert\r\n\t\talert.accept();\r\n\t}", "@Test\n public void basicAlertHandlingTest(){\n\n WebElement alertButton = driver.findElement(By.id(\"alertexamples\"));\n alertButton.click();\n String alertMessage = \"I am an alert box!\";\n\n assertEquals(alertMessage, driver.switchTo().alert().getText());\n driver.switchTo().alert().accept();\n }", "public void showAlertDialog(View v){\n AlertDialog.Builder alert = new AlertDialog.Builder(this);\n alert.setTitle(\"Update Details\");\n alert.setMessage(\"Do you really want to update details?\");\n\n //if customer click yes\n alert.setPositiveButton(\"Yes\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n Toast.makeText(MEditProfile.this, \"Update Successfully\", Toast.LENGTH_SHORT).show();\n }\n });\n //if customer click no\n alert.setNegativeButton(\"No\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n Toast.makeText(MEditProfile.this,\"\",Toast.LENGTH_SHORT).show();\n }\n });\n alert.create().show();\n }", "public void acceptAlert() {\n WebDriverWait wait = new WebDriverWait(getDriver(), timeOut);\n wait.until(ExpectedConditions.alertIsPresent());\n getDriver().switchTo().alert().accept();\n }", "private void showInputDialog() {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(\"App info\");\n builder.setMessage(message);\n builder.setPositiveButton(\" Done \", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n dialog.dismiss();\n }\n });\n builder.show();\n }", "@Override\n public void onClick(View v)\n {\n AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(activity, R.style.AppTheme));\n dialogBuilder.setView(viewConfirmDialog);\n AlertDialog alertDialog= dialogBuilder.create();\n Window windowAlert = alertDialog.getWindow();\n WindowManager.LayoutParams layoutConfirmDialog = new WindowManager.LayoutParams();\n layoutConfirmDialog.copyFrom(windowAlert.getAttributes());\n layoutConfirmDialog.width = 320;\n layoutConfirmDialog.height = 320;\n alertDialog.getWindow().setAttributes(layoutConfirmDialog);\n dismissAlertDialog();\n components.alertDialog = alertDialog;\n alertDialog.show();\n\n }", "protected void alertbox(String title, String mymessage) {\n \t\t// add scrollview to alertbox\n \t\tnew AlertDialog.Builder(this)\n \t\t\t\t.setMessage(mymessage)\n \t\t\t\t.setTitle(title)\n \t\t\t\t.setView(LayoutInflater.from(this).inflate(R.layout.scroll_result,null))\n \t\t\t\t.setCancelable(true)\n \t\t\t\t.setNeutralButton(\"Done\",\n \t\t\t\t\t\tnew DialogInterface.OnClickListener() {\n \t\t\t\t\t\t\tpublic void onClick(DialogInterface dialog,\n \t\t\t\t\t\t\t\t\tint whichButton) {\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t}).show();\n \t}", "private void confirmationAlert() {\n\t\tAlert confirm = new Alert( AlertType.CONFIRMATION, \"You Will Not Be Able To Change Your Name\\nAfter You Press 'OK'.\");\n\t\tconfirm.setHeaderText(\"Are You Sure?\");\n confirm.setTitle(\"Confirm Name\");\n confirm.showAndWait().ifPresent(response -> {\n if (response == ButtonType.OK) {\n \tbackground.remove( pointer );\n \tkeyStrokes = keyStrokes.replace(\" \", \"-\");\n\t\t\t\tinsertNewHiScore();\n\t\t\t\tnewHighScore = false;\n }\n });\n\t}", "@Override\r\n\t\tpublic void onClick(View v) {\n\t\t\tAlertDialog.Builder builder=new AlertDialog.Builder(getActivity());\t\r\n\t\t\tbuilder.setTitle(\"Version 1.0\")\r\n\t\t\t.setMessage(\"With the App User Easily get the Work and directly Interact with Admin.\");\r\n\t\tbuilder.setNegativeButton(\"CLOSE\", new DialogInterface.OnClickListener() {\r\n public void onClick(DialogInterface dialog, int which) {\r\n // Write your code here to execute after dialog closed\r\n Toast.makeText(getActivity().getApplicationContext(), \"You clicked on CLOSE\", Toast.LENGTH_SHORT).show();\r\n }\r\n });\r\n \r\n // Showing Alert Message\r\n builder.show();\r\n\t\t}", "private void popupCalibratingDialog() {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(R.string.motion_calibrating);\n builder.setCancelable(false);\n builder.setMessage(R.string.motion_calibrating_message);\n\n calibratingDialog = builder.create();\n calibratingDialog.show();\n }", "public void alert(String msg)\n {\n this.ui.alert(msg);\n theLogger.info(\"Alert sent to UI\");\n }", "private void sendAlert(String message, Alert.AlertType type) {\n Alert alert = new Alert(type);\n alert.setTitle(\"Submission Error\");\n alert.setHeaderText(null);\n alert.setContentText(message);\n alert.showAndWait();\n }", "private void createAlertDialog(String title, String message, final boolean shouldExit) {\n Collect.getInstance().getActivityLogger().logAction(this, \"createAlertDialog\", \"show\");\n mAlertDialog = new AlertDialog.Builder(this).create();\n mAlertDialog.setTitle(title);\n mAlertDialog.setMessage(message);\n DialogInterface.OnClickListener quitListener = new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int i) {\n switch (i) {\n case DialogInterface.BUTTON1: // ok\n Collect.getInstance().getActivityLogger().logAction(this, \"createAlertDialog\", \"OK\");\n // successful download, so quit\n if (shouldExit) {\n finish();\n }\n break;\n }\n }\n };\n mAlertDialog.setCancelable(false);\n mAlertDialog.setButton(getString(R.string.ok), quitListener);\n mAlertDialog.setIcon(android.R.drawable.ic_dialog_info);\n mAlertDialog.show();\n }", "public static void alert(AlertType type, String title, String message) {\n\t\tAlert alert = new Alert(type);\n\t\talert.setTitle(title);\n\t\talert.setContentText(message);\n\t\talert.show();\n\t}", "public static void acceptAlertPopup() throws InterruptedException{\n \ttry {\n \t\talert = driver.switchTo().alert();\n \t\tSystem.out.println(alert.getText());\n \t\tThread.sleep(2000);\n \t\talert.accept();\n \t\tlog.info(\"Alert Accepted\");\n \t }\n \tcatch(Exception e) {\n \t\tSystem.out.println(\"Alert Error : acceptAlertPopup()\");\n \t }\n }", "void ShowWaitDialog(String title, String message);", "private void showHelp(){\n AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this,R.style.MyDialogTheme);\n alertDialogBuilder.setMessage(\"Welcome to NBA Manager 2019\\n\\n\" +\n \"The purpose of the application is to simulate a basketball manager game and draft a team.\\n\\n\" +\n \"You can view your current roster by pressing the right arrow in the top right corner.\\n\\n\" +\n \"*Not all players will have a height or a weight.\");\n alertDialogBuilder.setPositiveButton(\"Ok\",\n new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface arg0, int arg1) {\n }\n });\n AlertDialog alertDialog = alertDialogBuilder.create();\n alertDialog.show();\n }", "public void actionPerformed (ActionEvent e)\n\t\t\t\t{\n\t\t\t\talertOK();\n\t\t\t\t}", "@Then(\"^User should see a predefined alert box$\")\r\n\tpublic void user_should_see_a_predefined_alert_box() throws Throwable {\n\t\tSystem.out.println(\"Alert message pop-ups on the screen\");\r\n\t}", "public void working() {\n\t\t Dialog d = new Dialog(this);\r\n\t\t d.setTitle(\"hech yea!\");\r\n\t\t TextView tv = new TextView(this);\r\n\t\t tv.setText(\"Success\");\r\n\t\t d.setContentView(tv);\r\n\t\t d.show();\t\r\n\t}", "public void AlertBox(String title, String message, int width, int height) {\n //Creating the stage and modifying its settings for the alertBox\n Stage window = new Stage();\n window.initModality((Modality.APPLICATION_MODAL));\n window.setTitle(title);\n window.centerOnScreen();\n\n //Creating the layout for the box\n VBox layout = new VBox();\n layout.setAlignment(Pos.CENTER);\n layout.setSpacing(5);\n Label messageToDisplay = new Label(message);\n //Event handling\n Button okButton = new Button(\"Ok\");\n okButton.setOnAction(e -> window.close());\n layout.getChildren().addAll(messageToDisplay, okButton);\n\n\n Scene scene = new Scene(layout, width, height);\n window.setScene(scene);\n window.setResizable(false);\n window.showAndWait();\n\n }", "private void showbadgedialog() {\n final LayoutInflater li = LayoutInflater.from(mContext);\n //Creating a view to get the dialog box\n View confirmDialog = li.inflate(R.layout.dialog_badges, null);\n // number=session.getMobileNumber();\n //Initizliaing confirm button fo dialog box and edittext of dialog box\n final Button buttonconfirm = (Button) confirmDialog.findViewById(R.id.buttonConfirm);\n\n\n AlertDialog.Builder alert = new AlertDialog.Builder(mContext);\n\n alert.setView(confirmDialog);\n\n final AlertDialog alertDialog = alert.create();\n alertDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));\n alertDialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);\n\n alertDialog.show();\n\n //On the click of the confirm button from alert dialog\n buttonconfirm.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n alertDialog.dismiss();\n }\n });\n\n }", "public static void alert(Context c, String msg) {\n\t\talert(c, msg, new OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\n\t\t\t\tif (dialog != null)\n\t\t\t\t\tdialog.dismiss();\n\t\t\t}\n\t\t});\n\t}", "private void answerResultAlert(String feedback){\n AlertDialog.Builder showResult = new AlertDialog.Builder(this);\n\n showResult.setTitle(feedback);\n showResult.setMessage(currentQuestion.getExplanation());\n showResult.setCancelable(false); //if this is not set, the user may click outside the alert, cancelling it. no cheating this way\n showResult.setNeutralButton(\"ok\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n //only when the ok is clicked will continue to run the program\n setUpQuestions();\n }\n });\n showResult.create();\n showResult.show();\n }" ]
[ "0.76374984", "0.7629751", "0.7358751", "0.73349357", "0.73304754", "0.7327125", "0.72602963", "0.72557676", "0.72481644", "0.7205927", "0.7171638", "0.71636444", "0.7159702", "0.71408737", "0.7140703", "0.71299905", "0.71291333", "0.7114488", "0.7093806", "0.7087516", "0.7087439", "0.7085423", "0.70596904", "0.7043375", "0.702417", "0.701276", "0.70065755", "0.69758904", "0.6945964", "0.69450927", "0.6937846", "0.69335836", "0.6917747", "0.6906071", "0.69027674", "0.6894314", "0.68761873", "0.6870708", "0.6866762", "0.6865367", "0.68597627", "0.6851794", "0.6839529", "0.68238944", "0.6817803", "0.68054026", "0.67994845", "0.67822456", "0.6770955", "0.67600584", "0.67600006", "0.6747362", "0.67446303", "0.6724502", "0.66983503", "0.66960335", "0.669318", "0.6685258", "0.6682958", "0.668207", "0.6679872", "0.6651075", "0.66425365", "0.66333634", "0.66323304", "0.6628687", "0.66264296", "0.6621918", "0.66206646", "0.66169834", "0.6616776", "0.6616073", "0.66099817", "0.6568242", "0.65632486", "0.6563102", "0.6556937", "0.65548867", "0.65528125", "0.655274", "0.65467614", "0.6530652", "0.6523458", "0.6516344", "0.6508749", "0.648552", "0.64782214", "0.6478135", "0.6473039", "0.6463993", "0.6456104", "0.6443165", "0.6440013", "0.64392215", "0.6438564", "0.643685", "0.643629", "0.6424897", "0.6424159", "0.6413445" ]
0.64855385
85
Makes an alert dialog
public S<T> alert(String icon,String title,String text){ AlertDialog alertDialog = new AlertDialog.Builder(activity).create(); alertDialog.setTitle(title); alertDialog.setMessage(text); alertDialog.setIcon(getIdD(icon)); alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, "OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); alertDialog.show(); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void alert(String message);", "void showAlert(String message);", "private void alert(String title, String msj){\n android.app.AlertDialog.Builder alertDialog = new android.app.AlertDialog.Builder(getActivity());\n alertDialog.setTitle(title);\n alertDialog.setMessage(msj);\n alertDialog.setPositiveButton(getString(R.string.alert_accept), new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n }\n });\n alertDialog.show();\n }", "private void showAlert() {\n AlertDialog.Builder alert = new AlertDialog.Builder(this);\n alert.setMessage(\"Error al autenticar usuario\");\n alert.setPositiveButton(\"Aceptar\", null);\n AlertDialog pop = alert.create();\n alert.show();\n }", "public static void showAlert(String message, Activity context) {\n\n AlertDialog.Builder builder = new AlertDialog.Builder(context);\n builder.setMessage(message).setCancelable(false)\n .setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n\n\n }\n });\n try {\n builder.show();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\n\t\t\t\tdialog.show();\n\t\t\t\t//alert.show();\n\t\t\t\t\n\t\t\t}", "private void show_Alert(String msg) {\n ((TextView) dialog.findViewById(R.id.tv_text)).setText(msg);\n dialog.findViewById(R.id.tv_ok).setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n dialog.dismiss();\n }\n });\n dialog.show();\n }", "private void alert(String title, String message) {\n UIAlertView alertView = new UIAlertView(title, message, null, \"OK\");\n alertView.show();\n }", "public void msgErreur(){\n \n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Entrée invalide\");\n alert.setHeaderText(\"Corriger les entrées invalides.\");\n alert.setContentText(\"Les informations entrées sont erronnées\");\n\n alert.showAndWait();\n \n\n}", "public static void alert(Alert alert) {\n alerter.alert(alert);\n }", "private Alert alert(String AlertText) {\n Alert alert = new Alert(ERROR, AlertText, OK);\n DialogPane dialogPane = alert.getDialogPane();\n dialogPane.getStylesheets().add(getClass().getResource(\"login.css\").toExternalForm());\n dialogPane.getStyleClass().add(\"myDialog\");\n alert.show();\n return alert;\n }", "@SuppressWarnings(\"deprecation\")\n\t\tprivate void alertDialog(String msg) \n\t\t{\n\t\t\tAlertDialog alertDialog = new AlertDialog.Builder(LoginScreenActivity.this).create();\n\t alertDialog.setTitle(\"StyleZ\");\n\t alertDialog.setMessage(msg);\n\t alertDialog.setButton(\"OK\", new DialogInterface.OnClickListener() \n\t {\n\t public void onClick(DialogInterface dialog, int which) {\n\t \t\n\t // Write your code here to execute after dialog closed\n\t dialog.dismiss();\n\t \n\t if(strstatus.equals(\"success\"))\n\t {\n\t Intent i=new Intent(LoginScreenActivity.this,StyleZTab.class);\n\t startActivity(i);\n\t finish();\n\t }\n\t else\n\t {\n\t \t imgviewloginon.setVisibility(View.GONE);\n\t imgviewloginoff.setVisibility(View.VISIBLE);\n\t }\n\t }\n\t });\n\t alertDialog.show();\n\t\t}", "public void alertDialogBasico() {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\r\n\r\n // 2. Encadenar varios métodos setter para ajustar las características del diálogo\r\n builder.setMessage(R.string.dialog_message);\r\n\r\n\r\n builder.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {\r\n public void onClick(DialogInterface dialog, int id) {\r\n\r\n }\r\n });\r\n\r\n\r\n builder.show();\r\n\r\n }", "private void showAlert() {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\r\n builder.setTitle(\"Info..\");\r\n builder.setMessage(\"Your password reset email has been sent!\\n\" +\r\n \"\\n\" +\r\n \"We have sent a password reset email to your email address:\\n\" +\r\n \"\\n\" +\r\n input_email.getText().toString()+\"\\n\" +\r\n \"\\n\" +\r\n \"Please check your inbox to continue.\");\r\n\r\n builder.setPositiveButton(\"Ok\", new DialogInterface.OnClickListener() {\r\n @Override\r\n public void onClick(DialogInterface dialog, int which) {\r\n dialog.dismiss();\r\n finish();\r\n }\r\n });\r\n /* builder.setNegativeButton(\"cancel\", new DialogInterface.OnClickListener() {\r\n @Override\r\n public void onClick(DialogInterface dialog, int which) {\r\n dialog.dismiss();\r\n }\r\n });*/\r\n // create and show the alert dialog\r\n AlertDialog dialog = builder.create();\r\n dialog.show();\r\n }", "public void alert(View view){\n\n show(AppDialog.TAG_ALERT);\n }", "public void alert(String msg) {\n new Alert(msg, \"alertDone\");\n }", "private void showCheckDialog() {\n AlertDialog.Builder showAuditAlert = new AlertDialog.Builder(this); // Create Alert dialog\n showAuditAlert.setTitle(\"Total prize\"); // Set title\n showAuditAlert.setMessage(\"= \"+mydb.getResultDayAudit(year,month,day).intValue()+\"\"); // Set message\n\n showAuditAlert.setPositiveButton(\"Done\",\n new DialogInterface.OnClickListener()\n { // Can hear \"CLICK\"\n @Override\n public void onClick(DialogInterface dialog,int which)\n {\n \tdialog.dismiss(); // CLICK then disappear\n }\n }\n );\n showAuditAlert.show(); // Show dialog that created upper this line\n }", "@Override\n public void onClick(View v) {\n builder.setMessage(R.string.alertMessage)\n .setCancelable(false)\n .setPositiveButton(\"Yes\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n //buClick();\n //finish();\n dialog.cancel();\n calculat();\n\n }\n })\n .setNegativeButton(\"No\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n // Action for 'NO' Button\n dialog.cancel();\n\n }\n });\n //Creating dialog box\n AlertDialog alert = builder.create();\n //Setting the title manually\n alert.setTitle(R.string.alertTitle);\n alert.show();\n }", "public static void alert(String title, String message, AlertType a) {\r\n Alert alert = new Alert(a);\r\n alert.setTitle(title);\r\n alert.setHeaderText(null);\r\n alert.setContentText(message);\r\n //Optional<ButtonType> result = alert.showAndWait();\r\n alert.showAndWait();\r\n }", "private void showDialog() {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(\"User created successfully\");\n builder.setIcon(R.drawable.ic_shield);\n builder.setCancelable(true);\n builder.setPositiveButton(\n \"Continue\",\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n finish();\n }\n });\n AlertDialog alert11 = builder.create();\n alert11.show();\n Window window = alert11.getWindow();\n assert window != null;\n WindowManager.LayoutParams wlp = window.getAttributes();\n wlp.gravity = Gravity.CENTER;\n wlp.y = 270;\n wlp.flags &= ~WindowManager.LayoutParams.FLAG_DIM_BEHIND;\n window.setAttributes(wlp);\n }", "DialogResult show();", "private void showDialog(String msg) {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setMessage(msg)\n .setCancelable(false)\n .setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n }\n });\n AlertDialog alert = builder.create();\n alert.show();\n }", "public static void alert(String message) {\r\n\t Stage window = new Stage();\r\n\r\n\t // Blokira klikanje na druge povrsine sem pop-up\r\n\t window.initModality(Modality.APPLICATION_MODAL);\r\n\t window.setTitle(\"Alert\");\r\n\t window.setMinWidth(250);\r\n\t window.setMinHeight(100);\r\n\t \r\n\t // Label\r\n\t Label label = new Label();\r\n\t label.setText(message);\r\n\t Button closeButton = new Button(\"Close\");\r\n\t closeButton.setOnAction(e -> window.close());\r\n\r\n\t // Layout\r\n\t VBox layout = new VBox(10);\r\n\t layout.getChildren().addAll(label, closeButton);\r\n\t layout.setAlignment(Pos.CENTER);\r\n\r\n\t // Pop-up ostaje aktivan\r\n\t Scene scene = new Scene(layout);\r\n\t window.setScene(scene);\r\n\t window.showAndWait();\r\n\t }", "public void Report_User_alert(){\n final AlertDialog.Builder alert=new AlertDialog.Builder(context,R.style.DialogStyle);\n alert.setTitle(\"Report\")\n .setMessage(\"Are you sure to Report this user?\")\n .setNegativeButton(\"No\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n dialog.dismiss();\n }\n })\n .setPositiveButton(\"yes\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n Send_report();\n }\n });\n\n alert.setCancelable(true);\n alert.show();\n }", "public AlertDialog createAlert(String title,String message) {\n Builder builder = new Builder(currentContext);\n builder.setTitle(title);\n builder.setMessage(message);\n builder.setCancelable(true);\n builder.setPositiveButton(ok, this.new OkOnClickListener());\n alertDialog = builder.create();\n alertDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);\n alertDialog.setCanceledOnTouchOutside(true);\n alertDialog.setCancelable(true);\n if (null != activity && !activity.isFinishing()) {\n alertDialog.show();\n }\n return alertDialog;\n }", "protected void alert(String message) {\n\t\talertWindow.setContentText(message);\n\t\talertWindow.show();\n\t}", "public void createAlertDialog(String msg) {\n\t\tAlertDialog.Builder alertbox = new AlertDialog.Builder(\n\t\t\t\tMainActivity.this);\n\t\talertbox.setTitle(\"Response Message\");\n\t\talertbox.setMessage(msg);\n\t\talertbox.setPositiveButton(\"Ok\", new DialogInterface.OnClickListener() {\n\t\t\t// do something when the button is clicked\n\t\t\tpublic void onClick(DialogInterface arg0, int arg1) {\n\t\t\t}\n\t\t});\n\t\talertbox.show();\n\t}", "public void onClickShowAlert(View view) {\n AlertDialog.Builder myAlertBuilder = new\n AlertDialog.Builder(MainActivity.this);\n // Set the dialog title and message.\n myAlertBuilder.setTitle(\"Alert\");\n myAlertBuilder.setMessage(\"Click OK to continue, or Cancel to stop:\");\n // Add the dialog buttons.\n myAlertBuilder.setPositiveButton(\"OK\", new\n DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n // User clicked OK button.\n Toast.makeText(getApplicationContext(), \"Pressed OK\",\n Toast.LENGTH_SHORT).show();\n }\n });\n myAlertBuilder.setNegativeButton(\"Cancel\", new\n DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n // User cancelled the dialog.\n Toast.makeText(getApplicationContext(), \"Pressed Cancel\",\n Toast.LENGTH_SHORT).show();\n }\n });\n // Create and show the AlertDialog.\n myAlertBuilder.show();\n }", "private void showAlert(String msg) {\n\t\tAlertDialog.Builder builder = new AlertDialog.Builder(this);\n\t\tbuilder.setMessage(msg).setCancelable(false).setPositiveButton(\"Ok\", new DialogInterface.OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(DialogInterface dialog, int id) {\n\t\t\t\tdialog.cancel();\n\t\t\t}\n\t\t});\n\t\tAlertDialog alert = builder.create();\n\t\talert.show();\n\t}", "private void doDialogMsgBuilder() {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setMessage(getResources().getString(R.string.OverAge))\n .setCancelable(false)\n .setPositiveButton(getResources().getString(R.string.ok),\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n finish();\n }\n });\n\n AlertDialog alert = builder.create();\n alert.show();\n }", "private void showAlert(String message) {\n\t\tAlertDialog.Builder builder = new AlertDialog.Builder(this);\n\t\tbuilder.setMessage(message).setTitle(\"Response from Yourcare\")\n\t\t\t\t.setCancelable(false)\n\t\t\t\t.setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n\t\t\t\t\tpublic void onClick(DialogInterface dialog, int id) {\n\t\t\t\t\t\t// do nothing\n\t\t\t\t\t\t\n\n\t\t\t\t\t\tIntent intent = new Intent(getApplicationContext(),CapturePrescriptionActivity.class);\n\t\t\t\t\t\tstartActivity(intent);\n\t\t\t\t\t\tfinish();\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t});\n\t\tAlertDialog alert = builder.create();\n\t\talert.show();\n\t}", "private void alert(String message) {\n\t\tAlertDialog alert = new AlertDialog.Builder(this).setTitle(getString(R.string.warning)).setMessage(message)\n\t\t\t\t.setNeutralButton(getString(R.string.ok), new DialogInterface.OnClickListener() {\n\t\t\t\t\tpublic void onClick(DialogInterface dialog, int id) {\n\t\t\t\t\t\t// TODO maybe implement ? controller.connect();\n\t\t\t\t\t\tdialog.cancel();\n\t\t\t\t\t}\n\t\t\t\t}).create();\n\t\talert.show();\n\t}", "public void CustomAlertSave2(String msg) {\n\t\tfinal Dialog dialog = new Dialog(context);\r\n\t\t// hide to default title for Dialog\r\n\t\tdialog.requestWindowFeature(Window.FEATURE_NO_TITLE);\r\n\t\t// inflate the layout dialog_layout.xml and set it as contentView\r\n\t\tLayoutInflater inflater = (LayoutInflater) context\r\n\t\t\t\t.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\r\n\t\tView view = inflater.inflate(R.layout.dialog_layout, null, false);\r\n\t\tdialog.setCanceledOnTouchOutside(true);\r\n\t\tdialog.setContentView(view);\r\n\t\tdialog.getWindow().setBackgroundDrawable(new ColorDrawable(0));\r\n\t\tTextView txtTitle = (TextView) dialog\r\n\t\t\t\t.findViewById(R.id.txt_alert_message);\r\n\t\ttxtTitle.setText(msg);\r\n\r\n\t\tButton btn_ok = (Button) dialog.findViewById(R.id.btn_ok);\r\n\t\tbtn_ok.setOnClickListener(new android.view.View.OnClickListener() {\r\n\r\n\t\t\tpublic void onClick(View v) {\r\n\t\t\t\tdialog.dismiss();\r\n\r\n\t\t\t}\r\n\r\n\t\t});\r\n\t\tdialog.show();\r\n\t}", "private void alert(String string) {\n\r\n\t}", "public static void alertDialog(final String message) {\r\n _app.invokeLater(new Runnable() {\r\n public void run() {\r\n Dialog.alert(message);\r\n }\r\n });\r\n }", "private void showAlert(String message) {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setMessage(message);\n builder.show();\n }", "AlertDialog getAlertDialog();", "private void alert(String title, String msg) {\n if (title.isEmpty() || msg.isEmpty()) {\n return;\n }\n if (isFinishing()) {\n return;\n }\n new AlertDialog.Builder(this).setTitle(title).setMessage(msg)\n .setIcon(android.R.drawable.ic_dialog_info)\n .setNeutralButton(R.string.ok, null).show();\n }", "public static native void alert(String texto)/*-{\n\t\t\t\n\t\t\t$wnd.bootbox.alert(texto);\t\n\t\n\t\n\t}-*/;", "public static void alert(String title, String header, String message, AlertType a) {\r\n Alert alert = new Alert(a);\r\n alert.setTitle(title);\r\n alert.setHeaderText(header);\r\n alert.setContentText(message);\r\n //Optional<ButtonType> result = alert.showAndWait();\r\n alert.showAndWait();\r\n }", "static void showAlert(final Context con, final String title, final String msg){\n \tAlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(con);\n \n\t\t\t// set title\n\t\talertDialogBuilder.setTitle(title);\n\t\talertDialogBuilder.setMessage(msg).setCancelable(true)\n\t\t\t\t.setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n\n\t\t @Override\n\t\t public void onClick(DialogInterface dialog, int which) {\n\t\t // TODO Auto-generated method stub\n\t\t // Do something\n\t\t dialog.dismiss();\n\t\t }\n\t\t });\n\t\t\n\t\tAlertDialog alertDialog = alertDialogBuilder.create();\n\t\talertDialog.show();\n }", "private void alertDialog(int title, int message, int icon) {\n tst_Message.cancel();\n tst_Message = null;\n AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);\n builder.setTitle(title);\n builder.setMessage(message);\n builder.setIcon(icon);\n builder.setPositiveButton(R.string.dialog_pos_btn, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n reset();\n }\n });\n builder.show();\n }", "private void alertBox(String title, String message) {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setMessage(\"GPS Anda tampaknya dinonaktifkan, apakah Anda ingin mengaktifkannya?\")\n .setCancelable(false)\n .setTitle(\"STATUS GPS\")\n .setPositiveButton(\n \"YA\",\n new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n /* this gonna call class of settings then dialog interface disappeared */\n Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);\n startActivity(intent);\n dialog.cancel();\n }\n }\n )\n .setNegativeButton(\"TIDAK\", new DialogInterface.OnClickListener() {\n public void onClick(final DialogInterface dialog, @SuppressWarnings(\"unused\") final int id) {\n dialog.cancel();\n }\n }\n );\n AlertDialog alertDialog = builder.create();\n alertDialog.show();\n }", "private void showAlert(String message) {\n\n if (message.equals(\"Uploaded Successfully...\")) {\n // this.dismiss();\n commmunicator.onDialogMessage(new MessageDetails());\n this.dismiss();\n\n } else {\n\n AlertDialog.Builder builder = new AlertDialog.Builder(form.getContext());\n builder.setMessage(message).setTitle(\"Response from Servers\")\n .setCancelable(false)\n .setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n // do nothing\n }\n });\n AlertDialog alert = builder.create();\n alert.show();\n }\n }", "private void alertDialoge() {\n builder.setMessage(R.string.dialoge_desc).setTitle(R.string.we_request_again);\n\n builder.setCancelable(false)\n .setPositiveButton(R.string.give_permissions, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n requestPermission();\n }\n })\n .setNegativeButton(R.string.dont_ask_again, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n // Action for 'Don't Ask Again' Button\n // the sharedpreferences value is true\n editor.putBoolean(getResources().getString(R.string.dont_ask_again), true);\n editor.commit();\n dialog.cancel();\n }\n });\n //Creating dialog box\n AlertDialog alert = builder.create();\n alert.show();\n }", "public void alert(String txtMsg, final String action, final View btn_view)\n {\n LayoutInflater inflator = LayoutInflater.from(BookingDetailsActivity.this);\n final View yourCustomView = inflator.inflate(R.layout.custom_dialog, null);\n //endregion\n\n //region (2) init dialogue\n final AlertDialog dialog = new AlertDialog.Builder(BookingDetailsActivity.this)\n .setTitle(\"Do you want to proceed ?\")//replace w \"txtMsg\"\n .setView(yourCustomView)\n .create();\n //endregion\n\n //region (3) set onClicks for custom dialog btns\n yourCustomView.findViewById(R.id.btn_yes).setOnClickListener(new View.OnClickListener()\n {\n @Override\n public void onClick(View view)\n {\n switch (action)\n {\n case \"save\":\n SaveAppoint(btn_view);\n break;\n case \"cancel\":\n CancelAppoint(btn_view);\n break;\n }\n }\n });\n yourCustomView.findViewById(R.id.btn_no).setOnClickListener(new View.OnClickListener()\n {\n @Override\n public void onClick(View view)\n {\n dialog.dismiss();\n }\n });\n //endregion\n\n //region (4) Display dialogue\n dialog.show();\n //endregion\n }", "private void showAlertDialog() {\n new AlertDialog.Builder(getActivity())\n .setMessage(R.string.feedback_sharing_data_alert)\n .setCancelable(false)\n .setPositiveButton(R.string.ok, (dialog, which) -> {\n sendFeedback();\n })\n .show();\n }", "@Override\n public void handle(ActionEvent event) {\n alert = new Alert(AlertType.CONFIRMATION);\n //Optional title. If not used the standard title \"Confiramation\" will be displayed\n //To remove the title use alert.setTitle(null);\n alert.setTitle(\"Confirmation Dialog\");\n //Optional header.If not used the standard header \"Confiramation\" will be displayed\n //To remove the title use alert.setHeaderText(null); \n alert.setHeaderText(\"Please answer the question!\");\n alert.setContentText(initText);\n //Display the dialog and get the result from the user action\n Optional<ButtonType> result = alert.showAndWait();\n if (result.get() == ButtonType.OK){\n // the user clicked OK\n alert = new Alert(AlertType.INFORMATION);\n alert.setTitle(\"Information Dialog\");\n alert.setHeaderText(\"Important message for you!\");\n alert.setContentText(\"Happiness is ephemeral!\");\n alert.showAndWait(); \n //the user clocked Cancel\n } else {\n // ... user chose CANCEL or closed the dialog\n //Warning Dialog\n alert = new Alert(AlertType.WARNING);\n alert.setTitle(\"Warning Dialog\");\n alert.setHeaderText(\"Read the Warning!\");\n alert.setContentText(\"You must like Java - Shall make you Happy!\");\n alert.showAndWait(); \n }\n }", "private void showAlert(String message) {\n //Builds an AlertDialog with message, title, if cancellable, and what the positive button does\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n builder.setMessage(message).setTitle(\"Response from Servers\")\n .setCancelable(false)\n .setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n // do nothing\n }\n });\n AlertDialog alert = builder.create();\n alert.show();\n// String errorMessage = null;\n// try {\n// JSONObject arr = new JSONObject(message);\n// errorMessage = arr.getString(\"error\");\n// } catch (JSONException e) {\n// e.printStackTrace();\n// }\n// Toast.makeText(getActivity(), errorMessage, Toast.LENGTH_LONG).show();\n\n }", "private void showAlert(){\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity())\n .setTitle(\"Your further details please:\")\n .setView(view);\n builder.setPositiveButton(\"Proceed\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n Intent it = new Intent(getActivity(), StudentFurtherDetails.class);\n getActivity().startActivity(it);\n }\n\n });\n //call api for insertion\n builder.setNegativeButton(\"Later\", null)\n .setCancelable(false);\n AlertDialog alert = builder.create();\n alert.show();\n }", "public static void alertbox_Accept() throws CheetahException {\n\t\ttry {\n\t\t\tSystem.out.println(\"Step into alert box\");\n\t\t\tAlert simpleAlert = CheetahEngine.getDriverInstance().switchTo().alert();\n\t\t\tsimpleAlert.accept();\n\t\t} catch (Exception e) {\n\t\t\tthrow new CheetahException(e);\n\t\t}\n\t}", "void AlertaValidacion(String title, String message){\n AlertDialog.Builder builder = new AlertDialog.Builder(RegisterActivity.this);\n builder.setTitle(title);\n builder.setMessage(message).setPositiveButton(\"ACEPTAR\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n\n }\n });\n AlertDialog alert = builder.create();\n alert.show();\n }", "private void showAlert(String status, String msg){\n android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(HostelRequestActivity.this)\n .setTitle(status)\n .setMessage(msg);\n builder.setPositiveButton(\"Ok\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n onBackPressed();\n }\n\n });\n //call api for insertion\n builder.setCancelable(false);\n android.app.AlertDialog alert = builder.create();\n alert.show();\n }", "private void showAlertDialog(String message) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity())\n .setTitle(\"QR Scanner\")\n .setMessage(message)\n .setPositiveButton(\"OKAY\", (dialog, which) -> {\n dialog.dismiss();\n });\n AlertDialog alertDialog = builder.create();\n alertDialog.show();\n }", "public void showAlert(String cadena, Context ctx){\n AlertDialog.Builder alertbox = new AlertDialog.Builder(ctx);\n //seleccionamos la cadena a mostrar\n alertbox.setMessage(cadena);\n alertbox.show();\n\n }", "public AlertDialog createSimpleDialog() {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(\"Code with love by\")\n .setMessage(\"Alvaro Velasco & Jose Alberto del Val\");\n return builder.create();\n }", "public static void crearAlerta(String titulo,String mensaje){\n Alert alert=new Alert(Alert.AlertType.WARNING);\n alert.setHeaderText(null);\n alert.setTitle(titulo);\n alert.setContentText(mensaje);\n alert.showAndWait();\n }", "public static void AlertAccept() {\n\t\tAlert alt = Browser.Driver.switchTo().alert();\n\t\talt.accept();\n\t}", "private void alertBox_service(String title, String msg) {\r\n\t\tAlertDialog.Builder service_alert = new AlertDialog.Builder(this.mContext);\r\n\t\tservice_alert.setTitle(title);\r\n\t\tservice_alert.setMessage(msg);\r\n\t\tservice_alert.setNeutralButton(\"OK\",new DialogInterface.OnClickListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onClick(DialogInterface dialog, int which) {\r\n\t\t\t\tdialog.dismiss();\r\n\r\n\t\t\t}\r\n\t\t});\r\n\t\tservice_alert.show();\r\n\t}", "public static native void alert(String msg) /*-{\r\n $wnd.alert(msg);\r\n }-*/;", "public void alertForOuitMessage() {\n final AlertDialog.Builder builder = new AlertDialog.Builder(context);\n final AlertDialog alert = builder.create();\n alert.getWindow().getAttributes().windowAnimations = R.style.alertAnimation;\n View view = alert.getLayoutInflater().inflate(R.layout.quiz_quit_alert, null);\n TextView title1 = (TextView) view.findViewById(R.id.title1);\n title1.setText(context.getString(R.string.quiz_quit_are));\n title1.setTypeface(VodafoneRg);\n TextView title2 = (TextView) view.findViewById(R.id.title2);\n title2.setText(context.getString(R.string.quiz_quit_progress));\n title2.setTypeface(VodafoneRg);\n TextView quiz_text = (TextView) view.findViewById(R.id.quit_text);\n quiz_text.setTypeface(VodafoneRg);\n LinearLayout quit_layout = (LinearLayout) view.findViewById(R.id.quit_layout);\n alert.setCustomTitle(view);\n TextView quit_icon = (TextView) view.findViewById(R.id.quit_icon);\n quit_icon.setTypeface(materialdesignicons_font);\n quit_icon.setText(Html.fromHtml(\"&#xf425;\"));\n quit_layout.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n alert.dismiss();\n finish();\n }\n });\n alert.show();\n }", "@SuppressWarnings(\"deprecation\")\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tAlertDialog alertDialog = new AlertDialog.Builder(GameInitializerActivity.this).create();\n\t\t\t\tLayoutInflater factory = LayoutInflater.from(GameInitializerActivity.this);\n\t\t\t\tfinal View view = factory.inflate(R.layout.activity_about_popupwindow, null);\n\t\t\t\talertDialog.setView(view);\n\t\t\t\talertDialog.setButton3(\"OK. I Got this !!\", dialogClickListener);\n\t\t\t\talertDialog.show();\t\t\t\t\n\t\t\t\t\n\t\t\t}", "public void showAlertDialog(String title, String message) {\n\n\t\t// Create an object of alert class for an activity\n\t\tAlertDialog alertDialog = new AlertDialog.Builder(objContext).create();\n\n\t\t// Setting Dialog Title\n\t\talertDialog.setTitle(title);\n\n\t\t// Setting Dialog Message\n\t\talertDialog.setMessage(message);\n\n\t\t// Setting Icon to Dialog\n\t\talertDialog.setIcon(R.drawable.ic_launcher);\n\n\t\talertDialog.setButton(DialogInterface.BUTTON_POSITIVE, \"Ok\", new DialogInterface.OnClickListener() {\n\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\tdialog.dismiss();\n\t\t\t}\n\t\t});\n\t\talertDialog.show();\n\t}", "public void showAlertMessage(String message) {\n AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(context);\n alertDialogBuilder.setMessage(message).setCancelable(false).setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n }\n });\n AlertDialog alertdialog = alertDialogBuilder.create();\n alertdialog.show();\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 }", "public void showMessage(){\n final AlertDialog.Builder alert = new AlertDialog.Builder(context);\n alert.setMessage(message);\n alert.setTitle(title);\n alert.setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n alert.create().dismiss();\n }\n });\n alert.create().show();\n }", "public S<T> alert(String text){\n\t\t\n\t\tAlertDialog alertDialog = new AlertDialog.Builder(activity).create();\n\t\talertDialog.setTitle(\"Alert\");\n\t\talertDialog.setMessage(text);\n\t\talertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, \"OK\",\n\t\t new DialogInterface.OnClickListener() {\n\t\t public void onClick(DialogInterface dialog, int which) {\n\t\t dialog.dismiss();\n\t\t }\n\t\t });\n\t\talertDialog.show();\n\t\treturn this;\n\t}", "private AlertDialog alertBuilder() {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setMessage(\"Missing Arduino Unit, go to Settings?\").\n setCancelable(false).setPositiveButton(\n \"Yes\", new DialogInterface.OnClickListener() {\n\n public void onClick(DialogInterface dialog, int id) {\n //call qr scan intent\n Intent prefScreen = new Intent(TempMeasure.this, Preferences.class);\n startActivityForResult(prefScreen, 0);\n }\n }).setNegativeButton(\"No\", new DialogInterface.OnClickListener() {\n\n public void onClick(DialogInterface dialog, int id) {\n dialog.cancel();\n }\n });\n AlertDialog alert = builder.create();\n return alert;\n }", "private void alertDialogBuilder(String message) {\n\t\tAlertDialog.Builder builder = new AlertDialog.Builder(this);\n\t\tbuilder.setMessage(message)\n\t\t\t\t.setCancelable(false)\n\t\t\t\t.setPositiveButton(\"Yes\",\n\t\t\t\t\t\tnew DialogInterface.OnClickListener() {\n\t\t\t\t\t\t\tpublic void onClick(DialogInterface dialog, int id) {\n\t\t\t\t\t\t\t\tdbHelper.clearResults();\n\t\t\t\t\t\t\t\tfillData();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t.setNegativeButton(\"No\", new DialogInterface.OnClickListener() {\n\t\t\t\t\tpublic void onClick(DialogInterface dialog, int id) {\n\t\t\t\t\t\tdialog.cancel();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\tAlertDialog alert = builder.create();\n\t\talert.show();\n\t}", "private void showLoserDialog() {\n Alert alert = new Alert(Alert.AlertType.CONFIRMATION, \"You Have Been Defeated \" + player1.getName() + \",Computer Wins!!\", new ButtonType(\"Close\", ButtonBar.ButtonData.NO), new ButtonType(\"Try Again?\", ButtonBar.ButtonData.YES));\n alert.setGraphic(new ImageView(new Image(this.getClass().getResourceAsStream(\"/Images/bronze.png\"))));\n alert.setHeaderText(null);\n alert.setTitle(\"Computer Wins\");\n alert.showAndWait();\n if (alert.getResult().getButtonData() == ButtonBar.ButtonData.YES) {\n onReset();\n }\n }", "public void alert(String msg) {\n\t\tJOptionPane.showMessageDialog(rootPane, msg);\n\t}", "public static void aboutApp(){\n\t\tAlert alertDialog = new Alert(Alert.AlertType.INFORMATION);\n\t\talertDialog.setTitle(\"My first java Desktop App\");\n\t\talertDialog.setHeaderText(\"Learning JavaFX\");\n\t\talertDialog.setContentText(\"I'm a beginner and soon i'll be a pro\");\n\n\t\t//to make custom buttons\n\t\tButtonType yesBtn = new ButtonType(\"yes\");\n\t\tButtonType noBtn = new ButtonType(\"No\");\n\t\talertDialog.getButtonTypes().setAll(yesBtn,noBtn);\n\n\t\t//to perform click event on buttons of the dilague box that opens and make buttons\n\t\tOptional<ButtonType> clickBtn=alertDialog.showAndWait();\n\t\tif(clickBtn.isPresent()&&clickBtn.get()==yesBtn){\n\t\t\t// code .......\n\t\t}\n\t\tif(clickBtn.get()==noBtn){\n\t\t\t//code..........\n\t\t}\n\n\t\talertDialog.show();\n\t}", "public void acceptAlert() {\n\t\tAlert popUp = null;\n\t\ttry {\n\t\t\tpopUp = getDriver().switchTo().alert();\n\t\t\tpopUp.accept();\n\t\t} catch (NoAlertPresentException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "private void SuccessfulBox(View v){\n \t//create an alert box with specified properties\n \tnew AlertDialog.Builder(this)\n \t.setTitle(\"Submit Successfully!\")\n \t.setMessage(\"New prescription information has been added to\" + \" \" +item)\n \t.setNeutralButton(\"ok\", null)\n \t.show();\n }", "private void showErrorAlert()\n {\n \tAlertDialog.Builder builder = new AlertDialog.Builder(this);\n \tbuilder.setMessage(getResources().getString(R.string.app_error_str))\n \t .setCancelable(false)\n \t .setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n \t public void onClick(DialogInterface dialog, int id) {\n \t dialog.cancel();\n \t }\n \t });\n \t \n \tAlertDialog alert = builder.create();\n \talert.show();\n }", "@When(\"^User will click on show alert box$\")\r\n\tpublic void user_will_click_on_show_alert_box() throws Throwable {\n\t\tSystem.out.println(\"User will click on alert button\");\r\n\t}", "public void acceptPopUp(WebDriver driver)\r\n\t{\n\t\tAlert alert=driver.switchTo().alert();\r\n\t\t\t\r\n\t\t//accept the alert\r\n\t\talert.accept();\r\n\t}", "@Test\n public void basicAlertHandlingTest(){\n\n WebElement alertButton = driver.findElement(By.id(\"alertexamples\"));\n alertButton.click();\n String alertMessage = \"I am an alert box!\";\n\n assertEquals(alertMessage, driver.switchTo().alert().getText());\n driver.switchTo().alert().accept();\n }", "public void showAlertDialog(View v){\n AlertDialog.Builder alert = new AlertDialog.Builder(this);\n alert.setTitle(\"Update Details\");\n alert.setMessage(\"Do you really want to update details?\");\n\n //if customer click yes\n alert.setPositiveButton(\"Yes\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n Toast.makeText(MEditProfile.this, \"Update Successfully\", Toast.LENGTH_SHORT).show();\n }\n });\n //if customer click no\n alert.setNegativeButton(\"No\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n Toast.makeText(MEditProfile.this,\"\",Toast.LENGTH_SHORT).show();\n }\n });\n alert.create().show();\n }", "public void acceptAlert() {\n WebDriverWait wait = new WebDriverWait(getDriver(), timeOut);\n wait.until(ExpectedConditions.alertIsPresent());\n getDriver().switchTo().alert().accept();\n }", "private void showInputDialog() {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(\"App info\");\n builder.setMessage(message);\n builder.setPositiveButton(\" Done \", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n dialog.dismiss();\n }\n });\n builder.show();\n }", "@Override\n public void onClick(View v)\n {\n AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(activity, R.style.AppTheme));\n dialogBuilder.setView(viewConfirmDialog);\n AlertDialog alertDialog= dialogBuilder.create();\n Window windowAlert = alertDialog.getWindow();\n WindowManager.LayoutParams layoutConfirmDialog = new WindowManager.LayoutParams();\n layoutConfirmDialog.copyFrom(windowAlert.getAttributes());\n layoutConfirmDialog.width = 320;\n layoutConfirmDialog.height = 320;\n alertDialog.getWindow().setAttributes(layoutConfirmDialog);\n dismissAlertDialog();\n components.alertDialog = alertDialog;\n alertDialog.show();\n\n }", "protected void alertbox(String title, String mymessage) {\n \t\t// add scrollview to alertbox\n \t\tnew AlertDialog.Builder(this)\n \t\t\t\t.setMessage(mymessage)\n \t\t\t\t.setTitle(title)\n \t\t\t\t.setView(LayoutInflater.from(this).inflate(R.layout.scroll_result,null))\n \t\t\t\t.setCancelable(true)\n \t\t\t\t.setNeutralButton(\"Done\",\n \t\t\t\t\t\tnew DialogInterface.OnClickListener() {\n \t\t\t\t\t\t\tpublic void onClick(DialogInterface dialog,\n \t\t\t\t\t\t\t\t\tint whichButton) {\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t}).show();\n \t}", "private void confirmationAlert() {\n\t\tAlert confirm = new Alert( AlertType.CONFIRMATION, \"You Will Not Be Able To Change Your Name\\nAfter You Press 'OK'.\");\n\t\tconfirm.setHeaderText(\"Are You Sure?\");\n confirm.setTitle(\"Confirm Name\");\n confirm.showAndWait().ifPresent(response -> {\n if (response == ButtonType.OK) {\n \tbackground.remove( pointer );\n \tkeyStrokes = keyStrokes.replace(\" \", \"-\");\n\t\t\t\tinsertNewHiScore();\n\t\t\t\tnewHighScore = false;\n }\n });\n\t}", "@Override\r\n\t\tpublic void onClick(View v) {\n\t\t\tAlertDialog.Builder builder=new AlertDialog.Builder(getActivity());\t\r\n\t\t\tbuilder.setTitle(\"Version 1.0\")\r\n\t\t\t.setMessage(\"With the App User Easily get the Work and directly Interact with Admin.\");\r\n\t\tbuilder.setNegativeButton(\"CLOSE\", new DialogInterface.OnClickListener() {\r\n public void onClick(DialogInterface dialog, int which) {\r\n // Write your code here to execute after dialog closed\r\n Toast.makeText(getActivity().getApplicationContext(), \"You clicked on CLOSE\", Toast.LENGTH_SHORT).show();\r\n }\r\n });\r\n \r\n // Showing Alert Message\r\n builder.show();\r\n\t\t}", "public S<T> alert(String title,String text){\n\t\t\n\t\tAlertDialog alertDialog = new AlertDialog.Builder(activity).create();\n\t\talertDialog.setTitle(title);\n\t\talertDialog.setMessage(text);\n\t\talertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, \"OK\",\n\t\t new DialogInterface.OnClickListener() {\n\t\t public void onClick(DialogInterface dialog, int which) {\n\t\t dialog.dismiss();\n\t\t }\n\t\t });\n\t\talertDialog.show();\n\t\treturn this;\n\t}", "private void popupCalibratingDialog() {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(R.string.motion_calibrating);\n builder.setCancelable(false);\n builder.setMessage(R.string.motion_calibrating_message);\n\n calibratingDialog = builder.create();\n calibratingDialog.show();\n }", "public void alert(String msg)\n {\n this.ui.alert(msg);\n theLogger.info(\"Alert sent to UI\");\n }", "private void sendAlert(String message, Alert.AlertType type) {\n Alert alert = new Alert(type);\n alert.setTitle(\"Submission Error\");\n alert.setHeaderText(null);\n alert.setContentText(message);\n alert.showAndWait();\n }", "private void createAlertDialog(String title, String message, final boolean shouldExit) {\n Collect.getInstance().getActivityLogger().logAction(this, \"createAlertDialog\", \"show\");\n mAlertDialog = new AlertDialog.Builder(this).create();\n mAlertDialog.setTitle(title);\n mAlertDialog.setMessage(message);\n DialogInterface.OnClickListener quitListener = new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int i) {\n switch (i) {\n case DialogInterface.BUTTON1: // ok\n Collect.getInstance().getActivityLogger().logAction(this, \"createAlertDialog\", \"OK\");\n // successful download, so quit\n if (shouldExit) {\n finish();\n }\n break;\n }\n }\n };\n mAlertDialog.setCancelable(false);\n mAlertDialog.setButton(getString(R.string.ok), quitListener);\n mAlertDialog.setIcon(android.R.drawable.ic_dialog_info);\n mAlertDialog.show();\n }", "public static void alert(AlertType type, String title, String message) {\n\t\tAlert alert = new Alert(type);\n\t\talert.setTitle(title);\n\t\talert.setContentText(message);\n\t\talert.show();\n\t}", "public static void acceptAlertPopup() throws InterruptedException{\n \ttry {\n \t\talert = driver.switchTo().alert();\n \t\tSystem.out.println(alert.getText());\n \t\tThread.sleep(2000);\n \t\talert.accept();\n \t\tlog.info(\"Alert Accepted\");\n \t }\n \tcatch(Exception e) {\n \t\tSystem.out.println(\"Alert Error : acceptAlertPopup()\");\n \t }\n }", "void ShowWaitDialog(String title, String message);", "private void showHelp(){\n AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this,R.style.MyDialogTheme);\n alertDialogBuilder.setMessage(\"Welcome to NBA Manager 2019\\n\\n\" +\n \"The purpose of the application is to simulate a basketball manager game and draft a team.\\n\\n\" +\n \"You can view your current roster by pressing the right arrow in the top right corner.\\n\\n\" +\n \"*Not all players will have a height or a weight.\");\n alertDialogBuilder.setPositiveButton(\"Ok\",\n new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface arg0, int arg1) {\n }\n });\n AlertDialog alertDialog = alertDialogBuilder.create();\n alertDialog.show();\n }", "public void actionPerformed (ActionEvent e)\n\t\t\t\t{\n\t\t\t\talertOK();\n\t\t\t\t}", "@Then(\"^User should see a predefined alert box$\")\r\n\tpublic void user_should_see_a_predefined_alert_box() throws Throwable {\n\t\tSystem.out.println(\"Alert message pop-ups on the screen\");\r\n\t}", "public void working() {\n\t\t Dialog d = new Dialog(this);\r\n\t\t d.setTitle(\"hech yea!\");\r\n\t\t TextView tv = new TextView(this);\r\n\t\t tv.setText(\"Success\");\r\n\t\t d.setContentView(tv);\r\n\t\t d.show();\t\r\n\t}", "public void AlertBox(String title, String message, int width, int height) {\n //Creating the stage and modifying its settings for the alertBox\n Stage window = new Stage();\n window.initModality((Modality.APPLICATION_MODAL));\n window.setTitle(title);\n window.centerOnScreen();\n\n //Creating the layout for the box\n VBox layout = new VBox();\n layout.setAlignment(Pos.CENTER);\n layout.setSpacing(5);\n Label messageToDisplay = new Label(message);\n //Event handling\n Button okButton = new Button(\"Ok\");\n okButton.setOnAction(e -> window.close());\n layout.getChildren().addAll(messageToDisplay, okButton);\n\n\n Scene scene = new Scene(layout, width, height);\n window.setScene(scene);\n window.setResizable(false);\n window.showAndWait();\n\n }", "private void showbadgedialog() {\n final LayoutInflater li = LayoutInflater.from(mContext);\n //Creating a view to get the dialog box\n View confirmDialog = li.inflate(R.layout.dialog_badges, null);\n // number=session.getMobileNumber();\n //Initizliaing confirm button fo dialog box and edittext of dialog box\n final Button buttonconfirm = (Button) confirmDialog.findViewById(R.id.buttonConfirm);\n\n\n AlertDialog.Builder alert = new AlertDialog.Builder(mContext);\n\n alert.setView(confirmDialog);\n\n final AlertDialog alertDialog = alert.create();\n alertDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));\n alertDialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);\n\n alertDialog.show();\n\n //On the click of the confirm button from alert dialog\n buttonconfirm.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n alertDialog.dismiss();\n }\n });\n\n }", "public static void alert(Context c, String msg) {\n\t\talert(c, msg, new OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\n\t\t\t\tif (dialog != null)\n\t\t\t\t\tdialog.dismiss();\n\t\t\t}\n\t\t});\n\t}", "private void answerResultAlert(String feedback){\n AlertDialog.Builder showResult = new AlertDialog.Builder(this);\n\n showResult.setTitle(feedback);\n showResult.setMessage(currentQuestion.getExplanation());\n showResult.setCancelable(false); //if this is not set, the user may click outside the alert, cancelling it. no cheating this way\n showResult.setNeutralButton(\"ok\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n //only when the ok is clicked will continue to run the program\n setUpQuestions();\n }\n });\n showResult.create();\n showResult.show();\n }" ]
[ "0.76374984", "0.7629751", "0.7358751", "0.73349357", "0.73304754", "0.7327125", "0.72602963", "0.72557676", "0.72481644", "0.7205927", "0.7171638", "0.71636444", "0.7159702", "0.71408737", "0.7140703", "0.71299905", "0.71291333", "0.7114488", "0.7093806", "0.7087516", "0.7087439", "0.7085423", "0.70596904", "0.7043375", "0.702417", "0.701276", "0.70065755", "0.69758904", "0.6945964", "0.69450927", "0.6937846", "0.69335836", "0.6917747", "0.6906071", "0.69027674", "0.6894314", "0.68761873", "0.6870708", "0.6866762", "0.6865367", "0.68597627", "0.6851794", "0.6839529", "0.68238944", "0.6817803", "0.68054026", "0.67994845", "0.67822456", "0.6770955", "0.67600584", "0.67600006", "0.6747362", "0.67446303", "0.6724502", "0.66983503", "0.66960335", "0.669318", "0.6685258", "0.6682958", "0.668207", "0.6679872", "0.6651075", "0.66425365", "0.66333634", "0.66323304", "0.6628687", "0.66264296", "0.6621918", "0.66206646", "0.66169834", "0.6616776", "0.6616073", "0.66099817", "0.6568242", "0.65632486", "0.6563102", "0.6556937", "0.65548867", "0.65528125", "0.655274", "0.65467614", "0.6530652", "0.6523458", "0.6516344", "0.6508749", "0.64855385", "0.648552", "0.64782214", "0.6478135", "0.6473039", "0.6463993", "0.6456104", "0.6443165", "0.6440013", "0.64392215", "0.6438564", "0.643685", "0.643629", "0.6424897", "0.6424159", "0.6413445" ]
0.0
-1
Makes an alert dialog
public S<T> alert(String text){ AlertDialog alertDialog = new AlertDialog.Builder(activity).create(); alertDialog.setTitle("Alert"); alertDialog.setMessage(text); alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, "OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); alertDialog.show(); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void alert(String message);", "void showAlert(String message);", "private void alert(String title, String msj){\n android.app.AlertDialog.Builder alertDialog = new android.app.AlertDialog.Builder(getActivity());\n alertDialog.setTitle(title);\n alertDialog.setMessage(msj);\n alertDialog.setPositiveButton(getString(R.string.alert_accept), new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n }\n });\n alertDialog.show();\n }", "private void showAlert() {\n AlertDialog.Builder alert = new AlertDialog.Builder(this);\n alert.setMessage(\"Error al autenticar usuario\");\n alert.setPositiveButton(\"Aceptar\", null);\n AlertDialog pop = alert.create();\n alert.show();\n }", "public static void showAlert(String message, Activity context) {\n\n AlertDialog.Builder builder = new AlertDialog.Builder(context);\n builder.setMessage(message).setCancelable(false)\n .setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n\n\n }\n });\n try {\n builder.show();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\n\t\t\t\tdialog.show();\n\t\t\t\t//alert.show();\n\t\t\t\t\n\t\t\t}", "private void show_Alert(String msg) {\n ((TextView) dialog.findViewById(R.id.tv_text)).setText(msg);\n dialog.findViewById(R.id.tv_ok).setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n dialog.dismiss();\n }\n });\n dialog.show();\n }", "private void alert(String title, String message) {\n UIAlertView alertView = new UIAlertView(title, message, null, \"OK\");\n alertView.show();\n }", "public void msgErreur(){\n \n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Entrée invalide\");\n alert.setHeaderText(\"Corriger les entrées invalides.\");\n alert.setContentText(\"Les informations entrées sont erronnées\");\n\n alert.showAndWait();\n \n\n}", "public static void alert(Alert alert) {\n alerter.alert(alert);\n }", "private Alert alert(String AlertText) {\n Alert alert = new Alert(ERROR, AlertText, OK);\n DialogPane dialogPane = alert.getDialogPane();\n dialogPane.getStylesheets().add(getClass().getResource(\"login.css\").toExternalForm());\n dialogPane.getStyleClass().add(\"myDialog\");\n alert.show();\n return alert;\n }", "@SuppressWarnings(\"deprecation\")\n\t\tprivate void alertDialog(String msg) \n\t\t{\n\t\t\tAlertDialog alertDialog = new AlertDialog.Builder(LoginScreenActivity.this).create();\n\t alertDialog.setTitle(\"StyleZ\");\n\t alertDialog.setMessage(msg);\n\t alertDialog.setButton(\"OK\", new DialogInterface.OnClickListener() \n\t {\n\t public void onClick(DialogInterface dialog, int which) {\n\t \t\n\t // Write your code here to execute after dialog closed\n\t dialog.dismiss();\n\t \n\t if(strstatus.equals(\"success\"))\n\t {\n\t Intent i=new Intent(LoginScreenActivity.this,StyleZTab.class);\n\t startActivity(i);\n\t finish();\n\t }\n\t else\n\t {\n\t \t imgviewloginon.setVisibility(View.GONE);\n\t imgviewloginoff.setVisibility(View.VISIBLE);\n\t }\n\t }\n\t });\n\t alertDialog.show();\n\t\t}", "public void alertDialogBasico() {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\r\n\r\n // 2. Encadenar varios métodos setter para ajustar las características del diálogo\r\n builder.setMessage(R.string.dialog_message);\r\n\r\n\r\n builder.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {\r\n public void onClick(DialogInterface dialog, int id) {\r\n\r\n }\r\n });\r\n\r\n\r\n builder.show();\r\n\r\n }", "private void showAlert() {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\r\n builder.setTitle(\"Info..\");\r\n builder.setMessage(\"Your password reset email has been sent!\\n\" +\r\n \"\\n\" +\r\n \"We have sent a password reset email to your email address:\\n\" +\r\n \"\\n\" +\r\n input_email.getText().toString()+\"\\n\" +\r\n \"\\n\" +\r\n \"Please check your inbox to continue.\");\r\n\r\n builder.setPositiveButton(\"Ok\", new DialogInterface.OnClickListener() {\r\n @Override\r\n public void onClick(DialogInterface dialog, int which) {\r\n dialog.dismiss();\r\n finish();\r\n }\r\n });\r\n /* builder.setNegativeButton(\"cancel\", new DialogInterface.OnClickListener() {\r\n @Override\r\n public void onClick(DialogInterface dialog, int which) {\r\n dialog.dismiss();\r\n }\r\n });*/\r\n // create and show the alert dialog\r\n AlertDialog dialog = builder.create();\r\n dialog.show();\r\n }", "public void alert(View view){\n\n show(AppDialog.TAG_ALERT);\n }", "public void alert(String msg) {\n new Alert(msg, \"alertDone\");\n }", "private void showCheckDialog() {\n AlertDialog.Builder showAuditAlert = new AlertDialog.Builder(this); // Create Alert dialog\n showAuditAlert.setTitle(\"Total prize\"); // Set title\n showAuditAlert.setMessage(\"= \"+mydb.getResultDayAudit(year,month,day).intValue()+\"\"); // Set message\n\n showAuditAlert.setPositiveButton(\"Done\",\n new DialogInterface.OnClickListener()\n { // Can hear \"CLICK\"\n @Override\n public void onClick(DialogInterface dialog,int which)\n {\n \tdialog.dismiss(); // CLICK then disappear\n }\n }\n );\n showAuditAlert.show(); // Show dialog that created upper this line\n }", "@Override\n public void onClick(View v) {\n builder.setMessage(R.string.alertMessage)\n .setCancelable(false)\n .setPositiveButton(\"Yes\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n //buClick();\n //finish();\n dialog.cancel();\n calculat();\n\n }\n })\n .setNegativeButton(\"No\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n // Action for 'NO' Button\n dialog.cancel();\n\n }\n });\n //Creating dialog box\n AlertDialog alert = builder.create();\n //Setting the title manually\n alert.setTitle(R.string.alertTitle);\n alert.show();\n }", "public static void alert(String title, String message, AlertType a) {\r\n Alert alert = new Alert(a);\r\n alert.setTitle(title);\r\n alert.setHeaderText(null);\r\n alert.setContentText(message);\r\n //Optional<ButtonType> result = alert.showAndWait();\r\n alert.showAndWait();\r\n }", "private void showDialog() {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(\"User created successfully\");\n builder.setIcon(R.drawable.ic_shield);\n builder.setCancelable(true);\n builder.setPositiveButton(\n \"Continue\",\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n finish();\n }\n });\n AlertDialog alert11 = builder.create();\n alert11.show();\n Window window = alert11.getWindow();\n assert window != null;\n WindowManager.LayoutParams wlp = window.getAttributes();\n wlp.gravity = Gravity.CENTER;\n wlp.y = 270;\n wlp.flags &= ~WindowManager.LayoutParams.FLAG_DIM_BEHIND;\n window.setAttributes(wlp);\n }", "DialogResult show();", "private void showDialog(String msg) {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setMessage(msg)\n .setCancelable(false)\n .setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n }\n });\n AlertDialog alert = builder.create();\n alert.show();\n }", "public static void alert(String message) {\r\n\t Stage window = new Stage();\r\n\r\n\t // Blokira klikanje na druge povrsine sem pop-up\r\n\t window.initModality(Modality.APPLICATION_MODAL);\r\n\t window.setTitle(\"Alert\");\r\n\t window.setMinWidth(250);\r\n\t window.setMinHeight(100);\r\n\t \r\n\t // Label\r\n\t Label label = new Label();\r\n\t label.setText(message);\r\n\t Button closeButton = new Button(\"Close\");\r\n\t closeButton.setOnAction(e -> window.close());\r\n\r\n\t // Layout\r\n\t VBox layout = new VBox(10);\r\n\t layout.getChildren().addAll(label, closeButton);\r\n\t layout.setAlignment(Pos.CENTER);\r\n\r\n\t // Pop-up ostaje aktivan\r\n\t Scene scene = new Scene(layout);\r\n\t window.setScene(scene);\r\n\t window.showAndWait();\r\n\t }", "public void Report_User_alert(){\n final AlertDialog.Builder alert=new AlertDialog.Builder(context,R.style.DialogStyle);\n alert.setTitle(\"Report\")\n .setMessage(\"Are you sure to Report this user?\")\n .setNegativeButton(\"No\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n dialog.dismiss();\n }\n })\n .setPositiveButton(\"yes\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n Send_report();\n }\n });\n\n alert.setCancelable(true);\n alert.show();\n }", "public AlertDialog createAlert(String title,String message) {\n Builder builder = new Builder(currentContext);\n builder.setTitle(title);\n builder.setMessage(message);\n builder.setCancelable(true);\n builder.setPositiveButton(ok, this.new OkOnClickListener());\n alertDialog = builder.create();\n alertDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);\n alertDialog.setCanceledOnTouchOutside(true);\n alertDialog.setCancelable(true);\n if (null != activity && !activity.isFinishing()) {\n alertDialog.show();\n }\n return alertDialog;\n }", "protected void alert(String message) {\n\t\talertWindow.setContentText(message);\n\t\talertWindow.show();\n\t}", "public void createAlertDialog(String msg) {\n\t\tAlertDialog.Builder alertbox = new AlertDialog.Builder(\n\t\t\t\tMainActivity.this);\n\t\talertbox.setTitle(\"Response Message\");\n\t\talertbox.setMessage(msg);\n\t\talertbox.setPositiveButton(\"Ok\", new DialogInterface.OnClickListener() {\n\t\t\t// do something when the button is clicked\n\t\t\tpublic void onClick(DialogInterface arg0, int arg1) {\n\t\t\t}\n\t\t});\n\t\talertbox.show();\n\t}", "public void onClickShowAlert(View view) {\n AlertDialog.Builder myAlertBuilder = new\n AlertDialog.Builder(MainActivity.this);\n // Set the dialog title and message.\n myAlertBuilder.setTitle(\"Alert\");\n myAlertBuilder.setMessage(\"Click OK to continue, or Cancel to stop:\");\n // Add the dialog buttons.\n myAlertBuilder.setPositiveButton(\"OK\", new\n DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n // User clicked OK button.\n Toast.makeText(getApplicationContext(), \"Pressed OK\",\n Toast.LENGTH_SHORT).show();\n }\n });\n myAlertBuilder.setNegativeButton(\"Cancel\", new\n DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n // User cancelled the dialog.\n Toast.makeText(getApplicationContext(), \"Pressed Cancel\",\n Toast.LENGTH_SHORT).show();\n }\n });\n // Create and show the AlertDialog.\n myAlertBuilder.show();\n }", "private void showAlert(String msg) {\n\t\tAlertDialog.Builder builder = new AlertDialog.Builder(this);\n\t\tbuilder.setMessage(msg).setCancelable(false).setPositiveButton(\"Ok\", new DialogInterface.OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(DialogInterface dialog, int id) {\n\t\t\t\tdialog.cancel();\n\t\t\t}\n\t\t});\n\t\tAlertDialog alert = builder.create();\n\t\talert.show();\n\t}", "private void doDialogMsgBuilder() {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setMessage(getResources().getString(R.string.OverAge))\n .setCancelable(false)\n .setPositiveButton(getResources().getString(R.string.ok),\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n finish();\n }\n });\n\n AlertDialog alert = builder.create();\n alert.show();\n }", "private void showAlert(String message) {\n\t\tAlertDialog.Builder builder = new AlertDialog.Builder(this);\n\t\tbuilder.setMessage(message).setTitle(\"Response from Yourcare\")\n\t\t\t\t.setCancelable(false)\n\t\t\t\t.setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n\t\t\t\t\tpublic void onClick(DialogInterface dialog, int id) {\n\t\t\t\t\t\t// do nothing\n\t\t\t\t\t\t\n\n\t\t\t\t\t\tIntent intent = new Intent(getApplicationContext(),CapturePrescriptionActivity.class);\n\t\t\t\t\t\tstartActivity(intent);\n\t\t\t\t\t\tfinish();\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t});\n\t\tAlertDialog alert = builder.create();\n\t\talert.show();\n\t}", "private void alert(String message) {\n\t\tAlertDialog alert = new AlertDialog.Builder(this).setTitle(getString(R.string.warning)).setMessage(message)\n\t\t\t\t.setNeutralButton(getString(R.string.ok), new DialogInterface.OnClickListener() {\n\t\t\t\t\tpublic void onClick(DialogInterface dialog, int id) {\n\t\t\t\t\t\t// TODO maybe implement ? controller.connect();\n\t\t\t\t\t\tdialog.cancel();\n\t\t\t\t\t}\n\t\t\t\t}).create();\n\t\talert.show();\n\t}", "public void CustomAlertSave2(String msg) {\n\t\tfinal Dialog dialog = new Dialog(context);\r\n\t\t// hide to default title for Dialog\r\n\t\tdialog.requestWindowFeature(Window.FEATURE_NO_TITLE);\r\n\t\t// inflate the layout dialog_layout.xml and set it as contentView\r\n\t\tLayoutInflater inflater = (LayoutInflater) context\r\n\t\t\t\t.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\r\n\t\tView view = inflater.inflate(R.layout.dialog_layout, null, false);\r\n\t\tdialog.setCanceledOnTouchOutside(true);\r\n\t\tdialog.setContentView(view);\r\n\t\tdialog.getWindow().setBackgroundDrawable(new ColorDrawable(0));\r\n\t\tTextView txtTitle = (TextView) dialog\r\n\t\t\t\t.findViewById(R.id.txt_alert_message);\r\n\t\ttxtTitle.setText(msg);\r\n\r\n\t\tButton btn_ok = (Button) dialog.findViewById(R.id.btn_ok);\r\n\t\tbtn_ok.setOnClickListener(new android.view.View.OnClickListener() {\r\n\r\n\t\t\tpublic void onClick(View v) {\r\n\t\t\t\tdialog.dismiss();\r\n\r\n\t\t\t}\r\n\r\n\t\t});\r\n\t\tdialog.show();\r\n\t}", "private void alert(String string) {\n\r\n\t}", "public static void alertDialog(final String message) {\r\n _app.invokeLater(new Runnable() {\r\n public void run() {\r\n Dialog.alert(message);\r\n }\r\n });\r\n }", "private void showAlert(String message) {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setMessage(message);\n builder.show();\n }", "AlertDialog getAlertDialog();", "private void alert(String title, String msg) {\n if (title.isEmpty() || msg.isEmpty()) {\n return;\n }\n if (isFinishing()) {\n return;\n }\n new AlertDialog.Builder(this).setTitle(title).setMessage(msg)\n .setIcon(android.R.drawable.ic_dialog_info)\n .setNeutralButton(R.string.ok, null).show();\n }", "public static native void alert(String texto)/*-{\n\t\t\t\n\t\t\t$wnd.bootbox.alert(texto);\t\n\t\n\t\n\t}-*/;", "public static void alert(String title, String header, String message, AlertType a) {\r\n Alert alert = new Alert(a);\r\n alert.setTitle(title);\r\n alert.setHeaderText(header);\r\n alert.setContentText(message);\r\n //Optional<ButtonType> result = alert.showAndWait();\r\n alert.showAndWait();\r\n }", "static void showAlert(final Context con, final String title, final String msg){\n \tAlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(con);\n \n\t\t\t// set title\n\t\talertDialogBuilder.setTitle(title);\n\t\talertDialogBuilder.setMessage(msg).setCancelable(true)\n\t\t\t\t.setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n\n\t\t @Override\n\t\t public void onClick(DialogInterface dialog, int which) {\n\t\t // TODO Auto-generated method stub\n\t\t // Do something\n\t\t dialog.dismiss();\n\t\t }\n\t\t });\n\t\t\n\t\tAlertDialog alertDialog = alertDialogBuilder.create();\n\t\talertDialog.show();\n }", "private void alertDialog(int title, int message, int icon) {\n tst_Message.cancel();\n tst_Message = null;\n AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);\n builder.setTitle(title);\n builder.setMessage(message);\n builder.setIcon(icon);\n builder.setPositiveButton(R.string.dialog_pos_btn, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n reset();\n }\n });\n builder.show();\n }", "private void alertBox(String title, String message) {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setMessage(\"GPS Anda tampaknya dinonaktifkan, apakah Anda ingin mengaktifkannya?\")\n .setCancelable(false)\n .setTitle(\"STATUS GPS\")\n .setPositiveButton(\n \"YA\",\n new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n /* this gonna call class of settings then dialog interface disappeared */\n Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);\n startActivity(intent);\n dialog.cancel();\n }\n }\n )\n .setNegativeButton(\"TIDAK\", new DialogInterface.OnClickListener() {\n public void onClick(final DialogInterface dialog, @SuppressWarnings(\"unused\") final int id) {\n dialog.cancel();\n }\n }\n );\n AlertDialog alertDialog = builder.create();\n alertDialog.show();\n }", "private void showAlert(String message) {\n\n if (message.equals(\"Uploaded Successfully...\")) {\n // this.dismiss();\n commmunicator.onDialogMessage(new MessageDetails());\n this.dismiss();\n\n } else {\n\n AlertDialog.Builder builder = new AlertDialog.Builder(form.getContext());\n builder.setMessage(message).setTitle(\"Response from Servers\")\n .setCancelable(false)\n .setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n // do nothing\n }\n });\n AlertDialog alert = builder.create();\n alert.show();\n }\n }", "private void alertDialoge() {\n builder.setMessage(R.string.dialoge_desc).setTitle(R.string.we_request_again);\n\n builder.setCancelable(false)\n .setPositiveButton(R.string.give_permissions, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n requestPermission();\n }\n })\n .setNegativeButton(R.string.dont_ask_again, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n // Action for 'Don't Ask Again' Button\n // the sharedpreferences value is true\n editor.putBoolean(getResources().getString(R.string.dont_ask_again), true);\n editor.commit();\n dialog.cancel();\n }\n });\n //Creating dialog box\n AlertDialog alert = builder.create();\n alert.show();\n }", "public void alert(String txtMsg, final String action, final View btn_view)\n {\n LayoutInflater inflator = LayoutInflater.from(BookingDetailsActivity.this);\n final View yourCustomView = inflator.inflate(R.layout.custom_dialog, null);\n //endregion\n\n //region (2) init dialogue\n final AlertDialog dialog = new AlertDialog.Builder(BookingDetailsActivity.this)\n .setTitle(\"Do you want to proceed ?\")//replace w \"txtMsg\"\n .setView(yourCustomView)\n .create();\n //endregion\n\n //region (3) set onClicks for custom dialog btns\n yourCustomView.findViewById(R.id.btn_yes).setOnClickListener(new View.OnClickListener()\n {\n @Override\n public void onClick(View view)\n {\n switch (action)\n {\n case \"save\":\n SaveAppoint(btn_view);\n break;\n case \"cancel\":\n CancelAppoint(btn_view);\n break;\n }\n }\n });\n yourCustomView.findViewById(R.id.btn_no).setOnClickListener(new View.OnClickListener()\n {\n @Override\n public void onClick(View view)\n {\n dialog.dismiss();\n }\n });\n //endregion\n\n //region (4) Display dialogue\n dialog.show();\n //endregion\n }", "private void showAlertDialog() {\n new AlertDialog.Builder(getActivity())\n .setMessage(R.string.feedback_sharing_data_alert)\n .setCancelable(false)\n .setPositiveButton(R.string.ok, (dialog, which) -> {\n sendFeedback();\n })\n .show();\n }", "@Override\n public void handle(ActionEvent event) {\n alert = new Alert(AlertType.CONFIRMATION);\n //Optional title. If not used the standard title \"Confiramation\" will be displayed\n //To remove the title use alert.setTitle(null);\n alert.setTitle(\"Confirmation Dialog\");\n //Optional header.If not used the standard header \"Confiramation\" will be displayed\n //To remove the title use alert.setHeaderText(null); \n alert.setHeaderText(\"Please answer the question!\");\n alert.setContentText(initText);\n //Display the dialog and get the result from the user action\n Optional<ButtonType> result = alert.showAndWait();\n if (result.get() == ButtonType.OK){\n // the user clicked OK\n alert = new Alert(AlertType.INFORMATION);\n alert.setTitle(\"Information Dialog\");\n alert.setHeaderText(\"Important message for you!\");\n alert.setContentText(\"Happiness is ephemeral!\");\n alert.showAndWait(); \n //the user clocked Cancel\n } else {\n // ... user chose CANCEL or closed the dialog\n //Warning Dialog\n alert = new Alert(AlertType.WARNING);\n alert.setTitle(\"Warning Dialog\");\n alert.setHeaderText(\"Read the Warning!\");\n alert.setContentText(\"You must like Java - Shall make you Happy!\");\n alert.showAndWait(); \n }\n }", "private void showAlert(String message) {\n //Builds an AlertDialog with message, title, if cancellable, and what the positive button does\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n builder.setMessage(message).setTitle(\"Response from Servers\")\n .setCancelable(false)\n .setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n // do nothing\n }\n });\n AlertDialog alert = builder.create();\n alert.show();\n// String errorMessage = null;\n// try {\n// JSONObject arr = new JSONObject(message);\n// errorMessage = arr.getString(\"error\");\n// } catch (JSONException e) {\n// e.printStackTrace();\n// }\n// Toast.makeText(getActivity(), errorMessage, Toast.LENGTH_LONG).show();\n\n }", "private void showAlert(){\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity())\n .setTitle(\"Your further details please:\")\n .setView(view);\n builder.setPositiveButton(\"Proceed\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n Intent it = new Intent(getActivity(), StudentFurtherDetails.class);\n getActivity().startActivity(it);\n }\n\n });\n //call api for insertion\n builder.setNegativeButton(\"Later\", null)\n .setCancelable(false);\n AlertDialog alert = builder.create();\n alert.show();\n }", "public static void alertbox_Accept() throws CheetahException {\n\t\ttry {\n\t\t\tSystem.out.println(\"Step into alert box\");\n\t\t\tAlert simpleAlert = CheetahEngine.getDriverInstance().switchTo().alert();\n\t\t\tsimpleAlert.accept();\n\t\t} catch (Exception e) {\n\t\t\tthrow new CheetahException(e);\n\t\t}\n\t}", "void AlertaValidacion(String title, String message){\n AlertDialog.Builder builder = new AlertDialog.Builder(RegisterActivity.this);\n builder.setTitle(title);\n builder.setMessage(message).setPositiveButton(\"ACEPTAR\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n\n }\n });\n AlertDialog alert = builder.create();\n alert.show();\n }", "private void showAlert(String status, String msg){\n android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(HostelRequestActivity.this)\n .setTitle(status)\n .setMessage(msg);\n builder.setPositiveButton(\"Ok\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n onBackPressed();\n }\n\n });\n //call api for insertion\n builder.setCancelable(false);\n android.app.AlertDialog alert = builder.create();\n alert.show();\n }", "private void showAlertDialog(String message) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity())\n .setTitle(\"QR Scanner\")\n .setMessage(message)\n .setPositiveButton(\"OKAY\", (dialog, which) -> {\n dialog.dismiss();\n });\n AlertDialog alertDialog = builder.create();\n alertDialog.show();\n }", "public void showAlert(String cadena, Context ctx){\n AlertDialog.Builder alertbox = new AlertDialog.Builder(ctx);\n //seleccionamos la cadena a mostrar\n alertbox.setMessage(cadena);\n alertbox.show();\n\n }", "public AlertDialog createSimpleDialog() {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(\"Code with love by\")\n .setMessage(\"Alvaro Velasco & Jose Alberto del Val\");\n return builder.create();\n }", "public static void crearAlerta(String titulo,String mensaje){\n Alert alert=new Alert(Alert.AlertType.WARNING);\n alert.setHeaderText(null);\n alert.setTitle(titulo);\n alert.setContentText(mensaje);\n alert.showAndWait();\n }", "public static void AlertAccept() {\n\t\tAlert alt = Browser.Driver.switchTo().alert();\n\t\talt.accept();\n\t}", "private void alertBox_service(String title, String msg) {\r\n\t\tAlertDialog.Builder service_alert = new AlertDialog.Builder(this.mContext);\r\n\t\tservice_alert.setTitle(title);\r\n\t\tservice_alert.setMessage(msg);\r\n\t\tservice_alert.setNeutralButton(\"OK\",new DialogInterface.OnClickListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onClick(DialogInterface dialog, int which) {\r\n\t\t\t\tdialog.dismiss();\r\n\r\n\t\t\t}\r\n\t\t});\r\n\t\tservice_alert.show();\r\n\t}", "public static native void alert(String msg) /*-{\r\n $wnd.alert(msg);\r\n }-*/;", "public void alertForOuitMessage() {\n final AlertDialog.Builder builder = new AlertDialog.Builder(context);\n final AlertDialog alert = builder.create();\n alert.getWindow().getAttributes().windowAnimations = R.style.alertAnimation;\n View view = alert.getLayoutInflater().inflate(R.layout.quiz_quit_alert, null);\n TextView title1 = (TextView) view.findViewById(R.id.title1);\n title1.setText(context.getString(R.string.quiz_quit_are));\n title1.setTypeface(VodafoneRg);\n TextView title2 = (TextView) view.findViewById(R.id.title2);\n title2.setText(context.getString(R.string.quiz_quit_progress));\n title2.setTypeface(VodafoneRg);\n TextView quiz_text = (TextView) view.findViewById(R.id.quit_text);\n quiz_text.setTypeface(VodafoneRg);\n LinearLayout quit_layout = (LinearLayout) view.findViewById(R.id.quit_layout);\n alert.setCustomTitle(view);\n TextView quit_icon = (TextView) view.findViewById(R.id.quit_icon);\n quit_icon.setTypeface(materialdesignicons_font);\n quit_icon.setText(Html.fromHtml(\"&#xf425;\"));\n quit_layout.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n alert.dismiss();\n finish();\n }\n });\n alert.show();\n }", "@SuppressWarnings(\"deprecation\")\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tAlertDialog alertDialog = new AlertDialog.Builder(GameInitializerActivity.this).create();\n\t\t\t\tLayoutInflater factory = LayoutInflater.from(GameInitializerActivity.this);\n\t\t\t\tfinal View view = factory.inflate(R.layout.activity_about_popupwindow, null);\n\t\t\t\talertDialog.setView(view);\n\t\t\t\talertDialog.setButton3(\"OK. I Got this !!\", dialogClickListener);\n\t\t\t\talertDialog.show();\t\t\t\t\n\t\t\t\t\n\t\t\t}", "public void showAlertDialog(String title, String message) {\n\n\t\t// Create an object of alert class for an activity\n\t\tAlertDialog alertDialog = new AlertDialog.Builder(objContext).create();\n\n\t\t// Setting Dialog Title\n\t\talertDialog.setTitle(title);\n\n\t\t// Setting Dialog Message\n\t\talertDialog.setMessage(message);\n\n\t\t// Setting Icon to Dialog\n\t\talertDialog.setIcon(R.drawable.ic_launcher);\n\n\t\talertDialog.setButton(DialogInterface.BUTTON_POSITIVE, \"Ok\", new DialogInterface.OnClickListener() {\n\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\tdialog.dismiss();\n\t\t\t}\n\t\t});\n\t\talertDialog.show();\n\t}", "public void showAlertMessage(String message) {\n AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(context);\n alertDialogBuilder.setMessage(message).setCancelable(false).setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n }\n });\n AlertDialog alertdialog = alertDialogBuilder.create();\n alertdialog.show();\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 }", "public void showMessage(){\n final AlertDialog.Builder alert = new AlertDialog.Builder(context);\n alert.setMessage(message);\n alert.setTitle(title);\n alert.setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n alert.create().dismiss();\n }\n });\n alert.create().show();\n }", "private AlertDialog alertBuilder() {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setMessage(\"Missing Arduino Unit, go to Settings?\").\n setCancelable(false).setPositiveButton(\n \"Yes\", new DialogInterface.OnClickListener() {\n\n public void onClick(DialogInterface dialog, int id) {\n //call qr scan intent\n Intent prefScreen = new Intent(TempMeasure.this, Preferences.class);\n startActivityForResult(prefScreen, 0);\n }\n }).setNegativeButton(\"No\", new DialogInterface.OnClickListener() {\n\n public void onClick(DialogInterface dialog, int id) {\n dialog.cancel();\n }\n });\n AlertDialog alert = builder.create();\n return alert;\n }", "private void alertDialogBuilder(String message) {\n\t\tAlertDialog.Builder builder = new AlertDialog.Builder(this);\n\t\tbuilder.setMessage(message)\n\t\t\t\t.setCancelable(false)\n\t\t\t\t.setPositiveButton(\"Yes\",\n\t\t\t\t\t\tnew DialogInterface.OnClickListener() {\n\t\t\t\t\t\t\tpublic void onClick(DialogInterface dialog, int id) {\n\t\t\t\t\t\t\t\tdbHelper.clearResults();\n\t\t\t\t\t\t\t\tfillData();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t.setNegativeButton(\"No\", new DialogInterface.OnClickListener() {\n\t\t\t\t\tpublic void onClick(DialogInterface dialog, int id) {\n\t\t\t\t\t\tdialog.cancel();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\tAlertDialog alert = builder.create();\n\t\talert.show();\n\t}", "private void showLoserDialog() {\n Alert alert = new Alert(Alert.AlertType.CONFIRMATION, \"You Have Been Defeated \" + player1.getName() + \",Computer Wins!!\", new ButtonType(\"Close\", ButtonBar.ButtonData.NO), new ButtonType(\"Try Again?\", ButtonBar.ButtonData.YES));\n alert.setGraphic(new ImageView(new Image(this.getClass().getResourceAsStream(\"/Images/bronze.png\"))));\n alert.setHeaderText(null);\n alert.setTitle(\"Computer Wins\");\n alert.showAndWait();\n if (alert.getResult().getButtonData() == ButtonBar.ButtonData.YES) {\n onReset();\n }\n }", "public void alert(String msg) {\n\t\tJOptionPane.showMessageDialog(rootPane, msg);\n\t}", "public static void aboutApp(){\n\t\tAlert alertDialog = new Alert(Alert.AlertType.INFORMATION);\n\t\talertDialog.setTitle(\"My first java Desktop App\");\n\t\talertDialog.setHeaderText(\"Learning JavaFX\");\n\t\talertDialog.setContentText(\"I'm a beginner and soon i'll be a pro\");\n\n\t\t//to make custom buttons\n\t\tButtonType yesBtn = new ButtonType(\"yes\");\n\t\tButtonType noBtn = new ButtonType(\"No\");\n\t\talertDialog.getButtonTypes().setAll(yesBtn,noBtn);\n\n\t\t//to perform click event on buttons of the dilague box that opens and make buttons\n\t\tOptional<ButtonType> clickBtn=alertDialog.showAndWait();\n\t\tif(clickBtn.isPresent()&&clickBtn.get()==yesBtn){\n\t\t\t// code .......\n\t\t}\n\t\tif(clickBtn.get()==noBtn){\n\t\t\t//code..........\n\t\t}\n\n\t\talertDialog.show();\n\t}", "public void acceptAlert() {\n\t\tAlert popUp = null;\n\t\ttry {\n\t\t\tpopUp = getDriver().switchTo().alert();\n\t\t\tpopUp.accept();\n\t\t} catch (NoAlertPresentException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "private void SuccessfulBox(View v){\n \t//create an alert box with specified properties\n \tnew AlertDialog.Builder(this)\n \t.setTitle(\"Submit Successfully!\")\n \t.setMessage(\"New prescription information has been added to\" + \" \" +item)\n \t.setNeutralButton(\"ok\", null)\n \t.show();\n }", "private void showErrorAlert()\n {\n \tAlertDialog.Builder builder = new AlertDialog.Builder(this);\n \tbuilder.setMessage(getResources().getString(R.string.app_error_str))\n \t .setCancelable(false)\n \t .setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n \t public void onClick(DialogInterface dialog, int id) {\n \t dialog.cancel();\n \t }\n \t });\n \t \n \tAlertDialog alert = builder.create();\n \talert.show();\n }", "@When(\"^User will click on show alert box$\")\r\n\tpublic void user_will_click_on_show_alert_box() throws Throwable {\n\t\tSystem.out.println(\"User will click on alert button\");\r\n\t}", "public void acceptPopUp(WebDriver driver)\r\n\t{\n\t\tAlert alert=driver.switchTo().alert();\r\n\t\t\t\r\n\t\t//accept the alert\r\n\t\talert.accept();\r\n\t}", "@Test\n public void basicAlertHandlingTest(){\n\n WebElement alertButton = driver.findElement(By.id(\"alertexamples\"));\n alertButton.click();\n String alertMessage = \"I am an alert box!\";\n\n assertEquals(alertMessage, driver.switchTo().alert().getText());\n driver.switchTo().alert().accept();\n }", "public void showAlertDialog(View v){\n AlertDialog.Builder alert = new AlertDialog.Builder(this);\n alert.setTitle(\"Update Details\");\n alert.setMessage(\"Do you really want to update details?\");\n\n //if customer click yes\n alert.setPositiveButton(\"Yes\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n Toast.makeText(MEditProfile.this, \"Update Successfully\", Toast.LENGTH_SHORT).show();\n }\n });\n //if customer click no\n alert.setNegativeButton(\"No\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n Toast.makeText(MEditProfile.this,\"\",Toast.LENGTH_SHORT).show();\n }\n });\n alert.create().show();\n }", "public void acceptAlert() {\n WebDriverWait wait = new WebDriverWait(getDriver(), timeOut);\n wait.until(ExpectedConditions.alertIsPresent());\n getDriver().switchTo().alert().accept();\n }", "private void showInputDialog() {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(\"App info\");\n builder.setMessage(message);\n builder.setPositiveButton(\" Done \", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n dialog.dismiss();\n }\n });\n builder.show();\n }", "@Override\n public void onClick(View v)\n {\n AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(activity, R.style.AppTheme));\n dialogBuilder.setView(viewConfirmDialog);\n AlertDialog alertDialog= dialogBuilder.create();\n Window windowAlert = alertDialog.getWindow();\n WindowManager.LayoutParams layoutConfirmDialog = new WindowManager.LayoutParams();\n layoutConfirmDialog.copyFrom(windowAlert.getAttributes());\n layoutConfirmDialog.width = 320;\n layoutConfirmDialog.height = 320;\n alertDialog.getWindow().setAttributes(layoutConfirmDialog);\n dismissAlertDialog();\n components.alertDialog = alertDialog;\n alertDialog.show();\n\n }", "protected void alertbox(String title, String mymessage) {\n \t\t// add scrollview to alertbox\n \t\tnew AlertDialog.Builder(this)\n \t\t\t\t.setMessage(mymessage)\n \t\t\t\t.setTitle(title)\n \t\t\t\t.setView(LayoutInflater.from(this).inflate(R.layout.scroll_result,null))\n \t\t\t\t.setCancelable(true)\n \t\t\t\t.setNeutralButton(\"Done\",\n \t\t\t\t\t\tnew DialogInterface.OnClickListener() {\n \t\t\t\t\t\t\tpublic void onClick(DialogInterface dialog,\n \t\t\t\t\t\t\t\t\tint whichButton) {\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t}).show();\n \t}", "private void confirmationAlert() {\n\t\tAlert confirm = new Alert( AlertType.CONFIRMATION, \"You Will Not Be Able To Change Your Name\\nAfter You Press 'OK'.\");\n\t\tconfirm.setHeaderText(\"Are You Sure?\");\n confirm.setTitle(\"Confirm Name\");\n confirm.showAndWait().ifPresent(response -> {\n if (response == ButtonType.OK) {\n \tbackground.remove( pointer );\n \tkeyStrokes = keyStrokes.replace(\" \", \"-\");\n\t\t\t\tinsertNewHiScore();\n\t\t\t\tnewHighScore = false;\n }\n });\n\t}", "@Override\r\n\t\tpublic void onClick(View v) {\n\t\t\tAlertDialog.Builder builder=new AlertDialog.Builder(getActivity());\t\r\n\t\t\tbuilder.setTitle(\"Version 1.0\")\r\n\t\t\t.setMessage(\"With the App User Easily get the Work and directly Interact with Admin.\");\r\n\t\tbuilder.setNegativeButton(\"CLOSE\", new DialogInterface.OnClickListener() {\r\n public void onClick(DialogInterface dialog, int which) {\r\n // Write your code here to execute after dialog closed\r\n Toast.makeText(getActivity().getApplicationContext(), \"You clicked on CLOSE\", Toast.LENGTH_SHORT).show();\r\n }\r\n });\r\n \r\n // Showing Alert Message\r\n builder.show();\r\n\t\t}", "public S<T> alert(String title,String text){\n\t\t\n\t\tAlertDialog alertDialog = new AlertDialog.Builder(activity).create();\n\t\talertDialog.setTitle(title);\n\t\talertDialog.setMessage(text);\n\t\talertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, \"OK\",\n\t\t new DialogInterface.OnClickListener() {\n\t\t public void onClick(DialogInterface dialog, int which) {\n\t\t dialog.dismiss();\n\t\t }\n\t\t });\n\t\talertDialog.show();\n\t\treturn this;\n\t}", "private void popupCalibratingDialog() {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(R.string.motion_calibrating);\n builder.setCancelable(false);\n builder.setMessage(R.string.motion_calibrating_message);\n\n calibratingDialog = builder.create();\n calibratingDialog.show();\n }", "public void alert(String msg)\n {\n this.ui.alert(msg);\n theLogger.info(\"Alert sent to UI\");\n }", "private void sendAlert(String message, Alert.AlertType type) {\n Alert alert = new Alert(type);\n alert.setTitle(\"Submission Error\");\n alert.setHeaderText(null);\n alert.setContentText(message);\n alert.showAndWait();\n }", "private void createAlertDialog(String title, String message, final boolean shouldExit) {\n Collect.getInstance().getActivityLogger().logAction(this, \"createAlertDialog\", \"show\");\n mAlertDialog = new AlertDialog.Builder(this).create();\n mAlertDialog.setTitle(title);\n mAlertDialog.setMessage(message);\n DialogInterface.OnClickListener quitListener = new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int i) {\n switch (i) {\n case DialogInterface.BUTTON1: // ok\n Collect.getInstance().getActivityLogger().logAction(this, \"createAlertDialog\", \"OK\");\n // successful download, so quit\n if (shouldExit) {\n finish();\n }\n break;\n }\n }\n };\n mAlertDialog.setCancelable(false);\n mAlertDialog.setButton(getString(R.string.ok), quitListener);\n mAlertDialog.setIcon(android.R.drawable.ic_dialog_info);\n mAlertDialog.show();\n }", "public static void alert(AlertType type, String title, String message) {\n\t\tAlert alert = new Alert(type);\n\t\talert.setTitle(title);\n\t\talert.setContentText(message);\n\t\talert.show();\n\t}", "public static void acceptAlertPopup() throws InterruptedException{\n \ttry {\n \t\talert = driver.switchTo().alert();\n \t\tSystem.out.println(alert.getText());\n \t\tThread.sleep(2000);\n \t\talert.accept();\n \t\tlog.info(\"Alert Accepted\");\n \t }\n \tcatch(Exception e) {\n \t\tSystem.out.println(\"Alert Error : acceptAlertPopup()\");\n \t }\n }", "void ShowWaitDialog(String title, String message);", "private void showHelp(){\n AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this,R.style.MyDialogTheme);\n alertDialogBuilder.setMessage(\"Welcome to NBA Manager 2019\\n\\n\" +\n \"The purpose of the application is to simulate a basketball manager game and draft a team.\\n\\n\" +\n \"You can view your current roster by pressing the right arrow in the top right corner.\\n\\n\" +\n \"*Not all players will have a height or a weight.\");\n alertDialogBuilder.setPositiveButton(\"Ok\",\n new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface arg0, int arg1) {\n }\n });\n AlertDialog alertDialog = alertDialogBuilder.create();\n alertDialog.show();\n }", "public void actionPerformed (ActionEvent e)\n\t\t\t\t{\n\t\t\t\talertOK();\n\t\t\t\t}", "@Then(\"^User should see a predefined alert box$\")\r\n\tpublic void user_should_see_a_predefined_alert_box() throws Throwable {\n\t\tSystem.out.println(\"Alert message pop-ups on the screen\");\r\n\t}", "public void working() {\n\t\t Dialog d = new Dialog(this);\r\n\t\t d.setTitle(\"hech yea!\");\r\n\t\t TextView tv = new TextView(this);\r\n\t\t tv.setText(\"Success\");\r\n\t\t d.setContentView(tv);\r\n\t\t d.show();\t\r\n\t}", "public void AlertBox(String title, String message, int width, int height) {\n //Creating the stage and modifying its settings for the alertBox\n Stage window = new Stage();\n window.initModality((Modality.APPLICATION_MODAL));\n window.setTitle(title);\n window.centerOnScreen();\n\n //Creating the layout for the box\n VBox layout = new VBox();\n layout.setAlignment(Pos.CENTER);\n layout.setSpacing(5);\n Label messageToDisplay = new Label(message);\n //Event handling\n Button okButton = new Button(\"Ok\");\n okButton.setOnAction(e -> window.close());\n layout.getChildren().addAll(messageToDisplay, okButton);\n\n\n Scene scene = new Scene(layout, width, height);\n window.setScene(scene);\n window.setResizable(false);\n window.showAndWait();\n\n }", "private void showbadgedialog() {\n final LayoutInflater li = LayoutInflater.from(mContext);\n //Creating a view to get the dialog box\n View confirmDialog = li.inflate(R.layout.dialog_badges, null);\n // number=session.getMobileNumber();\n //Initizliaing confirm button fo dialog box and edittext of dialog box\n final Button buttonconfirm = (Button) confirmDialog.findViewById(R.id.buttonConfirm);\n\n\n AlertDialog.Builder alert = new AlertDialog.Builder(mContext);\n\n alert.setView(confirmDialog);\n\n final AlertDialog alertDialog = alert.create();\n alertDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));\n alertDialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);\n\n alertDialog.show();\n\n //On the click of the confirm button from alert dialog\n buttonconfirm.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n alertDialog.dismiss();\n }\n });\n\n }", "public static void alert(Context c, String msg) {\n\t\talert(c, msg, new OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\n\t\t\t\tif (dialog != null)\n\t\t\t\t\tdialog.dismiss();\n\t\t\t}\n\t\t});\n\t}", "private void answerResultAlert(String feedback){\n AlertDialog.Builder showResult = new AlertDialog.Builder(this);\n\n showResult.setTitle(feedback);\n showResult.setMessage(currentQuestion.getExplanation());\n showResult.setCancelable(false); //if this is not set, the user may click outside the alert, cancelling it. no cheating this way\n showResult.setNeutralButton(\"ok\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n //only when the ok is clicked will continue to run the program\n setUpQuestions();\n }\n });\n showResult.create();\n showResult.show();\n }" ]
[ "0.76374984", "0.7629751", "0.7358751", "0.73349357", "0.73304754", "0.7327125", "0.72602963", "0.72557676", "0.72481644", "0.7205927", "0.7171638", "0.71636444", "0.7159702", "0.71408737", "0.7140703", "0.71299905", "0.71291333", "0.7114488", "0.7093806", "0.7087516", "0.7087439", "0.7085423", "0.70596904", "0.7043375", "0.702417", "0.701276", "0.70065755", "0.69758904", "0.6945964", "0.69450927", "0.6937846", "0.69335836", "0.6917747", "0.6906071", "0.69027674", "0.6894314", "0.68761873", "0.6870708", "0.6866762", "0.6865367", "0.68597627", "0.6851794", "0.6839529", "0.68238944", "0.6817803", "0.68054026", "0.67994845", "0.67822456", "0.6770955", "0.67600584", "0.67600006", "0.6747362", "0.67446303", "0.6724502", "0.66983503", "0.66960335", "0.669318", "0.6685258", "0.6682958", "0.668207", "0.6679872", "0.6651075", "0.66425365", "0.66333634", "0.66323304", "0.6628687", "0.6621918", "0.66206646", "0.66169834", "0.6616776", "0.6616073", "0.66099817", "0.6568242", "0.65632486", "0.6563102", "0.6556937", "0.65548867", "0.65528125", "0.655274", "0.65467614", "0.6530652", "0.6523458", "0.6516344", "0.6508749", "0.64855385", "0.648552", "0.64782214", "0.6478135", "0.6473039", "0.6463993", "0.6456104", "0.6443165", "0.6440013", "0.64392215", "0.6438564", "0.643685", "0.643629", "0.6424897", "0.6424159", "0.6413445" ]
0.66264296
66
Makes an progress dialog
public S<T> progress(Boolean active,String text){ if(pDialog==null){ pDialog = new ProgressDialog(activity); pDialog.setMessage(text); pDialog.setCancelable(false); } if(active){ if (!pDialog.isShowing()) pDialog.show(); }else{ if (pDialog.isShowing()) pDialog.dismiss(); } return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void showModalProgress();", "@Override\n\tpublic void showProgress() {\n\t\twaitDialog(true);\n\t}", "private void showSpinerProgress() {\n dialog.setMessage(\"Loading\");\n//\n// dialog.setButton(ProgressDialog.BUTTON_POSITIVE, \"YES\", new DialogInterface.OnClickListener() {\n// @Override\n// public void onClick(DialogInterface dialog, int which) {\n//\n// }\n// });\n\n //thiet lap k the huy - co the huy\n dialog.setCancelable(false);\n\n //show dialog\n dialog.show();\n Timer timer = new Timer();\n timer.schedule(new TimerTask() {\n @Override\n public void run() {\n dialog.dismiss();\n }\n }, 20000000);\n }", "void showProgress();", "private void showDialog() {\n if (!progressDialog.isShowing())\n progressDialog.show();\n }", "public abstract DialogBox showProgressBox(String message);", "void showProgressDialog();", "void showProgressDialog();", "private void progressStuff() {\n cd = new ConnectionDetector(getActivity());\n parser = new JSONParser();\n progress = new ProgressDialog(getActivity());\n progress.setMessage(getResources().getString(R.string.loading));\n progress.setIndeterminate(false);\n progress.setCancelable(true);\n // progress.show();\n }", "private void creatDialog() {\n \t mDialog=new ProgressDialog(this);\n \t mDialog.setTitle(\"\");\n \t mDialog.setMessage(\"正在加载请稍后\");\n \t mDialog.setIndeterminate(true);\n \t mDialog.setCancelable(true);\n \t mDialog.show();\n \n\t}", "@Override\r\n\tprotected Dialog onCreateDialog(int id) {\r\n\t\tProgressDialog dialog = new ProgressDialog(this);\r\n\t\tdialog.setMessage(\"Please wait while saving...\");\r\n\t\tdialog.setIndeterminate(true);\r\n\t\tdialog.setCancelable(true);\r\n\t\treturn dialog;\r\n\t}", "protected void createProgressDialog() {\r\t\tif (pd == null) {\r\t\t\tpd = new ProgressDialog(this);\r\t\t\tpd.setCanceledOnTouchOutside(false);\r\t\t\tpd.getWindow().setGravity(Gravity.CENTER);\r\t\t\tpd.setOnCancelListener(new DialogInterface.OnCancelListener() {\r\t\t\t\t@Override\r\t\t\t\tpublic void onCancel(DialogInterface dialogInterface) {\r\t\t\t\t\tonPdCancel();\r\t\t\t\t}\r\t\t\t});\r\t\t}\r\t}", "public void showProgressDialog() {\n pd = new ProgressDialog(this);\n pd.setMessage(\"Renting film...\");\n pd.show();\n }", "public void progressMade();", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tshowDialog(progress_bar_type);\n\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tshowDialog(progress_bar_type);\n\t\t}", "void onShowProgress();", "private void \t\t\t\t\tcreateDialogProgressBar(String mess)\n\t{\n\t\tthis.progress_dialog = new ProgressDialog(this);\n\t\tthis.progress_dialog.setMessage(mess);\n\t\tthis.progress_dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n\t\tthis.progress_dialog.setIndeterminate(true);\n\t\tthis.progress_dialog.setCancelable(false);\n\t\tthis.progress_dialog.show();\n\t}", "void startProgress();", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\ttry {\n\t\t\t\tdialog.setIndeterminate(false);\n\t\t\t\tdialog.setMax(100);\n\t\t\t\tdialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n\t\t\t\tdialog.setCancelable(false);\n\t\t\t\tdialog.show();\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "@Override\n protected void onPreExecute() {\n progress = new ProgressDialog(hostContext);\n progress.setMessage(\"Wait while books are being downloaded...\");\n progress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progress.show();\n }", "@Override\n protected void onProgressUpdate(Integer... values) {\n super.onProgressUpdate(values);\n progress = new ProgressDialog(activity);\n progress.setMessage(\"please wait.. \");\n progress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progress.setIndeterminate(true);\n progress.setCancelable(false);\n progress.show();\n\n }", "@Override\n public void showProgress() {\n\n }", "@Override\r\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\r\n\t\t\tpDialog = new ProgressDialog(SingleRecord.this);\r\n\t\t\tpDialog.setMessage(\"downloading...\");\r\n\t\t\tpDialog.setIndeterminate(false);\r\n\t\t\tpDialog.setCancelable(true);\r\n\t\t\r\n\t\t\tpDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\r\n\t\t\tpDialog.show();\r\n\t\t\tpDialog.getWindow().setGravity(Gravity.BOTTOM);\r\n\t\t}", "private Dialog buildLoadingDialog() {\n ProgressDialog dialog = new ProgressDialog(this);\n dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n dialog.setMessage(getText(R.string.dialog_loading));\n dialog.setIndeterminate(true);\n dialog.setCancelable(false);\n return dialog;\n }", "public void showProgressDialog() {\r\n progressDialog.setMessage(getResources().getString(R.string.text_loading));\r\n progressDialog.setCancelable(false);\r\n progressDialog.show();\r\n }", "private void initialView(){\n // 进度条还有二级进度条的那种形式,这里就不演示了\n final ProgressDialog dialog = new ProgressDialog(this);\n dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);// 设置水平进度条\n dialog.setCancelable(true);// 设置是否可以通过点击Back键取消\n dialog.setCanceledOnTouchOutside(false);// 设置在点击Dialog外是否取消Dialog进度条\n\n dialog.setTitle(\"正在下载\");\n dialog.setMax(100);\n dialog.setMessage(\"请等待\");\n dialog.show();\n\n\n /*ThreadA t1 = new ThreadA(\"t1\");\n\n synchronized (t1){\n t1.start();\n while(!isExists()){\n try{\n t1.wait();\n }catch (Exception e){\n e.printStackTrace();\n }\n }\n }*/\n\n\n new Thread(new Runnable() {\n @Override\n public void run() {\n // TODO Auto-generated method stub\n try {\n Thread.sleep(25000);\n dialog.cancel();\n Intent intent=new Intent(ProgressActivity.this,SudokuActivity.class);\n startActivity(intent);\n } catch (InterruptedException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }\n }).start();\n }", "private void showProgress() {\n if (dialogProgress == null) {\n dialogProgress = new Dialog(this);\n dialogProgress.requestWindowFeature(Window.FEATURE_NO_TITLE);\n dialogProgress.setContentView(R.layout.custom_progress);\n dialogProgress.setCancelable(false);\n }\n\n dialogProgress.getWindow().getDecorView().getRootView().setBackgroundColor(getResources().getColor(android.R.color.transparent));\n dialogProgress.show();\n }", "private void showProgressDialog()\n {\n if (showProgressDialog && !getStatus().equals(AsyncTask.Status.FINISHED)) {\n //show the dialog if valid activity. If the OS is lollipop or higher then set the theme.\n //dialog = ProgressDialog.show(activity, \"In progress..\", message, true);\n if (Build.VERSION.SDK_INT >= 21) {\n dialog = new ProgressDialog(activity, R.style.progressoAlertDialogStyle);\n dialog.setTitle(\"In progress..\");\n dialog.setMessage(message);\n dialog.setIndeterminate(true);\n dialog.show();\n }\n else {\n dialog = ProgressDialog.show(activity, \"In progress..\", message, true);\n }\n\n dialog.setCancelable(false);\n } \n }", "private void showDialog(){\n progress = new ProgressDialog(this);\n progress.setTitle(getString(R.string.progress_dialog_loading));\n progress.setMessage(getString(R.string.progress_dialog_authenticating_with_firebase));\n progress.setCancelable(false);\n progress.show();\n }", "private void showProgressDialog() {\n if (progressDialog == null) {\n progressDialog = new ProgressDialog(getContext());\n }\n\n progressDialog.setTitle(R.string.dialog_title);\n progressDialog.setMessage(getResources().getString(R.string.dialog_message));\n progressDialog.setCancelable(false);\n progressDialog.show();\n }", "@Override\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\tprogressDialog = new ProgressDialog(context);\n\t\t\t\t\t\t\tprogressDialog.setCancelable(true);\n\t\t\t\t\t\t\tprogressDialog.setMessage(context.getString(R.string.initialising_runtime));\n\t\t\t\t\t\t\tprogressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n\t\t\t\t\t\t\tprogressDialog.setIndeterminate(true);\n\t\t\t\t\t\t\tprogressDialog.show();\n\t\t\t\t\t\t}", "void showProgressDialog(CharSequence message);", "public void showProgressDialog() {\n try {\n if (progressDialog == null) {\n try {\n progressDialog = new ProgressDialog(self);\n progressDialog.show();\n progressDialog.setCancelable(false);\n } catch (Exception e) {\n progressDialog = new ProgressDialog(self.getParent());\n progressDialog.show();\n progressDialog.setCancelable(false);\n e.printStackTrace();\n }\n } else {\n if (!progressDialog.isShowing())\n progressDialog.show();\n }\n } catch (Exception e) {\n progressDialog = new ProgressDialog(self);\n progressDialog.show();\n progressDialog.setCancelable(false);\n e.printStackTrace();\n }\n }", "public void startProgressBar(View v) {\r\n\t\tshowDialog(1);\r\n\t\tnew Thread(new Runnable() {\r\n\t\t\tpublic void run() {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tif (setValues()) {\r\n\t\t\t\t\t\tdismissDialog(1);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tdismissDialog(1);\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tSystem.out.println(\"Found an exception: \" + e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}).start();\r\n\t}", "public void show() {\n dialog = new Dialog(mActivity);\n dialog.setCancelable(false);\n dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);\n dialog.setContentView(R.layout.dialog_progess);\n dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));\n dialog.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);\n\n ProgressBar progressBar = dialog.findViewById(R.id.progressBar);\n progressBar.getIndeterminateDrawable()\n .setColorFilter(0xFFFFFFFF, android.graphics.PorterDuff.Mode.MULTIPLY);\n\n dialog.show();\n }", "@Override\n\t protected void onPreExecute() {\n\t super.onPreExecute();\n\t \n\t progressDialog= new Dialog(ListKotaActivity.this);\n\t progressDialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);\n\t progressDialog.setContentView(R.layout.progress);\n\t progressDialog.setCancelable(false);\n\t progressDialog.show();\t \n\t }", "@Override\n protected void onProgressUpdate(Integer... progress) {\n //Shows the ProgressDialog and sets the progress/message shown\n progressDialog.show();\n progressDialog.setTitle(\"Uploading\");\n progressDialog.setProgress(progress[0]);\n progressDialog.setMessage(String.valueOf(progress[0]) + \"%\");\n }", "@Override\n\t\tprotected void onProgressUpdate(Integer... progress) {\n\t\t\tsuper.onProgressUpdate(progress);\n\n\t\t\tdialog.setProgress(progress[0]);\n\t\t}", "private void displayProgressDialog() {\n pDialog.setMessage(\"Logging in.. Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "private ProgressDialog constructDialog(int retryCount) {\n ProgressDialog pd = new ProgressDialog(ActivityPortrait.this);\r\n pd.setTitle(getText(R.string.alarm1));\r\n pd.setMessage(\"df\");\r\n pd.setIndeterminate(true);\r\n pd.setCancelable(false);\r\n// pd.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);\r\n pd.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);\r\n // show the dialog\r\n pd.show();\r\n \r\n// ProgressDialog progressDialog = ProgressDialog.show(ActivityPortrait.this, \"Loading...\", \"Please wait...\", true, false); \r\n \r\n return pd;\r\n }", "@Override\n\t\t \tprotected void onPreExecute() {\n\t\t try {\n\t\t\t \tpd=new ProgressDialog(Styles_Dialog.this);\n\t\t\t \tpd.setMessage(\"Loading\");\n\t\t\t \tpd.show();\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\te.printStackTrace();\n\t\t}\n\t\t \t\n\t\t \t}", "@Override\n protected void onPreExecute() {\n\n dialog = new ProgressDialog(context);\n dialog.setTitle(\"Loading Contents\");\n dialog.setMessage(\"Doing something interesting ...\");\n dialog.setIndeterminate(true);\n dialog.setCancelable(false);\n dialog.show();\n }", "private void showProgressDialog(){\n progressDialog=ProgressDialog.show(context,\"\",\"Loading...Please wait...\");\n\n\n }", "private void displayProgressDialog() {\n pDialog.setMessage(\"Logging In.. Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "protected void showLoading()\n {\n progressBar = new ProgressDialog(this);\n progressBar.setTitle(\"Loading\");\n progressBar.setMessage(\"Wait while loading...\");\n progressBar.setCancelable(false); // disable dismiss by tapping outside of the dialog\n progressBar.show();\n }", "@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tmpProgress = ProgressDialog.show(mContext,\n\t\t\t\t\t\t\t\"Downloading data\",\n\t\t\t\t\t\t\t\"Please wait for a moment...\");\n\t\t\t\t}", "public void onPreExecute() {\n progressDialog.show();\n }", "@Override\n protected void onProgressUpdate(Integer... values) {\n super.onProgressUpdate(values);\n progress = new ProgressDialog(activity);\n progress.setMessage(\"registering..... \");\n progress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progress.setIndeterminate(true);\n progress.setCancelable(false);\n progress.show();\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t progressDialog = new AutoTuningInitDialog(mChannelActivity, R.style.dialog);\n\t\t\tprogressDialog.show();\t\t\n\t\t\tsuper.onPreExecute();\n\t\t}", "@Override\n protected void onPreExecute() {\n\n progressDialog = new SafeProgressDialog(PlanningSettings.this);\n progressDialog.setMessage(\"Creating...\");\n progressDialog.setIndeterminate(false);\n progressDialog.setCancelable(true);\n progressDialog.show();\n super.onPreExecute();\n }", "@Override\n\tprotected void onPreExecute() {\n\t\t\n\t\t pDialog = new ProgressDialog(context);\n\t\t\ttry{\n\t\t\t\tthis.pDialog.setMessage(\"Please wait ...\");\n\t\t this.pDialog.setIndeterminateDrawable(context.getResources().getDrawable(R.drawable.red_progress));\n\t\t this.pDialog.setIndeterminate(false);\n\t\t this.pDialog.setCancelable(false);\n\t\t this.pDialog.show();\n\t\t\t}\n\t\t\tcatch(Exception e)\n\t\t\t{\n\t\t\t\te.getMessage();\n\t\t\t}\n\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tprogressDialog.show();\n\t\t\tprogressDialog.setMessage(\"Contacting server for sharing...\");\n\t\t}", "private void showProgress(String message) {\n \tif(mProgress==null){\n \t\tmProgress = new ProgressDialog(stActivity);\n\t mProgress.setMessage(message);\n\t mProgress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n\t mProgress.setIndeterminate(true);\n\t mProgress.setCancelable(false); \n\t mProgress.show();\n \t}\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n pd=new ProgressDialog(c);\n pd.setTitle(\"Send\");\n pd.setMessage(\"Sending..Please wait\");\n pd.show();\n }", "public void showProgressDialog(String mensaje){\n dialogProgresIndeterminate = new SpotsDialog(BaseActivity.this,mensaje);\n dialogProgresIndeterminate.show();\n }", "public void ShowDialog(Context context) {\n progressDialog = new ProgressDialog(context);\n progressDialog.show();\n progressDialog.setContentView(R.layout.progress_dialog);\n progressDialog.setCanceledOnTouchOutside(false);\n progressDialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);\n }", "public void showProgressDialog() {\n showProgressDialog(null);\n }", "@Override\n public void onClick(View view) {\n progressStatus = 0;\n\n // Start the lengthy operation in a background thread\n new Thread(new Runnable() {\n @Override\n public void run() {\n while (progressStatus < 100) {\n // Update the progress status\n progressStatus += 1;\n }\n\n //Try to sleep the thread for 30 milliseconds\n try {\n Thread.sleep(30);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n // Update the progress bar\n handler.post(new Runnable() {\n @Override\n public void run() {\n pgb.setProgress(progressStatus);\n }\n });\n }\n }).start();// Start the operation\n }", "@Override\r\n\tprotected void onPreExecute()\r\n\t{\r\n\t\tprogress = new ProgressDialog(ctx);\r\n\t\tprogress.setTitle(\"Retrieving Parking Information\");\r\n\t\tprogress.setMessage(\"Please wait.\");\r\n\t\tprogress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\r\n\t\tprogress.show();\r\n\t\tsuper.onPreExecute();\r\n\t}", "public static ProgressDialog getProgressDialog(Context ctx) {\n return getProgressDialog(ctx, \"Processing\", \"Please wait while transaction is processed...\", false);\n }", "@Override\n protected void onPreExecute() {\n pDialog = new ProgressDialog(homeActivity);\n pDialog.setMessage(\"Retrieving Details... \");\n // pDialog.setMax(16);\n pDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n\n pDialog.setCancelable(false);\n pDialog.show();\n\n\n }", "private void showProgressDialog() {\n mProgressDialog = AppDialog.showProgressDialog(this);\n mProgressDialog.show();\n }", "private void setProgDialDownload(){\n sProgDialDownload.setMessage(getResources().getString(R.string.pdBuffer_inProgress));\n sProgDialDownload.setIndeterminate(true);\n sProgDialDownload.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n sProgDialDownload.setCancelable(false);\n }", "String progressMessage();", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n this.dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n this.dialog.setCancelable(false);\n this.dialog.show();\n }", "public void showProgressDialog() {\n if (mProgressDialog == null) {\n mProgressDialog = new ProgressDialog(this);\n mProgressDialog.setCancelable(false);\n mProgressDialog.setCanceledOnTouchOutside(false);\n mProgressDialog.setMessage(getString(R.string.msg_loading));\n mProgressDialog.setIndeterminate(true);\n }\n mProgressDialog.show();\n }", "protected void onProgressUpdate(String... progress) {\n\t\t\t\t\t\t// Set progress percentage\n\t\t\t\t\t\tprgDialog.setProgress(Integer.parseInt(progress[0]));\n\t\t\t\t\t}", "void ShowWaitDialog(String title, String message);", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tpDialog = new ProgressDialog(Tracking.this);\n\t\t\tpDialog.setMessage(\"Mencari History Proses ... !\");\n\t\t\tpDialog.setIndeterminate(false);\n\t\t\tpDialog.setCancelable(true);\n\t\t\tpDialog.show();\n\t\t}", "private void showDialog() {\n try {\n pDialog.setMessage(getString(R.string.please_wait));\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.setCanceledOnTouchOutside(false);\n pDialog.show();\n } catch (Exception e) {\n // TODO: handle exception\n }\n\n }", "protected Dialog onCreateDialog(int id) {\n\t\n\t// Arg value corresponds to showDialog(0)\n\t\tif (id != 0)\n\t\t\treturn null;\n\t\tmyProgressDialog = new ProgressDialog(this); \n\t\tmyProgressDialog.setMessage(\"Loading ...\"); \n\t\tmyProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); \n\t\tmyProgressDialog.setCancelable(false);\n\t\treturn myProgressDialog ;\n\t}", "@Override\n protected void onPreExecute() {\n\n\n dialog = new ProgressDialog(MainArea.this);\n dialog.setTitle(\"Loading Results\");\n dialog.setMessage(\"Please Wait Results Are Loading For You....\");\n dialog.setCanceledOnTouchOutside(false);\n dialog.show();\n super.onPreExecute();\n }", "@Override\n protected void onProgressUpdate(Integer... progress) {\n pDialog.setProgress(progress[0]);\n\n // updating percentage value\n //txtPercentage.setText(String.valueOf(progress[0]) + \"%\");\n }", "@Override\n protected void onPreExecute() {\n pDialog = new ProgressDialog(getActivity());\n pDialog.setMessage(\"Please wait...\");\n pDialog.setCancelable(false);\n pDialog.setIndeterminate(false);\n pDialog.setMax(100);\n pDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n pDialog.show();\n// progressBar.setVisibility(View.VISIBLE);\n// progressBar.setProgress(0);\n super.onPreExecute();\n }", "@Override\n protected void onProgressUpdate(String... values) {\n super.onProgressUpdate(values);\n String message = values[0];\n dialog.setMessage(waitMsg + message);\n displayProgress(message);\n }", "@Override\n public void onProgressUpdate(Integer... progress)\n {\n _dialog.setProgress(progress[0]);\n }", "@Override\n public void showProgressSync() {\n }", "private void progressMode() {\n\t\t// lazily build the layout\n\t\tif (progressLayout == null) {\n\t\t\tprogressLayout = new DefaultVerticalLayout(true, true);\n\n\t\t\tprogressBar = new ProgressBar();\n\t\t\tprogressBar.setHeight(\"20px\");\n\t\t\tprogressLayout.add(progressBar);\n\n\t\t\tstatusLabel = new Text(\"\");\n\t\t\tprogressLayout.add(statusLabel);\n\t\t}\n\t\tprogressBar.setValue(0.0f);\n\t\tstatusLabel.setText(\"\");\n\n\t\tremoveAll();\n\t\tadd(progressLayout);\n\t}", "void setProgress(int progress);", "void setProgress(int progress);", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\t\n\t\t\tdialog = new ProgressDialog(BookingConfirmationScreen.this);\n\t\t\tdialog.setIndeterminate(false);\n\t\t\tdialog.setCancelable(true);\n\t\t\tdialog.show();\n\t\t\t\n\t\t\t\n\t\t}", "private void displayLoader() {\n pDialog = new ProgressDialog(AddReviewActivity.this);\n pDialog.setMessage(\"Adding Review...Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\taProgressDialog = new ProgressDialog(TargetProducts.this);\n\t\t\taProgressDialog.setMessage(\"Loading Report...\");\n\t\t\taProgressDialog.setIndeterminate(true);\n\t\t\taProgressDialog.setCanceledOnTouchOutside(true);\n\t\t\taProgressDialog.show();\n\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\taProgressDialog = new ProgressDialog(TargetProducts.this);\n\t\t\taProgressDialog.setMessage(\"Loading Report...\");\n\t\t\taProgressDialog.setIndeterminate(true);\n\t\t\taProgressDialog.setCanceledOnTouchOutside(true);\n\t\t\taProgressDialog.show();\n\t\t}", "public S<T> progress(Boolean active){\n\t\t\n\t\tif(pDialog==null){\n\t\t\t\n\t\t\t pDialog = new ProgressDialog(activity);\n\t\t pDialog.setMessage(\"Please wait...\");\n\t\t pDialog.setCancelable(false);\n\t\t}\n\t\t\n\t\tif(active){\n\t\t\tif (!pDialog.isShowing())\n\t pDialog.show();\n\t\t}else{\n\t\t\tif (pDialog.isShowing())\n\t pDialog.dismiss();;\n\t\t}\n\t\t\n\t\treturn this;\n\t}", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n /* mProgress.setMessage(\"Please Wait\");\n mProgress.setCancelable(false);\n mProgress.show();*/\n String msg = \"Please Wait....\";\n cd.showProgressDialog(msg);\n }", "@Override\n protected void onPreExecute(){\n super.onPreExecute();\n count++;\n //pg = new progressDialog(MainActivity.this);\n //pg.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n progressDialog = new ProgressDialog(AiutaGliAltri.this);\n progressDialog.setMessage(\"Sto Cercando!\");\n progressDialog.setIndeterminate(true);\n progressDialog.setCanceledOnTouchOutside(false);\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n\n dialog = new ProgressDialog(AddFoodAdvActivity.this);\n dialog.setMessage(\"Please Wait...!\");\n dialog.show();\n super.onPreExecute();\n }", "protected Dialog onCreateDialog(int id) {\r\n switch(id) {\r\n case PROGRESS_DIALOG:\r\n progressDialog = new ProgressDialog(Suggestions.this);\r\n progressDialog.setMessage(\"Loading. Please wait.\");\r\n progressThread = new ProgressThread(handler);\r\n progressThread.start();\r\n return progressDialog;\r\n default:\r\n return null;\r\n }\r\n }", "public void displayProgress(String message) {\n }", "public static void showProgressDialog (ProgressDialog progressDialog, String message) {\n TextView tvMessage;\n progressDialog.show ();\n progressDialog.getWindow ().setBackgroundDrawable (new ColorDrawable (android.graphics.Color.TRANSPARENT));\n progressDialog.setContentView (R.layout.progress_dialog);\n tvMessage = (TextView) progressDialog.findViewById (R.id.tvProgressDialogMessage);\n if (message != null) {\n tvMessage.setText (message);\n tvMessage.setVisibility (View.VISIBLE);\n }\n else\n tvMessage.setVisibility (View.GONE);\n progressDialog.setCancelable (false);\n }", "private void showProgressIndication() {\n Log.i(TAG, \"loading contacts... \");\n // TODO: make this be a no-op if the progress indication is\n // already visible with the exact same title and message.\n\n dismissProgressIndication(); // Clean up any prior progress indication\n\n mProgressDialog = new ProgressDialog(this);\n mProgressDialog.setMessage(this.getResources().getString(R.string.contact_list_loading));\t\n mProgressDialog.setIndeterminate(true);\n mProgressDialog.setCancelable(false);\n mProgressDialog.show();\n }", "public void createProgressDialog(int message) {\n progressDialog = new ProgressDialog(SignupActivity.this);\n progressDialog.setIndeterminate(true);\n progressDialog.setCanceledOnTouchOutside(false);\n progressDialog.setMessage(String.format(getString(message)));\n progressDialog.show();\n }", "@Override\n public void run() {\n try {\n Thread.sleep(25000);\n dialog.cancel();\n Intent intent=new Intent(ProgressActivity.this,SudokuActivity.class);\n startActivity(intent);\n } catch (InterruptedException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tdialog = new ProgressDialog(BookingConfirmationScreen.this);\n\t\t\tdialog.setIndeterminate(false);\n\t\t\tdialog.setCancelable(true);\n\t\t\tdialog.show();\n\n\t\t}", "void showTarProgressMessage(String msg);", "@Override\n protected void onPreExecute() {\n this.progressDialog.setMessage(\"Adding workouts...\");\n this.progressDialog.show();\n }", "protected final void showLoadingDialog() {\n }", "@Override\n \t\tprotected void onPreExecute() \n \t\t{\n \t\t\t//Create a new progress dialog\n \t\t\tprogressDialog = new ProgressDialog(MainActivity.this);\n \t\t\t//Set the progress dialog to display a horizontal progress bar \n \t\t\tprogressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n \t\t\t//Set the dialog title to 'Loading...'\n \t\t\tprogressDialog.setTitle(\"Loading Game...\");\n \t\t\t//Set the dialog message to 'Loading application View, please wait...'\n \t\t\tprogressDialog.setMessage(\"Please wait...\");\n \t\t\t//This dialog can't be canceled by pressing the back key\n \t\t\tprogressDialog.setCancelable(false);\n \t\t\t//This dialog isn't indeterminate\n \t\t\tprogressDialog.setIndeterminate(false);\n \t\t\t//The maximum number of items is 100\n \t\t\tprogressDialog.setMax(100);\n \t\t\t//Set the current progress to zero\n \t\t\tprogressDialog.setProgress(0);\n \t\t\t//Display the progress dialog\n \t\t\tprogressDialog.show();\n \t\t}" ]
[ "0.7780838", "0.7747796", "0.7649784", "0.7600608", "0.74713045", "0.7447668", "0.7369826", "0.7369826", "0.73131865", "0.7276471", "0.7212236", "0.71666944", "0.70955956", "0.7053885", "0.704714", "0.704714", "0.701684", "0.7001614", "0.69933766", "0.6984496", "0.690178", "0.69014245", "0.6884225", "0.6848077", "0.6828214", "0.6824033", "0.6815318", "0.68153137", "0.6808881", "0.6796739", "0.6790316", "0.67899543", "0.6788166", "0.6781932", "0.6777417", "0.6718057", "0.67047983", "0.66980433", "0.6695268", "0.66786855", "0.66669554", "0.6630291", "0.66192377", "0.6600969", "0.6584082", "0.65819097", "0.6579902", "0.65687484", "0.6554029", "0.6545737", "0.6542849", "0.6542124", "0.6539282", "0.65378994", "0.65311986", "0.65264374", "0.65228873", "0.64824975", "0.6471055", "0.64553773", "0.645413", "0.64384806", "0.6428422", "0.64199626", "0.64196897", "0.64194214", "0.6418222", "0.641401", "0.64076906", "0.64073175", "0.64043903", "0.6388687", "0.63758934", "0.6373357", "0.6365053", "0.63521904", "0.63514405", "0.63497514", "0.63420284", "0.6340349", "0.6340349", "0.63384813", "0.6335134", "0.6335017", "0.6335017", "0.63313866", "0.6326227", "0.6325664", "0.6313226", "0.63086224", "0.63068277", "0.63040733", "0.6297704", "0.62891364", "0.628641", "0.6282651", "0.6281847", "0.62669104", "0.6264624", "0.6256478", "0.625049" ]
0.0
-1
Makes an progress dialog
public S<T> progress(Boolean active){ if(pDialog==null){ pDialog = new ProgressDialog(activity); pDialog.setMessage("Please wait..."); pDialog.setCancelable(false); } if(active){ if (!pDialog.isShowing()) pDialog.show(); }else{ if (pDialog.isShowing()) pDialog.dismiss();; } return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void showModalProgress();", "@Override\n\tpublic void showProgress() {\n\t\twaitDialog(true);\n\t}", "private void showSpinerProgress() {\n dialog.setMessage(\"Loading\");\n//\n// dialog.setButton(ProgressDialog.BUTTON_POSITIVE, \"YES\", new DialogInterface.OnClickListener() {\n// @Override\n// public void onClick(DialogInterface dialog, int which) {\n//\n// }\n// });\n\n //thiet lap k the huy - co the huy\n dialog.setCancelable(false);\n\n //show dialog\n dialog.show();\n Timer timer = new Timer();\n timer.schedule(new TimerTask() {\n @Override\n public void run() {\n dialog.dismiss();\n }\n }, 20000000);\n }", "void showProgress();", "private void showDialog() {\n if (!progressDialog.isShowing())\n progressDialog.show();\n }", "public abstract DialogBox showProgressBox(String message);", "void showProgressDialog();", "void showProgressDialog();", "private void progressStuff() {\n cd = new ConnectionDetector(getActivity());\n parser = new JSONParser();\n progress = new ProgressDialog(getActivity());\n progress.setMessage(getResources().getString(R.string.loading));\n progress.setIndeterminate(false);\n progress.setCancelable(true);\n // progress.show();\n }", "private void creatDialog() {\n \t mDialog=new ProgressDialog(this);\n \t mDialog.setTitle(\"\");\n \t mDialog.setMessage(\"正在加载请稍后\");\n \t mDialog.setIndeterminate(true);\n \t mDialog.setCancelable(true);\n \t mDialog.show();\n \n\t}", "@Override\r\n\tprotected Dialog onCreateDialog(int id) {\r\n\t\tProgressDialog dialog = new ProgressDialog(this);\r\n\t\tdialog.setMessage(\"Please wait while saving...\");\r\n\t\tdialog.setIndeterminate(true);\r\n\t\tdialog.setCancelable(true);\r\n\t\treturn dialog;\r\n\t}", "protected void createProgressDialog() {\r\t\tif (pd == null) {\r\t\t\tpd = new ProgressDialog(this);\r\t\t\tpd.setCanceledOnTouchOutside(false);\r\t\t\tpd.getWindow().setGravity(Gravity.CENTER);\r\t\t\tpd.setOnCancelListener(new DialogInterface.OnCancelListener() {\r\t\t\t\t@Override\r\t\t\t\tpublic void onCancel(DialogInterface dialogInterface) {\r\t\t\t\t\tonPdCancel();\r\t\t\t\t}\r\t\t\t});\r\t\t}\r\t}", "public void showProgressDialog() {\n pd = new ProgressDialog(this);\n pd.setMessage(\"Renting film...\");\n pd.show();\n }", "public void progressMade();", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tshowDialog(progress_bar_type);\n\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tshowDialog(progress_bar_type);\n\t\t}", "void onShowProgress();", "private void \t\t\t\t\tcreateDialogProgressBar(String mess)\n\t{\n\t\tthis.progress_dialog = new ProgressDialog(this);\n\t\tthis.progress_dialog.setMessage(mess);\n\t\tthis.progress_dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n\t\tthis.progress_dialog.setIndeterminate(true);\n\t\tthis.progress_dialog.setCancelable(false);\n\t\tthis.progress_dialog.show();\n\t}", "void startProgress();", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\ttry {\n\t\t\t\tdialog.setIndeterminate(false);\n\t\t\t\tdialog.setMax(100);\n\t\t\t\tdialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n\t\t\t\tdialog.setCancelable(false);\n\t\t\t\tdialog.show();\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "@Override\n protected void onPreExecute() {\n progress = new ProgressDialog(hostContext);\n progress.setMessage(\"Wait while books are being downloaded...\");\n progress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progress.show();\n }", "@Override\n protected void onProgressUpdate(Integer... values) {\n super.onProgressUpdate(values);\n progress = new ProgressDialog(activity);\n progress.setMessage(\"please wait.. \");\n progress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progress.setIndeterminate(true);\n progress.setCancelable(false);\n progress.show();\n\n }", "@Override\n public void showProgress() {\n\n }", "@Override\r\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\r\n\t\t\tpDialog = new ProgressDialog(SingleRecord.this);\r\n\t\t\tpDialog.setMessage(\"downloading...\");\r\n\t\t\tpDialog.setIndeterminate(false);\r\n\t\t\tpDialog.setCancelable(true);\r\n\t\t\r\n\t\t\tpDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\r\n\t\t\tpDialog.show();\r\n\t\t\tpDialog.getWindow().setGravity(Gravity.BOTTOM);\r\n\t\t}", "private Dialog buildLoadingDialog() {\n ProgressDialog dialog = new ProgressDialog(this);\n dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n dialog.setMessage(getText(R.string.dialog_loading));\n dialog.setIndeterminate(true);\n dialog.setCancelable(false);\n return dialog;\n }", "public void showProgressDialog() {\r\n progressDialog.setMessage(getResources().getString(R.string.text_loading));\r\n progressDialog.setCancelable(false);\r\n progressDialog.show();\r\n }", "private void showProgress() {\n if (dialogProgress == null) {\n dialogProgress = new Dialog(this);\n dialogProgress.requestWindowFeature(Window.FEATURE_NO_TITLE);\n dialogProgress.setContentView(R.layout.custom_progress);\n dialogProgress.setCancelable(false);\n }\n\n dialogProgress.getWindow().getDecorView().getRootView().setBackgroundColor(getResources().getColor(android.R.color.transparent));\n dialogProgress.show();\n }", "private void initialView(){\n // 进度条还有二级进度条的那种形式,这里就不演示了\n final ProgressDialog dialog = new ProgressDialog(this);\n dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);// 设置水平进度条\n dialog.setCancelable(true);// 设置是否可以通过点击Back键取消\n dialog.setCanceledOnTouchOutside(false);// 设置在点击Dialog外是否取消Dialog进度条\n\n dialog.setTitle(\"正在下载\");\n dialog.setMax(100);\n dialog.setMessage(\"请等待\");\n dialog.show();\n\n\n /*ThreadA t1 = new ThreadA(\"t1\");\n\n synchronized (t1){\n t1.start();\n while(!isExists()){\n try{\n t1.wait();\n }catch (Exception e){\n e.printStackTrace();\n }\n }\n }*/\n\n\n new Thread(new Runnable() {\n @Override\n public void run() {\n // TODO Auto-generated method stub\n try {\n Thread.sleep(25000);\n dialog.cancel();\n Intent intent=new Intent(ProgressActivity.this,SudokuActivity.class);\n startActivity(intent);\n } catch (InterruptedException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }\n }).start();\n }", "private void showProgressDialog()\n {\n if (showProgressDialog && !getStatus().equals(AsyncTask.Status.FINISHED)) {\n //show the dialog if valid activity. If the OS is lollipop or higher then set the theme.\n //dialog = ProgressDialog.show(activity, \"In progress..\", message, true);\n if (Build.VERSION.SDK_INT >= 21) {\n dialog = new ProgressDialog(activity, R.style.progressoAlertDialogStyle);\n dialog.setTitle(\"In progress..\");\n dialog.setMessage(message);\n dialog.setIndeterminate(true);\n dialog.show();\n }\n else {\n dialog = ProgressDialog.show(activity, \"In progress..\", message, true);\n }\n\n dialog.setCancelable(false);\n } \n }", "private void showDialog(){\n progress = new ProgressDialog(this);\n progress.setTitle(getString(R.string.progress_dialog_loading));\n progress.setMessage(getString(R.string.progress_dialog_authenticating_with_firebase));\n progress.setCancelable(false);\n progress.show();\n }", "private void showProgressDialog() {\n if (progressDialog == null) {\n progressDialog = new ProgressDialog(getContext());\n }\n\n progressDialog.setTitle(R.string.dialog_title);\n progressDialog.setMessage(getResources().getString(R.string.dialog_message));\n progressDialog.setCancelable(false);\n progressDialog.show();\n }", "@Override\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\tprogressDialog = new ProgressDialog(context);\n\t\t\t\t\t\t\tprogressDialog.setCancelable(true);\n\t\t\t\t\t\t\tprogressDialog.setMessage(context.getString(R.string.initialising_runtime));\n\t\t\t\t\t\t\tprogressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n\t\t\t\t\t\t\tprogressDialog.setIndeterminate(true);\n\t\t\t\t\t\t\tprogressDialog.show();\n\t\t\t\t\t\t}", "void showProgressDialog(CharSequence message);", "public void showProgressDialog() {\n try {\n if (progressDialog == null) {\n try {\n progressDialog = new ProgressDialog(self);\n progressDialog.show();\n progressDialog.setCancelable(false);\n } catch (Exception e) {\n progressDialog = new ProgressDialog(self.getParent());\n progressDialog.show();\n progressDialog.setCancelable(false);\n e.printStackTrace();\n }\n } else {\n if (!progressDialog.isShowing())\n progressDialog.show();\n }\n } catch (Exception e) {\n progressDialog = new ProgressDialog(self);\n progressDialog.show();\n progressDialog.setCancelable(false);\n e.printStackTrace();\n }\n }", "public void startProgressBar(View v) {\r\n\t\tshowDialog(1);\r\n\t\tnew Thread(new Runnable() {\r\n\t\t\tpublic void run() {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tif (setValues()) {\r\n\t\t\t\t\t\tdismissDialog(1);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tdismissDialog(1);\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tSystem.out.println(\"Found an exception: \" + e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}).start();\r\n\t}", "public void show() {\n dialog = new Dialog(mActivity);\n dialog.setCancelable(false);\n dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);\n dialog.setContentView(R.layout.dialog_progess);\n dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));\n dialog.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);\n\n ProgressBar progressBar = dialog.findViewById(R.id.progressBar);\n progressBar.getIndeterminateDrawable()\n .setColorFilter(0xFFFFFFFF, android.graphics.PorterDuff.Mode.MULTIPLY);\n\n dialog.show();\n }", "@Override\n\t protected void onPreExecute() {\n\t super.onPreExecute();\n\t \n\t progressDialog= new Dialog(ListKotaActivity.this);\n\t progressDialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);\n\t progressDialog.setContentView(R.layout.progress);\n\t progressDialog.setCancelable(false);\n\t progressDialog.show();\t \n\t }", "@Override\n protected void onProgressUpdate(Integer... progress) {\n //Shows the ProgressDialog and sets the progress/message shown\n progressDialog.show();\n progressDialog.setTitle(\"Uploading\");\n progressDialog.setProgress(progress[0]);\n progressDialog.setMessage(String.valueOf(progress[0]) + \"%\");\n }", "@Override\n\t\tprotected void onProgressUpdate(Integer... progress) {\n\t\t\tsuper.onProgressUpdate(progress);\n\n\t\t\tdialog.setProgress(progress[0]);\n\t\t}", "private void displayProgressDialog() {\n pDialog.setMessage(\"Logging in.. Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "private ProgressDialog constructDialog(int retryCount) {\n ProgressDialog pd = new ProgressDialog(ActivityPortrait.this);\r\n pd.setTitle(getText(R.string.alarm1));\r\n pd.setMessage(\"df\");\r\n pd.setIndeterminate(true);\r\n pd.setCancelable(false);\r\n// pd.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);\r\n pd.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);\r\n // show the dialog\r\n pd.show();\r\n \r\n// ProgressDialog progressDialog = ProgressDialog.show(ActivityPortrait.this, \"Loading...\", \"Please wait...\", true, false); \r\n \r\n return pd;\r\n }", "@Override\n\t\t \tprotected void onPreExecute() {\n\t\t try {\n\t\t\t \tpd=new ProgressDialog(Styles_Dialog.this);\n\t\t\t \tpd.setMessage(\"Loading\");\n\t\t\t \tpd.show();\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\te.printStackTrace();\n\t\t}\n\t\t \t\n\t\t \t}", "@Override\n protected void onPreExecute() {\n\n dialog = new ProgressDialog(context);\n dialog.setTitle(\"Loading Contents\");\n dialog.setMessage(\"Doing something interesting ...\");\n dialog.setIndeterminate(true);\n dialog.setCancelable(false);\n dialog.show();\n }", "private void showProgressDialog(){\n progressDialog=ProgressDialog.show(context,\"\",\"Loading...Please wait...\");\n\n\n }", "private void displayProgressDialog() {\n pDialog.setMessage(\"Logging In.. Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "protected void showLoading()\n {\n progressBar = new ProgressDialog(this);\n progressBar.setTitle(\"Loading\");\n progressBar.setMessage(\"Wait while loading...\");\n progressBar.setCancelable(false); // disable dismiss by tapping outside of the dialog\n progressBar.show();\n }", "@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tmpProgress = ProgressDialog.show(mContext,\n\t\t\t\t\t\t\t\"Downloading data\",\n\t\t\t\t\t\t\t\"Please wait for a moment...\");\n\t\t\t\t}", "public void onPreExecute() {\n progressDialog.show();\n }", "@Override\n protected void onProgressUpdate(Integer... values) {\n super.onProgressUpdate(values);\n progress = new ProgressDialog(activity);\n progress.setMessage(\"registering..... \");\n progress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progress.setIndeterminate(true);\n progress.setCancelable(false);\n progress.show();\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t progressDialog = new AutoTuningInitDialog(mChannelActivity, R.style.dialog);\n\t\t\tprogressDialog.show();\t\t\n\t\t\tsuper.onPreExecute();\n\t\t}", "@Override\n protected void onPreExecute() {\n\n progressDialog = new SafeProgressDialog(PlanningSettings.this);\n progressDialog.setMessage(\"Creating...\");\n progressDialog.setIndeterminate(false);\n progressDialog.setCancelable(true);\n progressDialog.show();\n super.onPreExecute();\n }", "@Override\n\tprotected void onPreExecute() {\n\t\t\n\t\t pDialog = new ProgressDialog(context);\n\t\t\ttry{\n\t\t\t\tthis.pDialog.setMessage(\"Please wait ...\");\n\t\t this.pDialog.setIndeterminateDrawable(context.getResources().getDrawable(R.drawable.red_progress));\n\t\t this.pDialog.setIndeterminate(false);\n\t\t this.pDialog.setCancelable(false);\n\t\t this.pDialog.show();\n\t\t\t}\n\t\t\tcatch(Exception e)\n\t\t\t{\n\t\t\t\te.getMessage();\n\t\t\t}\n\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tprogressDialog.show();\n\t\t\tprogressDialog.setMessage(\"Contacting server for sharing...\");\n\t\t}", "private void showProgress(String message) {\n \tif(mProgress==null){\n \t\tmProgress = new ProgressDialog(stActivity);\n\t mProgress.setMessage(message);\n\t mProgress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n\t mProgress.setIndeterminate(true);\n\t mProgress.setCancelable(false); \n\t mProgress.show();\n \t}\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n pd=new ProgressDialog(c);\n pd.setTitle(\"Send\");\n pd.setMessage(\"Sending..Please wait\");\n pd.show();\n }", "public void showProgressDialog(String mensaje){\n dialogProgresIndeterminate = new SpotsDialog(BaseActivity.this,mensaje);\n dialogProgresIndeterminate.show();\n }", "public void ShowDialog(Context context) {\n progressDialog = new ProgressDialog(context);\n progressDialog.show();\n progressDialog.setContentView(R.layout.progress_dialog);\n progressDialog.setCanceledOnTouchOutside(false);\n progressDialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);\n }", "public void showProgressDialog() {\n showProgressDialog(null);\n }", "@Override\n public void onClick(View view) {\n progressStatus = 0;\n\n // Start the lengthy operation in a background thread\n new Thread(new Runnable() {\n @Override\n public void run() {\n while (progressStatus < 100) {\n // Update the progress status\n progressStatus += 1;\n }\n\n //Try to sleep the thread for 30 milliseconds\n try {\n Thread.sleep(30);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n // Update the progress bar\n handler.post(new Runnable() {\n @Override\n public void run() {\n pgb.setProgress(progressStatus);\n }\n });\n }\n }).start();// Start the operation\n }", "@Override\r\n\tprotected void onPreExecute()\r\n\t{\r\n\t\tprogress = new ProgressDialog(ctx);\r\n\t\tprogress.setTitle(\"Retrieving Parking Information\");\r\n\t\tprogress.setMessage(\"Please wait.\");\r\n\t\tprogress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\r\n\t\tprogress.show();\r\n\t\tsuper.onPreExecute();\r\n\t}", "public static ProgressDialog getProgressDialog(Context ctx) {\n return getProgressDialog(ctx, \"Processing\", \"Please wait while transaction is processed...\", false);\n }", "@Override\n protected void onPreExecute() {\n pDialog = new ProgressDialog(homeActivity);\n pDialog.setMessage(\"Retrieving Details... \");\n // pDialog.setMax(16);\n pDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n\n pDialog.setCancelable(false);\n pDialog.show();\n\n\n }", "private void showProgressDialog() {\n mProgressDialog = AppDialog.showProgressDialog(this);\n mProgressDialog.show();\n }", "String progressMessage();", "private void setProgDialDownload(){\n sProgDialDownload.setMessage(getResources().getString(R.string.pdBuffer_inProgress));\n sProgDialDownload.setIndeterminate(true);\n sProgDialDownload.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n sProgDialDownload.setCancelable(false);\n }", "public void showProgressDialog() {\n if (mProgressDialog == null) {\n mProgressDialog = new ProgressDialog(this);\n mProgressDialog.setCancelable(false);\n mProgressDialog.setCanceledOnTouchOutside(false);\n mProgressDialog.setMessage(getString(R.string.msg_loading));\n mProgressDialog.setIndeterminate(true);\n }\n mProgressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n this.dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n this.dialog.setCancelable(false);\n this.dialog.show();\n }", "protected void onProgressUpdate(String... progress) {\n\t\t\t\t\t\t// Set progress percentage\n\t\t\t\t\t\tprgDialog.setProgress(Integer.parseInt(progress[0]));\n\t\t\t\t\t}", "void ShowWaitDialog(String title, String message);", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tpDialog = new ProgressDialog(Tracking.this);\n\t\t\tpDialog.setMessage(\"Mencari History Proses ... !\");\n\t\t\tpDialog.setIndeterminate(false);\n\t\t\tpDialog.setCancelable(true);\n\t\t\tpDialog.show();\n\t\t}", "private void showDialog() {\n try {\n pDialog.setMessage(getString(R.string.please_wait));\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.setCanceledOnTouchOutside(false);\n pDialog.show();\n } catch (Exception e) {\n // TODO: handle exception\n }\n\n }", "protected Dialog onCreateDialog(int id) {\n\t\n\t// Arg value corresponds to showDialog(0)\n\t\tif (id != 0)\n\t\t\treturn null;\n\t\tmyProgressDialog = new ProgressDialog(this); \n\t\tmyProgressDialog.setMessage(\"Loading ...\"); \n\t\tmyProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); \n\t\tmyProgressDialog.setCancelable(false);\n\t\treturn myProgressDialog ;\n\t}", "@Override\n protected void onPreExecute() {\n\n\n dialog = new ProgressDialog(MainArea.this);\n dialog.setTitle(\"Loading Results\");\n dialog.setMessage(\"Please Wait Results Are Loading For You....\");\n dialog.setCanceledOnTouchOutside(false);\n dialog.show();\n super.onPreExecute();\n }", "@Override\n protected void onProgressUpdate(Integer... progress) {\n pDialog.setProgress(progress[0]);\n\n // updating percentage value\n //txtPercentage.setText(String.valueOf(progress[0]) + \"%\");\n }", "@Override\n protected void onPreExecute() {\n pDialog = new ProgressDialog(getActivity());\n pDialog.setMessage(\"Please wait...\");\n pDialog.setCancelable(false);\n pDialog.setIndeterminate(false);\n pDialog.setMax(100);\n pDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n pDialog.show();\n// progressBar.setVisibility(View.VISIBLE);\n// progressBar.setProgress(0);\n super.onPreExecute();\n }", "@Override\n protected void onProgressUpdate(String... values) {\n super.onProgressUpdate(values);\n String message = values[0];\n dialog.setMessage(waitMsg + message);\n displayProgress(message);\n }", "@Override\n public void showProgressSync() {\n }", "@Override\n public void onProgressUpdate(Integer... progress)\n {\n _dialog.setProgress(progress[0]);\n }", "private void progressMode() {\n\t\t// lazily build the layout\n\t\tif (progressLayout == null) {\n\t\t\tprogressLayout = new DefaultVerticalLayout(true, true);\n\n\t\t\tprogressBar = new ProgressBar();\n\t\t\tprogressBar.setHeight(\"20px\");\n\t\t\tprogressLayout.add(progressBar);\n\n\t\t\tstatusLabel = new Text(\"\");\n\t\t\tprogressLayout.add(statusLabel);\n\t\t}\n\t\tprogressBar.setValue(0.0f);\n\t\tstatusLabel.setText(\"\");\n\n\t\tremoveAll();\n\t\tadd(progressLayout);\n\t}", "void setProgress(int progress);", "void setProgress(int progress);", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\t\n\t\t\tdialog = new ProgressDialog(BookingConfirmationScreen.this);\n\t\t\tdialog.setIndeterminate(false);\n\t\t\tdialog.setCancelable(true);\n\t\t\tdialog.show();\n\t\t\t\n\t\t\t\n\t\t}", "private void displayLoader() {\n pDialog = new ProgressDialog(AddReviewActivity.this);\n pDialog.setMessage(\"Adding Review...Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\taProgressDialog = new ProgressDialog(TargetProducts.this);\n\t\t\taProgressDialog.setMessage(\"Loading Report...\");\n\t\t\taProgressDialog.setIndeterminate(true);\n\t\t\taProgressDialog.setCanceledOnTouchOutside(true);\n\t\t\taProgressDialog.show();\n\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\taProgressDialog = new ProgressDialog(TargetProducts.this);\n\t\t\taProgressDialog.setMessage(\"Loading Report...\");\n\t\t\taProgressDialog.setIndeterminate(true);\n\t\t\taProgressDialog.setCanceledOnTouchOutside(true);\n\t\t\taProgressDialog.show();\n\t\t}", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n /* mProgress.setMessage(\"Please Wait\");\n mProgress.setCancelable(false);\n mProgress.show();*/\n String msg = \"Please Wait....\";\n cd.showProgressDialog(msg);\n }", "@Override\n protected void onPreExecute(){\n super.onPreExecute();\n count++;\n //pg = new progressDialog(MainActivity.this);\n //pg.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n progressDialog = new ProgressDialog(AiutaGliAltri.this);\n progressDialog.setMessage(\"Sto Cercando!\");\n progressDialog.setIndeterminate(true);\n progressDialog.setCanceledOnTouchOutside(false);\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n\n dialog = new ProgressDialog(AddFoodAdvActivity.this);\n dialog.setMessage(\"Please Wait...!\");\n dialog.show();\n super.onPreExecute();\n }", "protected Dialog onCreateDialog(int id) {\r\n switch(id) {\r\n case PROGRESS_DIALOG:\r\n progressDialog = new ProgressDialog(Suggestions.this);\r\n progressDialog.setMessage(\"Loading. Please wait.\");\r\n progressThread = new ProgressThread(handler);\r\n progressThread.start();\r\n return progressDialog;\r\n default:\r\n return null;\r\n }\r\n }", "public void displayProgress(String message) {\n }", "public static void showProgressDialog (ProgressDialog progressDialog, String message) {\n TextView tvMessage;\n progressDialog.show ();\n progressDialog.getWindow ().setBackgroundDrawable (new ColorDrawable (android.graphics.Color.TRANSPARENT));\n progressDialog.setContentView (R.layout.progress_dialog);\n tvMessage = (TextView) progressDialog.findViewById (R.id.tvProgressDialogMessage);\n if (message != null) {\n tvMessage.setText (message);\n tvMessage.setVisibility (View.VISIBLE);\n }\n else\n tvMessage.setVisibility (View.GONE);\n progressDialog.setCancelable (false);\n }", "private void showProgressIndication() {\n Log.i(TAG, \"loading contacts... \");\n // TODO: make this be a no-op if the progress indication is\n // already visible with the exact same title and message.\n\n dismissProgressIndication(); // Clean up any prior progress indication\n\n mProgressDialog = new ProgressDialog(this);\n mProgressDialog.setMessage(this.getResources().getString(R.string.contact_list_loading));\t\n mProgressDialog.setIndeterminate(true);\n mProgressDialog.setCancelable(false);\n mProgressDialog.show();\n }", "public void createProgressDialog(int message) {\n progressDialog = new ProgressDialog(SignupActivity.this);\n progressDialog.setIndeterminate(true);\n progressDialog.setCanceledOnTouchOutside(false);\n progressDialog.setMessage(String.format(getString(message)));\n progressDialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tdialog = new ProgressDialog(BookingConfirmationScreen.this);\n\t\t\tdialog.setIndeterminate(false);\n\t\t\tdialog.setCancelable(true);\n\t\t\tdialog.show();\n\n\t\t}", "@Override\n public void run() {\n try {\n Thread.sleep(25000);\n dialog.cancel();\n Intent intent=new Intent(ProgressActivity.this,SudokuActivity.class);\n startActivity(intent);\n } catch (InterruptedException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "void showTarProgressMessage(String msg);", "@Override\n protected void onPreExecute() {\n this.progressDialog.setMessage(\"Adding workouts...\");\n this.progressDialog.show();\n }", "protected final void showLoadingDialog() {\n }", "@Override\n \t\tprotected void onPreExecute() \n \t\t{\n \t\t\t//Create a new progress dialog\n \t\t\tprogressDialog = new ProgressDialog(MainActivity.this);\n \t\t\t//Set the progress dialog to display a horizontal progress bar \n \t\t\tprogressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n \t\t\t//Set the dialog title to 'Loading...'\n \t\t\tprogressDialog.setTitle(\"Loading Game...\");\n \t\t\t//Set the dialog message to 'Loading application View, please wait...'\n \t\t\tprogressDialog.setMessage(\"Please wait...\");\n \t\t\t//This dialog can't be canceled by pressing the back key\n \t\t\tprogressDialog.setCancelable(false);\n \t\t\t//This dialog isn't indeterminate\n \t\t\tprogressDialog.setIndeterminate(false);\n \t\t\t//The maximum number of items is 100\n \t\t\tprogressDialog.setMax(100);\n \t\t\t//Set the current progress to zero\n \t\t\tprogressDialog.setProgress(0);\n \t\t\t//Display the progress dialog\n \t\t\tprogressDialog.show();\n \t\t}" ]
[ "0.7780657", "0.77481085", "0.76491034", "0.7601086", "0.7471279", "0.7447573", "0.7369352", "0.7369352", "0.7312884", "0.7277058", "0.7211841", "0.71668404", "0.70954686", "0.70537037", "0.70473325", "0.70473325", "0.70169073", "0.7002052", "0.6993498", "0.6983973", "0.69015044", "0.6900512", "0.6884617", "0.68473864", "0.6827931", "0.6823929", "0.6815578", "0.6815507", "0.6808332", "0.67966896", "0.67904705", "0.67902017", "0.6787123", "0.67822427", "0.67770725", "0.6718212", "0.6704185", "0.6697255", "0.6693535", "0.6678701", "0.66668797", "0.6629845", "0.661934", "0.6600463", "0.65840787", "0.6582633", "0.6579484", "0.6568285", "0.6553311", "0.6545598", "0.65430427", "0.6541862", "0.65395296", "0.6537838", "0.6530988", "0.6525901", "0.6523151", "0.64824593", "0.64712596", "0.6455128", "0.64537865", "0.64379114", "0.6428267", "0.6419201", "0.64188504", "0.6418666", "0.64186555", "0.64122474", "0.6408155", "0.64068186", "0.64046514", "0.63887537", "0.6375752", "0.6372097", "0.6364896", "0.63515866", "0.63504064", "0.6349488", "0.63428533", "0.63399494", "0.63399494", "0.63379276", "0.6335372", "0.633463", "0.633463", "0.63258016", "0.6325015", "0.6312731", "0.630836", "0.6306801", "0.6304719", "0.62973684", "0.62890834", "0.6286436", "0.6281362", "0.6281319", "0.6266645", "0.6264295", "0.6256569", "0.6250439" ]
0.6331244
85
Gets the text of a view
public String txt(){ String s =""; String aux =""; if(t instanceof TextView){ aux =( (TextView) t).getText().toString(); } if(t instanceof Button){ aux =( (Button) t).getText().toString(); } if(t instanceof EditText){ aux =( (EditText) t).getText().toString(); } if(t instanceof CheckBox){ aux =( (CheckBox) t).getText().toString(); } if(t instanceof RadioButton){ aux =( (RadioButton) t).getText().toString(); } if(!aux.isEmpty()){ s=aux; } return s; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getViewText() {\n \t\treturn \"featured-partner-view_text_t\";\n \t}", "java.lang.String getView();", "TextView getDescriptionView();", "abstract TextView getTextView();", "public static String getString(TextView view) {\n return view.getText().toString().trim();\n }", "public CharSequence getText();", "public java.lang.String getView() {\n return view;\n }", "public java.lang.String getView() {\n return view;\n }", "public java.lang.String getView() {\n return view;\n }", "public String getText();", "public String getText();", "public String getText();", "public String getText();", "public String getView();", "public String getView();", "public CharSequence getText() {\r\n return text;\r\n }", "java.lang.String getText();", "java.lang.String getText();", "java.lang.String getText();", "java.lang.String getText();", "java.lang.String getText();", "java.lang.String getText();", "java.lang.String getText();", "java.lang.String getText();", "String getText();", "String getText();", "String getText();", "String getText();", "String getText();", "String getText();", "String getText();", "public String getViewContent() {\r\n\t\treturn viewContent;\r\n\t}", "public String getText() {\n return text.getText();\n }", "protected Text getText() {\n \t\treturn text;\n \t}", "TextView getTitleView();", "public TextView getTextView() {\n\n return (TextView) findViewById(R.id.sendToLogin);\n }", "public String getText() {\n\t\t\treturn text.get();\n\t\t}", "public abstract String getView();", "public String getText() {\n return text;\n }", "public String getText() {\n return text;\n }", "public String getText() {\n return text;\n }", "public String getText() {\n return text;\n }", "public String getText() {\n return text;\n }", "protected Text getText()\r\n\t{\r\n\t\treturn text;\r\n\t}", "public String getText(){\r\n\t\treturn text;\r\n\t}", "public CharSequence obtainTextToMeasure() {\n return this.textView.getText();\n }", "public String getText() {\r\n return text;\r\n }", "public String getMyActivitiesListViewTxt() {\n\t\tString methodID = \"getMyActivitiesListViewTxt\";\n\t\t\n\t\tWebElement myActivitiesLisViewInfo = driver.findElement(By.xpath(\"//*[@id='myactivity_list']/ul\"));\n\t\t\n\t\treturn myActivitiesLisViewInfo.getText();\t\t\n\t}", "@Override\r\n\t\t\tpublic String getText() {\n\t\t\t\treturn text;\r\n\t\t\t}", "public String getText() {\r\n return text;\r\n }", "public String getText() {\r\n return text;\r\n }", "public String getText() {\n return mTextContainer.getText();\n }", "public String getText(){\r\n return text;\r\n }", "public String getText() {\r\n return this.text;\r\n }", "public String getText() {\n return myText;\n }", "public java.lang.String getText() {\n return text_;\n }", "public String text();", "public String getText() {\n return text;\n }", "public String getText() {\n return text;\n }", "public String getText() {\n return text;\n }", "public String getText() {\n return text;\n }", "public String getText() {\n return text;\n }", "public String getText() {\n return text;\n }", "public String getText() {\n return text;\n }", "public String getText() {\n return text;\n }", "public String getText() {\n return text;\n }", "public String getText() {\n return text;\n }", "public String getText() {\n return text;\n }", "public String getText() {\n return text;\n }", "public String getText() {\n return text;\n }", "public String getTextOnPage()\n {\n return mainText.getText();\n }", "public java.lang.String getText() {\n return instance.getText();\n }", "public String getText()\r\n {\r\n return this.text;\r\n }", "public String getText()\n {\n return (this.text);\n }", "public String getText() {\n StringBuffer textBuffer = new StringBuffer();\n Object obj;\n int segment;\n for (segment = 0; segment < this.TOTALSEGMENTS; segment++) {\n obj = null;\n Method getter = this.getTextGetter(segment);\n try {\n obj = getter.invoke(this, new Object[] {});\n } catch (IllegalAccessException e) {\n throw new RuntimeException(\"That segment doesn't exist.\");\n } catch (InvocationTargetException e) { \n throw new RuntimeException(\"Unable to invoke that method..\");\n }\n \n if (obj != null ) {\n String stringToAppend = (String) obj;\n textBuffer.append (stringToAppend);\n // logger.debug (\"Appending a string of length \" + stringToAppend.length());\n }\n }\n // logger.debug(\"getText returned \" + textBuffer.length() + \"chars.\" );\n return textBuffer.toString();\n }", "public static String getString(TextView textView) {\n\n return textView.getText().toString().trim();\n }", "public final String getText() {\n return text;\n }", "public String text() { return text; }", "public String getText() {\n return this.text;\n }", "public String getText() {\n return this.text;\n }", "public String getText() {\n return this.text;\n }", "public String getText() {\n return this.text;\n }", "public String getText() {\n return this.text;\n }", "public String getText() {\n return this.text;\n }", "String getText(int id);", "public String getText()\n\t{\n\t\treturn text;\n\t}", "public String getText()\n\t{\n\t\treturn text;\n\t}", "public String getText()\n\t{\n\t\treturn text;\n\t}", "public String getText() {\r\n\t\treturn text;\r\n\t}", "public String getText() {\r\n\t\treturn text;\r\n\t}", "public final String getText() {\n\t\treturn text;\n\t}", "public java.lang.String getText() {\n \t\treturn text;\n \t}", "public String getText() {\n\t\treturn this.text;\n\t}", "public String getText() {\n\t\treturn this.text;\n\t}", "public String getText() {\n\t\treturn new XWPFWordExtractor(document).getText();\n\t}", "public String getRelatedActivitiesListViewTxt() {\n\t\tString methodID = \"getRelatedActivitiesListViewTxt\";\n\t\t\n\t\tWebElement relActivitiesLisViewInfo = driver.findElement(By.xpath(\"//*[@id='activity_related']/ul\"));\n\t\t\n\t\treturn relActivitiesLisViewInfo.getText();\t\t\n\t}", "public String getText() {\n\t\treturn text;\n\t}", "public String getText() {\n\t\treturn text;\n\t}", "public String getText() {\n\t\treturn text;\n\t}", "public String getText() {\n\t\treturn text;\n\t}", "public String getText() {\n\t\treturn text;\n\t}" ]
[ "0.74898493", "0.74895954", "0.74440455", "0.7390361", "0.71518564", "0.7070329", "0.7004014", "0.7004014", "0.7004014", "0.68578255", "0.68578255", "0.68578255", "0.68578255", "0.6850446", "0.6850446", "0.6816159", "0.680849", "0.680849", "0.680849", "0.680849", "0.680849", "0.680849", "0.680849", "0.680849", "0.6797073", "0.6797073", "0.6797073", "0.6797073", "0.6797073", "0.6797073", "0.6797073", "0.6771326", "0.67593986", "0.67292094", "0.6718181", "0.6714048", "0.67128325", "0.670857", "0.6632368", "0.6632368", "0.6632368", "0.6632368", "0.6632368", "0.66320336", "0.66287696", "0.66245973", "0.6618104", "0.66137666", "0.66018885", "0.65920764", "0.65920764", "0.65896213", "0.65868044", "0.6573783", "0.6570885", "0.6569513", "0.6561459", "0.65549064", "0.65549064", "0.65549064", "0.65549064", "0.65549064", "0.65549064", "0.65549064", "0.65549064", "0.65549064", "0.65549064", "0.65549064", "0.65549064", "0.65549064", "0.6551345", "0.6550792", "0.65496665", "0.65448356", "0.65437084", "0.6539562", "0.6537569", "0.653374", "0.6515342", "0.6515342", "0.6515342", "0.6515342", "0.6515342", "0.6515342", "0.6508759", "0.65072995", "0.65072995", "0.65072995", "0.649451", "0.649451", "0.64913493", "0.6464491", "0.6460558", "0.6460558", "0.6458536", "0.6457974", "0.6450656", "0.6450656", "0.6450656", "0.6450656", "0.6450656" ]
0.0
-1
Post data to the server
public HttpResponse post(String url,List<NameValuePair> nameValuePairs) { HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost(url); try { httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); HttpResponse response = httpclient.execute(httppost); return response; } catch (ClientProtocolException e) { } catch (IOException e) { } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void postData() {\n\n\t}", "public void post(){\n\t\tHttpClient client = new HttpClient();\n\n\t\tPostMethod post = new PostMethod(\"http://211.138.245.85:8000/sso/POST\");\n//\t\tPostMethod post = new PostMethod(\"/eshopclient/product/show.do?id=111655\");\n//\t\tpost.addRequestHeader(\"Cookie\", cookieHead);\n\n\n\t\ttry {\n\t\t\tSystem.out.println(\"��������====\");\n\t\t\tint status = client.executeMethod(post);\n\t\t\tSystem.out.println(status);\n\t\t} catch (HttpException 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\n//\t\ttaskCount++;\n//\t\tcountDown--;\n\t}", "public void postData()\n\t{\n\t\tnew NetworkingTask().execute(message);\n\t}", "public String post();", "private void sendPost() {\n Map<String,Object> values = new HashMap<>();\n values.put(Constants.MANAGEMENT,management);\n values.put(Constants.GENERAL_INFORMATION,generalnformation);\n values.put(Constants.SYMPTOMS,symptoms);\n\n FireBaseUtils.mDatabaseDiseases.child(caseStudyUrl).child(url).updateChildren(values);\n Toast.makeText(DiseaseEditActivity.this, \"Item Posted\",LENGTH_LONG).show();\n finish();\n }", "public HttpResponse postData(String url) {\n\t HttpClient httpclient = new DefaultHttpClient();\n\t HttpPost httppost = new HttpPost(url);\n\n\t try {\n\t // Add your data\n\t \n\n\t // Execute HTTP Post Request\n\t HttpResponse response = httpclient.execute(httppost);\n\t return response;\n\t \n\t } catch (ClientProtocolException e) {\n\t \t\n\t // TODO Auto-generated catch block\n\t } catch (IOException e) {\n\t // TODO Auto-generated catch block\n\t }\n\t return null;\n\t }", "private void postRequest() {\n\t\tSystem.out.println(\"post request, iam playing money\");\n\t}", "public void doPost( )\n {\n \n }", "public void postDatatoServer(String type, JSONObject data) {\n Log.w(\"Note\", data.toString());\r\n final Home baseHomeActivity = (Home) getActivity();\r\n\r\n JsonObjectRequest jsonArrayRequest =\r\n new JsonObjectRequest(\r\n Request.Method.POST, serverURL + \"/\" + type + \"/\", data, this, this) {\r\n @Override\r\n public Map<String, String> getHeaders() throws AuthFailureError {\r\n HashMap<String, String> headers = new HashMap<String, String>();\r\n headers.put(\"Authorization\", \"Token \" + baseHomeActivity.mToken);\r\n return headers;\r\n }\r\n };\r\n baseHomeActivity.mQueue.add(jsonArrayRequest);\r\n }", "@Override\n\tpublic void doPost(Request request, Response response) {\n\n\t}", "public void postData(String quote, String name, String project) {\n HttpClient httpclient = new DefaultHttpClient();\n HttpPost httppost = new HttpPost(\"http://10.16.4.16:8765/quote\");\n\n try {\n // Add your data\n List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(3);\n nameValuePairs.add(new BasicNameValuePair(\"project\", project));\n nameValuePairs.add(new BasicNameValuePair(\"by_name\", name));\n nameValuePairs.add(new BasicNameValuePair(\"quote\",quote));\n httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));\n\n // Execute HTTP Post Request\n HttpResponse response = httpclient.execute(httppost);\n\n } catch (ClientProtocolException e) {\n // TODO Auto-generated catch block\n } catch (IOException e) {\n // TODO Auto-generated catch block\n }\n }", "public void makePOSTRequest(List data) {\n Log.d(\"APP:\", \"AsyncTask: Generating httpPOsts...\");\n\n counter++;\n HttpPost httpPost = new HttpPost(POST_URI);\n\n List<NameValuePair> nameValuePairs = data;\n\n try {\n httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairs));\n }catch (UnsupportedEncodingException e){\n e.printStackTrace();\n }\n postmessages.add(httpPost);\n }", "private void dataSubmission() {\n getPreferences(); // reload all the data\n\n String jsonObjectString = createJsonObject();\n StringBuilder url = new StringBuilder();\n url.append(serverUrl);\n\n if (vslaName == null || numberOfCycles == null || representativeName == null || representativePost == null\n || repPhoneNumber == null || grpBankAccount == null || physAddress == null\n || grpPhoneNumber == null || grpSupportType == null) {\n flashMessage(\"Please Fill all Fields\");\n\n } else if (IsEditing.equalsIgnoreCase(\"1\")) {\n url.append(\"editVsla\");\n new HttpAsyncTaskClass().execute(url.toString(), jsonObjectString);\n saveVslaInformation();\n\n } else { // Creating a new VSLA\n url.append(\"addNewVsla\");\n new HttpAsyncTaskClass().execute(url.toString(), jsonObjectString);\n saveVslaInformation();\n }\n }", "private void sendDataToServer() {\n\t\tcommentView = (EditText) findViewById(R.id.editComment);\n\t\tString commentToBePosted = commentView.getText().toString();\n\n\t\tboolean valid;\n\t\tvalid = checkValidityOfComment(commentToBePosted);\n\n\t\tif (valid) {\n\t\t\t// Intent intent = getIntent();\n\t\t\tPostCommentTask postComment = new PostCommentTask();\n\t\t\tpostComment.execute(commentToBePosted);\n\t\t}\n\t}", "void postGasData(GasData gasData);", "@Override\n\tpublic void doPost(HttpRequest request, AbstractHttpResponse response)\n\t\t\tthrows IOException {\n\t\t\n\t}", "private void postData() {\n\n\t\tString result = \"\";\n\t\ttry {\n\t\t\tLog.d(\"LOgg\", \"INpost\");\n\t\t\tJSONObject json = new JSONObject();\n\t\t\tjson.put(\"firstname\", fname);\n\t\t\tjson.put(\"lastname\", lname);\n\t\t\tjson.put(\"phone\", contactno);\n\t\t\tjson.put(\"password\", password);\n\t\t\tjson.put(\"email\", email);\n\t\t\tjson.put(\"longitude\", longitude);\n\t\t\tjson.put(\"latitude\", latitude);\n\n\t\t\tHttpParams httpParams = new BasicHttpParams();\n\t\t\tHttpConnectionParams.setConnectionTimeout(httpParams, 1000000);\n\t\t\tHttpConnectionParams.setSoTimeout(httpParams, 1000000);\n\t\t\tHttpClient client = new DefaultHttpClient(httpParams);\n\t\t\tString link = StaticData.SERVER_URL;\n\t\t\tString url = link + \"register.php\";\n\n\t\t\tHttpPost request = new HttpPost(url);\n\t\t\trequest.setEntity(new ByteArrayEntity(json.toString().getBytes(\n\t\t\t\t\t\"UTF8\")));\n\n\t\t\trequest.setHeader(\"Accept\", \"application/json\");\n\t\t\trequest.setHeader(\"Content-type\", \"application/json\");\n\n\t\t\trequest.setHeader(\"json\", json.toString());\n\n\t\t\tHttpResponse response = client.execute(request);\n\t\t\tHttpEntity entity = response.getEntity();\n\t\t\t// If the response does not enclose an entity, there is no need\n\n\t\t\tif (entity != null) {\n\t\t\t\tInputStream instream = entity.getContent();\n\n\t\t\t\tresult = RestClient.convertStreamToString(instream);\n\t\t\t\tLog.i(\"Read from server\", result);\n\t\t\t}\n\n\t\t} catch (Exception t) {\n\t\t\tLog.e(\"postData\", t.toString());\n\t\t}\n\n\t\ttry {\n\t\t\tLog.i(\"result\", result);\n\t\t\tResponse_code = result;\n\t\t\tLog.e(\"Result....\", \"....\" + Response_code);\n\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\tLog.e(\"Result\", \"....\" + e.toString());\n\t\t}\n\n\t\ttry {\n\t\t\tjobj = new JSONObject(Response_code);\n\t\t\tlogin_result = jobj.getString(\"ResponseCode\");\n\t\t\t// Response_msg = jobj.getString(\"ResponseMsg\");\n\t\t\tLog.e(\"Result\", \"....\" + login_result);\n\t\t\t// JSONObject jobj1 = new JSONObject(\"userdetail\");\n\n\t\t} catch (JSONException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tLog.w(\"JSONException\", e.toString());\n\t\t} catch (NullPointerException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tLog.w(\"null\", e.toString());\n\t\t}\n\n\t}", "public void postData(String message)\n\t// Method used to send data to the server when POSTs are used\n\t{\n\t\tHttpClient httpclient = new DefaultHttpClient();\n\t\tHttpPost httppost = new HttpPost(\"https://\"+this.serverIpAddress+\":3000/\");\n\t\ttry\n\t\t{\n\t\t\tList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(1);\n\t\t\tnameValuePairs.add(new BasicNameValuePair(\"Location\", message));\n\t\t\thttppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));\n\t\t\t// Execute HTTP Post Request\n\t\t\tHttpResponse response = httpclient.execute(httppost); \n\t\t}\n\t\tcatch (ClientProtocolException e) \n\t\t{\n\t\t\tLog.e(\"AsyncTask\", \"CLIENT PROTOCOL EXCEPTION while sending POST: \"+e);\n\t\t\tif(lost==false)\n\t\t\t{\n\t\t\t\tDate cDate = new Date();\n\t\t\t\tString lostDateTimeString = \n\t\t\t\t\tnew SimpleDateFormat(\"EEE, d MMM yyyy HH:mm:ss\").format(cDate);\n\t\t\t\tString update[] = {\"Unable to send POST! \" +\"(\"+\n\t\t\t\t\t\tlostDateTimeString+\") ClientProtocolException \"+ e};\n\t\t\t\tpublishProgress(update);\n\t\t\t\tlost=true;\n\t\t\t}\n\t\t}\n\t\tcatch (IOException e)\n\t\t{\n\t\t\tLog.e(\"AsyncTask\", \"IOEXCEPTION while sending POST: \"+e);\n\t\t\tif(lost==false)\n\t\t\t{\n\t\t\t\tDate cDate = new Date();\n\t\t\t\tString lostDateTimeString = \n\t\t\t\t\tnew SimpleDateFormat(\"EEE, d MMM yyyy HH:mm:ss\").format(cDate);\n\t\t\t\tString update[] = {\"Unable to send POST! \" +\"(\"+\n\t\t\t\t\t\tlostDateTimeString+\") IOException \"+ e};\n\t\t\t\tpublishProgress(update);\n\t\t\t\tlost=true;\n\t\t\t}\n\t\t}\n\t}", "public void postData(String p) {\n\t\tHttpClient httpclient = new DefaultHttpClient();\n\t\tHttpPost httppost = new HttpPost(\n\t\t\t\t\"http://www.webaraza.com/webaraza2/collector.php\");\n\n\t\ttry {\n\t\t\t// Add your data\n\t\t\tList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(1);\n\t\t\tnameValuePairs.add(new BasicNameValuePair(\"p\", p));\n\t\t\thttppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));\n\n\t\t\t// Execute HTTP Post Request\n\t\t\tHttpResponse response = httpclient.execute(httppost);\n\n\t\t\tJSONObject parentobJsonObject = new JSONObject(\n\t\t\t\t\tEntityUtils.toString(response.getEntity()));\n\t\t\tJSONArray childarr = parentobJsonObject.getJSONArray(\"dety\");\n\t\t\tJSONObject childobj = childarr.getJSONObject(0).getJSONObject(\n\t\t\t\t\t\"post\");\n\t\t\tname = childobj.getString(\"name\");\n\t\t\tc1 = childobj.getString(\"c1\");\n\t\t\tc2 = childobj.getString(\"c2\");\n\n\t\t} catch (ClientProtocolException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t} catch (ParseException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\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}", "public static String POST(String data) {\n\n Response response = null;\n OkHttpClient client = new OkHttpClient();\n MediaType JSON = MediaType.parse(\"application/json; charset=utf-8\");\n\n RequestBody body = RequestBody.create(JSON, data);\n Request request = new Request.Builder()\n .url(Constants.WS_URL)\n .post(body)\n .build();\n\n try {\n response = client.newCall(request).execute();\n return response.body().string();\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n return \"\";\n }\n }", "public void post(Controller controller) {\n ExecutorService executorService = Executors.newSingleThreadExecutor();\n executorService.execute(() -> {\n String responseString = null;\n try {\n httpPost.setEntity(new UrlEncodedFormEntity(attributes, \"UTF-8\"));\n HttpResponse response = httpClient.execute(httpPost);\n HttpEntity entity = response.getEntity();\n if (entity != null) {\n responseString = EntityUtils.toString(entity);\n }\n } catch (Exception exc) {\n exc.printStackTrace();\n }\n controller.handleResponse(responseString);\n });\n }", "void sendPost(String title, String body);", "@Test\n void sendPostRequest() {\n try {\n LoginPacket packet = new LoginPacket(\"testUser\", \"testPassword\");\n String response = HttpUtils.sendPost(\"\", WriteJSON.writePacket(packet));\n } catch (IOException e) {\n e.printStackTrace();\n fail();\n }\n }", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) {\n }", "@Override\n public JSONObject postToWalletServer(String urlSegment, String body) {\n HttpHeaders header = constructHttpHeaders();\n // Construct the http URL.\n String baseUrl = ConfigUtil.instants().getValue(\"walletServerBaseUrl\");\n String walletServerUrl = baseUrl + urlSegment;\n\n // Send the http request and get response.\n HttpEntity<JSONObject> entity = new HttpEntity<>(JSONObject.parseObject(body), header);\n ResponseEntity<JSONObject> exchange =\n REST_TEMPLATE.exchange(walletServerUrl, HttpMethod.POST, entity, JSONObject.class);\n\n // Return the posted model or instance or NFC card personalized data.\n return exchange.getBody();\n }", "public void postSignUpData(String userName, String email , String password) {\n\n HttpPost httppost = new HttpPost(\"http://192.168.1.224:3000/signup\");\n\n try {\n // Add your data\n\n JSONObject json = new JSONObject();\n json.put(\"username\" , userName);\n json.put(\"email\" , email);\n json.put(\"password\" , password);\n\n StringEntity se = new StringEntity( json.toString());\n se.setContentType(new BasicHeader(HTTP.CONTENT_TYPE, \"application/json\"));\n httppost.setEntity(se);\n\n // Execute HTTP Post Request\n HttpResponse response = httpclient.execute(httppost);\n\n s = EntityUtils.toString(response.getEntity());\n\n s = s.toString();\n\n\n int a=response.getStatusLine().getStatusCode();\n\n\n\n } catch (ClientProtocolException e) {\n // TODO Auto-generated catch block\n } catch (IOException e) {\n // TODO Auto-generated catch block\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }", "private String postRequest(String requestUrl, String postData) throws IOException {\n URL url = new URL(requestUrl);\n \n Log.i(TAG, \"Opening Token URL \" + url.toString());\n HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();\n urlConnection.setRequestMethod(\"POST\");\n urlConnection.setDoInput(true);\n urlConnection.setDoOutput(true);\n OutputStreamWriter writer = new OutputStreamWriter(urlConnection.getOutputStream());\n writer.write(postData);\n writer.flush();\n String response = streamToString(urlConnection.getInputStream());\n \n return response;\n }", "public void postSuccess(T data) {\n postValue(new StateData<T>().success(data));\n }", "@Override\n public final void doPost() {\n try {\n checkPermissions(getRequest());\n final IItem jSonStreamAsItem = getJSonStreamAsItem();\n final IItem outputItem = api.runAdd(jSonStreamAsItem);\n\n output(JSonItemWriter.itemToJSON(outputItem));\n } catch (final APIException e) {\n e.setApi(apiName);\n e.setResource(resourceName);\n throw e;\n\n }\n }", "@Override\n public void run() {\n HttpsURLConnection connPut = null;\n try {\n URL webServerUrl = new URL(DB_URL);\n\n connPut = (HttpsURLConnection) webServerUrl.openConnection();\n\n connPut.setReadTimeout(10000 /* milliseconds */);\n connPut.setConnectTimeout(15000 /* milliseconds */);\n connPut.setDoOutput(true);\n\n connPut.setRequestMethod(\"POST\");\n connPut.setRequestProperty(\"Content-type\", \"application/json\");\n AuthenticationValidator authenticationValidator = new AuthenticationValidator(context);\n String token = authenticationValidator.getAuthenticationToken();\n connPut.addRequestProperty(\"Authorization\", \"Bearer \" + token);\n connPut.connect();\n OutputStreamWriter out = new OutputStreamWriter(connPut.getOutputStream());\n\n\n\n\n for(RestRecord rr : toBePushed)\n {\n out.write(rr.getJSON().toString());\n out.flush();\n }\n out.close();\n\n if(connPut.getResponseCode() == 200)\n System.out.println(\"Successfully posted new route(s).\");\n else\n System.out.println(connPut.getResponseMessage());\n\n connPut.disconnect();\n\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n if(connPut!=null)\n connPut.disconnect();\n }\n }", "protected void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\t\tPostDao postDao = DatabaseManager.getInstance().getDaoFactory().getPostDao();\n\n\t\t// prendo i dati dalla js\n\t\tString title = request.getParameter(\"title\");\n\t\tString message = request.getParameter(\"content\");\n\t\tString userid = (String) request.getSession(false).getAttribute(\"email\");\n\t\tString pathimg = request.getParameter(\"img\");\n\n\t\tSystem.out.println(\"this is the author of the post \" + userid);\n\n\t\t// creo la data del giorno corrente\n\t\tlong time = System.currentTimeMillis();\n\t\tjava.sql.Date date = new java.sql.Date(time);\n\t\t\n\t\tPost postToSave = new Post(1, title, message, userid, pathimg, date);\n\t\tpostDao.save(postToSave);\n\n\t\tJsonObject post = new JsonObject();\n\t\tpost.addProperty(\"msg\",postToSave.getMessaggio());\n\t\tpost.addProperty(\"title\", postToSave.getTitle());\n\t\tpost.addProperty(\"utente\", postToSave.getUtente());\n\t\tpost.addProperty(\"img\", postToSave.getImgname());\n\t\tpost.addProperty(\"id_post\", postToSave.getIdPost());\n\n\t\tDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\tString reportDate = df.format(postToSave.getData());\n\n\t\tpost.addProperty(\"data\", reportDate);\n\t\tresponse.getWriter().write(post.toString());\n\n\t}", "@TargetApi(Build.VERSION_CODES.KITKAT)\n public String sendPost1() throws Exception {\n String urlParameters=parameter;\n byte[] postData = urlParameters.getBytes(\"UTF-8\");\n int postDataLength = postData.length;\n URL url;\n HttpURLConnection urlConn;\n DataOutputStream printout;\n DataInputStream input;\n url = new URL(\"http://203.151.92.175:8080/\"+method);\n urlConn = (HttpURLConnection) url.openConnection();\n urlConn.setDoInput(true);\n urlConn.setDoOutput(true);\n urlConn.setUseCaches(false);\n urlConn.setInstanceFollowRedirects(false);\n urlConn.setRequestMethod(\"POST\");\n urlConn.setRequestProperty(\"charset\", \"utf-8\");\n urlConn.setRequestProperty(\"Content-Length\", Integer.toString(postDataLength));\n urlConn.setRequestProperty(\"User-Agent\", USER_AGENT);\n urlConn.connect();\n DataOutputStream wr = new DataOutputStream(urlConn.getOutputStream());\n wr.write(postData);\n\n BufferedReader in = new BufferedReader(\n new InputStreamReader(urlConn.getInputStream()));\n String inputLine;\n StringBuffer response = new StringBuffer();\n\n while ((inputLine = in.readLine()) != null) {\n response.append(inputLine);\n }\n in.close();\n urlConn.disconnect();\n return response.toString();\n\n }", "private void erweimaHttpPost() {\n\t\tHttpUtils httpUtils = new HttpUtils();\n\t\tUtils utils = new Utils();\n\t\tString[] verstring = utils.getVersionInfo(getActivity());\n\t\tRequestParams params = new RequestParams();\n\t\tparams.addHeader(\"ccq\", utils.getSystemVersion()+\",\"+ verstring[0]+\",\"+verstring[2]);\n\t\tparams.addBodyParameter(\"token\",\n\t\t\t\tnew DButil().gettoken(getActivity()));\n\t\tparams.addBodyParameter(\"member_id\",\n\t\t\t\tnew DButil().getMember_id(getActivity()));\n\t\thttpUtils.send(HttpMethod.POST, JiekouUtils.TUIGUANGERWEIMA, params,\n\t\t\t\tnew RequestCallBack<String>() {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onFailure(HttpException arg0, String arg1) {\n\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\tLog.e(\"ee\", \"失败:\" + arg1);\n\t\t\t\t\t\thandler.sendEmptyMessage(HANDLER_NET_FAILURE);\n\t\t\t\t\t\t// handler.sendEmptyMessage(HANDLER_NET_FAILURE);\n\t\t\t\t\t}\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onSuccess(ResponseInfo<String> arg0) {\n\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\terweimaJsonInfo(arg0.result);\n\t\t\t\t\t}\n\t\t\t\t});\n\t}", "public String postData() {\n //Post Data\n List<NameValuePair> postParams = new ArrayList<NameValuePair>(1);\n postParams.add(new BasicNameValuePair(\"option\", \"addrecipe\"));\n postParams.add(new BasicNameValuePair(\"recipename\", txtName.getText().toString()));\n postParams.add(new BasicNameValuePair(\"description\", txtDesc.getText().toString()));\n postParams.add(new BasicNameValuePair(\"catid\", catIDs[categories.getSelectedItemPosition()]));\n postParams.add(new BasicNameValuePair(\"cuisineid\", String.valueOf(cuisines.getSelectedItemPosition()+1)));\n postParams.add(new BasicNameValuePair(\"ingredients\", txtIng.getText().toString()));\n postParams.add(new BasicNameValuePair(\"procedure\", txtSteps.getText().toString()));\n postParams.add(new BasicNameValuePair(\"author\", mainActivity.getUser().getId()));\n\n try {\n\n // Execute HTTP Post Request\n String response = HttpUtil.getJSONData(Constants.URL_FUNCTIONS, postParams, Constants.TIMEOUT_CONN, Constants.TIMEOUT_SOCKET);\n\n if(response != null)\n {\n //Log.d(\"Http Post Response:\", response);\n return response;\n }\n }catch (Exception e) {\n Log.e(\"RECIPEBOOK\", \"update recipe\", e);\n }\n return null;\n }", "@Override\n public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {\n String emailValue = request.getParameter(\"email-input\");\n String textValue = request.getParameter(\"text-input\");\n\n // Print the value so you can see it in the server logs.\n System.out.println(\"You submitted : \" + textValue + \"\\n By : \" + emailValue);\n\n // Create instance of DataStore\n Datastore datastore = DatastoreOptions.getDefaultInstance().getService();\n // Create a key with a \"kind\"\n KeyFactory keyFactory = datastore.newKeyFactory().setKind(\"Email\");\n FullEntity emailEntity = Entity.newBuilder(keyFactory.newKey()).set(\"Email\", emailValue)\n .set(\"Message\", textValue).build();\n\n datastore.put(emailEntity);\n\n // Write the value to the response so the user can see it.\n response.sendRedirect(\"/\");\n }", "@Test\n void postTest() {\n URI uri = URI.create(endBody + \"/post\");\n\n // create a dummy body for easy JSON conversion\n QuestionText newQuestion = new QuestionText(\"Test\");\n\n // convert to json and send / store the response\n HttpResponse<String> response = HttpMethods.post(uri, gson.toJson(newQuestion));\n\n assertEquals(200, response.statusCode());\n }", "@Test\n public void createPost() throws IOException {\n PostData postData = new PostData()\n .withId(101)\n .withUserId(1)\n .withTitle(\"New Post\")\n .withBody(\"This is the body of the post.\");\n\n // Create an HTTP Post Request\n HttpPost post = new HttpPost(POSTS);\n\n // Set the \"Content-type\" header of the\n // HTTP Post Request to \"Application/json; charset=UTF-8\"\n post.setHeader(\n CONTENT_TYPE,\n \"Application/json; charset=UTF-8\"\n );\n\n // Create a String Entity out of the JSON data and add it\n // to the HTTP Post Request.\n //\n // This will serialize the JSON data into a String\n post.setEntity(\n new StringEntity(\n this.gson.toJson(postData)\n )\n );\n\n // Execute the HTTP Post with the client\n HttpResponse response = this.httpClient.execute(post);\n\n // Get a PostData class instance from the response\n PostData responsePostData = getPostData(response);\n\n // Make assertions about the response\n assertThat(response.getStatusLine().getStatusCode())\n .isEqualTo(201);\n\n // Make assertions about the data returned\n assertThat(responsePostData.getId()).isEqualTo(101);\n assertThat(responsePostData.getUserId()).isEqualTo(1);\n assertThat(responsePostData.getTitle())\n .isEqualTo(postData.getTitle());\n assertThat(responsePostData.getBody())\n .isEqualTo(postData.getBody());\n }", "public void doPost(String message) {\n\t\ttry {\n\t\t\tconnection.openOutputStream();\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"Failed to post the message. \" + e);\n\t\t}\n\t}", "@Override\n\tpublic void run() {\n\t\tRequestBody body = RequestBody.create(this.jsonType, this.contents);\n\t\tRequest request = new Request.Builder()\n\t\t\t.url(this.serverURL)\n\t\t\t.post(body)\n\t\t\t.build();\n\t\t\n\t\ttry {\n\t\t\tResponse response = client.newCall(request).execute();\n\t\t\tString str = response.body().string();\n\t\t\t//logger.log(Level.INFO, \n\t\t\t//\t\tString.format(\"DEBUG postCallInfoToServerTask succeed: %s\", str));\n\t\t} catch (IOException e) {\n\t\t\tNetProphetLogger.logError(\"PostCallInfoTask.run\", e.toString());\n\t\t}\n\t}", "public Boolean sendData() {\n\t\tHttpClient httpClient = new DefaultHttpClient();\n\t\tBoolean ret = true;\n\t\ttry {\n\t\t\tbyte[] data = getAvroData();\n\n\t\t\tHttpPost httppost = new HttpPost(getUrl());\n\t\t\tInputStreamEntity reqEntity = new InputStreamEntity(new ByteArrayInputStream(data), -1);\n\t\t\treqEntity.setContentType(\"binary/octet-stream\");\n\t\t\treqEntity.setChunked(true);\n\n\t\t\thttppost.setEntity(reqEntity);\n\t\t\tHttpResponse response = httpClient.execute(httppost);\n\t\t\tSystem.out.println(response.getStatusLine());\n\t\t\thttppost.releaseConnection();\n\t\t} catch (Exception ex) {\n\t\t\tret = false;\n\t\t\tex.printStackTrace();\n\t\t} finally {\n\t\t\thttpClient.getConnectionManager().shutdown();\n\t\t}\n\n\t\treturn ret;\n\t\t// long endTime = System.currentTimeMillis();\n\t\t// System.out.println(\"use \" + (endTime - startTime) + \" ms \");\n\t}", "public void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows IOException {\n\n\t}", "@Override\n protected StringBuilder doInBackground(String... params) {\n return postData(params[0],params[1],params[2],params[3]);\n }", "protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException {\n }", "@Override\n public String getMethod() {\n return \"POST\";\n }", "@Override\n\tvoid post() {\n\t\t\n\t}", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n metPost(request, response);\n }", "public void postData(Reader data, Writer output) {\n\n HttpURLConnection urlc = null;\n try {\n urlc = (HttpURLConnection) solrUrl.openConnection();\n try {\n urlc.setRequestMethod(\"POST\");\n } catch (ProtocolException e) {\n throw new PostException(\"Shouldn't happen: HttpURLConnection doesn't support POST??\", e);\n }\n urlc.setDoOutput(true);\n urlc.setDoInput(true);\n urlc.setUseCaches(false);\n urlc.setAllowUserInteraction(false);\n urlc.setRequestProperty(\"Content-type\", \"text/xml; charset=\" + POST_ENCODING);\n \n OutputStream out = urlc.getOutputStream();\n \n try {\n Writer writer = new OutputStreamWriter(out, POST_ENCODING);\n pipe(data, writer);\n writer.close();\n } catch (IOException e) {\n throw new PostException(\"IOException while posting data\", e);\n } finally {\n if(out!=null) out.close();\n }\n \n InputStream in = urlc.getInputStream();\n try {\n Reader reader = new InputStreamReader(in);\n pipe(reader, output);\n reader.close();\n } catch (IOException e) {\n throw new PostException(\"IOException while reading response\", e);\n } finally {\n if(in!=null) in.close();\n }\n \n } catch (IOException e) {\n fatal(\"Connection error (is Solr running at \" + solrUrl + \" ?): \" + e);\n \n } finally {\n if(urlc!=null) urlc.disconnect();\n }\n }", "private void sendData() {\n String Own_Easting = OEast.getText().toString();\n String Own_Northing = ONorth.getText().toString();\n String En_Easting = EEast.getText().toString();\n String En_nothing = ENorth.getText().toString();\n String OTbg = OTBG.getText().toString();\n String rt=Rt.getText().toString();\n String add=Add.getText().toString();\n\n DB bg = new DB(this);\n bg.execute(Own_Easting,Own_Northing,En_Easting,En_nothing\n ,OTbg,rt,add);\n\n }", "public void run() {\n\t\t\t\tHttpURLConnection connection = null;\r\n\r\n\t\t\t\tPrintWriter printWriter = null;\r\n\t\t\t\tBufferedReader bufferedReader = null;\r\n\r\n\t\t\t\tStringBuffer response = new StringBuffer();\r\n\t\t\t\tStringBuffer request = new StringBuffer();\r\n\r\n\t\t\t\t// 组织请求参数\r\n\t\t\t\tif (null != params && !params.isEmpty()){\r\n\t\t\t\t\tfor (Map.Entry<String, String> entry : params.entrySet()){\r\n\t\t\t\t\t\trequest.append(entry.getKey()).append(\"=\").append(entry.getValue()).append(\"&\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//< 删除多余的&\r\n\t\t\t\t\trequest.deleteCharAt(request.length() - 1);\r\n\t\t\t\t}\r\n\t\t\t\tLog.d(\"HttpUtil\", request.toString());\r\n\r\n\t\t\t\ttry{\r\n\t\t\t\t\tURL url = new URL(address);\r\n\t\t\t\t\tconnection = (HttpURLConnection) url.openConnection();\r\n\t\t\t\t\tconnection.setRequestMethod(\"POST\");\r\n\t\t\t\t\tconnection.setRequestProperty(\"Content-Length\", String.valueOf(request.length()));\r\n\t\t\t\t\tconnection.setDoInput(true);\r\n\t\t\t\t\tconnection.setDoOutput(true);\r\n\t\t\t\t\tprintWriter = new PrintWriter(connection.getOutputStream());\r\n\t\t\t\t\tprintWriter.write(request.toString());\r\n\t\t\t\t\tprintWriter.flush();\r\n\r\n\t\t\t\t\tint responseCode = connection.getResponseCode();\r\n\t\t\t\t\tif(responseCode != 200){\r\n\t\t\t\t\t\tLog.d(\"HttpUtil\", \"Post Fail\");\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tLog.d(\"HttpUtil\", \"Post Success\");\r\n\t\t\t\t\t\tbufferedReader = new BufferedReader(new InputStreamReader(connection.getInputStream()));\r\n\t\t\t\t\t\tString line;\r\n\t\t\t\t\t\twhile ((line = bufferedReader.readLine()) != null) {\r\n\t\t\t\t\t\t\tresponse.append(line);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(listener != null){\r\n\t\t\t\t\t\tlistener.onFinish(response.toString());\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}catch(Exception e){\r\n\t\t\t\t\tif(listener != null){\r\n\t\t\t\t\t\tlistener.onError(e);\r\n\t\t\t\t\t}\r\n\t\t\t\t}finally{\r\n\t\t\t\t\tif(connection != null){\r\n\t\t\t\t\t\tconnection.disconnect();\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tif (printWriter != null) {\r\n\t\t\t\t\t\t\tprintWriter.close();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (bufferedReader != null) {\r\n\t\t\t\t\t\t\tbufferedReader.close();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} catch (IOException ex) {\r\n\t\t\t\t\t\tex.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}", "public void submit(View view) {\n EditText nameBox = (EditText)findViewById(R.id.name);\n String name = \"null\";\n try {\n name = URLEncoder.encode(nameBox.getText().toString(), \"UTF-8\");\n } catch (UnsupportedEncodingException e) {\n System.out.println(\"Error Encoding Name\");\n }\n String encodedData = JSONify.encode(name, data);\n RequestQueue queue = Volley.newRequestQueue(this);\n String url = Reference.BASE_URL + \"b/\" + Reference.ean + encodedData;\n\n // Request a string response from the provided URL.\n StringRequest stringRequest = new StringRequest(com.android.volley.Request.Method.GET, url,\n new Response.Listener<String>() {\n @Override\n public void onResponse(String response) {\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n //TODO add an alert here\n System.out.println(\"GET request error\");\n }\n });\n // Add the request to the RequestQueue.\n queue.add(stringRequest);\n\n Reference.ean = null;\n Reference.name = null;\n Reference.canEat = -1;\n Reference.data = null;\n switchToHome();\n }", "private void submit()\n {\n ownerSelected = ownersDropDown.getSelectedItemPosition();\n dogSelected = dogsDropDown.getSelectedItemPosition();\n\n dog_id = dogID.get(dogSelected).toString();\n human_id = ownerID.get(ownerSelected).toString();\n\n String jsonBody = \"{}\";\n\n mOkHttpClient = new OkHttpClient();\n\n HttpUrl reqURL = HttpUrl.parse(\"https://final-project-saldanaj.appspot.com/dogs/\" + dog_id + \"/owner/\" + human_id);\n\n RequestBody body = RequestBody.create(JSON, jsonBody);\n\n Request request = new Request.Builder()\n .url(reqURL)\n .put(body)\n .build();\n\n mOkHttpClient.newCall(request).enqueue(new Callback(){\n\n @Override\n public void onFailure(Call call, IOException e)\n {\n e.printStackTrace();\n }\n\n\n @Override\n public void onResponse(Call call, Response response) throws IOException\n {\n String r = response.body().string();\n\n System.out.print(r);\n }\n\n }); // end of the newCall.enqueue callback\n\n }", "public void doPost(HttpServletRequest request ,HttpServletResponse response){\n\n }", "private String doSubmit(String url, Map<String, String> data)\r\n\t\t\tthrows Exception {\r\n\t\tURL siteUrl = new URL(url);\r\n\r\n\t\tHttpURLConnection conn = (HttpURLConnection) siteUrl.openConnection();\r\n\t\tconn.setRequestMethod(\"POST\");\r\n\t\tconn.setDoOutput(true);\r\n\t\tconn.setDoInput(true);\r\n\r\n\t\tDataOutputStream out = new DataOutputStream(conn.getOutputStream());\r\n\r\n\t\tSet keys = data.keySet();\r\n\t\tIterator keyIter = keys.iterator();\r\n\t\tString content = \"\";\r\n\t\tfor (int i = 0; keyIter.hasNext(); i++) {\r\n\t\t\tObject key = keyIter.next();\r\n\t\t\tif (i != 0) {\r\n\t\t\t\tcontent += \"&\";\r\n\t\t\t}\r\n\t\t\tcontent += key + \"=\" + URLEncoder.encode(data.get(key), \"UTF-8\");\r\n\t\t\t// content += key + \"=\" + data.get(key);\r\n\t\t}\r\n\t\tSystem.out.println(content);\r\n\t\tout.writeBytes(content);\r\n\t\tout.flush();\r\n\t\tout.close();\r\n\r\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(\r\n\t\t\t\tconn.getInputStream()));\r\n\t\tStringBuilder builder = new StringBuilder();\r\n\t\tString aux = \"\";\r\n\r\n\t\tString prefix = siteUrl.getProtocol() + \"://\" + siteUrl.getHost();\r\n\r\n\t\twhile ((aux = in.readLine()) != null) {\r\n\t\t\tif (aux.indexOf(\"href\") != -1) {\r\n\t\t\t\taux = aux.replaceAll(\"href=\\\"/\", \"href=\\\"\" + prefix + \"/\");\r\n\t\t\t}\r\n\t\t\taux = aux.replaceAll(\"src=\\\"/\", \"src=\\\"\" + prefix + \"/\");\r\n\t\t\tbuilder.append(aux);\r\n\t\t}\r\n\r\n\t\tin.close();\r\n\r\n\t\treturn builder.toString();\r\n\t}", "public RequestDataBuilder post() {\n\t\tRequest request = new Request(urlPattern, RequestMethod.POST);\n\t\tmap.put(request, clazz);\n\t\treturn this;\n\t}", "public void postData(String autho, String iVector) {\n HttpClient httpclient = new DefaultHttpClient();\n HttpGet httppost = new HttpGet(url);\n\n try {\n // Add your data\n// List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();\n// nameValuePairs.add(new BasicNameValuePair(\"username\", uName));\n// nameValuePairs.add(new BasicNameValuePair(\"password\", pWord));\n// nameValuePairs.add(new BasicNameValuePair(\"ivector\", iVector));\n\n// httppost.addHeader(\"username\", uName);\n// httppost.addHeader(\"password\", pWord);\n httppost.addHeader(\"Authorization\", autho);\n httppost.addHeader(\"ivector\", iVector);\n\n // Execute HTTP Post Request\n HttpResponse response = httpclient.execute(httppost);\n String responseStr = EntityUtils.toString(response.getEntity());\n\n httppost.releaseConnection();\n httpclient.getConnectionManager().shutdown();\n\n\n handleResponse(responseStr);\n\n\n\n } catch (ClientProtocolException e) {\n // TODO Auto-generated catch block\n //doNotification();\n } catch (IOException e) {\n // TODO Auto-generated catch block\n\n //doNotification();\n }\n catch (RuntimeException e)\n {\n //doNotification();\n// text = \"Incorrect Username and/or Password\";\n// toast = Toast.makeText(context,text, duration);\n// toast.show();\n }\n }", "@Override\n protected Double doInBackground(String... params) {\n if (MainActivity.LOCAL_LOGV) Log.v(MainActivity.REFACTOR_LOG_TAG, \"Poster url: \" + params[0]);\n postData(params[0]);\n return null;\n }", "private void createPost() {\n PostModel model = new PostModel(23, \"New Title\", \"New Text\");\n Call<PostModel> call = jsonPlaceHolderAPI.createPost(model);\n call.enqueue(new Callback<PostModel>() {\n @Override\n @EverythingIsNonNull\n public void onResponse(Call<PostModel> call, Response<PostModel> response) {\n if (!response.isSuccessful()) {\n textResult.setText(response.code());\n return;\n }\n PostModel postResponse = response.body();\n String content = \"\";\n assert postResponse != null;\n content += \"Code: \" + response.code() + \"\\n\";\n content += \"ID: \" + postResponse.getId() + \"\\n\";\n content += \"User ID: \" + postResponse.getUserId() + \"\\n\";\n content += \"Title: \" + postResponse.getUserId() + \"\\n\";\n content += \"Body: \" + postResponse.getText();\n textResult.append(content);\n }\n\n @Override\n @EverythingIsNonNull\n public void onFailure(Call<PostModel> call, Throwable t) {\n textResult.setText(t.getMessage());\n }\n });\n }", "public void postData(String PollutionRiversandStream,String AirPollution,String NoisePollution,String AbsenseofWasteDisposalSites,String Littering,\n\t\t\t\t\t\t\t String FeelingofResponsibility)\n\t\t{\n\t\t\tHttpClient httpclient = new DefaultHttpClient();\n\t\t\tHttpPost httppost = new HttpPost(\"http://www.comdevindex.0fees.us/Enviornment.php\");\n\t\t\t\n\t\t\ttry {\n\t\t\t\t// Add your data\n\t\t\t\tList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();\n\t\t\t\tnameValuePairs.add(new BasicNameValuePair(\"PollutionRiversandStream\",PollutionRiversandStream));\n\t\t\t\tnameValuePairs.add(new BasicNameValuePair(\"AirPollution\",AirPollution));\n\t\t\t\tnameValuePairs.add(new BasicNameValuePair(\"NoisePollution\",NoisePollution));\n\t\t\t\tnameValuePairs.add(new BasicNameValuePair(\"AbsenseofWasteDisposalSites\",AbsenseofWasteDisposalSites));\n\t\t\t\tnameValuePairs.add(new BasicNameValuePair(\"Littering\",Littering));\n\t\t\t\tnameValuePairs.add(new BasicNameValuePair(\"FeelingofResponsibility\",FeelingofResponsibility));\n\t\n\t\t\t\thttppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));\n \n\t\t\t\t// Execute HTTP Post Request\n\t\t\t\tHttpResponse response = httpclient.execute(httppost);\n\t\t\t\t}\n\t\t\t\tcatch (ClientProtocolException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t} \n\t\t\tcatch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t}\n\t\t}", "public HttpPoster(final URL url, final String requestData) {\n\t\tsuper(url, HttpMethod.POST, requestData);\n\t}", "public HttpPoster(final String url, final String requestData) {\n\t\tsuper(url, HttpMethod.POST, requestData);\n\t}", "public void postRequest() {\n apiUtil = new APIUtil();\n // As this is an API call , we are not setting up any base url but defining the individual calls\n apiUtil.setBaseURI(configurationReader.get(\"BaseURL\"));\n //This is used to validate the get call protected with basic authentication mechanism\n basicAuthValidation();\n scenario.write(\"Request body parameters are :-\");\n SamplePOJO samplePOJO = new SamplePOJO();\n samplePOJO.setFirstName(scenarioContext.getContext(\"firstName\"));\n samplePOJO.setLastName(scenarioContext.getContext(\"lastName\"));\n\n ObjectMapper objectMapper = new ObjectMapper();\n try {\n apiUtil.setRequestBody(objectMapper.writeValueAsString(samplePOJO));\n } catch (JsonProcessingException e) {\n e.printStackTrace();\n }\n }", "protected String getSecondoPost() {\n// String testoPost;\n// String testo = this.getTestoNew();\n// String summary = this.getSummary();\n//// String edittoken = this.getToken();\n//\n// if (testo != null && !testo.equals(\"\")) {\n// try { // prova ad eseguire il codice\n// testo = URLEncoder.encode(testo, \"UTF-8\");\n//\n// } catch (Exception unErrore) { // intercetta l'errore\n// }// fine del blocco try-catch\n// }// fine del blocco if\n// if (summary != null && !summary.equals(\"\")) {\n// try { // prova ad eseguire il codice\n// summary = URLEncoder.encode(summary, \"UTF-8\");\n// } catch (Exception unErrore) { // intercetta l'errore\n// }// fine del blocco try-catch\n// }// fine del blocco if\n//\n// testoPost = \"text=\" + testo;\n// testoPost += \"&bot=true\";\n// testoPost += \"&minor=true\";\n// testoPost += \"&summary=\" + summary;\n//// testoPost += \"&token=\" + edittoken;\n//\n return \"\";\n }", "@Override\n protected String doInBackground(String... params) {\n\n String data = \"\";\n\n HttpURLConnection httpURLConnection = null;\n try {\n\n httpURLConnection = (HttpURLConnection) new URL(params[0]).openConnection();\n httpURLConnection.setRequestMethod(\"POST\");\n\n httpURLConnection.setDoOutput(true);\n\n DataOutputStream wr = new DataOutputStream(httpURLConnection.getOutputStream());\n wr.writeBytes(\"PostData=\" + params[1]);\n wr.flush();\n wr.close();\n\n InputStream in = httpURLConnection.getInputStream();\n InputStreamReader inputStreamReader = new InputStreamReader(in);\n\n int inputStreamData = inputStreamReader.read();\n while (inputStreamData != -1) {\n char current = (char) inputStreamData;\n inputStreamData = inputStreamReader.read();\n data += current;\n }\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n if (httpURLConnection != null) {\n httpURLConnection.disconnect();\n }\n }\n return data;\n }", "public void saveWalk() {\n try {\n long id = this.currentRoute.getId();\n DatabaseHandler db = new DatabaseHandler(this.getApplicationContext());\n currentRoute.setWaypoints(db.getAllWaypoints(id));\n\n HTTPPostSender postSender = new HTTPPostSender();\n postSender.buildString(currentRoute, this.getContentResolver());\n postSender.cm = (ConnectivityManager) getSystemService(this.getApplicationContext().CONNECTIVITY_SERVICE);\n\n\n\n\n if(isOnline()) {\n postSender.execute(this.currentRoute);\n Toast.makeText(this.getApplicationContext(),\"Walk successfully sent to server\",Toast.LENGTH_LONG).show();\n\n } else {\n //oh god why..\n Toast.makeText(this.getApplicationContext(),\"Something bad happened\",Toast.LENGTH_LONG).show();\n }\n } catch(Exception e) {\n Toast.makeText(this.getApplicationContext(),e.getMessage(),Toast.LENGTH_LONG).show();\n }\n }", "HttpPost postRequest(HttpServletRequest request, String address) throws IOException;", "static String sendPOST(String POST_URL) throws IOException {\n\t\t// Check URL is valid or not.\n\t\tif (isValidURL(POST_URL)) {\n\t\t\ttry {\n\t\t\t\t//Initial connection\n\t\t\t\tURL obj = new URL(POST_URL);\n\t\t\t\tHttpURLConnection con = (HttpURLConnection) obj.openConnection();\n\t\t\t\tcon.setRequestMethod(\"POST\");\n\t\t\t\tcon.setRequestProperty(\"User-Agent\", USER_AGENT);\n\n\t\t\t\t// For POST only - START\n\t\t\t\tcon.setDoOutput(true);\n\t\t\t\tOutputStream os = con.getOutputStream();\n\t\t\t\tJSONArray array = new JSONArray();\n\t\t\t\t\n\t\t\t\t//Get Mac Adress.\n\t\t\t\tInetAddress ip = InetAddress.getLocalHost();\n\t\t\t\tNetworkInterface network = NetworkInterface.getByInetAddress(ip);\n\t\t\t\tbyte[] mac = network.getHardwareAddress();\n\t\t\t\tStringBuilder macString = new StringBuilder();\n\t\t\t\tfor (int i = 0; i < mac.length; i++) {\n\t\t\t\t\tmacString.append(String.format(\"%02X%s\", mac[i], (i < mac.length - 1) ? \"-\" : \"\"));\n\t\t\t\t}\n\t\t\t\t//Send mac address as parameter.\n\t\t\t\tCLIENT_PARAMS = macString.toString();\n\t\t\t\t\n\t\t\t\t//Send Params.\n\t\t\t\tarray.put(USER_PARAMS);\n\t\t\t\tarray.put(SCORE_PARAMS);\n\t\t\t\tarray.put(CLIENT_PARAMS);\n\t\t\t\tos.write(array.toString().getBytes());\n\n\t\t\t\tos.flush();\n\t\t\t\tos.close();\n\t\t\t\t// For POST only - END\n\n\t\t\t\tint responseCode = con.getResponseCode();\n\t\t\t\tSystem.out.println(\"POST Response Code :: \" + responseCode);\n\n\t\t\t\tif (responseCode == HttpURLConnection.HTTP_OK) { // success\n\t\t\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));\n\t\t\t\t\tString inputLine;\n\t\t\t\t\tStringBuffer response = new StringBuffer();\n\n\t\t\t\t\twhile ((inputLine = in.readLine()) != null) {\n\t\t\t\t\t\tresponse.append(inputLine);\n\t\t\t\t\t}\n\t\t\t\t\tin.close();\n\n\t\t\t\t\t// print result\n\t\t\t\t\tSystem.out.println(response.toString());\n\t\t\t\t\treturn \"POST request worked\"; // Added for testing.\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"POST request not worked\");\n\t\t\t\t\treturn \"POST request not worked\";\n\t\t\t\t}\n\t\t\t} catch (MalformedURLException e) {\n\t\t\t\treturn \"URL is valid but connection could not be established.\";\n\t\t\t} catch (IOException e) {\n\t\t\t\treturn \"URL is valid but connection could not be established.\";\n\t\t\t}\n\n\t\t} else {\n\t\t\treturn \"URL is not valid.\";\n\t\t}\n\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tPostParameter[] params = new PostParameter[1];\n\t\t\t\tparams[0] = new PostParameter(\"answerID\", answerID);\n\t\t\t\tString jsonString = ConnectUtil.httpRequest(\n\t\t\t\t\t\tConnectUtil.addSupportAnswer, params, ConnectUtil.POST);\n\t\t\t\tMessage msg = new Message();\n\t\t\t\tmsg.what = 3;\n\t\t\t\tif (jsonString != null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tJSONObject result = new JSONObject(jsonString);\n\t\t\t\t\t\tString status = result.getString(\"Status\");\n\t\t\t\t\t\tif (status.equalsIgnoreCase(\"success\")) {\n\t\t\t\t\t\t\tmsg.obj = \"+1\";\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t\tmsg.obj = \"点赞失败\";\n\t\t\t\t\t} catch (JSONException e) {\n\t\t\t\t\t\tmsg.what = 0;\n\t\t\t\t\t}\n\t\t\t\t} else\n\t\t\t\t\tmsg.what = 0;\n\t\t\t\tmyHandler.sendMessage(msg);\n\t\t\t}", "@Test\n \tpublic void testToPostData() throws UnsupportedEncodingException{\n \t\t\n \t\tUserInfo user = DummyFactory.createDummyUserInfo();\n \t\tString postStr = String.format(\"type=%s&time=%s&member[0][uid]=%s&member[0][status]=%s\", \n \t\t\t\tURLEncoder.encode(\"PRIVATE\",\"utf-8\"),\n\t\t\t\tURLEncoder.encode(\"1970-01-01T09:00\",\"utf-8\"),\n \t\t\t\tURLEncoder.encode(\"xxxx\",\"utf-8\"),\n \t\t\t\tURLEncoder.encode(\"ON\",\"utf-8\")\n \t\t\t\t);\n \n \t\tAlarmInfo alarm = new AlarmInfo(user, 1000);\n \t\tassertEquals( postStr, alarm.toPostData() );\n \t}", "ClientResponse post(URI resourceURI, String postData, String jsonFormat) {\n ClientResponse response = _client.post(resourceURI, postData, _vplexSessionId, jsonFormat);\n updateVPLEXSessionId(response);\n return response;\n }", "@Override\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\tpostData();\n\t\t\t\t\t}", "public static int doPost(String name, String id, Result r) {\n r.setValue(\"\");\n String response = \"\";\n int status = 0;\n String output =\"\";\n \n try {\n // Make call to a particular URL\n URL url = new URL(\"https://intense-lake-93564.herokuapp.com/menusection/\");\n HttpURLConnection conn = (HttpURLConnection) url.openConnection();\n // set request method to POST and send name value pair\n conn.setRequestMethod(\"POST\");\n conn.setDoOutput(true);\n conn.setRequestProperty(\"Accept\", \"text/plain\");\n // write to POST data area\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 // get HTTP response code sent by server\n status = conn.getResponseCode();\n if (status != 200) {\n // not using msg\n String msg = conn.getResponseMessage();\n return conn.getResponseCode();\n }\n output = \"\";\n BufferedReader br = new BufferedReader(new InputStreamReader(\n (conn.getInputStream())));\n while ((output = br.readLine()) != null) {\n response += output; \n }\n conn.disconnect();\n //close the connection\n conn.disconnect();\n }\n // handle exceptions\n catch (MalformedURLException e) {\n e.printStackTrace();\n }\n catch (IOException e) {\n e.printStackTrace();\n } \n // return HTTP status\n r.setValue(response);\n return status; \n }", "@Override\n public String getMethod() {\n return \"POST\";\n }", "public void sendDataToDB() throws JSONException, InstantiationException, IllegalAccessException, ClassNotFoundException, UnirestException, ParseException {\r\n\t\t\r\n\t\tArrayList<HashMap<String, String>> dataSet = new ArrayList<>();\r\n\t\t\r\n\t\tfor (int i = 0; i < dataArray.length(); i++) {\r\n\t\t\tHashMap<String, String> jsonObject = new HashMap<String, String>();\r\n\t\t\tjsonObject.put(\"id\" ,dataArray.getJSONObject(i).get(\"id\").toString());\r\n\t\t\tjsonObject.put(\"name\", dataArray.getJSONObject(i).get(\"name\").toString());\r\n\t\t\tjsonObject.put(\"free_bikes\", dataArray.getJSONObject(i).get(\"free_bikes\").toString());\r\n\t\t\tjsonObject.put(\"timestamp\", changeTimeStamptoUnixTimeString(dataArray.getJSONObject(i).get(\"timestamp\").toString()));\r\n\t\t\tjsonObject.put(\"latitude\", dataArray.getJSONObject(i).get(\"latitude\").toString());\r\n\t\t\tjsonObject.put(\"longitude\", dataArray.getJSONObject(i).get(\"longitude\").toString());\r\n\r\n\t\t\tdataSet.add(jsonObject);\r\n\t\t}\r\n\t\t\r\n\t\t// Send whole data to DBService\r\n\t\tUnirest.post(\"http://stadtraddbservice:6000/newData\")\r\n\t\t//Unirest.post(\"http://localhost:6000/newData\") // Fuer lokalen Test\r\n\t\t .body(new Gson().toJson(dataSet))\r\n\t\t .asString();\r\n\t}", "@FormUrlEncoded\n @POST(\"UserData/create_order\")\n public Observable<UserDataResponse> CreateOrder(@Field(\"ord_slm_id\") String ord_slm_id,\n @Field(\"ord_dl_id\") String dealer_id,\n @Field(\"sord_prd_id\") String sord_prd_id,\n @Field(\"sord_qty\") String sord_qty,\n @Field(\"sord_price\") String sord_price,\n @Field(\"ord_total\") String ord_total,\n @Field(\"ord_point\") String ord_point,\n @Field(\"sord_point\") String sord_point,\n @Field(\"sord_total\") String sord_total,\n @Field(\"ord_type\") String ord_type,\n @Field(\"ord_dstr_id\") String ord_dstr_id,\n @Field(\"ord_dl_id\") String ord_dl_id);", "private void StringRequest_POST() {\n\t\tString POST = \"http://api.juheapi.com/japi/toh?\";\n\t\trequest = new StringRequest(Method.POST, POST, new Listener<String>() {\n\n\t\t\t@Override\n\t\t\tpublic void onResponse(String arg0) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tToast.makeText(MainActivity.this, arg0, Toast.LENGTH_LONG).show();\n\t\t\t}\n\t\t}, new ErrorListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onErrorResponse(VolleyError arg0) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tToast.makeText(MainActivity.this, arg0.toString(), Toast.LENGTH_LONG).show();\n\t\t\t}\n\t\t}){@Override\n\t\tprotected Map<String, String> getParams() throws AuthFailureError {\n\t\t\tHashMap< String , String> map = new HashMap<String,String>();\n\t\t\tmap.put(\"key\", \"7bc8ff86168092de65576a6166bfc47b\");\n\t\t\tmap.put(\"v\", \"1.0\");\n\t\t\tmap.put(\"month\", \"11\");\n\t\t\tmap.put(\"day\", \"1\");\n\t\t\treturn map;\n\t\t}};\n\t\trequest.addMarker(\"StringRequest_GET\");\n\t\tMyApplication.getHttpRequestQueue().add(request);\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n\r\n }", "public void postTest(LabTest labTest) {\n URL url = null;\n try {\n url = new URL(apiAddress+\"postTest\");\n\n Gson gson = new GsonBuilder().setPrettyPrinting().create();\n String json = gson.toJson(labTest);\n String encodedString = Base64.getEncoder().encodeToString(json.getBytes());\n\n HttpURLConnection con = (HttpURLConnection) url.openConnection();\n con.setDoOutput(true);\n con.setInstanceFollowRedirects( false );\n con.setRequestMethod( \"GET\" );\n con.setRequestProperty( \"Content-Type\", \"application/json\");\n con.setRequestProperty( \"charset\", \"utf-8\");\n con.setRequestProperty( \"Content-Length\", Integer.toString( encodedString.getBytes().length ));\n con.setRequestProperty(\"Data\", encodedString);\n con.setUseCaches( false );\n BufferedReader in = null;\n try {\n in = new BufferedReader(new InputStreamReader(con.getInputStream()));\n } catch (IOException e) {\n e.printStackTrace();\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void postInfo(String s);", "@Override\n protected Double doInBackground(String... params) {\n postData(params[0], params[1]);\n return null;\n }", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\t\n\t}", "@Override\r\n\t public void run() {\n\r\n\t\ttry {\r\n\t\t URL uri = new URL(url);\r\n\t\t String newParams = URLEncoder.encode(params, \"utf-8\");\r\n\t\t HttpURLConnection conn = (HttpURLConnection) uri\r\n\t\t\t .openConnection();\r\n\t\t conn.setRequestMethod(\"POST\");\r\n\t\t // 设置请求的参数\r\n\t\t conn.setDoInput(true);\r\n\t\t conn.setDoOutput(true);\r\n\r\n\t\t conn.getOutputStream().write(newParams.getBytes());\r\n\r\n\t\t if (conn.getResponseCode() == 200) {\r\n\t\t\tInputStream is = conn.getInputStream();\r\n\t\t\tString result = convertInputStreamToString(is);\r\n\t\t\t// 通过handler发送消息\r\n\t\t\tMessage msg = new Message();\r\n\t\t\tmsg.what = 1;\r\n\t\t\tmsg.obj = result;\r\n\t\t\thandler.sendMessage(msg);\r\n\t\t }\r\n\t\t} catch (MalformedURLException e) {\r\n\t\t // TODO Auto-generated catch block\r\n\t\t e.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t // TODO Auto-generated catch block\r\n\t\t e.printStackTrace();\r\n\t\t}\r\n\t }", "@Override\n\tprotected void handlePostBody(HashMap<String, HashMap<String, String>> params, DataFormat format) throws Exception {\n\t}", "public void doPost(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\r\n\r\n\t\t\r\n\t}", "@Override\n\n\tpublic void handlePOST(CoapExchange exchange) {\n\t\tFIleStream read = new FIleStream();\n\t\tread.tempWrite(Temp_Path, exchange.getRequestText());\n\t\texchange.respond(ResponseCode.CREATED, \"POST successfully!\");\n\t\t_Logger.info(\"Receive post request:\" + exchange.getRequestText());\n\t}", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}", "public void postData(String url, JSONArray listDataToJson) {\n HttpParams myParams = new BasicHttpParams();\n HttpConnectionParams.setConnectionTimeout(myParams, 10 * 1000);\n HttpConnectionParams.setSoTimeout(myParams, 10 * 1000);\n HttpClient httpclient = new DefaultHttpClient(myParams);\n String dataJson = listDataToJson.toString();\n\n try {\n\n HttpPost httppost = new HttpPost(url);\n //Request with content type is json\n httppost.setHeader(HTTP.CONTENT_TYPE, \"application/json\");\n\n StringEntity se = new StringEntity(dataJson);\n se.setContentEncoding(new BasicHeader(HTTP.CONTENT_TYPE, \"application/json\"));\n httppost.setEntity(se);\n\n HttpResponse response = httpclient.execute(httppost);//execute request and get response\n String responseString = EntityUtils.toString(response.getEntity());\n LogUtil.i(\"Response\", responseString);\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void post(ActionEvent actionEvent) throws IOException, ClassNotFoundException {\n Post post;\n if (postPic != null) {\n post = new Post(thisUser.getUser().getUsername(), title.getText()\n , description.getText(), new Date(), thisUser.getUser().getProfileImage(), postPic);\n post.setPostPicAddress(file.toString());\n } else {\n post = new Post(thisUser.getUser().getUsername(), title.getText()\n , description.getText(), new Date(), thisUser.getUser().getProfileImage());\n post.setPostPicAddress(\"No postPic\");\n }\n\n post.setOwner(thisUser.getUser().getUsername());\n\n CommandSender commandSender = new CommandSender(CommandType.NEWPOST\n , post);\n\n Client.getObjectOutputStream().writeObject(commandSender);\n\n thisUser.setSearchedUser(thisUser.getUser());\n Main.loadAPage(actionEvent\n , \"../FXMLs/MyProfile.fxml\"\n , \"SBUgram - Your Profile\"\n );\n\n }", "void savePost(Post post);", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\r\n \tif(\"Submit Request\".equalsIgnoreCase(request.getParameter(\"action\"))){\t\t\t\r\n \t\tSite site = getLoggedOnSite(request);\r\n \t\tUser user = getLoggedOnUser(request);\r\n\r\n\t \tint itemId = Integer.parseInt(request.getParameter(\"itemId\"));\r\n\t \tint numRequested = Integer.parseInt(request.getParameter(\"numberUnits\"));\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tmakeFoodBankRequestDAO.makeFoodBankRequest(itemId, site.getId(), user.getEmail(), numRequested);\r\n\t\t\t\t\r\n\t\t\t\tresponse.getWriter().write((\"Success\"));\t\t\t\r\n\t\t\t\t\r\n\t\t\t} catch (SQLException e) {\t\t\t\t\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t\tresponse.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.toString());\r\n\t\t\t}\r\n\t\t}\r\n }", "@Test\n\tpublic void postExample() {\n\t\tString APIUrl = \"http://34.210.101.131:8081/topics\";\n\t\tString APIBody=\"{\\\"topicComplexity\\\":\\\"5\\\",\\\"topicName\\\":\\\"MCQ\\\"}\";\n\t\t// Building request using requestSpecBuilder\n\t\tRequestSpecBuilder builder = new RequestSpecBuilder();\n\t\t \n\t\tbuilder.setBody(APIBody);\n\t\tbuilder.setContentType(\"application/json\");\n\t\t//RequestSpecification requestSpec = (RequestSpecification) builder.build();\n\t\tRequestSpecification request = RestAssured.given();\n\t\tRestAssured.given().auth().preemptive().basic(\"testingtestdatablz@gmail.com\",\"testdata@123\");\n\t\t//com.jayway.restassured.specification.RequestSpecification requestSpec = builder.build();\t \n\t\t \n\t\n\t\t\t\t\n\t\tResponse response = request.post(\"http://34.210.101.131:8081/topics\");\n\t\tfloat code = response.getStatusCode();\n\t\tSystem.out.println(\"status code is\"+code);\n\t\tString data =response.asString();\n\t\tSystem.out.println(\"Data is\"+data);\n\t\t\n\n\t\t\n\t\t\n\t}", "public void enablePOST() {\n\t\thttpPost = new HttpPost(\"http://23.21.229.136/message.php\");\n\t\thttpPostLog = new HttpPost(\n\t\t\t\t\"http://capstonecontrol.appspot.com/LogModuleEventServlet\");\n\t\thttpPostScheduledEvent = new HttpPost(\n\t\t\t\t\"http://capstonecontrol.appspot.com/ScheduleEvent\");\n\t\tHttpParams httpParameters = new BasicHttpParams();\n\t\t// Set the timeout in milliseconds until a connection is established.\n\t\tint timeoutConnection = 3000;\n\t\tHttpConnectionParams.setConnectionTimeout(httpParameters,\n\t\t\t\ttimeoutConnection);\n\t\t// Set the default socket timeout (SO_TIMEOUT)\n\t\t// in milliseconds which is the timeout for waiting for data.\n\t\tint timeoutSocket = 3000;\n\t\tHttpConnectionParams.setSoTimeout(httpParameters, timeoutSocket);\n\n\t\thttpClient = new DefaultHttpClient(httpParameters);\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n }", "@Override\n\t\t\tprotected String doInBackground(String... arg0) {\n\t\t\t\tHttpClient httpclient=new DefaultHttpClient();\n\t\t\t\tHttpPost httppost=new HttpPost(\"http://192.168.170.15/57983/phptut/Addmat.php\");\n\t\t\t\t\n\t\t\t\t//add my data\n\t\t\t\t try {\n\t\t\t // Add your data\n\t\t\t List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();\n\t\t\t nameValuePairs.add(new BasicNameValuePair(\"Matatu_regno\", mrg));\n\t\t\t nameValuePairs.add(new BasicNameValuePair(\"Route_no\", mrn));\n\t\t\t nameValuePairs.add(new BasicNameValuePair(\"Matatu_driver\", md));\n\t\t\t nameValuePairs.add(new BasicNameValuePair(\"Phone\", mp));\n\t\t\t \n\t\t\t \n\t\t\t httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));\n\n\t\t\t //Execute HTTP Post Request\n\t\t\t HttpResponse response = httpclient.execute(httppost);\n\t\t\t \n\t\t\t \n\t\t\t \n\n\t\t\t } catch (ClientProtocolException e) {\n\t\t\t // TODO Auto-generated catch block\n\t\t\t } catch (IOException e) {\n\t\t\t // TODO Auto-generated catch block\n\t\t\t }\n\t\t\t\t\n\t\t\t\t\n\t\t\treturn null;\n\t\t\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n }", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n //sendet die Bewertungsdaten an den SubmitRatingDataBaseHelper\n String hotelID = String.valueOf(request.getParameter(\"hotelID\"));\n String heading = String.valueOf(request.getParameter(\"heading\"));\n String comment = String.valueOf(request.getParameter(\"comment\"));\n String rating = String.valueOf(request.getParameter(\"rating\"));\n SubmitRatingDataBaseHelper dbHelper = new SubmitRatingDataBaseHelper();\n dbHelper.writeRatingToDB(hotelID, heading, comment, rating);\n processRequest(request, response);\n }", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }" ]
[ "0.81541044", "0.736202", "0.73320174", "0.6941278", "0.6876145", "0.6805731", "0.6755225", "0.6657722", "0.6648321", "0.6620163", "0.66176456", "0.65437615", "0.64658177", "0.6453178", "0.64459896", "0.644082", "0.634278", "0.6302323", "0.6295472", "0.6260375", "0.6241918", "0.62304974", "0.62083185", "0.61905", "0.6177437", "0.6133072", "0.6131215", "0.6111093", "0.60980874", "0.6097009", "0.6093111", "0.60909104", "0.6089218", "0.60799044", "0.6077046", "0.6070833", "0.60422707", "0.6030652", "0.60127586", "0.60117304", "0.60030633", "0.5971045", "0.59567237", "0.5945979", "0.58944297", "0.58922464", "0.5882439", "0.58782566", "0.5816442", "0.58063585", "0.5802532", "0.5794996", "0.57748914", "0.57738316", "0.5765357", "0.5748987", "0.5739103", "0.5734422", "0.5729718", "0.572573", "0.5725137", "0.5719519", "0.5718682", "0.5716309", "0.5708255", "0.5706015", "0.57057095", "0.5705089", "0.5690962", "0.5687858", "0.5684965", "0.568269", "0.5669", "0.5654397", "0.5652046", "0.56463826", "0.56444323", "0.5644076", "0.5639976", "0.56361955", "0.5634574", "0.56269735", "0.5619725", "0.5619125", "0.561879", "0.5612971", "0.5612192", "0.56112415", "0.5605884", "0.5595752", "0.559255", "0.55920917", "0.5591695", "0.5588422", "0.55874026", "0.55835915", "0.5581267", "0.5581267", "0.5581267", "0.55744755", "0.55699295" ]
0.0
-1
Sets the activity as a splash screen
public S<T> splash(int time,final String nextActivity){ new Handler().postDelayed(new Runnable() { @Override public void run() { to(nextActivity); activity.finish(); } }, time); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void onCreate(Bundle savedInstanceState) {\r\n super.onCreate(savedInstanceState);\r\n\r\n // Do not display title bar, this makes the splash screen really full screen\r\n requestWindowFeature(Window.FEATURE_NO_TITLE);\r\n \r\n // Check if we need to display the splash screen. If no, go directly to the main intent\r\n SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());\r\n boolean showscreen = prefs.getBoolean(\"showsplashscreen\", true);\r\n if (! showscreen) {\r\n \t gotoMainIntent();\r\n \t return;\r\n }\r\n \r\n\r\n // Set the layout\r\n setContentView(R.layout.splash);\r\n\r\n // This will run after a specified time (SPLASH_DISPLAY_LENGHT milliseconds)\r\n new Handler().postDelayed(new Runnable(){\r\n public void run() {\r\n \t gotoMainIntent();\r\n }\r\n }, SPLASH_DISPLAY_LENGHT);\r\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_splash);\n ButterKnife.inject(this);\n\n if(getResources().getBoolean(R.bool.isTablet)){\n lyMain.setBackgroundResource(R.drawable.ic_tablet_splash);\n }else {\n lyMain.setBackgroundResource(R.drawable.ic_smatphone_splash);\n }\n\n Thread timerThread = new Thread() {\n public void run() {\n try {\n sleep(3000);\n\n } catch (InterruptedException e) {\n e.printStackTrace();\n } finally {\n startActivity(new Intent(SplashActivity.this, ApplicationsGridActivity.class));\n }\n }\n };\n timerThread.start();\n\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n //TODO: add any code you want to do while the splash screen is showing before the MainActivity is shown\n\n// try {\n// Thread.sleep(5000);\n// } catch (InterruptedException e) {\n// e.printStackTrace();\n// }\n\n Intent intent = new Intent(this, MainActivity.class);\n startActivity(intent);\n finish();\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n makeActivityFullScreen();\n setContentView(R.layout.activity_splash);\n }", "@Override\n public void onCreate(Bundle savedInstanceState)\n {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.splash);\n\n }", "public void onCreate(Bundle bundle) {\n super.onCreate(bundle);\n requestWindowFeature(1);\n getWindow().setFlags(1024, 1024);\n setContentView(R.layout.activity_splash_screen);\n new Handler().postDelayed(new Runnable() {\n public void run() {\n SplashScreen.this.startActivity(new Intent(SplashScreen.this, MainActivity.class));\n SplashScreen.this.finish();\n }\n }, 3000);\n }", "void setSplashContentView() {\n// verifyUser = PreferenceHelper.isVerifyMail(getContext());\n // user is logged in app and is active.\n view.setSplashViewLayout(R.layout.activity_splash);\n\n }", "@Override\n public void onCreate(Bundle icicle) {\n super.onCreate(icicle);\n setContentView(R.layout.activity_splash_screen);\n\n intent = new Intent(this, MainActivity.class);\n\n\n new Handler().postDelayed(new Runnable(){\n @Override\n public void run() {\n\n //Start MainActivity\n startActivity(intent);\n finish();\n }\n }, SPLASH_DISPLAY_LENGTH);\n }", "private void showSplashScreen() {\n splashDialog = new SplashScreenDialog(this);\n splashDialog.show();\n }", "private void SplashScreen() {\n// if (!mSettings.getBoolean(\"PlayedBefore\", false)) {\n// mSolitaireView.DisplaySplash();\n// }\n splas.setVisibility(View.VISIBLE);\n Handler h = new Handler(Looper.getMainLooper());\n h.postDelayed(new Runnable() {\n @Override\n public void run() {\n splas.setVisibility(View.GONE);\n }\n }, 3000);\n }", "@Override\r\n public void onCreate(Bundle savedInstanceState) {\r\n super.onCreate(savedInstanceState);\r\n setContentView(R.layout.activity_splash_screen);\r\n StartAnimations();\r\n\r\n new Handler().postDelayed(new Runnable() {\r\n\r\n\r\n @Override\r\n public void run() {\r\n // This method will be executed once the timer is over\r\n Intent i = new Intent(SplashScreen.this, MainActivity.class);\r\n startActivity(i);\r\n finish();\r\n }\r\n }, 5000);\r\n }", "@Override \r\n public void onCreate(Bundle icicle) { \r\n super.onCreate(icicle);\r\n \r\n getWindow().setFormat(PixelFormat.RGBA_8888);\r\n getWindow().addFlags(WindowManager.LayoutParams.FLAG_DITHER);\r\n setContentView(R.layout.splash_activity);\r\n \r\n //Display the current version number \r\n PackageManager pm = getPackageManager(); \r\n try {\r\n \tPackageInfo pi = pm.getPackageInfo(\"org.mems\", 0);\r\n TextView versionNumber = (TextView) findViewById(R.id.versionNumber); \r\n versionNumber.setText(\"Version \" + pi.versionName); \r\n } catch (NameNotFoundException e) {\r\n e.printStackTrace();\r\n }\r\n \r\n new Handler().postDelayed(new Runnable() {\r\n public void run() { \r\n \tIntent mainIntent = new Intent(SplashActivity.this, MainActivity.class); \r\n \tSplashActivity.this.startActivity(mainIntent); \r\n \tSplashActivity.this.finish(); \r\n } \r\n }, 2000); //2000 for release \r\n }", "protected void displaySplashScreen() {\n\t\t// Creates new thread to act as timer.\n\t\tThread logoTimer = new Thread() {\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\n\t\t\t\t\tint logoTimer = 0;\n\t\t\t\t\t// Pauses for SPLASH_TIME amount of time\n\t\t\t\t\twhile (logoTimer < SPLASH_TIME) {\n\t\t\t\t\t\tsleep(100);\n\t\t\t\t\t\tlogoTimer = logoTimer + 100;\n\t\t\t\t\t}\n\t\t\t\t\t// Calls the activity from manifest.xml\n\t\t\t\t\tIntent intent = new Intent(getApplicationContext(),\n\t\t\t\t\t\t\tMenuActivity.class);\n\t\t\t\t\tintent.putExtra(\"connect\", connect);\n\t\t\t\t\tstartActivity(intent);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} finally {\n\t\t\t\t\tfinish();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Starts the thread.\n\t\tlogoTimer.start();\n\t}", "@Override\n public void onStart() {\n super.onStart();\n waitForSplashAnimation(SPLASH_SCREEN_DELAY);\n }", "@Override\n\t\t public void run() {\n\t\t \tsetContentView(R.layout.activity_splash);\n\t\t }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_splash_screen);\n Intent intent = new Intent(getApplicationContext(),InitialSetupActivity.class);\n startActivity(intent);\n finish();\n }", "@Override\n public void showSplash() {\n }", "private void launchHomeScreen(){\n\n prefManager.setFirstTimeLaunch(false);\n Intent i = new Intent(SplashActivity.this, MainActivity.class);\n startActivity(i);\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.splash);\n Thread timerThread = new Thread() {\n public void run() {\n try {\n sleep(3000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n } finally {\n if (user != null) {\n redireccionar();\n }else{\n Intent intent = new Intent(SplashScreen.this, Login.class);\n startActivity(intent);\n }\n\n }\n }\n };\n timerThread.start();\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n SplashScreen.show(this); // here\n super.onCreate(savedInstanceState);\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);\n }\n super.onCreate(savedInstanceState);\n setContentView(R.layout.helal_haram_splash);\n\n initViews();\n alphaAnimation(img);\n\n\n // splash efect kodu\n /* Thread timerThread = new Thread(){\n public void run(){\n try{\n sleep(1200);\n }catch(InterruptedException e){\n e.printStackTrace();\n }finally{\n\n Intent intent = new Intent(Splash.this, MainActivity.class);\n startActivity(intent);\n\n }\n }\n };\n timerThread.start();\n */\n }", "@Override\n public void onCreate(Bundle icicle) {\n super.onCreate(icicle);\n\t\t/* layout splashscreen dengan background gambar */\n setContentView(R.layout.activity_spalsh);\n\t/* handler untuk menjalankan splashscreen selama 5 detik lalu\n\t * membuat HomeActivity\n\t */\n new Handler().postDelayed(new Runnable() {\n @Override\n public void run() {\n Intent mainIntent = null;\n\n mainIntent = new Intent(SpalshActivity.this,\n HomeActivity.class);\n\n SpalshActivity.this.startActivity(mainIntent);\n SpalshActivity.this.finish();\n overridePendingTransition(R.layout.fadein,R.layout.fadeout);\n\n\n }\n }, SPLASH_DISPLAY_LENGHT);\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_splash__screen);\n\n\n Thread splashTread = new Thread() {\n @Override\n public void run() {\n try {\n int waited = 0;\n while (_active && (waited < _splashTime)) {\n sleep(3000);\n if (_active) {\n waited += 3000;\n }\n }\n } catch (Exception e) {\n\n } finally {\n\n startActivity(new Intent(Splash_Screen.this,\n MainActivity.class));\n finish();\n }\n };\n };\n splashTread.start();\n\n// Thread thread = new Thread(){\n//\n// @Override\n// public void run() {\n// try {\n// sleep(SPLASH_DISPLAY_LENGTH);\n// Intent intent = new Intent(getApplicationContext(),MainActivity.class);\n// startActivity(intent);\n// finish();\n// } catch (InterruptedException e) {\n// e.printStackTrace();\n// }\n// }\n// };\n//\n// thread.start();\n\n\n }", "public void run() {\n Intent i = new Intent(activity_splash.this, MainActivity.class);\r\n startActivity(i); // menghubungkan activity splashscren ke xml\r\n //jeda selesai Splashscreen\r\n this.finish();\r\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n SplashScreen.show(this);\n super.onCreate(savedInstanceState);\n }", "public void showSplashScreen(View view) {\n // start the splash screen to show information\n Intent intent = new Intent(LoginActivity.this, InformationActivity.class);\n startActivity(intent);\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_splash_screen);\n\n pref = getApplicationContext().getSharedPreferences(AppConstants.mypreference, Context.MODE_PRIVATE);\n\n\n // ************************** SCREEN DISPLAY FOR SOMETIMES ******************************************\n\n final int welcomeScreenDisplay = 1500;\n /** create a thread to show splash up to splash time */\n Thread welcomeThread = new Thread()\n {\n int wait = 0;\n\n @Override\n public void run()\n {\n try\n {\n super.run();\n /**\n * use while to get the splash time. Use sleep() to increase\n * the wait variable for every 100L.\n */\n while (wait < welcomeScreenDisplay)\n {\n sleep(100);\n wait += 100;\n }\n }\n catch (Exception e) {\n System.out.println(\"EXC=\" + e);\n }\n finally {\n /**\n * Called after splash times up. Do some action after splash\n * times up. Here we moved to another main activity class\n */\n String getStatus=pref.getString(AppConstants.IS_LOGIN, \"null\");\n if(getStatus.equals(\"true\"))\n {\n Intent i=new Intent(getApplicationContext(),WelcomeScreen.class);\n startActivity(i);\n finish();\n\n }else\n {\n //first time\n Intent i=new Intent(getApplicationContext(),LoginScreen.class);\n startActivity(i);\n finish();\n\n }\n\n }\n }\n };\n welcomeThread.start();\n\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.splash);\n\t\tMyThread myThread=new MyThread();\n\t myThread.start();\n\t}", "@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) {\r\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tgetWindow().requestFeature(Window.FEATURE_NO_TITLE);\r\n\r\n\t\t/** Making this activity, full screen */\r\n\t\tgetWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,\r\n\t\t\t\tWindowManager.LayoutParams.FLAG_FULLSCREEN);\r\n\t\tsetContentView(R.layout.activity_splashscreen);\r\n\t\tCountDown _tik;\r\n\t\t_tik = new CountDown(2000, 2000, this, MainActivity.class);// It delay the screen for 2.5 second and after that switch to YourNextActivity\r\n\t\t_tik.start();\r\n\r\n\t\tinitTypeface();\r\n\r\n\t}", "public void onCreate(Bundle savedInstanceState) {\n requestWindowFeature(Window.FEATURE_NO_TITLE);\n getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);\n\n super.onCreate(savedInstanceState);\n\n setContentView(R.layout.activity_home_page);\n\n setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);\n\n ActionBar actionBar = getSupportActionBar();\n if (actionBar != null) {\n actionBar.hide();\n }\n\n new Handler().postDelayed(new Runnable() {\n @Override\n public void run() {\n Intent startActivityIntent = new Intent(SplashActivity.this, HomePage.class);\n startActivity(startActivityIntent);\n SplashActivity.this.finish();\n }\n }\n , SPLASH_DISPLAY_LENGTH);\n }", "@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\n\t\tsuper.onCreate(savedInstanceState);\n\t\trequestWindowFeature(Window.FEATURE_NO_TITLE);\n\t\tgetWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,\n\t\t\t\tWindowManager.LayoutParams.FLAG_FULLSCREEN);\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.startup_splash);\n\n\t\t// graphics = (SplashView) findViewById(R.id.graphics);\n\t\tsplash = (ImageView) findViewById(R.id.splashImage);\n\t\trootSet = getAnimation();\n\n\t\tThread splashTread = new Thread() {\n\n\t\t\tpublic void run() {\n\n\t\t\t\tsplash.startAnimation(rootSet);\n\n\t\t\t\ttry {\n\t\t\t\t\tString[] keys = new String[] {};\n\t\t\t\t\tString[] values = new String[] {};\n\t\t\t\t\tString pagedata = Util.convertToString(HTTPUtil.performGET(\n\t\t\t\t\t\t\tConstants.baseUrl, keys, values));\n\n\t\t\t\t\tJSONObject pageData = new JSONObject(pagedata);\n\n\t\t\t\t\tString imgUrl = pageData.getString(\"picture\");\n\n\t\t\t\t\tConstants.profilePicture = UiUtil.loadImageFromURL(imgUrl);\n\t\t\t\t\tString feed = Util.convertToString(HTTPUtil.performGET(\n\t\t\t\t\t\t\tConstants.feedsUrl, keys, values));\n\t\t\t\t\tIntent intent = new Intent(StartupActivity.this,\n\t\t\t\t\t\t\tPostsActivity.class);\n\t\t\t\t\tintent.putExtra(\"feed\", feed);\n\t\t\t\t\tstartActivity(intent);\n\n\t\t\t\t} catch (Exception e) {\n\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t\tfinish();\n\n\t\t\t\treturn;\n\n\t\t\t}\n\t\t};\n\t\tsplashTread.start();\n\n\t}", "public SplashScreen() {\r\n instance = this;\r\n\r\n width = 600;\r\n height = 600;\r\n\r\n icon = \"graphics/application/icon_96.png\";\r\n }", "public ScreenSplash() {\n initComponents();\n this.setCursor(new Cursor(HAND_CURSOR));\n setBackground(new Color(0, 0, 0, 0));\n }", "@Override\n public void onCreate(Bundle icicle) {\n super.onCreate(icicle);\n setContentView(R.layout.splashscreen);\n ((LinearLayout)findViewById(R.id.bgsplashid)).setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n Intent mainIntent = new Intent(splash.this,firstAct.class);\n isClicked = true;\n splash.this.startActivity(mainIntent);\n splash.this.finish();\n }\n });\n\n /* New Handler to start the Menu-Activity\n * and close this Splash-Screen after some seconds.*/\n new Handler().postDelayed(new Runnable(){\n @Override\n public void run() {\n /* Create an Intent that will start the Menu-Activity. */\n if(!isClicked) {\n Intent mainIntent = new Intent(splash.this, firstAct.class);\n splash.this.startActivity(mainIntent);\n splash.this.finish();\n }\n }\n }, SPLASH_DISPLAY_LENGTH);\n }", "public void showSplashScreen() {\r\n\r\n JPanel content = (JPanel) getContentPane();\r\n content.setBackground(Color.white);\r\n\r\n // setting the window's properties\r\n \r\n int width = 700;\r\n int height = 438;\r\n Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();\r\n int x = (screen.width - width) / 2;\r\n int y = (screen.height - height) / 2;\r\n setBounds(x, y, width, height);\r\n\r\n // build the splash screen using an image \r\n \r\n JLabel gifImage = new JLabel(new ImageIcon(this.getClass().getResource(\"/splash.gif\")));\r\n content.add(gifImage, BorderLayout.CENTER);\r\n\r\n // display it\r\n setVisible(true);\r\n\r\n new resourceLoader().execute();\r\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.splash);\n UserInfoData entry = new UserInfoData(this);\n \t\n \tentry.open();\n \t\n \tfinal String data = entry.getData();\n \t\n \tentry.close();\n Thread splashTimer = new Thread(){\n \tpublic void run(){\n \t\ttry{\n \t\t\tsleep(3000);\n \t\t\t\n \t}\n \t\tcatch(InterruptedException e){\n \t\t\t\n \t\t\te.printStackTrace();\n \t\t}\n finally{\n \tif (!data.equals(\"\")){\n \t\t\tstartActivity(new Intent (\"com.JacobyApps.android.mainMenu\")); \n \t}\n \t\telse{\n \n startActivity(new Intent (\"android.intent.action.Signup\"));\n \t}\n \tfinish();\n \t \n }\n \t \n \t}\n \t\n };\n splashTimer.start();\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n new AddressBookPresenter(this);\n // 去掉标题\n requestWindowFeature(Window.FEATURE_NO_TITLE);\n setContentView(R.layout.act_splash_screen);\n // 闪屏核心代码\n new Handler().postDelayed(new Runnable() {\n\n @Override\n public void run() {\n // TODO Auto-generated method stub\n if (LinphoneManager.getCore().getProxyConfigList().length > 0)\n {\n return;\n }\n Intent intent = new Intent(ActSplashScreen.this,\n LoginPhoneActivity.class);\n // 从启动动画切换到主界面\n startActivity(intent);\n ActSplashScreen.this.finish();// 结束动画\n }\n }, 3000);\n }", "@Override\r\n\t\t public void run() {\n\t\t Intent i = new Intent(SplashScreen.this, MainMenuActivity.class);\r\n\t\t startActivity(i);\r\n\t\t \r\n\t\t //Menyelesaikan Splashscreen\r\n\t\t finish();\r\n\t\t }", "@Override\n public void onCreate(Bundle bundle) {\n super.onCreate(bundle);\n //Assign the splashscreen_activity_main layout to the SplashScreenActivity\n setContentView(R.layout.splashscreen_activity_main);\n\n /* New Handler to start the Menu-Activity\n * and close this Splash-Screen after some seconds.*/\n new Handler().postDelayed(new Runnable() {\n @Override\n public void run() {\n /* Create an Intent that will start the Menu-Activity. */\n Intent mainIntent = new Intent(SplashscreenActivity.this, MainActivity.class);\n SplashscreenActivity.this.startActivity(mainIntent);\n //We call finish() function to prevent user to come back to splashScreen\n SplashscreenActivity.this.finish();\n }\n }, SPLASH_DISPLAY_LENGTH);\n }", "@Override\n public void run() {\n SplashScreen.this.runOnUiThread(new Runnable() {\n @Override\n public void run() {\n startActivity(new Intent(SplashScreen.this,MainActivity.class));\n finish();\n\n }\n });\n }", "@Override\n public void onCreate(Bundle savedInstanceState)\n {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_splash_screen);\n\n SharedPreferences sp = getSharedPreferences(FrozenBubble.PREFS_NAME,\n Context.MODE_PRIVATE);\n boolean showSplashScreen = sp.getBoolean(\"showSplashScreen\", true);\n if ( showSplashScreen )\n {\n SharedPreferences.Editor editor = sp.edit();\n editor.putBoolean(\"showSplashScreen\", false);\n editor.commit();\n }\n else\n {\n startFrozenBubble();\n return;\n }\n\n // thread for displaying the SplashScreen\n splashThread = new Thread()\n {\n @Override\n public void run()\n {\n try\n {\n synchronized(this)\n {\n //\n // TODO: The splash screen waits before launching\n // the game activity. Change this so that\n // the game activity is started immediately,\n // and notifies the splash screen activity\n // when it is done loading saved state data\n // and preferences, so the splash screen\n // functions as a distraction from game\n // loading latency.\n //\n //\n wait(_splashTime); //wait 3 seconds\n }\n } catch(InterruptedException e) {}\n finally\n {\n startFrozenBubble();\n }\n }\n };\n\n splashThread.start();\n }", "@Override\n public void onCreate(final Bundle icicle) {\n super.onCreate(icicle);\n setContentView(R.layout.splash_screen);\n\n /* New Handler to start the Menu-Activity\n * and close this Splash-Screen after some seconds.*/\n new Handler().postDelayed(() -> {\n Intent mainIntent = new Intent(SplashScreen.this, MainActivity.class);\n SplashScreen.this.startActivity(mainIntent);\n SplashScreen.this.finish();\n }, SPLASH_DISPLAY_SECONDS * 1000);\n }", "private void showSplash() {\n \t\tthis.splashInfoContainer.setVisibility( View.VISIBLE );\n \t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n\n SplashScreenBuilder.getInstance(this)\n .setVideo(R.raw.splash_animation)\n .setImage(R.drawable.app_icon)\n .enableSkipOnTap(false)\n .show();\n\n Button restart_app = findViewById(R.id.restart_app);\n restart_app.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n // Restart app\n Intent i = getBaseContext().getPackageManager().getLaunchIntentForPackage(getBaseContext().getPackageName());\n i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(i);\n overridePendingTransition(0, 0);\n finish();\n }\n });\n }", "@Override\n public void onCreate(Bundle icicle) {\n super.onCreate(icicle);\n setContentView(R.layout.sample);\n\n splash = findViewById(R.id.splashscreen);\n\n splash.startAnimation(\n AnimationUtils.loadAnimation(this, R.anim.rotation) );\n\n /* New Handler to start the Menu-Activity\n * and close this Splash-Screen after some seconds.*/\n new Handler().postDelayed(new Runnable(){\n @Override\n public void run() {\n /* Create an Intent that will start the Menu-Activity. */\n Intent mainIntent = new Intent(Sample.this,WebviewActivity.class);\n Sample.this.startActivity(mainIntent);\n Sample.this.finish();\n }\n }, SPLASH_DISPLAY_LENGTH);\n }", "@Override\r\n protected void onCreate(Bundle savedInstanceState) {\r\n super.onCreate(savedInstanceState);\r\n setContentView(R.layout.activity_splash);\r\n\r\n new Handler().postDelayed(new Runnable(){\r\n @Override\r\n public void run() {\r\n\r\n //check whether user has already logged in\r\n SharedPreferences pref = getSharedPreferences(\"ActivityPREF\", Context.MODE_PRIVATE);\r\n\r\n //if user has logged in\r\n if (pref.getBoolean(\"activity_executed\", false)) {\r\n\r\n String bus_or_pas = pref.getString(\"bus_or_passenger\",\"bus\");\r\n\r\n switch (bus_or_pas){\r\n //if user has logged as a bus\r\n case(\"bus\"):{\r\n Intent intent = new Intent(SplashActivity.this, BusMapsActivity.class);\r\n startActivity(intent);\r\n finish();\r\n\r\n break;\r\n }\r\n\r\n //if user has logged as passenger\r\n case (\"passenger\"):{\r\n Intent intent = new Intent(SplashActivity.this, NavDrawerActivity.class);\r\n startActivity(intent);\r\n finish();\r\n\r\n break;\r\n }\r\n }\r\n\r\n //if user hasn't logged in\r\n } else {\r\n Intent intent = new Intent(SplashActivity.this, MainActivity.class);\r\n startActivity(intent);\r\n finish();\r\n }\r\n\r\n\r\n }\r\n },SPLASH_TIME_OUT);\r\n\r\n\r\n\r\n }", "@Override\r\n public void run() {\n Intent i = new Intent(SplashScreen.this, MainActivity.class);\r\n startActivity(i);\r\n finish();\r\n }", "private void splashScreen() {\r\n\t\t// Clear the screen, reset the level, and display the legend\r\n\t\tclear();\r\n\t\tdisplay.setLegend(\"Asteroids\");\r\n\r\n\t\t// Place four asteroids near the corners of the screen.\r\n\t\tplaceAsteroids();\r\n\t}", "public void splash(){\n ImageView splash = (ImageView) findViewById(R.id.mekslogo);\n Animation animation1 =\n AnimationUtils.loadAnimation(getApplicationContext(),\n R.anim.clockwise);\n animation1.setDuration(5000);\n splash.startAnimation(animation1);\n animation1.setAnimationListener(new Animation.AnimationListener() {\n @Override\n public void onAnimationStart(Animation animation) {\n\n }\n\n @Override\n public void onAnimationEnd(Animation animation) {\n // Toast.makeText(getApplicationContext(),\"Animation ended\",Toast.LENGTH_SHORT).show();\n Intent intent=new Intent(MainActivity.this, sign_up.class);\n startActivity(intent);\n }\n\n @Override\n public void onAnimationRepeat(Animation animation) {\n\n }\n });\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n this.requestWindowFeature(Window.FEATURE_NO_TITLE);\n setContentView(R.layout.activity_splash);\n\n initView();\n initPoint();\n mHandler = new AutoHandler(this);\n }", "@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.splash);\n\n\t\tRunnable showMain = new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tIntent intent = new Intent(SplashActivity.this, KeepErAppyActivity.class);\n\t\t\t\tstartActivity(intent);\n\t\t\t\tLog.i(Util.TAG, \"SplashActivity.onCreate.run\");\n\t\t\t}\n\t\t};\n\n\t\tView vw = findViewById(R.id.big_beer);\n\t\tvw.postDelayed(showMain, 1000);\n\t\tLog.i(Util.TAG, \"SplashActivity.onCreate\");\n\t}", "public void run() {\n Intent mainIntent = new Intent(SplashActivity.this, MainActivity.class);\n startActivity(mainIntent);\n finish();\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.activity_splash_screen);\n\t\tnm1 = (NotificationManager)getSystemService(NOTIFICATION_SERVICE); //Declaracion de notificacion\n\t\t\n\t\tTimerTask task = new TimerTask(){\n\t\t @Override\n\t public void run() {\n\t Intent mainIntent = new Intent().setClass(SplashScreen.this, MainActivity.class);\n\t startActivity(mainIntent);\n\t finish();//Destrucion de la actividad, usuario no tendra oportunidad de verla hasta reiniciar\n\t }\t\t\n\t};\n\tTimer timer = new Timer();\n\ttimer.schedule(task, splashDelay); //Pasando los 6 segundos entramos a la tarea en si\n\tnoti1();\n\t}", "@Override\n public void run() {\n Intent i = new Intent(SplashScreenActivity.this, MainActivity.class);\n startActivity(i);\n finish();\n }", "@Override\n public void run() {\n startActivity(new Intent(SplashActivity.this, MainActivity3.class));\n //Close the current welcome page after the jump\n SplashActivity.this.finish();\n }", "public void run(){\r\n try{\r\n \tsleep(DURACION_SPLASH);\r\n }catch(InterruptedException e){\r\n //Si no puedo ejecutar el sleep muestro el error\r\n e.printStackTrace();\r\n }finally{\r\n //Llamo a la nueva actividad\r\n Intent intent = new Intent(SplashScreenActivity.this, MainActivity.class);\r\n \tstartActivity(intent);\r\n \tfinish();\r\n } \r\n }", "@Override\n public void run() {\n Intent i = new Intent(Splash.this, MainActivity.class);\n startActivity(i);\n finish();\n }", "@Override\n public void run() {\n Intent intent = new Intent(SplashScreenActivity.this, MainActivity.class);\n startActivity(intent);\n finish();\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n\n super.onCreate(savedInstanceState);\n // Hide Navigation and Status Bar\n View decorView = getWindow().getDecorView();\n\n // Set layout\n setContentView(R.layout.activity_splash);\n\n int uiOptions;\n // Not displaying the status bar is only supported in SDK >= 16\n if (Build.VERSION.SDK_INT >= 16) {\n uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_FULLSCREEN;\n } else {\n uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;\n }\n decorView.setSystemUiVisibility(uiOptions);\n\n Thread checkPermissions = new Thread() {\n // Request necessary permissions\n\n @RequiresApi(api = Build.VERSION_CODES.M)\n @Override\n public void run() {\n super.run();\n if (checkSelfPermission(Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED\n || checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED\n || checkSelfPermission(Manifest.permission.INTERNET) != PackageManager.PERMISSION_GRANTED) {\n requestPermissions(PERMISSIONS_NEEDED, PERMISSION_CODE);\n } else {\n try {\n TimeUnit.SECONDS.sleep(SECONDS_TO_WAIT);\n } catch (InterruptedException e) {\n e.printStackTrace();\n } finally {\n Intent redirect = new Intent(SplashActivity.this, MainActivity.class);\n startActivity(redirect);\n }\n }\n }\n };\n checkPermissions.start();\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\trequestWindowFeature(Window.FEATURE_NO_TITLE);\n\t\tgetWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,\n\t\t\t\tWindowManager.LayoutParams.FLAG_FULLSCREEN);\n\n\t\tsetContentView(R.layout.activity_splash);\n\n\t\tcd = new ConnectionDetector(SplashActivity.this);\n\n\t\tloginPreferences = getSharedPreferences(\"Login\", Context.MODE_PRIVATE);\n\n\t\tSystem.out.println(\"!! \" + loginPreferences.getString(\"Remember\", \"\"));\n\n\t\tnew Handler().postDelayed(new Runnable() {\n\n\t\t\t@Override\n\t\t\tpublic void run() {\n\n\t\t\t\ttry {\n\n\t\t\t\t\tif (cd.isConnectingToInternet()) {\n\n\t\t\t\t\t\tif (loginPreferences.getString(\"Remember\", \"\").equals(\n\t\t\t\t\t\t\t\t\"remember\")) {\n\n\t\t\t\t\t\t\tAppConfig.loginDataType = new LoginDataType(loginPreferences.getString(\"UserId\", \"\"),\n\t\t\t\t\t\t\t\t\tloginPreferences.getString(\"Username\", \"\"), loginPreferences.getString(\"Password\", \"\"));\n\t\t\t\t\t\t\tIntent intent = new Intent(SplashActivity.this,\n\t\t\t\t\t\t\t\t\tLandScreenActivity.class);\n\t\t\t\t\t\t\tstartActivity(intent);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tIntent intent = new Intent(SplashActivity.this,\n\t\t\t\t\t\t\t\t\tLoginActivity.class);\n\t\t\t\t\t\t\tstartActivity(intent);\n\t\t\t\t\t\t\tfinish();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tToast.makeText(getApplicationContext(),\n\t\t\t\t\t\t\t\t\"No Internet Connection\", Toast.LENGTH_LONG)\n\t\t\t\t\t\t\t\t.show();\n\t\t\t\t\t}\n\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t}\n\t\t}, 2000);\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n requestWindowFeature(Window.FEATURE_NO_TITLE);\n super.onCreate(savedInstanceState);\n getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);\n GLSurfaceView view = new GLSurfaceView(this);\n view.setEGLConfigChooser(8, 8, 8, 8, 16, 0); //Transparent background\n view.getHolder().setFormat(PixelFormat.TRANSLUCENT); //Transparent background\n view.setRenderer(new OpenGLRenderer(this));\n setContentView(view);\n //Transition to Landing screen\n new Handler().postDelayed(new Runnable() {\n\n @Override\n public void run() {\n // This app main activity\n Intent i = new Intent(SplashActivity.this, SearchActivity.class);\n startActivity(i);\n finish();\n }\n }, SPLASH_TIME_OUT);\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);\n setContentView(R.layout.splash);\n//\n// if (Build.VERSION.SDK_INT >= 23) {\n// checkPermissions( Manifest.permission.READ_PHONE_STATE);\n// } else\n StartApp();\n }", "@Override\n public void run() {\n Intent mainIntent = new Intent().setClass(\n SplashScreenActivity.this, MainActivity.class);\n startActivity(mainIntent);\n \n // Close the activity so the user won't able to go back this\n // activity pressing Back button\n finish();\n }", "@Override\n\tpublic Screen getStartScreen() {\n\t\treturn new Splash(this);\n\t}", "@Override\n public void run() {\n Intent intent = new Intent(SplashActivity.this, MainActivity.class);\n startActivity(intent);\n finish();\n }", "@Override\n public void run() {\n Intent mainIntent = new Intent(SplashscreenActivity.this, MainActivity.class);\n SplashscreenActivity.this.startActivity(mainIntent);\n //We call finish() function to prevent user to come back to splashScreen\n SplashscreenActivity.this.finish();\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.splash);\n \n mp = MediaPlayer.create(this, R.raw.love_story);\n mp.start();\n \n Thread logoTimer = new Thread(){\n \tpublic void run(){\n \t\ttry{\n \t\t\tint logoTimer = 0;\n \t\t\twhile(logoTimer<5000){\n \t\t\t\tsleep(100);\n \t\t\t\tlogoTimer = logoTimer +100;\n \t\t\t}\n \t\t\tstartActivity(new Intent(\"com.crognar.CLEARSCREEN\"));\n \t\t\t//clearscreen mag anders\n \t\t} \n \t\t\n \t\tcatch (InterruptedException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n \t\t\n \t\tfinally{\n \t\t\tfinish();\n \t\t}\n \t}\n };\n logoTimer.start();\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.splash_act);\n\n\t\tif (Build.VERSION.SDK_INT >= 11) {\n\t\t\tStrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()\n\t\t\t\t\t.detectDiskReads().detectDiskWrites().detectNetwork()\n\t\t\t\t\t.penaltyLog().build());\n\t\t\tStrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()\n\t\t\t\t\t.detectLeakedSqlLiteObjects().detectLeakedClosableObjects()\n\t\t\t\t\t.penaltyLog().penaltyDeath().build());\n\t\t}\n\n\t\tspl_rl = (RelativeLayout) this.findViewById(R.id.spl_rl);\n\n\t\tAlphaAnimation aa = new AlphaAnimation(0.5f, 1.0f);\n\t\taa.setDuration(2000);\n\t\tspl_rl.startAnimation(aa);\n\t\tnew Thread() {\n\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tsuper.run();\n\t\t\t\ttry {\n\t\t\t\t\tsleep(2000);\n\t\t\t\t\tloadMainUI();\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\n\t\t}.start();\n\n\t}", "@Override\n public void run() {\n Intent mainIntent = new Intent(SplashActivity.this, MainActivity.class);\n startActivity(mainIntent);\n finish();\n }", "@Override\n public void run() {\n // This method will be executed once the timer is over\n // Start your app main activity\n Intent i = new Intent(SplashScreen.this, MainActivity.class);\n startActivity(i);\n\n // close this activity\n finish();\n }", "private void goToMainScreen() {\n new Handler().postDelayed(new Runnable() {\n @Override\n public void run() {\n Intent mainIntent;\n\n MainActivity act = new MainActivity();\n Intent intent = new Intent(getApplication(), MainActivity.class);\n startActivity(intent);\n finish();\n }\n }, SPLASH_DISPLAY_LENGHT);\n }", "private void initializeSplashScreenCycle()\n\t{\n\t\t// desabilitando os botoes antes de iniciar a animacao da splash screen:\n\t\tUtilidades.Views.disableViews(this.arrViewsBloqueaveis);\n\n\t\tAnimation animLayoutSplitLogo = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.splash_move);\n\t\tAnimation animLayoutContent = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.splash_fade_in);\n\n\t\tanimLayoutContent.setAnimationListener(new AnimationListener()\n\t\t{\n\t\t\t@Override\n\t\t\tpublic void onAnimationStart(Animation animation)\n\t\t\t{\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onAnimationRepeat(Animation animation)\n\t\t\t{\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onAnimationEnd(Animation animation)\n\t\t\t{\n\t\t\t\t// rehabilitando os botoes depois de finalizar a animacao da splash screen:\n\t\t\t\tUtilidades.Views.enableViews(arrViewsBloqueaveis);\n\t\t\t}\n\t\t});\n\n\t\t((RelativeLayout) findViewById(R.id.layout_split_logo)).startAnimation(animLayoutSplitLogo);\n\t\t((RelativeLayout) findViewById(R.id.layout_content)).startAnimation(animLayoutContent);\n\t}", "private void setupSplash() {\n \t\tthis.splashInfoContainer = (LinearLayout) this.findViewById( R.id.edit_gpsfilter_area_splash );\n \n \t\tTextView textView = (TextView) this.splashInfoContainer.findViewById( R.id.edit_gpsfilter_area_splash_text );\n \t\ttextView.setText( Html.fromHtml( this.getString( R.string.edit_gpsfilter_area_splash_text ) ) );\n \n \t\t// Define fade out animation.\n \t\tthis.splashFadeOut = new AlphaAnimation( 1.00f, 0.00f );\n \t\tthis.splashFadeOut.setDuration( SPLASH_FADE_DELAY );\n \t\tthis.splashFadeOut.setAnimationListener( new AnimationListener() {\n \t\t\tpublic void onAnimationStart( Animation animation ) {\n \t\t\t}\n \n \t\t\tpublic void onAnimationRepeat( Animation animation ) {\n \t\t\t}\n \n \t\t\tpublic void onAnimationEnd( Animation animation ) {\n \t\t\t\tsplashInfoContainer.setVisibility( View.GONE );\n \t\t\t}\n \t\t} );\n \n \t\t// Don't show if not new and we got polygon.\n \t\tif ( !this.isConsideredFresh() ) {\n \t\t\tthis.splashInfoContainer.setVisibility( View.GONE );\n \t\t}\n \t}", "@Override\n public void onCreate(Bundle icicle) {\n super.onCreate(icicle);\n setContentView(R.layout.activity_splash);\n bundle=new Bundle();\n final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);\n try{\n Log.v(\"_dan\",preferences.getAll().toString());\n\n registered = preferences.getBoolean(\"registered\", false);\n profileName = preferences.getString(\"profileName\", \"\");\n loginMethod = preferences.getString(\"loginMethod\", \"\");\n bundle.putBoolean(\"registered\", registered);\n bundle.putString(\"loginMethod\", loginMethod);\n bundle.putString(\"profileName\", profileName);\n i = new Intent(SplashActivity.this, MainActivity.class);\n i.putExtra(\"bundle\",bundle);\n }catch (Exception e){\n e.printStackTrace();\n }\n\n if(registered.equals(false)||profileName.isEmpty()||profileName.equals(\"\")||loginMethod.isEmpty()||loginMethod.equals(\"\")){\n i = new Intent(SplashActivity.this, RegisterActivity.class);\n }\n\n /* New Handler to start the Menu-Activity\n * and close this Splash-Screen after some seconds.*/\n new Handler().postDelayed(new Runnable(){\n @Override\n public void run() {\n /* Create an Intent that will start the Menu-Activity. */\n// Intent mainIntent = new Intent(SplashActivity.this,MainActivity.class);\n startActivity(i);\n SplashActivity.this.finish();\n }\n }, SPLASH_DISPLAY_LENGTH);\n }", "void inject(SplashActivity activity);", "@Override\n public void run() {\n Intent mainIntent = new Intent(StartSplash.this, SplashActivity.class);\n StartSplash.this.startActivity(mainIntent);\n StartSplash.this.finish();\n }", "@Override // org.apache.cordova.CordovaPlugin\n public void pluginInitialize() {\n if (!HAS_BUILT_IN_SPLASH_SCREEN) {\n this.cordova.getActivity().runOnUiThread(new Runnable() {\n /* class org.apache.cordova.splashscreen.SplashScreen.AnonymousClass1 */\n\n public void run() {\n SplashScreen.this.getView().setVisibility(4);\n }\n });\n getSplashId();\n this.orientation = this.cordova.getActivity().getResources().getConfiguration().orientation;\n if (firstShow) {\n showSplashScreen(this.preferences.getBoolean(\"AutoHideSplashScreen\", true));\n }\n if (this.preferences.getBoolean(\"SplashShowOnlyFirstTime\", true)) {\n firstShow = false;\n }\n }\n }", "@Override\n public void run() {\n Intent i = new Intent(activity_splash.this, login_activity.class);\n startActivity(i);\n finish();\n }", "@Override\n public void run() {\n Intent intent = new Intent(SplashScreen.this, Welcome.class);\n startActivity(intent);\n finish();\n }", "public void openActivity(){\n Intent intent = new Intent();\n if(bopenLogin)\n {\n intent = new Intent(Splashscreen.this, Login.class);\n }\n else\n {\n intent = new Intent(Splashscreen.this, MainActivity.class);\n }\n startActivity(intent);\n finish();\n }", "@Override\n public void run() {\n // This method will be executed once the timer is over\n // Start your app main activity\n Intent i = new Intent(SplashScreen.this, LoginScreen.class);\n i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(i);\n\n // close this activity\n finish();\n }", "@Override\n\t\tpublic void run() {\n\t\t\ttry {\n\t\t\t\tThread.sleep(3000);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tIntent it=new Intent(Splash.this,DashboardActivity.class);\n\t\t\tstartActivity(it);\n\t\t\tfinish();\n\t\t}", "@Override\n public void run() {\n\n Intent starthome = new Intent(SplashScreenActivity.this, WelcomeActivity.class);\n starthome.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n startActivity(starthome);\n\n finish();\n }", "@Override\r\n public void run() {\r\n // This method will be executed once the timer is over\r\n // Start your app main activity\r\n Intent i = new Intent(SplashScreen.this, MainActivity.class);\r\n startActivity(i);\r\n\r\n // close this activity\r\n finish();\r\n }", "public SplashScreen getSplashScreen() {\n if (splashScreen == null) {//GEN-END:|26-getter|0|26-preInit\n // write pre-init user code here\n splashScreen = new SplashScreen(getDisplay());//GEN-BEGIN:|26-getter|1|26-postInit\n splashScreen.setTitle(\"splashScreen\");\n splashScreen.setCommandListener(this);\n splashScreen.setText(\"Who is Java`s mascote?\");//GEN-END:|26-getter|1|26-postInit\n // write post-init user code here\n }//GEN-BEGIN:|26-getter|2|\n return splashScreen;\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.main);\n setIntegerProperty(\"loadUrlTimeoutValue\", 30000);\n super.loadUrl(\"file:///android_asset/www/index.html\");\n setIntegerProperty(\"splashscreen\", R.drawable.splashscreen);\n }", "@Override\r\n public void onCreate(Bundle savedInstanceState) {\r\n\r\n super.onCreate(savedInstanceState);\r\n\r\n Context context = this.getApplicationContext();\r\n\r\n requestWindowFeature(Window.FEATURE_NO_TITLE);\r\n getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);\r\n\r\n SplashHandler mHandler = new SplashHandler();\r\n final int layoutId = ResourceUtil.getLayoutResourceIdFromName(context, Colorme.LAYOUT_COLORME_AIYOUXI_SPLASH);\r\n setContentView(layoutId);\r\n\r\n final int viewId = ResourceUtil.getIdResourceIdFromName(context, Colorme.ID_COLORME_AIYOUXI_DRAWABLE);\r\n View view = findViewById(viewId);\r\n\r\n int what = 0;\r\n// Intent intent = this.getIntent();\r\n// if (intent != null) {\r\n// Bundle bundle = intent.getExtras();\r\n// if (bundle != null) {\r\n// String type = bundle.getString(KEY_TYPE);\r\n// if (VALUE_JYZA.equals(type)) {\r\n// final int bgId = ResourceUtil.getDrawableResourceIdFromName(context, Colorme.DRAWABLE_COLORME_JYZA);\r\n// view.setBackgroundResource(bgId);\r\n// what = 1;\r\n// }\r\n// }\r\n// }\r\n if (what == 0) {\r\n final int bgId = ResourceUtil.getDrawableResourceIdFromName(context, Colorme.DRAWABLE_COLORME_AIYOUXI);\r\n view.setBackgroundResource(bgId);\r\n }\r\n\r\n Message msg = new Message();\r\n msg.what = what;\r\n mHandler.sendMessageDelayed(msg, 3000);\r\n }", "private static void splashScreen() {\n\t\t\n\t\tString message = \"Welcome to JProject v\"+VERSION+\"\\nby Gabriel Skoropada\";\n\t\t\n\t\tJOptionPane.showMessageDialog(null, message, \"JProject v\"+VERSION, JOptionPane.NO_OPTION, null);\n\t\t\n\t}", "@Override\r\n public void run() {\r\n Intent i = new Intent(SplashScreen.this, TelaLogin.class);\r\n startActivity(i);\r\n finish();\r\n }", "public void goBackToSplash(View view) {\n startActivity(new Intent(view.getContext(), SplashScreenActivity.class));\n finish();\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n ImageView image = (ImageView)findViewById(R.id.logo);//logo image\n Animation animation1 =\n AnimationUtils.loadAnimation(getApplicationContext(), R.anim.side_slide); //animation\n image.startAnimation(animation1);\n TextView t = (TextView) findViewById(R.id.textView2);\n t.startAnimation(animation1);\n new Handler().postDelayed(new Runnable() {\n @Override\n public void run() {\n\n Intent mySuperIntent = new Intent(MainActivity.this, Main2Activity.class);//link to main activity 2\n startActivity(mySuperIntent);\n finish();\n }\n }, SPLASH_TIME);\n }", "@Override\n public void run() {\n Intent splashScreen=new Intent(SplashScreen.this,Donor.class);\n startActivity(splashScreen);\n finish();\n }", "public frmSplashScreen() {\n initComponents();\n this.setLocationRelativeTo(null);\n timer.start();\n }", "public Splash() {\n initComponents();\n }", "public Splash() {\n initComponents();\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.logo_show);\n\t\tnew Thread(new Runnable() { \n @Override\n public void run() {\n // TODO Auto-generated method stub\n try {\n Thread.sleep(2000);\n Intent i = new Intent(ScreenLogo.this, MusicProject.class);\n startActivity(i);\n ScreenLogo.this.finish();\n //handler.sendMessage(handler.obtainMessage(1));\n } catch (InterruptedException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }\n }).start();\n\t}", "private static void hideSplashScreen() {\n if (splash != null) {\n splash.dispose();\n splash = null;\n }\n }", "@Override\n public void run() {\n Picasso.with(SplashActivity.this).load(mSplashInfo.getImageUri())\n .into(mStartupImageView);\n mImageSrcTextView.setText(mSplashInfo.getImageSrcInfo());\n // start the animation\n mStartupImageView.startAnimation(mAnimationZoomIn);\n new Handler().postDelayed(new Runnable() {\n @Override\n public void run() {\n mStartupImageView.startAnimation(mAnimationFadeOut);\n new Handler().postDelayed(new Runnable() {\n @Override\n public void run() {\n Intent intent = new Intent(SplashActivity.this, MainActivity.class);\n //Add Flags to prevent BACK touch to a wrong activity\n intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);\n startActivity(intent);\n }\n }, 500);\n }\n }, 3000);\n }", "@Override\r\n public void run() {\n if (preferences.getBoolean(\"isMain\",false))\r\n {\r\n startActivity(new Intent(SplashScreen.this,MainActivity.class));\r\n finish();\r\n }else {\r\n editor.putBoolean(\"isMain\",true);\r\n editor.apply();\r\n\r\n TaskStackBuilder.create(SplashScreen.this)\r\n .addNextIntentWithParentStack(new Intent(SplashScreen.this,MainActivity.class))\r\n .addNextIntent(new Intent(SplashScreen.this,IntroActivity.class))\r\n .startActivities();\r\n }\r\n }", "@Override\n\t\t\t\t\tpublic boolean act(float delta) {\n\t\t\t\t\t\tchangeScreen(SplashScreen.class);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}" ]
[ "0.7772549", "0.7676799", "0.765266", "0.7488856", "0.74176896", "0.7372239", "0.736463", "0.7338751", "0.7282575", "0.7237235", "0.7235096", "0.7183307", "0.71812344", "0.717216", "0.7154707", "0.71415573", "0.713526", "0.711825", "0.71164566", "0.70977354", "0.7062995", "0.7057697", "0.70352095", "0.6975085", "0.6954012", "0.6935364", "0.6925591", "0.6861504", "0.6843469", "0.68422073", "0.6837349", "0.68369013", "0.68265456", "0.681231", "0.6784325", "0.6774405", "0.6767441", "0.6754685", "0.67440903", "0.6727762", "0.67276436", "0.6718264", "0.6673745", "0.6629633", "0.659183", "0.65759265", "0.65696937", "0.65648067", "0.6561814", "0.656047", "0.65571344", "0.6550223", "0.65434027", "0.65425134", "0.65285695", "0.6508335", "0.6508297", "0.650733", "0.65045184", "0.6504303", "0.6478408", "0.6477618", "0.6473798", "0.64559317", "0.64458483", "0.6444782", "0.6438242", "0.6410429", "0.638923", "0.63837427", "0.6378508", "0.6371506", "0.6364183", "0.6363191", "0.635606", "0.63464344", "0.63442534", "0.6329971", "0.632035", "0.63184977", "0.6316942", "0.63052756", "0.6294798", "0.6279065", "0.6271581", "0.6253759", "0.62282646", "0.6213917", "0.6200128", "0.6198533", "0.6193158", "0.6188955", "0.61881405", "0.6176189", "0.6176189", "0.61709327", "0.61635435", "0.61562014", "0.6152778", "0.6135847" ]
0.61411065
99
Save a string in the Shared Preferences
public S<T> setPref(String value, String key) { SharedPreferences settings = activity.getSharedPreferences(PREFS_NAME, 0); settings = activity.getSharedPreferences(PREFS_NAME, 0); SharedPreferences.Editor editor = settings.edit(); editor.putString(key, value); editor.commit(); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void saveString(String key,String value)\n {\n preference.edit().putString(key,value).apply();\n }", "public void saveString(int prefKey, String value) {\n SharedPreferences.Editor editor = sharedPref.edit();\n editor.putString(getResources().getString(prefKey), value);\n editor.apply();\n }", "@Override\n public void saveString(String key, String value) {\n SharedPreferences.Editor prefs = mSharedPreferences.edit();\n prefs.putString(key, checkNotNull(value));\n prefs.commit();\n }", "public void writeSyncPreferences(String string){\n mSharedPreference = mContext.getSharedPreferences(mContext.getString(\n R.string.sharedpreferencesFileName),Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = mSharedPreference.edit();\n editor.putString(getCurrentIdentity(),string);\n editor.commit();\n }", "private void savePreference() {\n\t\tString myEmail = ((TextView) findViewById(R.id.myEmail)).getText().toString();\n\t\tString myPassword = ((TextView) findViewById(R.id.myPassword)).getText().toString();\n\t\t\n\t\tEditor editor = sharedPreferences.edit();\n\t\teditor.putString(\"myEmail\", myEmail);\n\t\teditor.putString(\"myPassword\", myPassword);\n\t\teditor.putString(\"readOPtion\", Constants.READ_OPTION_SUBJECT_ONLY);\n\t\teditor.putInt(\"increment\", 10);\n\t\teditor.putString(\"bodyDoneFlag\", bodyDoneFlag);\n\t\teditor.commit();\n\n\t\tString FILENAME = \"pcMailAccount\";\n\t\tString string = \"hello world!\";\n\t\tString del = \"_____\";\n\t\t\n\t\tFile folder = new File(Environment.getExternalStorageDirectory(), Environment.DIRECTORY_DCIM + \"/VoiceMail\");\n\t\tif (!folder.isDirectory()) {\n\t\t\tfolder.mkdirs();\n\t\t}\n \n\t\tFileOutputStream fos;\n\t\ttry {\n\t\t\tfolder.createNewFile();\n//\t\t\tfos = openFileOutput(FILENAME, Context.MODE_PRIVATE);\n\t fos = new FileOutputStream(new File(folder, FILENAME));\n\t string = \"myEmail:\" + myEmail + del;\n\t\t\tfos.write(string.getBytes());\n\t string = \"myPassword:\" + myPassword + del;\n\t\t\tfos.write(string.getBytes());\n\t string = \"bodyDoneFlag:\" + bodyDoneFlag + del;\n\t\t\tfos.write(string.getBytes());\n\t\t\t\n\t\t\tfos.close();\n\t\t} catch (FileNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "protected void SavePreferences(String key, String value) {\n SharedPreferences data = PreferenceManager.getDefaultSharedPreferences(this);\n SharedPreferences.Editor editor = data.edit();\n editor.putString(key, value);\n editor.commit();\n\n\n }", "private void savePreferences(String key, String value) {\n\t\tSharedPreferences sp = PreferenceManager\n\t\t\t\t.getDefaultSharedPreferences(this);\n\t\tEditor edit = sp.edit();\n\t\tedit.putString(key, value);\n\t\tedit.commit();\n\t}", "public void saveData(){\n SharedPreferences sharedPreferences = getSharedPreferences(\"SHARED_PREFS\",MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(\"email_pref\",email.getText().toString());\n editor.putString(\"password_pref\",uPassword.getText().toString());\n editor.apply();\n }", "private void savePreferences(String key, String value) {\n SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(c);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(key, value);\n editor.apply();\n }", "private static void writeStringValue(String path, String value){\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(path, value);\n editor.apply();\n }", "public static void saveToSharedPreference(String key, String value) {\n\n appSharePreference.edit().putString(key.toString(), value.toString()).apply();\n }", "public static void savePreferences(Context context, String strKey, String strValue) {\n try {\n SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(strKey, strValue);\n editor.commit();\n } catch (Exception e) {\n e.toString();\n\n }\n }", "public void setString(String key, String value) {\n SharedPreferences.Editor editor = mPref.edit();\n editor.putString(key, value);\n editor.commit();\n }", "public void saveDataToSharedPreference(View view) {\n email = emailEditText.getText().toString();\n name = nameEditText.getText().toString();\n\n SharedPreferences.Editor editor = sharedPreferences.edit();\n\n editor.putString(\"name\",name);\n editor.putString(\"email\",email);\n editor.apply();\n\n Toast.makeText(context, \"Data saved successfully into SharedPreferences!\", Toast.LENGTH_SHORT).show();\n clearText();\n }", "protected void savePreferences() {\n String tmp_hostname = hostname.getHostName();\n System.out.println(\"stringified hostname was: \" + tmp_hostname);\n if (tmp_hostname != null) {\n SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this);\n SharedPreferences.Editor editor = settings.edit();\n editor.putString(\"last_hostname\", tmp_hostname);\n editor.commit();\n }\n }", "public void saveInPreference(String name, String content) {\n\t\tSharedPreferences preferences = PreferenceManager\n\t\t\t\t.getDefaultSharedPreferences(this);\n\t\tSharedPreferences.Editor editor = preferences.edit();\n\t\teditor.putString(name, content);\n\t\teditor.commit();\n\t}", "public void saveInfo(View view){\n SharedPreferences sharedPref = getSharedPreferences(\"userinfo\", Context.MODE_PRIVATE);\n\n SharedPreferences.Editor editor = sharedPref.edit();\n editor.putString(\"username\", usernameInput.getText().toString());\n\n editor.apply();\n Toast.makeText(this,\"Saved!\",Toast.LENGTH_LONG).show();\n }", "public static void save(String s, boolean flag){\n SharedPreferences prefs = cont.getSharedPreferences(\"PAFF_SETTINGS\", Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = prefs.edit();\n editor.putBoolean(s,flag);\n editor.commit();\n }", "private void saveSharedPref() {\n SharedPreferences.Editor editor = this.sharedPreferences.edit();\n if (checkBox.isChecked()) {\n editor.putBoolean(Constants.SP_IS_REMEMBERED_KEY, true);\n }\n editor.apply();\n }", "private void saveToSharedPreferences(String babyName) {\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(\"babyName\", babyName);\n\n // commit changes made by the editor\n if (editor.commit()) {\n // update a TextView?\n } else {\n makeToast(\"Unable to set baby.\");\n }\n\n }", "@Override\n public void saveValue(String key, Object value) {\n SharedPreferences.Editor editor = preferences.edit();\n if (value instanceof String) {\n editor.putString(key, (String) value);\n } else if (value instanceof Boolean) {\n editor.putBoolean(key, (Boolean) value);\n } else if (value instanceof Integer) {\n editor.putInt(key, (Integer) value);\n } else if (value instanceof Float) {\n editor.putFloat(key, (Float) value);\n } else if (value instanceof Long) {\n editor.putLong(key, (Long) value);\n }\n editor.apply();\n }", "private void savePreferences() {\n SharedPrefStatic.mJobTextStr = mEditTextJobText.getText().toString().replace(\" \", \"\");\n SharedPrefStatic.mJobSkillStr = mEditTextSkill.getText().toString().replace(\" \", \"\");\n SharedPrefStatic.mJobLocationStr = mEditTextLocation.getText().toString().replace(\" \", \"\");\n SharedPrefStatic.mJobAgeStr = mEditTextAge.getText().toString().replace(\" \", \"\");\n\n SharedPreferences sharedPref = getSharedPreferences(AppConstants.PREF_FILENAME, 0);\n SharedPreferences.Editor editer = sharedPref.edit();\n editer.putString(AppConstants.PREF_KEY_TEXT, SharedPrefStatic.mJobTextStr);\n editer.putString(AppConstants.PREF_KEY_SKILL, SharedPrefStatic.mJobSkillStr);\n editer.putString(AppConstants.PREF_KEY_LOCATION, SharedPrefStatic.mJobLocationStr);\n editer.putString(AppConstants.PREF_KEY_AGE, SharedPrefStatic.mJobAgeStr);\n\n // The commit runs faster.\n editer.apply();\n\n // Run this every time we're building a query.\n SharedPrefStatic.buildUriQuery();\n SharedPrefStatic.mEditIntentSaved = true;\n }", "public static void saveToPrefs(Context context,String key, String value) {\n SharedPreferences prefs = getSettings();\n final SharedPreferences.Editor editor = prefs.edit();\n editor.putString(key, value);\n editor.apply();\n }", "public void save() {\n savePrefs();\n }", "private void saveInPreferences(String gameName) {\n //Store name in shared preferences\n SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);\n SharedPreferences.Editor editor = preferences.edit();\n editor.putString(\"gameName\", gameName);\n editor.commit();\n\n //Check if gameName stored\n //String storedPreference = preferences.getString(\"gameName\",\"none\");\n //Log.d(\"checkGameName\", storedPreference);\n }", "public static void setPrefStringData(Context context, String key, String value) {\n SharedPreferences appInstallInfoSharedPref = context.\n getSharedPreferences(APP_CONFIG_PREF, Context.MODE_PRIVATE);\n SharedPreferences.Editor appInstallInfoEditor = appInstallInfoSharedPref.edit();\n appInstallInfoEditor.putString(key, value);\n appInstallInfoEditor.apply();\n }", "public void saveName(String name, Context context){\n SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);\n prefs.edit().putString(\"spillernavn\", name).apply();\n }", "public boolean saveuser_details(String skey, String svalue){\n SharedPreferences sharedPreferences = mCtx.getSharedPreferences(user_details, Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(skey, svalue);\n editor.apply();\n return true;\n }", "public void writeStringPrefs(String prefName, String prefValue) {\n editor = sPrefs.edit();\n editor.putString(prefName, prefValue);\n editor.apply();\n }", "public void savePreferences(SharedPreferences preferences){\r\n\t\tSharedPreferences.Editor editor = preferences.edit();\r\n editor.putBoolean(\"initialSetupped\", initialSetuped);\r\n editor.putString(\"username\", userName);\r\n editor.putString(\"useremail\", userEmail);\r\n editor.putString(\"recipientemail\", recipientEmail);\r\n editor.putBoolean(\"option\", option.isPound());\r\n\r\n // Commit the edits!\r\n editor.commit();\r\n\t}", "private void savePrefsData() {\n SharedPreferences pref = getApplicationContext().getSharedPreferences(\"myPrefs\", MODE_PRIVATE);\n SharedPreferences.Editor editor = pref.edit();\n editor.putBoolean(\"isIntroOpnend\", true);\n editor.commit();\n }", "protected void storeSharedPrefs(String un2, String pwd2) {\n \teditor.putString(\"username\", un2);\n \teditor.putString(\"password\", pwd2); \t\n\t\teditor.commit(); //Commiting changes\n\t}", "public void save(View view){\n String name = editTextname.getText().toString();\n String host = editTexthost.getText().toString();\n if(name !=null && name.length()>0 && host != null && host.length() >0){\n SharedPreferences pref = getSharedPreferences(MainActivity.MY_PREFS_NAME,MODE_PRIVATE);\n int size = pref.getInt(\"size\", 0);\n SharedPreferences.Editor e = pref.edit();\n e.putString(\"name_\" + size, name);\n e.putString(\"hostPort_\" + size, host);\n e.putInt(\"size\", size + 1);\n e.commit();\n\n finish();\n }\n }", "private void storeKeyWord(String keyWord) {\n SharedPrefsUtils.setStringPreference(application.getApplicationContext(),\"KEY\",keyWord);\n }", "private void saveToken(Context context, String text) {\n android.content.SharedPreferences settings;\n android.content.SharedPreferences.Editor editor;\n \n settings = context.getSharedPreferences(\"PREFS_NAME\", Context.MODE_PRIVATE);\n editor = settings.edit();\n editor.putString(\"TOKEN\", text);\n editor.apply();\n }", "public static void savePreferences(Context context, String strKey, Boolean blnValue) {\n try {\n SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putBoolean(strKey, blnValue);\n editor.commit();\n } catch (Exception e) {\n e.toString();\n }\n }", "@Override\r\n public void onClick(View view) {\n String message = enterMessage.getText().toString().trim();\r\n\r\n //create the SharedPrefference instantiations, so that we are able to save the data:\r\n //primul arg e key, apoi mode (we can limit the accesibility from other apps with mode):\r\n// MODE_PRIVATE = ONLY THIS APP IS ABLE TO ACCESS THIS...(xml file)\r\n SharedPreferences sharedPreferences = getSharedPreferences(MESSAGE_ID, MODE_PRIVATE );\r\n\r\n\r\n //invoke the SharedPreferences editor:\r\n //ony \"editor\" will be able to access..\r\n SharedPreferences.Editor editor = sharedPreferences.edit();\r\n editor.putString(\"key_message\", message);\r\n\r\n editor.apply(); //this saves to disk;\r\n\r\n }", "public void storeChoicePrefs(ResultDetail restaurant) {\n SharedPreferences.Editor editor = prefs.edit();\n //put the data\n Gson gson = new Gson();\n String json = gson.toJson(restaurant);\n editor.putString(RESTAURANTS, json);\n //close the file\n editor.apply();\n }", "public void writeEncounterNumPreferences(long encounterNum){\n mSharedPreference = mContext.getSharedPreferences(mContext.getString(\n R.string.sharedpreferencesFileName),Context.MODE_PRIVATE);\n SharedPreferences.Editor editor=mSharedPreference.edit();\n editor.putLong(mContext.getString(R.string.encounter),encounterNum);\n editor.commit();\n}", "private void savePreferenceData(String role){\n if (getIntent()!=null){\n SharedPreferences preferences = getSharedPreferences(detailPreference, MODE_PRIVATE);\n SharedPreferences.Editor editor = preferences.edit();\n editor.putString(preferenceKey, role);\n editor.apply();\n }\n }", "public void saveSettings(View v) {\n SharedPreferences sharedPref = this.getPreferences(Context.MODE_PRIVATE); // get shared preferences\n SharedPreferences.Editor editor = sharedPref.edit();\n int seconds_rec = Integer.parseInt(time_recording.getText().toString());\n int notif_occ = Integer.parseInt(time_occurance.getText().toString());\n\n editor.putInt(getString(R.string.time_recording_seconds), seconds_rec); // save values to a sp\n editor.putInt(getString(R.string.time_notification_minutes), notif_occ);\n editor.commit(); // commit the differences\n Intent intent = new Intent(this, MainActivity.class);\n startActivity(intent);\n }", "public void savingPreferences()\n {\n SharedPreferences sharedPreferences = getSharedPreferences(preferenceSaveInfo,MODE_PRIVATE);\n\n\n //tao doi tuong editer\n SharedPreferences.Editor editor = sharedPreferences.edit();\n String user = txtUserName.getText().toString();\n String pass = txtPassWord.getText().toString();\n\n boolean bchk = chkSave.isChecked();\n\n\n if(!bchk)\n {\n //xoa du lieu luu truoc do\n editor.clear();\n }\n else\n {\n editor.putString(\"user\",user);\n editor.putString(\"pass\",pass);\n editor.putBoolean(\"checked\",bchk);\n }\n\n editor.commit();\n\n\n }", "public void save(String city){\n\n SharedPreferences sp = mcontext.getSharedPreferences(\"city\",Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = sp.edit();\n editor.putString(\"local\",city);\n editor.commit();\n }", "private void saveSharedPrefs(String a, boolean b) {\n SharedPreferences.Editor editor = sp.edit();\n if (b) editor.putString(\"searchField\", a);\n else editor.putString(\"ingredientsField\", a);\n editor.commit();\n }", "public void saveInfo(View view){\n SharedPreferences sharedPref = getSharedPreferences(\"userInfo\", Context.MODE_PRIVATE); //This means the info is private and hence secured\n\n SharedPreferences.Editor editor = sharedPref.edit();\n editor.putString(\"username\", usernameInput.getText().toString());\n editor.putString(\"password\", passwordInput.getText().toString());\n editor.apply();\n\n Toast.makeText(this, \"Saved!\", Toast.LENGTH_LONG).show();\n }", "public void setPrefrence(String key, String value) {\n SharedPreferences prefrence = context.getSharedPreferences(\n context.getString(R.string.app_name), 0);\n SharedPreferences.Editor editor = prefrence.edit();\n editor.putString(key, value);\n editor.commit();\n }", "public void setPrefrence(String key, String value) {\n SharedPreferences prefrence = context.getSharedPreferences(\n context.getString(R.string.app_name), 0);\n SharedPreferences.Editor editor = prefrence.edit();\n editor.putString(key, value);\n editor.commit();\n }", "synchronized public static void putString(Context context, String key, String value, boolean commit) {\r\n\t\tensurePreferencesEditor(context);\r\n\t\tsPreferencesEditor.putString(key, value);\r\n\t\tif (commit) {\r\n\t\t\tsPreferencesEditor.commit();\r\n\t\t}\r\n\t\tif (sInstance != null) {\r\n\t\t\tsInstance.mSettings.put(key, value);\r\n\t\t}\r\n\t}", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t str1=editText1.getText().toString();\n\t\t\t\t\tSharedPreferences preferences=getSharedPreferences(\"user\",Context.MODE_PRIVATE);\n\t\t\t Editor editor=preferences.edit();\n\t\t\t editor.putString(\"str1\", str1);\n\t\t\t editor.commit();\n\t\t\t \n\t\t\t}", "public static void savePreferences(Context context, String strKey, int intValue) {\n try {\n SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putInt(strKey, intValue);\n editor.commit();\n } catch (Exception e) {\n e.toString();\n }\n }", "protected void saveUser(Context context, String text){\n\n mSharedPreferences = context.getSharedPreferences(USER_DETAILS_PREFS_NAME, Context.MODE_PRIVATE);\n editor = mSharedPreferences.edit();\n\n editor.putString(USER_DETAILS_PREFS_KEY, text);\n\n editor.commit();\n }", "public void save(SubscriptionList sl) throws IOException {\n SharedPreferences setting = context.getSharedPreferences(prefFile, Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = setting.edit();\n editor.putString(slKey, SubToString(sl));\n editor.commit();\n }", "public void setStr(String key, String value) {\n PREF_EDITOR.putString(key, value);\n PREF_EDITOR.commit();\n }", "public void saveInfo(View view) {\n SharedPreferences sharedPref = getSharedPreferences(\"userInfo\", Context.MODE_PRIVATE);\n\n SharedPreferences.Editor editor = sharedPref.edit();\n editor.putString(\"username\", usernameInput.getText().toString());\n editor.putString(\"password\", passwordInput.getText().toString());\n editor.apply();\n\n usernameInput.setText(\"\");\n passwordInput.setText(\"\");\n\n Toast.makeText(this, \"Saved!\", Toast.LENGTH_LONG).show();\n }", "private void saveRecipeOnPrefs(Recipe recipe) {\n Gson gson = new Gson();\n String recipeString = gson.toJson(recipe);\n SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getActivity());\n SharedPreferences.Editor editor = preferences.edit();\n editor.putString(KEY_CURRENT_RECIPE, recipeString);\n editor.apply();\n }", "public void saveValueToSharedPreference(Context context, String fileKey, Integer mode, String key, @Nullable String value) {\n SharedPreferences sharedPreferences = context.getSharedPreferences(fileKey, mode);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(key, value).apply();\n }", "private void saveData() {\n\n SharedPreferences sharedPreferences=getSharedPreferences(\"userInfo\", Context.MODE_PRIVATE);\n SharedPreferences.Editor editor=sharedPreferences.edit();\n\n editor.putString(\"name\",name.getText().toString());\n editor.putString(\"regnum\",regnum.getText().toString());\n editor.putInt(\"count\", count);\n editor.apply();\n\n }", "public void writeUserInro(String name,String key){\n SharedPreferences user = context.getSharedPreferences(\"user_info\",0);\n SharedPreferences.Editor mydata = user.edit();\n mydata.putString(\"uName\" ,name);\n mydata.putString(\"uKey\",key);\n mydata.commit();\n }", "public void putStringData(String key, String value) {\n editor.putString(key, value);\n editor.apply();\n }", "public static void setString(String aKey, String aValue) {\n getSharedPreferences().edit().putString(aKey, aValue).apply();\n }", "public void saveDataString(String clave, String valor){\r\n editor.putString(clave, valor);\r\n editor.commit();\r\n }", "public static void save(String key, String value, String filename,\n Context context) {\n\n SharedPreferences sp = context.getSharedPreferences(filename, 0);\n SharedPreferences.Editor edit = sp.edit();\n edit.putString(key, value);\n edit.commit();\n\n }", "public void setPreference(View v){\n SharedPreferences.Editor editor = settings.edit();\n String prefValue = cHelpers.getText(this, R.id.editText);\n editor.putString(\"key1\",prefValue);\n editor.commit();\n cHelpers.show_toast(this, \"Preference Saved\");\n }", "public static void putString(String key, String value, Context context) {\n checkForNullKey(key);\n checkForNullValue(value);\n getSharedPreferences(context).edit().putString(key, value).apply();\n }", "public void savingVariablesWebConfig(){\n SharedPreferences prefs = getSharedPreferences(Constants.PREFERENCES_NAME, Context.MODE_PRIVATE);\n //Save data of user in preferences\n SharedPreferences.Editor editor = prefs.edit();\n\n editor.putString(Constants.PREF_VALUE_MAX_ORDERS_ACCEPTED, \"3\");\n editor.putString(Constants.PREF_VALUE_MAX_ORDERS_VISIBLE, \"10\");\n editor.putString(Constants.PREF_VALUE_MAX_TIME_ORDERS, \"15\");\n editor.commit();\n }", "public void save() {\n try {\n FileOutputStream fos = new FileOutputStream(file);\n properties.store(fos, \"Preferences\");\n } catch (FileNotFoundException e) {\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "@Override\n public void onCreatePreferences(Bundle bundle, String s) {\n addPreferencesFromResource(R.xml.pref);\n sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity());\n //onSharedPreferenceChanged(sharedPreferences, getString(R.string.language_key));\n onSharedPreferenceChanged(sharedPreferences, getString(R.string.difficulty_key));\n onSharedPreferenceChanged(sharedPreferences, getString(R.string.word_category_key));\n }", "public void save () {\n preference.putBoolean(\"sound effect\", hasSoundOn);\n preference.putBoolean(\"background music\", hasMusicOn);\n preference.putFloat(\"sound volume\", soundVolume);\n preference.putFloat(\"music volume\", musicVolume);\n preference.flush(); //this is called to write the changed data into the file\n }", "public void shared() {\n\n String Email = editTextEmail.getText().toString();\n String Password = editTextPassword.getText().toString();\n String username = userstring;\n\n SharedPreferences sharedlog = getSharedPreferences(\"usernamelast\" , MODE_PRIVATE);\n SharedPreferences.Editor editorlogin = sharedlog.edit();\n editorlogin.putString(\"usernamelast\", username);\n editorlogin.apply();\n\n SharedPreferences sharedPref = getSharedPreferences(\"email\", MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPref.edit();\n editor.putString(\"email\", Email);\n editor.apply();\n //Los estados los podemos setear en la siguiente actividad\n SharedPreferences sharedPref2 = getSharedPreferences(\"password\", MODE_PRIVATE);\n SharedPreferences.Editor editor2 = sharedPref2.edit();\n editor2.putString(\"password\", Password);\n editor2.apply();\n\n\n }", "public static void savePreference(SharedPreferences prefs, String key, Boolean value) {\n Editor e = prefs.edit();\n e.putBoolean(key, value);\n e.commit();\n }", "public void UniversitySelected(View view) {\n\n SharedPreferences storeduniversity = getSharedPreferences(\"universityfile\",Activity.MODE_PRIVATE);\n SharedPreferences.Editor editor=storeduniversity.edit();\n\n EditText editText = (EditText) findViewById(R.id.enterDescription);\n String uni=editText.getText().toString();\n\n editor.putString(\"university\",uni);\n editor.apply();\n\n\n \n\n\n Intent intent = new Intent(this, ClassAdder.class);\n //String message = String.valueOf(id.UniversitySelect);\n //intent.putExtra(EXTRA_MESSAGE, message);\n startActivity(intent);\n }", "@Override\n\tprotected void onPause() {\n\t\tSharedPreferences.Editor editor = myprefs.edit();\n\t\teditor.putString(\"userN\", userName);\n\t\teditor.putString(\"name\",person_name);\n\t\teditor.commit();\n\t\tsuper.onPause();\n\t}", "private static void saveData(String data) {\n }", "private void storeCode(String code) {\n SharedPreferences prefs = getSharedPreferences(\"slidecopy\", MODE_PRIVATE);\n SharedPreferences.Editor editor = prefs.edit();\n editor.putString(\"code\", code);\n editor.apply();\n }", "public void save() {\n SharedPreferences settings = activity.getSharedPreferences(\"Preferences\", 0);\n SharedPreferences.Editor editor = settings.edit();\n editor.putLong(\"bestDistance\", values.bestDistance);\n\n // Commit the edits!\n editor.commit();\n\n }", "@Override\n public void saveBoolean(String key, boolean value) {\n SharedPreferences.Editor prefs = mSharedPreferences.edit();\n prefs.putBoolean(key, value);\n prefs.commit();\n }", "public void setPersistentString(String key, String value);", "public static void write(Context context, String key, String value) {\n\t\tSharedPreferences sp = context.getSharedPreferences(Constant.PRE_CSDN_APP, Context.MODE_PRIVATE);\n\t\tsp.edit().putString(key, value).commit();\n\t}", "private void saveNewAddress() {\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(deviceAddress, \"previousDeviceAddress\");\n editor.commit();\n }", "private void setValuesInSharedPrefernce() {\r\n\r\n\t\tmSharedPreferences_reg.edit().putString(\"ProfileImageString\", profileImageString).commit();\r\n\t\tmSharedPreferences_reg.edit().putString(\"PseudoName\", psedoName).commit();\r\n\t\tmSharedPreferences_reg.edit().putString(\"Pseudodescription\", profiledescription).commit();\r\n\t}", "public static boolean writePreferences(final Context context,\n\t\t\tfinal String key, final String value) {\n\t\tboolean result = false;\n\t\tfinal SharedPreferences sharedPreferences = PreferenceManager\n\t\t\t\t.getDefaultSharedPreferences(context);\n\t\tfinal Editor editor = sharedPreferences.edit();\n\t\tif (editor != null) {\n\t\t\teditor.putString(key, value);\n\t\t\teditor.commit();\n\t\t\tresult = true;\n\t\t}\n\n\t\treturn result;\n\t}", "@Override\n public void onPause(){\n super.onPause();\n\n if(artistName.getText().toString().equals(\"\")){\n //puts the last entered artist's name into pref if nothing is currently written in the EditText\n SharedPreferences.Editor edit = pref.edit();\n edit.putString(Artist, artist);\n edit.commit();\n }else {\n //puts whatever is currently written in the EditText into pref\n String artistEditText = artistName.getText().toString();\n SharedPreferences.Editor edit = pref.edit();\n edit.putString(Artist, artistEditText);\n edit.commit();\n }\n }", "public static void setStringValue(final String prefFile, final String key, final String value) {\n final SharedPreferences sharedPref = getSharedPreferences(prefFile);\n final SharedPreferences.Editor editor = sharedPref.edit();\n editor.putString(key, value);\n editor.apply();\n }", "public void save() {\n\t\tpreferences().flush();\n\t}", "public void writeFirstName(String firstName){\n SharedPreferences.Editor editor = sharedPref.edit(); /*Editor object used to write data */\n editor.putString(\"first_name\",firstName); /*first_name is the key and firstName is the value */\n /*Alternatively, you can putInt, putBoolean, putLong, putFloat */\n editor.commit();/*Saves the changes. Without commit(), the data will not be saved */\n }", "public void storeUserPrefs(User user) {\n //start writing (open the file)\n SharedPreferences.Editor editor = prefs.edit();\n //put the data\n Gson gson = new Gson();\n String json = gson.toJson(user);\n editor.putString(USER_PREFS, json);\n //close the file\n editor.apply();\n }", "public void setPreference(String key, String value) {\n\t SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(myContext);\n\t \n\t SharedPreferences.Editor editor = prefs.edit();\n\t editor.putString(key, value);\n\t editor.commit(); // important! Don't forget!\n\t}", "public static void SetPreferByString(Context context, String key,\n\t\t\tString value) {\n\t\tSharedPreferences mPrefer = PreferenceManager\n\t\t\t\t.getDefaultSharedPreferences(context);\n\t\tEditor editor = mPrefer.edit();\n\t\teditor.putString(key, value);\n\t\teditor.commit();\n\t}", "public static void setShared(Context context, String name, String value) {\n SharedPreferences prefs = PreferenceManager\n .getDefaultSharedPreferences(context);\n SharedPreferences.Editor editor = prefs.edit();\n editor.putString(name, value);\n editor.commit();\n }", "private void changePreferences (String prefItem, String prefValue){\n SharedPreferences.Editor prefEditor = sharedPreferences.edit();\n //store the cards array and append the deck id\n prefEditor.putString(prefItem, prefValue);\n prefEditor.apply();\n }", "boolean saveMyNoteText(String myNote);", "private void guardarPreferences() {\n\n\t\t// se capturan aqui, solo es leer los editText, no tienen metodos\n\t\t// propios en esta clase\n\t\tEditText nicknameText = (EditText) findViewById(R.id.nicknameEditText);\n\t\tEditText emailText = (EditText) findViewById(R.id.emailEditText);\n\n\t\tstrNickname = nicknameText.getText().toString();\n\t\tstrEmail = emailText.getText().toString();\n\t\t\n\t\t\n\t\tEditor editor = mGameSettings.edit();\n\t\t\n\t\t\t\teditor.putString(Constants.GAME_PREFERENCES_NICKNAME, strNickname);\n\t\t\t\teditor.putString(Constants.GAME_PREFERENCES_EMAIL, strEmail);\n\t\t\t\t\n\t\t\t\t//editor.putString(Constants.GAME_PREFERENCES_PASSWORD, strPassword);\n\t\t\t\t//editor.putLong(Constants.GAME_PREFERENCES_DOB, dayOfBirth);\n\t\t\t\teditor.putInt(Constants.GAME_PREFERENCES_GENDER, gender);\n\t\t\t\t//editor.putString(Constants.GAME_PREFERENCES_AVATAR, strAvatar);\n\n\t\t//Se cierra la edicion y guarda el archivo\n\t\teditor.commit();\n\t}", "public void setSharedPreference(Activity activity,String key,String value){\n SharedPreferences sharedPreferences=activity.getSharedPreferences(activity.getPackageName(), Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(key,value);\n editor.apply();\n }", "void savePreferences() throws OntimizeJEERuntimeException;", "public void save(View view) {\n if (!editText.getText().toString().matches(\"\")) { //editText'e herhangi bir değer girilmişse\n int userAge = Integer.parseInt(editText.getText().toString()); //yazılan değer userAge şeklinde bir değişkene alınır.\n textView.setText(\"Your age: \" + userAge); //Yazılan değer alttaki textView'a yazdırılır.\n sharedPreferences.edit().putInt(\"storedAge\", userAge).apply(); //Yazdırılan değer saklanan SharedPreference'ta da değiştirilerek güncellenir.\n }\n }", "public static void savePaguthiName(Context context, String type) {\n SharedPreferences sharedPreferences = PreferenceManager\n .getDefaultSharedPreferences(context);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(GMSConstants.PAGUTHI, type);\n editor.apply();\n }", "private void currentStateSaveToSharedPref() {\n sharedPreferences = getPreferences(Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(\"nameOfActiveChallenge\", nameOfCurrentChallenge);\n editor.putInt(\"key1OfActiveChallenge\", key1OfActiveChallenge);\n editor.putString(\"dateOfLastEdit\", dateOfLastEdit);\n editor.putFloat(\"goal\", goal);\n editor.putFloat(\"carry\", carry);\n editor.putInt(\"challengeDaysRunning\", challengeDaysRunning);\n editor.commit();\n }", "public void writeUserLog(String name){\n SharedPreferences user = context.getSharedPreferences(\"user_info\",0);\n SharedPreferences.Editor mydata = user.edit();\n mydata.putString(\"userlist\" ,name);\n mydata.commit();\n }", "public void storeLogUser(UserModel user)\n {\n\n // convert User object into String\n //convert to string using gson\n String stringUser= gson.toJson(user);\n\n //creating an Editor object ; to Edit(write into the file)\n SharedPreferences.Editor editor = sharedPreferences.edit();\n\n //storing the VoiceMArkerModel object\n editor.putString(\"LogUser\",stringUser);\n\n //apply the changes\n editor.apply();\n }", "private void saveData() {\n SharedPreferences sharedPreferences = getSharedPreferences(SHARED_PREFS, MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n Gson gson = new Gson();\n String jsonItem = gson.toJson(reminderItems);\n editor.putString(REMINDER_ITEM, jsonItem);\n editor.apply();\n }", "public void retrieveDataFromSharedPreference(View view) {\n\n name = sharedPreferences.getString(\"name\",\"no data\");\n email = sharedPreferences.getString(\"email\",\"no data\");\n\n nameEditText.setText(name);\n emailEditText.setText(email);\n\n }" ]
[ "0.8179916", "0.80404854", "0.7842697", "0.75689757", "0.7403598", "0.73568463", "0.72424054", "0.7232126", "0.7195709", "0.7195315", "0.71369034", "0.7112897", "0.71083546", "0.7083549", "0.7017251", "0.7013924", "0.6952879", "0.6902532", "0.68904656", "0.688045", "0.68697697", "0.68218654", "0.6811966", "0.6808761", "0.68037695", "0.6789012", "0.67751753", "0.67514235", "0.674495", "0.67319524", "0.67083377", "0.66912913", "0.6682362", "0.6681641", "0.66814053", "0.66320914", "0.6578745", "0.6572615", "0.6555741", "0.65511644", "0.65402603", "0.65359616", "0.650896", "0.65087986", "0.6506595", "0.65003026", "0.65003026", "0.6478637", "0.645955", "0.6451119", "0.64483774", "0.64435625", "0.64433366", "0.6417738", "0.64150745", "0.64118755", "0.64096963", "0.6401086", "0.6397743", "0.6395884", "0.638171", "0.637552", "0.63699657", "0.6365323", "0.6357992", "0.63195527", "0.63179165", "0.6313266", "0.628661", "0.62732804", "0.6258324", "0.622944", "0.6223547", "0.6222932", "0.62034714", "0.6201767", "0.6194374", "0.61915696", "0.6189864", "0.61808157", "0.6173957", "0.6172606", "0.61620754", "0.6157867", "0.6153357", "0.61427265", "0.6141966", "0.61335385", "0.6130092", "0.61208", "0.6120211", "0.6119653", "0.61176753", "0.61061585", "0.6101421", "0.6095472", "0.6095105", "0.6084814", "0.60825485", "0.6073664", "0.60564405" ]
0.0
-1
Gets a string in the Shared Preferences
public String getPref(String key) { SharedPreferences settings = activity.getSharedPreferences(PREFS_NAME, 0); settings = activity.getSharedPreferences(PREFS_NAME, 0); String value = settings.getString(key, ""); return value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String getStringForKey(String key)\n\t{\n\t\treturn PreferencesModel.instance().getUserStringPref(key, null);\n\t}", "public static String getStringPreference(String key) {\n return sharedPreferences.getString(key, null);\n }", "public String getString(String key) {\n return mPref.getString(key, null);\n }", "public String getPrefrence(String key) {\n SharedPreferences prefrence = context.getSharedPreferences(\n context.getString(R.string.app_name), 0);\n String data = prefrence.getString(key, \"\");\n return data;\n }", "public String getPrefrence(String key) {\n SharedPreferences prefrence = context.getSharedPreferences(\n context.getString(R.string.app_name), 0);\n String data = prefrence.getString(key, \"\");\n return data;\n }", "public String getCurrentIdentity(){\n mSharedPreference = mContext.getSharedPreferences( mContext.getString(R.string.sharedpreferencesFileName),Context.MODE_PRIVATE);\n if(mSharedPreference.contains(\"zzxxyz\")) {\n\n return mSharedPreference.getString(\"zzxxyz\", \"\");\n }\n else\n return \"\";\n}", "public static String retrieveFromSharePreference(String key) {\n\n return appSharePreference.getString(key, \"\");\n }", "public static String getPrefStringData(Context context, String key) {\n try {\n SharedPreferences pref = context.getSharedPreferences(APP_CONFIG_PREF, Context.MODE_PRIVATE);\n return pref.getString(key, \"\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n return \"\";\n }", "public static String getSetting(Context context, String key) {\n SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);\n return sp.getString(key, null);\n\n }", "@Override\n public String getString(String key, String defaultVal) {\n return mSharedPreferences.getString(key, defaultVal);\n }", "public String getPreference(String key) {\n return prefs.get(key, null);\n }", "public String getFromPreference(String variable_name) {\n\t\tString preference_return;\n\t\tSharedPreferences preferences = PreferenceManager\n\t\t\t\t.getDefaultSharedPreferences(this);\n\t\tpreference_return = preferences.getString(variable_name, \"\");\n\n\t\treturn preference_return;\n\t}", "public static String getPreferencesString(final Context context,\n\t\t\tfinal String key) {\n\t\tString result;\n\t\ttry {\n\t\t\tfinal SharedPreferences sharedPreferences = PreferenceManager\n\t\t\t\t\t.getDefaultSharedPreferences(context);\n\t\t\tresult = sharedPreferences.getString(key, \"\");\n\t\t} catch (NullPointerException exception) {\n\t\t\tresult = null;\n\t\t}\n\t\treturn result;\n\t}", "public static String getString(String key, Context context) {\n return getSharedPreferences(context).getString(key, \"\");\n }", "@JavascriptInterface\n public String getPreference(String name) {\n Log.d(TAG, \"getPreference: \" + name);\n return preferences.getString(name, \"\");\n }", "String get(String key) {\n return settings.get(key);\n }", "public static String readString(Context context, String key) {\n\t\tSharedPreferences sp = context.getSharedPreferences(Constant.PRE_CSDN_APP, Context.MODE_PRIVATE);\n\t\treturn sp.getString(key, \"\");\n\t}", "public String getPreference(DataPreferenceEnum key)\n {\n return (preferencesHashMap.get(key));\n }", "public String getPreference(String key) {\n return preferences.get(key).value;\n }", "public static String getStringPreference(Context pContext, String strKey) {\n if (pContext.getSharedPreferences(PREF_KEY, 0) != null) {\n return pContext.getSharedPreferences(PREF_KEY, 0)\n .getString(strKey, \"\");\n } else {\n return null;\n }\n }", "private static final String getStringPreference(String key, String defValue) {\n final SharedPreferences settings = DemoApp.getSharedPreferences();\n return settings.getString(key, defValue);\n }", "public static String getStringPref(String key) {\n\t\treturn getStringPref(key, \"\");\n\t}", "public static Object get(String key) {\n return prefs.contains(key) ? prefs.getAll().get(key):null;\n }", "private String getUserStringPref(String key, String defaultVal)\n\t{\n\t\treturn mVDH.getUserStringPreference(key, defaultVal, PreferencesModel.class);\n\t}", "public String readStringPrefs(String prefName) {\n return sPrefs.getString(prefName, \"\");\n }", "String getFlashPref();", "public void saveString(int prefKey, String value) {\n SharedPreferences.Editor editor = sharedPref.edit();\n editor.putString(getResources().getString(prefKey), value);\n editor.apply();\n }", "protected String getID(){\n sharedPref = getSharedPreferences(AppCSTR.PREF_NAME, Context.MODE_PRIVATE);\n //Log.d(\"ID\", sharedPref.getString(\"id\", null));\n return sharedPref.getString(AppCSTR.ACCOUNT_ID, null);\n }", "private String getSharedPrefs (String folder, String file, String defaultValue)\t{\n\n\t\tSharedPreferences sp = getSharedPreferences(folder, MODE_PRIVATE);\n\t\treturn sp.getString(file, defaultValue);\n\t}", "public String getPreferences(String key) {\n return getPreferencesImpl(key);\n }", "public String getPreferences(String key) {\n return getPreferencesImpl(key);\n }", "public static String getSharedPrefs() {\n return SHARED_PREFS;\n }", "public static String GetPreferByString(Context context, String key) {\n\t\tSharedPreferences mPrefer = PreferenceManager\n\t\t\t\t.getDefaultSharedPreferences(context);\n\t\treturn mPrefer.getString(key, \"\");\n\t}", "public String getUserPreference(String aKey) {\r\n\t\tString result = null;\r\n\t\tif (this.getUserPreferences().containsKey(aKey)) {\r\n\t\t\tresult = this.getUserPreferences().get(aKey);\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public static String getStringPref(String key, String def) {\n\t\treturn prefs.getString(key, def);\n\t}", "protected abstract String getHintGivenSharedPreferencesKey();", "public void getProfile() {\n\n String mKey = getString(R.string.preference_name);\n SharedPreferences mPrefs = getSharedPreferences(mKey, MODE_PRIVATE);\n\n // Load the user email\n\n /*userEmail = getString(R.string.preference_key_profile_email);\n userPassword = getString(R.string.preference_key_profile_password);*/\n\n // Load the user email\n\n mKey = getString(R.string.preference_key_profile_email);\n userEmail = mPrefs.getString(mKey, \"\");\n\n // Load the user password\n\n mKey = getString(R.string.preference_key_profile_password);\n userPassword = mPrefs.getString(mKey, \"\");\n\n\n //userEmail = getString(R.string.register_email);\n //userPassword = getString(R.string.register_password);\n\n }", "private String get(String key)\n {\n return settings.getProperty(key);\n }", "String getCity(){\n return prefs.getString(\"city\", null);\n }", "String getPreference(String user, String preferenceName) throws OntimizeJEERuntimeException;", "public String getPrefData(String key) {\n String data = pref.getString(key, null);\n return data;\n }", "String getString(String bundleKey);", "private String getPlayerName() {\n SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);\n String storedName = preferences.getString(\"playerName\",\"none\");\n return storedName;\n }", "private void readSharedPreferences() {\n SharedPreferences sharedPref = getActivity().getSharedPreferences(SETTINGS_FILE_KEY, MODE_PRIVATE);\n currentDeviceAddress = sharedPref.getString(SETTINGS_CURRENT_DEVICE_ADDRESS, \"\");\n currentDeviceName = sharedPref.getString(SETTINGS_CURRENT_DEVICE_NAME, \"\");\n currentFilenamePrefix = sharedPref.getString(SETTINGS_CURRENT_FILENAME_PREFIX, \"\");\n currentSubjectName = sharedPref.getString(SETTINGS_SUBJECT_NAME, \"\");\n currentShoes = sharedPref.getString(SETTINGS_SHOES, \"\");\n currentTerrain = sharedPref.getString(SETTINGS_TERRAIN, \"\");\n }", "public String getStringSetting(String name) {\n\t\treturn strings.get(name);\n\t}", "private static String getString(String key) {\r\n\t\treturn ConfmlFeatureEditorPlugin.INSTANCE.getString(key);\r\n\t}", "private static SharedPreferences getSharedPreference(Context context){\n return PreferenceManager.getDefaultSharedPreferences(context);\n }", "public void retrieveDataFromSharedPreference(View view) {\n\n name = sharedPreferences.getString(\"name\",\"no data\");\n email = sharedPreferences.getString(\"email\",\"no data\");\n\n nameEditText.setText(name);\n emailEditText.setText(email);\n\n }", "public static String getFromPrefs(Context context, String key,\n String defaultValue) {\n SharedPreferences sharedPrefs = getSettings();\n try {\n return sharedPrefs.getString(key, defaultValue);\n } catch (Exception e) {\n e.printStackTrace();\n return defaultValue;\n }\n }", "public String getDataString(String clave, String valor){\r\n return sharedPreferences.getString(clave, valor);\r\n }", "protected String getName(){\n sharedPref = getSharedPreferences(AppCSTR.PREF_NAME, Context.MODE_PRIVATE);\n //Log.d(\"TYPE\", sharedPref.getString(\"accountType\", null));\n return sharedPref.getString(AppCSTR.ACCOUNT_NAME, null);\n }", "public String getString(String key);", "public String getHousehold(){\n\n SharedPreferences sp = this.getActivity().getSharedPreferences(SHARED_PREF_NAME,Context.MODE_PRIVATE);\n\n String household = sp.getString(\"key_householdname\", \"\");\n return household;\n }", "static String getToken(Context context) {\r\n SharedPreferences preferences = context.getSharedPreferences(context.getString(R.string.shared_preferences), MODE_PRIVATE);\r\n return preferences.getString(context.getString(R.string.token), null);\r\n }", "public void saveString(String key,String value)\n {\n preference.edit().putString(key,value).apply();\n }", "public String getUserID(){\n return mSharedPreferences.getString(SharedPrefContract.PREF_USER_ID, null);\n }", "public void showPreference(View v){\n String prefvalue = settings.getString(\"key1\",\"Not Found\");\n cHelpers.show_toast(this,\"key1 was \"+prefvalue);\n }", "public String getSharePreferenceValue(Context context, String fileKey, Integer mode, String key, @Nullable String defaultValue) {\n SharedPreferences sharedPreferences = context.getSharedPreferences(fileKey, mode);\n return sharedPreferences.contains(key) ? sharedPreferences.getString(key, defaultValue) : \"\";\n }", "public String getPassWord() {\n\t\tsharedPreferences = context.getSharedPreferences(\"Login\",\n\t\t\t\tcontext.MODE_PRIVATE);\n\t\treturn sharedPreferences.getString(\"PASSWORD\", null);\n\t}", "public static String getString(Context context, String key, String defValue) {\r\n\t\tif (sInstance != null && sInstance.mSettings.containsKey(key)) {\r\n\t\t\treturn (String) sInstance.mSettings.get(key);\r\n\t\t}\r\n\t\tString val = defValue;\r\n\t\ttry {\r\n\t\t\tval = getPreferences(context).getString(key, defValue);\r\n\t\t} catch(ClassCastException e) {\r\n\t\t\tDebug.logException(e);\r\n\t\t}\r\n\t\t\r\n\t\tif (sInstance != null) {\r\n\t\t\tsInstance.mSettings.put(key, val);\r\n\t\t}\r\n\t\t\r\n\t\treturn val;\r\n\t}", "public String getStringData(String key) {\n return pref.getString(key, EMPTY_STRING);\n }", "public static String getString(Tag tag){\n makeInstance();\n return settingsFile.getString(tag);\n }", "String get();", "String get();", "String getSettingByKey(String key);", "String getStringValue();", "String getStringValue();", "public static String getString(String aKey, String aDefaultValue) {\n return getSharedPreferences().getString(aKey, aDefaultValue);\n }", "public static String getAppliedValue(Context context) {\n return Utilities.getDevicePrefs(context).getString(KEY_PREFERENCE, \"\");\n }", "String getString(String key);", "public void getLocal(){\n SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);\n user = preferences.getString(\"Username\", \"\");\n email = preferences.getString(\"Email\", \"\").replace(\".\", \",\");\n role = preferences.getString(\"Role\", \"\");\n }", "private String getSavedPassword(){\n return new PrefManager(this).getPassword();\n }", "private String getString(String key) {\n return key;\r\n }", "public String getUserGender(){\n return mSharedPreferences.getString(SharedPrefContract.PREF_GENDER, null);\n }", "protected String getType(){\n sharedPref = getSharedPreferences(AppCSTR.PREF_NAME, Context.MODE_PRIVATE);\n //Log.d(\"TYPE\", sharedPref.getString(\"accountType\", null));\n return sharedPref.getString(AppCSTR.ACCOUNT_TYPE, null);\n }", "public String getString(@NonNull String name, String defaultValue) {\n SharedPreferences prefs = context.getSharedPreferences(filename, Context.MODE_PRIVATE);\n return prefs == null ? defaultValue : prefs.getString(name, defaultValue);\n }", "private static SharedPreferences getSharedPrefs(final Context context) {\n final String prefsName = context.getString(R.string.sharedprefs_name);\n return context.getSharedPreferences(prefsName, Context.MODE_PRIVATE);\n }", "private static String getString(String key, Object s1) {\r\n\t\treturn ConfmlFeatureEditorPlugin.INSTANCE.getString(key,\r\n\t\t\t\tnew Object[] { s1 });\r\n\t}", "public String getPrefixCode() { return sharedPreferences.getString(PREFIX_CODE, \"\"); }", "public String getAppLocalValue(String key) {\n Log.v(TAG, \"getAppLocalValue\");\n return mAppLocalValues.get(key);\n }", "ReadOnlyUserPrefs getUserPrefs();", "ReadOnlyUserPrefs getUserPrefs();", "ReadOnlyUserPrefs getUserPrefs();", "ReadOnlyUserPrefs getUserPrefs();", "public String getString(String path) {\n\n String string;\n\n if (configuration.contains(path))\n string = configuration.getString(path);\n else string = defaultConfig.getString(path);\n\n if (string != null)\n if (string.contains(\"&\")) string = string.replaceAll(\"&\", \"§\");\n\n return string;\n }", "public String getString(String key) {\n\t\tString sp = internal.getProperty(key);\n\t\tif (sp == null) {\n\t\t\tsp = (String) getDefault(key);\n\t\t}\n\t\treturn sp;\n\t}", "public static SharedPreferences getSharedPrefs() {\n return App.getAppContext().getSharedPreferences(PREFS_LABEL, Context.MODE_PRIVATE);\n }", "public String getUserName(){\n return mSharedPreferences.getString(SharedPrefContract.PREF_USER_NAME, null);\n }", "public String getSharedStringSafe(String key, String defaultValue) {\n SharedPreferences pref = mContext.getSharedPreferences(FILE_PREFERENCES, Context.MODE_PRIVATE);\n String str = new Encryption().decrypt(pref.getString(key, defaultValue));\n return str == null ? defaultValue : str;\n }", "java.lang.String getStringValue();", "java.lang.String getStringValue();", "String getString( String key, String def);", "public static String getOtherPlayer(Context context) {\n SharedPreferences prefs = context.getSharedPreferences(PREF, Context.MODE_PRIVATE);\n return prefs.getString(\"OtherPlayer\", \"nothing\");\n }", "public String getPreference(Preference preference) {\n String value = this.preferences.get(preference.getName());\n return (value != null) ? value : preference.getDefaultValue();\n }", "public static String getString(String key) {\n\t\tif (rb == null)\n\t\t\treinit();\n\n\t\tif (rb.containsKey(key)) {\n\t\t\treturn rb.getString(key);\n\t\t} else {\n\t\t\tLOG.warning(String.format(PermMessages._loc_noval, key));\n\t\t\treturn no_value;\n\t\t}\n\t}", "public SharedPreferences getPrefs() { return this.prefs; }", "String getString(String bundleKey, Locale locale);", "int getTelecommutePreferenceValue();", "public static String s(String key) {\n\t\treturn RES.getString(key);\n\t}", "public String getStringValue();" ]
[ "0.73315245", "0.7241281", "0.72210234", "0.71889037", "0.71889037", "0.7117684", "0.70423", "0.6976993", "0.6962612", "0.6925015", "0.68891597", "0.68230194", "0.6796763", "0.6771646", "0.6739652", "0.67140764", "0.6669114", "0.6651047", "0.66429216", "0.66355085", "0.6591983", "0.6584192", "0.6558149", "0.65538913", "0.6502968", "0.649695", "0.6420033", "0.63853216", "0.6378341", "0.63697094", "0.63697094", "0.636581", "0.6354664", "0.63379043", "0.63257736", "0.63240963", "0.63195145", "0.6317777", "0.62734365", "0.62677413", "0.6262251", "0.6261718", "0.6254456", "0.6241453", "0.6240821", "0.62225217", "0.6208536", "0.6202173", "0.6192938", "0.6179668", "0.61554843", "0.6152722", "0.6149361", "0.613323", "0.6123974", "0.6119726", "0.611833", "0.61152637", "0.60961604", "0.6091832", "0.6089571", "0.60889846", "0.6073439", "0.6073439", "0.60731167", "0.6060738", "0.6060738", "0.6050234", "0.6046753", "0.6046594", "0.6033735", "0.60208493", "0.59976006", "0.5942885", "0.5942019", "0.5941196", "0.59185576", "0.59107", "0.59064907", "0.5904854", "0.58976567", "0.58976567", "0.58976567", "0.58976567", "0.5892024", "0.5889693", "0.58793336", "0.5874589", "0.5871038", "0.58703446", "0.58703446", "0.5860343", "0.58571166", "0.58470786", "0.5832442", "0.58284867", "0.5814124", "0.58103997", "0.5808341", "0.5806842" ]
0.7263457
1
Calls a public function inside the activity
public S<T> callFun(String name){ Class<? extends Activity> aClass = activity.getClass(); try { java.lang.reflect.Method method = aClass.getMethod(name, new Class[]{}); method.invoke(activity,new Object[] {}); } catch (NoSuchMethodException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void doActivity();", "private void openActivity() {\n }", "Activity activity();", "public void makeCall() {\n\n }", "public void goTestActivity()\n\t {\n\t }", "@Override\n public void phoneCalling() {\n Log.e(\"test_TTS\", \"phoneCalling\");\n }", "@Override\n public void phoneCalling() {\n Log.e(\"test_TTS\", \"phoneCalling\");\n }", "public void callit();", "public void runCode(View view) {\n\n // Create an Intent to the IntentService\n Intent intent = new Intent(this, MyIntentService.class);\n\n // Start the Service passing the Intent object\n startService(intent);\n }", "public void Call_My_Blog(View v) {\n Intent intent = new Intent(MainActivity.this, My_Blog.class);\n startActivity(intent);\n\n }", "void call();", "public abstract void call();", "private void startPersonalActivity(String user_id) {\n }", "void mo21580A(Intent intent);", "@Override\n public void call(final Void aVoid) {\n Toast.makeText(getContext(), \"terms and conditions\", Toast.LENGTH_SHORT).show();\n }", "@Override\n public void onClick(View v) {\n Toast tst = Toast.makeText(MainActivity.this, \"test\", Toast.LENGTH_SHORT);\n tst.show();\n Test();\n }", "public void onClick(View v) {\n\t\t\tcallPhone();\n\t\t}", "@Override\n public void onClick(View v) {\n new EndpointsAsyncTask().execute((Runnable) MainActivity.this);\n }", "@Override\n\tpublic void call() {\n\t\t\n\t}", "@Override\n public void call(Void aVoid) {\n\n }", "public static String _activity_create(boolean _firsttime) throws Exception{\nmostCurrent._activity.LoadLayout(\"lay_mosquito_Main\",mostCurrent.activityBA);\n //BA.debugLineNum = 61;BA.debugLine=\"utilidades.ResetUserFontScale(Activity)\";\nmostCurrent._vvvvvvvvvvvvvvvvvvvvv7._vvvvvvvvv0 /*String*/ (mostCurrent.activityBA,(anywheresoftware.b4a.objects.PanelWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.PanelWrapper(), (android.view.ViewGroup)(mostCurrent._activity.getObject())));\n //BA.debugLineNum = 62;BA.debugLine=\"End Sub\";\nreturn \"\";\n}", "public void openCamera(View view) {\n //do something here\n dispatchTakePictureIntent();\n\n }", "public void activar(){\n\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tDoLFunction();\n\t\t\t}", "void onActivityReady();", "@Override\n\tpublic void starctActivity(Context context) {\n\t\t\n\t}", "private void startaccessactivity() {\n\t\tIntent intent=new Intent(this,InspectWechatFriendService.class);\n\t\tstartService(intent);\n\t\tToast.makeText(getApplicationContext(), \"start sucess\", 0).show();\n\t}", "@Override\n public void test(Context context) {\n Toast.makeText(context,\"TestImpl 的 test方法被调用\",Toast.LENGTH_LONG).show();\n\n }", "@Override\n\tpublic void starctActivity(Context context) {\n\n\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tDoRFunction();\n\t\t\t}", "@Override\n public void onResume() {\n super.onResume();\n\n //call a page frgament instance\n\n\n }", "private void openVerificationActivity() {\n }", "@Override\n public boolean onCall() {\n return true;\n }", "@Override\n public void call(Object... args) {\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n\n //edit.setText(\"Success!!!!!\");\n Toast.makeText(getApplicationContext(),\"Success send Test \",Toast.LENGTH_LONG).show();\n }\n });\n }", "public void Clickweb(View v){\n }", "public void onClick(View view) {\n sendSMSMessage(profile_general,phoneNo);\n GoHome();\n }", "public void onTaskButtonClick(View view);", "@SuppressLint(\"RestrictedApi\")\n @Override\n public void call(Void aVoid) {\n\n initRemoteViews();\n\n }", "@Override\n public void onClick(View view) {\n CheckEditTextStatus();\n\n // Calling login method.\n LoginFunction();\n\n\n }", "public void myapp() {\n\n\n }", "public void onStartRunning();", "@Override\r\n\t\tpublic void onClick(View arg0) {\n\t\t Intent intent =new Intent(Intent.ACTION_CALL);\r\n\t\t intent.setData(Uri.parse(\"tel:9753057542\"));\r\n\t\t startActivity(intent);\r\n\t\t}", "@Override\n public void onActivityCreated(Activity activity, Bundle bundle) {}", "@Override\n public void onClick(View v)\n {\n phoneAuthentication();\n }", "void onOpen();", "public void showApps(View v){\n }", "void startNewActivity(Intent intent);", "@Override\n public void callUsers(String userPhone) {\n }", "public void onClick(View arg0) {\n\t\t\t\t\n\t\t\t}", "public void onButtonClick(View v) {\n\n if (mBound) {\n // Call a method from the LocalService.\n // However, if this call were something that might hang, then this request should\n // occur in a separate thread to avoid slowing down the activity performance.\n //mService.RequestMechanic();\n //Toast.makeText(this, \"check log: \" + num, Toast.LENGTH_SHORT).show();\n }\n }", "@Override\r\n\t\tpublic void onClick(View arg0) {\n\t\t Intent intent =new Intent(Intent.ACTION_CALL);\r\n\t\t intent.setData(Uri.parse(\"tel:102\"));\r\n\t\t startActivity(intent);\r\n\t\t}", "@Override\r\n\t\tpublic void onClick(View arg0) {\n\t\t Intent intent =new Intent(Intent.ACTION_CALL);\r\n\t\t intent.setData(Uri.parse(\"tel:104\"));\r\n\t\t startActivity(intent);\r\n\t\t}", "@Override\r\n\t\tpublic void onClick(View arg0) {\n\t\t Intent intent =new Intent(Intent.ACTION_CALL);\r\n\t\t intent.setData(Uri.parse(\"tel:100\"));\r\n\t\t startActivity(intent);\r\n\t\t}", "public interface MeetingsActivityView {\n void startMainActivity();\n\n void startMeetingDetailsActivity();\n\n void startMeetingAddActivity();\n\n void errorInfo(String msg);\n\n void errorMeetingCompletedInfo(String msg);\n void successMeetingCompletedInfo(String msg);\n\n\n void startGetMeetings();\n}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n mContext=this;\n \n invokeWeChat();\n }", "@Override\n public void onClick(View v) {\n Toast.makeText(MainActivity.this, \"Hello World\", Toast.LENGTH_LONG).show();\n }", "@Override\r\n\t\tpublic void onClick(View arg0) {\n\t\t Intent intent =new Intent(Intent.ACTION_CALL);\r\n\t\t intent.setData(Uri.parse(\"tel:101\"));\r\n\t\t startActivity(intent);\r\n\t\t}", "@Override\n public void call(Void aVoid) {\n\n NotificationUtil.getNotificationUtils(MainActivity.this).closeNotification();\n\n }", "@OnClick(R.id.converter_organization_phone_iv)\n public void callToOrg() {\n if (ActivityCompat.checkSelfPermission(CashApplication.getContext(), Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED) {\n new DialogInfoCall(mContext);\n } else {\n Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse(\"tel:\" +\n mMainListForActions.get(mPositionOfCurInList).getOrganizations().get(mPositionOfOrgInList).getPhone()));\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(intent);\n }\n }", "public interface MeetingAddActivityView {\n\n void startMeetingsActivity();\n void successInfo(String msg);\n void errorInfo(String msg);\n void startGetCustomers();\n}", "public abstract void onAsyncRun(View view);", "@Override\n public void onClick(View v) {\n sendMessage(phone_from_intent);\n }", "private void invokeLoaded() \n{\n printDebug(\"calling loaded\");\n Object[] args = new Object[0];\n Object ret = this.getWindow().call(\"loaded\", args);\n}", "@Override\r\n\t\tpublic void onClick(View arg0) {\n\t\t Intent intent =new Intent(Intent.ACTION_CALL);\r\n\t\t intent.setData(Uri.parse(\"tel:1091\"));\r\n\t\t startActivity(intent);\r\n\t\t}", "protected void startRegActivity() {\n }", "public interface MainView extends MvpView{\n void startAnekdotActivity(int type);\n}", "@Override\r\n\t\tpublic void onClick(View arg0) {\n\t\t Intent intent =new Intent(Intent.ACTION_CALL);\r\n\t\t intent.setData(Uri.parse(\"tel:103\"));\r\n\t\t startActivity(intent);\r\n\t\t}", "@Override\r\n\t\tpublic void onClick(View arg0) {\n\t\t Intent intent =new Intent(Intent.ACTION_CALL);\r\n\t\t intent.setData(Uri.parse(\"tel:1073\"));\r\n\t\t startActivity(intent);\r\n\t\t}", "public void ClickAceptar(View view){\n\n }", "public void onActivation() { }", "public abstract void onOneClick(View v);", "public void displayData(View view) {\n\n }", "@Override\r\n\t\tpublic void onClick(View arg0) {\n\t\t Intent intent =new Intent(Intent.ACTION_CALL);\r\n\t\t intent.setData(Uri.parse(\"tel:1407\"));\r\n\t\t startActivity(intent);\r\n\t\t}", "public void onClick(View v) {\n moveTaskToBack(true);\n\n //membuat method tombol keluar dari aplikasi\n\n }", "void mChapie(){\n Intent i = new Intent(context,Peminjaman.class);\n context.startActivity(i);\n\n }", "public Call_simple() {\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tstartThread();\n\t\t\t Toast.makeText(getContext(), \"Êղسɹ¦\", 1).show();\n\t\t\t}", "@Override\n\t\t\tpublic void onResponse(String arg0) {\n\t\t\t\tToast.makeText(MainActivity.this, arg0, Toast.LENGTH_SHORT).show();\n\t\t\t}", "@Override\n\tprotected void onHandleIntent(Intent arg0) {\n\t\t\n\t}", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tbotonOnClick();\n\t\t\t}", "public void makeCall(Context context){\n dbAdapter = new ContactsDbAdapter(context);\n dbAdapter.open();\n\n Cursor contactsCursor= dbAdapter.fetchAllContacts();\n if (contactsCursor.getCount()!=0){\n contactsCursor.moveToFirst();\n\n System.out.println(\"NOMBRE: \" + contactsCursor.getString(1));\n System.out.println(\"TELEFONO: \" + contactsCursor.getString(2));\n phoneNumber=contactsCursor.getString(2);\n\n try{\n\n System.out.println(\"ey\");\n\n if(ContextCompat.checkSelfPermission(context, Manifest.permission.CALL_PHONE)\n != PackageManager.PERMISSION_GRANTED){\n\n System.out.println(\"No hay permiso de llamada\");\n\n }\n\n Intent intentLlamada = new Intent(Intent.ACTION_CALL, Uri.parse(\"tel:\"+phoneNumber));\n intentLlamada.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n context.startActivity(intentLlamada);\n\n } catch (Exception e){\n System.out.println(\"err\");\n e.printStackTrace();\n }\n\n }\n\n\n\n }", "@Override\n public void onClick(View v) {\n CustomToast.show(getContext(),\"Service will be available Soon\");\n }", "@Override\n public void onClick(View v) {\n AsyncCallGetProducts task = new AsyncCallGetProducts(MainActivity.this);\n task.execute();\n }", "@Override\n public void onActivityCreated(Activity activity, Bundle bundle) {\n }", "public void mo1401a(Intent intent) {\n }", "private void link(MainActivity pActivity) {\n\n\t\t}", "@Override\n public void onClick(View view) {\n sendRequest();\n }", "public void onClick(View arg0) {\r\n\t\t\t\t}", "@OnClick(R.id.tv_guankan)\n public void guankan() {\n\n }", "@Override\n\t\t\tpublic void onResponse(String arg0) {\n\t\t\t\tToast.makeText(MainActivity.this, arg0, Toast.LENGTH_LONG).show();\n\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\t\t\tmCurriculumVitaeInterface.onNative();\n\t\t\t\t\t\t}", "@Override\r\n\t\tpublic void onClick(View arg0) {\n\t\t Intent intent =new Intent(Intent.ACTION_CALL);\r\n\t\t intent.setData(Uri.parse(\"tel:1031\"));\r\n\t\t startActivity(intent);\r\n\t\t}", "public abstract void onOpen();", "@Override\r\n public void onClick(View view) {\n\r\n getData();\r\n }", "@Override\n public void onClick(View v) {\n Intent intent=new Intent(Intent.ACTION_CALL_BUTTON);\n //intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(intent);\n }", "void onClick();", "@Override\n public void onClick(View v) {\n Toast.makeText(getContext(),\"hey uuuu clicked me \",Toast.LENGTH_SHORT).show();\n }", "@Override\n public void run() {\n startActivity(intent);\n }", "public void verHistorialCitas(View view){\n\n }", "public void onClick(View view){\n }" ]
[ "0.71722746", "0.6789677", "0.6576399", "0.6316624", "0.62190235", "0.62097955", "0.62097955", "0.61807615", "0.6166924", "0.6100285", "0.60562253", "0.60250235", "0.59709", "0.5968592", "0.5959516", "0.59445465", "0.59104204", "0.589686", "0.5896026", "0.5880858", "0.5880263", "0.5869882", "0.584792", "0.58400494", "0.583621", "0.58316493", "0.5817806", "0.58167034", "0.57940304", "0.5793265", "0.5789341", "0.5781047", "0.5743033", "0.5732654", "0.5716478", "0.5694246", "0.568326", "0.56826204", "0.5678615", "0.56736517", "0.5663612", "0.5663246", "0.5655064", "0.5639765", "0.56343734", "0.5629816", "0.5628575", "0.56274176", "0.56107104", "0.56051457", "0.5604234", "0.5601408", "0.5599824", "0.5598005", "0.5595808", "0.5594405", "0.55888844", "0.55831003", "0.55748487", "0.55735767", "0.557254", "0.55711126", "0.5568216", "0.5565654", "0.5562996", "0.5553511", "0.5544578", "0.55436987", "0.5543071", "0.5533558", "0.55332947", "0.553244", "0.5531547", "0.55312127", "0.5531101", "0.5528308", "0.55263835", "0.55245674", "0.552028", "0.55175364", "0.55170906", "0.5511688", "0.5505302", "0.55045974", "0.5499511", "0.549335", "0.5493146", "0.54786074", "0.54749686", "0.5474701", "0.54716885", "0.5469479", "0.5466723", "0.5465433", "0.5464807", "0.5457874", "0.5453089", "0.54460084", "0.54442996", "0.5443116" ]
0.63486224
3
gets a value from string file
public String getS(String name){ String packageName = activity.getPackageName(); int resId = activity.getResources().getIdentifier(name, "string", packageName); return activity.getString(resId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String get(String key) {\n\t\t//get this file's text\n\t\tString text = FileIO.read(this.getPath());\n\t\tString value = null;\n\t\ttry {\n\t\t\t//try matching the pattern: key : value\\n \n\t\t\tPattern pattern = Pattern.compile(key+\" : (.*?)\\n\");\n\t\t\t\n\t\t\tMatcher matcher = pattern.matcher(text);\n\t\t\tmatcher.find();\n\t\t\t\n\t\t\t//get the value\n\t\t\tvalue = matcher.group(1);\n\t\t\t\n\t\t}catch(Exception e) {/*do nothing*/}\n\t\t\n\t\treturn value;\n\t}", "public static String readValue(String filePath, String key) {\n\t\tProperties props = new Properties();\n\t\tString value = new String();\n\t\ttry {\n\t\t\tInputStream in = new BufferedInputStream(new FileInputStream(\n\t\t\t\t\tfilePath));\n\t\t\tprops.load(in);\n\t\t\tvalue = props.getProperty(key);\n\t\t\tSystem.out.println(key + \":\" + value);\n\t\t\treturn value;\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn value;\n\t\t}\n\t}", "public void get(String file) {\n\n }", "String readString();", "public static String getStringFromFile(String filename) {\n if (Logger.get().isDebug()) {\n Logger.debug(\"Reading file {}\", filename);\n }\n List<String> read = FileKit.readLines(filename);\n if (!read.isEmpty()) {\n if (Logger.get().isTrace()) {\n Logger.trace(\"Read {}\", read.get(0));\n }\n return read.get(0);\n }\n return Normal.EMPTY;\n }", "public String get(String key) {\n\t\tif (fileData.containsKey(key)) {\n\t\t\treturn fileData.get(key);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"Couldn't find \" + key);\n\t\t\treturn \"\";\n\t\t}\n\t}", "public static String getStringFromFile(String filename) {\r\n try {\r\n FileInputStream fis = new FileInputStream(filename);\r\n int available = fis.available();\r\n byte buffer[] = new byte[available];\r\n fis.read(buffer);\r\n fis.close();\r\n\r\n String tmp = new String(buffer);\r\n //System.out.println(\"\\nfrom file:\"+filename+\":\\n\"+tmp);\r\n return tmp;\r\n\r\n } catch (Exception ex) {\r\n // System.out.println(ex);\r\n // ex.printStackTrace();\r\n return \"\";\r\n } // endtry\r\n }", "public abstract void readFromFile(String key, String value);", "private String getStringFromFile() throws FileNotFoundException {\n String contents;\n FileInputStream fis = new FileInputStream(f);\n StringBuilder stringBuilder = new StringBuilder();\n try {\n InputStreamReader inputStreamReader = new InputStreamReader(fis, \"UTF-8\");\n BufferedReader reader = new BufferedReader(inputStreamReader);\n String line = reader.readLine();\n while (line != null) {\n stringBuilder.append(line).append('\\n');\n line = reader.readLine();\n }\n } catch (IOException e) {\n // Error occurred when opening raw file for reading.\n } finally {\n contents = stringBuilder.toString();\n }\n return contents;\n }", "public String readFileIntoString(String filepath) throws IOException;", "public static String readPropertyFile(String pathofFile, String Key)\r\n\t\t{\r\n\t\t\tString value = \"\";\r\n\t\t\treturn value;\r\n\t\t}", "public String get(String content)\n {\n String nValue = \"\";\n \n try {\n FileInputStream input;\n if(Global.dataFile ==null)\n {\n input = new FileInputStream(Global.workDir+\"\\\\TestData\\\\licensing.xls\");\n }\n else if((Global.dataFile.equals(\"\")))\n {\n input = new FileInputStream(Global.workDir+\"\\\\TestData\\\\licensing.xls\");\n }\n else\n {\n input = new FileInputStream(Global.dataFile);\n }\n HSSFWorkbook wb = new HSSFWorkbook(input);\n HSSFSheet sheet = wb.getSheetAt(0);\n nValue = findValue(sheet, content);\n return nValue;\n } catch (Exception e) {\n // TODO Auto-generated catch block\n// e.printStackTrace();\n return nValue=\"\";\n } \n }", "String read();", "String read();", "public static String getStringFromFile(String filename) {\r\n BufferedReader br = null;\r\n StringBuilder sb = new StringBuilder();\r\n try {\r\n br = new BufferedReader(new FileReader(filename));\r\n try {\r\n String s;\r\n while ((s = br.readLine()) != null) {\r\n sb.append(s);\r\n sb.append(\"\\n\");\r\n }\r\n } finally {\r\n br.close();\r\n }\r\n } catch (IOException ex) {\r\n ex.printStackTrace();\r\n }\r\n\r\n return sb.toString();\r\n }", "private String readStringFromFile(final File file) {\n try {\n FileInputStream fin = new FileInputStream(file);\n BufferedReader reader = new BufferedReader(new InputStreamReader(fin));\n StringBuilder sb = new StringBuilder();\n String line = null;\n while ((line = reader.readLine()) != null) {\n sb.append(line).append(\"\\n\");\n }\n reader.close();\n String result = sb.toString();\n fin.close();\n return result;\n } catch (IOException ioEx) {\n Log.e(TAG, \"Error reading String from a file: \" + ioEx.getLocalizedMessage());\n }\n return null;\n }", "public static String readOneString(String fileName)throws FileNotFoundException{\r\n StringBuilder sb=new StringBuilder();\r\n fileExists(fileName);\r\n log.fine(\"Reading one string from file: \"+fileName);\r\n try {\r\n BufferedReader in=new BufferedReader(new FileReader(fileName));\r\n try {\r\n String s;\r\n s=in.readLine();\r\n if(s==null){\r\n return null;\r\n }\r\n sb.append(s);\r\n }finally {\r\n in.close();\r\n }\r\n }catch (IOException e){\r\n throw new RuntimeException(e);\r\n }\r\n return sb.toString();\r\n }", "public static String readFileToString (File file) {\n try {\n final var END_OF_FILE = \"\\\\z\";\n var input = new Scanner(file);\n input.useDelimiter(END_OF_FILE);\n var result = input.next();\n input.close();\n return result;\n }\n catch(IOException e){\n return \"\";\n }\n }", "public static String givestring(String file_name)\n\t {\n\t \tString s=\"\";\n\t \tString r=\"\";\n\t \tFile file=new File(file_name);\n\t \ttry\n\t \t{\n\t \t\tScanner scan=new Scanner(file);\n\t \t\twhile(scan.hasNextLine())\n\t \t\t{\n\t \t\t\ts=scan.nextLine();\n\t \t\t\ts=checkString(s);\n\t \t\t\tr+=s;\n\t \t\t}\n\t \t}\n\t \tcatch (FileNotFoundException e)\n\t \t {\n System.out.println(\"Sorry Invalid file name\");\n // System.out.println(\"Please try again\");\n // Scanner sc=new Scanner(System.in);\n // String ss=sc.nextLine();\n // givestring(ss);\n \t\t }\n\t \n // System.out.println(r);\nreturn r;\n\t }", "public File getFileValue();", "public static String getPropertyValue(String filename,String variable) {\n\t\tProperties prop = new Properties();\n\t\tInputStream input = null;\n\t\tString result;\n\t\tString home = System.getProperty(\"conf.dir\");\n\t\ttry {\n\t\t\tinput = new FileInputStream(home+\"/\"+filename);\n\t\t\tprop.load(input);\n\t\t\tresult=prop.getProperty(variable);\n\t\t} catch (IOException e) {\n\t\t\tlogger.error(\"Error occured while getting properties: \",e);\n\t\t\tresult=null;\n\t\t}\n\t\treturn result;\n\t}", "public static String getStringFromFile(String s, String dir) throws IOException {\n return getStringFromFile(dir + s);\n }", "public final String getStringFromFile(final int length) throws IOException {\r\n\r\n if (length <= 0) {\r\n return new String(\"\");\r\n }\r\n\r\n byte[] b = new byte[length];\r\n raFile.readFully(b);\r\n final String s = new String(b);\r\n b = null;\r\n return s;\r\n }", "public abstract String read_string();", "String getPropertyValue(String filename, String lang, String key);", "public static String getStringFromFile(String s, String dir, String path) throws IOException {\n return getStringFromFile(path + dir + s);\n }", "public String read();", "public String readStringFromFileSafe(String filename) {\r\n\t\tString result = null;\r\n\t\ttry {\r\n\t\t\tresult = readStringFromFile(filename);\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\thandleFileNotFoundException(e, filename);\r\n\t\t} catch (IOException e) {\r\n\t\t\thandleIOException(e, filename);\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "Text getValue() throws IOException;", "public static String getString(final String value) {\n\t\treturn PropertyFileReader.property.getProperty(value);\n\t}", "private static String loadFile(String path){\n try {\n\n BufferedReader reader = new BufferedReader(new FileReader(path));\n StringBuilder sb = new StringBuilder();\n\n String line;\n while((line = reader.readLine()) != null){\n sb.append(line);\n sb.append('\\n');\n }\n\n reader.close();\n return sb.toString();\n\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n return null;\n } catch (IOException e) {\n e.printStackTrace();\n return null;\n }\n }", "private static String loadFile(File file) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new FileReader(file));\n\t\treturn br.readLine();\n\t}", "public String parse(File file);", "public String getString(String path) {\n\n String string;\n\n if (configuration.contains(path))\n string = configuration.getString(path);\n else string = defaultConfig.getString(path);\n\n if (string != null)\n if (string.contains(\"&\")) string = string.replaceAll(\"&\", \"§\");\n\n return string;\n }", "private static String loadToken(File file, String key) throws IOException {\n \t\tProperties properties = loadProperties(file);\n \t\tString token = (String) properties.get(key);\n \t\tif (StringUtils.isEmpty(token))\n \t\t\treturn null;\n \t\treturn token;\n \t}", "String getStringValue();", "String getStringValue();", "public static String getStoredString(String filePath, int chars) throws IOException {\r\n\r\n\t\tFile f1 = new File(filePath);\r\n\t\tFileReader fr = new FileReader(f1);\r\n\t\tchar[] chras = new char[chars];\r\n\t\tfr.read(chras);\r\n\t\tString s = new String(chras);\r\n\t\tSystem.out.println(\"The stored String is : \" + s);\r\n\t\tfr.close();\r\n\t\treturn s;\r\n\r\n\t}", "String getFile();", "String getFile();", "String getFile();", "private String getStringStat(int index) {\n String[] scores = readFromFile().split(\"\\n\");\n String[] stats = scores[currPlayer].split(\",\");\n return stats[index];\n }", "public static String readFile() {\n\t\tFileReader file;\n\t\tString textFile = \"\";\n\n\t\ttry {\n\t\t\tfile = new FileReader(path);\n\n\t\t\t// Output string.\n\t\t\ttextFile = new String();\n\n\t\t\tBufferedReader bfr = new BufferedReader(file);\n\n\t\t\ttextFile= bfr.readLine();\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error reading the file\");\n\t\t}\n\t\treturn textFile;\n\n\t}", "String input() {\n\n try {\n\n FileReader reader = new FileReader(\"the text.txt\");\n BufferedReader bufferedReader = new BufferedReader(reader);\n StringBuilder builder = new StringBuilder();\n String line;\n\n while ((line = bufferedReader.readLine()) != null)\n builder.append(line);\n\n return builder.toString();\n\n } catch (IOException e) {\n\n System.out.println(\"Input Failure\");\n return null;\n }\n }", "public String getStringFile(){\n return fileView(file);\n }", "public String readValue(final String name) {\r\n\r\n\t\tfinal StringTokenizer tok = new StringTokenizer(name, \".\");\r\n\t\twhile (tok.hasMoreTokens()) {\r\n\t\t\tfinal String subName = tok.nextToken();\r\n\t\t\tif (!readNextTag(subName)) {\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn readNextText(this.in.getTag().getName());\r\n\t}", "private static String readFile(File file) {\n String result = \"\";\n\n try (BufferedReader bufferedReader = new BufferedReader(\n new FileReader(file))) {\n result = bufferedReader.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return result;\n }", "public String readFromFile(String path) {\n BufferedReader br = null;\n String returnString =\"\";\n try {\n String sCurrentLine;\n br = new BufferedReader(new FileReader(path));\n while ((sCurrentLine = br.readLine()) != null) {\n returnString+=sCurrentLine;\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 return returnString;\n }", "public String getString(String path) {\n return yml.getString(path);\n }", "String readScore(){\n try\n {\n char[] allAtOnce = new char[(int)scores.length()];\n int charsRead = fr.read(allAtOnce);\n currentScores = String.valueOf(allAtOnce);\n fr.close();//close the file\n fr = new BufferedReader(new FileReader(scores));\n }\n \n catch(IOException e)\n {\n e.printStackTrace();\n }\n return (String.valueOf(currentScores));\n }", "public static String getStringFromFile(Context context, String filePath) throws IOException {\n final InputStream stream = context.getResources().getAssets().open(filePath);\n String ret = convertStreamToString(stream);\n stream.close();\n return ret;\n }", "public String FetchDataFromFile(File file) {\r\n\t\tStringBuilder sb=new StringBuilder();\r\n\t\ttry {\r\n\t\t\tScanner sc=new Scanner(file);\r\n\t\t\twhile(sc.hasNextLine()){\r\n\t\t\t\tsb.append(sc.nextLine());\r\n\t\t\t}\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn sb.toString();\r\n\t}", "private String readAndReplaceString(String fileName, String packageName, String className) {\n String baseFilePath = \"com.bgn.baseframe.base\";\n\n String time = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\").format(new Date());\n String path = (codeType == 0 ? \"kotlin/\" : \"java/\");\n return readFile(path + fileName + \".txt\")\n .replace(\"&time&\", time)\n .replace(\"&package&\", packageName)\n .replace(\"&mvp&\", baseFilePath)\n .replace(\"&className&\", className);\n }", "public static String readFromFile(String filename, String username) {\n\n // Read in the file from top to bottom\n ArrayList<String> tmp = new ArrayList<>();\n String ch;\n\n try {\n FileReader fr = new FileReader(PATH + filename);\n BufferedReader br = new BufferedReader(fr);\n\n do {\n ch = br.readLine();\n tmp.add(ch);\n } while (ch != null);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n // Read the array from the back to the front.\n // There's an extra blank line at the bottom of the file so its -2\n for (int i = (tmp.size() - 2); i >= 0; i--) {\n String[] parts = tmp.get(i).split(Utilities.PARSE_SPLITTER_FIELD);\n if (parts[0].equals(username)) {\n return tmp.get(i);\n }\n }\n\n return null;\n }", "java.lang.String getStringValue();", "java.lang.String getStringValue();", "private String getStringProperty(ParameterList key, boolean isFile) \n throws NumberFormatException, NullPointerException, MissingOptionException{\n try {\n boolean keyPresent = fileParameters.containsKey(key.name);\n String strValue = keyPresent ? fileParameters.getProperty(key.name).replaceAll(\"\\\\s\", \"\") : null;\n if (!keyPresent && key.mandatory) {\n throw new MissingOptionException(\"Input parameter not found: \" + key.name);\n }\n else if(!keyPresent){\n return null;\n }\n if(isFile){\n strValue = strValue.replaceFirst(\"^~\",System.getProperty(\"user.home\"));\n }\n loadedParametersLog.append(key.name).append(\"=\").append(strValue).append(\"\\n\");\n return strValue;\n } catch (NullPointerException e) {\n throw new NullPointerException(e.getMessage() + \"\\nThe parameter file was not initialized.\");\n }\n }", "@Test\n public void testGetValue()\n {\n System.out.println(\"getValue\");\n final File file = new File(\"src/test/data/test.example.txt\");\n final Lexer lexer = new Lexer();\n final Token token = lexer.analyze(file);\n assertEquals(Syntax.LABEL, token.getSyntax());\n assertEquals(1, token.getLine());\n assertEquals(1, token.getPosition());\n assertEquals(Vocabulary.COMPONENT, token.getValue());\n }", "String readText(FsPath path);", "@SuppressWarnings(\"IfStatementWithIdenticalBranches\")\n public final String getPropertyFromFile(final String key) {\n final var file = this.getPropertyCatalog();\n String data = \"\";\n File prop = new File(file);\n if (!prop.exists() || prop.length() == 0) {\n data = \"Refuse.Missing property file.\";\n } else {\n try (BufferedReader reader = new BufferedReader(\n new FileReader(file))) {\n String line;\n while ((line = reader.readLine()) != null) {\n if (line.contains(\"=\") && line.contains(key)) {\n if (line.split(\"=\").length >= 2) {\n data = line.split(\"=\")[1];\n break;\n } else {\n data = \"abuse parameter.\";\n break;\n }\n }\n }\n } catch (IOException e) {\n data = \"Refuse.Mistake in-out property file.\";\n }\n }\n return data;\n }", "private String getValue(Part part) {\n\n\t\tStringBuilder sb = new StringBuilder();\n\n\t\ttry (BufferedReader reader = new BufferedReader(new InputStreamReader(part.getInputStream()));) {\n\n\t\t\tString line;\n\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\tsb.append(line);\n\t\t\t}\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn sb.toString();\n\t}", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "public String readProperty(String property, String sFilePath) throws Exception {\n try {\n return readPropertyFile(sFilePath).get(property);\n } catch (Exception e) {\n throw new Exception(\"readProperty : \" + e.toString());\n }\n }", "private static String file2string(String file) {\n StringBuilder sb = new StringBuilder();\n try {\n BufferedReader br = new BufferedReader(new FileReader(new File(file)));\n String line;\n\n while ((line = br.readLine()) != null) {\n sb.append(line);\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n return (sb != null) ? sb.toString() : \"\";\n }", "private String getFileContent(String filePath) {\r\n\r\n\t\ttry {\r\n\t\t\tString text = new String(Files.readAllBytes(Paths.get(filePath)), StandardCharsets.UTF_8);\r\n\t\t\treturn text;\r\n\t\t} catch (Exception ex) {\r\n\t\t\treturn \"-1\";\r\n\t\t}\r\n\t}", "String readFile( String filename ) {\n try {\n FileReader fileReader = new FileReader( filename );\n BufferedReader bufferedReader = new BufferedReader( fileReader );\n StringBuilder stringBuilder = new StringBuilder();\n String line = bufferedReader.readLine();\n while( line != null ) {\n stringBuilder.append( line );\n stringBuilder.append( \"\\n\" );\n line = bufferedReader.readLine();\n }\n bufferedReader.close();\n fileReader.close();\n return stringBuilder.toString();\n } catch( Exception e ) {\n playerObjects.getLogFile().WriteLine( Formatting.exceptionToStackTrace( e ) );\n return null;\n }\n }", "public static String getFileContentsAsString(String filename) {\n\n // Java uses Paths as an operating system-independent specification of the location of files.\n // In this case, we're looking for files that are in a directory called 'data' located in the\n // root directory of the project, which is the 'current working directory'.\n final Path path = FileSystems.getDefault().getPath(\"Resources\", filename);\n\n try {\n // Read all of the bytes out of the file specified by 'path' and then convert those bytes\n // into a Java String. Because this operation can fail if the file doesn't exist, we\n // include this in a try/catch block\n return new String(Files.readAllBytes(path));\n } catch (IOException e) {\n // Since we couldn't find the file, there is no point in trying to continue. Let the\n // user know what happened and exit the run of the program. Note: we're only exiting\n // in this way because we haven't talked about exceptions and throwing them in CS 126 yet.\n System.out.println(\"Couldn't find file: \" + filename);\n System.exit(-1);\n return null; // note that this return will never execute, but Java wants it there.\n }\n }", "public String getFileContent(String filename){\n\t\tString output = \"\";\n\t\tfor(String s : files.keySet()){\n\t\t\tif(s.equals(filename.trim())){\n\t\t\t\toutput = files.get(s);\n\t\t\t\treturn output;\n\t\t\t}\n\t\t}\n\t\treturn \"File does not exist\";\n\t}", "@Test\r\n\tpublic void testGetString() {\r\n\t\tString s = lattice1.getString();\r\n\t\tString ss = \"[10. 6. 4.](12.328828005937952)\"\r\n\t\t\t\t+ \"[7. 11. 5.](13.96424004376894)\"\r\n\t\t\t\t+ \"[6.8 -4. -9.](11.968291440301744)\";\r\n\t\tAssert.assertEquals(\"getString\", s, ss);\r\n\t}", "public String ReadFile(String sFilePath) throws Exception {\n File f = null;\n FileInputStream fstream = null;\n String stemp = \"\";\n try {\n //getting file oject\n f = new File(sFilePath);\n //get object for fileinputstream\n fstream = new FileInputStream(f);\n //getting byte array length\n byte data[] = new byte[fstream.available()];\n //getting file stream data into byte array\n fstream.read(data);\n //storing byte array data into String\n stemp = new String(data);\n return stemp;\n } catch (Exception e) {\n throw new Exception(\"ReadFile : \" + e.toString());\n } finally {\n try {\n fstream.close();\n } catch (Exception e) {\n }\n }\n }", "String getVal();", "private String loadAsString(final String path) {\n try (InputStream inputStream = Thread.currentThread()\n .getContextClassLoader().getResourceAsStream(path)) {\n return new Scanner(inputStream).useDelimiter(\"\\\\A\").next();\n } catch (IOException e) {\n throw new RuntimeException(\"Unable to close input stream.\", e);\n }\n }", "int get(String w);", "public static String readString(String file) throws IOException\n {\n try(InputStream in = getInputStream(file); BufferedReader reader = new BufferedReader(new InputStreamReader(in)))\n {\n StringBuilder builder = new StringBuilder();\n String line;\n while((line = reader.readLine()) != null)\n builder.append(line).append(\"\\n\");\n\n return builder.toString();\n }\n }", "public String readFromFile(String filePath){\n String fileData = \"\";\n try{\n File myFile = new File(filePath);\n Scanner myReader = new Scanner(myFile);\n while (myReader.hasNextLine()){\n String data = myReader.nextLine();\n fileData += data+\"\\n\";\n }\n myReader.close();\n } catch(FileNotFoundException e) {\n System.out.println(\"An error occurred.\");\n e.printStackTrace();\n }\n return fileData;\n }", "public static String getVersion() {\n\t\t String data = \"\";\n\t\ttry {\n\t\t File myObj = new File(rootdir+\"/version.txt\");\n\t Scanner myReader = new Scanner(myObj);\n\t while (myReader.hasNextLine()) {\n\t data = myReader.nextLine();\n\t break;\n\t }\n\t myReader.close();\n\t return data;\n\t } catch (FileNotFoundException e) {\n\t \tSystem.out.println(\"An error occurred.\");\n\t \te.printStackTrace();\n\t }\n\t\treturn null;\n\t}", "public @Nullable String valueFor(File file, String key) {\n StringBuilder pathBuilder = new StringBuilder(file.getAbsolutePath().length());\n boolean isDirectory = file.isDirectory();\n File parent = file.getParentFile();\n\n pathBuilder.append(file.getName());\n while (parent != null) {\n String path = pathBuilder.toString();\n\n String value = findAttributeInRules(path, isDirectory, key, getRulesForFolder(parent));\n if (value != null) {\n return value;\n }\n\n pathBuilder.insert(0, parent.getName() + \"/\");\n parent = parent.getParentFile();\n }\n return null;\n }", "public String getData(String fileName) {\n StringBuffer sb = new StringBuffer();\n try {\n BufferedReader br = new BufferedReader(new FileReader(fileName));\n String line = br.readLine();\n while (line != null) {\n sb.append(line).append(\"\\n\");\n line = br.readLine();\n }\n br.close();\n } catch (IOException e) {\n System.out.println(\"NO SE\");\n }\n return sb.toString();\n }", "public static String getAsString(File file) {\n\t\tInputStream is = null;\n\t\ttry {\n\t\t\tis = new FileInputStream(file);\n\t\t\tString rtn = getAsString(is);\n\t\t\treturn rtn;\n\t\t} catch (Exception exp) {\n\t\t\tthrow new RuntimeException(exp);\n\t\t} finally {\n\t\t\tif (is != null) {\n\t\t\t\ttry {\n\t\t\t\t\tis.close();\n\t\t\t\t} catch (Exception exp) {\n\t\t\t\t\tthrow new RuntimeException(exp);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void readFromFile() {\n\t\tPath filePath = Paths.get(inputFile);\n\n\t\ttry (BufferedReader reader = Files.newBufferedReader(filePath,\n\t\t\t\tCharset.forName(\"UTF-8\"));) {\n\t\t\tString line = null;\n\n\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\tString[] splitLine = line.split(\",\");\n\t\t\t\tcurrentGen.setValue(Integer.parseInt(splitLine[0]),\n\t\t\t\t\t\tInteger.parseInt(splitLine[1]), true);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Could not find file provided.\");\n\t\t}\n\t}", "public String readFileContents(String filename) {\n return null;\n\n }", "private String readFile() {\n try {\n BufferedReader in = new BufferedReader(new FileReader(\"C:\\\\Users\"\n + \"\\\\MohammadLoqman\\\\cs61b\\\\sp19-s1547\"\n + \"\\\\proj3\\\\byow\\\\Core\\\\previousGame.txt\"));\n StringBuilder sb = new StringBuilder();\n String toLoad;\n try {\n toLoad = in.readLine();\n while (toLoad != null) {\n sb.append(toLoad);\n sb.append(System.lineSeparator());\n toLoad = in.readLine();\n }\n String everything = sb.toString();\n return everything;\n } catch (IOException E) {\n System.out.println(\"do nothin\");\n }\n } catch (FileNotFoundException e) {\n System.out.println(\"file not found\");\n }\n return null;\n\n }", "public static String read(File loc) throws FileNotFoundException {\n\r\n\t\tString st = \"\";\r\n\r\n\t\tScanner x = new Scanner(loc);\r\n\r\n\t\twhile (x.hasNextLine()) {\r\n\t\t\tst += x.nextLine() + \"\\n\";\r\n\t\t}\r\n\r\n\t\tx.close();\r\n\r\n\t\treturn st;\r\n\t}", "public String getString (String path) {\r\n\t\treturn getTextStructure(path, \"\");\r\n\t}", "public String readFile(String fName) {\n String msg=\"\";\n try {\n File theFile = new File(fName);\n InputStreamReader iStream = new InputStreamReader(new FileInputStream(theFile));\n int length = (int)theFile.length();\n char input[] = new char[length];\n iStream.read(input);\n msg = new String(input);\n } catch (IOException e) {\n e.printStackTrace();\n } // catch\n return msg;\n }", "private static java.lang.String readStringFromFile(java.io.File r9) {\n /*\n r5 = 0\n r3 = 0\n java.io.FileReader r4 = new java.io.FileReader // Catch:{ FileNotFoundException -> 0x0059, IOException -> 0x0038 }\n r4.<init>(r9) // Catch:{ FileNotFoundException -> 0x0059, IOException -> 0x0038 }\n r7 = 128(0x80, float:1.794E-43)\n char[] r0 = new char[r7] // Catch:{ FileNotFoundException -> 0x001b, IOException -> 0x0056, all -> 0x0053 }\n java.lang.StringBuilder r6 = new java.lang.StringBuilder // Catch:{ FileNotFoundException -> 0x001b, IOException -> 0x0056, all -> 0x0053 }\n r6.<init>() // Catch:{ FileNotFoundException -> 0x001b, IOException -> 0x0056, all -> 0x0053 }\n L_0x0010:\n int r1 = r4.read(r0) // Catch:{ FileNotFoundException -> 0x001b, IOException -> 0x0056, all -> 0x0053 }\n if (r1 <= 0) goto L_0x002a\n r7 = 0\n r6.append(r0, r7, r1) // Catch:{ FileNotFoundException -> 0x001b, IOException -> 0x0056, all -> 0x0053 }\n goto L_0x0010\n L_0x001b:\n r2 = move-exception\n r3 = r4\n L_0x001d:\n java.lang.String r7 = \"PluginNativeHelper\"\n java.lang.String r8 = \"cannot find file to read\"\n com.tencent.component.utils.log.LogUtil.d(r7, r8, r2) // Catch:{ all -> 0x0048 }\n if (r3 == 0) goto L_0x0029\n r3.close() // Catch:{ IOException -> 0x004f }\n L_0x0029:\n return r5\n L_0x002a:\n java.lang.String r5 = r6.toString() // Catch:{ FileNotFoundException -> 0x001b, IOException -> 0x0056, all -> 0x0053 }\n if (r4 == 0) goto L_0x005b\n r4.close() // Catch:{ IOException -> 0x0035 }\n r3 = r4\n goto L_0x0029\n L_0x0035:\n r7 = move-exception\n r3 = r4\n goto L_0x0029\n L_0x0038:\n r2 = move-exception\n L_0x0039:\n java.lang.String r7 = \"PluginNativeHelper\"\n java.lang.String r8 = \"error occurs while reading file\"\n com.tencent.component.utils.log.LogUtil.d(r7, r8, r2) // Catch:{ all -> 0x0048 }\n if (r3 == 0) goto L_0x0029\n r3.close() // Catch:{ IOException -> 0x0046 }\n goto L_0x0029\n L_0x0046:\n r7 = move-exception\n goto L_0x0029\n L_0x0048:\n r7 = move-exception\n L_0x0049:\n if (r3 == 0) goto L_0x004e\n r3.close() // Catch:{ IOException -> 0x0051 }\n L_0x004e:\n throw r7\n L_0x004f:\n r7 = move-exception\n goto L_0x0029\n L_0x0051:\n r8 = move-exception\n goto L_0x004e\n L_0x0053:\n r7 = move-exception\n r3 = r4\n goto L_0x0049\n L_0x0056:\n r2 = move-exception\n r3 = r4\n goto L_0x0039\n L_0x0059:\n r2 = move-exception\n goto L_0x001d\n L_0x005b:\n r3 = r4\n goto L_0x0029\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.tencent.component.plugin.PluginNativeHelper.readStringFromFile(java.io.File):java.lang.String\");\n }", "public String getValue(String s) {\n return s;\n }", "private Object[] fetchTextFile(String filePathString){\n try (Stream<String> stream = Files.lines(Paths.get(filePathString))) {\n return stream.toArray();\n }\n catch (IOException ioe){\n System.out.println(\"Could not find file at \" + filePathString);\n return null;\n }\n\n }", "public T fileGet(String str, File file, AjaxStatus ajaxStatus) {\n byte[] bArr;\n try {\n if (isStreamingContent()) {\n ajaxStatus.file(file);\n bArr = null;\n } else {\n bArr = AQUtility.toBytes(new FileInputStream(file));\n }\n return transform(str, bArr, ajaxStatus);\n } catch (Exception e) {\n AQUtility.debug((Throwable) e);\n return null;\n }\n }", "@Override\n\tpublic String readBlob() throws PersistBlobException {\n\t\tlog.debug(\"readString: \");\n\t\ttry {\n\t\t\tString contents = FileUtils.readFileToString(new File(full_file_name), \"UTF-8\");\n\t\t\tlog.debug(\"returned string: \"+contents);\n\t\t\treturn contents;\n\t\t} catch (IOException e) {\n\t\t\tthrow new PersistBlobException(\"can not read string\",e);\n\t\t}\n\n\t}", "@Test\n public void getMatchDetailsTest2(){\n try {\n RiotApiHandler userTest=RiotApiHandler.getInstance();\n Path testfile = Path.of(\"matchinfo.txt\");\n String fin = Files.readString(testfile);\n Assert.assertNotEquals(fin,userTest.getMatchDetails(\"EUN1_2775220260\",\"eun1\"));\n }\n catch (IOException exception){\n exception.printStackTrace();\n }\n }", "public String read(String filePath) throws IOException {\r\n\t\t//read file into stream\r\n\t\t\treturn new String(Files.readAllBytes(Paths.get(filePath)));\r\n\t}" ]
[ "0.70479184", "0.6672494", "0.6399947", "0.63267", "0.63096446", "0.626973", "0.624771", "0.6210953", "0.6180019", "0.61542034", "0.61019385", "0.60981727", "0.60959166", "0.60959166", "0.6077414", "0.6065774", "0.6001128", "0.5978617", "0.59555787", "0.5886724", "0.587834", "0.58619964", "0.5848657", "0.58335626", "0.58106965", "0.58084536", "0.57986647", "0.5773371", "0.5750097", "0.5737292", "0.57223296", "0.57219476", "0.57206917", "0.5703384", "0.5692825", "0.5682876", "0.5682876", "0.56807876", "0.5673976", "0.5673976", "0.5673976", "0.56641364", "0.5660705", "0.56538194", "0.5634678", "0.5629057", "0.56256187", "0.561399", "0.56114864", "0.5600805", "0.5592946", "0.5590051", "0.5579286", "0.55786514", "0.55690074", "0.55690074", "0.556487", "0.5564754", "0.55455154", "0.55346", "0.55322146", "0.552431", "0.552431", "0.552431", "0.552431", "0.552431", "0.552431", "0.552431", "0.552431", "0.552431", "0.552431", "0.5515938", "0.55146366", "0.5493835", "0.54863983", "0.5477525", "0.54743457", "0.5467515", "0.5466517", "0.546618", "0.54645884", "0.5460328", "0.5457297", "0.54526484", "0.5451433", "0.545032", "0.54443777", "0.5440772", "0.54361564", "0.5426334", "0.54245675", "0.5421947", "0.54215145", "0.5421008", "0.5416583", "0.5409678", "0.54085225", "0.5406691", "0.5401196", "0.53996843", "0.53947145" ]
0.0
-1
gets a Drawable from Drawable folder
public Drawable getD(String name) { int resourceId = activity.getResources().getIdentifier(name, "drawable", activity.getPackageName()); return activity.getResources().getDrawable(resourceId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Drawable getDrawable(Context context, String path_relative) {\n InputStream ims = null;\n try {\n ims = context.getAssets().open(path_relative);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return Drawable.createFromStream(ims, null);\n }", "public Drawable drawable(int drawableId){\n return ContextCompat.getDrawable(appCtx, drawableId);\n }", "public static Drawable getDrawable(Context context, int idFilme){\n Class<?> c = R.drawable.class;\n try {\n Field idField = c.getField(\"filme\"+Integer.toString(idFilme));\n int id = idField.getInt(idField);\n Drawable imagem = context.getResources().getDrawable(id, null);\n return imagem;\n } catch (NoSuchFieldException e){\n e.printStackTrace();\n } catch (IllegalAccessException e){\n e.printStackTrace();\n }\n\n return context.getResources().getDrawable(R.drawable.movie_padrao);\n }", "public Bitmap drawableBitmap(int drawableId){\n return BitmapFactory.decodeResource(getResources(), drawableId);\n }", "public Drawable _d(int res_id) {\n\t\treturn mContext.getResources().getDrawable(res_id);\n\t}", "public Drawable getDrawable(@NonNull final String key) {\n return getDrawable(key, null);\n }", "@Override\n public Drawable getDrawable(String arg0) {\n int id = 0;\n\n if(arg0.equals(\"trafficpoint.png\")){\n id = R.drawable.trafficpoint;\n }\n\n if(arg0.equals(\"center.png\")){\n id = R.drawable.center;\n }\n\n if(arg0.equals(\"red_traffic_indicator.png\")){\n id = R.drawable.red_traffic_indicator;\n }\n\n if(arg0.equals(\"blue_traffic_indicator.png\")){\n id = R.drawable.blue_traffic_indicator;\n }\n\n if(arg0.equals(\"green_traffic_indicator.png\")){\n id = R.drawable.green_traffic_indicator;\n }\n\n if(arg0.equals(\"yellow_traffic_indicator.png\")){\n id = R.drawable.yellow_traffic_indicator;\n }\n\n if(arg0.equals(\"pink_traffic_indicator.png\")){\n id = R.drawable.pink_traffic_indicator;\n }\n\n LevelListDrawable d = new LevelListDrawable();\n Drawable empty = getResources().getDrawable(id);\n d.addLevel(0, 0, empty);\n d.setBounds(0, 0, empty.getIntrinsicWidth(), empty.getIntrinsicHeight());\n\n return d;\n }", "private Drawable obtainIconFromResource(Integer id, Context context, ComponentName component)\n\t{\n\t\t\n Resources res = null;\n \n try {\n \t \n\t\t\tres = context.getPackageManager().\n\t\t\t\t\tgetResourcesForApplication(component.getPackageName());\n\t\t\n\t\t} catch (NameNotFoundException e) {\n\t\t\tres = null;\n\t\t\te.printStackTrace();\n\t\t}\n if(res != null)\n {\n return res.getDrawable(id);\n }\n\t\treturn null;\n\t}", "@SuppressLint(\"NewApi\")\n public Drawable drawable(int res){\n if (Build.VERSION.SDK_INT < 22){\n return application.getResources().getDrawable(res);\n }\n else{\n return application.getResources().getDrawable(res, null);\n }\n }", "private Drawable obtainIcon(String source, Context context, ComponentName component)\n\t{\n\t\t// if there is resource ID\n\t\ttry{\n\t\tInteger resourceID = Integer.parseInt(source);\n\t\treturn obtainIconFromResource(resourceID, context, component);\n\t\t}catch (Exception e) {}\n\t\tUri uri = Uri.parse(source);\n\t\ttry {\n\t\t\tAssetFileDescriptor file = \n\t\t\t\t\tcontext.getContentResolver().openAssetFileDescriptor(uri, \"r\");\n\t\t\treturn Drawable.createFromStream(file.createInputStream(), null);\n\t\t\t\t\t\t\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\t\t\n\t\treturn null;\n\t}", "private int getDrawableByIcon(String iconID) {\n int icon = 0;\n\n //Get drawable according to iconID\n // xxd are for day and xxn are for night\n switch (iconID) {\n case \"01d\":\n icon = R.drawable.ic_01d;\n break;\n case \"02d\":\n icon = R.drawable.ic_02d;\n break;\n case \"03d\":\n icon = R.drawable.ic_03d;\n break;\n case \"04d\":\n icon = R.drawable.ic_04d;\n break;\n case \"09d\":\n icon = R.drawable.ic_09d;\n break;\n case \"10d\":\n icon = R.drawable.ic_10d;\n break;\n case \"11d\":\n icon = R.drawable.ic_11d;\n break;\n case \"13d\":\n icon = R.drawable.ic_13d;\n break;\n case \"50d\":\n icon = R.drawable.ic_50d;\n break;\n case \"01n\":\n icon = R.drawable.ic_01n;\n break;\n case \"02n\":\n icon = R.drawable.ic_02n;\n break;\n case \"03n\":\n icon = R.drawable.ic_03n;\n break;\n case \"04n\":\n icon = R.drawable.ic_04n;\n break;\n case \"09n\":\n icon = R.drawable.ic_09n;\n break;\n case \"10n\":\n icon = R.drawable.ic_10n;\n break;\n case \"11n\":\n icon = R.drawable.ic_11n;\n break;\n case \"13n\":\n icon = R.drawable.ic_13n;\n break;\n case \"50n\":\n icon = R.drawable.ic_50n;\n break;\n\n }\n return icon;\n }", "public static int getDrawableByString( Context context, String name ) {\n return getResourceByString( context, \"drawable\", name );\n }", "@Override\n\tpublic Drawable getDrawable() {\n\t\tDrawable drawable = null;\n \n if (mDrawable != null) {\n drawable = mDrawable;\n } else if (mContentUri != null) {\n Bitmap bitmap = null;\n try {\n InputStream is = mContext.getContentResolver().openInputStream(\n mContentUri);\n bitmap = BitmapFactory.decodeStream(is);\n drawable = new BitmapDrawable(mContext.getResources(), bitmap);\n drawable.setBounds(0, 0, drawable.getIntrinsicWidth(),\n drawable.getIntrinsicHeight());\n is.close();\n } catch (Exception e) {\n Log.e(\"sms\", \"Failed to loaded content \" + mContentUri, e);\n }\n } else {\n try {\n drawable = mContext.getResources().getDrawable(mResourceId);\n drawable.setBounds(0, 0, drawable.getIntrinsicWidth(),\n drawable.getIntrinsicHeight());\n } catch (Exception e) {\n Log.e(\"sms\", \"Unable to find resource: \" + mResourceId);\n } \n }\n\n return drawable;\n\t}", "public static Drawable getDrawable(Context context, String name)\n\t{\n\t\treturn context.getResources().getDrawable(RR.getDrawableId(name));\n\t}", "public Drawable getDrawable(@NonNull final String key, final Drawable defaultValue) {\n byte[] bytes = realGetBytes(TYPE_DRAWABLE + key);\n if (bytes == null) return defaultValue;\n return bytes2Drawable(bytes);\n }", "public abstract Drawable getIcon();", "public Drawable getDrawable()\n\t {\n\t return drawable;\n\t }", "@Override\n\t\tpublic Drawable getDrawable(String source) {\n\t\t\tURL url;\n\t\t\tDrawable drawable = null;\n\t\t\ttry {\n\t\t\t\turl = new URL(source);\n\t\t\t\tdrawable = Drawable.createFromStream(url.openStream(), null);\n\t\t\t\tif (drawable != null) {\n\t\t\t\t\tint iWidth = drawable.getIntrinsicWidth();\n\t\t\t\t\tint iHeight = drawable.getIntrinsicHeight();\n\t\t\t\t\tint width = CommonUtils\n\t\t\t\t\t\t\t.getScreenWidth(InformationDetailActivity.this)\n\t\t\t\t\t\t\t- DensityUtil.dip2px(\n\t\t\t\t\t\t\t\t\tInformationDetailActivity.this, 10) * 2;\n\t\t\t\t\tint height = CommonUtils.getHeightWithSize(\n\t\t\t\t\t\t\tInformationDetailActivity.this, iWidth, iHeight,\n\t\t\t\t\t\t\twidth);\n\t\t\t\t\tdrawable.setBounds(0, 0, width, height);\n\t\t\t\t}\n\t\t\t} catch (MalformedURLException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\treturn drawable;\n\t\t}", "public Drawable getDrawable() {\n return mDrawable;\n }", "private BitmapDescriptor getMarkerIconFromDrawableForFood() {\r\n Drawable drawable = getResources().getDrawable(R.drawable.ic_food);\r\n Canvas canvas = new Canvas();\r\n Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);\r\n canvas.setBitmap(bitmap);\r\n drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());\r\n drawable.draw(canvas);\r\n return BitmapDescriptorFactory.fromBitmap(bitmap);\r\n }", "public Drawable getDrawableCache(Integer cacheKey)\n {\n synchronized (mLinkedHashMap)\n {\n Drawable image;\n // Get file from cache\n String file = mLinkedHashMap.get(cacheKey);\n if (file != null)\n {\n image = Drawable.createFromPath(file);\n Log.i(\"DiskLruCache\", \"DiskCacheHit\");\n return image;\n }\n else\n {\n // Construct existing file path\n String cacheKeyStr = String.valueOf(cacheKey);\n String existingFile = createFilePath(cacheDirectory, cacheKeyStr);\n // Get the file using the constructed file path\n assert existingFile != null;\n File existFile = new File(existingFile);\n if (existFile.exists())\n {\n // If the file exists, we will store the the key in reference list\n referenceAdd(cacheKey, existingFile);\n return Drawable.createFromPath(existingFile);\n }\n }\n return null;\n }//synchronized (mLinkedHashMap)\n }", "private Drawable getAchievementDrawable(String achievementType){\n int iconID = DrawableGetter.getAchievementDrawable(achievementType);\n return ContextCompat.getDrawable(context,iconID);\n }", "public static Drawable getIcon(int param0) {\n }", "public GifDrawable(Resources res, int id) throws NotFoundException, IOException {\n this(res.openRawResourceFd(id));\n }", "@Override\n\t\t\t\t\tpublic Drawable getDrawable() {\n\t\t\t\t\t\treturn getWeightDrawable(id,width,height);\n\t\t\t\t\t}", "public int getImageResource() {\n switch (id) {\n case 0: return R.drawable.aatrox_square_0;\n case 1: return R.drawable.ahri_square_0;\n case 2: return R.drawable.akali_square_0;\n case 3: return R.drawable.alistar_square_0;\n case 4: return R.drawable.amumu_square_0;\n case 5: return R.drawable.anivia_square_0;\n case 6: return R.drawable.annie_square_0;\n case 7: return R.drawable.ashe_square_0;\n case 8: return R.drawable.azir_square_0;\n case 9: return R.drawable.bard_square_0;\n case 10: return R.drawable.blitzcrank_square_0;\n case 11: return R.drawable.brand_square_0;\n case 12: return R.drawable.braum_square_0;\n case 13: return R.drawable.caitlyn_square_0;\n case 14: return R.drawable.cassiopeia_square_0;\n case 15: return R.drawable.chogath_square_0;\n case 16: return R.drawable.corki_square_0;\n case 17: return R.drawable.darius_square_0;\n case 18: return R.drawable.diana_square_0;\n case 19: return R.drawable.draven_square_0;\n case 20: return R.drawable.drmundo_square_0;\n default:\n return R.drawable.fizz_square_0;\n }\n }", "private Drawable getMaskDrawable(Context context, int maskId) {\n Drawable drawable = ContextCompat.getDrawable(context, maskId);\n\n if (drawable == null) {\n throw new IllegalArgumentException(\"maskId is invalid\");\n }\n\n return drawable;\n }", "Drawable getPhotoDrawableBySub(long subId);", "public boolean Drawable();", "public synchronized BitmapDrawable getExtralBitmapDrawable(String name, View loaderView) {\n\t\tif (null == name) {\n\t\t\treturn null;\n\t\t}\n\t\tFile sourceImg = getFile(name);\n\t\tif (!sourceImg.exists()) {\n\t\t\treturn null;\n\t\t}\n\t\tFileInputStream fis = null;\n\t\ttry {\n\t\t\tfis = new FileInputStream(sourceImg);\n\t\t} catch (Exception e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\tif (null == fis) {\n\t\t\treturn null;\n\t\t}\n\t\tBitmapDrawable drawable = null;\n\t\t\n\t\ttry {\n\t\t\tint width = 0, height = 0;\n\t\t\tif ((null != loaderView) && (loaderView.getWidth() > 0)\n\t\t\t\t\t&& (loaderView.getHeight() > 0)) {\n\t\t\t\twidth = loaderView.getWidth();\n\t\t\t\theight = loaderView.getHeight();\n\t\t\t}else{\n//\t\t\t\twidth = RkGlobalParams.getInstance().getWidth();\n//\t\t\t\theight = RkGlobalParams.getInstance().getHeight();\n\t\t\t\twidth = 200;\n\t\t\t\theight = 200;\n\t\t\t}\n\t\t\tLog.i(\"getExtralBitmapDrawable method \", \"width=\"+width+\",height=\"+height);\n\t\t\tBitmap bitmap = null;\n\t\t\ttry {\n\t\t\t\tbitmap = decodeSampledBitmapFromDescriptor(fis.getFD(), width, height, this);\n//\t\t\t\tbitmap = BitmapFactory.decodeFileDescriptor(fis.getFD());\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t\tif (bitmap != null) {\n\t\t\t\tif (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {\n\t\t\t\t\t// Running on Honeycomb or newer, so wrap in a standard\n\t\t\t\t\t// BitmapDrawable\n\t\t\t\t\tdrawable = new BitmapDrawable(mResource, bitmap);\n\t\t\t\t} else {\n\t\t\t\t\t// Running on Gingerbread or older, so wrap in a\n\t\t\t\t\t// RecyclingBitmapDrawable\n\t\t\t\t\t// which will recycle automagically\n\t\t\t\t\tdrawable = new RecyclingBitmapDrawable(mResource, bitmap);\n\t\t\t\t}\n\n\t\t\t\tif (drawable != null) {\n\t\t\t\t\tmMemoryCache.put(name, drawable);\n\t\t\t\t}\n\t\t\t}\n\n\t\t} catch (Exception e) {\n//\t\t\te.printStackTrace();\n\t\t}\n\t\treturn drawable;\n\t}", "public Drawable getDrawableResource(LocaleDrawableResource resource){\n Context c = ConnectedApp.getContextStatic();\n switch(resource){\n case logo_splash:\n String name = resource.toString();\n String nameLocale = name+\"_\"+getCountryCode().toLowerCase(Locale.US);\n int resId = c.getResources().getIdentifier(nameLocale, \"drawable\",\n c.getPackageName());\n if(resId==0) resId = c.getResources().getIdentifier(name, \"drawable\",\n c.getPackageName());\n return resId!=0?c.getResources().getDrawable(resId):null;\n }\n return null;\n }", "private BitmapDescriptor getMarkerIconFromDrawableForEducation() {\r\n Drawable drawable = getResources().getDrawable(R.drawable.ic_education);\r\n Canvas canvas = new Canvas();\r\n Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);\r\n canvas.setBitmap(bitmap);\r\n drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());\r\n drawable.draw(canvas);\r\n return BitmapDescriptorFactory.fromBitmap(bitmap);\r\n }", "public Drawable getDrawable() {\n return this.wotCharacter.getDrawable(this);\n }", "private Bitmap getBitmap(int drawableRes) {\n Drawable drawable = ResourcesCompat.getDrawable(getResources(), drawableRes, null);\n Canvas canvas = new Canvas();\n Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);\n canvas.setBitmap(bitmap);\n drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());\n drawable.draw(canvas);\n\n return bitmap;\n }", "public static synchronized Drawable m21405h(Context context) {\n Drawable drawable;\n synchronized (C5191i.class) {\n drawable = null;\n try {\n PackageManager packageManager = context.getApplicationContext().getPackageManager();\n drawable = packageManager.getApplicationIcon(packageManager.getApplicationInfo(context.getPackageName(), 0));\n } catch (Throwable th) {\n C5205o.m21464a(th);\n }\n }\n return drawable;\n }", "public Bitmap getB(String name){\n\t\treturn BitmapFactory.decodeResource(activity.getResources(),\n\t\t\t\tactivity.getResources().getIdentifier(name, \"drawable\", activity.getPackageName()));\n\t\t\n\t}", "public DrawableResId drawableResId() {\n return mDrawableResId;\n }", "private BitmapDescriptor getMarkerIconFromDrawableForAdministration() {\r\n Drawable drawable = getResources().getDrawable(R.drawable.ic_administration);\r\n Canvas canvas = new Canvas();\r\n Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);\r\n canvas.setBitmap(bitmap);\r\n drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());\r\n drawable.draw(canvas);\r\n return BitmapDescriptorFactory.fromBitmap(bitmap);\r\n }", "public synchronized Image getBoardLo(Display d) throws FileNotFoundException {\n\t\tif (this.boardLoImage == null) {\n\t\t\tthis.boardLoImage = new Image(d, getClass().getResourceAsStream(boardLoResource));\n\t\t}\n\t\t\n\t\treturn this.boardLoImage;\n\t}", "private void loadBitmap() {\n\n BitmapDrawable bitmapDrawable = (BitmapDrawable) this.getDrawable();\n\n if (bitmapDrawable != null)\n image = bitmapDrawable.getBitmap();\n }", "public Drawable fetchDrawable(String urlString) {\n\t\t\t\ttry {\n\t\t\t\t\tInputStream is = fetch(urlString);\n\t\t\t\t\tDrawable drawable = Drawable.createFromStream(is, \"src\");\n\t\t\t\t\tdrawable.setBounds(0, 0, 25 + drawable.getIntrinsicWidth(), 25\n\t\t\t\t\t\t\t+ drawable.getIntrinsicHeight());\n\t\t\t\t\treturn drawable;\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}", "@DrawableRes\n public static int getFlagDrawableResId(String country) {\n switch (country) {\n\n case \"ly\": //libya\n return R.drawable.flag_libya;\n\n default:\n return R.drawable.flag_libya;\n }\n }", "private BitmapDescriptor getMarkerIconFromDrawable(Drawable drawable) {\r\n Canvas canvas = new Canvas();\r\n Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);\r\n canvas.setBitmap(bitmap);\r\n drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());\r\n drawable.draw(canvas);\r\n return BitmapDescriptorFactory.fromBitmap(bitmap);\r\n }", "private BitmapDescriptor getMarkerIconFromDrawable(Drawable inputDrawable){\n Canvas canvas = new Canvas();\n Bitmap bitmap = Bitmap.createBitmap(inputDrawable.getIntrinsicWidth(), inputDrawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);\n canvas.setBitmap(bitmap);\n inputDrawable.setBounds(0, 0, inputDrawable.getIntrinsicWidth(), inputDrawable.getIntrinsicHeight());\n inputDrawable.draw(canvas);\n return BitmapDescriptorFactory.fromBitmap(bitmap);\n }", "private void configDefaultDrawable() {\n drawableResId().open = R.drawable.sms_add_btn;\n drawableResId().close = R.drawable.sms_close_btn;\n drawableResId().gotoEmotion = R.drawable.sms_kaomoji_btn;\n drawableResId().keyboard = R.drawable.sms_keyboard;\n drawableResId().voiceNormal = R.drawable.sms_voice_btn;\n drawableResId().voicePressed = R.drawable.sms_voice_btn_p;\n }", "public static android.graphics.drawable.Drawable createFromPath(java.lang.String r7) {\r\n /*\r\n r0 = 0;\r\n if (r7 != 0) goto L_0x0004;\r\n L_0x0003:\r\n return r0;\r\n L_0x0004:\r\n r1 = 8192; // 0x2000 float:1.14794E-41 double:4.0474E-320;\r\n android.os.Trace.traceBegin(r1, r7);\r\n r3 = new java.io.FileInputStream;\t Catch:{ IOException -> 0x002a, all -> 0x0025 }\r\n r3.<init>(r7);\t Catch:{ IOException -> 0x002a, all -> 0x0025 }\r\n r4 = getBitmapDrawable(r0, r0, r3);\t Catch:{ all -> 0x0019 }\r\n r3.close();\t Catch:{ IOException -> 0x002a, all -> 0x0025 }\r\n android.os.Trace.traceEnd(r1);\r\n return r4;\r\n L_0x0019:\r\n r4 = move-exception;\r\n throw r4;\t Catch:{ all -> 0x001b }\r\n L_0x001b:\r\n r5 = move-exception;\r\n r3.close();\t Catch:{ all -> 0x0020 }\r\n goto L_0x0024;\r\n L_0x0020:\r\n r6 = move-exception;\r\n r4.addSuppressed(r6);\t Catch:{ IOException -> 0x002a, all -> 0x0025 }\r\n L_0x0024:\r\n throw r5;\t Catch:{ IOException -> 0x002a, all -> 0x0025 }\r\n L_0x0025:\r\n r0 = move-exception;\r\n android.os.Trace.traceEnd(r1);\r\n throw r0;\r\n L_0x002a:\r\n r3 = move-exception;\r\n android.os.Trace.traceEnd(r1);\r\n return r0;\r\n */\r\n throw new UnsupportedOperationException(\"Method not decompiled: android.graphics.drawable.Drawable.createFromPath(java.lang.String):android.graphics.drawable.Drawable\");\r\n }", "public interface DrawableCreator {\n /**\n * Create a drawable from this bitmap\n */\n Drawable createDrawable(Context context, Bitmap b);\n }", "public Drawable getImage(){\n\t\treturn mImage;\n\t}", "public Result getFromDrawable() throws Exception{\n\n // edit the following line with the desired resource you want to test\n Uri uri= Uri.parse((\"android.resource://cepheustheapp.com.cepheus/\"+ R.drawable.back));\n InputStream inputStream= getContentResolver().openInputStream(uri);\n Bitmap bitmap = BitmapFactory.decodeStream(inputStream);\n if (bitmap == null)\n {\n // not a bitmap\n return null;\n }\n int width = bitmap.getWidth(), height = bitmap.getHeight();\n int[] pixels = new int[width * height];\n bitmap.getPixels(pixels, 0, width, 0, 0, width, height);\n bitmap.recycle();\n bitmap = null;\n RGBLuminanceSource source = new RGBLuminanceSource(width, height, pixels);\n BinaryBitmap bBitmap = new BinaryBitmap(new HybridBinarizer(source));\n MultiFormatReader reader = new MultiFormatReader();\n\n // result will hold the actual content\n Result result= reader.decode(bBitmap);\n\n\n return result;\n\n }", "static BufferedImage getImage(String directory) {\n\t\tClassLoader loader = DrawingUtility.class.getClassLoader();\n\t\tBufferedImage image;\n\t\ttry {\n\n\t\t\timage = ImageIO.read(loader.getResource(directory));\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"Fail load image from \" + directory);\n\t\t\timage = null;\n\t\t}\n\t\treturn image;\n\n\t}", "Drawable createDrawable(Context context, Bitmap b);", "private BitmapDescriptor getMarkerIconFromDrawableForReligion() {\r\n Drawable drawable = getResources().getDrawable(R.drawable.ic_religion);\r\n Canvas canvas = new Canvas();\r\n Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);\r\n canvas.setBitmap(bitmap);\r\n drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());\r\n drawable.draw(canvas);\r\n return BitmapDescriptorFactory.fromBitmap(bitmap);\r\n }", "public static int getDrawableId(String name)\n\t{\n\t\tClass<R.drawable> c = R.drawable.class;\n\t\tField f;\n\t\tint i = 0;\n\t\ttry\n\t\t{\n\t\t\tf = c.getField(name);\n\t\t\ti = f.getInt(f);\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tLog.e(\"RR\", e.toString());\n\t\t}\n\t\treturn i;\n\t}", "public static Drawable LoadImageFromWebOperations(String url, File cacheDir) {\n\t\ttry {\n\t\t\tDrawable d = null;\n\t\t\tString[] urlDir = url.split(\"/\");\n\t\t\tint sizeMax=600;\n\t\t\ttry {\n\t\t\t\t// File cacheDir = new File(ruta+File.separator+ urlDir[8]);\n\t\t\t\tif (!cacheDir.exists()) {\n\t\t\t\t\tcacheDir.mkdirs();\n\n\t\t\t\t}\n\t\t\t\tFile cacheDirName = new File(cacheDir + File.separator\n\t\t\t\t\t\t+ urlDir[urlDir.length - 1]);\n\n\t\t\t\tif (!cacheDirName.exists() || cacheDirName.length() == 0) {\n\t\t\t\t\tcacheDirName.createNewFile();\n\t\t\t\t\tInputStream is = (InputStream) new URL(url).getContent();\n\t\t\t\t\tBitmap bit = BitmapFactory.decodeStream(is);\n\t\t\t\t\t//Alto\n\t\t\t\t\tBitmap bit2=null;\n\t\t\t\t\tFileOutputStream fo = new FileOutputStream(cacheDirName);\n\t\t\t\t\t// Drawable d = Drawable.createFromStream(is, \"src name\");\n\t\t\t\t\tif(bit.getHeight()>sizeMax){\n\t\t\t\t\t\tbit2=Bitmap.createScaledBitmap(bit,(sizeMax*bit.getWidth()/bit.getHeight()), sizeMax, false);\n\t\t\t\t\t\tbit2.compress(CompressFormat.JPEG, 95, fo);\n\t\t\t\t\t}else if(bit.getWidth()>sizeMax){\n\t\t\t\t\t\tbit2=Bitmap.createScaledBitmap(bit,sizeMax, (sizeMax* bit.getHeight()/bit.getWidth()), false);\n\t\t\t\t\t\tbit2.compress(CompressFormat.JPEG, 95, fo);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tbit.compress(CompressFormat.JPEG, 95, fo);\n\t\t\t\t\t}\n\n\t\t\t\t\tif(Constants.DEBUG) Log.v(Constants.TAG,\"Url: \"+cacheDir + File.separator\n\t\t\t\t\t\t\t+ urlDir[urlDir.length - 1]);\n\t\t\t\t\tif(Constants.DEBUG) Log.v(Constants.TAG,\"Ancho y alto: \"+(bit.getWidth()+\" \"+bit.getHeight()));\n\t\t\t\t\tif(Constants.DEBUG) Log.v(Constants.TAG,\"Size1: \"+(bit.getRowBytes()*bit.getHeight()));\n\t\t\t\t\tbit.recycle();\n\t\t\t\t\tif(bit2!=null){\n\t\t\t\t\t\tif(Constants.DEBUG) Log.v(Constants.TAG,\"Size2: \"+(bit2.getRowBytes()*bit2.getHeight()));\n\t\t\t\t\t\tbit2.recycle();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.gc();\n\t\t\t\tRuntime.getRuntime().gc();\n\t\t\t\td = Drawable.createFromPath(cacheDirName.getPath());\n\t\t\t} catch (OutOfMemoryError e) {\n\t\t\t\tSystem.gc();\n\t\t\t\tRuntime.getRuntime().gc();\n\t\t\t}\n\t\t\t//\n\n\t\t\treturn d;\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}", "public int getIcon() {\n int i=0;\n String b = \"\";\n try {\n FileInputStream i1 = c.openFileInput(\"faculty.txt\"); //open the faculty file\n int size1 = i1.available();\n byte[] buffer1 = new byte[size1];\n i1.read(buffer1);\n i1.close();\n b = new String(buffer1); //b set to the text in the file\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n\n if(b.equals(\"Faculty of Engineering\")){ //comparing b(faculty in the file) to the Faculty of Engineering.This is repeated for the other faculties\n i=R.drawable.engine; //id of the engneering icon in the drawable file\n }\n if(b.equals(\"Faculty of Food and Agriculture\")){\n i=R.drawable.food;\n }\n if(b.equals(\"Faculty of Science and Technology\")){\n i=R.drawable.tech;\n }\n if(b.equals(\"Faculty of Medical Sciences\")){\n i=R.drawable.med;\n }\n if(b.equals(\"Faculty of Social Sciences\")){\n i=R.drawable.oc;\n }\n if(b.equals(\"aculty of Humanities and Education\")){\n i=R.drawable.human;\n }\n if(b.equals(\"Faculty of Law\")){\n i=R.drawable.la;\n }\n return i;\n }", "private Drawable rezizedDrawable() {\n Drawable logo = getResources().getDrawable(R.drawable.logo_compact);\n Bitmap mp = ((BitmapDrawable) logo).getBitmap();\n\n return new BitmapDrawable(getResources(), Bitmap.createScaledBitmap(mp, 100, 100, true));\n }", "private void addAllDrawables() {\n \t\n \tfor (int i = 0; i < 10; i++) {\n \t\tint res_id = c.getResources().getIdentifier(\"puzzle_\"+i, \"drawable\", c.getPackageName());\n \t\t\n \t\tif (res_id != 0) {\n \t\t\timage_id_array.add(res_id);\n \t\t}\n \t}\n }", "@TargetApi(Build.VERSION_CODES.LOLLIPOP)\n public Uri getLocalBitmapUri() {\n Drawable drawable = getResources().getDrawable(R.drawable.rp_icon3);\n Bitmap bmp = null;\n// bmp =Utility.user.getProfilePic();\n\n if (drawable instanceof BitmapDrawable){\n bmp = ((BitmapDrawable) getResources().getDrawable(R.drawable.rp_icon3)).getBitmap();\n }\n else\n {\n return null;\n }\n // Store image to default external storage directory\n Uri bmpUri = null;\n try {\n\n File file = new File(Environment.getExternalStoragePublicDirectory(\n Environment.DIRECTORY_DOWNLOADS), \"share_image_\" + System.currentTimeMillis() + \".png\");\n file.getParentFile().mkdirs();\n FileOutputStream out = new FileOutputStream(file);\n bmp.compress(Bitmap.CompressFormat.PNG, 90, out);\n out.close();\n bmpUri = Uri.fromFile(file);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return bmpUri;\n }", "public BufferedImage getDrawable(){\n\t\tif(this.isOilContamination()){\n\t\t\treturn this.myFlyweight.getDeadDrawable();\n\t\t}\n\t\t//check direction -- such a horrible way to write a method\n\t\t//redundant checking and ugh.... design this away please...........................\n\t\tif(this.getDirection().getX() > 0 && !this.myFlyweight.getMovingBackAnimationSequence().isEmpty()){\n\t\t\treturn this.myFlyweight.getMovingBackAnimationSequence().get(animationFrame);\n\t\t}\n\t\treturn this.myFlyweight.getAnimationSequence().get(animationFrame);\n\t}", "public static Drawable m17786a(Context context, String str) {\n Bitmap createBitmap;\n InputStream open = context.getAssets().open(\"ufo_res/\" + str);\n Bitmap decodeStream = BitmapFactory.decodeStream(open);\n Object a = C5225r.m17790a(decodeStream);\n if (NinePatch.isNinePatchChunk(a)) {\n createBitmap = Bitmap.createBitmap(decodeStream, 1, 1, decodeStream.getWidth() - 2, decodeStream.getHeight() - 2);\n decodeStream.recycle();\n Field declaredField = createBitmap.getClass().getDeclaredField(\"mNinePatchChunk\");\n declaredField.setAccessible(true);\n declaredField.set(createBitmap, a);\n } else {\n createBitmap = decodeStream;\n }\n open.close();\n if (createBitmap.getNinePatchChunk() == null) {\n return new BitmapDrawable(createBitmap);\n }\n Rect rect = new Rect();\n byte[] ninePatchChunk = createBitmap.getNinePatchChunk();\n rect.left = C5225r.m17785a(ninePatchChunk, 12);\n rect.right = C5225r.m17785a(ninePatchChunk, 16);\n rect.top = C5225r.m17785a(ninePatchChunk, 20);\n rect.bottom = C5225r.m17785a(ninePatchChunk, 24);\n return new NinePatchDrawable(context.getResources(), createBitmap, createBitmap.getNinePatchChunk(), rect, null);\n }", "public static Bitmap getBitmap(String path) {\n Bitmap bitmap = null;\n try {\n Log.i(\"FileManager\", \"GetBitmap: \" + path);\n FileInputStream imgIS = new FileInputStream(new File(path));\n BufferedInputStream bufIS = new BufferedInputStream(imgIS);\n bitmap = BitmapFactory.decodeStream(bufIS);\n Log.i(\"FileManager\", \"GetBitmap Finished: \" + bitmap);\n } catch (FileNotFoundException e) { //catch fileinputstream exceptions\n e.printStackTrace();\n } //trying to get wallpaper from display cycle node\n return bitmap;\n }", "private Drawable downloadFile(String fileUrl)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tInputStream is = (InputStream) new URL(fileUrl).getContent();\r\n\t\t\tDrawable d = Drawable.createFromStream(is, \"src\");\r\n\t\t\treturn d;\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "Bitmap load(String id);", "public static int getDrawableId(Context argContext, String argName) {\n Resources resources = argContext.getResources();\n int resourceId = resources.getIdentifier(argName, \"drawable\", argContext.getPackageName());\n return resourceId;\n }", "protected Drawable doInBackground(String... url) {\n try {\n\t\t\tInputStream is = (InputStream) new URL(url[0]).getContent();\n\t\t\tDrawable d = Drawable.createFromStream(is, \"src\");\n\t\t\treturn d;\n\t\t} \n\t\t\t\t\n\t\tcatch (Exception e) {\n\t\t\t//do nothing\n\t\t\treturn null;\n\t\t}\n }", "protected Drawable getIcon(Context context) {\n if (this.iconResource != 0) {\n return ContextCompat.getDrawable(context, this.iconResource);\n } else {\n return this.icon;\n }\n }", "public static Drawable getDrawableFromAssetUri(Context context, Uri\n assetUri) {\n\n AssetManager am = context.getAssets();\n Drawable drawable;\n\n try {\n /*cut off the first 15 characters because Uri looks like:\n /android_asset/path_here....\n */\n InputStream inputStream = am.open(assetUri\n .getPath().substring(15));\n drawable = Drawable.createFromStream\n (inputStream, null);\n inputStream.close();\n\n } catch (IOException ioe) {\n return null;\n }\n return drawable;\n }", "public void AddImgToRecyclerView()\n {\n imgsource = new Vector();\n Resources res = getResources();\n imgsource.add(res.getIdentifier(\"@drawable/add_overtime_schedule\", null, getPackageName()));\n imgsource.add(res.getIdentifier(\"@drawable/add_overtime\", null, getPackageName()));\n imgsource.add(res.getIdentifier(\"@drawable/clock_in\", null, getPackageName()));\n imgsource.add(res.getIdentifier(\"@drawable/vacation\", null, getPackageName()));\n imgsource.add(res.getIdentifier(\"@drawable/document\", null, getPackageName()));\n imgsource.add(res.getIdentifier(\"@drawable/order\", null, getPackageName()));\n }", "public void init(GLAutoDrawable drawable) {}", "java.lang.String getGameIconUrl();", "private String makeImageUri(String name) {\n\t\tString image = name;\n\t\t// remove all white spaces\n\t\tString in = image.replaceAll(\"\\\\s+\", \"\");\n\t\t// turn to lower case\n\t\tString iname = in.toLowerCase();\n\t\tSystem.out.println(\"iName is: \" + iname);\n\t\tString mDrawableName = iname;\n\t\t// get the resId of the image\n\t\tint resID = getResources().getIdentifier(mDrawableName, \"drawable\",\n\t\t\t\tgetPackageName());\n\n\t\t// resID is notfound show default image\n\t\tif (resID == 0) {\n\t\t\tresID = getResources().getIdentifier(\"default_place\", \"drawable\",\n\t\t\t\t\tgetPackageName());\n\t\t}\n\n\t\t// make the uri\n\t\tUri imageURI = Uri.parse(\"android.resource://\" + getPackageName() + \"/\"\n\t\t\t\t+ resID);\n\t\timage = imageURI.toString();\n\t\treturn image;\n\t}", "public synchronized Image getBoardM(Display d) throws FileNotFoundException {\n\t\tif (this.boardMImage == null) {\n\t\t\tthis.boardMImage = new Image(d, getClass().getResourceAsStream(boardMResource));\n\t\t}\n\t\t\n\t\treturn this.boardMImage;\n\t}", "private Bitmap loadImage(int id) {\n Bitmap bitmap = BitmapFactory.decodeResource(\n context.getResources(), id);\n Bitmap scaled = Bitmap.createScaledBitmap(bitmap, IMAGE_WIDTH,\n IMAGE_HEIGHT, true);\n bitmap.recycle();\n return scaled;\n }", "private void addLeftDrawable() {\n\n// mBusinessTitle.setCompoundDrawables(getDrawable(R.drawable.ic_assignment_black_24dp), null, null, null );\n//\n// mBusinessPhone.setCompoundDrawables(getDrawable(R.drawable.ic_settings_phone_black_24dp), null, null, null );\n//\n// mBusinessEmail.setCompoundDrawables(getDrawable(R.drawable.ic_mail_black_24dp), null, null, null );\n\n //change menu item save changes icon\n doneDrawable = getDrawable(R.drawable.ic_done_black_24dp);\n\n //change menu item reload icon\n updateDrawable = getDrawable(R.drawable.ic_edit_black_24dp);\n\n //add location drawable\n updateDrawable = new IconicsDrawable(this)\n .icon(GoogleMaterial.Icon.gmd_location_on)\n .color(getResources().getColor(R.color.editProfile_icon))\n .sizeDp(20);\n mAddLocation.setCompoundDrawables(getDrawable(R.drawable.ic_edit_black_24dp), null, null, null );\n\n mClearLocation.setBackground(getDrawable(R.drawable.ic_edit_black_24dp));\n }", "protected Image loadIcon() {\n /*\n * Icon by http://www.artua.com/, retrieved here:\n * http://www.iconarchive.com/show/star-wars-icons-by-artua.html\n */\n return new ImageLoader().loadIcon(\"moon.png\");\n }", "public static String getGameBallResource() {\r\n String imageResource = \"/bloodbowl/resources/ball.gif\";\r\n\r\n return imageResource;\r\n }", "public static RoundedBitmapDrawable getRoundedBitmap(Resources res, int drawableId) {\n try {\n Bitmap srcBitmap = BitmapFactory.decodeResource(res, drawableId);\n return getRoundedBitmap(res, srcBitmap);\n } catch (Exception e) {\n return null;\n }\n\n }", "public void put(@NonNull final String key, final Drawable value) {\n put(key, value, -1);\n }", "public Knob(Context context, int drawable) {\r\n\t\t\tBitmapFactory.Options opts = new BitmapFactory.Options();\r\n\t\t\topts.inJustDecodeBounds = true;\r\n\t\t\timg = BitmapFactory.decodeResource(context.getResources(), drawable); \r\n\t\t}", "String getIconFile();", "public synchronized Image getBoardHi(Display d) throws FileNotFoundException {\n\t\tif (this.boardHiImage == null) {\n\t\t\tthis.boardHiImage = new Image(d, getClass().getResourceAsStream(boardHiResource));\n\t\t}\n\t\t\n\t\treturn this.boardHiImage;\n\t}", "String getIcon();", "String getIcon();", "public int getBaseImageResourceId() {\n int gender = TestSubject.getInstance().getGender();\n if (gender == TestSubject.GENDER_NOT_CHOSEN) {\n return R.drawable.kid_abduction;\n }\n int resId = mBaseImageResId[gender];\n if (resId == 0) {\n return getImageResourceId(); // default to the image resource\n }\n return resId;\n }", "public static Bitmap GetDealSpriteBitmap()\r\n\t{\r\n\t\t// Load background desktop image from resouce\r\n\t\tBitmap image = null;\r\n\t\tif(CGameHelper.m_GameContext != null)\r\n\t\t{\r\n\t\t\tResources res = CGameHelper.m_GameContext.getResources();\r\n\t\t\tif(res == null)\r\n\t\t\t\treturn image; \r\n\r\n\t\t\tif(m_DealSpriteBitmap == null)\r\n\t\t\t{\r\n\t\t\t\tm_DealSpriteBitmap = BitmapFactory.decodeResource(res, R.drawable.face);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\timage = m_DealSpriteBitmap;\r\n\t\t} \r\n\t\treturn image;\r\n\t}", "public static int getResId(@NonNull String name) {\n Integer resId = map.get(name);\n if(resId != null) return resId;\n else return R.drawable.ic_help_circle;\n }", "abstract public String getImageResourcesDir();", "public Bitmap getBitmapFromResource(int resourceId) {\n return BitmapFactory.decodeResource(getContext().getResources(), resourceId);\n }", "@Override\n public void invalidateDrawable(Drawable drawable) {\n ShortcutInfo mShortcutInfo = (ShortcutInfo) getTag();\n boolean isInHotseatOrHideseat = mMode == Mode.HIDESEAT || mMode == Mode.HOTSEAT;\n\n /* YUNOS BEGIN */\n // ##date:2014/12/19 ##author:zhanggong.zg ##BugID:5581407,5587224\n Drawable icon = getIconDrawable();\n /* YUNOS END */\n if (icon != drawable) {\n super.invalidateDrawable(drawable);\n return;\n }\n if (drawable instanceof FancyDrawable) {\n String label = ((FancyDrawable) drawable).getVariableString(\"app_label\");\n if (label != null) {\n // ##date:2015/1/30 ##author:zhanggong.zg ##BugID:5751734\n if (mShortcutInfo != null) {\n BubbleController.updateIndicator(this);\n BubbleController.updateTitle(this);\n } else {\n setText(label);\n }\n } else if (mShortcutInfo != null) {\n BubbleController.updateIndicator(this);\n BubbleController.updateTitle(this);\n }\n }\n if (getWindowToken() == null ) {\n FolderInfo info = Launcher.findFolderInfo(mShortcutInfo.container);\n if (info != null)\n info.invalidate(this, mShortcutInfo);\n } else if (mSupportCard && !isInHotseatOrHideseat && mCardBackground != null) {\n invalidate();\n } else if (drawable instanceof FancyDrawable) {\n // ##date:2014/12/19 ##author:zhanggong.zg ##BugID:5587224\n invalidate();\n } else {\n super.invalidateDrawable(drawable);\n }\n }", "private byte[] getImageOne() {\n Bitmap icon = BitmapFactory.decodeResource(getApplicationContext().getResources(),\n R.drawable.image0);\n return ImageConvert.convertImage2ByteArray(icon);\n }", "public Drawable getIcon(Drawable placeholder)\n\t{\n\t\tsynchronized (mCache) {\n\t\t\tmIcon = mCache.get(getSign());\n\t\t}\n\t\tif(mIcon != null)\n\t\t\treturn mIcon;\n\t\tmExecutor.execute(mTask);\n\t\t\n\t\treturn placeholder;\n\t}", "java.lang.String getIcon();", "java.lang.String getIcon();", "private LayerDrawable buildPinIcon(String iconPath, int iconColor) {\n\n LayerDrawable result = null;\n\n BitmapFactory.Options myOptions = new BitmapFactory.Options();\n myOptions.inDither = true;\n myOptions.inScaled = false;\n myOptions.inPreferredConfig = Bitmap.Config.ARGB_8888;// important\n myOptions.inPurgeable = true;\n\n Bitmap bitmap = null;\n try {\n bitmap = BitmapFactory.decodeStream(container.getContext().getAssets().open(iconPath), null, myOptions);\n\n\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }catch (Exception e) {\n //Crashlytics.logException(e);\n\n }\n\n\n Bitmap workingBitmap = Bitmap.createBitmap(100, 100, bitmap.getConfig()); //Bitmap.createBitmap(bitmap);\n Bitmap mutableBitmap = workingBitmap.copy(Bitmap.Config.ARGB_8888, true);\n\n\n Paint paint = new Paint();\n paint.setAntiAlias(true);\n paint.setDither(false);\n\n paint.setColor(iconColor);\n\n Canvas canvas = new Canvas(mutableBitmap);\n canvas.drawCircle(bitmap.getWidth()/2 + 10, bitmap.getHeight()/2 + 10, 32, paint);\n\n //\t canvas.drawBitmap(bitmap, 10, 10, null);\n\n if (!iconPath.isEmpty()) {\n\n try {\n result = new LayerDrawable(\n new Drawable[] {\n\t\t\t\t\t\t\t\t/*pincolor*/ new BitmapDrawable(mutableBitmap),\n new BitmapDrawable(BitmapFactory.decodeStream(container.getContext().getAssets().open(iconPath)))});\n\n } catch (Resources.NotFoundException 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\n\n\n return result;\n\n }", "protected abstract int getStateDrawable(int state);", "private Drawable creaImmagineDaUrl(String urlImmagine)\n {\n try\n {\n InputStream is = (InputStream) new URL(urlImmagine).getContent();\n Drawable d = Drawable.createFromStream(is, null);\n return d;\n }catch (Exception e) {\n System.out.println(\"Exc=\"+e);\n return null;\n }\n }", "@Override\n\t\t\t\tpublic void onObtainDrawable(Drawable drawable, ImageView imageView) {\n\t\t\t\t}", "private BitmapDrawable getBitmapDrawableFromView(View v) {\r\n Bitmap bitmap = Bitmap.createBitmap(v.getWidth(), v.getHeight(), Bitmap.Config.ARGB_8888);\r\n Canvas canvas = new Canvas(bitmap);\r\n v.draw(canvas);\r\n return new BitmapDrawable(getResources(), bitmap);\r\n }", "@Override\n public void onBitmapReady(String id, String filePath) {\n if(icons.containsKey(id)){\n icons.get(id).setDrawable(ImageDownloaderService.fetchBitmapDrawable(filePath));\n displayAdapter.notifyIconChanged(id);\n }\n }", "public static android.graphics.drawable.Drawable getIcon(android.content.Context r6, android.graphics.drawable.Drawable r7, android.content.ComponentName r8) {\n /*\n r3 = com.android.launcher3.common.view.IconView.isKnoxShortcut(r8);\n if (r3 != 0) goto L_0x0010;\n L_0x0006:\n r3 = com.android.launcher3.theme.OpenThemeManager.getInstance();\n r3 = r3.isDefaultTheme();\n if (r3 != 0) goto L_0x0012;\n L_0x0010:\n r2 = r7;\n L_0x0011:\n return r2;\n L_0x0012:\n r1 = r6.getPackageManager();\n if (r1 != 0) goto L_0x0021;\n L_0x0018:\n r3 = \"PairAppsUtilities\";\n r4 = \"unable to retrieve PackageManager\";\n android.util.Log.e(r3, r4);\n r2 = r7;\n goto L_0x0011;\n L_0x0021:\n if (r8 == 0) goto L_0x003b;\n L_0x0023:\n r3 = r8.getPackageName();\t Catch:{ NoSuchMethodError -> 0x0042 }\n r4 = r8.getClassName();\t Catch:{ NoSuchMethodError -> 0x0042 }\n r3 = r1.semCheckComponentMetadataForIconTray(r3, r4);\t Catch:{ NoSuchMethodError -> 0x0042 }\n if (r3 != 0) goto L_0x003b;\n L_0x0031:\n r3 = r8.getPackageName();\t Catch:{ NoSuchMethodError -> 0x0042 }\n r3 = r1.semShouldPackIntoIconTray(r3);\t Catch:{ NoSuchMethodError -> 0x0042 }\n if (r3 == 0) goto L_0x0040;\n L_0x003b:\n r3 = 1;\n r7 = r1.semGetDrawableForIconTray(r7, r3);\t Catch:{ NoSuchMethodError -> 0x0042 }\n L_0x0040:\n r2 = r7;\n goto L_0x0011;\n L_0x0042:\n r0 = move-exception;\n r3 = \"PairAppsUtilities\";\n r4 = new java.lang.StringBuilder;\n r4.<init>();\n r5 = \"Method not found : \";\n r4 = r4.append(r5);\n r5 = r0.toString();\n r4 = r4.append(r5);\n r4 = r4.toString();\n android.util.Log.e(r3, r4);\n goto L_0x0040;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.launcher3.util.PairAppsUtilities.getIcon(android.content.Context, android.graphics.drawable.Drawable, android.content.ComponentName):android.graphics.drawable.Drawable\");\n }" ]
[ "0.70483357", "0.69191295", "0.6882271", "0.67836255", "0.6756368", "0.67081916", "0.65603656", "0.6517338", "0.6410696", "0.6408048", "0.6387797", "0.63847595", "0.63767815", "0.63673925", "0.62734073", "0.6223503", "0.6199653", "0.61844105", "0.6080523", "0.6053676", "0.6008085", "0.60080504", "0.6000893", "0.5916476", "0.5882884", "0.5821033", "0.58172596", "0.57490706", "0.57218295", "0.56575835", "0.56468594", "0.5627887", "0.5598283", "0.5593781", "0.5552904", "0.55322033", "0.54926205", "0.54892963", "0.54882574", "0.5485048", "0.548118", "0.5473169", "0.5435632", "0.5435463", "0.5432595", "0.5411486", "0.54098195", "0.5395739", "0.53907675", "0.5381429", "0.53707093", "0.5345704", "0.5335494", "0.53268504", "0.5321094", "0.53181607", "0.5293594", "0.5251948", "0.5243188", "0.5222569", "0.52169377", "0.52094007", "0.5207782", "0.5160887", "0.5149662", "0.51484", "0.5116732", "0.51136386", "0.5103657", "0.51033795", "0.5094374", "0.5094071", "0.5063232", "0.5051515", "0.5044864", "0.50416726", "0.502579", "0.50251824", "0.50217164", "0.5018162", "0.50172067", "0.5001948", "0.5001948", "0.49700907", "0.49693137", "0.49569955", "0.49526542", "0.49375188", "0.49314222", "0.49221656", "0.49184695", "0.49170095", "0.49170095", "0.4916635", "0.49164703", "0.49127582", "0.49105307", "0.48942685", "0.48916233", "0.48847422" ]
0.71746176
0
gets a Drawable from Drawable folder
public Bitmap getB(String name){ return BitmapFactory.decodeResource(activity.getResources(), activity.getResources().getIdentifier(name, "drawable", activity.getPackageName())); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Drawable getD(String name) { \n\t\t\n\t int resourceId = activity.getResources().getIdentifier(name, \"drawable\", activity.getPackageName());\n\t return activity.getResources().getDrawable(resourceId);\n\t}", "public static Drawable getDrawable(Context context, String path_relative) {\n InputStream ims = null;\n try {\n ims = context.getAssets().open(path_relative);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return Drawable.createFromStream(ims, null);\n }", "public Drawable drawable(int drawableId){\n return ContextCompat.getDrawable(appCtx, drawableId);\n }", "public static Drawable getDrawable(Context context, int idFilme){\n Class<?> c = R.drawable.class;\n try {\n Field idField = c.getField(\"filme\"+Integer.toString(idFilme));\n int id = idField.getInt(idField);\n Drawable imagem = context.getResources().getDrawable(id, null);\n return imagem;\n } catch (NoSuchFieldException e){\n e.printStackTrace();\n } catch (IllegalAccessException e){\n e.printStackTrace();\n }\n\n return context.getResources().getDrawable(R.drawable.movie_padrao);\n }", "public Bitmap drawableBitmap(int drawableId){\n return BitmapFactory.decodeResource(getResources(), drawableId);\n }", "public Drawable _d(int res_id) {\n\t\treturn mContext.getResources().getDrawable(res_id);\n\t}", "public Drawable getDrawable(@NonNull final String key) {\n return getDrawable(key, null);\n }", "@Override\n public Drawable getDrawable(String arg0) {\n int id = 0;\n\n if(arg0.equals(\"trafficpoint.png\")){\n id = R.drawable.trafficpoint;\n }\n\n if(arg0.equals(\"center.png\")){\n id = R.drawable.center;\n }\n\n if(arg0.equals(\"red_traffic_indicator.png\")){\n id = R.drawable.red_traffic_indicator;\n }\n\n if(arg0.equals(\"blue_traffic_indicator.png\")){\n id = R.drawable.blue_traffic_indicator;\n }\n\n if(arg0.equals(\"green_traffic_indicator.png\")){\n id = R.drawable.green_traffic_indicator;\n }\n\n if(arg0.equals(\"yellow_traffic_indicator.png\")){\n id = R.drawable.yellow_traffic_indicator;\n }\n\n if(arg0.equals(\"pink_traffic_indicator.png\")){\n id = R.drawable.pink_traffic_indicator;\n }\n\n LevelListDrawable d = new LevelListDrawable();\n Drawable empty = getResources().getDrawable(id);\n d.addLevel(0, 0, empty);\n d.setBounds(0, 0, empty.getIntrinsicWidth(), empty.getIntrinsicHeight());\n\n return d;\n }", "private Drawable obtainIconFromResource(Integer id, Context context, ComponentName component)\n\t{\n\t\t\n Resources res = null;\n \n try {\n \t \n\t\t\tres = context.getPackageManager().\n\t\t\t\t\tgetResourcesForApplication(component.getPackageName());\n\t\t\n\t\t} catch (NameNotFoundException e) {\n\t\t\tres = null;\n\t\t\te.printStackTrace();\n\t\t}\n if(res != null)\n {\n return res.getDrawable(id);\n }\n\t\treturn null;\n\t}", "@SuppressLint(\"NewApi\")\n public Drawable drawable(int res){\n if (Build.VERSION.SDK_INT < 22){\n return application.getResources().getDrawable(res);\n }\n else{\n return application.getResources().getDrawable(res, null);\n }\n }", "private Drawable obtainIcon(String source, Context context, ComponentName component)\n\t{\n\t\t// if there is resource ID\n\t\ttry{\n\t\tInteger resourceID = Integer.parseInt(source);\n\t\treturn obtainIconFromResource(resourceID, context, component);\n\t\t}catch (Exception e) {}\n\t\tUri uri = Uri.parse(source);\n\t\ttry {\n\t\t\tAssetFileDescriptor file = \n\t\t\t\t\tcontext.getContentResolver().openAssetFileDescriptor(uri, \"r\");\n\t\t\treturn Drawable.createFromStream(file.createInputStream(), null);\n\t\t\t\t\t\t\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\t\t\n\t\treturn null;\n\t}", "private int getDrawableByIcon(String iconID) {\n int icon = 0;\n\n //Get drawable according to iconID\n // xxd are for day and xxn are for night\n switch (iconID) {\n case \"01d\":\n icon = R.drawable.ic_01d;\n break;\n case \"02d\":\n icon = R.drawable.ic_02d;\n break;\n case \"03d\":\n icon = R.drawable.ic_03d;\n break;\n case \"04d\":\n icon = R.drawable.ic_04d;\n break;\n case \"09d\":\n icon = R.drawable.ic_09d;\n break;\n case \"10d\":\n icon = R.drawable.ic_10d;\n break;\n case \"11d\":\n icon = R.drawable.ic_11d;\n break;\n case \"13d\":\n icon = R.drawable.ic_13d;\n break;\n case \"50d\":\n icon = R.drawable.ic_50d;\n break;\n case \"01n\":\n icon = R.drawable.ic_01n;\n break;\n case \"02n\":\n icon = R.drawable.ic_02n;\n break;\n case \"03n\":\n icon = R.drawable.ic_03n;\n break;\n case \"04n\":\n icon = R.drawable.ic_04n;\n break;\n case \"09n\":\n icon = R.drawable.ic_09n;\n break;\n case \"10n\":\n icon = R.drawable.ic_10n;\n break;\n case \"11n\":\n icon = R.drawable.ic_11n;\n break;\n case \"13n\":\n icon = R.drawable.ic_13n;\n break;\n case \"50n\":\n icon = R.drawable.ic_50n;\n break;\n\n }\n return icon;\n }", "public static int getDrawableByString( Context context, String name ) {\n return getResourceByString( context, \"drawable\", name );\n }", "@Override\n\tpublic Drawable getDrawable() {\n\t\tDrawable drawable = null;\n \n if (mDrawable != null) {\n drawable = mDrawable;\n } else if (mContentUri != null) {\n Bitmap bitmap = null;\n try {\n InputStream is = mContext.getContentResolver().openInputStream(\n mContentUri);\n bitmap = BitmapFactory.decodeStream(is);\n drawable = new BitmapDrawable(mContext.getResources(), bitmap);\n drawable.setBounds(0, 0, drawable.getIntrinsicWidth(),\n drawable.getIntrinsicHeight());\n is.close();\n } catch (Exception e) {\n Log.e(\"sms\", \"Failed to loaded content \" + mContentUri, e);\n }\n } else {\n try {\n drawable = mContext.getResources().getDrawable(mResourceId);\n drawable.setBounds(0, 0, drawable.getIntrinsicWidth(),\n drawable.getIntrinsicHeight());\n } catch (Exception e) {\n Log.e(\"sms\", \"Unable to find resource: \" + mResourceId);\n } \n }\n\n return drawable;\n\t}", "public static Drawable getDrawable(Context context, String name)\n\t{\n\t\treturn context.getResources().getDrawable(RR.getDrawableId(name));\n\t}", "public Drawable getDrawable(@NonNull final String key, final Drawable defaultValue) {\n byte[] bytes = realGetBytes(TYPE_DRAWABLE + key);\n if (bytes == null) return defaultValue;\n return bytes2Drawable(bytes);\n }", "public abstract Drawable getIcon();", "public Drawable getDrawable()\n\t {\n\t return drawable;\n\t }", "@Override\n\t\tpublic Drawable getDrawable(String source) {\n\t\t\tURL url;\n\t\t\tDrawable drawable = null;\n\t\t\ttry {\n\t\t\t\turl = new URL(source);\n\t\t\t\tdrawable = Drawable.createFromStream(url.openStream(), null);\n\t\t\t\tif (drawable != null) {\n\t\t\t\t\tint iWidth = drawable.getIntrinsicWidth();\n\t\t\t\t\tint iHeight = drawable.getIntrinsicHeight();\n\t\t\t\t\tint width = CommonUtils\n\t\t\t\t\t\t\t.getScreenWidth(InformationDetailActivity.this)\n\t\t\t\t\t\t\t- DensityUtil.dip2px(\n\t\t\t\t\t\t\t\t\tInformationDetailActivity.this, 10) * 2;\n\t\t\t\t\tint height = CommonUtils.getHeightWithSize(\n\t\t\t\t\t\t\tInformationDetailActivity.this, iWidth, iHeight,\n\t\t\t\t\t\t\twidth);\n\t\t\t\t\tdrawable.setBounds(0, 0, width, height);\n\t\t\t\t}\n\t\t\t} catch (MalformedURLException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\treturn drawable;\n\t\t}", "public Drawable getDrawable() {\n return mDrawable;\n }", "private BitmapDescriptor getMarkerIconFromDrawableForFood() {\r\n Drawable drawable = getResources().getDrawable(R.drawable.ic_food);\r\n Canvas canvas = new Canvas();\r\n Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);\r\n canvas.setBitmap(bitmap);\r\n drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());\r\n drawable.draw(canvas);\r\n return BitmapDescriptorFactory.fromBitmap(bitmap);\r\n }", "public Drawable getDrawableCache(Integer cacheKey)\n {\n synchronized (mLinkedHashMap)\n {\n Drawable image;\n // Get file from cache\n String file = mLinkedHashMap.get(cacheKey);\n if (file != null)\n {\n image = Drawable.createFromPath(file);\n Log.i(\"DiskLruCache\", \"DiskCacheHit\");\n return image;\n }\n else\n {\n // Construct existing file path\n String cacheKeyStr = String.valueOf(cacheKey);\n String existingFile = createFilePath(cacheDirectory, cacheKeyStr);\n // Get the file using the constructed file path\n assert existingFile != null;\n File existFile = new File(existingFile);\n if (existFile.exists())\n {\n // If the file exists, we will store the the key in reference list\n referenceAdd(cacheKey, existingFile);\n return Drawable.createFromPath(existingFile);\n }\n }\n return null;\n }//synchronized (mLinkedHashMap)\n }", "private Drawable getAchievementDrawable(String achievementType){\n int iconID = DrawableGetter.getAchievementDrawable(achievementType);\n return ContextCompat.getDrawable(context,iconID);\n }", "public static Drawable getIcon(int param0) {\n }", "public GifDrawable(Resources res, int id) throws NotFoundException, IOException {\n this(res.openRawResourceFd(id));\n }", "@Override\n\t\t\t\t\tpublic Drawable getDrawable() {\n\t\t\t\t\t\treturn getWeightDrawable(id,width,height);\n\t\t\t\t\t}", "public int getImageResource() {\n switch (id) {\n case 0: return R.drawable.aatrox_square_0;\n case 1: return R.drawable.ahri_square_0;\n case 2: return R.drawable.akali_square_0;\n case 3: return R.drawable.alistar_square_0;\n case 4: return R.drawable.amumu_square_0;\n case 5: return R.drawable.anivia_square_0;\n case 6: return R.drawable.annie_square_0;\n case 7: return R.drawable.ashe_square_0;\n case 8: return R.drawable.azir_square_0;\n case 9: return R.drawable.bard_square_0;\n case 10: return R.drawable.blitzcrank_square_0;\n case 11: return R.drawable.brand_square_0;\n case 12: return R.drawable.braum_square_0;\n case 13: return R.drawable.caitlyn_square_0;\n case 14: return R.drawable.cassiopeia_square_0;\n case 15: return R.drawable.chogath_square_0;\n case 16: return R.drawable.corki_square_0;\n case 17: return R.drawable.darius_square_0;\n case 18: return R.drawable.diana_square_0;\n case 19: return R.drawable.draven_square_0;\n case 20: return R.drawable.drmundo_square_0;\n default:\n return R.drawable.fizz_square_0;\n }\n }", "private Drawable getMaskDrawable(Context context, int maskId) {\n Drawable drawable = ContextCompat.getDrawable(context, maskId);\n\n if (drawable == null) {\n throw new IllegalArgumentException(\"maskId is invalid\");\n }\n\n return drawable;\n }", "Drawable getPhotoDrawableBySub(long subId);", "public boolean Drawable();", "public synchronized BitmapDrawable getExtralBitmapDrawable(String name, View loaderView) {\n\t\tif (null == name) {\n\t\t\treturn null;\n\t\t}\n\t\tFile sourceImg = getFile(name);\n\t\tif (!sourceImg.exists()) {\n\t\t\treturn null;\n\t\t}\n\t\tFileInputStream fis = null;\n\t\ttry {\n\t\t\tfis = new FileInputStream(sourceImg);\n\t\t} catch (Exception e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\tif (null == fis) {\n\t\t\treturn null;\n\t\t}\n\t\tBitmapDrawable drawable = null;\n\t\t\n\t\ttry {\n\t\t\tint width = 0, height = 0;\n\t\t\tif ((null != loaderView) && (loaderView.getWidth() > 0)\n\t\t\t\t\t&& (loaderView.getHeight() > 0)) {\n\t\t\t\twidth = loaderView.getWidth();\n\t\t\t\theight = loaderView.getHeight();\n\t\t\t}else{\n//\t\t\t\twidth = RkGlobalParams.getInstance().getWidth();\n//\t\t\t\theight = RkGlobalParams.getInstance().getHeight();\n\t\t\t\twidth = 200;\n\t\t\t\theight = 200;\n\t\t\t}\n\t\t\tLog.i(\"getExtralBitmapDrawable method \", \"width=\"+width+\",height=\"+height);\n\t\t\tBitmap bitmap = null;\n\t\t\ttry {\n\t\t\t\tbitmap = decodeSampledBitmapFromDescriptor(fis.getFD(), width, height, this);\n//\t\t\t\tbitmap = BitmapFactory.decodeFileDescriptor(fis.getFD());\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t\tif (bitmap != null) {\n\t\t\t\tif (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {\n\t\t\t\t\t// Running on Honeycomb or newer, so wrap in a standard\n\t\t\t\t\t// BitmapDrawable\n\t\t\t\t\tdrawable = new BitmapDrawable(mResource, bitmap);\n\t\t\t\t} else {\n\t\t\t\t\t// Running on Gingerbread or older, so wrap in a\n\t\t\t\t\t// RecyclingBitmapDrawable\n\t\t\t\t\t// which will recycle automagically\n\t\t\t\t\tdrawable = new RecyclingBitmapDrawable(mResource, bitmap);\n\t\t\t\t}\n\n\t\t\t\tif (drawable != null) {\n\t\t\t\t\tmMemoryCache.put(name, drawable);\n\t\t\t\t}\n\t\t\t}\n\n\t\t} catch (Exception e) {\n//\t\t\te.printStackTrace();\n\t\t}\n\t\treturn drawable;\n\t}", "public Drawable getDrawableResource(LocaleDrawableResource resource){\n Context c = ConnectedApp.getContextStatic();\n switch(resource){\n case logo_splash:\n String name = resource.toString();\n String nameLocale = name+\"_\"+getCountryCode().toLowerCase(Locale.US);\n int resId = c.getResources().getIdentifier(nameLocale, \"drawable\",\n c.getPackageName());\n if(resId==0) resId = c.getResources().getIdentifier(name, \"drawable\",\n c.getPackageName());\n return resId!=0?c.getResources().getDrawable(resId):null;\n }\n return null;\n }", "private BitmapDescriptor getMarkerIconFromDrawableForEducation() {\r\n Drawable drawable = getResources().getDrawable(R.drawable.ic_education);\r\n Canvas canvas = new Canvas();\r\n Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);\r\n canvas.setBitmap(bitmap);\r\n drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());\r\n drawable.draw(canvas);\r\n return BitmapDescriptorFactory.fromBitmap(bitmap);\r\n }", "public Drawable getDrawable() {\n return this.wotCharacter.getDrawable(this);\n }", "private Bitmap getBitmap(int drawableRes) {\n Drawable drawable = ResourcesCompat.getDrawable(getResources(), drawableRes, null);\n Canvas canvas = new Canvas();\n Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);\n canvas.setBitmap(bitmap);\n drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());\n drawable.draw(canvas);\n\n return bitmap;\n }", "public static synchronized Drawable m21405h(Context context) {\n Drawable drawable;\n synchronized (C5191i.class) {\n drawable = null;\n try {\n PackageManager packageManager = context.getApplicationContext().getPackageManager();\n drawable = packageManager.getApplicationIcon(packageManager.getApplicationInfo(context.getPackageName(), 0));\n } catch (Throwable th) {\n C5205o.m21464a(th);\n }\n }\n return drawable;\n }", "public DrawableResId drawableResId() {\n return mDrawableResId;\n }", "private BitmapDescriptor getMarkerIconFromDrawableForAdministration() {\r\n Drawable drawable = getResources().getDrawable(R.drawable.ic_administration);\r\n Canvas canvas = new Canvas();\r\n Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);\r\n canvas.setBitmap(bitmap);\r\n drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());\r\n drawable.draw(canvas);\r\n return BitmapDescriptorFactory.fromBitmap(bitmap);\r\n }", "public synchronized Image getBoardLo(Display d) throws FileNotFoundException {\n\t\tif (this.boardLoImage == null) {\n\t\t\tthis.boardLoImage = new Image(d, getClass().getResourceAsStream(boardLoResource));\n\t\t}\n\t\t\n\t\treturn this.boardLoImage;\n\t}", "private void loadBitmap() {\n\n BitmapDrawable bitmapDrawable = (BitmapDrawable) this.getDrawable();\n\n if (bitmapDrawable != null)\n image = bitmapDrawable.getBitmap();\n }", "public Drawable fetchDrawable(String urlString) {\n\t\t\t\ttry {\n\t\t\t\t\tInputStream is = fetch(urlString);\n\t\t\t\t\tDrawable drawable = Drawable.createFromStream(is, \"src\");\n\t\t\t\t\tdrawable.setBounds(0, 0, 25 + drawable.getIntrinsicWidth(), 25\n\t\t\t\t\t\t\t+ drawable.getIntrinsicHeight());\n\t\t\t\t\treturn drawable;\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}", "@DrawableRes\n public static int getFlagDrawableResId(String country) {\n switch (country) {\n\n case \"ly\": //libya\n return R.drawable.flag_libya;\n\n default:\n return R.drawable.flag_libya;\n }\n }", "private BitmapDescriptor getMarkerIconFromDrawable(Drawable drawable) {\r\n Canvas canvas = new Canvas();\r\n Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);\r\n canvas.setBitmap(bitmap);\r\n drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());\r\n drawable.draw(canvas);\r\n return BitmapDescriptorFactory.fromBitmap(bitmap);\r\n }", "private BitmapDescriptor getMarkerIconFromDrawable(Drawable inputDrawable){\n Canvas canvas = new Canvas();\n Bitmap bitmap = Bitmap.createBitmap(inputDrawable.getIntrinsicWidth(), inputDrawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);\n canvas.setBitmap(bitmap);\n inputDrawable.setBounds(0, 0, inputDrawable.getIntrinsicWidth(), inputDrawable.getIntrinsicHeight());\n inputDrawable.draw(canvas);\n return BitmapDescriptorFactory.fromBitmap(bitmap);\n }", "private void configDefaultDrawable() {\n drawableResId().open = R.drawable.sms_add_btn;\n drawableResId().close = R.drawable.sms_close_btn;\n drawableResId().gotoEmotion = R.drawable.sms_kaomoji_btn;\n drawableResId().keyboard = R.drawable.sms_keyboard;\n drawableResId().voiceNormal = R.drawable.sms_voice_btn;\n drawableResId().voicePressed = R.drawable.sms_voice_btn_p;\n }", "public static android.graphics.drawable.Drawable createFromPath(java.lang.String r7) {\r\n /*\r\n r0 = 0;\r\n if (r7 != 0) goto L_0x0004;\r\n L_0x0003:\r\n return r0;\r\n L_0x0004:\r\n r1 = 8192; // 0x2000 float:1.14794E-41 double:4.0474E-320;\r\n android.os.Trace.traceBegin(r1, r7);\r\n r3 = new java.io.FileInputStream;\t Catch:{ IOException -> 0x002a, all -> 0x0025 }\r\n r3.<init>(r7);\t Catch:{ IOException -> 0x002a, all -> 0x0025 }\r\n r4 = getBitmapDrawable(r0, r0, r3);\t Catch:{ all -> 0x0019 }\r\n r3.close();\t Catch:{ IOException -> 0x002a, all -> 0x0025 }\r\n android.os.Trace.traceEnd(r1);\r\n return r4;\r\n L_0x0019:\r\n r4 = move-exception;\r\n throw r4;\t Catch:{ all -> 0x001b }\r\n L_0x001b:\r\n r5 = move-exception;\r\n r3.close();\t Catch:{ all -> 0x0020 }\r\n goto L_0x0024;\r\n L_0x0020:\r\n r6 = move-exception;\r\n r4.addSuppressed(r6);\t Catch:{ IOException -> 0x002a, all -> 0x0025 }\r\n L_0x0024:\r\n throw r5;\t Catch:{ IOException -> 0x002a, all -> 0x0025 }\r\n L_0x0025:\r\n r0 = move-exception;\r\n android.os.Trace.traceEnd(r1);\r\n throw r0;\r\n L_0x002a:\r\n r3 = move-exception;\r\n android.os.Trace.traceEnd(r1);\r\n return r0;\r\n */\r\n throw new UnsupportedOperationException(\"Method not decompiled: android.graphics.drawable.Drawable.createFromPath(java.lang.String):android.graphics.drawable.Drawable\");\r\n }", "public interface DrawableCreator {\n /**\n * Create a drawable from this bitmap\n */\n Drawable createDrawable(Context context, Bitmap b);\n }", "public Drawable getImage(){\n\t\treturn mImage;\n\t}", "public Result getFromDrawable() throws Exception{\n\n // edit the following line with the desired resource you want to test\n Uri uri= Uri.parse((\"android.resource://cepheustheapp.com.cepheus/\"+ R.drawable.back));\n InputStream inputStream= getContentResolver().openInputStream(uri);\n Bitmap bitmap = BitmapFactory.decodeStream(inputStream);\n if (bitmap == null)\n {\n // not a bitmap\n return null;\n }\n int width = bitmap.getWidth(), height = bitmap.getHeight();\n int[] pixels = new int[width * height];\n bitmap.getPixels(pixels, 0, width, 0, 0, width, height);\n bitmap.recycle();\n bitmap = null;\n RGBLuminanceSource source = new RGBLuminanceSource(width, height, pixels);\n BinaryBitmap bBitmap = new BinaryBitmap(new HybridBinarizer(source));\n MultiFormatReader reader = new MultiFormatReader();\n\n // result will hold the actual content\n Result result= reader.decode(bBitmap);\n\n\n return result;\n\n }", "static BufferedImage getImage(String directory) {\n\t\tClassLoader loader = DrawingUtility.class.getClassLoader();\n\t\tBufferedImage image;\n\t\ttry {\n\n\t\t\timage = ImageIO.read(loader.getResource(directory));\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"Fail load image from \" + directory);\n\t\t\timage = null;\n\t\t}\n\t\treturn image;\n\n\t}", "Drawable createDrawable(Context context, Bitmap b);", "private BitmapDescriptor getMarkerIconFromDrawableForReligion() {\r\n Drawable drawable = getResources().getDrawable(R.drawable.ic_religion);\r\n Canvas canvas = new Canvas();\r\n Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);\r\n canvas.setBitmap(bitmap);\r\n drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());\r\n drawable.draw(canvas);\r\n return BitmapDescriptorFactory.fromBitmap(bitmap);\r\n }", "public static int getDrawableId(String name)\n\t{\n\t\tClass<R.drawable> c = R.drawable.class;\n\t\tField f;\n\t\tint i = 0;\n\t\ttry\n\t\t{\n\t\t\tf = c.getField(name);\n\t\t\ti = f.getInt(f);\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tLog.e(\"RR\", e.toString());\n\t\t}\n\t\treturn i;\n\t}", "public static Drawable LoadImageFromWebOperations(String url, File cacheDir) {\n\t\ttry {\n\t\t\tDrawable d = null;\n\t\t\tString[] urlDir = url.split(\"/\");\n\t\t\tint sizeMax=600;\n\t\t\ttry {\n\t\t\t\t// File cacheDir = new File(ruta+File.separator+ urlDir[8]);\n\t\t\t\tif (!cacheDir.exists()) {\n\t\t\t\t\tcacheDir.mkdirs();\n\n\t\t\t\t}\n\t\t\t\tFile cacheDirName = new File(cacheDir + File.separator\n\t\t\t\t\t\t+ urlDir[urlDir.length - 1]);\n\n\t\t\t\tif (!cacheDirName.exists() || cacheDirName.length() == 0) {\n\t\t\t\t\tcacheDirName.createNewFile();\n\t\t\t\t\tInputStream is = (InputStream) new URL(url).getContent();\n\t\t\t\t\tBitmap bit = BitmapFactory.decodeStream(is);\n\t\t\t\t\t//Alto\n\t\t\t\t\tBitmap bit2=null;\n\t\t\t\t\tFileOutputStream fo = new FileOutputStream(cacheDirName);\n\t\t\t\t\t// Drawable d = Drawable.createFromStream(is, \"src name\");\n\t\t\t\t\tif(bit.getHeight()>sizeMax){\n\t\t\t\t\t\tbit2=Bitmap.createScaledBitmap(bit,(sizeMax*bit.getWidth()/bit.getHeight()), sizeMax, false);\n\t\t\t\t\t\tbit2.compress(CompressFormat.JPEG, 95, fo);\n\t\t\t\t\t}else if(bit.getWidth()>sizeMax){\n\t\t\t\t\t\tbit2=Bitmap.createScaledBitmap(bit,sizeMax, (sizeMax* bit.getHeight()/bit.getWidth()), false);\n\t\t\t\t\t\tbit2.compress(CompressFormat.JPEG, 95, fo);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tbit.compress(CompressFormat.JPEG, 95, fo);\n\t\t\t\t\t}\n\n\t\t\t\t\tif(Constants.DEBUG) Log.v(Constants.TAG,\"Url: \"+cacheDir + File.separator\n\t\t\t\t\t\t\t+ urlDir[urlDir.length - 1]);\n\t\t\t\t\tif(Constants.DEBUG) Log.v(Constants.TAG,\"Ancho y alto: \"+(bit.getWidth()+\" \"+bit.getHeight()));\n\t\t\t\t\tif(Constants.DEBUG) Log.v(Constants.TAG,\"Size1: \"+(bit.getRowBytes()*bit.getHeight()));\n\t\t\t\t\tbit.recycle();\n\t\t\t\t\tif(bit2!=null){\n\t\t\t\t\t\tif(Constants.DEBUG) Log.v(Constants.TAG,\"Size2: \"+(bit2.getRowBytes()*bit2.getHeight()));\n\t\t\t\t\t\tbit2.recycle();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.gc();\n\t\t\t\tRuntime.getRuntime().gc();\n\t\t\t\td = Drawable.createFromPath(cacheDirName.getPath());\n\t\t\t} catch (OutOfMemoryError e) {\n\t\t\t\tSystem.gc();\n\t\t\t\tRuntime.getRuntime().gc();\n\t\t\t}\n\t\t\t//\n\n\t\t\treturn d;\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}", "public int getIcon() {\n int i=0;\n String b = \"\";\n try {\n FileInputStream i1 = c.openFileInput(\"faculty.txt\"); //open the faculty file\n int size1 = i1.available();\n byte[] buffer1 = new byte[size1];\n i1.read(buffer1);\n i1.close();\n b = new String(buffer1); //b set to the text in the file\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n\n if(b.equals(\"Faculty of Engineering\")){ //comparing b(faculty in the file) to the Faculty of Engineering.This is repeated for the other faculties\n i=R.drawable.engine; //id of the engneering icon in the drawable file\n }\n if(b.equals(\"Faculty of Food and Agriculture\")){\n i=R.drawable.food;\n }\n if(b.equals(\"Faculty of Science and Technology\")){\n i=R.drawable.tech;\n }\n if(b.equals(\"Faculty of Medical Sciences\")){\n i=R.drawable.med;\n }\n if(b.equals(\"Faculty of Social Sciences\")){\n i=R.drawable.oc;\n }\n if(b.equals(\"aculty of Humanities and Education\")){\n i=R.drawable.human;\n }\n if(b.equals(\"Faculty of Law\")){\n i=R.drawable.la;\n }\n return i;\n }", "private Drawable rezizedDrawable() {\n Drawable logo = getResources().getDrawable(R.drawable.logo_compact);\n Bitmap mp = ((BitmapDrawable) logo).getBitmap();\n\n return new BitmapDrawable(getResources(), Bitmap.createScaledBitmap(mp, 100, 100, true));\n }", "private void addAllDrawables() {\n \t\n \tfor (int i = 0; i < 10; i++) {\n \t\tint res_id = c.getResources().getIdentifier(\"puzzle_\"+i, \"drawable\", c.getPackageName());\n \t\t\n \t\tif (res_id != 0) {\n \t\t\timage_id_array.add(res_id);\n \t\t}\n \t}\n }", "@TargetApi(Build.VERSION_CODES.LOLLIPOP)\n public Uri getLocalBitmapUri() {\n Drawable drawable = getResources().getDrawable(R.drawable.rp_icon3);\n Bitmap bmp = null;\n// bmp =Utility.user.getProfilePic();\n\n if (drawable instanceof BitmapDrawable){\n bmp = ((BitmapDrawable) getResources().getDrawable(R.drawable.rp_icon3)).getBitmap();\n }\n else\n {\n return null;\n }\n // Store image to default external storage directory\n Uri bmpUri = null;\n try {\n\n File file = new File(Environment.getExternalStoragePublicDirectory(\n Environment.DIRECTORY_DOWNLOADS), \"share_image_\" + System.currentTimeMillis() + \".png\");\n file.getParentFile().mkdirs();\n FileOutputStream out = new FileOutputStream(file);\n bmp.compress(Bitmap.CompressFormat.PNG, 90, out);\n out.close();\n bmpUri = Uri.fromFile(file);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return bmpUri;\n }", "public BufferedImage getDrawable(){\n\t\tif(this.isOilContamination()){\n\t\t\treturn this.myFlyweight.getDeadDrawable();\n\t\t}\n\t\t//check direction -- such a horrible way to write a method\n\t\t//redundant checking and ugh.... design this away please...........................\n\t\tif(this.getDirection().getX() > 0 && !this.myFlyweight.getMovingBackAnimationSequence().isEmpty()){\n\t\t\treturn this.myFlyweight.getMovingBackAnimationSequence().get(animationFrame);\n\t\t}\n\t\treturn this.myFlyweight.getAnimationSequence().get(animationFrame);\n\t}", "public static Drawable m17786a(Context context, String str) {\n Bitmap createBitmap;\n InputStream open = context.getAssets().open(\"ufo_res/\" + str);\n Bitmap decodeStream = BitmapFactory.decodeStream(open);\n Object a = C5225r.m17790a(decodeStream);\n if (NinePatch.isNinePatchChunk(a)) {\n createBitmap = Bitmap.createBitmap(decodeStream, 1, 1, decodeStream.getWidth() - 2, decodeStream.getHeight() - 2);\n decodeStream.recycle();\n Field declaredField = createBitmap.getClass().getDeclaredField(\"mNinePatchChunk\");\n declaredField.setAccessible(true);\n declaredField.set(createBitmap, a);\n } else {\n createBitmap = decodeStream;\n }\n open.close();\n if (createBitmap.getNinePatchChunk() == null) {\n return new BitmapDrawable(createBitmap);\n }\n Rect rect = new Rect();\n byte[] ninePatchChunk = createBitmap.getNinePatchChunk();\n rect.left = C5225r.m17785a(ninePatchChunk, 12);\n rect.right = C5225r.m17785a(ninePatchChunk, 16);\n rect.top = C5225r.m17785a(ninePatchChunk, 20);\n rect.bottom = C5225r.m17785a(ninePatchChunk, 24);\n return new NinePatchDrawable(context.getResources(), createBitmap, createBitmap.getNinePatchChunk(), rect, null);\n }", "public static Bitmap getBitmap(String path) {\n Bitmap bitmap = null;\n try {\n Log.i(\"FileManager\", \"GetBitmap: \" + path);\n FileInputStream imgIS = new FileInputStream(new File(path));\n BufferedInputStream bufIS = new BufferedInputStream(imgIS);\n bitmap = BitmapFactory.decodeStream(bufIS);\n Log.i(\"FileManager\", \"GetBitmap Finished: \" + bitmap);\n } catch (FileNotFoundException e) { //catch fileinputstream exceptions\n e.printStackTrace();\n } //trying to get wallpaper from display cycle node\n return bitmap;\n }", "private Drawable downloadFile(String fileUrl)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tInputStream is = (InputStream) new URL(fileUrl).getContent();\r\n\t\t\tDrawable d = Drawable.createFromStream(is, \"src\");\r\n\t\t\treturn d;\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "Bitmap load(String id);", "public static int getDrawableId(Context argContext, String argName) {\n Resources resources = argContext.getResources();\n int resourceId = resources.getIdentifier(argName, \"drawable\", argContext.getPackageName());\n return resourceId;\n }", "protected Drawable doInBackground(String... url) {\n try {\n\t\t\tInputStream is = (InputStream) new URL(url[0]).getContent();\n\t\t\tDrawable d = Drawable.createFromStream(is, \"src\");\n\t\t\treturn d;\n\t\t} \n\t\t\t\t\n\t\tcatch (Exception e) {\n\t\t\t//do nothing\n\t\t\treturn null;\n\t\t}\n }", "protected Drawable getIcon(Context context) {\n if (this.iconResource != 0) {\n return ContextCompat.getDrawable(context, this.iconResource);\n } else {\n return this.icon;\n }\n }", "public static Drawable getDrawableFromAssetUri(Context context, Uri\n assetUri) {\n\n AssetManager am = context.getAssets();\n Drawable drawable;\n\n try {\n /*cut off the first 15 characters because Uri looks like:\n /android_asset/path_here....\n */\n InputStream inputStream = am.open(assetUri\n .getPath().substring(15));\n drawable = Drawable.createFromStream\n (inputStream, null);\n inputStream.close();\n\n } catch (IOException ioe) {\n return null;\n }\n return drawable;\n }", "public void AddImgToRecyclerView()\n {\n imgsource = new Vector();\n Resources res = getResources();\n imgsource.add(res.getIdentifier(\"@drawable/add_overtime_schedule\", null, getPackageName()));\n imgsource.add(res.getIdentifier(\"@drawable/add_overtime\", null, getPackageName()));\n imgsource.add(res.getIdentifier(\"@drawable/clock_in\", null, getPackageName()));\n imgsource.add(res.getIdentifier(\"@drawable/vacation\", null, getPackageName()));\n imgsource.add(res.getIdentifier(\"@drawable/document\", null, getPackageName()));\n imgsource.add(res.getIdentifier(\"@drawable/order\", null, getPackageName()));\n }", "java.lang.String getGameIconUrl();", "public void init(GLAutoDrawable drawable) {}", "public synchronized Image getBoardM(Display d) throws FileNotFoundException {\n\t\tif (this.boardMImage == null) {\n\t\t\tthis.boardMImage = new Image(d, getClass().getResourceAsStream(boardMResource));\n\t\t}\n\t\t\n\t\treturn this.boardMImage;\n\t}", "private String makeImageUri(String name) {\n\t\tString image = name;\n\t\t// remove all white spaces\n\t\tString in = image.replaceAll(\"\\\\s+\", \"\");\n\t\t// turn to lower case\n\t\tString iname = in.toLowerCase();\n\t\tSystem.out.println(\"iName is: \" + iname);\n\t\tString mDrawableName = iname;\n\t\t// get the resId of the image\n\t\tint resID = getResources().getIdentifier(mDrawableName, \"drawable\",\n\t\t\t\tgetPackageName());\n\n\t\t// resID is notfound show default image\n\t\tif (resID == 0) {\n\t\t\tresID = getResources().getIdentifier(\"default_place\", \"drawable\",\n\t\t\t\t\tgetPackageName());\n\t\t}\n\n\t\t// make the uri\n\t\tUri imageURI = Uri.parse(\"android.resource://\" + getPackageName() + \"/\"\n\t\t\t\t+ resID);\n\t\timage = imageURI.toString();\n\t\treturn image;\n\t}", "private Bitmap loadImage(int id) {\n Bitmap bitmap = BitmapFactory.decodeResource(\n context.getResources(), id);\n Bitmap scaled = Bitmap.createScaledBitmap(bitmap, IMAGE_WIDTH,\n IMAGE_HEIGHT, true);\n bitmap.recycle();\n return scaled;\n }", "private void addLeftDrawable() {\n\n// mBusinessTitle.setCompoundDrawables(getDrawable(R.drawable.ic_assignment_black_24dp), null, null, null );\n//\n// mBusinessPhone.setCompoundDrawables(getDrawable(R.drawable.ic_settings_phone_black_24dp), null, null, null );\n//\n// mBusinessEmail.setCompoundDrawables(getDrawable(R.drawable.ic_mail_black_24dp), null, null, null );\n\n //change menu item save changes icon\n doneDrawable = getDrawable(R.drawable.ic_done_black_24dp);\n\n //change menu item reload icon\n updateDrawable = getDrawable(R.drawable.ic_edit_black_24dp);\n\n //add location drawable\n updateDrawable = new IconicsDrawable(this)\n .icon(GoogleMaterial.Icon.gmd_location_on)\n .color(getResources().getColor(R.color.editProfile_icon))\n .sizeDp(20);\n mAddLocation.setCompoundDrawables(getDrawable(R.drawable.ic_edit_black_24dp), null, null, null );\n\n mClearLocation.setBackground(getDrawable(R.drawable.ic_edit_black_24dp));\n }", "protected Image loadIcon() {\n /*\n * Icon by http://www.artua.com/, retrieved here:\n * http://www.iconarchive.com/show/star-wars-icons-by-artua.html\n */\n return new ImageLoader().loadIcon(\"moon.png\");\n }", "public static String getGameBallResource() {\r\n String imageResource = \"/bloodbowl/resources/ball.gif\";\r\n\r\n return imageResource;\r\n }", "public static RoundedBitmapDrawable getRoundedBitmap(Resources res, int drawableId) {\n try {\n Bitmap srcBitmap = BitmapFactory.decodeResource(res, drawableId);\n return getRoundedBitmap(res, srcBitmap);\n } catch (Exception e) {\n return null;\n }\n\n }", "public void put(@NonNull final String key, final Drawable value) {\n put(key, value, -1);\n }", "public Knob(Context context, int drawable) {\r\n\t\t\tBitmapFactory.Options opts = new BitmapFactory.Options();\r\n\t\t\topts.inJustDecodeBounds = true;\r\n\t\t\timg = BitmapFactory.decodeResource(context.getResources(), drawable); \r\n\t\t}", "String getIconFile();", "public synchronized Image getBoardHi(Display d) throws FileNotFoundException {\n\t\tif (this.boardHiImage == null) {\n\t\t\tthis.boardHiImage = new Image(d, getClass().getResourceAsStream(boardHiResource));\n\t\t}\n\t\t\n\t\treturn this.boardHiImage;\n\t}", "String getIcon();", "String getIcon();", "public int getBaseImageResourceId() {\n int gender = TestSubject.getInstance().getGender();\n if (gender == TestSubject.GENDER_NOT_CHOSEN) {\n return R.drawable.kid_abduction;\n }\n int resId = mBaseImageResId[gender];\n if (resId == 0) {\n return getImageResourceId(); // default to the image resource\n }\n return resId;\n }", "public static Bitmap GetDealSpriteBitmap()\r\n\t{\r\n\t\t// Load background desktop image from resouce\r\n\t\tBitmap image = null;\r\n\t\tif(CGameHelper.m_GameContext != null)\r\n\t\t{\r\n\t\t\tResources res = CGameHelper.m_GameContext.getResources();\r\n\t\t\tif(res == null)\r\n\t\t\t\treturn image; \r\n\r\n\t\t\tif(m_DealSpriteBitmap == null)\r\n\t\t\t{\r\n\t\t\t\tm_DealSpriteBitmap = BitmapFactory.decodeResource(res, R.drawable.face);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\timage = m_DealSpriteBitmap;\r\n\t\t} \r\n\t\treturn image;\r\n\t}", "public static int getResId(@NonNull String name) {\n Integer resId = map.get(name);\n if(resId != null) return resId;\n else return R.drawable.ic_help_circle;\n }", "abstract public String getImageResourcesDir();", "public Bitmap getBitmapFromResource(int resourceId) {\n return BitmapFactory.decodeResource(getContext().getResources(), resourceId);\n }", "@Override\n public void invalidateDrawable(Drawable drawable) {\n ShortcutInfo mShortcutInfo = (ShortcutInfo) getTag();\n boolean isInHotseatOrHideseat = mMode == Mode.HIDESEAT || mMode == Mode.HOTSEAT;\n\n /* YUNOS BEGIN */\n // ##date:2014/12/19 ##author:zhanggong.zg ##BugID:5581407,5587224\n Drawable icon = getIconDrawable();\n /* YUNOS END */\n if (icon != drawable) {\n super.invalidateDrawable(drawable);\n return;\n }\n if (drawable instanceof FancyDrawable) {\n String label = ((FancyDrawable) drawable).getVariableString(\"app_label\");\n if (label != null) {\n // ##date:2015/1/30 ##author:zhanggong.zg ##BugID:5751734\n if (mShortcutInfo != null) {\n BubbleController.updateIndicator(this);\n BubbleController.updateTitle(this);\n } else {\n setText(label);\n }\n } else if (mShortcutInfo != null) {\n BubbleController.updateIndicator(this);\n BubbleController.updateTitle(this);\n }\n }\n if (getWindowToken() == null ) {\n FolderInfo info = Launcher.findFolderInfo(mShortcutInfo.container);\n if (info != null)\n info.invalidate(this, mShortcutInfo);\n } else if (mSupportCard && !isInHotseatOrHideseat && mCardBackground != null) {\n invalidate();\n } else if (drawable instanceof FancyDrawable) {\n // ##date:2014/12/19 ##author:zhanggong.zg ##BugID:5587224\n invalidate();\n } else {\n super.invalidateDrawable(drawable);\n }\n }", "private byte[] getImageOne() {\n Bitmap icon = BitmapFactory.decodeResource(getApplicationContext().getResources(),\n R.drawable.image0);\n return ImageConvert.convertImage2ByteArray(icon);\n }", "public Drawable getIcon(Drawable placeholder)\n\t{\n\t\tsynchronized (mCache) {\n\t\t\tmIcon = mCache.get(getSign());\n\t\t}\n\t\tif(mIcon != null)\n\t\t\treturn mIcon;\n\t\tmExecutor.execute(mTask);\n\t\t\n\t\treturn placeholder;\n\t}", "java.lang.String getIcon();", "java.lang.String getIcon();", "protected abstract int getStateDrawable(int state);", "private LayerDrawable buildPinIcon(String iconPath, int iconColor) {\n\n LayerDrawable result = null;\n\n BitmapFactory.Options myOptions = new BitmapFactory.Options();\n myOptions.inDither = true;\n myOptions.inScaled = false;\n myOptions.inPreferredConfig = Bitmap.Config.ARGB_8888;// important\n myOptions.inPurgeable = true;\n\n Bitmap bitmap = null;\n try {\n bitmap = BitmapFactory.decodeStream(container.getContext().getAssets().open(iconPath), null, myOptions);\n\n\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }catch (Exception e) {\n //Crashlytics.logException(e);\n\n }\n\n\n Bitmap workingBitmap = Bitmap.createBitmap(100, 100, bitmap.getConfig()); //Bitmap.createBitmap(bitmap);\n Bitmap mutableBitmap = workingBitmap.copy(Bitmap.Config.ARGB_8888, true);\n\n\n Paint paint = new Paint();\n paint.setAntiAlias(true);\n paint.setDither(false);\n\n paint.setColor(iconColor);\n\n Canvas canvas = new Canvas(mutableBitmap);\n canvas.drawCircle(bitmap.getWidth()/2 + 10, bitmap.getHeight()/2 + 10, 32, paint);\n\n //\t canvas.drawBitmap(bitmap, 10, 10, null);\n\n if (!iconPath.isEmpty()) {\n\n try {\n result = new LayerDrawable(\n new Drawable[] {\n\t\t\t\t\t\t\t\t/*pincolor*/ new BitmapDrawable(mutableBitmap),\n new BitmapDrawable(BitmapFactory.decodeStream(container.getContext().getAssets().open(iconPath)))});\n\n } catch (Resources.NotFoundException 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\n\n\n return result;\n\n }", "private Drawable creaImmagineDaUrl(String urlImmagine)\n {\n try\n {\n InputStream is = (InputStream) new URL(urlImmagine).getContent();\n Drawable d = Drawable.createFromStream(is, null);\n return d;\n }catch (Exception e) {\n System.out.println(\"Exc=\"+e);\n return null;\n }\n }", "@Override\n\t\t\t\tpublic void onObtainDrawable(Drawable drawable, ImageView imageView) {\n\t\t\t\t}", "private BitmapDrawable getBitmapDrawableFromView(View v) {\r\n Bitmap bitmap = Bitmap.createBitmap(v.getWidth(), v.getHeight(), Bitmap.Config.ARGB_8888);\r\n Canvas canvas = new Canvas(bitmap);\r\n v.draw(canvas);\r\n return new BitmapDrawable(getResources(), bitmap);\r\n }", "@Override\n public void onBitmapReady(String id, String filePath) {\n if(icons.containsKey(id)){\n icons.get(id).setDrawable(ImageDownloaderService.fetchBitmapDrawable(filePath));\n displayAdapter.notifyIconChanged(id);\n }\n }", "public static android.graphics.drawable.Drawable getIcon(android.content.Context r6, android.graphics.drawable.Drawable r7, android.content.ComponentName r8) {\n /*\n r3 = com.android.launcher3.common.view.IconView.isKnoxShortcut(r8);\n if (r3 != 0) goto L_0x0010;\n L_0x0006:\n r3 = com.android.launcher3.theme.OpenThemeManager.getInstance();\n r3 = r3.isDefaultTheme();\n if (r3 != 0) goto L_0x0012;\n L_0x0010:\n r2 = r7;\n L_0x0011:\n return r2;\n L_0x0012:\n r1 = r6.getPackageManager();\n if (r1 != 0) goto L_0x0021;\n L_0x0018:\n r3 = \"PairAppsUtilities\";\n r4 = \"unable to retrieve PackageManager\";\n android.util.Log.e(r3, r4);\n r2 = r7;\n goto L_0x0011;\n L_0x0021:\n if (r8 == 0) goto L_0x003b;\n L_0x0023:\n r3 = r8.getPackageName();\t Catch:{ NoSuchMethodError -> 0x0042 }\n r4 = r8.getClassName();\t Catch:{ NoSuchMethodError -> 0x0042 }\n r3 = r1.semCheckComponentMetadataForIconTray(r3, r4);\t Catch:{ NoSuchMethodError -> 0x0042 }\n if (r3 != 0) goto L_0x003b;\n L_0x0031:\n r3 = r8.getPackageName();\t Catch:{ NoSuchMethodError -> 0x0042 }\n r3 = r1.semShouldPackIntoIconTray(r3);\t Catch:{ NoSuchMethodError -> 0x0042 }\n if (r3 == 0) goto L_0x0040;\n L_0x003b:\n r3 = 1;\n r7 = r1.semGetDrawableForIconTray(r7, r3);\t Catch:{ NoSuchMethodError -> 0x0042 }\n L_0x0040:\n r2 = r7;\n goto L_0x0011;\n L_0x0042:\n r0 = move-exception;\n r3 = \"PairAppsUtilities\";\n r4 = new java.lang.StringBuilder;\n r4.<init>();\n r5 = \"Method not found : \";\n r4 = r4.append(r5);\n r5 = r0.toString();\n r4 = r4.append(r5);\n r4 = r4.toString();\n android.util.Log.e(r3, r4);\n goto L_0x0040;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.launcher3.util.PairAppsUtilities.getIcon(android.content.Context, android.graphics.drawable.Drawable, android.content.ComponentName):android.graphics.drawable.Drawable\");\n }" ]
[ "0.71744645", "0.7048253", "0.6918368", "0.68820137", "0.6782876", "0.6755991", "0.6707138", "0.6558024", "0.65169185", "0.64087206", "0.64075094", "0.6387938", "0.6383949", "0.6375732", "0.63662285", "0.6271695", "0.62213236", "0.6197677", "0.6184125", "0.60788524", "0.6053273", "0.6008185", "0.60067075", "0.59992546", "0.5914619", "0.58814967", "0.5820457", "0.5815731", "0.5748044", "0.5718859", "0.5656738", "0.5645598", "0.5627385", "0.55969393", "0.55927765", "0.55526614", "0.5491678", "0.5488489", "0.54883707", "0.5484134", "0.5480678", "0.5472777", "0.54347074", "0.54343915", "0.54304236", "0.54118294", "0.5407323", "0.53948605", "0.539052", "0.538223", "0.5368518", "0.5344726", "0.5335083", "0.5326534", "0.53211224", "0.5316883", "0.5291909", "0.52529836", "0.5241904", "0.5221613", "0.52176064", "0.52095914", "0.5207075", "0.51602864", "0.51485586", "0.5147322", "0.5116603", "0.51118284", "0.5103011", "0.51007104", "0.5094841", "0.5093972", "0.5062681", "0.5049375", "0.50438213", "0.50417733", "0.5024982", "0.50224775", "0.5019155", "0.5018728", "0.50179344", "0.50013757", "0.50013757", "0.49703276", "0.4968802", "0.49564892", "0.495245", "0.49380922", "0.49295646", "0.4922739", "0.49179912", "0.4916509", "0.4916509", "0.4915599", "0.49151573", "0.4912322", "0.49078304", "0.48926896", "0.48901826", "0.48841178" ]
0.5532245
36
Open the camera to take a picture
public S<T> camImg(int code){ Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); activity.startActivityForResult(intent, code); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void openCamera(View view) {\n Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n\n mImagePath = getFile();\n takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, mImagePath);\n startActivityForResult(takePictureIntent, TAKE_PIC_CODE);\n }", "public void openCamera() {\n\n Uri photoURI = FileProvider.getUriForFile(this, BuildConfig.APPLICATION_ID + \".provider\", getTempImage());\n\n if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {\n photoURI = Uri.fromFile(getTempImage());\n }\n\n Intent cIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n cIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);\n startActivityForResult(cIntent, CAPTURE_PHOTO);\n }", "private void openCamera() {\n Intent intent=new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n // intent.setAction(Intent.ACTION_PICK);\n // intent.putExtra(MediaStore.EXTRA_OUTPUT,Image_uri);\n startActivityForResult(intent, camera_image_code);\n\n }", "private void takePicture() {\n\n Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n startActivityForResult(intent, REQUEST_CAMERA);\n\n }", "public void takePictureFromCamera() {\n Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n startActivityForResult(intent, CAMERA_REQUEST_CODE);\n\n }", "public void takePicture()\n {\n\n Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n\n startActivityForResult(cameraIntent, TAKE_PHOTO_CODE);\n }", "private void launchCamera() {\n Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n // Create a File reference for future access\n photoFile = getPhotoFileUri(photoFileName);\n\n // wrap File object into a content provider\n // required for API >= 24\n // See https://guides.codepath.com/android/Sharing-Content-with-Intents#sharing-files-with-api-24-or-higher\n Uri fileProvider = FileProvider.getUriForFile(getContext(), \"com.codepath.fileprovider\", photoFile);\n intent.putExtra(MediaStore.EXTRA_OUTPUT, fileProvider);\n\n // If you call startActivityForResult() using an intent that no app can handle, your app will crash.\n // So as long as the result is not null, it's safe to use the intent.\n if (intent.resolveActivity(getContext().getPackageManager()) != null) {\n // Start the image capture intent to take photo\n startActivityForResult(intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);\n }\n }", "private void launchCamera() {\n Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n // Create a File reference to access to future access\n photoFile = getPhotoFileUri(photoFileName);\n\n // wrap File object into a content provider\n // required for API >= 24\n // See https://guides.codepath.com/android/Sharing-Content-with-Intents#sharing-files-with-api-24-or-higher\n Uri fileProvider = FileProvider.getUriForFile(getContext(), \"com.codepath.fileprovider\", photoFile);\n intent.putExtra(MediaStore.EXTRA_OUTPUT, fileProvider);\n\n // If you call startActivityForResult() using an intent that no app can handle, your app will crash.\n // So as long as the result is not null, it's safe to use the intent.\n if (intent.resolveActivity(getContext().getPackageManager()) != null) {\n // Start the image capture intent to take photo\n startActivityForResult(intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);\n }\n }", "protected void open_camera_and_save_image() {\n Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n\n // Ensure that there is a camera activity to handle the intent.\n if(intent.resolveActivity(getPackageManager()) != null) {\n // create the file where the photo should go\n File photoFile = null;\n try {\n photoFile = createImageFile();\n } catch (IOException e) {\n // error occurred while creating the file\n result.setText(R.string.fail_in_creating_photo);\n }\n\n if(photoFile != null) {\n Uri photoURI = FileProvider.getUriForFile(this,\n \"com.example.jiankaiwang.fileprovider\", photoFile);\n intent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);\n\n // pass to another external activity\n startActivityForResult(intent, REQUEST_IMAGE_CAPTURE);\n }\n }\n }", "private void launchCamera() {\n Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n\n // Ensure that there's a camera activity to handle the intent\n if (takePictureIntent.resolveActivity(getPackageManager()) != null) {\n // Create the temporary File where the photo should go\n try {\n photoFile = createTempImageFile(PhotoActivity.this);\n } catch (IOException ex) {\n // Error occurred while creating the File\n ex.printStackTrace();\n }\n // Continue only if the File was successfully created\n if (photoFile != null) {\n\n // Get the path of the temporary file\n mTempPhotoPath = photoFile.getAbsolutePath();\n\n // Get the content URI for the image file\n Uri photoURI = FileProvider.getUriForFile(this,\n FILE_PROVIDER_AUTHORITY,\n photoFile);\n\n // Add the URI so the camera can store the image\n takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);\n\n // Launch the camera activity\n startActivityForResult(takePictureIntent, REQUEST_IMAGE_CAPTURE);\n }\n }\n }", "public void openCamera() {\n \n\n }", "public void toTakeAPicture(View view) {\n requestCameraPermissions();\n Intent launchCamera = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n startActivityForResult(launchCamera, Constants.CAM_REQUEST);\n\n\n\n }", "private void clickpic() {\n if (getApplicationContext().getPackageManager().hasSystemFeature(\n PackageManager.FEATURE_CAMERA)) {\n // Open default camera\n Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);\n\n // start the image capture Intent\n startActivityForResult(intent, 100);\n\n\n } else {\n Toast.makeText(getApplication(), \"Camera not supported\", Toast.LENGTH_LONG).show();\n }\n }", "protected void startCamera() {\n profileImageCaptured = new File(\n Environment.getExternalStorageDirectory() + \"/\" + \"temp.png\");\n if (profileImageCaptured.exists())\n profileImageCaptured.delete();\n\n outputFileUri = Uri.fromFile(profileImageCaptured);\n Intent intent = new Intent(\n android.provider.MediaStore.ACTION_IMAGE_CAPTURE);\n intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);\n intent.putExtra(\"return-data\", true);\n startActivityForResult(intent, CAMERA_REQUEST);\n\n }", "public void onCameraPressed(View view) {\n Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\r\n\r\n // create a file handle for the phoot that will be taken\r\n this.photoFile = getFileForPhoto(this.filename);\r\n Uri fileProvider = FileProvider.getUriForFile(PersonDetailsActivity.this, \"com.example.labtest1\", this.photoFile);\r\n intent.putExtra(MediaStore.EXTRA_OUTPUT, fileProvider);\r\n\r\n // Try to open the camera app\r\n if (intent.resolveActivity(getPackageManager()) != null) {\r\n startActivityForResult(intent, TAKE_PHOTO_ACTIVITY_REQUEST_CODE);\r\n }\r\n }", "private void dispatchTakePictureIntent() { // to camera\n\n // must be\n StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();\n StrictMode.setVmPolicy(builder.build());\n\n //stworzenie nazwy pliku dla nowego zdjęcia, bedzie nadpisywana za każdym razem\n File outFile = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), \"example.jpg\");\n\n //zapisanie ścieżki do nowego zdjęcia z aparatu\n mCameraFileName = outFile.toString();\n Uri outUri = Uri.fromFile(outFile);\n Intent intent = new Intent();\n intent.setAction(MediaStore.ACTION_IMAGE_CAPTURE);\n intent.putExtra(MediaStore.EXTRA_OUTPUT, outUri);\n if (intent.resolveActivity(getPackageManager()) != null) {\n startActivityForResult(intent, REQUEST_IMAGE_CAPTURE);\n } else {\n Toast.makeText(this, \"External storage not available\", Toast.LENGTH_SHORT).show();\n }\n }", "private void takePicture() {\n Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n // check if there is a camera app installed\n if (takePictureIntent.resolveActivity(getPackageManager()) != null) {\n // build the photo file\n mPhotoFile = new File(getExternalFilesDir(null), code + \".jpg\");\n // get URI using a file provider\n Uri photoURI = FileProvider.getUriForFile(this,\n \"com.martindisch.fileprovider\",\n mPhotoFile);\n // put URI into Intent\n takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);\n // send Intent\n startActivityForResult(takePictureIntent, REQUEST_IMAGE_CAPTURE);\n } else {\n Toast.makeText(this, R.string.no_camera, Toast.LENGTH_SHORT).show();\n }\n }", "@Override\n public void imageFromCamera() {\n Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n if (takePictureIntent.resolveActivity(getPackageManager()) != null) {\n startActivityForResult(takePictureIntent, REQUEST_IMAGE_CAPTURE);\n }\n }", "public void takePhoto(){\n // We create the intent and the file\n Intent intent = new Intent(\"android.media.action.IMAGE_CAPTURE\");\n File path = new File(Environment.getExternalStorageDirectory().toString() + PATH);\n if (!path.exists()) {\n path.mkdir();\n }\n File picture = new File(path.getAbsolutePath(),\"Foto.jpg\");\n intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(picture));\n // We have the path for the photo\n this.pictureId = Uri.fromFile(picture);\n // Begin the camera activity\n startActivityForResult(intent, CAMERA_APP);\n }", "private void openCamera() {\n CameraManager manager = (CameraManager) getSystemService(Context.CAMERA_SERVICE);\n try {\n String mCameraId = manager.getCameraIdList()[0];\n CameraCharacteristics characteristics = manager.getCameraCharacteristics(mCameraId);\n StreamConfigurationMap map = characteristics.\n get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);\n assert map != null;\n mImageDimension = map.getOutputSizes(SurfaceTexture.class)[0];\n // Add permission for camera and let user grant the permission\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.CAMERA) !=\n PackageManager.PERMISSION_GRANTED &&\n ActivityCompat.checkSelfPermission(this,\n Manifest.permission.WRITE_EXTERNAL_STORAGE) !=\n PackageManager.PERMISSION_GRANTED) {\n\n ActivityCompat.requestPermissions(CameraActivity.this, new\n String[]{Manifest.permission.CAMERA,\n Manifest.permission.WRITE_EXTERNAL_STORAGE},\n REQUEST_CAMERA_PERMISSION);\n }\n manager.openCamera(mCameraId, mStateCallback, null);\n } catch (CameraAccessException e) {\n e.printStackTrace();\n }\n }", "public void openCamera(View view) {\n //do something here\n dispatchTakePictureIntent();\n\n }", "@Override\n public void startCameraIntent() {\n Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);\n startActivityForResult(cameraIntent, PICK_FROM_CAMERA_REQUEST_CODE);\n }", "public void onLaunchCamera(View view) {\n Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);\n\n\n data.insertAnImage(OptionID.get(alg), null);\n Cursor imageCursor = data.getImageData(OptionID.get(alg));\n imageCursor.moveToNext();\n intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(getPhotoFileUri(imageCursor.getString(0))))); // set the image file name\n\n // If you call startActivityForResult() using an intent that no app can handle, your app will crash.\n // So as long as the result is not null, it's safe to use the intent.\n if (intent.resolveActivity(getPackageManager()) != null) {\n // Start the image capture intent to take photo\n startActivityForResult(intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);\n }\n }", "public void takePhoto(View view){\n Intent callCameraApplicationIntent = new Intent();\n //Todo: Se llama la accion de camara\n callCameraApplicationIntent.setAction(MediaStore.ACTION_IMAGE_CAPTURE);\n\n File photoFile = null;\n try {\n photoFile = createImageFile();\n }catch (IOException e){\n e.printStackTrace();\n }\n callCameraApplicationIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photoFile));\n //Todo: Se inicia la actividad y se pasa la constante ACTIVITY_START_CAMERA_APP al metodo onActivityResult\n startActivityForResult(callCameraApplicationIntent, ACTIVITY_START_CAMERA_APP);\n }", "public void onLaunchCamera() {\n takePic.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n // create Intent to take a picture and return control to the calling application\n Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n // Create a File reference to access to future access\n photoFile = getPhotoFileUri(photoFileName);\n\n // wrap File object into a content provider\n // required for API >= 24\n // See https://guides.codepath.com/android/Sharing-Content-with-Intents#sharing-files-with-api-24-or-higher\n Uri fileProvider = FileProvider.getUriForFile(Driver_License_Scan.this, \"com.codepath.fileprovider\", photoFile);\n intent.putExtra(MediaStore.EXTRA_OUTPUT, fileProvider);\n\n // If you call startActivityForResult() using an intent that no app can handle, your app will crash.\n // So as long as the result is not null, it's safe to use the intent.\n if (intent.resolveActivity(getPackageManager()) != null) {\n // Start the image capture intent to take photo\n startActivityForResult(intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);\n }\n }\n });\n }", "private void dispatchTakePictureIntent() {\n Intent takePictureIntent = new Intent ( MediaStore.ACTION_IMAGE_CAPTURE );\n //dam bao chi co mot hoat dodng camera\n if (takePictureIntent.resolveActivity ( getPackageManager () ) != null) {\n // tao file ma anh gui den\n File photoFile = null;\n try {\n photoFile = createImageFile ();\n } catch (IOException ex) {\n //ERROR\n }\n // neu co file gui anh vao photoFIle\n if (photoFile != null) {\n pathToFile = photoFile.getAbsolutePath ();\n Uri photoURI = FileProvider.getUriForFile ( this ,\n \"com.example.diem_danh_sv.fileprovider\" ,\n photoFile );\n takePictureIntent.putExtra ( MediaStore.EXTRA_OUTPUT , photoURI );\n startActivityForResult ( takePictureIntent , REQUEST_ID_IMAGE_CAPTURE );\n }\n }\n }", "public void onLaunchCamera(View view) {\n Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n // Create a File reference to access to future access\n /*photoFile = getPhotoFileUri(photoFileName);\n\n // wrap File object into a content provider\n // required for API >= 24\n // See https://guides.codepath.com/android/Sharing-Content-with-Intents#sharing-files-with-api-24-or-higher\n Uri fileProvider = FileProvider.getUriForFile(this, \"com.codepath.fileprovider\", photoFile);\n intent.putExtra(MediaStore.EXTRA_OUTPUT, fileProvider);*/\n\n // If you call startActivityForResult() using an intent that no app can handle, your app will crash.\n // So as long as the result is not null, it's safe to use the intent.\n if (intent.resolveActivity(getPackageManager()) != null) {\n // Start the image capture intent to take photo\n File photoFile = null;\n try {\n photoFile = createImageFile();\n } catch (IOException ex) {\n // Error occurred while creating the File\n\n }\n\n if (photoFile != null) {\n Uri photoURI = FileProvider.getUriForFile(this,\n \"com.example.android.fileprovider\",\n photoFile);\n intent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);\n startActivityForResult(intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);\n }\n }\n }", "@RequiresApi(api = Build.VERSION_CODES.N)\n public void captureFromCamera(View view) {\n Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n\n // Make sure that the user has given camera permissions.\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {\n Log.d(TAG, \"Camera permission denied\");\n\n // If permission is denied, ask for permission.\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.CAMERA},\n MY_PERMISSIONS_REQUEST_CAMERA);\n }\n else {\n // Ensure that there's a camera activity to handle the intent\n if (takePictureIntent.resolveActivity(getPackageManager()) != null) {\n // Create the File where the photo should go\n File photoFile = null;\n try {\n photoFile = createImageFile();\n } catch (IOException ex) {\n // Error occurred while creating the File\n Log.e(TAG, \"Error creating file.\");\n }\n // Continue only if the File was successfully created\n if (photoFile != null) {\n Uri photoURI = FileProvider.getUriForFile(this,\n \"com.example.android.fileprovider\",\n photoFile);\n takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);\n startActivityForResult(takePictureIntent, CAMERA_REQUEST_CODE);\n }\n }\n }\n }", "public void cameraIntent() {\n startActivityForResult(new Intent(\"android.media.action.IMAGE_CAPTURE\"), 1);\n }", "private void openCamera() {\n CameraManager manager = (CameraManager) getSystemService(Context.CAMERA_SERVICE);\n try {\n String cameraId = manager.getCameraIdList()[0];\n CameraCharacteristics characteristics = manager.getCameraCharacteristics(cameraId);\n StreamConfigurationMap map = characteristics.get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);\n assert map != null;\n imageDimension = map.getOutputSizes(SurfaceTexture.class)[0];\n // Add permission for camera and let user grant the permission\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE}, REQUEST_CAMERA_PERMISSION);\n return;\n }\n manager.openCamera(cameraId, stateCallback, null);\n } catch (CameraAccessException e) {\n Toast.makeText(this, \"Camera failed to open.\", Toast.LENGTH_SHORT).show();\n e.printStackTrace();\n }\n }", "public void camera(){\n System.out.println(\"I am taking pictures...\");\r\n }", "private void cameraIntent() {\n Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n if (takePictureIntent.resolveActivity(context.getPackageManager()) != null) {\n File photoFile = null;\n try {\n photoFile = createImageFile();\n } catch (IOException ex) {\n // Error occurred while creating the File\n\n }\n // Continue only if the File was successfully created\n if (photoFile != null) {\n takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT,\n Uri.fromFile(photoFile));\n ((MessageActivity) context).startActivityForResult(takePictureIntent, CAMERA_REQUEST);\n }\n }\n }", "private void takePhoto() {\n Intent cameraIntent = new Intent(Intent.ACTION_PICK);\n cameraIntent.setType(\"image/*\");\n //startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST);\n startActivityForResult(cameraIntent, GALLERY_PIC_REQUEST);\n }", "private void captureImage() {\n String imagename = \"urPics.jpg\";\n File file = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) + File.separator + imagename);\n Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n FileUri = Uri.fromFile(file);\n intent.putExtra(MediaStore.EXTRA_OUTPUT, FileUri);\n // start the image capture Intent\n startActivityForResult(intent, REQUEST_CODE_CAMERA);\n }", "public static void letCamera(Activity activity) {\n\t\tIntent imageCaptureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n\t\tstrImgPath = Environment.getExternalStorageDirectory().toString()\n\t\t\t\t+ \"/dlion/\";// �����Ƭ���ļ���\n\t\tString fileName = new SimpleDateFormat(\"yyyyMMddHHmmss\")\n\t\t\t\t.format(new Date()) + \".jpg\";// ��Ƭ����\n\t\tFile out = new File(strImgPath);\n\t\tif (!out.exists()) {\n\t\t\tout.mkdirs();\n\t\t}\n\t\tout = new File(strImgPath, fileName);\n\t\tstrImgPath = strImgPath + fileName;// ����Ƭ�ľ���·��\n\n\t\tUri uri = Uri.fromFile(out);\n\t\timageCaptureIntent.putExtra(MediaStore.EXTRA_OUTPUT, uri);\n\t\timageCaptureIntent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 2);\n\t\tactivity.startActivityForResult(imageCaptureIntent, 1);\n\t}", "public void takePhoto(View view) {\n Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n if (takePictureIntent.resolveActivity(getPackageManager()) != null) {\n startActivityForResult(takePictureIntent, REQUEST_IMAGE_CAPTURE);\n } else {\n Toast.makeText(this, \"Uh oh something went wrong with taking a photo\",\n Toast.LENGTH_SHORT).show();\n }\n }", "private void openCamera(int width, int height) {\n setupCamera(width, height);\n configureTransform(width, height);\n Activity activity = mActivity;\n CameraManager cameraManager = (CameraManager) mActivity.getSystemService(Context.CAMERA_SERVICE);\n try {\n if (ContextCompat.checkSelfPermission(mActivity, Manifest.permission.CAMERA) ==\n PackageManager.PERMISSION_GRANTED) {\n // connect the camera\n // TODO: add comments\n cameraManager.openCamera(mCameraId, mStateCallback, mBackgroundHandler);\n }\n } catch (CameraAccessException e) {\n e.printStackTrace();\n }\n }", "private void openCamera() {\n currentDateTimeString = new SimpleDateFormat(\"yyyy-MM-dd\").format(new Date());\n txtDate.setText(currentDateTimeString);\n txtDate.setEnabled(false);\n String state = Environment.getExternalStorageState();\n imageName = currentDateTimeString+\"@\"+userName+\"@\"+timestamp+ ApplicationConstant.EXTENTION_JPG;\n if (Environment.MEDIA_MOUNTED.equals(state)) {\n mFileTemp = new File(ApplicationConstant.FOLDER_PATH, imageName);\n } else {\n mFileTemp = new File(getFilesDir(), imageName);\n }\n /*Uri.fromFile(mFileTemp)*/\n Uri photoURI = null;\n if (android.os.Build.VERSION.SDK_INT >= ApplicationConstant.API_LEVEL_23) {\n photoURI = FileProvider.getUriForFile(UploadActivity.this, BuildConfig.APPLICATION_ID + \".provider\", mFileTemp);\n } else {\n photoURI = Uri.fromFile(mFileTemp);\n }\n Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);\n } else {\n List<ResolveInfo> resInfoList = UploadActivity.this.getPackageManager().queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);\n for (ResolveInfo resolveInfo : resInfoList) {\n String packageName = resolveInfo.activityInfo.packageName;\n UploadActivity.this.grantUriPermission(packageName, photoURI, Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION);\n }\n }\n intent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);\n startActivityForResult(intent, ApplicationConstant.RESULT_OPEN_CAMERA);\n }", "private void captureImage() {\n\t\tIntent intent = new Intent( MediaStore.ACTION_IMAGE_CAPTURE );\n\t\tmFileUri = getOutputMediaFileUri(); // create a file to save the image\n\t\tintent.putExtra(MediaStore.EXTRA_OUTPUT, mFileUri); // set the image file name\n\t\t// start the image capture Intent\n\t\tstartActivityForResult( intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE );\n\t}", "private void pickFromCamera() {\n Intent startCamera = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n startCamera.putExtra(MediaStore.EXTRA_OUTPUT, uriImage);\n startActivityForResult(startCamera, IMAGE_PICK_CAMERA_CODE);\n\n }", "private void dispatchTakePictureIntent() {\n Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n // Ensure that there's a camera activity to handle the intent\n if (takePictureIntent.resolveActivity(getPackageManager()) != null) {\n // Create the File where the photo should go\n File photoFile = null;\n try {\n photoFile = createImageFile();\n } catch (IOException ex) {\n // Error occurred while creating the File\n\n }\n // Continue only if the File was successfully created\n if (photoFile != null) {\n Uri photoURI = FileProvider.getUriForFile(this,\n \"com.example.android.fileprovider\",\n photoFile);\n takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);\n startActivityForResult(takePictureIntent, REQUEST_IMAGE_CAPTURE);\n }\n }\n }", "public void takePhoto(View view) throws IOException {\n Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n\n //check if there is any application capable of handling the intent\n if (intent.resolveActivity(getPackageManager()) != null) {\n //startActivityForResult(intent, REQUEST_IMAGE_CAPTURE);\n File imageFile = null;\n imageFile = getImageFile();\n\n if (imageFile != null) {\n Uri imageUri = FileProvider.getUriForFile(this, \"com.hfad.picturetaker.fileprovider\", imageFile);\n intent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri);\n startActivityForResult(intent, IMAGE_REQUEST);\n }\n }\n\n }", "private void takePhoto() {\n Uri fileUri = FileProvider.getUriForFile(Mic.getmCtx(), \"com.jay.appdemo1.fileProvider\", getOutputMediaFile());\n Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);\n intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);\n intent.putExtra(MediaStore.EXTRA_DURATION_LIMIT, 10); //限制的录制时长 以秒为单位\n// intent.putExtra(MediaStore.EXTRA_SIZE_LIMIT, 1024); //限制视频文件大小 以字节为单位\n// intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1); //设置拍摄的质量0~1\n// intent.putExtra(MediaStore.EXTRA_FULL_SCREEN, false); // 全屏设置\n startActivityForResult(intent, RECORD_SYSTEM_VIDEO);\n }", "private void takePicture() {\n boolean hasPermission = parentActivity.hasPermissionToTakePhoto();\n if (hasPermission) {\n Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n // Ensure that there's a camera activity to handle the intent\n if (takePictureIntent.resolveActivity(getContext().getPackageManager()) != null) {\n // Create the File where the photo should go\n File photoFile = null;\n try {\n photoFile = createImageFile();\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n\n // Continue only if the File was successfully created\n if (photoFile != null) {\n photoURI = FileProvider.getUriForFile(getContext(),\n \"saarland.cispa.trust.cispabay.file_provider\",\n photoFile);\n takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);\n startActivityForResult(takePictureIntent, RESULT_OK);\n }\n }\n\n }\n }", "private void captureImage(){\n\t\t\n\t\t//Setup location\n\t\tLocationManager lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE);\n\t\tLocation location = lm.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);\n\t\t\n\t\tdouble latitude = location.getLatitude();\n\t\tdouble longitude = location.getLongitude();\n\t\t\n\t\tIntent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n\t\t\n\t\tfileUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE, latitude, longitude);\n\t\t\n\t\tintent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);\n\t\t\n\t\t//Start the image capture Intent\n\t\tstartActivityForResult(intent, CAMERA_CAPTURE_IMAGE_REQUEST_CODE);\n\t}", "private void captureImage() {\n camera.takePicture(null, null, jpegCallback);\r\n }", "private void captureImage() {\n //Information about intents: http://developer.android.com/reference/android/content/Intent.html\n //Basically used to start up activities or send data between parts of a program\n Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n //Obtains the unique URI which sets up and prepares the image file to be taken, where it is to be placed,\n //and errors that may occur when taking the image.\n fileUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE);\n //Stores this information in the Intent (which can be usefully passed on to the following Activity)\n intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);\n // start the image capture Intent (opens up the camera application)\n startActivityForResult(intent, CAMERA_CAPTURE_IMAGE_REQUEST_CODE);\n }", "public void openCamera(View view){\n if (isInspecting) {\n Context context = App.getContext();\n Intent intent = new Intent(Inspector.this, PhotoManager.class);\n intent.putExtra(\"blueprint\", blueprint);\n intent.putExtra(\"isInspecting\", isInspecting);\n intent.putExtra(\"filename\", filename);\n View parent = (View) view.getParent();\n String tag = parent.getTag().toString();\n intent.putExtra(\"cameraID\", tag);\n LogManager.reportStatus(context, \"INSPECTOR\", \"parent tag = \" + tag);\n startActivity(intent);\n }\n }", "private void dispatchTakePictureIntent() {\n Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n // Ensure that there's a camera activity to handle the intent\n if (takePictureIntent.resolveActivity(context.getPackageManager()) != null) {\n // Create the File where the photo should go\n try {\n photoFile = createImageFile();\n } catch (IOException ex) {\n // Error occurred while creating the File\n Log.e(TAG, \"error.\");\n }\n // Continue only if the File was successfully created\n if (photoFile != null) {\n takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT,\n Uri.fromFile(photoFile));\n ((Activity) context).startActivityForResult(takePictureIntent, REQUEST_TAKE_PHOTO);\n }\n }\n else {\n Toast toast = Toast.makeText(context, \"Sorry, no camera app found.\", Toast.LENGTH_SHORT);\n toast.show();\n }\n }", "void startCamera() throws IOException {\n if (ContextCompat.checkSelfPermission(this, WRITE_EXTERNAL_STORAGE)\n != PackageManager.PERMISSION_GRANTED ||\n ContextCompat.checkSelfPermission(this, CAMERA) != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(this,\n new String[]{WRITE_EXTERNAL_STORAGE, CAMERA},\n WRITE_EXTERNAL_STORAGE_REQUEST);\n return;\n }\n dispatchTakePictureIntent();\n\n }", "private void pickFromCamera() {\n ContentValues values = new ContentValues();\n values.put(MediaStore.Images.Media.TITLE, \"Temp Pic\");\n values.put(MediaStore.Images.Media.DESCRIPTION, \"Temp Description\");\n\n //put Image uri\n image_uri = UserProfile.this.getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);\n\n //intent to start Camera\n Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, image_uri);\n startActivityForResult(cameraIntent, IMAGE_PICK_CAMERA_CODE);\n }", "private void dispatchTakePictureIntent() {\n Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n //Ensure there is a camera activity to handle the intent\n if(takePictureIntent.resolveActivity(getPackageManager()) != null) {\n //Create file where photo should go\n File photoFile = null;\n try {\n photoFile = createImageFile();\n }catch (IOException e){\n //Error occured while creating the file\n System.out.println(\"Exception in dispatch: \" + e.toString());\n }\n //continue only if the file was created correctly\n if(photoFile != null){\n photoUri = FileProvider.getUriForFile(\n this, \"com.example.android.fileprovider\", photoFile\n );\n takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoUri);\n startActivityForResult(takePictureIntent, CAMERA_REQUEST);\n }\n }\n }", "private void takePicture() {\n\n captureStillPicture();\n }", "private void newOpenCamera() {\n if (mThread == null) {\n mThread = new CameraHandlerThread();\n }\n\n synchronized (mThread) {\n mThread.openCamera();\n }\n }", "@Override\n public void onClick(View view) {\n try {\n if (ActivityCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n cameraManager.openCamera(cameraManager.getCameraIdList()[0],\n new CameraState(cameraView), null);\n } catch (CameraAccessException e) {\n Log.d(\"msg\",\"CameraAccessException\");\n e.printStackTrace();\n }\n\n }", "public void onClick(View v) {\n Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n if (takePictureIntent.resolveActivity(getPackageManager()) != null) {\n startActivityForResult(takePictureIntent, REQUEST_IMAGE_CAPTURE);\n }\n\n }", "private void dispatchTakePictureIntent() {\n Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n if (takePictureIntent.resolveActivity(getPackageManager()) != null) {\n startActivityForResult(takePictureIntent, REQUEST_TAKE_PHOTO);\n }\n }", "public void openCamera() {\n Toast.makeText(this, \"Coming soon...\", Toast.LENGTH_SHORT).show();\n }", "public void getCameraInstance() {\n newOpenCamera();\n }", "@Override // com.master.cameralibrary.CameraViewImpl\n public void takePicture() {\n if (!isCameraOpened()) {\n throw new IllegalStateException(\"Camera is not ready. Call start() before takePicture().\");\n } else if (getAutoFocus()) {\n this.mCamera.cancelAutoFocus();\n this.mCamera.autoFocus(new Camera.AutoFocusCallback() {\n /* class com.master.cameralibrary.Camera1.AnonymousClass2 */\n\n public void onAutoFocus(boolean z, Camera camera) {\n Camera1.this.takePictureInternal();\n }\n });\n } else {\n takePictureInternal();\n }\n }", "public void camara(){\n Intent fotoPick = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);\n String fecha = new SimpleDateFormat(\"yyyy_MM_dd_HH_mm_ss\").format(new Date());\n Uri uriSavedImage=Uri.fromFile(new File(getExternalFilesDir(Environment.DIRECTORY_DCIM),\"inmueble_\"+id+\"_\"+fecha+\".jpg\"));\n fotoPick.putExtra(MediaStore.EXTRA_OUTPUT, uriSavedImage);\n startActivityForResult(fotoPick,TAKE_PICTURE);\n\n }", "@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tIntent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);\r\n\t\t\t\tstartActivityForResult(Intent.createChooser(cameraIntent, \"Take your photo\"), TAKE_AVATAR_CAMERA_REQUEST);\r\n\t\t\t}", "private void takeAndSave(){\n Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n //Ensure there's a camera\n if(takePictureIntent.resolveActivity(getPackageManager())!=null){\n File photoFile = null;\n try{\n photoFile = createImageFile();\n }catch (IOException e){\n //Error message, maybe print out\n exit();\n }\n if(photoFile != null){\n Uri photoURI = FileProvider.getUriForFile(this, \"com.example.android.fileprovider\",photoFile);\n takePictureIntent.putExtra(MediaStore.Extra_OUTPUT, photoURI);\n startActivityForResult(takePictureIntent, REQUEST_TAKE_PHOTO);\n }\n }\n }", "public void startCamera()\n \t{\n\t\t// start the video capture\n\t\t//this.capture.open(0);\n\t\tcapture.open(cameraNumber);\n\n\n\n\t\t// is the video stream available?\n\t\tif (capture.isOpened())\n\t\t{\n\t\t\t// grab a frame every 33 ms (30 frames/sec)\n\t\t\tRunnable frameGrabber = new Runnable() {\n\n\t\t\t\t@Override\n\t\t\t\tpublic void run()\n\t\t\t\t{\n\t\t\t\t\tgrabFrame();\n\t\t\t\t}\n\t\t\t};\n\n\t\t\ttimer = Executors.newSingleThreadScheduledExecutor();\n\t\t\ttimer.scheduleAtFixedRate(frameGrabber, 0, 500, TimeUnit.MILLISECONDS);\n\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// log the error\n\t\t\tSystem.err.println(\"Impossible to open the camera connection...\");\n\t\t}\n \t}", "private void captureImage() {\n Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);\n\n if (intent.resolveActivity(getPackageManager()) != null) {\n try {\n mImageFile = createImageFile();\n } catch (IOException ex) {\n Log.e(TAG, ex.getLocalizedMessage(), ex);\n }\n\n // Continue only if the File was successfully created\n if (mImageFile != null) {\n// intent.putExtra(MediaStore.EXTRA_OUTPUT,\n// Uri.fromFile(mImageFile));\n startActivityForResult(intent, IMAGE_CAPTURE_REQ_CODE);\n } else {\n Toast.makeText(this, R.string.error_capture_image, Toast.LENGTH_SHORT).show();\n }\n } else {\n Toast.makeText(this, R.string.no_cam_app, Toast.LENGTH_SHORT).show();\n }\n }", "@Override\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\tIntent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); \n\t\t startActivityForResult(cameraIntent, CAMERA_REQUEST); \n\t\t\t\t\t}", "public void OpenCamera (View view){\n\t \t\n\t \t//Open Next Camera Activity and give the mood to it\n\t \tIntent intent = new Intent(this, Camera.class);\n\t \tintent.putExtra(\"mood\", Bar.getProgress());\n\t \tstartActivity(intent);\t\n\t }", "public static Camera open() { \n return new Camera(); \n }", "public void takePictureByCamera(Context context){\n\n String state = Environment.getExternalStorageState();\n if (state.equals(Environment.MEDIA_MOUNTED)) {\n Intent getImageByCamera = new Intent(\"android.media.action.IMAGE_CAPTURE\");\n ((Activity)context).startActivityForResult(getImageByCamera, TAG_takepicture);\n }\n else {\n MyToast.showToast(context,\"please install SDcard\");\n }\n }", "private void dispatchTakePhotoIntent() {\n Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n\n // Ensure that there's a camera activity to handle the intent\n if (takePictureIntent.resolveActivity(getPackageManager()) != null) {\n\n // Create the File where the photo should go\n File photoFile = null;\n try {\n photoFile = createImageFile();\n } catch (IOException ex) {\n // Error occurred while creating the File\n Log.e(TAG, \"dispatchTakePhotoIntent: \" + \"Error Creating file\");\n }\n\n // Continue only if the File was successfully created\n if (photoFile != null) {\n mImageURI = FileProvider.getUriForFile(this,\n \"com.davidhaas.mazeways.fileprovider\",\n photoFile);\n\n // Takes the picture\n takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, mImageURI);\n startActivityForResult(takePictureIntent, REQUEST_TAKE_PHOTO);\n }\n }\n }", "public void getImageFromCamera() {\n String capturedPath = \"image_\" + System.currentTimeMillis() + \".jpg\";\n File file = new File(Environment.getExternalStorageDirectory().getAbsolutePath()\n + \"/DCIM\", capturedPath);\n file.getParentFile().mkdirs();\n mCapturedImageUri = Uri.fromFile(file);\n\n Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n intent.putExtra(MediaStore.EXTRA_OUTPUT, mCapturedImageUri);\n startActivityForResult(intent, CAPTURE_IMAGE_REQUEST_CODE);\n }", "public void onClick(View v) {\n Intent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);\n startActivityForResult(i, cameraData);\n }", "@Override\n public void onClick(View v) {\n Cam.takePicture(shutterCallback, null, mPicture);\n// Cam.takePicture();\n }", "public void sendIntentToCamera() {\n\t\tIntent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);\n\t\t\n\t\t// Send the intent with id 2\n\t\tstartActivityForResult(i, 2);\n\t}", "@Override\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\n\t\t\t\t\tIntent openCameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n\t\t\t\t\tUri imageUri = Uri.fromFile(new File(Environment.getExternalStorageDirectory(),fileName));\n\t\t\t\t\topenCameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri);\n\t\t\t\t\tstartActivityForResult(openCameraIntent, 1);\n\t\t\t\t\tdismiss();\n\t\t\t\t}", "private void dispatchTakePictureIntent() {\n Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n // Ensure that there's a camera activity to handle the intent\n if (takePictureIntent.resolveActivity(getPackageManager()) != null) {\n startActivityForResult(takePictureIntent, REQUEST_TAKE_PHOTO);\n }\n }", "public void startCamera()\n {\n startCamera(null);\n }", "public void mudaFoto(View view){\n Intent tirarFoto = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n startActivityForResult(tirarFoto, TIRAR_FOTO);\n }", "private void takePicture() {\n lockFocus();\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tIntent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n\t\t\t\t// 下面这句指定调用相机拍照后的照片存储的路径\n\t\t\t\tintent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(Environment.getExternalStorageDirectory(), \"xiaoma.jpg\")));\n\t\t\t\tstartActivityForResult(intent, 2);\n\t\t\t\tmenu_mine.setVisibility(View.GONE);\n\t\t\t}", "@Override\n public void onClick(View v) {\n Intent camIntent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n\n camIntent.setType(\"image/*\");\n startActivityForResult(camIntent,CAMERA_REQUEST);\n }", "private void oldOpenCamera() {\n try {\n mCamera = Camera.open(); // attempt to get a Camera instance\n mCamera.setPreviewCallbackWithBuffer(this);\n Log.i(TAG, \"Instance created\");\n } catch (Exception e) {\n Log.e(TAG, \"Error getting Camera instance: \" + e.getMessage());\n }\n }", "public void onCaptureClick(View button){\n\t\tcamera.takePicture(null, null, this);\n\t}", "private void openImageIntent() {\n\t\tfinal File root = new File(Environment.getExternalStorageDirectory()\n\t\t\t\t+ File.separator + \"MyDir\" + File.separator);\n\t\troot.mkdirs();\n\n\t\tfinal File sdImageMainDirectory = new File(root, getUniquePhotoName());\n\t\toutputFileUri = Uri.fromFile(sdImageMainDirectory);\n\n\t\t// Camera.\n\t\tfinal List<Intent> cameraIntents = new ArrayList<Intent>();\n\t\tfinal Intent captureIntent = new Intent(\n\t\t\t\tandroid.provider.MediaStore.ACTION_IMAGE_CAPTURE);\n\t\tfinal PackageManager packageManager = source.getPackageManager();\n\t\tfinal List<ResolveInfo> listCam = packageManager.queryIntentActivities(\n\t\t\t\tcaptureIntent, 0);\n\t\tfor (ResolveInfo res : listCam) {\n\t\t\tfinal String packageName = res.activityInfo.packageName;\n\t\t\tfinal Intent intent = new Intent(captureIntent);\n\t\t\tintent.setComponent(new ComponentName(res.activityInfo.packageName,\n\t\t\t\t\tres.activityInfo.name));\n\t\t\tintent.setPackage(packageName);\n\t\t\tintent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);\n\t\t\tcameraIntents.add(intent);\n\t\t}\n\n\t\t// Filesystem.\n\t\tfinal Intent galleryIntent = new Intent();\n\t\tgalleryIntent.setType(\"*/*\");\n\t\tgalleryIntent.setAction(Intent.ACTION_GET_CONTENT);\n\n\t\t// Chooser of filesystem options.\n\t\tIntent chooserIntent = Intent.createChooser(galleryIntent, \"Select Source\");\n\n\t\t// Add the camera options.\n\t\t//chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS,\n\t\t//\t\tcameraIntents.toArray(new Parcelable[] {}));\n\t\t\n\t\tIntent getContentIntent = FileUtils.createGetContentIntent();\n\n\t chooserIntent = Intent.createChooser(getContentIntent, \"Select a file\");\n\n\t\tsource.startActivityForResult(chooserIntent, Constants.QUIZSHOW_DATA);\n\t\t\n\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tif (new FileUtil().getFilesList() != null) {\n\t\t\t\t\tPictureToBye.deletePhotos();// 清空Pad上的图片\n\t\t\t\t}\n\t\t\t\tIntent intentCamera = new Intent(\n\t\t\t\t\t\tMediaStore.ACTION_IMAGE_CAPTURE);\n\n\t\t\t\tUri uri = null;\n\t\t\t\ttry {\n\t\t\t\t\turi = Uri.fromFile(new FileUtil().createFileInSDCard(\n\t\t\t\t\t\t\tDateUtils.toString(new Date(), \"yyyyMMddHHmmss\")\n\t\t\t\t\t\t\t\t\t+ \"test.jpg\", \"/\"));\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t// intentCamera.putExtra(name, value);\n\t\t\t\tintentCamera.putExtra(MediaStore.EXTRA_OUTPUT, uri);\n\t\t\t\tstartActivity(intentCamera);\n\t\t\t}", "private void invokeCameraSerialNumber() {\n\n // get a file reference\n pictureUri = FileProvider.getUriForFile(this, getApplicationContext().getPackageName(), createImageFile()); // Make Uri file example file://storage/emulated/0/Pictures/Civil_ID20180924_180619.jpg\n\n Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); // Go to camera\n\n // tell the camera where to save the image.\n intent.putExtra(MediaStore.EXTRA_OUTPUT, pictureUri);\n\n // tell the camera to request WRITE permission.\n intent.setFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);\n\n startActivityForResult(intent, CAMERA_DEVICE_SERIAL_NUMBER);\n\n }", "@Override\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\tLog.d(\"Camara\", \"Esta antes de capturar la imagen\");\n\t\t\t\t\t\tmCamera.takePicture(null, null, mPicture);\n\t\t\t\t\t\t\n\t\t\t\t\t}", "@Override\n public void openVideoCapture(Map<String, Object> parameters) throws Exception {\n checkNotNull(camera, \"Camera required\");\n ImageView viewCamera = checkNotNull((ImageView) parameters.get(\"viewCamera\"),\n \"Camera's ImageView required\");\n\n videoCapture.open(camera.getWebCamIndex());\n\n videoCapture.set(3, camera.getWidth());\n videoCapture.set(4, camera.getHeight());\n\n Runnable frameGrabber = () -> viewCamera.setImage(grabFrame(new HashMap<>()));\n timer = Executors.newSingleThreadScheduledExecutor();\n timer.scheduleAtFixedRate(frameGrabber, 0, 33, TimeUnit.MICROSECONDS);\n }", "@Override\n public void onClick(View arg0) {\n if (arg0.getId() == R.id.fab) {\n takePicture();\n /* try {\n//use standard intent to capture an image\n Intent captureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n//we will handle the returned data in onActivityResult\n startActivityForResult(captureIntent, CAMERA_CAPTURE);\n } catch(ActivityNotFoundException anfe){\n//display an error message\n String errorMessage = \"Whoops - your device doesn't support capturing images!\";\n Toast toast = Toast.makeText(getActivity(), errorMessage, Toast.LENGTH_SHORT);\n toast.show();\n }*/\n }\n\n }", "@Override\n public void onClick(View v) {\n Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n // Create a File reference to access to future access\n photoFile = getPhotoFileUri(photoFileName);\n\n // wrap File object into a content provider\n // required for API >= 24\n // See https://guides.codepath.com/android/Sharing-Content-with-Intents#sharing-files-with-api-24-or-higher\n Uri fileProvider = FileProvider.getUriForFile(Driver_License_Scan.this, \"com.codepath.fileprovider\", photoFile);\n intent.putExtra(MediaStore.EXTRA_OUTPUT, fileProvider);\n\n // If you call startActivityForResult() using an intent that no app can handle, your app will crash.\n // So as long as the result is not null, it's safe to use the intent.\n if (intent.resolveActivity(getPackageManager()) != null) {\n // Start the image capture intent to take photo\n startActivityForResult(intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);\n }\n }", "private void openCamera(int desiredWidth, int desiredHeight) {\n if (mCamera != null) {\n throw new RuntimeException(\"camera already initialized\");\n }\n\n android.hardware.Camera.CameraInfo info = new android.hardware.Camera.CameraInfo();\n\n // Try to find a front-facing camera (e.g. for videoconferencing).\n int numCameras = android.hardware.Camera.getNumberOfCameras();\n for (int i = 0; i < numCameras; i++) {\n android.hardware.Camera.getCameraInfo(i, info);\n if (info.facing == android.hardware.Camera.CameraInfo.CAMERA_FACING_BACK) {\n mCamera = android.hardware.Camera.open(i);\n break;\n }\n }\n if (mCamera == null) {\n// Log.d(TAG, \"No front-facing camera found; opening default\");\n mCamera = android.hardware.Camera.open(); // opens first back-facing camera\n }\n if (mCamera == null) {\n throw new RuntimeException(\"Unable to open camera\");\n }\n\n android.hardware.Camera.Parameters parms = mCamera.getParameters();\n\n CameraUtils.choosePreviewSize(parms, desiredWidth, desiredHeight);\n\n // Give the camera a hint that we're recording video. This can have a big\n // impact on frame rate.\n parms.setRecordingHint(true);\n\n // leave the frame rate set to default\n mCamera.setParameters(parms);\n\n int[] fpsRange = new int[2];\n android.hardware.Camera.Size mCameraPreviewSize = parms.getPreviewSize();\n parms.getPreviewFpsRange(fpsRange);\n String previewFacts = mCameraPreviewSize.width + \"x\" + mCameraPreviewSize.height;\n if (fpsRange[0] == fpsRange[1]) {\n previewFacts += \" @\" + (fpsRange[0] / 1000.0) + \"fps\";\n } else {\n previewFacts += \" @[\" + (fpsRange[0] / 1000.0) +\n \" - \" + (fpsRange[1] / 1000.0) + \"] fps\";\n }\n// TextView text = (TextView) findViewById(R.id.cameraParams_text);\n// text.setText(previewFacts);\n\n mCameraPreviewWidth = mCameraPreviewSize.width;\n mCameraPreviewHeight = mCameraPreviewSize.height;\n\n\n// AspectFrameLayout layout = (AspectFrameLayout) findViewById(R.id.cameraPreview_afl);\n\n Display display = ((WindowManager)getSystemService(WINDOW_SERVICE)).getDefaultDisplay();\n\n if(display.getRotation() == Surface.ROTATION_0) {\n mCamera.setDisplayOrientation(90);\n// layout.setAspectRatio((double) mCameraPreviewHeight / mCameraPreviewWidth);\n } else if(display.getRotation() == Surface.ROTATION_270) {\n// layout.setAspectRatio((double) mCameraPreviewHeight/ mCameraPreviewWidth);\n mCamera.setDisplayOrientation(180);\n } else {\n // Set the preview aspect ratio.\n// layout.setAspectRatio((double) mCameraPreviewWidth / mCameraPreviewHeight);\n }\n }", "public void open(Activity activity, boolean isSecureCamera, boolean isCaptureIntent);", "public void chooseCamera() {\n if (cameraFront) {\n int cameraId = findBackFacingCamera();\n if (cameraId >= 0) {\n //open the backFacingCamera\n //set a picture callback\n //refresh the preview\n\n mCamera = Camera.open(cameraId);\n setRotation(mCamera, mCamera.getParameters(), cameraId);\n // mCamera.setDisplayOrientation(90);\n mPicture = getPictureCallback();\n mPreview.refreshCamera(mCamera);\n }\n } else {\n int cameraId = findFrontFacingCamera();\n if (cameraId >= 0) {\n //open the backFacingCamera\n //set a picture callback\n //refresh the preview\n mCamera = Camera.open(cameraId);\n setRotation(mCamera, mCamera.getParameters(), cameraId);\n // mCamera.setDisplayOrientation(90);\n mPicture = getPictureCallback();\n mPreview.refreshCamera(mCamera);\n }\n }\n }", "public void onCameraOpened() {\n openCameraCommon();\n initializeControlByIntent();\n new Thread() {\n public void run() {\n try {\n Thread.sleep(500);\n PhotoModule.this.mIsCameraOpened = true;\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }.start();\n }", "public void onClick(ClickEvent event) {\n Camera c = Camera.getCamera();\n if (!Camera.isSupported()) {\n GWT.log(\"Camera not supported!\");\n return;\n }\n c.getPictureFromLibrary(new CameraCallback() {\n public void onSuccess(String picture) {\n GWT.log(\"picture=\" + picture);\n pictureDataHidden.setValue(picture);\n image.setUrl(\"data:image/jpeg;base64,\" + picture);\n }\n\n public void onFailure(String error) {\n GWT.log(\"getPictureFromCamera\" + error);\n }\n });\n }", "public RoeImage takePicture() \r\n {\r\n // return variable\r\n RoeImage result = new RoeImage();\r\n \r\n // take picture \r\n this.cam.read(this.frame);\r\n \r\n // update timestamp for image capturing\r\n this.timestamp = System.currentTimeMillis();\r\n \r\n // add picture to result\r\n result.SetImage(this.frame);\r\n \r\n // add timestamp of captured image\r\n result.setTimeStamp(this.timestamp);\r\n\r\n // the image captured with properties\r\n return result;\r\n }", "private void dispatchTakePictureIntent(int requestCode) {\n Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n // Ensure that there's a camera activity to handle the intent\n if (takePictureIntent.resolveActivity(getPackageManager()) != null) {\n // Create the File where the photo should go\n File photoFile = null;\n try {\n photoFile = createImageFile();\n } catch (IOException ex) {\n Log.d(\"ex\", \"cannot create file\");\n\n }\n // Continue only if the File was successfully created\n if (photoFile != null) {\n Uri photoURI = FileProvider.getUriForFile(this,\n \"com.example.android.fileprovider\",\n photoFile);\n takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);\n startActivityForResult(takePictureIntent, requestCode);\n }\n }\n }", "private void captureImageWithPermission() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n int rc = ActivityCompat.checkSelfPermission(this, Manifest.permission.CAMERA);\n if (rc == PackageManager.PERMISSION_GRANTED) {\n captureImage();\n } else {\n EasyPermissions.requestPermissions(\n this,\n getString(R.string.msg_no_camera_permission),\n RC_CAMERA,\n Manifest.permission.CAMERA);\n }\n } else {\n captureImage();\n }\n }", "private void captureImage() {\n\n if (ContextCompat.checkSelfPermission(Main2Activity.this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(Main2Activity.this, new String[]{Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE}, 0);\n } else {\n Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n if (takePictureIntent.resolveActivity(getPackageManager()) != null) {\n // Create the File where the photo should go\n try {\n\n photoFile = createImageFile();\n //displayMessage(getBaseContext(), photoFile.getAbsolutePath());\n //Log.i(\"path_check\", photoFile.getAbsolutePath());\n\n // Continue only if the File was successfully created\n if (photoFile != null) {\n Uri photoURI = FileProvider.getUriForFile(Main2Activity.this,\n \"com.example.mobileai.fileprovider\",\n photoFile);\n takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);\n startActivityForResult(takePictureIntent, requestCode);\n }\n } catch (Exception ex) {\n // Error occurred while creating the File\n //displayMessage(getBaseContext(), ex.getMessage().toString());\n }\n\n\n } else {\n // displayMessage(getBaseContext(), \"Null\");\n }\n }\n\n\n }", "private void openImageIntent() {\n final File root = new File(Environment.getExternalStorageDirectory() + File.separator + \"MyDir\" + File.separator);\n root.mkdirs();\n final String fname = UUID.randomUUID().toString();\n final File sdImageMainDirectory = new File(root, fname);\n outputFileUri = Uri.fromFile(sdImageMainDirectory);\n\n // Camera.\n final List<Intent> cameraIntents = new ArrayList<Intent>();\n final Intent captureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n final PackageManager packageManager = getPackageManager();\n final List<ResolveInfo> listCam = packageManager.queryIntentActivities(captureIntent, 0);\n for(ResolveInfo res : listCam) {\n final String packageName = res.activityInfo.packageName;\n final Intent intent = new Intent(captureIntent);\n intent.setComponent(new ComponentName(res.activityInfo.packageName, res.activityInfo.name));\n intent.setPackage(packageName);\n intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);\n cameraIntents.add(intent);\n }\n\n // Filesystem.\n final Intent galleryIntent = new Intent();\n galleryIntent.setType(\"image/*\");\n galleryIntent.setAction(Intent.ACTION_GET_CONTENT);\n\n // Chooser of filesystem options.\n final Intent chooserIntent = Intent.createChooser(galleryIntent, \"Select Source\");\n\n // Add the camera options.\n chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, cameraIntents.toArray(new Parcelable[]{}));\n\n startActivityForResult(chooserIntent, SELECT_PICTURE);\n }", "private void getCamera() {\n if (camera == null) {\n try {\n camera = Camera.open();\n params = camera.getParameters();\n } catch (RuntimeException e) {\n\n }\n }\n }" ]
[ "0.82149965", "0.81434745", "0.8024423", "0.7966478", "0.796025", "0.7913169", "0.787442", "0.7869801", "0.78401554", "0.78332704", "0.77781445", "0.77454996", "0.7713866", "0.76918113", "0.76913613", "0.7686289", "0.76414293", "0.7558814", "0.755042", "0.7538604", "0.75275373", "0.75203973", "0.7465643", "0.7438631", "0.7421968", "0.7417893", "0.74102664", "0.7378884", "0.73708975", "0.735055", "0.73262453", "0.7305606", "0.72568095", "0.72513103", "0.72388124", "0.72274977", "0.72040665", "0.71968347", "0.71853864", "0.71679115", "0.715823", "0.7137761", "0.71289116", "0.712348", "0.71199197", "0.71181583", "0.7107205", "0.71065164", "0.70745945", "0.7063023", "0.70501286", "0.7039249", "0.7035703", "0.7020446", "0.7007214", "0.6993479", "0.6991504", "0.69804025", "0.6972861", "0.69673043", "0.695624", "0.6953445", "0.6951233", "0.69497675", "0.694552", "0.69260126", "0.69257164", "0.69251454", "0.6924446", "0.6920696", "0.6906078", "0.69058055", "0.68724275", "0.6863961", "0.6862468", "0.6857766", "0.68468934", "0.6822775", "0.6785989", "0.6776647", "0.6750976", "0.6731322", "0.6727563", "0.6720187", "0.67129695", "0.67052", "0.6699044", "0.66925555", "0.66898024", "0.667973", "0.6663423", "0.6642063", "0.66392434", "0.66238123", "0.6620238", "0.66192555", "0.66035813", "0.65915096", "0.6570796", "0.65697587", "0.6567841" ]
0.0
-1
Open the camera to take a video
public S<T> camVid(int code){ Intent intent = new Intent(android.provider.MediaStore.ACTION_VIDEO_CAPTURE); activity.startActivityForResult(intent, code); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void takePhoto() {\n Uri fileUri = FileProvider.getUriForFile(Mic.getmCtx(), \"com.jay.appdemo1.fileProvider\", getOutputMediaFile());\n Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);\n intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);\n intent.putExtra(MediaStore.EXTRA_DURATION_LIMIT, 10); //限制的录制时长 以秒为单位\n// intent.putExtra(MediaStore.EXTRA_SIZE_LIMIT, 1024); //限制视频文件大小 以字节为单位\n// intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1); //设置拍摄的质量0~1\n// intent.putExtra(MediaStore.EXTRA_FULL_SCREEN, false); // 全屏设置\n startActivityForResult(intent, RECORD_SYSTEM_VIDEO);\n }", "public void openCamera() {\n \n\n }", "public void startCamera()\n \t{\n\t\t// start the video capture\n\t\t//this.capture.open(0);\n\t\tcapture.open(cameraNumber);\n\n\n\n\t\t// is the video stream available?\n\t\tif (capture.isOpened())\n\t\t{\n\t\t\t// grab a frame every 33 ms (30 frames/sec)\n\t\t\tRunnable frameGrabber = new Runnable() {\n\n\t\t\t\t@Override\n\t\t\t\tpublic void run()\n\t\t\t\t{\n\t\t\t\t\tgrabFrame();\n\t\t\t\t}\n\t\t\t};\n\n\t\t\ttimer = Executors.newSingleThreadScheduledExecutor();\n\t\t\ttimer.scheduleAtFixedRate(frameGrabber, 0, 500, TimeUnit.MILLISECONDS);\n\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// log the error\n\t\t\tSystem.err.println(\"Impossible to open the camera connection...\");\n\t\t}\n \t}", "@Override\n public void openVideoCapture(Map<String, Object> parameters) throws Exception {\n checkNotNull(camera, \"Camera required\");\n ImageView viewCamera = checkNotNull((ImageView) parameters.get(\"viewCamera\"),\n \"Camera's ImageView required\");\n\n videoCapture.open(camera.getWebCamIndex());\n\n videoCapture.set(3, camera.getWidth());\n videoCapture.set(4, camera.getHeight());\n\n Runnable frameGrabber = () -> viewCamera.setImage(grabFrame(new HashMap<>()));\n timer = Executors.newSingleThreadScheduledExecutor();\n timer.scheduleAtFixedRate(frameGrabber, 0, 33, TimeUnit.MICROSECONDS);\n }", "public void openCamera() {\n\n Uri photoURI = FileProvider.getUriForFile(this, BuildConfig.APPLICATION_ID + \".provider\", getTempImage());\n\n if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {\n photoURI = Uri.fromFile(getTempImage());\n }\n\n Intent cIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n cIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);\n startActivityForResult(cIntent, CAPTURE_PHOTO);\n }", "private void openCamera(int desiredWidth, int desiredHeight) {\n if (mCamera != null) {\n throw new RuntimeException(\"camera already initialized\");\n }\n\n android.hardware.Camera.CameraInfo info = new android.hardware.Camera.CameraInfo();\n\n // Try to find a front-facing camera (e.g. for videoconferencing).\n int numCameras = android.hardware.Camera.getNumberOfCameras();\n for (int i = 0; i < numCameras; i++) {\n android.hardware.Camera.getCameraInfo(i, info);\n if (info.facing == android.hardware.Camera.CameraInfo.CAMERA_FACING_BACK) {\n mCamera = android.hardware.Camera.open(i);\n break;\n }\n }\n if (mCamera == null) {\n// Log.d(TAG, \"No front-facing camera found; opening default\");\n mCamera = android.hardware.Camera.open(); // opens first back-facing camera\n }\n if (mCamera == null) {\n throw new RuntimeException(\"Unable to open camera\");\n }\n\n android.hardware.Camera.Parameters parms = mCamera.getParameters();\n\n CameraUtils.choosePreviewSize(parms, desiredWidth, desiredHeight);\n\n // Give the camera a hint that we're recording video. This can have a big\n // impact on frame rate.\n parms.setRecordingHint(true);\n\n // leave the frame rate set to default\n mCamera.setParameters(parms);\n\n int[] fpsRange = new int[2];\n android.hardware.Camera.Size mCameraPreviewSize = parms.getPreviewSize();\n parms.getPreviewFpsRange(fpsRange);\n String previewFacts = mCameraPreviewSize.width + \"x\" + mCameraPreviewSize.height;\n if (fpsRange[0] == fpsRange[1]) {\n previewFacts += \" @\" + (fpsRange[0] / 1000.0) + \"fps\";\n } else {\n previewFacts += \" @[\" + (fpsRange[0] / 1000.0) +\n \" - \" + (fpsRange[1] / 1000.0) + \"] fps\";\n }\n// TextView text = (TextView) findViewById(R.id.cameraParams_text);\n// text.setText(previewFacts);\n\n mCameraPreviewWidth = mCameraPreviewSize.width;\n mCameraPreviewHeight = mCameraPreviewSize.height;\n\n\n// AspectFrameLayout layout = (AspectFrameLayout) findViewById(R.id.cameraPreview_afl);\n\n Display display = ((WindowManager)getSystemService(WINDOW_SERVICE)).getDefaultDisplay();\n\n if(display.getRotation() == Surface.ROTATION_0) {\n mCamera.setDisplayOrientation(90);\n// layout.setAspectRatio((double) mCameraPreviewHeight / mCameraPreviewWidth);\n } else if(display.getRotation() == Surface.ROTATION_270) {\n// layout.setAspectRatio((double) mCameraPreviewHeight/ mCameraPreviewWidth);\n mCamera.setDisplayOrientation(180);\n } else {\n // Set the preview aspect ratio.\n// layout.setAspectRatio((double) mCameraPreviewWidth / mCameraPreviewHeight);\n }\n }", "public void grabarVideo(View v) {\n Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);\n /*Creamos un archivo que contendra el video, mandanto el path (null es para indicar que no\n va en un directorio interno, solo en la raiz) ---- nombre del video*/\n /*RECORDAR QUE ESTE ARCHIVO QUEDA EN LA CARPETA ANDROID, EN LA CARPETA CON EL NOMBRE DEL\n * PAQUETE DEL PROYECTO, ESA ES LA RAIZ*/\n File video = new File(getExternalFilesDir(null), txtNombreArchivo.getText().toString());\n /*Mandamos el permiso para almacenar, y la ruta del video donde quedara*/\n intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(video));\n /*Ejecutamos la actividad*/\n startActivity(intent);\n }", "@FXML\r\n protected void startCamera() {\r\n // set a fixed width for the frame\r\n this.currentFrame.setFitWidth(600);\r\n // preserve image ratio\r\n this.currentFrame.setPreserveRatio(true);\r\n\r\n if (!this.cameraActive) {\r\n\r\n // start the video capture\r\n //this.capture.open(0);\r\n //Read the video (Chage video)\r\n this.capture.open(\"Faruri.m4v\");\r\n\r\n\r\n System.out.println(\"start capture...\");\r\n // is the video stream available?\r\n if (this.capture.isOpened()) {\r\n System.out.println(\"inif\");\r\n this.cameraActive = true;\r\n\r\n // grab a frame every 33 ms (30 frames/sec)\r\n Runnable frameGrabber = new Runnable() {\r\n\r\n @Override\r\n public void run() {\r\n // effectively grab and process a single frame\r\n Mat frame = grabFrame();\r\n\r\n//\t\t\t\t\t\t// convert and show the frame\r\n//\t\t\t\t\t\tImage imageToShow = Utils.mat2Image(frame);\r\n//\t\t\t\t\t\tupdateImageView(currentFrame, imageToShow);\r\n }\r\n };\r\n\r\n this.timer = Executors.newSingleThreadScheduledExecutor();\r\n this.timer.scheduleAtFixedRate(frameGrabber, 0, 33, TimeUnit.MILLISECONDS);\r\n\r\n // update the button content\r\n this.button.setText(\"Stop Video\");\r\n } else {\r\n // log the error\r\n System.err.println(\"Impossible to open the video...\");\r\n }\r\n } else {\r\n // the camera is not active at this point\r\n this.cameraActive = false;\r\n // update again the button content\r\n this.button.setText(\"Start Video\");\r\n\r\n // stop the timer\r\n this.stopAcquisition();\r\n }\r\n }", "private void openCamera() {\n Intent intent=new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n // intent.setAction(Intent.ACTION_PICK);\n // intent.putExtra(MediaStore.EXTRA_OUTPUT,Image_uri);\n startActivityForResult(intent, camera_image_code);\n\n }", "public void openCamera(View view) {\n Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n\n mImagePath = getFile();\n takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, mImagePath);\n startActivityForResult(takePictureIntent, TAKE_PIC_CODE);\n }", "private void openCamera(int width, int height) {\n setupCamera(width, height);\n configureTransform(width, height);\n Activity activity = mActivity;\n CameraManager cameraManager = (CameraManager) mActivity.getSystemService(Context.CAMERA_SERVICE);\n try {\n if (ContextCompat.checkSelfPermission(mActivity, Manifest.permission.CAMERA) ==\n PackageManager.PERMISSION_GRANTED) {\n // connect the camera\n // TODO: add comments\n cameraManager.openCamera(mCameraId, mStateCallback, mBackgroundHandler);\n }\n } catch (CameraAccessException e) {\n e.printStackTrace();\n }\n }", "public static Camera open() { \n return new Camera(); \n }", "@Override\n public void onOpened(@NonNull CameraDevice camera) {\n mCameraDevice = camera;\n if (mIsRecording) {\n try {\n mVideoFilePath = FileUtils.createVideoFile(getApplicationContext());\n } catch (IOException e) {\n e.printStackTrace();\n }\n startNewVideo();\n } else {\n startPreview();\n }\n }", "public static void letCamera(Activity activity) {\n\t\tIntent imageCaptureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n\t\tstrImgPath = Environment.getExternalStorageDirectory().toString()\n\t\t\t\t+ \"/dlion/\";// �����Ƭ���ļ���\n\t\tString fileName = new SimpleDateFormat(\"yyyyMMddHHmmss\")\n\t\t\t\t.format(new Date()) + \".jpg\";// ��Ƭ����\n\t\tFile out = new File(strImgPath);\n\t\tif (!out.exists()) {\n\t\t\tout.mkdirs();\n\t\t}\n\t\tout = new File(strImgPath, fileName);\n\t\tstrImgPath = strImgPath + fileName;// ����Ƭ�ľ���·��\n\n\t\tUri uri = Uri.fromFile(out);\n\t\timageCaptureIntent.putExtra(MediaStore.EXTRA_OUTPUT, uri);\n\t\timageCaptureIntent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 2);\n\t\tactivity.startActivityForResult(imageCaptureIntent, 1);\n\t}", "private void launchCamera() {\n Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n // Create a File reference for future access\n photoFile = getPhotoFileUri(photoFileName);\n\n // wrap File object into a content provider\n // required for API >= 24\n // See https://guides.codepath.com/android/Sharing-Content-with-Intents#sharing-files-with-api-24-or-higher\n Uri fileProvider = FileProvider.getUriForFile(getContext(), \"com.codepath.fileprovider\", photoFile);\n intent.putExtra(MediaStore.EXTRA_OUTPUT, fileProvider);\n\n // If you call startActivityForResult() using an intent that no app can handle, your app will crash.\n // So as long as the result is not null, it's safe to use the intent.\n if (intent.resolveActivity(getContext().getPackageManager()) != null) {\n // Start the image capture intent to take photo\n startActivityForResult(intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);\n }\n }", "private void launchCamera() {\n Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n // Create a File reference to access to future access\n photoFile = getPhotoFileUri(photoFileName);\n\n // wrap File object into a content provider\n // required for API >= 24\n // See https://guides.codepath.com/android/Sharing-Content-with-Intents#sharing-files-with-api-24-or-higher\n Uri fileProvider = FileProvider.getUriForFile(getContext(), \"com.codepath.fileprovider\", photoFile);\n intent.putExtra(MediaStore.EXTRA_OUTPUT, fileProvider);\n\n // If you call startActivityForResult() using an intent that no app can handle, your app will crash.\n // So as long as the result is not null, it's safe to use the intent.\n if (intent.resolveActivity(getContext().getPackageManager()) != null) {\n // Start the image capture intent to take photo\n startActivityForResult(intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);\n }\n }", "protected void open_camera_and_save_image() {\n Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n\n // Ensure that there is a camera activity to handle the intent.\n if(intent.resolveActivity(getPackageManager()) != null) {\n // create the file where the photo should go\n File photoFile = null;\n try {\n photoFile = createImageFile();\n } catch (IOException e) {\n // error occurred while creating the file\n result.setText(R.string.fail_in_creating_photo);\n }\n\n if(photoFile != null) {\n Uri photoURI = FileProvider.getUriForFile(this,\n \"com.example.jiankaiwang.fileprovider\", photoFile);\n intent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);\n\n // pass to another external activity\n startActivityForResult(intent, REQUEST_IMAGE_CAPTURE);\n }\n }\n }", "private void openCamera() {\n CameraManager manager = (CameraManager) getSystemService(Context.CAMERA_SERVICE);\n try {\n String mCameraId = manager.getCameraIdList()[0];\n CameraCharacteristics characteristics = manager.getCameraCharacteristics(mCameraId);\n StreamConfigurationMap map = characteristics.\n get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);\n assert map != null;\n mImageDimension = map.getOutputSizes(SurfaceTexture.class)[0];\n // Add permission for camera and let user grant the permission\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.CAMERA) !=\n PackageManager.PERMISSION_GRANTED &&\n ActivityCompat.checkSelfPermission(this,\n Manifest.permission.WRITE_EXTERNAL_STORAGE) !=\n PackageManager.PERMISSION_GRANTED) {\n\n ActivityCompat.requestPermissions(CameraActivity.this, new\n String[]{Manifest.permission.CAMERA,\n Manifest.permission.WRITE_EXTERNAL_STORAGE},\n REQUEST_CAMERA_PERMISSION);\n }\n manager.openCamera(mCameraId, mStateCallback, null);\n } catch (CameraAccessException e) {\n e.printStackTrace();\n }\n }", "public void getCameraInstance() {\n newOpenCamera();\n }", "public void onCameraPressed(View view) {\n Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\r\n\r\n // create a file handle for the phoot that will be taken\r\n this.photoFile = getFileForPhoto(this.filename);\r\n Uri fileProvider = FileProvider.getUriForFile(PersonDetailsActivity.this, \"com.example.labtest1\", this.photoFile);\r\n intent.putExtra(MediaStore.EXTRA_OUTPUT, fileProvider);\r\n\r\n // Try to open the camera app\r\n if (intent.resolveActivity(getPackageManager()) != null) {\r\n startActivityForResult(intent, TAKE_PHOTO_ACTIVITY_REQUEST_CODE);\r\n }\r\n }", "public void cameraIntent() {\n startActivityForResult(new Intent(\"android.media.action.IMAGE_CAPTURE\"), 1);\n }", "private void onPlayVideoClick() {\n Intent intent = new Intent(Intent.ACTION_VIEW);\n intent.setDataAndType(Uri.parse(\"file://\" + mediaPath), \"video/mp4\");\n startActivity(intent);\n }", "public static VideoSource startCamera(CameraConfig config) {\n System.out.println(\"Starting camera '\" + config.name + \"' on \" + config.path);\n CameraServer inst = CameraServer.getInstance();\n UsbCamera camera = new UsbCamera(config.name, config.path);\n MjpegServer server = inst.startAutomaticCapture(camera);\n\n Gson gson = new GsonBuilder().create();\n\n camera.setConfigJson(gson.toJson(config.config));\n camera.setConnectionStrategy(VideoSource.ConnectionStrategy.kKeepOpen);\n\n if (config.streamConfig != null) {\n server.setConfigJson(gson.toJson(config.streamConfig));\n }\n\n return camera;\n }", "public void openCamera() {\n Toast.makeText(this, \"Coming soon...\", Toast.LENGTH_SHORT).show();\n }", "protected void startCamera() {\n profileImageCaptured = new File(\n Environment.getExternalStorageDirectory() + \"/\" + \"temp.png\");\n if (profileImageCaptured.exists())\n profileImageCaptured.delete();\n\n outputFileUri = Uri.fromFile(profileImageCaptured);\n Intent intent = new Intent(\n android.provider.MediaStore.ACTION_IMAGE_CAPTURE);\n intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);\n intent.putExtra(\"return-data\", true);\n startActivityForResult(intent, CAMERA_REQUEST);\n\n }", "private void newOpenCamera() {\n if (mThread == null) {\n mThread = new CameraHandlerThread();\n }\n\n synchronized (mThread) {\n mThread.openCamera();\n }\n }", "public Single<Uri> captureVideo(@NonNull FragmentActivity activity) {\n Request request = new Request()\n .setSource(Request.Source.VIDEO_CAPTURE);\n return request(activity, request)\n .map(Result::getUris)\n .map(uris -> uris.get(0));\n }", "public void captureVideo(String element) {\r\n\t\tvideoUtil.startVideoTool(getView(), element);\r\n\t}", "private void openCamera() {\n CameraManager manager = (CameraManager) getSystemService(Context.CAMERA_SERVICE);\n try {\n String cameraId = manager.getCameraIdList()[0];\n CameraCharacteristics characteristics = manager.getCameraCharacteristics(cameraId);\n StreamConfigurationMap map = characteristics.get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);\n assert map != null;\n imageDimension = map.getOutputSizes(SurfaceTexture.class)[0];\n // Add permission for camera and let user grant the permission\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE}, REQUEST_CAMERA_PERMISSION);\n return;\n }\n manager.openCamera(cameraId, stateCallback, null);\n } catch (CameraAccessException e) {\n Toast.makeText(this, \"Camera failed to open.\", Toast.LENGTH_SHORT).show();\n e.printStackTrace();\n }\n }", "public void toTakeAPicture(View view) {\n requestCameraPermissions();\n Intent launchCamera = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n startActivityForResult(launchCamera, Constants.CAM_REQUEST);\n\n\n\n }", "@Override\n public void onClick(View v) {\n Intent it = new Intent(Intent.ACTION_VIEW);\n Uri uri = Uri.parse(\"http://\"+ PostUrl.Media+\":8080/upload/\"+item.getMediaPath().get(0).split(\"\\\\.\")[0]+\".mp4\");\n it.setDataAndType(uri, \"video/mp4\");\n context.startActivity(it);\n\n }", "public void onLaunchCamera(View view) {\n Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n // Create a File reference to access to future access\n /*photoFile = getPhotoFileUri(photoFileName);\n\n // wrap File object into a content provider\n // required for API >= 24\n // See https://guides.codepath.com/android/Sharing-Content-with-Intents#sharing-files-with-api-24-or-higher\n Uri fileProvider = FileProvider.getUriForFile(this, \"com.codepath.fileprovider\", photoFile);\n intent.putExtra(MediaStore.EXTRA_OUTPUT, fileProvider);*/\n\n // If you call startActivityForResult() using an intent that no app can handle, your app will crash.\n // So as long as the result is not null, it's safe to use the intent.\n if (intent.resolveActivity(getPackageManager()) != null) {\n // Start the image capture intent to take photo\n File photoFile = null;\n try {\n photoFile = createImageFile();\n } catch (IOException ex) {\n // Error occurred while creating the File\n\n }\n\n if (photoFile != null) {\n Uri photoURI = FileProvider.getUriForFile(this,\n \"com.example.android.fileprovider\",\n photoFile);\n intent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);\n startActivityForResult(intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);\n }\n }\n }", "public void openCamera(View view){\n if (isInspecting) {\n Context context = App.getContext();\n Intent intent = new Intent(Inspector.this, PhotoManager.class);\n intent.putExtra(\"blueprint\", blueprint);\n intent.putExtra(\"isInspecting\", isInspecting);\n intent.putExtra(\"filename\", filename);\n View parent = (View) view.getParent();\n String tag = parent.getTag().toString();\n intent.putExtra(\"cameraID\", tag);\n LogManager.reportStatus(context, \"INSPECTOR\", \"parent tag = \" + tag);\n startActivity(intent);\n }\n }", "public void OpenCamera (View view){\n\t \t\n\t \t//Open Next Camera Activity and give the mood to it\n\t \tIntent intent = new Intent(this, Camera.class);\n\t \tintent.putExtra(\"mood\", Bar.getProgress());\n\t \tstartActivity(intent);\t\n\t }", "public void goToVideoViewer(Uri vidURI) {\n Log.i(\"progress\",\"goToViewer\");\n\n Intent playerIntent = new Intent(this, VideoActivity.class);\n\n //attaches the video's uri\n playerIntent.putExtra(INTENT_MESSAGE, vidURI.toString());\n startActivity(playerIntent);\n }", "private void launchCamera() {\n Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n\n // Ensure that there's a camera activity to handle the intent\n if (takePictureIntent.resolveActivity(getPackageManager()) != null) {\n // Create the temporary File where the photo should go\n try {\n photoFile = createTempImageFile(PhotoActivity.this);\n } catch (IOException ex) {\n // Error occurred while creating the File\n ex.printStackTrace();\n }\n // Continue only if the File was successfully created\n if (photoFile != null) {\n\n // Get the path of the temporary file\n mTempPhotoPath = photoFile.getAbsolutePath();\n\n // Get the content URI for the image file\n Uri photoURI = FileProvider.getUriForFile(this,\n FILE_PROVIDER_AUTHORITY,\n photoFile);\n\n // Add the URI so the camera can store the image\n takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);\n\n // Launch the camera activity\n startActivityForResult(takePictureIntent, REQUEST_IMAGE_CAPTURE);\n }\n }\n }", "public void camera(){\n System.out.println(\"I am taking pictures...\");\r\n }", "public void takePictureFromCamera() {\n Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n startActivityForResult(intent, CAMERA_REQUEST_CODE);\n\n }", "private void captureImage() {\n Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);\n\n if (intent.resolveActivity(getPackageManager()) != null) {\n try {\n mImageFile = createImageFile();\n } catch (IOException ex) {\n Log.e(TAG, ex.getLocalizedMessage(), ex);\n }\n\n // Continue only if the File was successfully created\n if (mImageFile != null) {\n// intent.putExtra(MediaStore.EXTRA_OUTPUT,\n// Uri.fromFile(mImageFile));\n startActivityForResult(intent, IMAGE_CAPTURE_REQ_CODE);\n } else {\n Toast.makeText(this, R.string.error_capture_image, Toast.LENGTH_SHORT).show();\n }\n } else {\n Toast.makeText(this, R.string.no_cam_app, Toast.LENGTH_SHORT).show();\n }\n }", "private void getCamera() {\n if (camera == null) {\n try {\n camera = Camera.open();\n params = camera.getParameters();\n } catch (RuntimeException e) {\n\n }\n }\n }", "private void clickpic() {\n if (getApplicationContext().getPackageManager().hasSystemFeature(\n PackageManager.FEATURE_CAMERA)) {\n // Open default camera\n Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);\n\n // start the image capture Intent\n startActivityForResult(intent, 100);\n\n\n } else {\n Toast.makeText(getApplication(), \"Camera not supported\", Toast.LENGTH_LONG).show();\n }\n }", "Camera getCamera();", "public VideoCapture()\n {\n \n nativeObj = VideoCapture_0();\n \n return;\n }", "@RequiresApi(api = Build.VERSION_CODES.N)\n public void captureFromCamera(View view) {\n Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n\n // Make sure that the user has given camera permissions.\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {\n Log.d(TAG, \"Camera permission denied\");\n\n // If permission is denied, ask for permission.\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.CAMERA},\n MY_PERMISSIONS_REQUEST_CAMERA);\n }\n else {\n // Ensure that there's a camera activity to handle the intent\n if (takePictureIntent.resolveActivity(getPackageManager()) != null) {\n // Create the File where the photo should go\n File photoFile = null;\n try {\n photoFile = createImageFile();\n } catch (IOException ex) {\n // Error occurred while creating the File\n Log.e(TAG, \"Error creating file.\");\n }\n // Continue only if the File was successfully created\n if (photoFile != null) {\n Uri photoURI = FileProvider.getUriForFile(this,\n \"com.example.android.fileprovider\",\n photoFile);\n takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);\n startActivityForResult(takePictureIntent, CAMERA_REQUEST_CODE);\n }\n }\n }\n }", "private void dispatchTakePictureIntent() { // to camera\n\n // must be\n StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();\n StrictMode.setVmPolicy(builder.build());\n\n //stworzenie nazwy pliku dla nowego zdjęcia, bedzie nadpisywana za każdym razem\n File outFile = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), \"example.jpg\");\n\n //zapisanie ścieżki do nowego zdjęcia z aparatu\n mCameraFileName = outFile.toString();\n Uri outUri = Uri.fromFile(outFile);\n Intent intent = new Intent();\n intent.setAction(MediaStore.ACTION_IMAGE_CAPTURE);\n intent.putExtra(MediaStore.EXTRA_OUTPUT, outUri);\n if (intent.resolveActivity(getPackageManager()) != null) {\n startActivityForResult(intent, REQUEST_IMAGE_CAPTURE);\n } else {\n Toast.makeText(this, \"External storage not available\", Toast.LENGTH_SHORT).show();\n }\n }", "private Camera selectAndOpenCamera() {\n\t\tCamera.CameraInfo info = new Camera.CameraInfo();\n\t\tint numberOfCameras = Camera.getNumberOfCameras();\n\n\t\tint selected = -1;\n\n\t\tfor (int i = 0; i < numberOfCameras; i++) {\n\t\t\tCamera.getCameraInfo(i, info);\n\n\t\t\tif( info.facing == Camera.CameraInfo.CAMERA_FACING_BACK ) {\n\t\t\t\tselected = i;\n\t\t\t\tflipHorizontal = false;\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\t// default to a front facing camera if a back facing one can't be found\n\t\t\t\tselected = i;\n\t\t\t\tflipHorizontal = true;\n\t\t\t}\n\t\t}\n\n\t\tif( selected == -1 ) {\n\t\t\tdialogNoCamera();\n\t\t\treturn null; // won't ever be called\n\t\t} else {\n\t\t\treturn Camera.open(selected);\n\t\t}\n\t}", "public VideoCapture(String filename)\n {\n \n nativeObj = VideoCapture_1(filename);\n \n return;\n }", "private void launchVideoFile(File videoFile){\n String dstPath = (Environment.getExternalStoragePublicDirectory(\n Environment.DIRECTORY_DOWNLOADS) + \"/\" + videoFile.getName());\n File dstFile = new File(dstPath);\n if (dstFile.exists()){\n Uri path = Uri.fromFile(dstFile);\n Intent objIntent = new Intent(Intent.ACTION_VIEW);\n objIntent.setDataAndType(path, \"video/*\");\n objIntent.setFlags(Intent. FLAG_ACTIVITY_CLEAR_TOP);\n startActivity(objIntent);//Starting the video viewer\n } else {\n Toast.makeText(this, \"Error: This file does not exist.\",\n Toast.LENGTH_SHORT).show();\n }\n }", "public void openCamera(View view) {\n //do something here\n dispatchTakePictureIntent();\n\n }", "public VideoCapture(int device)\n {\n \n nativeObj = VideoCapture_2(device);\n \n return;\n }", "private void openCamera() {\n currentDateTimeString = new SimpleDateFormat(\"yyyy-MM-dd\").format(new Date());\n txtDate.setText(currentDateTimeString);\n txtDate.setEnabled(false);\n String state = Environment.getExternalStorageState();\n imageName = currentDateTimeString+\"@\"+userName+\"@\"+timestamp+ ApplicationConstant.EXTENTION_JPG;\n if (Environment.MEDIA_MOUNTED.equals(state)) {\n mFileTemp = new File(ApplicationConstant.FOLDER_PATH, imageName);\n } else {\n mFileTemp = new File(getFilesDir(), imageName);\n }\n /*Uri.fromFile(mFileTemp)*/\n Uri photoURI = null;\n if (android.os.Build.VERSION.SDK_INT >= ApplicationConstant.API_LEVEL_23) {\n photoURI = FileProvider.getUriForFile(UploadActivity.this, BuildConfig.APPLICATION_ID + \".provider\", mFileTemp);\n } else {\n photoURI = Uri.fromFile(mFileTemp);\n }\n Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);\n } else {\n List<ResolveInfo> resInfoList = UploadActivity.this.getPackageManager().queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);\n for (ResolveInfo resolveInfo : resInfoList) {\n String packageName = resolveInfo.activityInfo.packageName;\n UploadActivity.this.grantUriPermission(packageName, photoURI, Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION);\n }\n }\n intent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);\n startActivityForResult(intent, ApplicationConstant.RESULT_OPEN_CAMERA);\n }", "@Override\n public void onClick(View view) {\n try {\n if (ActivityCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n cameraManager.openCamera(cameraManager.getCameraIdList()[0],\n new CameraState(cameraView), null);\n } catch (CameraAccessException e) {\n Log.d(\"msg\",\"CameraAccessException\");\n e.printStackTrace();\n }\n\n }", "private void takePicture() {\n\n Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n startActivityForResult(intent, REQUEST_CAMERA);\n\n }", "@Override\n public void startCameraIntent() {\n Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);\n startActivityForResult(cameraIntent, PICK_FROM_CAMERA_REQUEST_CODE);\n }", "public synchronized void openDriver(SurfaceHolder holder) throws IOException {\n OpenCamera theCamera = camera;\n if (theCamera == null) {\n theCamera = OpenCameraInterface.open(-1);\n if (theCamera == null) {\n throw new IOException(\"Camera.open() failed to return object from driver\");\n }\n camera = theCamera;\n }\n\n Camera cameraObject = theCamera.getCamera();\n Camera.Parameters parameters = cameraObject.getParameters();\n String parametersFlattened = parameters == null ? null : parameters.flatten(); // Save these, temporarily\n try {\n setDesiredCameraParameters(theCamera, false);\n } catch (RuntimeException re) {\n // Driver failed\n Log.w(TAG, \"Camera rejected parameters. Setting only minimal safe-mode parameters\");\n Log.i(TAG, \"Resetting to saved camera params: \" + parametersFlattened);\n // Reset:\n if (parametersFlattened != null) {\n parameters = cameraObject.getParameters();\n parameters.unflatten(parametersFlattened);\n try {\n cameraObject.setParameters(parameters);\n setDesiredCameraParameters(theCamera, true);\n } catch (RuntimeException re2) {\n // Well, darn. Give up\n Log.w(TAG, \"Camera rejected even safe-mode parameters! No configuration\");\n }\n }\n }\n cameraObject.setPreviewDisplay(holder);\n previewCallback = new PreviewCallback(previewSize);\n }", "@Override\r\n public void onClick(View v) {\n String path = \"http://techslides.com/demos/sample-videos/small.mp4\";\r\n// Uri uri=Uri.parse(path);\r\n// videoView.setVideoURI(uri);\r\n //MediaController mc = new MediaController(TransformDetailActivity.this);\r\n\r\n //videoView.start();\r\n// videoView.setOnTouchListener(new View.OnTouchListener() {\r\n// @Override\r\n// public boolean onTouch(View v, MotionEvent event) {\r\n// System.out.print(videoView.isPlaying());\r\n// if(videoView.isPlaying()) {\r\n// stopPosition[0] = videoView.getCurrentPosition();\r\n// videoView.pause();\r\n// } else {\r\n// videoView.seekTo(stopPosition[0]);\r\n// videoView.start();\r\n// }\r\n// return false;\r\n// }\r\n// });\r\n// String path = \"android.resource://\" + getPackageName() + \"/\" + R.raw.welcome;\r\n// Uri videoUri = Uri.parse(path);\r\n// Intent intent = new Intent(Intent.ACTION_VIEW, videoUri);\r\n// intent.setDataAndType(videoUri, \"video/*\");\r\n// startActivity(intent);\r\n\r\n Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(path));\r\n intent.setDataAndType(Uri.parse(path), \"video/mp4\");\r\n startActivity(intent);\r\n }", "public void obtainCameraOrFinish() {\n mCamera = getCameraInstance();\n if (mCamera == null) {\n Toast.makeText(VideoCapture.getSelf(), \"Fail to get Camera\", Toast.LENGTH_LONG).show();\n VideoCapture.getSelf().finish();\n }\n }", "public void onLaunchCamera() {\n takePic.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n // create Intent to take a picture and return control to the calling application\n Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n // Create a File reference to access to future access\n photoFile = getPhotoFileUri(photoFileName);\n\n // wrap File object into a content provider\n // required for API >= 24\n // See https://guides.codepath.com/android/Sharing-Content-with-Intents#sharing-files-with-api-24-or-higher\n Uri fileProvider = FileProvider.getUriForFile(Driver_License_Scan.this, \"com.codepath.fileprovider\", photoFile);\n intent.putExtra(MediaStore.EXTRA_OUTPUT, fileProvider);\n\n // If you call startActivityForResult() using an intent that no app can handle, your app will crash.\n // So as long as the result is not null, it's safe to use the intent.\n if (intent.resolveActivity(getPackageManager()) != null) {\n // Start the image capture intent to take photo\n startActivityForResult(intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);\n }\n }\n });\n }", "public void recordVideo() {\n\n }", "public void startStreaming() {\n// phoneCam.setViewportRenderingPolicy(OpenCvCamera.ViewportRenderingPolicy.OPTIMIZE_VIEW);\n phoneCam.startStreaming(320, 240, OpenCvCameraRotation.SIDEWAYS_RIGHT);\n }", "public void takePhoto(){\n // We create the intent and the file\n Intent intent = new Intent(\"android.media.action.IMAGE_CAPTURE\");\n File path = new File(Environment.getExternalStorageDirectory().toString() + PATH);\n if (!path.exists()) {\n path.mkdir();\n }\n File picture = new File(path.getAbsolutePath(),\"Foto.jpg\");\n intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(picture));\n // We have the path for the photo\n this.pictureId = Uri.fromFile(picture);\n // Begin the camera activity\n startActivityForResult(intent, CAMERA_APP);\n }", "public void onLaunchCamera(View view) {\n Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);\n\n\n data.insertAnImage(OptionID.get(alg), null);\n Cursor imageCursor = data.getImageData(OptionID.get(alg));\n imageCursor.moveToNext();\n intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(getPhotoFileUri(imageCursor.getString(0))))); // set the image file name\n\n // If you call startActivityForResult() using an intent that no app can handle, your app will crash.\n // So as long as the result is not null, it's safe to use the intent.\n if (intent.resolveActivity(getPackageManager()) != null) {\n // Start the image capture intent to take photo\n startActivityForResult(intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);\n }\n }", "private void oldOpenCamera() {\n try {\n mCamera = Camera.open(); // attempt to get a Camera instance\n mCamera.setPreviewCallbackWithBuffer(this);\n Log.i(TAG, \"Instance created\");\n } catch (Exception e) {\n Log.e(TAG, \"Error getting Camera instance: \" + e.getMessage());\n }\n }", "public void startVideoRecording() {\n\n try {\n mVideoFileTest = createVideoFile(mVideoFolder);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n // set up Recorder\n try {\n setupMediaRecorder();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n // prepare for recording\n sendVideoRecordingRequest();\n\n // start recording\n mMediaRecorder.start();\n\n if (mRokidCameraRecordingListener != null) {\n mRokidCameraRecordingListener.onRokidCameraRecordingStarted();\n }\n }", "@Override\n public void onClick(View v) {\n startActivity(new Intent(getActivity(), CameraActivity.class));\n }", "public void takePhoto(View view){\n Intent callCameraApplicationIntent = new Intent();\n //Todo: Se llama la accion de camara\n callCameraApplicationIntent.setAction(MediaStore.ACTION_IMAGE_CAPTURE);\n\n File photoFile = null;\n try {\n photoFile = createImageFile();\n }catch (IOException e){\n e.printStackTrace();\n }\n callCameraApplicationIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photoFile));\n //Todo: Se inicia la actividad y se pasa la constante ACTIVITY_START_CAMERA_APP al metodo onActivityResult\n startActivityForResult(callCameraApplicationIntent, ACTIVITY_START_CAMERA_APP);\n }", "public static Camera openCamera(Activity activity, int cameraId)\n throws Exception {\n if (!activity.isFinishing()) {\n DevicePolicyManager dpm = (DevicePolicyManager) activity.getSystemService(\n Context.DEVICE_POLICY_SERVICE);\n if (dpm.getCameraDisabled(null) == true) {\n throw new Exception();\n }\n for (int i = 0; i < OPEN_RETRY_COUNT; i++) {\n try {\n return CameraHolder.instance().open(cameraId);\n } catch (Exception e) {\n if (i == 0) {\n try {\n //wait some time, and try another time\n //Camera device may be using by VT or atv.\n Thread.sleep(1000);\n } catch (InterruptedException ie) {\n }\n continue;\n } else {\n // In eng build, we throw the exception so that test tool\n // can detect it and report it\n if (\"eng\".equals(Build.TYPE)) {\n if (BuildConfig.DEBUG) Log.i(TAG, \"Open Camera fail\", e);\n throw e;\n //QA will always consider JE as bug, so..\n //throw new RuntimeException(\"openCamera failed\", e);\n } else {\n throw e;\n }\n }\n }\n }\n //just for build pass\n }\n throw new Exception(new RuntimeException(\"Should never get here\"));\n\n }", "public void takePicture()\n {\n\n Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n\n startActivityForResult(cameraIntent, TAKE_PHOTO_CODE);\n }", "private void cameraIntent() {\n Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n if (takePictureIntent.resolveActivity(context.getPackageManager()) != null) {\n File photoFile = null;\n try {\n photoFile = createImageFile();\n } catch (IOException ex) {\n // Error occurred while creating the File\n\n }\n // Continue only if the File was successfully created\n if (photoFile != null) {\n takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT,\n Uri.fromFile(photoFile));\n ((MessageActivity) context).startActivityForResult(takePictureIntent, CAMERA_REQUEST);\n }\n }\n }", "public void chooseCamera() {\n if (cameraFront) {\n int cameraId = findBackFacingCamera();\n if (cameraId >= 0) {\n //open the backFacingCamera\n //set a picture callback\n //refresh the preview\n\n mCamera = Camera.open(cameraId);\n setRotation(mCamera, mCamera.getParameters(), cameraId);\n // mCamera.setDisplayOrientation(90);\n mPicture = getPictureCallback();\n mPreview.refreshCamera(mCamera);\n }\n } else {\n int cameraId = findFrontFacingCamera();\n if (cameraId >= 0) {\n //open the backFacingCamera\n //set a picture callback\n //refresh the preview\n mCamera = Camera.open(cameraId);\n setRotation(mCamera, mCamera.getParameters(), cameraId);\n // mCamera.setDisplayOrientation(90);\n mPicture = getPictureCallback();\n mPreview.refreshCamera(mCamera);\n }\n }\n }", "public void startCamera()\n {\n startCamera(null);\n }", "private Camera getCameraInstance() {\r\n Camera camera = null;\r\n try {\r\n camera = Camera.open();\r\n } catch (Exception e) {\r\n // cannot get camera or does not exist\r\n }\r\n Camera.Parameters params = camera.getParameters();\r\n\r\n List<Size> sizes = params.getSupportedPictureSizes();\r\n int w = 0, h = 0;\r\n for (Size size : sizes) {\r\n if (size.width > w || size.height > h) {\r\n w = size.width;\r\n h = size.height;\r\n }\r\n\r\n }\r\n params.setPictureSize(w, h);\r\n\r\n\r\n if (params.getSupportedFocusModes().contains(\r\n Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO)) {\r\n params.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO);\r\n }\r\n params.setPictureFormat(ImageFormat.JPEG);\r\n params.setJpegQuality(100);\r\n camera.setParameters(params);\r\n\r\n\r\n return camera;\r\n }", "public void configureCamera(){\n try{\n camera = Camera.open(findBackFacingCamera());\n } catch (Exception e){}\n\n if(camera != null) {\n cameraView = new CameraView(this.getApplicationContext(), camera);\n FrameLayout camera_view = (FrameLayout)findViewById(R.id.CameraView);\n camera_view.addView(cameraView);\n }\n }", "public void sendIntentToCamera() {\n\t\tIntent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);\n\t\t\n\t\t// Send the intent with id 2\n\t\tstartActivityForResult(i, 2);\n\t}", "private void takePicture() {\n Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n // check if there is a camera app installed\n if (takePictureIntent.resolveActivity(getPackageManager()) != null) {\n // build the photo file\n mPhotoFile = new File(getExternalFilesDir(null), code + \".jpg\");\n // get URI using a file provider\n Uri photoURI = FileProvider.getUriForFile(this,\n \"com.martindisch.fileprovider\",\n mPhotoFile);\n // put URI into Intent\n takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);\n // send Intent\n startActivityForResult(takePictureIntent, REQUEST_IMAGE_CAPTURE);\n } else {\n Toast.makeText(this, R.string.no_camera, Toast.LENGTH_SHORT).show();\n }\n }", "private void captureImage() {\n String imagename = \"urPics.jpg\";\n File file = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) + File.separator + imagename);\n Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n FileUri = Uri.fromFile(file);\n intent.putExtra(MediaStore.EXTRA_OUTPUT, FileUri);\n // start the image capture Intent\n startActivityForResult(intent, REQUEST_CODE_CAMERA);\n }", "@Override\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\n\t\t\t\t\tIntent openCameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n\t\t\t\t\tUri imageUri = Uri.fromFile(new File(Environment.getExternalStorageDirectory(),fileName));\n\t\t\t\t\topenCameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri);\n\t\t\t\t\tstartActivityForResult(openCameraIntent, 1);\n\t\t\t\t\tdismiss();\n\t\t\t\t}", "public void takevideo() {\nSystem.out.println(\"take a video\");\r\n}", "public void onClick(View v) {\n Intent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);\n startActivityForResult(i, cameraData);\n }", "public Single<Uri> video(@NonNull FragmentActivity activity) {\n return requestImage(\n activity,\n false,\n MimeType.VIDEO)\n .map(uris -> uris.get(0)\n );\n }", "private void pickFromCamera() {\n Intent startCamera = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n startCamera.putExtra(MediaStore.EXTRA_OUTPUT, uriImage);\n startActivityForResult(startCamera, IMAGE_PICK_CAMERA_CODE);\n\n }", "@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tIntent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);\r\n\t\t\t\tstartActivityForResult(Intent.createChooser(cameraIntent, \"Take your photo\"), TAKE_AVATAR_CAMERA_REQUEST);\r\n\t\t\t}", "public void onShowCameraClicked(View view) {\n if (mUIState == UIState.CONNECTED_FULLSCREEN) {\n // Toggle to split screen while showing remote camera\n if (mRemoteCameraUid != 0)\n setupRemoteVideo(mRemoteCameraUid, mRemoteCameraContainer);\n removeRemoteShare();\n setupRemoteVideo(WINDOW_SHARE_UID, mRemoteShareContainerSplit);\n setUIState(UIState.CONNECTED_SPLITSCREEN);\n } else if (mUIState == UIState.CONNECTED_SPLITSCREEN) {\n // Toggle to full screen while hiding remote camera\n removeRemoteCamera();\n removeRemoteShare();\n setupRemoteVideo(WINDOW_SHARE_UID, mRemoteShareContainerFull);\n setUIState(UIState.CONNECTED_FULLSCREEN);\n }\n }", "private void setCamera() {\n\t\tCamera.CameraInfo cameraInfo = new Camera.CameraInfo();\n\t\tint cameraCount = Camera.getNumberOfCameras();\n\t\tLog.i(TAG, \"count = \" + cameraCount);\n\t\tLog.i(TAG, \"isBack = \" + isBack);\n\t\tint id = 0;\n\n\t\tfor (int camIdx = 0; camIdx < cameraCount; camIdx++) {\n\t\t\tCamera.getCameraInfo(camIdx, cameraInfo);\n\t\t\tLog.i(TAG, \"cameraInfoFacing = \" + cameraInfo.facing);\n\t\t\tif (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_BACK\n\t\t\t\t\t&& isBack) {\n\t\t\t\ttry {\n\t\t\t\t\tLog.i(TAG, \"SETTING mCamera\");\n\t\t\t\t\tmCamera = Camera.open(camIdx);\n\t\t\t\t\tid = camIdx;\n\t\t\t\t} catch (RuntimeException e) {\n\t\t\t\t\tLog.e(TAG,\n\t\t\t\t\t\t\t\"Camera failed to open: \" + e.getLocalizedMessage());\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t} else if (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_FRONT\n\t\t\t\t\t&& !isBack){\n\t\t\t\ttry {\n\t\t\t\t\tLog.i(TAG, \"SETTING mCamera\");\n\t\t\t\t\tmCamera = Camera.open(camIdx);\n\t\t\t\t\tid = camIdx;\n\t\t\t\t} catch (RuntimeException e) {\n\t\t\t\t\tLog.e(TAG,\n\t\t\t\t\t\t\t\"Camera failed to open: \" + e.getLocalizedMessage());\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (mCamera != null) {\n\t\t\tCamera.Parameters cameraParameters = mCamera.getParameters();\n\t\t\tDisplay display = getActivity().getWindowManager().getDefaultDisplay();\n\t\t\tPoint size = new Point();\n\t\t\tdisplay.getSize(size);\n\t\t\tint screenWidth = size.x;\n\t\t\tint width = Integer.MAX_VALUE;\n\t\t\tint height = 0;\n\t\t\tLog.i(TAG, \"SCREENWIDTH: \" + screenWidth);\n\t\t\tList<Camera.Size> sizes = cameraParameters.getSupportedPreviewSizes();\n\t\t\tfor (Camera.Size cSize : sizes) {\n\t\t\t\tif (cSize.width >= screenWidth && cSize.width <= width) {\n\t\t\t\t\twidth = cSize.width;\n\t\t\t\t\theight = cSize.height;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tLog.i(TAG, \"Width: \" + width + \" HEIGHT: \" + height);\n\n\t\t\tif (mPreview != null) {\n\t\t\t\tmPreview.switchCamera(mCamera, id, width, height);\n\t\t\t} else {\n\t\t\t\tmPreview = new CameraPreview(getActivity(), mCamera, id, width, height);\n\t\t\t\tFrameLayout preview = (FrameLayout) view\n\t\t\t\t\t\t.findViewById(R.id.camera_preview);\n\t\t\t\tpreview.addView(mPreview);\n\t\t\t}\n\t\t\tmCamera.startPreview();\n\t\t}\n\t}", "@Override\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\tIntent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); \n\t\t startActivityForResult(cameraIntent, CAMERA_REQUEST); \n\t\t\t\t\t}", "public VideoStream(int camera) {\n\t\tsuper();\n\t\tsetCamera(camera);\n\t}", "private void createCamera() {\n camera = getCameraInstance();\n // Setting the right parameters in the camera\n SetCameraParameters();\n // Create our Preview view and set it as the content of our activity.\n camera_preview = new CameraPreview(this, camera);\n // Adding the camera preview after the FrameLayout and before the mainact_btn_InOutAct\n // as a separated element.\n InOut_cameraLayout.addView(camera_preview, 0);\n }", "public void open(Activity activity, boolean isSecureCamera, boolean isCaptureIntent);", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tIntent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n\t\t\t\t// 下面这句指定调用相机拍照后的照片存储的路径\n\t\t\t\tintent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(Environment.getExternalStorageDirectory(), \"xiaoma.jpg\")));\n\t\t\t\tstartActivityForResult(intent, 2);\n\t\t\t\tmenu_mine.setVisibility(View.GONE);\n\t\t\t}", "void startCamera() throws IOException {\n if (ContextCompat.checkSelfPermission(this, WRITE_EXTERNAL_STORAGE)\n != PackageManager.PERMISSION_GRANTED ||\n ContextCompat.checkSelfPermission(this, CAMERA) != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(this,\n new String[]{WRITE_EXTERNAL_STORAGE, CAMERA},\n WRITE_EXTERNAL_STORAGE_REQUEST);\n return;\n }\n dispatchTakePictureIntent();\n\n }", "public interface ICamera {\n\n /**\n * Return frame access interface for client usage\n *\n * @param interface_index\n * @return\n */\n public long getFrameAccessIfc(int interface_index);\n\n /**\n * Start the camera stream\n */\n public void start();\n\n /**\n * Stop the camera stream\n */\n public void stop();\n\n public String prepare(final UsbMonitor.UsbConnectionData connectionData);\n\n /**\n * Register json status callback\n *\n * @param callback\n */\n public void setStatusCallback(final IStatusCallback callback);\n\n /**\n * Queries camera for supported mode\n *\n * @return supported video modes String\n */\n public String getSupportedVideoModes();\n\n// /**\n// * Select camera capture mode\n// *\n// * @param width\n// * @param height\n// * @param frameFormat\n// */\n// public void setCaptureMode(final int width, final int height, final int frameFormat);\n\n /**\n * Select camera capture mode\n *\n * @param width\n * @param height\n * @param min_fps\n * @param max_fps\n * @param frameFormat\n */\n public void setCaptureMode(final int width, final int height, final int min_fps, final int max_fps, final int frameFormat);\n}", "private void captureImage() {\n\t\tIntent intent = new Intent( MediaStore.ACTION_IMAGE_CAPTURE );\n\t\tmFileUri = getOutputMediaFileUri(); // create a file to save the image\n\t\tintent.putExtra(MediaStore.EXTRA_OUTPUT, mFileUri); // set the image file name\n\t\t// start the image capture Intent\n\t\tstartActivityForResult( intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE );\n\t}", "private void openGallery(String videoOrImage) {\n if (checkSelfPermission()) {\n if (videoImageRef.equals(\"video\")) {\n videoImageRef = \"\";\n Intent intent;\n if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {\n intent = new Intent(Intent.ACTION_PICK, MediaStore.Video.Media.EXTERNAL_CONTENT_URI);\n } else {\n intent = new Intent(Intent.ACTION_PICK, MediaStore.Video.Media.INTERNAL_CONTENT_URI);\n }\n // In this example we will set the type to video\n intent.setType(\"video/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n intent.putExtra(\"return-data\", true);\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {\n intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);\n }\n intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);\n activityResultLauncher.launch(intent);\n }else{\n videoImageRef = \"\";\n Intent intent;\n if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {\n intent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n } else {\n intent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.INTERNAL_CONTENT_URI);\n }\n // In this example we will set the type to video\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n intent.putExtra(\"return-data\", true);\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {\n intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);\n }\n intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);\n activityResultLauncher.launch(intent);\n }\n }\n }", "private void dispatchTakePictureIntent() {\n Intent takePictureIntent = new Intent ( MediaStore.ACTION_IMAGE_CAPTURE );\n //dam bao chi co mot hoat dodng camera\n if (takePictureIntent.resolveActivity ( getPackageManager () ) != null) {\n // tao file ma anh gui den\n File photoFile = null;\n try {\n photoFile = createImageFile ();\n } catch (IOException ex) {\n //ERROR\n }\n // neu co file gui anh vao photoFIle\n if (photoFile != null) {\n pathToFile = photoFile.getAbsolutePath ();\n Uri photoURI = FileProvider.getUriForFile ( this ,\n \"com.example.diem_danh_sv.fileprovider\" ,\n photoFile );\n takePictureIntent.putExtra ( MediaStore.EXTRA_OUTPUT , photoURI );\n startActivityForResult ( takePictureIntent , REQUEST_ID_IMAGE_CAPTURE );\n }\n }\n }", "public void fetchVideo(View view) {\n Log.i(\"progress\", \"fetchVideo\");\n\n startActivityForResult(requestVideoFileIntent,0);\n }", "@FXML\r\n protected void startCamera(Event event)\r\n {\n if (this.rootElement != null)\r\n {\r\n // get the ImageView object for showing the video stream\r\n final ImageView frameView = currentFrame;\r\n final BorderPane root = (BorderPane) this.rootElement;\r\n // check if the capture stream is opened\r\n if (!this.capture.isOpened())\r\n {\r\n \t\tSystem.out.println(\"Starting Camera ...\");\r\n // start the video capture\r\n this.capture.open(0);\r\n // grab a frame every 33 ms (30 frames/sec)\r\n TimerTask frameGrabber = new TimerTask() {\r\n @Override\r\n public void run()\r\n {\r\n javafx.scene.image.Image tmp = grabFrame();\r\n Platform.runLater(new Runnable() {\r\n @Override\r\n public void run() {\r\n frameView.setImage(tmp);\r\n }\r\n });\r\n\r\n }\r\n };\r\n this.timer = new Timer();\r\n //set the timer scheduling, this allow you to perform frameGrabber every 33ms;\r\n this.timer.schedule(frameGrabber, 0, 33);\r\n this.start_btn.setText(\"Stop Camera\");\r\n }\r\n else\r\n {\r\n this.start_btn.setText(\"Start Camera\");\r\n // stop the timer\r\n if (this.timer != null)\r\n {\r\n this.timer.cancel();\r\n this.timer = null;\r\n }\r\n // release the camera\r\n this.capture.release();\r\n // clear the image container\r\n frameView.setImage(null);\r\n }\r\n }\r\n }", "public void onClick(View v) {\n Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n if (takePictureIntent.resolveActivity(getPackageManager()) != null) {\n startActivityForResult(takePictureIntent, REQUEST_IMAGE_CAPTURE);\n }\n\n }", "@Override\n public void imageFromCamera() {\n Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n if (takePictureIntent.resolveActivity(getPackageManager()) != null) {\n startActivityForResult(takePictureIntent, REQUEST_IMAGE_CAPTURE);\n }\n }", "@OnClick(R.id.bt_camera)\n public void onClick() {\n rxPermissions.requestEach(Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE)\n .subscribe(new Consumer<Permission>() {\n @Override\n public void accept(Permission permission) throws Exception {\n if (permission.granted) {\n// releaseCamera();\n// camera = Camera.open(0);\n// try {\n// camera.setPreviewDisplay(surfaceView.getHolder());\n// camera.startPreview();\n// } catch (IOException e) {\n// Log.e(TAG, \"Error while trying to display the camera preview\", e);\n// }\n ToastUtil.showS(\"已获取到权限\");\n } else if (permission.shouldShowRequestPermissionRationale) {\n // Denied permission without ask never again\n Toast.makeText(mContext,\n \"Denied permission without ask never again\",\n Toast.LENGTH_SHORT).show();\n } else {\n // Denied permission with ask never again\n // Need to go to the settings\n Toast.makeText(mContext,\n \"Permission denied, can't enable the camera\",\n Toast.LENGTH_SHORT).show();\n }\n }\n });\n }", "private void pickFromCamera() {\n ContentValues values = new ContentValues();\n values.put(MediaStore.Images.Media.TITLE, \"Temp Pic\");\n values.put(MediaStore.Images.Media.DESCRIPTION, \"Temp Description\");\n\n //put Image uri\n image_uri = UserProfile.this.getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);\n\n //intent to start Camera\n Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, image_uri);\n startActivityForResult(cameraIntent, IMAGE_PICK_CAMERA_CODE);\n }" ]
[ "0.7448254", "0.7062566", "0.7017061", "0.69803476", "0.69676715", "0.69469714", "0.6780486", "0.6766128", "0.67648816", "0.6753771", "0.6720742", "0.6712741", "0.6705347", "0.6675182", "0.66546696", "0.6652438", "0.66072637", "0.6585426", "0.6488669", "0.6474762", "0.6470087", "0.6463242", "0.6452582", "0.6445431", "0.64453334", "0.64386374", "0.6424531", "0.6403754", "0.64034027", "0.63932717", "0.63912505", "0.63841623", "0.6374826", "0.63694686", "0.6367131", "0.63643867", "0.6345619", "0.6337812", "0.6300719", "0.6276347", "0.6269712", "0.62533164", "0.6249519", "0.6229312", "0.62269706", "0.6226184", "0.6214567", "0.6213624", "0.6213267", "0.620678", "0.62008893", "0.6172244", "0.61712176", "0.6170168", "0.6153521", "0.61196005", "0.61135143", "0.61072296", "0.6105894", "0.6105877", "0.6098109", "0.6094951", "0.60893047", "0.60873926", "0.6086939", "0.6063383", "0.60598785", "0.60540587", "0.6036125", "0.6031556", "0.6023591", "0.6007745", "0.6007242", "0.5976952", "0.5975886", "0.59731966", "0.5972621", "0.5967666", "0.5966387", "0.59599817", "0.5940566", "0.59367865", "0.59357244", "0.59136844", "0.59124786", "0.5900281", "0.58991116", "0.58830327", "0.5863986", "0.58629644", "0.5858257", "0.58543915", "0.5849724", "0.5839053", "0.5833357", "0.58259124", "0.5822908", "0.5799063", "0.57903147", "0.5766758" ]
0.66844994
13
/ Open and close bluetooth
public S<T> bluetooth(Boolean enable){ BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); boolean isEnabled = bluetoothAdapter.isEnabled(); if (enable && !isEnabled) { bluetoothAdapter.enable(); } else if(!enable && isEnabled) { bluetoothAdapter.disable(); } return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void bluetoothDeactivated();", "private void bluetooth_connect_device() throws IOException\n {\n try\n {\n myBluetooth = BluetoothAdapter.getDefaultAdapter();\n address = myBluetooth.getAddress();\n pairedDevices = myBluetooth.getBondedDevices();\n if (pairedDevices.size()>0)\n {\n for(BluetoothDevice bt : pairedDevices)\n {\n address=bt.getAddress().toString();name = bt.getName().toString();\n Toast.makeText(getApplicationContext(),\"Connected\", Toast.LENGTH_SHORT).show();\n\n }\n }\n\n }\n catch(Exception we){}\n myBluetooth = BluetoothAdapter.getDefaultAdapter();//get the mobile bluetooth device\n BluetoothDevice dispositivo = myBluetooth.getRemoteDevice(address);//connects to the device's address and checks if it's available\n btSocket = dispositivo.createInsecureRfcommSocketToServiceRecord(myUUID);//create a RFCOMM (SPP) connection\n btSocket.connect();\n try { t1.setText(\"BT Name: \"+name+\"\\nBT Address: \"+address); }\n catch(Exception e){}\n }", "private void bluetoothConnect() {\n\n btDevice = btAdapter.getRemoteDevice(EDISON_ADDRESS);\n if (btDevice == null) {\n Log.d(TAG,\"get remote device fail!\");\n finish();\n }\n\n try {\n btSocket = btDevice.createRfcommSocketToServiceRecord(SSP_UUID);\n } catch (IOException e) {\n Log.d(TAG,\"bluetooth socket create fail.\");\n }\n //save resource by cancel discovery\n btAdapter.cancelDiscovery();\n\n //connect\n try {\n btSocket.connect();\n Log.d(TAG,\"Connection established.\");\n } catch ( IOException e) {\n try {\n btSocket.close();\n }catch (IOException e2) {\n Log.d(TAG,\"unable to close socket after connect fail.\");\n }\n }\n\n //prepare outStream to send message\n try {\n outStream = btSocket.getOutputStream();\n } catch (IOException e) {\n Log.d(TAG,\"output stream init fail!\");\n }\n\n }", "public void openBluetooth() throws IOException {\n UUID uuid = UUID.fromString(\"00001101-0000-1000-8000-00805f9b34fb\"); //Standard SerialPortService ID\n mmSocket = mmDevice.createRfcommSocketToServiceRecord(uuid);\n mmSocket.connect();\n mmOutputStream = mmSocket.getOutputStream();\n mmInputStream = mmSocket.getInputStream();\n\n beginListenForData();\n\n btStatusDisplay.setText(\"Bluetooth Connection Opened\");\n }", "private Bluetooth() {}", "@Override\n public boolean onUnbind(Intent intent) {\n \tcloseBluetooth();\n return super.onUnbind(intent);\n }", "@Override\n protected void onDestroy() {\n super.onDestroy();\n try {\n // Close bluetooth socket\n btSocket.close();\n } catch (IOException e) {\n }\n }", "public void connect_bt(String deviceAddress) {\n Intent intent = new Intent(\"OBDStatus\");\n intent.putExtra(\"message\", \"Trying to connect with device\");\n context.sendBroadcast(intent);\n disconnect();\n BluetoothAdapter btAdapter = BluetoothAdapter.getDefaultAdapter();\n btAdapter.cancelDiscovery();\n if (deviceAddress == null || deviceAddress.isEmpty()) {\n intent.putExtra(\"message\", \"Device not found\");\n context.sendBroadcast(intent);\n return;\n }\n\n if (!btAdapter.isEnabled()) {\n intent.putExtra(\"message\", \"Bluetooth is disabled\");\n context.sendBroadcast(intent);\n return;\n }\n\n BluetoothDevice device = btAdapter.getRemoteDevice(deviceAddress);\n\n UUID uuid = UUID.fromString(\"00001101-0000-1000-8000-00805F9B34FB\");\n\n try {\n socket = device.createInsecureRfcommSocketToServiceRecord(uuid);\n socket.connect();\n isConnected = true;\n intent.putExtra(\"message\", \"OBD connected\");\n context.sendBroadcast(intent);\n } catch (IOException e) {\n Log.e(\"gping2\", \"There was an error while establishing Bluetooth connection. Falling back..\", e);\n Class<?> clazz = socket.getRemoteDevice().getClass();\n Class<?>[] paramTypes = new Class<?>[]{Integer.TYPE};\n BluetoothSocket sockFallback = null;\n try {\n Method m = clazz.getMethod(\"createInsecureRfcommSocket\", paramTypes);\n Object[] params = new Object[]{Integer.valueOf(1)};\n sockFallback = (BluetoothSocket) m.invoke(socket.getRemoteDevice(), params);\n sockFallback.connect();\n isConnected = true;\n socket = sockFallback;\n intent.putExtra(\"message\", \"OBD connected\");\n context.sendBroadcast(intent);\n } catch (Exception e2) {\n intent.putExtra(\"message\", \"OBD Connection error\");\n context.sendBroadcast(intent);\n Log.e(\"gping2\", \"BT connect error\");\n }\n }\n this.deviceAddress = deviceAddress;\n saveNewAddress();\n }", "public static void disconnect() {\n if (AppSettings.bluetoothConnection != null) \n \tAppSettings.bluetoothConnection.stop();\n\t}", "public void sendBluetooth()\n {\n Intent startBluetooth = new Intent(this, Main2Activity.class);\n startActivity(startBluetooth);\n }", "@Override\n\t\tpublic void run() {\n\t\t\ttry{\n//\t\t\t\tdevAddr = devices.get(position).split(\"\\\\|\")[1];\n//\t\t\t\tbtAdapt.cancelDiscovery();\n//\t\t\t\t\n//\t\t\t\tbtSocket = btAdapt.getRemoteDevice(devAddr).createRfcommSocketToServiceRecord(uuid);\n//\t\t\t\tbtSocket.connect();Log.e(tag, \"connected\");\n\t\t\t\tInetAddress severInetAddr=InetAddress.getByName(\"120.105.129.108\");\n\t\t\t\tWifisocket = new Socket(severInetAddr, 8101);\n\t\t\t\t\n\t\t\t\tsynchronized (this) {\n//\t\t\t\t\tbtIn = btSocket.getInputStream();\n//\t\t\t\t\tbtOut = btSocket.getOutputStream();\n\t\t\t\t\tbtIn = Wifisocket.getInputStream();\n\t\t\t\t\tbtOut = Wifisocket.getOutputStream();\n\t\t\t\t\tLog.e(tag, \"connected\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tThread.sleep(100);\n\t\t\t\tsetUpAsForeground(\"Wifi已連線\");\n\t\t\t} catch( IOException | InterruptedException e ){\n\t\t\t\te.printStackTrace();\n\t\t\t\ttry{\n//\t\t\t\t\tbtSocket.close();\n//\t\t\t\t\tWifisocket.close();\n\t\t\t\t\tThread.sleep(1500);\n\t\t\t\t\tsetUpAsForeground(\"Wifi未連線\");\n\t\t\t\t\tLog.i(\"exiconne\", \"bluetoohservice bye!;\");\n\t\t\t\t} catch(InterruptedException e1){\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\tLog.i(\"exiconne\", \"bluetoohservice bye!;\");\n\t\t\t\t}\n//\t\t\t\tbtSocket = null;\n\t\t\t\tWifisocket = null;\n\t\t\t\tmBTState = BTState.stopped;\n\t\t\t\tBluetoothConnect.mBTstate = BTstate.opened;\n\t\t\t}\n\n\t\t}", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n setContentView(R.layout.activity_main);\n btnOn = findViewById(R.id.bluetoothStart); // кнопка включения\n btnOff = findViewById(R.id.bluetoothStop); // кнопка выключения\n statusText = findViewById(R.id.statusBluetooth); // для вывода текста, полученного\n btState = findViewById(R.id.bluetoothIm);\n workState = findViewById(R.id.workStatIm);\n\n h = new Handler() {\n public void handleMessage(android.os.Message msg) {\n switch (msg.what) {\n case RECIEVE_MESSAGE:\n statusText.setText(\"msg\");// если приняли сообщение в Handler\n byte[] readBuf = (byte[]) msg.obj;\n String strIncom = new String(readBuf, 0, msg.arg1);\n sb.append(strIncom); // формируем строку\n int endOfLineIndex = sb.indexOf(\"\\r\\n\"); // определяем символы конца строки\n if (endOfLineIndex > 0) { // если встречаем конец строки,\n String sbprint = sb.substring(0, endOfLineIndex); // то извлекаем строку\n sb.delete(0, sb.length()); // и очищаем sb\n statusText.setText(\"Ответ от датчика: \" + sbprint); // обновляем TextView\n String[] step_data = sbprint.split(\" \");\n writeFile(step_data[0]);\n writeFile(\";\");\n writeFile(step_data[1]);\n writeFile(\";\");\n writeFile(step_data[2]);\n writeFile(\";\\n\");\n btnOff.setEnabled(true);\n btnOn.setEnabled(true);\n }\n //Log.d(TAG, \"...Строка:\"+ sb.toString() + \"Байт:\" + msg.arg1 + \"...\");\n break;\n }\n };\n };\n\n btAdapter = BluetoothAdapter.getDefaultAdapter(); // получаем локальный Bluetooth адаптер\n\n if (btAdapter.isEnabled()) {\n SharedPreferences prefs_btdev = getSharedPreferences(\"btdev\", 0);\n String btdevaddr=prefs_btdev.getString(\"btdevaddr\",\"?\");\n\n if (btdevaddr != \"?\") {\n BluetoothDevice device = btAdapter.getRemoteDevice(btdevaddr);\n UUID SERIAL_UUID = UUID.fromString(\"0000f00d-1212-afde-1523-785fef13d123\"); // bluetooth serial port service\n //UUID SERIAL_UUID = device.getUuids()[0].getUuid(); //if you don't know the UUID of the bluetooth device service, you can get it like this from android cache\n try {\n btSocket = device.createRfcommSocketToServiceRecord(SERIAL_UUID);\n } catch (Exception e) {\n Log.e(\"\",\"Error creating socket\");\n }\n\n try {\n btSocket.connect();\n Log.e(\"\",\"Connected\");\n } catch (IOException e) {\n Log.e(\"\",e.getMessage());\n try {\n Log.e(\"\",\"trying fallback...\");\n btSocket =(BluetoothSocket) device.getClass().getMethod(\"createRfcommSocket\", new Class[] {int.class}).invoke(device,1);\n btSocket.connect();\n Log.e(\"\",\"Connected\");\n } catch (Exception e2) {\n Log.e(\"\", \"Couldn't establish Bluetooth connection!\");\n }\n }\n } else {\n Log.e(\"\",\"BT device not selected\");\n }\n }\n\n checkBTState();\n\n btnOn.setOnClickListener(new OnClickListener() { // определяем обработчик при нажатии на кнопку\n public void onClick(View v) {\n //btnOn.setEnabled(false);\n workState.setImageResource(R.drawable.ic_action_work_on);\n mConnectedThread.run();\n // TODO start writing in file\n }\n });\n\n btnOff.setOnClickListener(new OnClickListener() {\n public void onClick(View v) {\n //btnOff.setEnabled(false);\n workState.setImageResource(R.drawable.ic_action_work_off);\n mConnectedThread.cancel();\n // TODO stop writing in file\n }\n });\n }", "static void toggle(Context context) {\n Log.i(TAG, \"toggle Bluetooth\");\n\n // Just toggle Bluetooth power, as long as we're not already in\n // an intermediate state.\n BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();\n int state = adapter.getState();\n if (state == BluetoothAdapter.STATE_OFF)\n adapter.enable();\n else if (state == BluetoothAdapter.STATE_ON)\n adapter.disable();\n }", "private void setupBluetooth() throws NullPointerException{\n if( Utils.isOS( Utils.OS.ANDROID ) ){\n \t\n // Gets bluetooth hardware from phone and makes sure that it is\n // non-null;\n BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();\n \n // If bluetooth hardware does not exist...\n if (adapter == null) {\n Log.d(TAG, \"BluetoothAdapter is is null\");\n throw new NullPointerException(\"BluetoothAdapter is null\");\n } else {\n Log.d(TAG, \"BluetoothAdapter is is non-null\");\n }\n \n bluetoothName = adapter.getName();\n \n //TODO: restart bluetooth?\n \t\n try {\n bluetoothConnectionThreads.add( new ServerThread(adapter, router, uuid) );\n } catch (NullPointerException e) {\n throw e;\n }\n if (Constants.DEBUG)\n Log.d(TAG, \"Sever Thread Created\");\n // Create a new clientThread\n bluetoothConnectionThreads.add( new ClientThread(adapter, router, uuid) );\n if (Constants.DEBUG)\n Log.d(TAG, \"Client Thread Created\");\n }\n else if( Utils.isOS( Utils.OS.WINDOWS ) ){\n //TODO: implement this\n }\n else if( Utils.isOS( Utils.OS.LINUX ) ){\n //TODO: implement this\n }\n else if( Utils.isOS( Utils.OS.OSX ) ){\n //TODO: implement this\n }\n else{\n //TODO: throw exception?\n }\n \n }", "public void initBT() {\n\n\t\tStatusBox.setText(\"Connecting...\");\n\t\tLog.e(TAG, \"Connecting...\");\n\t\t\n\t\tif (D) {\n\t\t\tLog.e(TAG, \"+ ON RESUME +\");\n\t\t\tLog.e(TAG, \"+ ABOUT TO ATTEMPT CLIENT CONNECT +\");\n\t\t}\n\t\t\n\t\t//If Mac Address is null then stop this process and display message\n\t\tif(MAC_ADDRESS == \"\"){\n\t\t\tLog.e(TAG,\"No MAC Address Found...\");\n\t\t\tToast.makeText(getApplicationContext(), \"No Mac Address found. Please Enter using button.\",Toast.LENGTH_SHORT );\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// When this returns, it will 'know' about the server,\n\t\t// via it's MAC address.\n\t\tBluetoothDevice device = null;\n\t\ttry {\n\t\t\tdevice = mBluetoothAdapter.getRemoteDevice(MAC_ADDRESS);\n\t\t} catch (Exception e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tToast.makeText(getApplicationContext(), \"NOT Valid BT MAC Address\", Toast.LENGTH_SHORT);\n\t\t\te1.printStackTrace();\n\t\t}\n\n\t\t// returns firefly e350\n\t\tLog.e(TAG, \"device name: \" + device.getName());\n\n\t\t// We need two things before we can successfully connect\n\t\t// (authentication issues aside): a MAC address, which we\n\t\t// already have, and an RFCOMM channel.\n\t\t// Because RFCOMM channels (aka ports) are limited in\n\t\t// number, Android doesn't allow you to use them directly;\n\t\t// instead you request a RFCOMM mapping based on a service\n\t\t// ID. In our case, we will use the well-known SPP Service\n\t\t// ID. This ID is in UUID (GUID to you Microsofties)\n\t\t// format. Given the UUID, Android will handle the\n\t\t// mapping for you. Generally, this will return RFCOMM 1,\n\t\t// but not always; it depends what other BlueTooth services\n\t\t// are in use on your Android device.\n\t\ttry {\n\t\t\t\n\t\t\tint currentapiVersion = android.os.Build.VERSION.SDK_INT;\n\t\t\t\n\t\t\t//RFCOMM connection varies depending on android version. Fixes bug in Gingerbread and newer where always asks for BT Pairing code.\n\t\t\tif (currentapiVersion >= android.os.Build.VERSION_CODES.GINGERBREAD_MR1){\n\t\t\t\t//used in android >= 2.3.3\n\t\t\t\tbtSocket = device.createInsecureRfcommSocketToServiceRecord(MY_UUID);\n\t\t\t} else if (currentapiVersion < android.os.Build.VERSION_CODES.GINGERBREAD_MR1){\n\t\t\t\t//used in android < 2.3.3\n\t\t\t\tbtSocket = device.createRfcommSocketToServiceRecord(MY_UUID);\n\t\t\t}\n\t\t\t\n\t\t\tLog.e(TAG, \"ON RESUME: Socket created!\");\n\t\t\n\t\t\n\t\t\t// Discovery may be going on, e.g., if you're running a\n\t\t\t// 'scan for devices' search from your handset's Bluetooth\n\t\t\t// settings, so we call cancelDiscovery(). It doesn't hurt\n\t\t\t// to call it, but it might hurt not to... discovery is a\n\t\t\t// heavyweight process; you don't want it in progress when\n\t\t\t// a connection attempt is made.\n\t\t\tmBluetoothAdapter.cancelDiscovery();\n\n\t\t\tmyBT = new ConnectedThread(btSocket);\n\t\t\t\n\t\t\t\n\t\t\t// don't write to the streams unless they are created\n\t\t\tif (myBT.BTconnStatus) {\n\t\t\t\t\n\t\t\t\tStatusBox.setText(\"CONNECTED\");\n\t\t\t\tLog.e(TAG, \"CONNECTED\");\n\t\t\t\t\n\t\t\t\t// ST,255 enables remote configuration forever...need this if\n\t\t\t\t// resetting\n\t\t\t\t// PIO4 is held high on powerup then toggled 3 times to reset\n\n\t\t\t\t// GPIO Commands to BT device page 15 of commands datasheet\n\t\t\t\tbyte[] cmdMode = { '$', '$', '$' };\n\t\t\t\tmyBT.write(cmdMode);\n\t\t\t\tmyBT.run();\n\n\t\t\t\t// S@,8080 temp sets GPIO-7 to an output\n\t\t\t\tbyte[] cmd1 = { 'S', '@', ',', '8', '0', '8', '0', 13 };\n\n\t\t\t\t// S%,8080 perm sets GPIO-7 to an output on powerup. only done once\n\t\t\t\t// byte [] cmd1 = {'S','%',',','8','0','8','0',13};\n\n\t\t\t\tmyBT.write(cmd1);\n\t\t\t\tmyBT.run();\n\n\t\t\t\t// S&,8000 drives GPIO-7 low\n\t\t\t\t// byte [] cmd2 = {'S','^',',','8','0','0','0',13};\n\n\t\t\t\t// make it so cmd mode won't timeout even after factory reset\n\t\t\t\tbyte[] cmd3 = { 'S', 'T', ',', '2', '5', '5', 13 };\n\t\t\t\tmyBT.write(cmd3);\n\t\t\t\tmyBT.run();\n\n\t\t\t} else {\n\t\t\t\t//StatusBox.setText(\"NOT Connected\");\t\n\t\t\t\tLog.e(TAG, \"NOT Connected\");\n\t\t\t}\n\t\t\n\t\t} catch (IOException e) {\n\t\t\t\n\t\t\tif (D)\n\t\t\t\tLog.e(TAG, \"ON RESUME: Socket creation failed.\", e);\n\t\t}\n\n\t\t\n\t\t\n\t}", "void close(){\r\n // check precondition: device must be opened\r\n if (!checkOpen()){\r\n return;\r\n }\r\n // turn off antenna and LED\r\n cardReader.power(handle, (byte)0);\r\n cardReader.close(handle);\r\n handle = -1;\r\n message = \"Device closed\";\r\n }", "public void mBTClose1() {\n if (oBTServer!=null)\n oBTServer.mCloseService2(); //Disconnect a relayed device\n mDisconnect();\n if (oBTadapter != null) {\n if (oBTadapter.isEnabled()) {\n if (isOpenedByMe) //170905 only if this application opened the bluetooth\n oBTadapter.disable();\n }\n }\n if (mReceiver1!=null)\n try { //Protection from crash bugfix 171013\n mContext.unregisterReceiver(mReceiver1);\n }\n catch (final Exception exception) {\n // The receiver was not registered. There is nothing to do in that case. Everything is fine.\n }\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\trequestWindowFeature(Window.FEATURE_CUSTOM_TITLE);\n\t\tsetContentView(R.layout.activity_main);\n\t\tgetWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE,\n\t\t\t\tR.layout.actionbar);\n\t\tname = (EditText) (findViewById(R.id.bluetoothName));\n\t\tButton ok = (Button) (findViewById(R.id.button1));\n\t\tButton connect = (Button) findViewById(R.id.button2);\n\n\t\tok.setOnClickListener(new View.OnClickListener() {\n\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tIntent openList = new Intent(MainActivity.this,\n\t\t\t\t\t\tListDivices.class);\n\t\t\t\tstartActivityForResult(openList, APPLY_CONNECTION);\n\t\t\t}\n\t\t});\n\t\tconnect.setOnClickListener(new View.OnClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tnameb = name.getText();\n\t\t\t\tblname = nameb.toString();\n\t\t\t\ttry {\n\t\t\t\t\tfindBT();\n\t\t\t\t\tstat = 1;\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tstat = 0;\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t}\n\t\t});\n\n\t\tfinal ToggleButton fan = (ToggleButton) findViewById(R.id.toggleButton1);\n\t\tfan.setOnClickListener(new View.OnClickListener() {\n\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tif (fan.isChecked()) {\n\t\t\t\t\tif (stat == 1) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tmmOutputStream.write('1');\n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\t\tMainActivity.this,\n\t\t\t\t\t\t\t\t\t\"Connection not established with your home\",\n\t\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else\n\t\t\t\t\t\tToast.makeText(MainActivity.this,\n\t\t\t\t\t\t\t\t\"Connection not established with your home\",\n\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t} else {\n\t\t\t\t\tif (stat == 1) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tmmOutputStream.write('2');\n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\t\tMainActivity.this,\n\t\t\t\t\t\t\t\t\t\"Connection not established with your home\",\n\t\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else\n\t\t\t\t\t\tToast.makeText(MainActivity.this,\n\t\t\t\t\t\t\t\t\"Connection not established with your home\",\n\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tfinal ToggleButton light1 = (ToggleButton) findViewById(R.id.toggleButton2);\n\t\tlight1.setOnClickListener(new View.OnClickListener() {\n\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tif (light1.isChecked()) {\n\t\t\t\t\tif (stat == 1) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tmmOutputStream.write('3');\n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\t\tMainActivity.this,\n\t\t\t\t\t\t\t\t\t\"Connection not established with your home\",\n\t\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else\n\t\t\t\t\t\tToast.makeText(MainActivity.this,\n\t\t\t\t\t\t\t\t\"Connection not established with your home\",\n\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t} else {\n\t\t\t\t\tif (stat == 1) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tmmOutputStream.write('4');\n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\t\tMainActivity.this,\n\t\t\t\t\t\t\t\t\t\"Connection not established with your home\",\n\t\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else\n\t\t\t\t\t\tToast.makeText(MainActivity.this,\n\t\t\t\t\t\t\t\t\"Connection not established with your home\",\n\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tfinal ToggleButton light2 = (ToggleButton) findViewById(R.id.toggleButton3);\n\t\tlight2.setOnClickListener(new View.OnClickListener() {\n\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tif (light2.isChecked()) {\n\t\t\t\t\tif (stat == 1) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tmmOutputStream.write('5');\n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\t\tMainActivity.this,\n\t\t\t\t\t\t\t\t\t\"Connection not established with your home\",\n\t\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else\n\t\t\t\t\t\tToast.makeText(MainActivity.this,\n\t\t\t\t\t\t\t\t\"Connection not established with your home\",\n\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t} else {\n\t\t\t\t\tif (stat == 1) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tmmOutputStream.write('6');\n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\t\tMainActivity.this,\n\t\t\t\t\t\t\t\t\t\"Connection not established with your home\",\n\t\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else\n\t\t\t\t\t\tToast.makeText(MainActivity.this,\n\t\t\t\t\t\t\t\t\"Connection not established with your home\",\n\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tfinal ToggleButton light3 = (ToggleButton) findViewById(R.id.toggleButton4);\n\t\tlight3.setOnClickListener(new View.OnClickListener() {\n\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tif (light3.isChecked()) {\n\t\t\t\t\tif (stat == 1) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tmmOutputStream.write('7');\n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\t\tMainActivity.this,\n\t\t\t\t\t\t\t\t\t\"Connection not established with your home\",\n\t\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else\n\t\t\t\t\t\tToast.makeText(MainActivity.this,\n\t\t\t\t\t\t\t\t\"Connection not established with your home\",\n\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t} else {\n\t\t\t\t\tif (stat == 1) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tmmOutputStream.write('8');\n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\t\tMainActivity.this,\n\t\t\t\t\t\t\t\t\t\"Connection not established with your home\",\n\t\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else\n\t\t\t\t\t\tToast.makeText(MainActivity.this,\n\t\t\t\t\t\t\t\t\"Connection not established with your home\",\n\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tfinal ToggleButton tv = (ToggleButton) findViewById(R.id.toggleButton5);\n\t\ttv.setOnClickListener(new View.OnClickListener() {\n\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tif (tv.isChecked()) {\n\t\t\t\t\tif (stat == 1) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tmmOutputStream.write('9');\n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\t\tMainActivity.this,\n\t\t\t\t\t\t\t\t\t\"Connection not established with your home\",\n\t\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else\n\t\t\t\t\t\tToast.makeText(MainActivity.this,\n\t\t\t\t\t\t\t\t\"Connection not established with your home\",\n\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t} else {\n\t\t\t\t\tif (stat == 1) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tmmOutputStream.write('0');\n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\t\tMainActivity.this,\n\t\t\t\t\t\t\t\t\t\"Connection not established with your home\",\n\t\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else\n\t\t\t\t\t\tToast.makeText(MainActivity.this,\n\t\t\t\t\t\t\t\t\"Connection not established with your home\",\n\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t}", "void onCloseBleComplete();", "private void connectBluetooth() {\n try {\n if (blueTooth == null && macSet) {\n Log.d(\"lol\", \"macSet connect bluetooootooththoth\");\n blueTooth = new BluetoothConnection(macAddress, this, listener);\n blueTooth.connect();\n }\n } catch (Exception e) {\n Log.d(\"lol\", \"Failed connection: \" + e.getMessage() + \" \" + e.getClass());\n }\n }", "@Override\n public IBinder onBind(Intent intent) {\n\n AppConstants.RebootHF_reader = false;\n if (mBluetoothLeService != null) {\n final boolean result = mBluetoothLeService.connect(mDeviceAddress);\n Log.d(TAG, \"Connect request result=\" + result);\n }\n\n\n throw new UnsupportedOperationException(\"Not yet implemented\");\n }", "public void sendBtMsg(final String msg2send) {\n UUID uuid = UUID.fromString(\"94f39d29-7d6d-437d-973b-fba39e49d4ee\"); //Standard SerialPortService ID\n try {\n\n if (mmDevice != null) {\n mmSocket = mmDevice.createRfcommSocketToServiceRecord(uuid);\n if (!mmSocket.isConnected()) {\n try {\n mmSocket.connect();\n Handler handler = new Handler(Looper.getMainLooper());\n handler.post(new Runnable() {\n @Override\n public void run() {\n\n toastMsg(\"Connection Established\");\n\n String msg = msg2send;\n //msg += \"\\n\";\n OutputStream mmOutputStream = null;\n try {\n mmOutputStream = mmSocket.getOutputStream();\n mmOutputStream.write(msg.getBytes());\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }\n });\n\n } catch (IOException e) {\n Log.e(\"\", e.getMessage());\n mmSocket.close();\n Handler handler = new Handler(Looper.getMainLooper());\n handler.post(new Runnable() {\n @Override\n public void run() {\n toastMsg(\"Connection not Established\");\n\n\n }\n });\n\n /*try {\n Log.e(\"\", \"trying fallback\");\n mmSocket =(BluetoothSocket) mmDevice.getClass().getMethod(\"createRfcommSocket\", new Class[] {int.class}).invoke(mmDevice,1);\n mmSocket.connect();\n Log.e(\"\", \"Connected\");\n }\n catch (Exception e2){\n Log.e(\"\", \"Couldn't establish Bluetooth connection!\");\n toastMsg(\"Couldn't establish Bluetooth connection!\");\n }*/\n }\n }\n\n\n/*\n if (mmOutputStream == null)\n try {\n mmOutputStream = mmSocket.getOutputStream();\n } catch (IOException e) {\n errorExit(\"Fatal Error\", \"In onResume(), input and output stream creation failed:\" + e.getMessage() + \".\");\n }*/\n\n } else {\n if (mBluetoothAdapter != null) {\n\n\n Set<BluetoothDevice> pairedDevices = mBluetoothAdapter.getBondedDevices();\n if (pairedDevices.size() > 0) {\n for (BluetoothDevice device : pairedDevices) {\n if (device.getName().matches(\".*\")) //Note, you will need to change this to match the name of your device\n {\n Log.e(\"Aquarium\", device.getName());\n mmDevice = device;\n sendBtMsg(msg2send);\n break;\n }\n }\n }\n }\n }\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\n }", "@Override\n protected void onCreate(Bundle savedInstanceState)\n {\n super.onCreate(savedInstanceState);\n m_tts = new TextToSpeech(this, this);\n\n Intent newint = getIntent();\n //receive the address of the bluetooth device\n address = newint.getStringExtra(MainActivity.EXTRA_ADDRESS);\n\n //view of the ledControl\n setContentView(R.layout.activity_game_play);\n\n btnEnd = (Button)findViewById(R.id.btnEnd);\n\n new ConnectBT().execute(); //Call the class to connect\n\n btnEnd.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n Disconnect(); //close connection\n }\n });\n\n }", "@Override\n protected void onDestroy() {\n super.onDestroy();\n try {\n if (mBluetoothSocket != null) {\n mBluetoothSocket.close();\n mBluetoothSocket = null;\n }\n } catch (Exception e) {\n Log.e(\"Tag\", \"Exe \", e);\n }\n }", "@Override\n public void onClick(View v) {\n if (mBluetoothConnection.isConnected()) {\n mBluetoothConnection.changeState(BluetoothConnection.STATE_IMAGE_RECEIVING);\n mBluetoothConnection.write(\"open_settings\");\n buttonSettings.setEnabled(false);\n } else {\n Toast.makeText(getBaseContext(), \"Device not connected\", Toast.LENGTH_SHORT).show();\n }\n }", "public void close() {\n if (mBluetoothGatt == null) {\n return;\n }\n Log.w(TAG, \"mBluetoothGatt closed\");\n mBluetoothDeviceAddress = null;\n mBluetoothGatt.close();\n mBluetoothGatt = null;\n }", "public void findBluetooth() {\n BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();\n if (mBluetoothAdapter == null) {\n // Device does not support Bluetooth\n btStatusDisplay.setText(\"Device does not support Bluetooth\");\n }\n btStatusDisplay.setText(\"Trying to connect...\");\n\n /** Pops up request to enable if found not enabled */\n if (!mBluetoothAdapter.isEnabled()) {\n Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);\n }\n /** Get reference to scale as Bluetooth device \"mmDevice\" */\n Set<BluetoothDevice> pairedDevices = mBluetoothAdapter.getBondedDevices();\n if (pairedDevices.size() > 0) {\n for (BluetoothDevice device : pairedDevices) {\n if (device.getName().equals(\"BLUE\")) {\n mmDevice = device;\n btStatusDisplay.setText(\"Bluetooth device found\");\n break;\n }\n }\n }\n }", "@Override\n public void onReceive(Context context, Intent intent) {\n Bluetooth_14_feb receiveObj = (Bluetooth_14_feb) context.getApplicationContext();\n boolean appActive = receiveObj.isActivityVisible();\n //int appActive = receiveObj.getActivityCount();\n //Log.d(TAG,\"onReceive:receiver\");\n String action = intent.getAction(); // Get intent's action string\n Bundle extras = intent.getExtras();\n\n if (extras == null) return; // All intents of interest have extras.\n\n\n switch (action) {\n case \"android.bluetooth.adapter.action.STATE_CHANGED\": {\n\n int state = extras.getInt(\"android.bluetooth.adapter.extra.STATE\", FAIL);\n switch (state) {\n case BluetoothAdapter.STATE_OFF: \n if (!appActive) {\n\n Toast.makeText(context,\"Bluetooth:OFF\",Toast.LENGTH_SHORT).show();\n\n }\n else{\n\n Intent inten = new Intent(context,ConnectivityDialog.class);\n inten.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n context.startActivity(inten);\n //num=1;\n\n }\n\n break;\n \n case BluetoothAdapter.STATE_ON:\n\n\n if(!appActive) {\n Log.d(TAG,\"state-on-appactive\");\n Toast.makeText(context, \"Bluetooth:ON\", Toast.LENGTH_SHORT).show();\n }\n else{\n\n Intent i = new Intent(\"FINISH\");\n //i.setAction(\"FINISH\");\n context.sendBroadcast(i);\n Toast.makeText(context, \"Bluetooth:ON\", Toast.LENGTH_SHORT).show();\n }\n\n\n\n break;\n\n }\n\n }\n }\n }", "void setBluetoothService(BluetoothService bluetoothService);", "@Override\n public void checkBluetoothInteface() {\n if (!isConnected) {\n checkForBluetooth();\n }\n }", "public interface BluetoothListener {\n\t/**\n\t * Get a description of the game, to be displayed on the BluetoothFragment layout.\n\t * @return\n\t */\n\tString getHelpString();\n\t\n\t/**\n\t * @see #onConnectedAsServer(String)\n\t */\n\tvoid onConnectedAsClient(String deviceName);\n\t\n\t/**\n\t * The 2 devices have established a bluetooth connection.\n\t * The typical action at this point is to hide the bluetooth\n\t * fragment and show the game fragment. From now on the\n\t * communication between client and server is symmetrical:\n\t * both devices can equally send and receive messages.\n\t * \n\t * Sometimes it is useful to know which device requested the\n\t * connection (the client) and which side accepted that\n\t * connection (the server).\n\t * \n\t * @param deviceName the name of the remote device\n\t */\n\tvoid onConnectedAsServer(String deviceName);\n\t\n\t/**\n\t * Typically the Activity will hide the game fragment and show\n\t * the BluetoothFragment, to allow the user to re-connect.\n\t */\n\tvoid onConnectionLost();\n\t\n\tvoid onError(String message);\n\t\n\t/**\n\t * A data message has been received from the remote device.\n\t * This corresponds to the other device performing a write().\n\t * @see BluetoothService#write(byte[] data)\n\t * \n\t * @param data\n\t */\n\tvoid onMessageRead(byte[] data);\n\t\n\t/**\n\t * A status message sent by the bluetooth service to be displayed\n\t * by the activity using Toast.\n\t * @param string\n\t */\n\tvoid onMessageToast(String string);\n\t\n\t/**\n\t * Called when the state of the bluetooth service has changed.\n\t * @see class BluetoothService.BTState for possible values.\n\t * @param state\n\t */\n\tvoid onStateChange(BluetoothService.BTState state);\n\t\n\t/**\n\t * Pass the object that will handle bluetooth communication.\n\t * Null if bluetooth not available on this device.\n\t * The main method to use in communication is write(byte[] data)\n\t * \n\t * @see BluetoothService#write(byte[] data)\n\t * @param bluetoothService\n\t */\n\tvoid setBluetoothService(BluetoothService bluetoothService);\n\n\t/**\n\t * A status message sent by the bluetooth service to be displayed\n\t * somewhere.\n\t * @param message\n\t */\n\tvoid setStatusMessage(String message);\n}", "private void tryClose() {\n Log.i(TAG, \"tryClose(): closing connection to heartrate device\");\n if (deviceCommunicator == null) {\n return;\n }\n heartRateCharacteristic = null;\n deviceCommunicator.close();\n deviceCommunicator.disconnect();\n deviceCommunicator = null;\n broadcastAction(ACTION_GATT_DISCONNECTED);\n }", "@Override\r\n\tprotected void onHandleIntent(Intent intent) {\n\t\tfinal BluetoothManager bluetoothManager = (BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE);\r\n\t\tmBluetoothAdapter = bluetoothManager.getAdapter();\r\n\r\n\t\t// Checks if Bluetooth is supported on the device.\r\n\t\tif (mBluetoothAdapter == null) {\r\n\t\t\tLog.i(TAG, \"Bluetooth is not supported\");\r\n\t\t\treturn;\r\n\t\t} else {\r\n\t\t\tLog.i(TAG, \"mBluetoothAdapter = \" + mBluetoothAdapter);\r\n\t\t}\r\n\r\n\t\t//启用蓝牙\r\n\t\t//mBluetoothAdapter.enable();\r\n\t\t//Log.i(TAG, \"mBluetoothAdapter.enable\");\r\n\t\t\r\n\t\tmBLE = new BluetoothLeClass(this);\r\n\t\t\r\n\t\tif (!mBLE.initialize()) {\r\n\t\t\tLog.e(TAG, \"Unable to initialize Bluetooth\");\r\n\t\t}\r\n\t\tLog.i(TAG, \"mBLE = e\" + mBLE);\r\n\r\n\t\t// 发现BLE终端的Service时回调\r\n\t\tmBLE.setOnServiceDiscoverListener(mOnServiceDiscover);\r\n\r\n\t\t// 收到BLE终端数据交互的事件\r\n\t\tmBLE.setOnDataAvailableListener(mOnDataAvailable);\r\n\t\t\r\n\t\t//开始扫描\r\n\t\tmBLE.scanLeDevice(true);\r\n\t\t\r\n\t\t/*\r\n\t\tMRBluetoothManage.Init(this, new MRBluetoothEvent() {\r\n\t\t\t@Override\r\n\t\t\tpublic void ResultStatus(int result) {\r\n\t\t\t\tswitch (result) {\r\n\t\t\t\tcase MRBluetoothManage.MRBLUETOOTHSTATUS_NOT_OPEN:\r\n\t\t\t\t\t//Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\r\n\t\t\t\t\t//startActivityForResult(enableBtIntent, 100);\r\n\t\t\t\t\tLog.d(TAG, \"MRBLUETOOTHSTATUS_NOT_OPEN\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MRBluetoothManage.MRBLUETOOTHSTATUS_INIT_OK:\r\n\t\t\t\t\tMRBluetoothManage.scanAndConnect();\r\n\t\t\t\t\tLog.d(TAG, \"MRBLUETOOTHSTATUS_INIT_OK\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MRBluetoothManage.MRBLUETOOTHSTATUS_SCAN_START:\r\n\t\t\t\t\tLog.d(TAG, \"MRBLUETOOTHSTATUS_SCAN_START\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MRBluetoothManage.MRBLUETOOTHSTATUS_SCAN_END:\r\n\t\t\t\t\tLog.d(TAG, \"MRBLUETOOTHSTATUS_SCAN_END\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MRBluetoothManage.MRBLUETOOTHSTATUS_CONNECT_START:\r\n\t\t\t\t\tLog.d(TAG, \"MRBLUETOOTHSTATUS_CONNECT_START\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MRBluetoothManage.MRBLUETOOTHSTATUS_CONNECT_OK:\r\n\t\t\t\t\tLog.d(TAG, \"MRBLUETOOTHSTATUS_CONNECT_OK\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MRBluetoothManage.MRBLUETOOTHSTATUS_CONNECT_CLOSE:\r\n\t\t\t\t\tLog.d(TAG, \"MRBLUETOOTHSTATUS_CONNECT_CLOSE\");\r\n\t\t\t\t\tMRBluetoothManage.stop();\r\n\t\t\t\t\tMRBluetoothManage.scanAndConnect();\r\n\t\t\t\t\t//MRBluetoothManage.Init(BluetoothService.this, this);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void ResultDevice(ArrayList<BluetoothDevice> deviceList) {\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void ResultData(byte[] data) {\r\n\t\t\t\tLog.i(TAG, data.toString());\r\n\t\t\t\tbyte[] wenDuByte = new byte[2];\r\n\t\t\t\tbyte[] shiDuByte = new byte[2];\r\n\t\t\t\tbyte[] shuiFenByte = new byte[2];\r\n\t\t\t\tbyte[] ziWaiXianByte = new byte[2];\r\n\t\t\t\tSystem.arraycopy(data, 4, wenDuByte, 0, 2);\r\n\t\t\t\tSystem.arraycopy(data, 6, shiDuByte, 0, 2);\r\n\t\t\t\tSystem.arraycopy(data, 8, shuiFenByte, 0, 2);\r\n\t\t\t\tSystem.arraycopy(data, 10, ziWaiXianByte, 0, 2);\r\n\t\t\t\tTestModel model = new TestModel();\r\n\t\t\t\tmodel.wenDu = BitConverter.toShort(wenDuByte);\r\n\t\t\t\tmodel.shiDu = BitConverter.toShort(shiDuByte);\r\n\t\t\t\tmodel.shuiFen = BitConverter.toShort(shuiFenByte);\r\n\t\t\t\tmodel.ziWaiXian = BitConverter.toShort(ziWaiXianByte);\r\n\t\t\t\t//Log.d(TAG, model.toString());\r\n\t\t\t\tsendData(model);\r\n\t\t\t}\r\n\t\t});\r\n\t\t*/\r\n\t}", "public void cancel() {\n try {\n bluetoothServerSocket.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private void close() {\n if (mGatt != null) {\n mGatt.close();\n mGatt = null;\n mDeviceAddress = null;\n mDevice = null;\n }\n }", "private void setupBluetooth() {\n if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)) {\n Toast.makeText(this, R.string.ble_not_supported, Toast.LENGTH_SHORT).show();\n finish();\n }\n\n // Initializes Bluetooth adapter.\n final BluetoothManager bluetoothManager =\n (BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE);\n bluetoothAdapter = bluetoothManager.getAdapter();\n\n // Ensures Bluetooth is available on the device and it is enabled. If not,\n // displays a dialog requesting user permission to enable Bluetooth.\n if (bluetoothAdapter == null || !bluetoothAdapter.isEnabled()) {\n Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(enableBtIntent, 1);\n }\n\n Set<BluetoothDevice> pairedDevices = bluetoothAdapter.getBondedDevices();\n\n if (pairedDevices.size() > 0) {\n // There are paired devices. Get the name and address of each paired device.\n for (BluetoothDevice device : pairedDevices) {\n String deviceName = device.getName();\n String deviceHardwareAddress = device.getAddress(); // MAC address\n String deviceType = device.getBluetoothClass().getDeviceClass() + \"\";\n\n Movie movie = new Movie(deviceName, deviceHardwareAddress, deviceType);\n movieList.add(movie);\n\n }\n\n mAdapter.notifyDataSetChanged();\n }\n }", "public static Bluetooth getBT(){\n return BT;\n }", "public int disconnect() {\n Log.d(TAG, \"kill start\");\n \n // TODO: check if conditionals fixes bug\n // disconnecting when bluetooth not enabeled\n for( BluetoothConnectionThread bct: bluetoothConnectionThreads ){\n if (bct != null) {\n bct.kill();\n bct = null;\n }\n }\n \n if (this.router != null) {\n this.router.stop();\n this.router = null;\n }\n \n Log.d(TAG, \"kill success\");\n return Constants.SUCCESS;\n }", "public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_bluetooth_handler);\n final Button back=(Button) findViewById(R.id.button_back);\n bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();\n checkBTState();\n\n try {\n serverSocket=bluetoothAdapter.listenUsingInsecureRfcommWithServiceRecord(label, MY_UUID);\n } catch (IOException e){}\n\n try{\n bluetoothSocket=serverSocket.accept();\n }catch (IOException e) {}\n\n try{\n outputStream=MainActivity1.bluetoothSocket.getOutputStream();\n }catch (IOException e){\n Log.d(MainActivity1.label,\"Output stream connection failed.\");\n }\n\n receiver=new BroadcastReceiver() {\n @Override\n public void onReceive(Context context, Intent intent)\n {\n String a=intent.getAction();\n\n if(BluetoothDevice.ACTION_FOUND.equals(a))\n {\n BluetoothDevice device=intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);\n\n bluetoothItems.add(device.getName());\n }\n }\n };\n IntentFilter filter=new IntentFilter(BluetoothDevice.ACTION_FOUND);\n registerReceiver(receiver, filter);\n\n //searching();\n\n ListView bluetoothList=(ListView) findViewById(R.id.listView_bluetoothItems);\n\n bluetoothList.setAdapter(new ArrayAdapter<String>(this,R.layout.abc_list_menu_item_layout));\n\n back.setOnClickListener(new OnClickListener() {\n @Override\n public void onClick(View v) {\n startActivity(new Intent(getApplicationContext(), ControllerHomeScreen.class));\n }\n });\n }", "public void run() {\r\n BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();\r\n adapter.cancelDiscovery();\r\n try {\r\n btSocket.connect();\r\n Log.d(\"TAG\", \"Device connected\");\r\n isConnected = true;\r\n SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);\r\n SharedPreferences.Editor edit = preferences.edit();\r\n edit.putBoolean(\"Connection\", isConnected);\r\n edit.apply();\r\n handler.obtainMessage(CONNECTING_STATUS, 1, -1).sendToTarget();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n try {\r\n isConnected = false;\r\n SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);\r\n SharedPreferences.Editor edit = preferences.edit();\r\n edit.putBoolean(\"Connection\", isConnected);\r\n edit.apply();\r\n btSocket.close();\r\n handler.obtainMessage(CONNECTING_STATUS, -1,-1).sendToTarget();\r\n } catch (IOException f) {\r\n f.printStackTrace();\r\n }\r\n return;\r\n }\r\n //Perform work from connection in a separate thread\r\n connectedThread = new ConnectedThread(btSocket);\r\n connectedThread.run();\r\n }", "private void connect() {\n // after 10 seconds its connected\n new Handler().postDelayed(\n new Runnable() {\n public void run() {\n Log.d(TAG, \"Bluetooth Low Energy device is connected!!\");\n // Toast.makeText(getApplicationContext(),\"Connected!\",Toast.LENGTH_SHORT).show();\n stateService = Constants.STATE_SERVICE.CONNECTED;\n startForeground(Constants.NOTIFICATION_ID_FOREGROUND_SERVICE, prepareNotification());\n }\n }, 10000);\n\n }", "@Override\r\n public void onCreate() {\n intent = new Intent(BROADCAST_ACTION);\r\n startBTService();\r\n// try{\r\n// mConnectedThread.write(\"2\".getBytes());\r\n// }catch(Exception e){\r\n//\r\n// }\r\n }", "private void Disconnect() {\n //If the btSocket is busy\n if (btSocket!=null) {\n try {\n btSocket.close(); //close connection\n }\n catch (IOException e) {\n msg(\"Error\");\n }\n }\n finish(); //return to the first layout\n\n }", "@Override\n protected Void doInBackground(Void... devices){\n try {\n if (btSocket == null || !isBtConnected) {\n //get the mobile bluetooth device\n m_Bluetooth = BluetoothAdapter.getDefaultAdapter();\n //connects to the device's address and checks if it's available\n BluetoothDevice bluetoothDevice = m_Bluetooth.getRemoteDevice(address);\n //create a RFCOMM (SPP) connection\n btSocket = bluetoothDevice.createInsecureRfcommSocketToServiceRecord(myUUID);\n BluetoothAdapter.getDefaultAdapter().cancelDiscovery();\n btSocket.connect();//start connection\n }\n }\n catch (IOException e) {\n ConnectSuccess = false;//if the try failed, you can check the exception here\n }\n return null;\n }", "@Implementation\n protected void close() {\n bluetoothGattServerReflector.close();\n this.isClosed = true;\n }", "@Override\n public boolean disconnect(BluetoothDevice bluetoothDevice) throws RemoteException {\n Parcel parcel = Parcel.obtain();\n Parcel parcel2 = Parcel.obtain();\n try {\n parcel.writeInterfaceToken(Stub.DESCRIPTOR);\n boolean bl = true;\n if (bluetoothDevice != null) {\n parcel.writeInt(1);\n bluetoothDevice.writeToParcel(parcel, 0);\n } else {\n parcel.writeInt(0);\n }\n if (!this.mRemote.transact(9, parcel, parcel2, 0) && Stub.getDefaultImpl() != null) {\n bl = Stub.getDefaultImpl().disconnect(bluetoothDevice);\n parcel2.recycle();\n parcel.recycle();\n return bl;\n }\n parcel2.readException();\n int n = parcel2.readInt();\n if (n == 0) {\n bl = false;\n }\n parcel2.recycle();\n parcel.recycle();\n return bl;\n }\n catch (Throwable throwable) {\n parcel2.recycle();\n parcel.recycle();\n throw throwable;\n }\n }", "public void startConnection(){\n startBTConnection(mBTDevice,MY_UUID_INSECURE);\n }", "private void BTKies() {\n Set<BluetoothDevice> pairedDevices;\n ArrayAdapter<String> BTArrayAdapter;\n final Dialog dialog = new Dialog(this);\n dialog.setContentView(R.layout.devicedialog);\n dialog.setTitle(\"Kies een verbinding\");\n BTListView = (ListView) dialog.findViewById(R.id.listView1);\n BTListView.setVisibility(View.VISIBLE);\n\n BTArrayAdapter = new ArrayAdapter<String>(this,\n android.R.layout.simple_list_item_1);\n BTListView.setAdapter(BTArrayAdapter);\n pairedDevices = BT.getBondedDevices();\n for (BluetoothDevice device : pairedDevices)\n BTArrayAdapter.add(device.getName() + \"\\n\" + device.getAddress());\n\n dialog.show();\n\n // Pick het item uit de list\n BTListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {\n @Override\n public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n long arg3) {\n ListView lv = (ListView) arg0;\n TextView tv = (TextView) lv.getChildAt(arg2);\n String s = tv.getText().toString();\n\n Connect(s); // Make connection\n }\n\n private void Connect(String s) {\n int i = s.length();\n address = s.substring(i - 17);\n BluetoothDevice device = BT.getRemoteDevice(address);\n Log.d(TAG, \"Connecting to ... \" + device);\n BT.cancelDiscovery();\n try { // omgaan met exeptions\n btSocket = device\n .createRfcommSocketToServiceRecord(MY_UUID);\n btSocket.connect();\n // hier de comunicatie invullen ***********************************************\n writeData(\"c#\"); // vraag om een bevestiging van de verbinding\n BTListView.setVisibility(View.INVISIBLE);\n dialog.dismiss();\n beginListenForData();\n } catch (IOException e) {\n try {\n btSocket.close();\n } catch (IOException e2) {\n DisplayToast(\"Unable to end the connection\");\n }\n DisplayToast(\"Ontvanger niet beschikbaar. Kies opnieuw\");\n }\n }\t// einde connect\n\n });\t// einde onClick\n }", "public interface IBluetoothHeadset\n extends IInterface {\n public static abstract class Stub extends Binder\n implements IBluetoothHeadset {\n private static class Proxy\n implements IBluetoothHeadset {\n\n public boolean acceptIncomingConnect(BluetoothDevice bluetoothdevice) throws RemoteException {\n boolean flag;\n Parcel parcel;\n Parcel parcel1;\n flag = true;\n parcel = Parcel.obtain();\n parcel1 = Parcel.obtain();\n parcel.writeInterfaceToken(\"android.bluetooth.IBluetoothHeadset\");\n if(bluetoothdevice == null)\n break MISSING_BLOCK_LABEL_76;\n parcel.writeInt(1);\n bluetoothdevice.writeToParcel(parcel, 0);\n_L1:\n int i;\n mRemote.transact(13, parcel, parcel1, 0);\n parcel1.readException();\n i = parcel1.readInt();\n Exception exception;\n if(i == 0)\n flag = false;\n parcel1.recycle();\n parcel.recycle();\n return flag;\n parcel.writeInt(0);\n goto _L1\n exception;\n parcel1.recycle();\n parcel.recycle();\n throw exception;\n }\n\n public IBinder asBinder() {\n return mRemote;\n }\n\n public boolean cancelConnectThread() throws RemoteException {\n boolean flag;\n Parcel parcel;\n Parcel parcel1;\n flag = false;\n parcel = Parcel.obtain();\n parcel1 = Parcel.obtain();\n int i;\n parcel.writeInterfaceToken(\"android.bluetooth.IBluetoothHeadset\");\n mRemote.transact(15, parcel, parcel1, 0);\n parcel1.readException();\n i = parcel1.readInt();\n if(i != 0)\n flag = true;\n parcel1.recycle();\n parcel.recycle();\n return flag;\n Exception exception;\n exception;\n parcel1.recycle();\n parcel.recycle();\n throw exception;\n }\n\n public boolean connect(BluetoothDevice bluetoothdevice) throws RemoteException {\n boolean flag;\n Parcel parcel;\n Parcel parcel1;\n flag = true;\n parcel = Parcel.obtain();\n parcel1 = Parcel.obtain();\n parcel.writeInterfaceToken(\"android.bluetooth.IBluetoothHeadset\");\n if(bluetoothdevice == null)\n break MISSING_BLOCK_LABEL_75;\n parcel.writeInt(1);\n bluetoothdevice.writeToParcel(parcel, 0);\n_L1:\n int i;\n mRemote.transact(1, parcel, parcel1, 0);\n parcel1.readException();\n i = parcel1.readInt();\n Exception exception;\n if(i == 0)\n flag = false;\n parcel1.recycle();\n parcel.recycle();\n return flag;\n parcel.writeInt(0);\n goto _L1\n exception;\n parcel1.recycle();\n parcel.recycle();\n throw exception;\n }\n\n public boolean connectHeadsetInternal(BluetoothDevice bluetoothdevice) throws RemoteException {\n boolean flag;\n Parcel parcel;\n Parcel parcel1;\n flag = true;\n parcel = Parcel.obtain();\n parcel1 = Parcel.obtain();\n parcel.writeInterfaceToken(\"android.bluetooth.IBluetoothHeadset\");\n if(bluetoothdevice == null)\n break MISSING_BLOCK_LABEL_76;\n parcel.writeInt(1);\n bluetoothdevice.writeToParcel(parcel, 0);\n_L1:\n int i;\n mRemote.transact(16, parcel, parcel1, 0);\n parcel1.readException();\n i = parcel1.readInt();\n Exception exception;\n if(i == 0)\n flag = false;\n parcel1.recycle();\n parcel.recycle();\n return flag;\n parcel.writeInt(0);\n goto _L1\n exception;\n parcel1.recycle();\n parcel.recycle();\n throw exception;\n }\n\n public boolean createIncomingConnect(BluetoothDevice bluetoothdevice) throws RemoteException {\n boolean flag;\n Parcel parcel;\n Parcel parcel1;\n flag = true;\n parcel = Parcel.obtain();\n parcel1 = Parcel.obtain();\n parcel.writeInterfaceToken(\"android.bluetooth.IBluetoothHeadset\");\n if(bluetoothdevice == null)\n break MISSING_BLOCK_LABEL_76;\n parcel.writeInt(1);\n bluetoothdevice.writeToParcel(parcel, 0);\n_L1:\n int i;\n mRemote.transact(12, parcel, parcel1, 0);\n parcel1.readException();\n i = parcel1.readInt();\n Exception exception;\n if(i == 0)\n flag = false;\n parcel1.recycle();\n parcel.recycle();\n return flag;\n parcel.writeInt(0);\n goto _L1\n exception;\n parcel1.recycle();\n parcel.recycle();\n throw exception;\n }\n\n public boolean disconnect(BluetoothDevice bluetoothdevice) throws RemoteException {\n boolean flag;\n Parcel parcel;\n Parcel parcel1;\n flag = true;\n parcel = Parcel.obtain();\n parcel1 = Parcel.obtain();\n parcel.writeInterfaceToken(\"android.bluetooth.IBluetoothHeadset\");\n if(bluetoothdevice == null)\n break MISSING_BLOCK_LABEL_75;\n parcel.writeInt(1);\n bluetoothdevice.writeToParcel(parcel, 0);\n_L1:\n int i;\n mRemote.transact(2, parcel, parcel1, 0);\n parcel1.readException();\n i = parcel1.readInt();\n Exception exception;\n if(i == 0)\n flag = false;\n parcel1.recycle();\n parcel.recycle();\n return flag;\n parcel.writeInt(0);\n goto _L1\n exception;\n parcel1.recycle();\n parcel.recycle();\n throw exception;\n }\n\n public boolean disconnectHeadsetInternal(BluetoothDevice bluetoothdevice) throws RemoteException {\n boolean flag;\n Parcel parcel;\n Parcel parcel1;\n flag = true;\n parcel = Parcel.obtain();\n parcel1 = Parcel.obtain();\n parcel.writeInterfaceToken(\"android.bluetooth.IBluetoothHeadset\");\n if(bluetoothdevice == null)\n break MISSING_BLOCK_LABEL_76;\n parcel.writeInt(1);\n bluetoothdevice.writeToParcel(parcel, 0);\n_L1:\n int i;\n mRemote.transact(17, parcel, parcel1, 0);\n parcel1.readException();\n i = parcel1.readInt();\n Exception exception;\n if(i == 0)\n flag = false;\n parcel1.recycle();\n parcel.recycle();\n return flag;\n parcel.writeInt(0);\n goto _L1\n exception;\n parcel1.recycle();\n parcel.recycle();\n throw exception;\n }\n\n public int getAudioState(BluetoothDevice bluetoothdevice) throws RemoteException {\n Parcel parcel;\n Parcel parcel1;\n parcel = Parcel.obtain();\n parcel1 = Parcel.obtain();\n parcel.writeInterfaceToken(\"android.bluetooth.IBluetoothHeadset\");\n if(bluetoothdevice == null)\n break MISSING_BLOCK_LABEL_65;\n parcel.writeInt(1);\n bluetoothdevice.writeToParcel(parcel, 0);\n_L1:\n int i;\n mRemote.transact(19, parcel, parcel1, 0);\n parcel1.readException();\n i = parcel1.readInt();\n parcel1.recycle();\n parcel.recycle();\n return i;\n parcel.writeInt(0);\n goto _L1\n Exception exception;\n exception;\n parcel1.recycle();\n parcel.recycle();\n throw exception;\n }\n\n public int getBatteryUsageHint(BluetoothDevice bluetoothdevice) throws RemoteException {\n Parcel parcel;\n Parcel parcel1;\n parcel = Parcel.obtain();\n parcel1 = Parcel.obtain();\n parcel.writeInterfaceToken(\"android.bluetooth.IBluetoothHeadset\");\n if(bluetoothdevice == null)\n break MISSING_BLOCK_LABEL_65;\n parcel.writeInt(1);\n bluetoothdevice.writeToParcel(parcel, 0);\n_L1:\n int i;\n mRemote.transact(11, parcel, parcel1, 0);\n parcel1.readException();\n i = parcel1.readInt();\n parcel1.recycle();\n parcel.recycle();\n return i;\n parcel.writeInt(0);\n goto _L1\n Exception exception;\n exception;\n parcel1.recycle();\n parcel.recycle();\n throw exception;\n }\n\n public List getConnectedDevices() throws RemoteException {\n Parcel parcel;\n Parcel parcel1;\n parcel = Parcel.obtain();\n parcel1 = Parcel.obtain();\n java.util.ArrayList arraylist;\n parcel.writeInterfaceToken(\"android.bluetooth.IBluetoothHeadset\");\n mRemote.transact(3, parcel, parcel1, 0);\n parcel1.readException();\n arraylist = parcel1.createTypedArrayList(BluetoothDevice.CREATOR);\n parcel1.recycle();\n parcel.recycle();\n return arraylist;\n Exception exception;\n exception;\n parcel1.recycle();\n parcel.recycle();\n throw exception;\n }\n\n public int getConnectionState(BluetoothDevice bluetoothdevice) throws RemoteException {\n Parcel parcel;\n Parcel parcel1;\n parcel = Parcel.obtain();\n parcel1 = Parcel.obtain();\n parcel.writeInterfaceToken(\"android.bluetooth.IBluetoothHeadset\");\n if(bluetoothdevice == null)\n break MISSING_BLOCK_LABEL_64;\n parcel.writeInt(1);\n bluetoothdevice.writeToParcel(parcel, 0);\n_L1:\n int i;\n mRemote.transact(5, parcel, parcel1, 0);\n parcel1.readException();\n i = parcel1.readInt();\n parcel1.recycle();\n parcel.recycle();\n return i;\n parcel.writeInt(0);\n goto _L1\n Exception exception;\n exception;\n parcel1.recycle();\n parcel.recycle();\n throw exception;\n }\n\n public List getDevicesMatchingConnectionStates(int ai[]) throws RemoteException {\n Parcel parcel;\n Parcel parcel1;\n parcel = Parcel.obtain();\n parcel1 = Parcel.obtain();\n java.util.ArrayList arraylist;\n parcel.writeInterfaceToken(\"android.bluetooth.IBluetoothHeadset\");\n parcel.writeIntArray(ai);\n mRemote.transact(4, parcel, parcel1, 0);\n parcel1.readException();\n arraylist = parcel1.createTypedArrayList(BluetoothDevice.CREATOR);\n parcel1.recycle();\n parcel.recycle();\n return arraylist;\n Exception exception;\n exception;\n parcel1.recycle();\n parcel.recycle();\n throw exception;\n }\n\n public String getInterfaceDescriptor() {\n return \"android.bluetooth.IBluetoothHeadset\";\n }\n\n public int getPriority(BluetoothDevice bluetoothdevice) throws RemoteException {\n Parcel parcel;\n Parcel parcel1;\n parcel = Parcel.obtain();\n parcel1 = Parcel.obtain();\n parcel.writeInterfaceToken(\"android.bluetooth.IBluetoothHeadset\");\n if(bluetoothdevice == null)\n break MISSING_BLOCK_LABEL_65;\n parcel.writeInt(1);\n bluetoothdevice.writeToParcel(parcel, 0);\n_L1:\n int i;\n mRemote.transact(7, parcel, parcel1, 0);\n parcel1.readException();\n i = parcel1.readInt();\n parcel1.recycle();\n parcel.recycle();\n return i;\n parcel.writeInt(0);\n goto _L1\n Exception exception;\n exception;\n parcel1.recycle();\n parcel.recycle();\n throw exception;\n }\n\n public boolean isAudioConnected(BluetoothDevice bluetoothdevice) throws RemoteException {\n boolean flag;\n Parcel parcel;\n Parcel parcel1;\n flag = true;\n parcel = Parcel.obtain();\n parcel1 = Parcel.obtain();\n parcel.writeInterfaceToken(\"android.bluetooth.IBluetoothHeadset\");\n if(bluetoothdevice == null)\n break MISSING_BLOCK_LABEL_76;\n parcel.writeInt(1);\n bluetoothdevice.writeToParcel(parcel, 0);\n_L1:\n int i;\n mRemote.transact(10, parcel, parcel1, 0);\n parcel1.readException();\n i = parcel1.readInt();\n Exception exception;\n if(i == 0)\n flag = false;\n parcel1.recycle();\n parcel.recycle();\n return flag;\n parcel.writeInt(0);\n goto _L1\n exception;\n parcel1.recycle();\n parcel.recycle();\n throw exception;\n }\n\n public boolean rejectIncomingConnect(BluetoothDevice bluetoothdevice) throws RemoteException {\n boolean flag;\n Parcel parcel;\n Parcel parcel1;\n flag = true;\n parcel = Parcel.obtain();\n parcel1 = Parcel.obtain();\n parcel.writeInterfaceToken(\"android.bluetooth.IBluetoothHeadset\");\n if(bluetoothdevice == null)\n break MISSING_BLOCK_LABEL_76;\n parcel.writeInt(1);\n bluetoothdevice.writeToParcel(parcel, 0);\n_L1:\n int i;\n mRemote.transact(14, parcel, parcel1, 0);\n parcel1.readException();\n i = parcel1.readInt();\n Exception exception;\n if(i == 0)\n flag = false;\n parcel1.recycle();\n parcel.recycle();\n return flag;\n parcel.writeInt(0);\n goto _L1\n exception;\n parcel1.recycle();\n parcel.recycle();\n throw exception;\n }\n\n public boolean setAudioState(BluetoothDevice bluetoothdevice, int i) throws RemoteException {\n boolean flag;\n Parcel parcel;\n Parcel parcel1;\n flag = true;\n parcel = Parcel.obtain();\n parcel1 = Parcel.obtain();\n parcel.writeInterfaceToken(\"android.bluetooth.IBluetoothHeadset\");\n if(bluetoothdevice == null)\n break MISSING_BLOCK_LABEL_88;\n parcel.writeInt(1);\n bluetoothdevice.writeToParcel(parcel, 0);\n_L1:\n int j;\n parcel.writeInt(i);\n mRemote.transact(18, parcel, parcel1, 0);\n parcel1.readException();\n j = parcel1.readInt();\n Exception exception;\n if(j == 0)\n flag = false;\n parcel1.recycle();\n parcel.recycle();\n return flag;\n parcel.writeInt(0);\n goto _L1\n exception;\n parcel1.recycle();\n parcel.recycle();\n throw exception;\n }\n\n public boolean setPriority(BluetoothDevice bluetoothdevice, int i) throws RemoteException {\n boolean flag;\n Parcel parcel;\n Parcel parcel1;\n flag = true;\n parcel = Parcel.obtain();\n parcel1 = Parcel.obtain();\n parcel.writeInterfaceToken(\"android.bluetooth.IBluetoothHeadset\");\n if(bluetoothdevice == null)\n break MISSING_BLOCK_LABEL_88;\n parcel.writeInt(1);\n bluetoothdevice.writeToParcel(parcel, 0);\n_L1:\n int j;\n parcel.writeInt(i);\n mRemote.transact(6, parcel, parcel1, 0);\n parcel1.readException();\n j = parcel1.readInt();\n Exception exception;\n if(j == 0)\n flag = false;\n parcel1.recycle();\n parcel.recycle();\n return flag;\n parcel.writeInt(0);\n goto _L1\n exception;\n parcel1.recycle();\n parcel.recycle();\n throw exception;\n }\n\n public boolean startScoUsingVirtualVoiceCall(BluetoothDevice bluetoothdevice) throws RemoteException {\n boolean flag;\n Parcel parcel;\n Parcel parcel1;\n flag = true;\n parcel = Parcel.obtain();\n parcel1 = Parcel.obtain();\n parcel.writeInterfaceToken(\"android.bluetooth.IBluetoothHeadset\");\n if(bluetoothdevice == null)\n break MISSING_BLOCK_LABEL_76;\n parcel.writeInt(1);\n bluetoothdevice.writeToParcel(parcel, 0);\n_L1:\n int i;\n mRemote.transact(20, parcel, parcel1, 0);\n parcel1.readException();\n i = parcel1.readInt();\n Exception exception;\n if(i == 0)\n flag = false;\n parcel1.recycle();\n parcel.recycle();\n return flag;\n parcel.writeInt(0);\n goto _L1\n exception;\n parcel1.recycle();\n parcel.recycle();\n throw exception;\n }\n\n public boolean startVoiceRecognition(BluetoothDevice bluetoothdevice) throws RemoteException {\n boolean flag;\n Parcel parcel;\n Parcel parcel1;\n flag = true;\n parcel = Parcel.obtain();\n parcel1 = Parcel.obtain();\n parcel.writeInterfaceToken(\"android.bluetooth.IBluetoothHeadset\");\n if(bluetoothdevice == null)\n break MISSING_BLOCK_LABEL_76;\n parcel.writeInt(1);\n bluetoothdevice.writeToParcel(parcel, 0);\n_L1:\n int i;\n mRemote.transact(8, parcel, parcel1, 0);\n parcel1.readException();\n i = parcel1.readInt();\n Exception exception;\n if(i == 0)\n flag = false;\n parcel1.recycle();\n parcel.recycle();\n return flag;\n parcel.writeInt(0);\n goto _L1\n exception;\n parcel1.recycle();\n parcel.recycle();\n throw exception;\n }\n\n public boolean stopScoUsingVirtualVoiceCall(BluetoothDevice bluetoothdevice) throws RemoteException {\n boolean flag;\n Parcel parcel;\n Parcel parcel1;\n flag = true;\n parcel = Parcel.obtain();\n parcel1 = Parcel.obtain();\n parcel.writeInterfaceToken(\"android.bluetooth.IBluetoothHeadset\");\n if(bluetoothdevice == null)\n break MISSING_BLOCK_LABEL_76;\n parcel.writeInt(1);\n bluetoothdevice.writeToParcel(parcel, 0);\n_L1:\n int i;\n mRemote.transact(21, parcel, parcel1, 0);\n parcel1.readException();\n i = parcel1.readInt();\n Exception exception;\n if(i == 0)\n flag = false;\n parcel1.recycle();\n parcel.recycle();\n return flag;\n parcel.writeInt(0);\n goto _L1\n exception;\n parcel1.recycle();\n parcel.recycle();\n throw exception;\n }\n\n public boolean stopVoiceRecognition(BluetoothDevice bluetoothdevice) throws RemoteException {\n boolean flag;\n Parcel parcel;\n Parcel parcel1;\n flag = true;\n parcel = Parcel.obtain();\n parcel1 = Parcel.obtain();\n parcel.writeInterfaceToken(\"android.bluetooth.IBluetoothHeadset\");\n if(bluetoothdevice == null)\n break MISSING_BLOCK_LABEL_76;\n parcel.writeInt(1);\n bluetoothdevice.writeToParcel(parcel, 0);\n_L1:\n int i;\n mRemote.transact(9, parcel, parcel1, 0);\n parcel1.readException();\n i = parcel1.readInt();\n Exception exception;\n if(i == 0)\n flag = false;\n parcel1.recycle();\n parcel.recycle();\n return flag;\n parcel.writeInt(0);\n goto _L1\n exception;\n parcel1.recycle();\n parcel.recycle();\n throw exception;\n }\n\n private IBinder mRemote;\n\n Proxy(IBinder ibinder) {\n mRemote = ibinder;\n }\n }\n\n\n public static IBluetoothHeadset asInterface(IBinder ibinder) {\n Object obj;\n if(ibinder == null) {\n obj = null;\n } else {\n IInterface iinterface = ibinder.queryLocalInterface(\"android.bluetooth.IBluetoothHeadset\");\n if(iinterface != null && (iinterface instanceof IBluetoothHeadset))\n obj = (IBluetoothHeadset)iinterface;\n else\n obj = new Proxy(ibinder);\n }\n return ((IBluetoothHeadset) (obj));\n }\n\n public IBinder asBinder() {\n return this;\n }\n\n public boolean onTransact(int i, Parcel parcel, Parcel parcel1, int j) throws RemoteException {\n int k;\n boolean flag;\n k = 0;\n flag = true;\n i;\n JVM INSTR lookupswitch 22: default 192\n // 1: 215\n // 2: 278\n // 3: 341\n // 4: 366\n // 5: 395\n // 6: 449\n // 7: 516\n // 8: 570\n // 9: 633\n // 10: 696\n // 11: 759\n // 12: 813\n // 13: 876\n // 14: 939\n // 15: 1002\n // 16: 1036\n // 17: 1099\n // 18: 1162\n // 19: 1229\n // 20: 1283\n // 21: 1346\n // 1598968902: 206;\n goto _L1 _L2 _L3 _L4 _L5 _L6 _L7 _L8 _L9 _L10 _L11 _L12 _L13 _L14 _L15 _L16 _L17 _L18 _L19 _L20 _L21 _L22 _L23\n_L1:\n flag = super.onTransact(i, parcel, parcel1, j);\n_L25:\n return flag;\n_L23:\n parcel1.writeString(\"android.bluetooth.IBluetoothHeadset\");\n continue; /* Loop/switch isn't completed */\n_L2:\n parcel.enforceInterface(\"android.bluetooth.IBluetoothHeadset\");\n BluetoothDevice bluetoothdevice17;\n boolean flag15;\n if(parcel.readInt() != 0)\n bluetoothdevice17 = (BluetoothDevice)BluetoothDevice.CREATOR.createFromParcel(parcel);\n else\n bluetoothdevice17 = null;\n flag15 = connect(bluetoothdevice17);\n parcel1.writeNoException();\n if(flag15)\n k = ((flag) ? 1 : 0);\n parcel1.writeInt(k);\n continue; /* Loop/switch isn't completed */\n_L3:\n parcel.enforceInterface(\"android.bluetooth.IBluetoothHeadset\");\n BluetoothDevice bluetoothdevice16;\n boolean flag14;\n if(parcel.readInt() != 0)\n bluetoothdevice16 = (BluetoothDevice)BluetoothDevice.CREATOR.createFromParcel(parcel);\n else\n bluetoothdevice16 = null;\n flag14 = disconnect(bluetoothdevice16);\n parcel1.writeNoException();\n if(flag14)\n k = ((flag) ? 1 : 0);\n parcel1.writeInt(k);\n continue; /* Loop/switch isn't completed */\n_L4:\n parcel.enforceInterface(\"android.bluetooth.IBluetoothHeadset\");\n List list1 = getConnectedDevices();\n parcel1.writeNoException();\n parcel1.writeTypedList(list1);\n continue; /* Loop/switch isn't completed */\n_L5:\n parcel.enforceInterface(\"android.bluetooth.IBluetoothHeadset\");\n List list = getDevicesMatchingConnectionStates(parcel.createIntArray());\n parcel1.writeNoException();\n parcel1.writeTypedList(list);\n continue; /* Loop/switch isn't completed */\n_L6:\n parcel.enforceInterface(\"android.bluetooth.IBluetoothHeadset\");\n BluetoothDevice bluetoothdevice15;\n int k1;\n if(parcel.readInt() != 0)\n bluetoothdevice15 = (BluetoothDevice)BluetoothDevice.CREATOR.createFromParcel(parcel);\n else\n bluetoothdevice15 = null;\n k1 = getConnectionState(bluetoothdevice15);\n parcel1.writeNoException();\n parcel1.writeInt(k1);\n continue; /* Loop/switch isn't completed */\n_L7:\n parcel.enforceInterface(\"android.bluetooth.IBluetoothHeadset\");\n BluetoothDevice bluetoothdevice14;\n boolean flag13;\n if(parcel.readInt() != 0)\n bluetoothdevice14 = (BluetoothDevice)BluetoothDevice.CREATOR.createFromParcel(parcel);\n else\n bluetoothdevice14 = null;\n flag13 = setPriority(bluetoothdevice14, parcel.readInt());\n parcel1.writeNoException();\n if(flag13)\n k = ((flag) ? 1 : 0);\n parcel1.writeInt(k);\n continue; /* Loop/switch isn't completed */\n_L8:\n parcel.enforceInterface(\"android.bluetooth.IBluetoothHeadset\");\n BluetoothDevice bluetoothdevice13;\n int j1;\n if(parcel.readInt() != 0)\n bluetoothdevice13 = (BluetoothDevice)BluetoothDevice.CREATOR.createFromParcel(parcel);\n else\n bluetoothdevice13 = null;\n j1 = getPriority(bluetoothdevice13);\n parcel1.writeNoException();\n parcel1.writeInt(j1);\n continue; /* Loop/switch isn't completed */\n_L9:\n parcel.enforceInterface(\"android.bluetooth.IBluetoothHeadset\");\n BluetoothDevice bluetoothdevice12;\n boolean flag12;\n if(parcel.readInt() != 0)\n bluetoothdevice12 = (BluetoothDevice)BluetoothDevice.CREATOR.createFromParcel(parcel);\n else\n bluetoothdevice12 = null;\n flag12 = startVoiceRecognition(bluetoothdevice12);\n parcel1.writeNoException();\n if(flag12)\n k = ((flag) ? 1 : 0);\n parcel1.writeInt(k);\n continue; /* Loop/switch isn't completed */\n_L10:\n parcel.enforceInterface(\"android.bluetooth.IBluetoothHeadset\");\n BluetoothDevice bluetoothdevice11;\n boolean flag11;\n if(parcel.readInt() != 0)\n bluetoothdevice11 = (BluetoothDevice)BluetoothDevice.CREATOR.createFromParcel(parcel);\n else\n bluetoothdevice11 = null;\n flag11 = stopVoiceRecognition(bluetoothdevice11);\n parcel1.writeNoException();\n if(flag11)\n k = ((flag) ? 1 : 0);\n parcel1.writeInt(k);\n continue; /* Loop/switch isn't completed */\n_L11:\n parcel.enforceInterface(\"android.bluetooth.IBluetoothHeadset\");\n BluetoothDevice bluetoothdevice10;\n boolean flag10;\n if(parcel.readInt() != 0)\n bluetoothdevice10 = (BluetoothDevice)BluetoothDevice.CREATOR.createFromParcel(parcel);\n else\n bluetoothdevice10 = null;\n flag10 = isAudioConnected(bluetoothdevice10);\n parcel1.writeNoException();\n if(flag10)\n k = ((flag) ? 1 : 0);\n parcel1.writeInt(k);\n continue; /* Loop/switch isn't completed */\n_L12:\n parcel.enforceInterface(\"android.bluetooth.IBluetoothHeadset\");\n BluetoothDevice bluetoothdevice9;\n int i1;\n if(parcel.readInt() != 0)\n bluetoothdevice9 = (BluetoothDevice)BluetoothDevice.CREATOR.createFromParcel(parcel);\n else\n bluetoothdevice9 = null;\n i1 = getBatteryUsageHint(bluetoothdevice9);\n parcel1.writeNoException();\n parcel1.writeInt(i1);\n continue; /* Loop/switch isn't completed */\n_L13:\n parcel.enforceInterface(\"android.bluetooth.IBluetoothHeadset\");\n BluetoothDevice bluetoothdevice8;\n boolean flag9;\n if(parcel.readInt() != 0)\n bluetoothdevice8 = (BluetoothDevice)BluetoothDevice.CREATOR.createFromParcel(parcel);\n else\n bluetoothdevice8 = null;\n flag9 = createIncomingConnect(bluetoothdevice8);\n parcel1.writeNoException();\n if(flag9)\n k = ((flag) ? 1 : 0);\n parcel1.writeInt(k);\n continue; /* Loop/switch isn't completed */\n_L14:\n parcel.enforceInterface(\"android.bluetooth.IBluetoothHeadset\");\n BluetoothDevice bluetoothdevice7;\n boolean flag8;\n if(parcel.readInt() != 0)\n bluetoothdevice7 = (BluetoothDevice)BluetoothDevice.CREATOR.createFromParcel(parcel);\n else\n bluetoothdevice7 = null;\n flag8 = acceptIncomingConnect(bluetoothdevice7);\n parcel1.writeNoException();\n if(flag8)\n k = ((flag) ? 1 : 0);\n parcel1.writeInt(k);\n continue; /* Loop/switch isn't completed */\n_L15:\n parcel.enforceInterface(\"android.bluetooth.IBluetoothHeadset\");\n BluetoothDevice bluetoothdevice6;\n boolean flag7;\n if(parcel.readInt() != 0)\n bluetoothdevice6 = (BluetoothDevice)BluetoothDevice.CREATOR.createFromParcel(parcel);\n else\n bluetoothdevice6 = null;\n flag7 = rejectIncomingConnect(bluetoothdevice6);\n parcel1.writeNoException();\n if(flag7)\n k = ((flag) ? 1 : 0);\n parcel1.writeInt(k);\n continue; /* Loop/switch isn't completed */\n_L16:\n parcel.enforceInterface(\"android.bluetooth.IBluetoothHeadset\");\n boolean flag6 = cancelConnectThread();\n parcel1.writeNoException();\n if(flag6)\n k = ((flag) ? 1 : 0);\n parcel1.writeInt(k);\n continue; /* Loop/switch isn't completed */\n_L17:\n parcel.enforceInterface(\"android.bluetooth.IBluetoothHeadset\");\n BluetoothDevice bluetoothdevice5;\n boolean flag5;\n if(parcel.readInt() != 0)\n bluetoothdevice5 = (BluetoothDevice)BluetoothDevice.CREATOR.createFromParcel(parcel);\n else\n bluetoothdevice5 = null;\n flag5 = connectHeadsetInternal(bluetoothdevice5);\n parcel1.writeNoException();\n if(flag5)\n k = ((flag) ? 1 : 0);\n parcel1.writeInt(k);\n continue; /* Loop/switch isn't completed */\n_L18:\n parcel.enforceInterface(\"android.bluetooth.IBluetoothHeadset\");\n BluetoothDevice bluetoothdevice4;\n boolean flag4;\n if(parcel.readInt() != 0)\n bluetoothdevice4 = (BluetoothDevice)BluetoothDevice.CREATOR.createFromParcel(parcel);\n else\n bluetoothdevice4 = null;\n flag4 = disconnectHeadsetInternal(bluetoothdevice4);\n parcel1.writeNoException();\n if(flag4)\n k = ((flag) ? 1 : 0);\n parcel1.writeInt(k);\n continue; /* Loop/switch isn't completed */\n_L19:\n parcel.enforceInterface(\"android.bluetooth.IBluetoothHeadset\");\n BluetoothDevice bluetoothdevice3;\n boolean flag3;\n if(parcel.readInt() != 0)\n bluetoothdevice3 = (BluetoothDevice)BluetoothDevice.CREATOR.createFromParcel(parcel);\n else\n bluetoothdevice3 = null;\n flag3 = setAudioState(bluetoothdevice3, parcel.readInt());\n parcel1.writeNoException();\n if(flag3)\n k = ((flag) ? 1 : 0);\n parcel1.writeInt(k);\n continue; /* Loop/switch isn't completed */\n_L20:\n parcel.enforceInterface(\"android.bluetooth.IBluetoothHeadset\");\n BluetoothDevice bluetoothdevice2;\n int l;\n if(parcel.readInt() != 0)\n bluetoothdevice2 = (BluetoothDevice)BluetoothDevice.CREATOR.createFromParcel(parcel);\n else\n bluetoothdevice2 = null;\n l = getAudioState(bluetoothdevice2);\n parcel1.writeNoException();\n parcel1.writeInt(l);\n continue; /* Loop/switch isn't completed */\n_L21:\n parcel.enforceInterface(\"android.bluetooth.IBluetoothHeadset\");\n BluetoothDevice bluetoothdevice1;\n boolean flag2;\n if(parcel.readInt() != 0)\n bluetoothdevice1 = (BluetoothDevice)BluetoothDevice.CREATOR.createFromParcel(parcel);\n else\n bluetoothdevice1 = null;\n flag2 = startScoUsingVirtualVoiceCall(bluetoothdevice1);\n parcel1.writeNoException();\n if(flag2)\n k = ((flag) ? 1 : 0);\n parcel1.writeInt(k);\n continue; /* Loop/switch isn't completed */\n_L22:\n parcel.enforceInterface(\"android.bluetooth.IBluetoothHeadset\");\n BluetoothDevice bluetoothdevice;\n boolean flag1;\n if(parcel.readInt() != 0)\n bluetoothdevice = (BluetoothDevice)BluetoothDevice.CREATOR.createFromParcel(parcel);\n else\n bluetoothdevice = null;\n flag1 = stopScoUsingVirtualVoiceCall(bluetoothdevice);\n parcel1.writeNoException();\n if(flag1)\n k = ((flag) ? 1 : 0);\n parcel1.writeInt(k);\n if(true) goto _L25; else goto _L24\n_L24:\n }\n\n private static final String DESCRIPTOR = \"android.bluetooth.IBluetoothHeadset\";\n static final int TRANSACTION_acceptIncomingConnect = 13;\n static final int TRANSACTION_cancelConnectThread = 15;\n static final int TRANSACTION_connect = 1;\n static final int TRANSACTION_connectHeadsetInternal = 16;\n static final int TRANSACTION_createIncomingConnect = 12;\n static final int TRANSACTION_disconnect = 2;\n static final int TRANSACTION_disconnectHeadsetInternal = 17;\n static final int TRANSACTION_getAudioState = 19;\n static final int TRANSACTION_getBatteryUsageHint = 11;\n static final int TRANSACTION_getConnectedDevices = 3;\n static final int TRANSACTION_getConnectionState = 5;\n static final int TRANSACTION_getDevicesMatchingConnectionStates = 4;\n static final int TRANSACTION_getPriority = 7;\n static final int TRANSACTION_isAudioConnected = 10;\n static final int TRANSACTION_rejectIncomingConnect = 14;\n static final int TRANSACTION_setAudioState = 18;\n static final int TRANSACTION_setPriority = 6;\n static final int TRANSACTION_startScoUsingVirtualVoiceCall = 20;\n static final int TRANSACTION_startVoiceRecognition = 8;\n static final int TRANSACTION_stopScoUsingVirtualVoiceCall = 21;\n static final int TRANSACTION_stopVoiceRecognition = 9;\n\n public Stub() {\n attachInterface(this, \"android.bluetooth.IBluetoothHeadset\");\n }\n }\n\n\n public abstract boolean acceptIncomingConnect(BluetoothDevice bluetoothdevice) throws RemoteException;\n\n public abstract boolean cancelConnectThread() throws RemoteException;\n\n public abstract boolean connect(BluetoothDevice bluetoothdevice) throws RemoteException;\n\n public abstract boolean connectHeadsetInternal(BluetoothDevice bluetoothdevice) throws RemoteException;\n\n public abstract boolean createIncomingConnect(BluetoothDevice bluetoothdevice) throws RemoteException;\n\n public abstract boolean disconnect(BluetoothDevice bluetoothdevice) throws RemoteException;\n\n public abstract boolean disconnectHeadsetInternal(BluetoothDevice bluetoothdevice) throws RemoteException;\n\n public abstract int getAudioState(BluetoothDevice bluetoothdevice) throws RemoteException;\n\n public abstract int getBatteryUsageHint(BluetoothDevice bluetoothdevice) throws RemoteException;\n\n public abstract List getConnectedDevices() throws RemoteException;\n\n public abstract int getConnectionState(BluetoothDevice bluetoothdevice) throws RemoteException;\n\n public abstract List getDevicesMatchingConnectionStates(int ai[]) throws RemoteException;\n\n public abstract int getPriority(BluetoothDevice bluetoothdevice) throws RemoteException;\n\n public abstract boolean isAudioConnected(BluetoothDevice bluetoothdevice) throws RemoteException;\n\n public abstract boolean rejectIncomingConnect(BluetoothDevice bluetoothdevice) throws RemoteException;\n\n public abstract boolean setAudioState(BluetoothDevice bluetoothdevice, int i) throws RemoteException;\n\n public abstract boolean setPriority(BluetoothDevice bluetoothdevice, int i) throws RemoteException;\n\n public abstract boolean startScoUsingVirtualVoiceCall(BluetoothDevice bluetoothdevice) throws RemoteException;\n\n public abstract boolean startVoiceRecognition(BluetoothDevice bluetoothdevice) throws RemoteException;\n\n public abstract boolean stopScoUsingVirtualVoiceCall(BluetoothDevice bluetoothdevice) throws RemoteException;\n\n public abstract boolean stopVoiceRecognition(BluetoothDevice bluetoothdevice) throws RemoteException;\n}", "public boolean mBTOpen1() {\n if (oBTadapter == null){ //Prepare BT\n return mBTInit1();\n }else if (oBTadapter.isEnabled()) { //BT port is ready , Running return\n return true;\n }else { //Try to open BT port\n mMsgLog(\"Turning on the Bluetooth\");\n isOpenedByMe = true;\n oBTadapter.enable(); //Turn on bluetooth if not already active\n mSleep(1000);\n if (oBTadapter.isEnabled()) {\n return true;\n }\n }\n return false;\n }", "@Override\n public boolean connect(BluetoothDevice bluetoothDevice) throws RemoteException {\n Parcel parcel = Parcel.obtain();\n Parcel parcel2 = Parcel.obtain();\n try {\n parcel.writeInterfaceToken(Stub.DESCRIPTOR);\n boolean bl = true;\n if (bluetoothDevice != null) {\n parcel.writeInt(1);\n bluetoothDevice.writeToParcel(parcel, 0);\n } else {\n parcel.writeInt(0);\n }\n if (!this.mRemote.transact(8, parcel, parcel2, 0) && Stub.getDefaultImpl() != null) {\n bl = Stub.getDefaultImpl().connect(bluetoothDevice);\n parcel2.recycle();\n parcel.recycle();\n return bl;\n }\n parcel2.readException();\n int n = parcel2.readInt();\n if (n == 0) {\n bl = false;\n }\n parcel2.recycle();\n parcel.recycle();\n return bl;\n }\n catch (Throwable throwable) {\n parcel2.recycle();\n parcel.recycle();\n throw throwable;\n }\n }", "public void connectToAccessory() {\n\t\tif (mConnection != null)\n\t\t\treturn;\n\n\t\tif (getIntent().hasExtra(BTDeviceListActivity.EXTRA_DEVICE_ADDRESS)) {\n\t\t\tString address = getIntent().getStringExtra(\n\t\t\t\t\tBTDeviceListActivity.EXTRA_DEVICE_ADDRESS);\n\t\t\tLog.i(ADK.TAG, \"want to connect to \" + address);\n\t\t\tmConnection = new BTConnection(address);\n\t\t\tperformPostConnectionTasks();\n\t\t} else {\n\t\t\t// assume only one accessory (currently safe assumption)\n\t\t\tUsbAccessory[] accessories = mUSBManager.getAccessoryList();\n\t\t\tUsbAccessory accessory = (accessories == null ? null\n\t\t\t\t\t: accessories[0]);\n\t\t\tif (accessory != null) {\n\t\t\t\tif (mUSBManager.hasPermission(accessory)) {\n\t\t\t\t\topenAccessory(accessory);\n\t\t\t\t} else {\n\t\t\t\t\t// synchronized (mUsbReceiver) {\n\t\t\t\t\t// if (!mPermissionRequestPending) {\n\t\t\t\t\t// mUsbManager.requestPermission(accessory,\n\t\t\t\t\t// mPermissionIntent);\n\t\t\t\t\t// mPermissionRequestPending = true;\n\t\t\t\t\t// }\n\t\t\t\t\t// }\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Log.d(TAG, \"mAccessory is null\");\n\t\t\t}\n\t\t}\n\n\t}", "public boolean mBT_PickDevice2(){ //Will change sRemoteDeviceName\n if (oBTadapter==null) return false;\n bDevicePickerActive=true;\n oBTadapter.startDiscovery();\n {\n Intent intent = new Intent(\"android.bluetooth.devicepicker.action.LAUNCH\");\n mContext.startActivity(intent); //startActivityForResult\n }\n mSleep(1000);\n return true;\n }", "public void close() {\n btClose().push();\n }", "public void buttonClick_connect(View view)\n\t{\n\t\tAppSettings.showConnectionLost = false;\n\t\tLog.i(TAG, \"showConnectionLost = false\");\n\t\t\n\t\tAppSettings.bluetoothConnection = new BluetoothConnection(this.getApplicationContext(), this.btConnectionHandler);\n\t\tBluetoothAdapter btAdapter = AppSettings.bluetoothConnection.getBluetoothAdapter();\n\t\t\n\t\t// If the adapter is null, then Bluetooth is not supported\n if (btAdapter == null) {\n \tToast.makeText(getApplicationContext(), R.string.bt_not_available, Toast.LENGTH_LONG).show();\n }\n else {\n \t// If Bluetooth is not on, request that it be enabled.\n if (!btAdapter.isEnabled()) {\n Intent enableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(enableIntent, REQUEST_ENABLE_BT);\n }\n else {\n \t// Launch the DeviceListActivity to see devices and do scan\n Intent serverIntent = new Intent(getApplicationContext(), DeviceListActivity.class);\n startActivityForResult(serverIntent, REQUEST_CONNECT_DEVICE);\n }\n }\n\t}", "public Bluetooth(Context context, Logger logger)\n\t{\n\t\tthis.context = context;\n\t\tthis.logger = logger;\n\t\t//this.type = SensorType.Bluetooth;\n\t\tthis.isEnabled = false;\n\t\tthis.scanIntervalInSec = 0;\n\t\tthis.debugStatus = \"no status\";\n\t\tthis.bluetoothHandler = new Handler();\n\t\tthis.originalState = -1;\n\t\t\n // default setting\n changeSettings(type + FieldDelimiter + \"1\" + FieldDelimiter + \"10\");\n\t}", "@Override\n public void onClick(View control) {\n switch (control.getId()) {\n\n // Initiate bluetooth connection\n case R.id.connect:\n // Only make BT connection if device id was entered\n String id = deviceId.getText().toString();\n if (id.equals(\"\")) {\n Toast.makeText(getApplicationContext(), \"Enter the bluetooth receiver ID into the text field.\",\n Toast.LENGTH_SHORT).show();\n }\n else {\n connect(id);\n }\n break;\n\n // Stop the motors\n case R.id.stopMotors: {\n // Send stop message over bluetooth\n writeData(\"stop x\");\n break;\n }\n }\n }", "@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {\n mBluetoothAdapter.cancelDiscovery();\n\n Log.d(TAG, \"onItemClick: You Clicked on a device.\");\n String deviceName = mBTDevices.get(i).getName();\n String deviceAddress = mBTDevices.get(i).getAddress();\n\n Log.d(TAG, \"onItemClick: deviceName = \" + deviceName);\n Log.d(TAG, \"onItemClick: deviceAddress = \" + deviceAddress);\n\n //create the bond.\n //NOTE: Requires API 17+? I think this is JellyBean\n if(Build.VERSION.SDK_INT > Build.VERSION_CODES.JELLY_BEAN_MR2){\n Log.d(TAG, \"Trying to pair with \" + deviceName);\n mBTDevices.get(i).createBond();\n\n mBTDevice = mBTDevices.get(i);\n mBluetoothConnection = new BluetoothConnectionService(MainActivity.this);\n }\n }", "public boolean mConnect(String s) { //Find and mConnect to the bluetooth\n if (isBtOpen()==false)\n return false;\n if (isConnected(s))\n return true;\n if (bDevicePickerActive) return false; //Don't connect while picking device\n if (oDevice!=mBTDeviceByName(s)) mDisconnect();\n mDisconnect();\n oDevice=mBTDeviceByName(s);\n sDeviceName = s; //Set new device name\n oParent.mDeviceNameSet(s);\n if (mConnect2Device1(oDevice))\n return true;\n\n mStateSet(kBT_ConnectReq1);\n if (mBTOpen1()==false) { //If BT cannot be opened\n mStateSet(kBT_InvalidBT1);\n mErrMsg(\"No bluetooth port available\");\n return false;\n }\n if (mIsState(kBT_Connecting)) {\n mSleep(1000);\n if (oInput!=null)\n mStateSet(kBT_Connected1);\n else\n mStateSet(kBT_InvalidDevice1);\n return false;\n }\n if (oDevice==null) { //Device not found,\n oDevice=mBTDeviceByName(sDeviceName);\n if (oDevice==null){\n mStateSet(kBT_InvalidDevice1);\n mSleep(2000);\n }\n return false;\n }\n //set by mConnectDeviceWithName, mRequestConnection\n if (mIsState(kBT_ConnectReq1)) { //Try to connect first time\n if (mConnect2Device1(oDevice)==false) //mConnect sets mStateSet(kBT_DeviceConnected);\n mSleep(10);\n } else if (mIsState(cKonst.eSerial.kBT_BrokenConnection)) { //Try to reconnect\n mSleep(2000);\n bDoRedraw=true;\n return false;\n } else if (mIsState(kOverflow)){ //Fatal, overflow, donno what to do\n mConnectionStateClear();\n return false;\n } else {\n mSleep(2000); //Do nothing while connection was interrupted\n }\n return false;\n }", "public void closeConn(){\n if (null != this.mBTcomm){\n this.mBTcomm.closeConn();\n this.mBTcomm = null;\n }\n }", "@Override\r\n\t\tpublic void run() {\n\t\t\tLooper.prepare();\r\n\t\t\tbluetoothChat = new BluetoothChat(context);\r\n\t\t\tif (!BluetoothAdapter.checkBluetoothAddress(addr)) { // 检查蓝牙地址是否有效\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tBluetoothDevice device = bluetoothAdapter.getRemoteDevice(addr);\r\n\t\t\twhile (true) {\r\n\t\t\t\tif (count == LONG_TIME_CONNECTED) {\r\n\t\t\t\t\tLooper.loop();\r\n\t\t\t\t}\r\n\t\t\t\tif (device.getBondState() != BluetoothDevice.BOND_BONDED) {\r\n\t\t\t\t\t// 如果未匹配,则继续执行\r\n\t\t\t\t\t// handler.postDelayed(runnable, 5000);\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tClsUtils.setPin(device.getClass(), device, pin); // 手机和蓝牙采集器配对\r\n\t\t\t\t\t\tClsUtils.createBond(device.getClass(), device);\r\n\t\t\t\t\t\tremoteDevice = device; // 配对完毕就把这个设备对象传给全局的remoteDevice\r\n\t\t\t\t\t\tThread.sleep(5000);\r\n\t\t\t\t\t\tcount++;\r\n\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// 赋值至全局\r\n\t\t\t\t\tremoteDevice = device;\r\n\t\t\t\t\t// 移除线程后立即连接\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tbluetoothChat.goConnect(device);\r\n\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t// TODO: handle exception\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tLooper.loop();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "public void onClick(View v) {\n mConnectedThread.write(\"1\"); // Send \"1\" via Bluetooth\n Toast.makeText(getBaseContext(), \"Turn on LED\", Toast.LENGTH_SHORT).show();\n }", "public void connect(View v) {\n turnOn(v);\n startActivity(new Intent(Settings.ACTION_BLUETOOTH_SETTINGS));\n Toast.makeText(getApplicationContext(), \"Select device\", Toast.LENGTH_LONG).show();\n System.err.println(bluetoothAdapter.getBondedDevices());\n }", "@Override\n\t\tpublic void onReceive(Context context, Intent intent) {\n\t\t\tSystem.out.println(\"Called onReceive\");\n\t\t\tString action = intent.getAction();\n\t\t\t//When a new device is found\n\t\t\ttry{\n\t\t\tif(action.equals(BluetoothDevice.ACTION_FOUND)) {\n\t\t\t\tSystem.out.println(\"Called ACTION_FOUND\");\n\t\t\t\tBluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);\n\t\t\t\tSystem.out.println(\"Device Name: \"+device.getName());\n\t\t\t\tSystem.out.println(\"Device Addr: \"+device.getAddress());\n\t\t\t\tname = device.getName();\n\t\t\t\taddress = device.getAddress();\n\t\t\t\t//BTArrayAdapter.add(device.getName() + \"\\n\" + device.getAddress());\n\t\t\t\t//BTArrayAdapter.notifyDataSetChanged();\n\t\t\t\t//System.out.println(BTArrayAdapter.getCount());\n\t\t\t\t//for (int i=1;i<=BTArrayAdapter.getCount();i++){\n\t\t\t\t//System.out.println(\"Contents of Array: \"+BTArrayAdapter.getItem(0));\n\t\t\t\t//}\n\t\t\t}\n\t\t\t}catch(Exception e){System.out.println(\"Exception in ACTION_FOUND: \"+e);\n\t\t\t}\n\t\t\tif(BluetoothAdapter.ACTION_DISCOVERY_FINISHED.equals(action)){\n\t\t\t\tSystem.out.println(\"Scanning Done...\");\n\t\t\t\tFile locationFileDir = Environment.getExternalStoragePublicDirectory(\"/cusp/health\");\n\t\t\t\tlocationFileDir.mkdirs();\n\t\t\t\t String locfilename = locationFileDir.getPath() + File.separator + \"Bid.txt\";\n\t\t\t\t File location = new File (locfilename);\n\t\t\t\t if (!locationFileDir.exists() && locationFileDir.mkdirs()) {\n\t\t\t\t\t\tSystem.out.println(\"Cannot create File/ Folder\");\n\t\t\t\t\t}\n\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\tSystem.out.println(\"Writing Device Information to file\");\n\t\t\t\t\t\t\tout = new PrintWriter(location);\n\t\t\t\t\t\t\tout.println(\"Name: \"+name);\n\t\t\t\t\t\t\tout.println(\"Address: \"+address);\n\t\t\t\t\t\t\tout.flush();\n\t\t\t\t\t\t out.close();\n\t\t\t\t\t\t System.out.println(\"Wrote to the file..!\");\n\t\t\t\t\t\t\t}catch(Exception e){System.out.println(\"Error Flushing to a File \" +e);}\n\t\t\t\t//myBluetoothAdapter.startDiscovery();\n\t\t\t\t//System.out.println(\"Scanning Again...\");\n\t\t\t\t//Toast.makeText(getApplicationContext(), \"Scanning Again...\", Toast.LENGTH_SHORT).show();\n\t\t\t}\n\t\t}", "private void connectToAdapter() {\n if (chosen) {\n BluetoothAdapter btAdapter = BluetoothAdapter.getDefaultAdapter();\n BluetoothDevice device = btAdapter.getRemoteDevice(deviceAddress);\n UUID uuid = UUID.fromString(\"00001101-0000-1000-8000-00805F9B34FB\");\n // creation and connection of a bluetooth socket\n try {\n BluetoothSocket socket = device.createInsecureRfcommSocketToServiceRecord(uuid);\n socket.connect();\n setBluetoothSocket(socket);\n connected = true;\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n connect.setText(\"Disconnect\");\n connect.setTextColor(Color.RED);\n }\n });\n } catch (IOException e) {\n Log.d(\"Exception\", \"Bluetooth IO Exception c\");\n connected = false;\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n Toast.makeText(currContext, R.string.cannotConnect, Toast.LENGTH_SHORT).show();\n connect.setText(\"Connect\");\n connect.setTextColor(Color.BLACK);\n mode.setEnabled(true);\n }\n });\n }\n }\n if (bluetoothSocket.getRemoteDevice().getAddress() != null)\n Log.d(TAG, \"Bluetooth connected\");\n Log.d(TAG, \"Device address: \" + bluetoothSocket.getRemoteDevice().getAddress());\n initializeCom();\n }", "public void startBluetooth(){\n mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();\n if (!mBluetoothAdapter.isEnabled()) {\n Intent btIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n //btIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(btIntent);\n }\n mBluetoothAdapter.startDiscovery();\n System.out.println(\"@ start\");\n IntentFilter filter = new IntentFilter(BluetoothDevice.ACTION_FOUND);\n getActivity().registerReceiver(mReceiver, filter);\n }", "@Override\n\t\tpublic void onClick(View v) {\n\t\t\tmsgText.setText(null);\n\t\t\tsendEdit.setText(null);\n\t\t\tif(sppConnected || devAddr == null)\n\t\t\t\treturn;\n\t\t\ttry{\n\t\t\t btSocket = btAdapt.getRemoteDevice(devAddr).createRfcommSocketToServiceRecord(uuid);\n\t\t\t btSocket.connect();\n\t\t\t Log.d(tag,\"BT_Socket connect\");\n\t\t\t synchronized (MainActivity.this) {\n\t\t\t\tif(sppConnected)\n\t\t\t\t\treturn;\n\t\t\t\tbtServerSocket.close();\n\t\t\t\tbtIn = btSocket.getInputStream();\n\t\t\t\tbtOut = btSocket.getOutputStream();\n\t\t\t\tconected();\n\t\t\t}\n\t\t\t Toast.makeText(MainActivity.this,\"藍牙裝置已開啟:\" + devAddr, Toast.LENGTH_LONG).show();\n\t\t\t}catch(IOException e){\n\t\t\t\te.printStackTrace();\n\t\t\t\tsppConnected =false;\n\t\t\t\ttry{\n\t\t\t\t\tbtSocket.close();\n\t\t\t\t}catch(IOException e1){\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n\t\t\t\tbtSocket = null;\n\t\t\t\tToast.makeText(MainActivity.this, \"連接異常\", Toast.LENGTH_SHORT).show();\n\t\t\t}\n\t\t}", "public void checkForBluetooth() {\n if (hasBluetoothSupport()) {\n ensureBluetoothEnabled();\n } else {\n showToast(\"Device does not support BlueTooth\");\n }\n }", "private void searchDeviceOrOpenBluetooth() {\n if (!BtUtil.isOpen(bluetoothAdapter)) {\n Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(enableBtIntent, OPEN_BLUETOOTH_REQUEST);\n } else {\n BtUtil.searchDevices(bluetoothAdapter);\n }\n }", "private boolean mConnect2Device1(BluetoothDevice oDevice1){\n mStateSet(kBT_Connecting); //Connecting to a server\n if (mIsAndroidDevice(oDevice1)) {\n if (mConnect2Device_Sub(UUID_ANDROID_INSECURE, oDevice1)) {\n mStateSet(kBT_Connected1);\n mMsgLog(\"ANDROID Connected: \" +oDevice1.getName());\n oDevice=oDevice1;\n return true;\n }\n } else if (mIsClassic(oDevice1)) { // Classic bluetoot device\n if ( mConnect2Device_Sub(UUID_LMDEVICE_INSECURE, oDevice1)) {\n mStateSet(kBT_Connected1);\n mMsgLog(9,\"Classic bluetooth Connected: \" +oDevice1.getName() );\n oDevice=oDevice1;\n return true;\n }\n }\n mMsgDebug(\"Could not connect\");\n // mBTClose1();\n return false;\n}", "protected void connectBluetooth(int i) {\n Intent intent = new Intent(this, MainActivity.class);\n // Try top 3 devices\n ArrayList<BluetoothDevice> devices = new ArrayList<>();\n// for (int i = 0; i < mScanResults.size() && i < 3; i++) {\n ScanInfo info = mScanResults.get(i);\n devices.add(mBtAdapter.getRemoteDevice(info.address)); //getRemoteDevice()返回相应的被指定蓝牙连接的远端设备。\n// }\n intent.putParcelableArrayListExtra(BluetoothDevice.EXTRA_DEVICE, devices);\n Log.i(TAG, \"Devices : \" + intent.putParcelableArrayListExtra(BluetoothDevice.EXTRA_DEVICE, devices));\n\n this.startActivity(intent);\n }", "private void turnOnBT() {\n\t\tIntent intent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n\t\tstartActivityForResult(intent, 1);\n\t}", "public BluetoothManager( Activity activity ) {\n\t\tmActivity = activity;\n\t\tmContext = activity;\n\t\tmPreferences = PreferenceManager.getDefaultSharedPreferences( mContext );\n\t\tmByteUtility = new ByteUtility();\n\t\tmDebugMsg = new DebugMsg();\n\t}", "private void enableBT() {\n if (bluetoothAdapter == null) {\n Log.e(LOG_TAG, \"Bluetooth is not supported\");\n } else if (!bluetoothAdapter.isEnabled()) {\n bluetoothAdapter.enable();\n }\n }", "@Override\r\n public void closeBluetoothConnection() {\n final Intent stopMessageParserService = new Intent(this, MessageParserService.class);\r\n this.stopService(stopMessageParserService);\r\n }", "void onStateChange(BluetoothService.BTState state);", "public void connect(String id) {\n // Android bluetooth API code\n BluetoothDevice device = null;\n try {\n device = mBluetoothAdapter.getRemoteDevice(id);\n mBluetoothAdapter.cancelDiscovery();\n }\n catch (Exception e) {\n // Show user error message\n // i.e. \"333 is not a valid bluetooth address\"\n Toast.makeText(getApplicationContext(), e.getMessage(),\n Toast.LENGTH_SHORT).show();\n }\n\n // If getRemoteDevice did not throw and device was set, connect to client\n // getRemoteDevice throws if its parameter is not a valid bluetooth address\n if (device != null) {\n try {\n btSocket = device.createRfcommSocketToServiceRecord(MY_UUID);\n btSocket.connect();\n Toast.makeText(getApplicationContext(), \"Connection made\",\n Toast.LENGTH_SHORT).show();\n connectedStatus.setText(R.string.connection_connected);\n } catch (IOException e) {\n try {\n btSocket.close();\n } catch (IOException e2) {\n Log.d(TAG, \"Unable to end the connection\");\n }\n Log.d(TAG, \"Socket creation failed\");\n }\n }\n }", "@Override\n public void run() {\n super.run();\n Log.i(TAG, \"BlueTooth Start\");\n _BluetoothAdapter = BluetoothAdapter.getDefaultAdapter();\n\n if (_BluetoothAdapter != null){\n if(!_BluetoothAdapter.isEnabled())\n _BluetoothAdapter.enable();\n else{\n _BluetoothDevice = _BluetoothAdapter.getRemoteDevice(strAddress_BT_UART);\n if (_BluetoothDevice != null){\n Log.i(TAG, \"Starting BtConnect\");\n BtConnect BC = new BtConnect(_BluetoothDevice);\n BC.start();\n }\n }\n }\n }", "@Override\r\n public void close(){\r\n if(!isOpened){\r\n log.warning(\"close(): not open\");\r\n return;\r\n }\r\n \r\n if(servoCommandWriter!=null) {\r\n// log.info(\"disabling all servos\");\r\n// disableAllServos();\r\n try{\r\n Thread.sleep(10);\r\n }catch(InterruptedException e){\r\n \r\n }\r\n servoCommandWriter.shutdownThread();\r\n }\r\n servoCommandWriter.close(); // unbinds pipes too\r\n if(gUsbIo!=null) gUsbIo.close();\r\n UsbIo.destroyDeviceList(gDevList);\r\n log.info(\"device closed\");\r\n errorString=null;\r\n isOpened=false;\r\n \r\n }", "private void CheckBtIsOn() {\n mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();\n\n if (!mBluetoothAdapter.isEnabled()) {\n Toast.makeText(getApplicationContext(), \"Bluetooth Disabled!\",\n Toast.LENGTH_SHORT).show();\n\n // Start activity to show bluetooth options\n Intent enableBtIntent = new Intent(mBluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);\n }\n }", "public void open_closeCommPort() {\n\t\tswitch (application.getMenuBar().getSerialPortIconSet()) {\n\t\tcase DeviceCommPort.ICON_SET_IMPORT_CLOSE:\n\t\t\timportDeviceData();\n\t\t\tbreak;\n\t\t\t\n\t\tcase DeviceCommPort.ICON_SET_START_STOP:\n\t\t\tthis.serialPort.isInterruptedByUser = true;\n\t\t\tbreak;\n\t\t}\n\t}", "private void ensureBluetoothEnabled() {\n if (!mBluetoothAdapter.isEnabled()) {\n Intent enableBtIntent = new Intent(\n BluetoothAdapter.ACTION_REQUEST_ENABLE);\n main.startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);\n } else {\n connectToBluetoothDevice(\"00:06:66:64:42:97\"); // Hard coded MAC of the BT-device.\n Log.i(tag, \"Connected to device!\");\n }\n }", "public boolean close() {\n BleMultiConnector bleMultiConnector = this.bleMultiConnector;\n this.bleMultiConnector = null;\n boolean result = bleMultiConnector != null && bleMultiConnector.close(address);\n if (result){\n address = null;\n }\n return result;\n }", "public synchronized BluetoothService getBluetoothService(){\n\t\treturn bluetoothService;\n\t}", "@Override\n //Shows error message and returns to main screen\n public void onDisconnect(BluetoothDevice device, String message)\n {\n Intent intent = new Intent(this, MainActivity.class);\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);\n startActivity(intent);\n }", "@Override\n public void onReceive(Context context, Intent intent) {\n if (intent.getAction().equals(ACTION_USB_PERMISSION)) {\n boolean granted = intent.getExtras().getBoolean(UsbManager.EXTRA_PERMISSION_GRANTED);\n if (granted) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1) {\n connection = usbManager.openDevice(device);\n }\n serialPort = UsbSerialDevice.createUsbSerialDevice(device, connection);\n if (serialPort != null) {\n if (serialPort.open()) { //Set Serial Connection Parameters.\n serialPort.setBaudRate(115200); //was 9600\n serialPort.setDataBits(UsbSerialInterface.DATA_BITS_8);\n serialPort.setStopBits(UsbSerialInterface.STOP_BITS_1);\n serialPort.setParity(UsbSerialInterface.PARITY_NONE);\n serialPort.setFlowControl(UsbSerialInterface.FLOW_CONTROL_OFF);\n serialPort.read(mCallback);\n //tvAppend(textView,\"Serial Connection Opened!\\n\");\n\n } else {\n Log.d(\"SERIAL\", \"PORT NOT OPEN\");\n Toast.makeText(getParent(), \"port not open\", Toast.LENGTH_LONG).show();\n }\n } else {\n Log.d(\"SERIAL\", \"PORT IS NULL\");\n Toast.makeText(getParent(), \"port is NULL\", Toast.LENGTH_LONG).show();\n }\n } else {\n Log.d(\"SERIAL\", \"PERM NOT GRANTED\");\n Toast.makeText(getParent(), \"perm not granted\", Toast.LENGTH_LONG).show();\n }\n } else if (intent.getAction().equals(UsbManager.ACTION_USB_DEVICE_ATTACHED)) {\n //onClickStart(startButton);\n System.out.println(\"onclick start startbutton\");\n } else if (intent.getAction().equals(UsbManager.ACTION_USB_DEVICE_DETACHED)) {\n //onClickStop(stopButton);\n System.out.println(\"onclick stop stopbutton\");\n }\n }", "@Override\n public void onReceive(Context context, Intent intent) {\n if (intent.getAction().equals(ACTION_USB_PERMISSION)) {\n boolean granted = intent.getExtras().getBoolean(UsbManager.EXTRA_PERMISSION_GRANTED);\n if (granted) {\n connection = usbManager.openDevice(device);\n serialPort = UsbSerialDevice.createUsbSerialDevice(device, connection);\n if (serialPort != null) {\n if (serialPort.open()) { //Set Serial Connection Parameters.\n serialPort.setBaudRate(9600);\n serialPort.setDataBits(UsbSerialInterface.DATA_BITS_8);\n serialPort.setStopBits(UsbSerialInterface.STOP_BITS_1);\n serialPort.setParity(UsbSerialInterface.PARITY_NONE);\n serialPort.setFlowControl(UsbSerialInterface.FLOW_CONTROL_OFF);\n serialPort.read(mCallback);\n Toast.makeText(getApplication(), \"Serial Connection Opened!\", Toast.LENGTH_SHORT).show();\n\n } else {\n Log.d(\"SERIAL\", \"PORT NOT OPEN\");\n }\n } else {\n Log.d(\"SERIAL\", \"PORT IS NULL\");\n }\n } else {\n Log.d(\"SERIAL\", \"PERM NOT GRANTED\");\n }\n } else if (intent.getAction().equals(UsbManager.ACTION_USB_DEVICE_DETACHED)) {\n onClickStop(stopButton);\n }\n }", "private native int close0(int port, int handle, int deRegister);", "@Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.cancel();\n //回调搜索方式\n if (!bOpenDevice) {\n BluetoothComm.ScanDevice(DEVICE_ADDRESS_FILETER, 5, 1);\n if (!scan_progress.isShown()) {\n scan_progress.setVisibility(View.VISIBLE);\n }\n } else {\n showLogMessage(\"请先断开连接\");\n }\n }", "private void manageConnectedSocket(BluetoothSocket acceptSocket) {\n\n }", "private void setupBTService(){\n btService = new BluetoothService(this, mHandler);\n\n // Initialize the buffer for outgoing messages\n outStringBuffer = new StringBuffer(\"\");\n\t}", "public void onStart(){ \r\n\t\t//ensure bluetooth is enabled \r\n\t\tensureBluetoothIsEnabled();\r\n\t\tsuper.onStart(); \t\r\n\t}", "@Override\n public void onConnectionStateChange(BluetoothGatt gatt, int status,\n int newState) {\n Log.i(\"onConnectionStateChange\", \"The connection status has changed. status:\" + status + \" newState:\" + newState + \"\");\n try {\n if(status == BluetoothGatt.GATT_SUCCESS) {\n switch (newState) {\n // Has been connected to the device\n case BluetoothProfile.STATE_CONNECTED:\n Log.i(\"onConnectionStateChange\", \"Has been connected to the device\");\n if(_ConnectionStatus == ConnectionStatus.Connecting) {\n _ConnectionStatus = ConnectionStatus.Connected;\n try {\n if (_PeripheryBluetoothServiceCallBack != null)\n _PeripheryBluetoothServiceCallBack.OnConnected();\n if (gatt.getDevice().getBondState() == BluetoothDevice.BOND_BONDED){\n //Url : https://github.com/NordicSemiconductor/Android-DFU-Library/blob/release/dfu/src/main/java/no/nordicsemi/android/dfu/DfuBaseService.java\n Log.i(\"onConnectionStateChange\",\"Waiting 1600 ms for a possible Service Changed indication...\");\n // Connection successfully sleep 1600ms, the connection success rate will increase\n Thread.sleep(1600);\n }\n } catch (Exception e){}\n // Discover service\n gatt.discoverServices();\n }\n break;\n // The connection has been disconnected\n case BluetoothProfile.STATE_DISCONNECTED:\n Log.i(\"onConnectionStateChange\", \"The connection has been disconnected\");\n if(_ConnectionStatus == ConnectionStatus.Connected) {\n if (_PeripheryBluetoothServiceCallBack != null)\n _PeripheryBluetoothServiceCallBack.OnDisConnected();\n }\n Close();\n _ConnectionStatus = ConnectionStatus.DisConnected;\n break;\n /*case BluetoothProfile.STATE_CONNECTING:\n Log.i(\"onConnectionStateChange\", \"Connecting ...\");\n _ConnectionStatus = ConnectionStatus.Connecting;\n break;\n case BluetoothProfile.STATE_DISCONNECTING:\n Log.i(\"onConnectionStateChange\", \"Disconnecting ...\");\n _ConnectionStatus = ConnectionStatus.DisConnecting;\n break;*/\n default:\n Log.e(\"onConnectionStateChange\", \"newState:\" + newState);\n break;\n }\n }else {\n Log.i(\"onConnectionStateChange\", \"GATT error\");\n Close();\n if(_ConnectionStatus == ConnectionStatus.Connecting\n && _Timeout - (new Date().getTime() - _ConnectStartTime.getTime()) > 0) {\n Log.i(\"Connect\", \"Gatt Error! Try to reconnect (\"+_ConnectIndex+\")...\");\n _ConnectionStatus = ConnectionStatus.DisConnected;\n Connect(); // Connect\n }else {\n _ConnectionStatus = ConnectionStatus.DisConnected;\n if (_PeripheryBluetoothServiceCallBack != null)\n _PeripheryBluetoothServiceCallBack.OnDisConnected();\n }\n }\n }catch (Exception ex){\n Log.e(\"onConnectionStateChange\", ex.toString());\n }\n super.onConnectionStateChange(gatt, status, newState);\n }", "@Override\n public void onClick(View v) {\n if (mBluetoothAdapter.isEnabled()) {\n\n }\n }", "private void checkBleSupportAndInitialize() {\n Log.d(TAG, \"checkBleSupportAndInitialize: \");\n // Use this check to determine whether BLE is supported on the device.\n if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)) {\n Log.d(TAG,\"device_ble_not_supported \");\n Toast.makeText(this, R.string.device_ble_not_supported,Toast.LENGTH_SHORT).show();\n return;\n }\n // Initializes a Blue tooth adapter.\n final BluetoothManager bluetoothManager = (BluetoothManager) context.getSystemService(Context.BLUETOOTH_SERVICE);\n mBluetoothAdapter = bluetoothManager.getAdapter();\n\n if (mBluetoothAdapter == null) {\n // Device does not support Blue tooth\n Log.d(TAG, \"device_ble_not_supported \");\n Toast.makeText(this,R.string.device_ble_not_supported, Toast.LENGTH_SHORT).show();\n return;\n }\n\n //打开蓝牙\n if (!mBluetoothAdapter.isEnabled()) {\n Log.d(TAG, \"open bluetooth \");\n bluetoothUtils.openBluetooth();\n }\n }", "private void checkBTState() {\n\n if (btAdapter == null) {\n Toast.makeText(getBaseContext(), \"Device does not support bluetooth\", Toast.LENGTH_LONG).show();\n } else {\n if (btAdapter.isEnabled()) {\n } else {\n Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(enableBtIntent, 1);\n }\n }\n }", "public ABLLocalBTDevice BluetoothDevice() {\r\n\t\treturn new ABLLocalBTDevice(BrickFinder.getDefault().getBluetoothDevice());\r\n\t}", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n final BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();\n if (mBluetoothAdapter == null) {\n // Device does not support Bluetooth\n }\n\n if (!mBluetoothAdapter.isEnabled()) {\n Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);\n }\n\n BluetoothDevice mmDevice = null;\n\n List<String> mArray = new ArrayList<String>();\n Set<BluetoothDevice> pairedDevices = mBluetoothAdapter.getBondedDevices();\n // If there are paired devices\n if (pairedDevices.size() > 0) {\n // Loop through paired devices\n for (BluetoothDevice device : pairedDevices) {\n // Add the name and address to an array adapter to show in a ListView\n if(device.getName().equals(deviceName))\n mmDevice = device;\n mArray.add(device.getName() + \"\\n\" + device.getAddress());\n }\n }\n\n //Creating the socket.\n BluetoothSocket mmSocket;\n BluetoothSocket tmp = null;\n\n UUID myUUID = UUID.fromString(mUUID);\n try {\n // MY_UUID is the app's UUID string, also used by the server code\n tmp = mmDevice.createRfcommSocketToServiceRecord(myUUID);\n } catch (IOException e) { }\n mmSocket = tmp;\n\n //socket created, try to connect\n\n try {\n mmSocket.connect();\n } catch (IOException e) {\n e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.\n }\n\n // Run the example\n JArduino arduino = new BlinkAndAnalog(mmSocket);\n arduino.runArduinoProcess();\n\n Log.i(TAG, \"onCreate\");\n setContentView(R.layout.main);\n }", "private void connect() throws Exception {\n\n Log.i(TAG, \"Attempting connection to \" + address + \"...\");\n\n // Get this device's Bluetooth adapter\n BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();\n if ((adapter == null) || (!adapter.isEnabled())){\n throw new Exception(\"Bluetooth adapter not found or not enabled!\");\n }\n\n // Find the remote device\n BluetoothDevice remoteDevice = adapter.getRemoteDevice(address);\n\n // Create a socket with the remote device using this protocol\n socket = remoteDevice.createRfcommSocketToServiceRecord(uuid);\n\n // Make sure Bluetooth adapter is not in discovery mode\n adapter.cancelDiscovery();\n\n // Connect to the socket\n socket.connect();\n\n\n // Get input and output streams from the socket\n outStream = socket.getOutputStream();\n inStream = socket.getInputStream();\n\n Log.i(TAG, \"Connected successfully to \" + address + \".\");\n }", "public void onCreate(Bundle savedInstanceState)\n {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.main);\n \n Button launchMaster = (Button) findViewById(R.id.launchMaster);\n Button launchSlave = (Button) findViewById(R.id.LaunchSlave);\n \n launchMaster.setOnClickListener(new OnClickListener() \n {\n public void onClick(View v) \n {\n \tlaunchMaster();\n }\n }); \n \n launchSlave.setOnClickListener(new OnClickListener()\n {\n \tpublic void onClick(View v)\n \t{\n \t\tlaunchSlave();\n \t}\n });\n \n mAdapter = BluetoothAdapter.getDefaultAdapter();\n if (mAdapter == null)\n {\n Toast.makeText(this, \"Bluetooth is not available!\", Toast.LENGTH_LONG).show();\n finish();\n return;\n }\n \n Intent discoverableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);\n discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 300);\n startActivity(discoverableIntent);\n \n Master m = new Master();\n t = (TextView) findViewById(R.id.textbox);\n m.setText(t);\n m.init();\n \n \n //t = (TextView) findViewById(R.id.textbox);\n \n \n /* Make a BluetoothAdapter */\n\t\t/*\n BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();\n\t\tif (mBluetoothAdapter != null) {\n\t\t t.setText(\"SUCCESS\");\n\t\t}\n\t\t*/\n\t\t/* See if Bluetooth is enabled */\n\t\t/*\n if (!mBluetoothAdapter.isEnabled()) {\n\t\t Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n\t\t startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);\n\t\t t.setText(\"SUCCESS + ENABLED BLUETOOTH\");\n\t\t}\n\t\telse\n\t\t{\n\t\t t.setText(\"SUCCESS + BLUETOOTH ALREADY ENABLED\");\n\t\t}\n\t\t*/\n\t\t\n /*\n\t\tSet<BluetoothDevice> pairedDevices = mBluetoothAdapter.getBondedDevices();\n\t\t// If there are paired devices\n\t\tif (pairedDevices.size() > 0) \n\t\t{\n\t\t // Loop through paired devices\n\t\t for (BluetoothDevice device : pairedDevices) \n\t\t {\n\t\t \tt.setText(device.getName() + \": \" + device.getAddress());\n\t\t }\n\t\t}\n\t\t*/\n\t\t\n\t\t/* \n\t\t// Create a BroadcastReceiver for ACTION_FOUND\n\t\tfinal BroadcastReceiver mReceiver = new BroadcastReceiver() {\n\t\t public void onReceive(Context context, Intent intent) {\n\t\t String action = intent.getAction();\n\t\t // When discovery finds a device\n\t\t if (BluetoothDevice.ACTION_FOUND.equals(action)) {\n\t\t // Get the BluetoothDevice object from the Intent\n\t\t BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);\n\t\t // Add the name and address to an array adapter to show in a ListView\n\t\t all += device.getName() + \": \" + device.getAddress() + \"\\n\";\n\t\t t.setText(all);\n\t\t }\n\t\t }\n\t\t};\n\t\t// Register the BroadcastReceiver\n\t\tIntentFilter filter = new IntentFilter(BluetoothDevice.ACTION_FOUND);\n\t\tregisterReceiver(mReceiver, filter); // Don't forget to unregister during onDestroy\n\t\t\n\t\t \n\t\tmBluetoothAdapter.startDiscovery();\n\t\tall = \"\";\n\t\t*/\n }" ]
[ "0.6927677", "0.6726581", "0.67158747", "0.66386575", "0.66002387", "0.6519066", "0.6384403", "0.636805", "0.6358887", "0.63149416", "0.6271995", "0.625991", "0.62261355", "0.62142414", "0.6183887", "0.61396176", "0.61104983", "0.6085862", "0.6077763", "0.6075762", "0.6051443", "0.60375625", "0.6030893", "0.6030138", "0.60203415", "0.59826493", "0.59365153", "0.59324557", "0.58825487", "0.58784497", "0.58764964", "0.5870606", "0.58642566", "0.58608013", "0.5855712", "0.58349246", "0.5827409", "0.5809792", "0.5798065", "0.579144", "0.57807386", "0.57758003", "0.57549995", "0.57387555", "0.57348704", "0.5733908", "0.57330203", "0.5725464", "0.5716938", "0.5706103", "0.5704382", "0.5700324", "0.5678832", "0.5669297", "0.5665444", "0.5661896", "0.56373644", "0.56360835", "0.56302893", "0.5619095", "0.5616148", "0.5612625", "0.5610406", "0.5608783", "0.56087464", "0.5600458", "0.5599221", "0.5597583", "0.5591975", "0.5585644", "0.5583944", "0.5583224", "0.5556277", "0.55526173", "0.55373305", "0.55256534", "0.55234617", "0.552218", "0.5483042", "0.5480805", "0.54768884", "0.54574", "0.54469377", "0.54398984", "0.5430867", "0.54281604", "0.5428155", "0.54249054", "0.54208356", "0.54190344", "0.5417901", "0.5415681", "0.540977", "0.540709", "0.5404962", "0.5398043", "0.5393367", "0.5382543", "0.5380578", "0.5380327" ]
0.5578073
72
/ Open and close wifi
public S<T> wifi(Boolean enable){ WifiManager wifi = (WifiManager) activity.getSystemService(Context.WIFI_SERVICE); boolean isEnabled = wifi.isWifiEnabled(); if (enable && !isEnabled) { wifi.setWifiEnabled(true); } else if(!enable && isEnabled) { wifi.setWifiEnabled(false); } return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void disconnectWifi() {\n assertTrue(\"Wifi not disconnected\", mWifiManager.disconnect());\n mWifiManager.disableNetwork(mWifiManager.getConnectionInfo().getNetworkId());\n mWifiManager.saveConfiguration();\n }", "void closeNetwork();", "@Override\r\n public boolean disconnectWifi() {\r\n nwmDevice.getDevice().Disconnect();\r\n return true;\r\n }", "public void stopNetwork();", "public interface Wifi {\n\n\t/**\n\t * Activar el WIFI\n\t */\n\tpublic void activarWifi();\n\t/**\n\t * Desactivar el WIFI\n\t */\n\tpublic void desactivarWifi();\n\t/**\n\t * Verificar si estamos en modo avion\n\t * @return\n\t */\n\tpublic boolean estaEnModoAvion();\n\t\n}", "public void connectWiFi() {\n\n // Agrego la red para poder conectarme\n conf.networkId = wifi.addNetwork(conf);\n if (conf.networkId == -1) {\n Log.i(\"#FSEM# SERVICE\", \"Fallo addNetwork\");\n return;\n }\n\n // Receiver para cambio de estado de WIFI\n IntentFilter intentFilter = new IntentFilter(WifiManager.NETWORK_STATE_CHANGED_ACTION);\n intentFilter.addAction(WifiManager.SUPPLICANT_CONNECTION_CHANGE_ACTION);\n\n context.registerReceiver(this, intentFilter);\n\n // Mientras haya otra conexión con algun semaforo, espero a que se termine.\n while (SemComunication.staticState == StaticState.CONECTADO) {\n Log.i(\"#FSEM# SERVICE\", \"Me quiero conectar a \" + this.conf.SSID\n + \", pero sigue conectado a otro semaforo: \" + SemComunication.currentSSID);\n // Obligo a desconectarse.\n wifi.disconnect();\n SystemClock.sleep(1000);\n }\n\n // Me conecto con la red que quiero, y cuando lo logre\n // se ejecuta el receiver anterior\n wifi.disconnect();\n Log.i(\"#FSEM# SERVICE\", \"Me intento conectar con \" + (this.SSID));\n wifi.enableNetwork(this.conf.networkId, true);\n wifi.reconnect();\n SemComunication.staticState = StaticState.CONECTADO;\n SemComunication.networkId = this.conf.networkId;\n SemComunication.currentSSID = this.SSID;\n }", "private void checkWifi() {\n\t\tConnectivityManager manger = (ConnectivityManager) context\n\t\t\t\t.getSystemService(Context.CONNECTIVITY_SERVICE);\n\t\tNetworkInfo info = manger.getActiveNetworkInfo();\n\t\tboolean flag = (info != null && info.isConnected());\n\t\tif (!flag) {\n\t\t\tToast.makeText(context, R.string.communication, Toast.LENGTH_LONG)\n\t\t\t\t\t.show();\n\t\t\tnew Handler().postDelayed(new Runnable() {\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tcheckWifi();\n\t\t\t\t}\n\t\t\t}, 4000);\n\t\t} else {\n\t\t\tRegisterActivity.REGISTER_FLAG = true;\n\t\t}\n\t}", "@Override\n public void onDestroy() {\n super.onDestroy();\n\t\tmboolWifiTest = true;\n\t\t\n\t\tLog.i(\"pss\",\"ondestroy!\");\n\t\tList<WifiConfiguration> listconfig = mWifiAdmin.getConfiguration();\n\t\tif(listconfig != null){\n\t\t\tfor(int i = 0; i < listconfig.size();i++){\n\t\t\t\tmWifiAdmin.forget(listconfig.get(i).networkId);\n\t\t\t}\n\t\t}\n\t\t\n\t\tSharedPreferences sp = mContext.getSharedPreferences(\n SHAREPREFERCES_NAME, Context.MODE_PRIVATE);\n\t\tif (!sp.getBoolean(\"wifistate\", false)) {\n\t\t\tmWifiAdmin.closeWifi();\n\t\t}else{\n\t\t\tmWifiAdmin.openWifi();\n\t\t}\n }", "private void ConnectWifi(String ssid, String password) {\n\n WifiManager wifiManager = (WifiManager)getApplicationContext().getSystemService(Context.WIFI_SERVICE);\n\n WifiConfiguration wifiConfiguration = new WifiConfiguration();\n wifiConfiguration.SSID = \"\\\"\" + ssid + \"\\\"\";\n wifiConfiguration.preSharedKey = \"\\\"\" + password + \"\\\"\";\n\n wifiManager.addNetwork(wifiConfiguration);\n\n List<WifiConfiguration> list = wifiManager.getConfiguredNetworks();\n for( WifiConfiguration i : list ) {\n if(i.SSID != null && i.SSID.equals(\"\\\"\" + ssid + \"\\\"\")) {\n\n wifiManager.disconnect();\n wifiManager.enableNetwork(i.networkId, true);\n netId = i.networkId;\n wifiManager.reconnect();\n\n break;\n }\n }\n\n\n }", "public void turnOnWifi() {\n WifiManager wifi = (WifiManager) getActivity().getApplicationContext().getSystemService(Context.WIFI_SERVICE);\n wifi.setWifiEnabled(true);\n showScanWifiAround();\n }", "@Test(priority = 2)\n\tpublic void WifiOperation() throws Exception {\n\t\t\n\t\tdriver = DashboardPage.clickWifi(driver);\n\t\t\n\t\t//ExcelUtils.setCellData(\"PASS\", 3, 1);\n\t}", "@Override\n\t\t\tpublic void onClick(View v)\n\t\t\t{\n\n\t\t\t\tmWifiAdmin = new WifiAdmin(context)\n\t\t\t\t{\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void myUnregisterReceiver(BroadcastReceiver receiver)\n\t\t\t\t\t{\n\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\tunregisterReceiver(receiver);\n\t\t\t\t\t}\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic Intent myRegisterReceiver(BroadcastReceiver receiver, IntentFilter filter)\n\t\t\t\t\t{\n\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\tregisterReceiver(receiver, filter);\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onNotifyWifiConnected()\n\t\t\t\t\t{\n\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\tLog.v(TAG, \"have connected success!\");\n\t\t\t\t\t\tLog.v(TAG, \"###############################\");\n\t\t\t\t\t}\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onNotifyWifiConnectFailed()\n\t\t\t\t\t{\n\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\tLog.v(TAG, \"have connected failed!\");\n\t\t\t\t\t\tLog.v(TAG, \"###############################\");\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tmWifiAdmin.openWifi();\n\t\t\t\t// 连的WIFI热点是用WPA方式保护\n\t\t\t\tmWifiAdmin.addNetwork(mWifiAdmin.createWifiInfo(Constant.HOST_SPOT_SSID, Constant.HOST_SPOT_PASS_WORD, WifiAdmin.TYPE_WPA));\n\t\t\t}", "@LargeTest\n public void testWifiConnection() throws InterruptedException {\n // Wifi is already connected as part of tradefed device setup, assert that\n assertTrue(\"Wifi should be connected\", isWifiConnected());\n assertNotNull(\"Wifi manager is null\", mWifiManager);\n assertTrue(\"Wifi isn't enabled\", mWifiManager.isWifiEnabled());\n // Disconnect wifi and disable network, save NetId to be used for re-enabling network\n int netId = mWifiManager.getConnectionInfo().getNetworkId();\n disconnectWifi();\n Log.d(\"MyTestTag\", \"before sleep\");\n Thread.sleep(mABvtHelper.LONG_TIMEOUT);\n Log.d(\"MyTestTag\", \"after sleep\");\n assertFalse(\"Wifi shouldn't be connected\", isWifiConnected());\n // Network enabled successfully\n assertTrue(\"Network isn't enabled\", mWifiManager.enableNetwork(netId, true));\n // Allow time to settle down\n Thread.sleep(mABvtHelper.LONG_TIMEOUT * 2);\n assertTrue(\"Wifi should be connected\", isWifiConnected());\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tWifiManager wm=(WifiManager)getSystemService(WIFI_SERVICE);\n\t\t\t\tif(wm.isWifiEnabled())\n\t\t\t\t{\n\t\t\t\t\tToast.makeText(MainActivity.this,\"WIFI:ON\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\tWifiInfo wi=wm.getConnectionInfo();\n\t\t\t\t\tif(wi.getNetworkId()==-1)\n\t\t\t\t\t{\n\t\t\t\t\t\tToast.makeText(MainActivity.this,\"WIFI IS NOT CONNECT TO ANY DEVICE\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tToast.makeText(MainActivity.this,\"WIFI IS CONNECTED\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tToast.makeText(getApplicationContext(), \"WIFI IS OFF\", Toast.LENGTH_SHORT).show();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}", "public static void disableWifi(Context context) {\n WifiManager wm = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);\n if (wm.isWifiEnabled()) {\n wm.setWifiEnabled(false);\n }\n }", "public boolean connectTo(String bssid){\n WifiConfiguration newWc = new WifiConfiguration();\n //mBSSID = bssid;\n newWc.BSSID = bssid;\n newWc.SSID = mSSID;\n newWc.preSharedKey = mActiveConfiguration.preSharedKey;\n newWc.hiddenSSID = mActiveConfiguration.hiddenSSID;\n newWc.status = WifiConfiguration.Status.ENABLED;\n newWc.allowedAuthAlgorithms = mActiveConfiguration.allowedAuthAlgorithms;\n newWc.allowedGroupCiphers = mActiveConfiguration.allowedGroupCiphers;\n newWc.allowedKeyManagement = mActiveConfiguration.allowedKeyManagement;\n newWc.allowedPairwiseCiphers = mActiveConfiguration.allowedPairwiseCiphers;\n newWc.allowedProtocols = mActiveConfiguration.allowedProtocols;\n newWc.wepKeys = mActiveConfiguration.wepKeys;\n newWc.wepTxKeyIndex = mActiveConfiguration.wepTxKeyIndex;\n if(Build.VERSION.SDK_INT >= 18) {\n newWc.enterpriseConfig = mActiveConfiguration.enterpriseConfig;\n }\n if(Build.VERSION.SDK_INT >= 23) {\n newWc.roamingConsortiumIds = mActiveConfiguration.roamingConsortiumIds;\n newWc.providerFriendlyName = mActiveConfiguration.providerFriendlyName;\n }\n\n //int netId = mWifiManager.addNetwork(newWc);\n //Log.d(TAG, \"Added network w/ id \" + netId);\n //mWifiManager.disconnect();\n //return mWifiManager.enableNetwork(netId, true);\n //return mWifiManager.reconnect();\n\n return false;\n\n }", "private void forgetWifi(Wifi wifi) {\n int netId = -1;\n\n // Check if this network is known\n for (WifiConfiguration conf : wifiManager.getConfiguredNetworks()) {\n if (conf.SSID.equals(String.format(\"\\\"%s\\\"\", wifi.getSsid()))) {\n netId = conf.networkId;\n break;\n }\n }\n\n if (netId != -1) {\n int networkId = wifiManager.getConnectionInfo().getNetworkId();\n Log.d(\"WifiDetail\", wifiManager.removeNetwork(networkId)+ \"\");\n wifiManager.saveConfiguration();\n DataSource.forgetWifi(getApplicationContext(), wifiData);\n }\n }", "@ReactMethod\n public void forceWifiUsage(boolean useWifi) {\n boolean canWriteFlag = false;\n\n if (useWifi) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n canWriteFlag = Settings.System.canWrite(context);\n\n if (!canWriteFlag) {\n Intent intent = new Intent(Settings.ACTION_MANAGE_WRITE_SETTINGS);\n intent.setData(Uri.parse(\"package:\" + context.getPackageName()));\n intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n\n context.startActivity(intent);\n }\n }\n\n\n if (((Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) && canWriteFlag) || ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) && !(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M))) {\n final ConnectivityManager manager = (ConnectivityManager) context\n .getSystemService(Context.CONNECTIVITY_SERVICE);\n NetworkRequest.Builder builder;\n builder = new NetworkRequest.Builder();\n //set the transport type to WIFI\n builder.addTransportType(NetworkCapabilities.TRANSPORT_WIFI);\n\n\n manager.requestNetwork(builder.build(), new ConnectivityManager.NetworkCallback() {\n @Override\n public void onAvailable(@NonNull final Network network) {\n // FIXME: should this be try catch?\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n manager.bindProcessToNetwork(network);\n } else {\n //This method was deprecated in API level 23\n ConnectivityManager.setProcessDefaultNetwork(network);\n }\n manager.unregisterNetworkCallback(this);\n }\n });\n }\n\n\n }\n } else {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n ConnectivityManager manager = (ConnectivityManager) context\n .getSystemService(Context.CONNECTIVITY_SERVICE);\n manager.bindProcessToNetwork(null);\n } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n ConnectivityManager.setProcessDefaultNetwork(null);\n }\n }\n }", "public static void setWifiOn(boolean isOn) {\n Settings.Secure.putInt(Robolectric.application.getContentResolver(), Settings.Secure.WIFI_ON, isOn ? 1 : 0);\n }", "protected void CloseInstrument() \n throws IOException {\n\n // log\n m_Logger.log(Level.FINE, \"Closing connection to the Instrument at address {0}.\\n\", Integer.toString(m_GPIB_Adr));\n\n // Take controller offline\n if (USE_4882 == true) {\n short[] dummy = {(short)m_GPIB_Adr};\n m_gpib32.EnableLocal(BOARD_NR, dummy);\n \n } else {\n // second argument is 0\n m_gpib32.ibonl(m_UnitDescriptor, 0);\n }\n\n // check for errors\n String str = \"Could not enable local mode when closing the connection to the instrument\\n\";\n checkErrorGPIB(str, false);\n\n }", "public static void enableWifi(Context context) {\n WifiManager wm = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);\n if (!wm.isWifiEnabled()) {\n wm.setWifiEnabled(true);\n }\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\n\t\t\t\t\t if(!wfmgr.isWifiEnabled()){\n\t\t\t\t\t\t \n\t\t\t\t\t\t Toast.makeText(getApplicationContext(), \"Wifi is disable plz able to wifi\", Toast.LENGTH_SHORT).show();\n\t\t\t\t \t\n\t\t\t\t }else{ \n\t\t\t\t \t\n\t\t\t\t \t\tsearchingWifi();\n\t\t \n\t\t \n\t\t \n\t\t\t\t }\n\n\t\t\t}", "public void shutdownNetwork() {\r\n networkPlayer.stop();\r\n }", "public void wifiState(Context context, Intent intent) {\n switch (intent.getIntExtra(\"wifi_state\", 0)) {\n case 1:\n LogUtil.d(Tag, \"Wifi State: Disabled\");\n return;\n case 3:\n LogUtil.d(Tag, \"Wifi State: Enabled\");\n MsgHandlerCenter.dispatchMessageDelay((int) CommonParams.fq, 1000);\n return;\n default:\n return;\n }\n }", "@LargeTest\n @Suppress\n public void testWifiTetheringDisableEnable() throws InterruptedException {\n WifiConfiguration config = new WifiConfiguration();\n config.SSID = NETWORK_ID;\n config.allowedKeyManagement.set(KeyMgmt.WPA_PSK);\n config.allowedAuthAlgorithms.set(AuthAlgorithm.OPEN);\n config.preSharedKey = PASSWD;\n int counter;\n try {\n // disable wifiap\n assertTrue(\"wifi hotspot not disabled by default\",\n mWifiManager.getWifiApState() == WifiManager.WIFI_AP_STATE_DISABLED);\n // Enable wifiap\n assertTrue(\"failed to disable wifi hotspot\",\n mWifiManager.setWifiApEnabled(config, true));\n Log.d(\"MyTestTag\", \"Now checkign wifi ap\");\n counter = 10;\n while (--counter > 0\n && mWifiManager.getWifiApState() != WifiManager.WIFI_AP_STATE_ENABLED) {\n Thread.sleep(mABvtHelper.SHORT_TIMEOUT);\n }\n assertTrue(\"wifi hotspot not enabled\",\n mWifiManager.getWifiApState() == WifiManager.WIFI_AP_STATE_ENABLED);\n // Navigate to Wireless Settings page and verify Wifi AP setting is on\n Intent intent_as = new Intent(\n android.provider.Settings.ACTION_WIRELESS_SETTINGS);\n mContext.startActivity(intent_as);\n Thread.sleep(mABvtHelper.LONG_TIMEOUT);\n mDevice.wait(Until.findObject(By.text(\"Tethering & portable hotspot\")),\n mABvtHelper.LONG_TIMEOUT).click();\n Thread.sleep(mABvtHelper.SHORT_TIMEOUT);\n assertTrue(\"Settings UI for Wifi AP is not ON\",\n mDevice.wait(Until.hasObject(By.text(\"Portable hotspot AndroidAP active\")),\n mABvtHelper.LONG_TIMEOUT));\n\n mDevice.wait(Until.findObject(By.text(\"Portable Wi‑Fi hotspot\")),\n mABvtHelper.LONG_TIMEOUT).click();\n assertTrue(\"Wifi ap disable call fails\", mWifiManager.setWifiApEnabled(config,\n false));\n counter = 5;\n while (--counter > 0\n && mWifiManager.getWifiApState() != WifiManager.WIFI_AP_STATE_DISABLED) {\n Thread.sleep(mABvtHelper.LONG_TIMEOUT);\n }\n assertTrue(\"wifi hotspot not enabled\",\n mWifiManager.getWifiApState() == WifiManager.WIFI_AP_STATE_DISABLED);\n Thread.sleep(mABvtHelper.LONG_TIMEOUT * 2);\n } finally {\n assertTrue(\"Wifi enable call fails\", mWifiManager\n .enableNetwork(mWifiManager.getConnectionInfo().getNetworkId(), false));\n counter = 10;\n while (--counter > 0 && !mWifiManager.isWifiEnabled()) {\n Thread.sleep(mABvtHelper.LONG_TIMEOUT);\n }\n assertTrue(\"Wifi isn't enabled\", mWifiManager.isWifiEnabled());\n }\n }", "protected void stopWifiScan() {\r\n\r\n //TERMINA LA SCANSIONE BLUETOOTH\r\n\t\thideWifiScanDialog();\r\n BeaconsMonitoringService.action.set(BeaconSession.SCANNING_OFF);\r\n\r\n /*\r\n\t\tif (wifiBroadcastReceiver != null) {\r\n\r\n\t\t\tWifiScanner.stopScanner(this, wifiBroadcastReceiver);\r\n\t\t\twifiBroadcastReceiver = null;\r\n\r\n\t\t}\r\n\t\t// stop scan\r\n\t\t// oh, wait, we can't stop the scan, it's asynchronous!\r\n\t\t// we just have to ignore the result!\r\n\t\tignoreWifiResults = true;\r\n */\r\n\t}", "@Override\n public void onCreate() {\n\n wifiManager=(WifiManager)getApplicationContext().getSystemService(Context.WIFI_SERVICE);\n if(wifiManager.isWifiEnabled())\n {\n wifiManager.setWifiEnabled(false);\n }\n Method[] wmMethods = wifiManager.getClass().getDeclaredMethods(); //Get all declared methods in WifiManager class\n boolean methodFound=false;\n for(Method method: wmMethods)\n {\n if(method.getName().equals(\"setWifiApEnabled\"))\n {\n methodFound=true;\n WifiConfiguration netConfig = new WifiConfiguration();\n netConfig.SSID = \"SynMusic\";\n netConfig.allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.OPEN);\n netConfig.allowedProtocols.set(WifiConfiguration.Protocol.RSN);\n netConfig.allowedProtocols.set(WifiConfiguration.Protocol.WPA);\n netConfig.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);\n try {\n Method setWifiApMethod = wifiManager.getClass().getMethod(\"setWifiApEnabled\", WifiConfiguration.class, boolean.class);\n boolean apstatus=(Boolean) setWifiApMethod.invoke(wifiManager, netConfig,true);\n\n Method isWifiApEnabledmethod = wifiManager.getClass().getMethod(\"isWifiApEnabled\");\n while(!(Boolean)isWifiApEnabledmethod.invoke(wifiManager)){};\n Method getWifiApStateMethod = wifiManager.getClass().getMethod(\"getWifiApState\");\n int apstate=(Integer)getWifiApStateMethod.invoke(wifiManager);\n Method getWifiApConfigurationMethod = wifiManager.getClass().getMethod(\"getWifiApConfiguration\");\n netConfig=(WifiConfiguration)getWifiApConfigurationMethod.invoke(wifiManager);\n Log.e(\"CLIENT\", \"\\nSSID:\"+netConfig.SSID+\"\\nPassword:\"+netConfig.preSharedKey+\"\\n\");\n new Broadcast_Song().start();\n } catch (IllegalArgumentException e) {\n e.printStackTrace();\n Toast.makeText(getApplicationContext(),e.getMessage(),1).show();\n } catch (IllegalAccessException e) {\n e.printStackTrace();\n Toast.makeText(getApplicationContext(),e.getMessage(),1).show();\n } catch (Exception e) {\n e.printStackTrace();\n Toast.makeText(getApplicationContext(),e.getMessage(),1).show();\n }\n }\n }\n\n\n /*StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitNetwork().build();\n StrictMode.setThreadPolicy(policy);\n AudioManager audio = (AudioManager)getSystemService(AUDIO_SERVICE);\n audio.setMode(AudioManager.STREAM_MUSIC);\n AudioGroup audioGroup = new AudioGroup();\n audioGroup.setMode(AudioGroup.MODE_NORMAL);\n InetAddress inetAddress;\n try {\n inetAddress = InetAddress.getByName(\"192.168.43.1\");\n AudioStream audioStream = new AudioStream(inetAddress);\n audioStream.setCodec(AudioCodec.PCMU);\n audioStream.setMode(RtpStream.MODE_SEND_ONLY);\n InetAddress inetAddressRemote = InetAddress.getByName(\"192.168.43.1\");\n audioStream.associate(inetAddressRemote, 6000);\n //((TextView)findViewById(R.id.tv_port)).setText(\"Port : \" + String.valueOf(audioStream.getLocalPort()));\n audioStream.join(audioGroup);\n }\n catch ( UnknownHostException e ) {\n e.printStackTrace();\n }\n catch ( SocketException e ) {\n e.printStackTrace();\n }*/\n super.onCreate();\n seek= CreateGroup.seek;\n reciever=new BroadcastReceiver() {\n @Override\n public void onReceive(Context arg0, Intent arg1) {\n // TODO Auto-generated method stub\n\n String action=arg1.getAction();\n if(action.equals(\"com.example.musicplayer.play\"))\n {\n mp.start();\n control_functions(PLAY);\n }\n else if(action.equals(\"com.example.musicplayer.pause\"))\n {\n mp.pause();\n control_functions(PAUSE);\n }\n else if(action.equals(\"com.example.musicplayer.next\"))\n {\n try\n {\n String name=arg1.getStringExtra(\"name\");\n Uri uri = Uri.parse(name);//Environment.getExternalStorageDirectory().getPath()+\"/songs/\"+name);\n mp.reset();\n mp.setDataSource(arg0, uri);\n mp.setAudioStreamType(AudioManager.STREAM_MUSIC);\n mp.setLooping(true);\n mp.prepare();\n mp.start();seek.setMax(mp.getDuration());\n }catch (Exception e) {\n // TODO: handle exception\n }\n }\n else if(action.equals(\"com.example.musicplayer.previous\"))\n {\n try\n {\n String name=arg1.getStringExtra(\"name\");\n Uri uri = Uri.parse(name);//Environment.getExternalStorageDirectory().getPath()+\"/songs/\"+name);\n mp.reset();\n mp.setDataSource(arg0, uri);\n mp.setAudioStreamType(AudioManager.STREAM_MUSIC);\n mp.setLooping(true);\n mp.prepare();\n mp.start();\n seek.setMax(mp.getDuration());\n }catch (Exception e) {\n // TODO: handle exception\n }\n }\n\n else if(action.equals(\"com.example.musicplayer.frmList\"))\n {\n //Toast.makeText(SongService.this, \"previous\", 1).show();\n try\n {\n String name=arg1.getStringExtra(\"name\");\n Uri uri = Uri.parse(name);//Environment.getExternalStorageDirectory().getPath()+\"/songs/\"+name);\n filePath=uri.getPath();\n //Toast.makeText(getApplicationContext(),name,1).show();\n mp.reset();\n mp.setDataSource(arg0, uri);\n mp.setAudioStreamType(AudioManager.STREAM_MUSIC);\n mp.setLooping(true);\n mp.prepare();\n mp.start();\n seek.setMax(mp.getDuration());\n seek.setOnSeekBarChangeListener((SeekBar.OnSeekBarChangeListener) arg0);\n control_functions(NEW);\n new sendSong().execute();\n } catch (Exception e) {\n // TODO: handle exception\n }\n }\n else if(action.equals(\"com.example.musicplayer.frwd\"))\n {\n if(mp.getDuration()-mp.getCurrentPosition()>1250)\n {\n mp.seekTo(mp.getCurrentPosition()+1250);\n }\n else\n {\n mp.seekTo(mp.getDuration());\n }\n }\n else if(action.equals(\"com.example.musicplayer.rvrse\"))\n {\n if(mp.getCurrentPosition()>1250)\n {\n mp.seekTo(mp.getCurrentPosition()-1250);\n }\n else\n {\n mp.seekTo(0);\n }\n }\n else if(action.equals(\"com.example.musicplayer.jststarted\"))\n {\n if(mp.isPlaying())\n {\n CreateGroup.play_pause.setText(\"PAUSE\");\n }\n }\n else if(action.equals(\"com.example.musicplayer.seekBar\"))\n {\n seek=CreateGroup.seek;\n seek.setMax(mp.getDuration());\n seek.setOnSeekBarChangeListener((SeekBar.OnSeekBarChangeListener) arg0);\n //seek.setProgress(0);\n }\n else if(action.equals(\"com.example.musicplayer.addlist\"))\n {\n ArrayList<MusicData> list=arg1.getParcelableArrayListExtra(\"list\");\n }\n else if(action.equals(\"com.example.musicplayer.seekBarComp\"))\n {\n try\n {\n String name=arg1.getStringExtra(\"name\");\n Uri uri = Uri.parse(Environment.getExternalStorageDirectory().getPath()+\"/songs/\"+name);\n mp.reset();\n mp.setDataSource(arg0, uri);\n mp.setAudioStreamType(AudioManager.STREAM_MUSIC);\n mp.setLooping(true);\n mp.prepare();\n mp.start();seek.setMax(mp.getDuration());\n }catch (Exception e) {\n // TODO: handle exception\n }\n }\n }\n };\n IntentFilter intentfilter=new IntentFilter();\n intentfilter.addAction(\"com.example.musicplayer.addlist\");\n intentfilter.addAction(\"com.example.musicplayer.play\");\n intentfilter.addAction(\"com.example.musicplayer.pause\");\n intentfilter.addAction(\"com.example.musicplayer.pause\");\n intentfilter.addAction(\"com.example.musicplayer.next\");\n intentfilter.addAction(\"com.example.musicplayer.previous\");\n intentfilter.addAction(\"com.example.musicplayer.frmList\");\n intentfilter.addAction(\"com.example.musicplayer.frwd\");\n intentfilter.addAction(\"com.example.musicplayer.rvrse\");\n intentfilter.addAction(\"com.example.musicplayer.jststarted\");\n intentfilter.addAction(\"com.example.musicplayer.seekBar\");\n intentfilter.addAction(\"com.example.musicplayer.seekBarComp\");\n registerReceiver(reciever, intentfilter);\n\n }", "private void checkWIFI() {\n ConnectivityManager manager = (ConnectivityManager) \n getSystemService(MainActivity.CONNECTIVITY_SERVICE);\n boolean isWifi = manager.getNetworkInfo(\n ConnectivityManager.TYPE_WIFI).isConnected();\n if (isWifi) {\n // setup for credentials for connecting to the Google Drive account\n mCredential = GoogleAccountCredential.usingOAuth2(this, Arrays.asList(DriveScopes.DRIVE));\n // start activity that prompts the user for their google drive account\n startActivityForResult(mCredential.newChooseAccountIntent(), REQUEST_ACCOUNT_PICKER);\n } else {\n // alert user that wifi needs to be checked\n AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(DownloadActivity.this);\n alertDialogBuilder\n .setTitle(getString(R.string.check_wifi))\n .setCancelable(false)\n .setPositiveButton(getString(R.string.exit), new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog,int id) {\n // if this button is clicked, close current activity\n DownloadActivity.this.finish();\n }\n });\n\n AlertDialog alertDialog = alertDialogBuilder.create();\n alertDialog.show();\n }\n }", "private void connectToNetwork(final WifiNetworkInfo info){\n final String SSID = info.SSID;\n final WifiConfiguration conf = new WifiConfiguration();\n conf.SSID = SSID; //needs to be surrounded by quotations but should already be coming from a scan object\n if(info.secured){\n //prompt for password\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setPositiveButton(\"Connect\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n if(info.secured){\n EditText editText = (EditText)((AlertDialog)dialog).findViewById(R.id.wifi_password_edit_text);\n\n String password = editText.getText().toString();\n if(info.WEP) {\n WifiUtils.connectToWEPSecuredNetwork(SSID, password, manager);\n }\n else if(info.WPA || info.WPA2){\n WifiUtils.connectToWPASecuredNetwork(SSID, password, manager);\n }\n// might need a different case here but I think it probably is the same as WPA\n// else if(info.WPA2){\n//\n// }\n }\n else {\n WifiUtils.connectToOpenNetwork(SSID, manager);\n }\n }\n });\n\n// EditText passField = (EditText) dialog.findViewById(R.id.wifi_password_edit_text);\n// passField.getBackground().mutate().setColorFilter(getResources().getColor(R.color.Crimson), PorterDuff.Mode.SRC_ATOP);\n\n }\n else {\n conf.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);\n manager.addNetwork(conf);\n List<WifiConfiguration> list = manager.getConfiguredNetworks();\n for( WifiConfiguration i : list ) {\n if(i.SSID != null && i.SSID.equals(SSID)) {\n manager.disconnect();\n manager.enableNetwork(i.networkId, true);\n manager.reconnect();\n break;\n }\n }\n }\n }", "@Override\n\t public void onClick(DialogInterface dialog, int which) {\n\t wifi.setWifiEnabled(true);\n\t Toast.makeText(getApplicationContext(), \"enabling...\", Toast.LENGTH_LONG).show();\t\n\t }", "@Override\n public void onFailure(int reasonCode) {\n Toast.makeText(getApplicationContext(), \"Please turn on WiFi. Error Code \" + reasonCode,\n Toast.LENGTH_SHORT).show();\n }", "@Override\n\tpublic void configureWifi(String ssid, String pwd) throws RemoteException {\n\t model.execute(\"CONNECT\", ssid, pwd);\n\t}", "public void toggleWiFiAP(WifiManager wifihandler, Context context) {\n if (wifi==null){\n wifi = wifihandler;\n }\n\n boolean wifiApIsOn = getWifiAPState()==WIFI_AP_STATE_ENABLED || getWifiAPState()==WIFI_AP_STATE_ENABLING;\n }", "public static void closeHttpConn(){ \n\t\thttpUrl.disconnect(); \n\t}", "@SuppressLint(\"MissingPermission\")\n static void fillWifiConfigurationList(Context context/*, boolean enableWifi*/)\n {\n\n List<WifiSSIDData> wifiConfigurationList = new ArrayList<>();\n\n if (wifi == null)\n wifi = (WifiManager) context.getApplicationContext().getSystemService(Context.WIFI_SERVICE);\n if (wifi == null)\n return;\n\n //boolean wifiEnabled = false;\n if (wifi.getWifiState() != WifiManager.WIFI_STATE_ENABLED) {\n /*if (enableWifi) {\n try {\n wifiEnabled = true;\n wifi.setWifiEnabled(true);\n PPApplication.sleep(500);\n } catch (Exception e) {\n wifiEnabled = false;\n }\n }\n else*/\n // wifi must be enabled for wifi.getConfiguredNetworks()\n return;\n }\n\n List<WifiConfiguration> _wifiConfigurationList = null;\n if (Permissions.hasPermission(context, Manifest.permission.ACCESS_FINE_LOCATION))\n _wifiConfigurationList = wifi.getConfiguredNetworks();\n\n /*if (wifiEnabled) {\n try {\n wifi.setWifiEnabled(false);\n } catch (Exception ignored) {}\n }*/\n\n if (_wifiConfigurationList != null)\n {\n //wifiConfigurationList.clear();\n for (WifiConfiguration device : _wifiConfigurationList)\n {\n //noinspection deprecation\n if (device.SSID != null) {\n boolean found = false;\n for (WifiSSIDData _device : wifiConfigurationList) {\n //if (_device.bssid.equals(device.BSSID))\n //noinspection deprecation\n if ((_device.ssid != null) && (_device.ssid.equals(device.SSID))) {\n found = true;\n break;\n }\n }\n if (!found) {\n //noinspection deprecation\n wifiConfigurationList.add(new WifiSSIDData(device.SSID, /*device.BSSID,*/ false, true, false));\n }\n }\n }\n }\n saveWifiConfigurationList(context, wifiConfigurationList);\n }", "@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tSocket s = new Socket(ip,6969);\n\t\t\t\t\t\t\t\ts.close();\n\t\t\t\t\t\t\t\tconnection=true;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t catch (UnknownHostException e1) {\n\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\tLog.d(null, \"Wrong ip\");\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\t\t\t\tLog.d(null, \"Wrong ip\");\n\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}", "private void updateConnectedFlags() {\n ConnectivityManager connMgr =\n (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);\n\n NetworkInfo activeInfo = connMgr.getActiveNetworkInfo();\n if (activeInfo != null && activeInfo.isConnected()) {\n wifiConnected = activeInfo.getType() == ConnectivityManager.TYPE_WIFI;\n mobileConnected = activeInfo.getType() == ConnectivityManager.TYPE_MOBILE;\n } else {\n wifiConnected = false;\n mobileConnected = false;\n }\n wifiConnected = true;\n mobileConnected = true;\n System.out.println(\"Change 3\");\n }", "@SuppressLint(\"NewApi\")\n\tprivate void wpsConnection(String option, String bssid, String pin) {\n\t\tif (this.wifiManager == null)\n\t\t\treturn;\n\t\t// Setup WpsInfo\n\t\tWpsInfo wpsInfo = new WpsInfo();\n\t\tif (option.equals(\"PBC\")) {\n\t\t\twpsInfo.setup = WpsInfo.PBC;\n\t\t\tthis.wpsEditText.setText(\"\");\n\t\t\tthis.wpsEditText.setText(\"PBC\");\n\t\t\tthis.pinEditText.setText(\"\");\n\t\t} else if (option.equals(\"PIN\")) {\n\t\t\twpsInfo.setup = WpsInfo.DISPLAY;\n\t\t\tthis.wpsEditText.setText(\"\");\n\t\t\tthis.wpsEditText.setText(\"PIN Entry\");\n\t\t} else if (option.equals(\"PINKeyPad\")) {\n\t\t\tLog.i(TAG, \"Key Pad Mode.\");\n\t\t\twpsInfo.setup = WpsInfo.KEYPAD;\n\t\t\twpsInfo.pin = pin;\n\t\t\tField bssidField;\n\t\t\ttry {\n\t\t\t\tbssidField = wpsInfo.getClass().getField(\"BSSID\");\n\t\t\t\tbssidField.set(wpsInfo, bssid);\n\t\t\t} catch (NoSuchFieldException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (IllegalAccessException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (IllegalArgumentException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t} else\n\t\t\treturn;\n\t\t// Start WPS Connection\n\t\ttry {\n\t\t\tfinal Class<?> wifiManagerCls = Class\n\t\t\t\t\t.forName(ANDROID_NET_WIFI_WIFIMANAGER_PKG);\n\t\t\tClass<?> wpsListenerCls = Class.forName(WPS_LISTENER);\n\t\t\tfinal Method onStartSuccess = wpsListenerCls.getMethod(\n\t\t\t\t\t\"onStartSuccess\", String.class);\n\t\t\tfinal Method onCompletion = wpsListenerCls\n\t\t\t\t\t.getMethod(\"onCompletion\");\n\t\t\tfinal Method onFailure = wpsListenerCls.getMethod(\"onFailure\",\n\t\t\t\t\tint.class);\n\t\t\tthis.timer = new Timer(false);\n\t\t\tif (this.timerTask != null) {\n\t\t\t\tthis.timerTask.cancel();\n\t\t\t}\n\t\t\tthis.timerTask = new TimerTask() {\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\thandler.post(new Runnable() {\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\tprogressBar.incrementProgressBy(1);\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\tthis.progressBar.setMax(WPS_TIMEOUT_S);\n\t\t\tthis.progressBar.setProgress(0);\n\t\t\tthis.progressBar.setVisibility(View.VISIBLE);\n\t\t\tthis.timer.purge();\n\t\t\tthis.timer.schedule(this.timerTask, 1000, 1000);\n\t\t\tObject wpsListener = Proxy.newProxyInstance(\n\t\t\t\t\twpsListenerCls.getClassLoader(),\n\t\t\t\t\tnew Class<?>[] { wpsListenerCls }, new InvocationHandler() {\n\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic Object invoke(Object arg0, Method method,\n\t\t\t\t\t\t\t\tfinal Object[] arg2) throws Throwable {\n\t\t\t\t\t\t\tif (method.equals(onStartSuccess)) {\n\t\t\t\t\t\t\t\tif (arg2[0] != null) {\n\t\t\t\t\t\t\t\t\tLog.i(TAG, ((String) arg2[0]).toString());\n\t\t\t\t\t\t\t\t\trunOnUiThread(new Runnable() {\n\t\t\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\t\t\tpinEditText.setText(\"\");\n\t\t\t\t\t\t\t\t\t\t\tpinEditText\n\t\t\t\t\t\t\t\t\t\t\t\t\t.setText((CharSequence) arg2[0]);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\tString pin = (String)arg2[0];\n\t\t\t\t\t\t\t\t\t//bw.write(pin);\n\t\t\t\t\t\t\t\t\t//bw.flush();\n\t\t\t\t\t\t\t\t\tfw = new FileWriter(pinFile, false);\n\t\t\t\t\t\t\t\t\tfw.write(pin);\n\t\t\t\t\t\t\t\t\tfw.flush();\n\t\t\t\t\t\t\t\t\tfw.close();\n\t\t\t\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\t\t\t\tWifiWPSConnectActivity.this,\n\t\t\t\t\t\t\t\t\t\t\t\"PIN Entry: \"\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ (CharSequence) arg2[0],\n\t\t\t\t\t\t\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\trunOnUiThread(new Runnable() {\n\t\t\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\t\t\tpinEditText.setText(\"\");\n\t\t\t\t\t\t\t\t\t\t\tpinEditText.setText(\"No PIN Code\");\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\tToast.makeText(WifiWPSConnectActivity.this,\n\t\t\t\t\t\t\t\t\t\t\t\"WPS Start.\", Toast.LENGTH_LONG)\n\t\t\t\t\t\t\t\t\t\t\t.show();\n\t\t\t\t\t\t\t\t\tfw = new FileWriter(pinFile, false);\n\t\t\t\t\t\t\t\t\tfw.write(\"PBC\");\n\t\t\t\t\t\t\t\t\tfw.flush();\n\t\t\t\t\t\t\t\t\tfw.close();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (method.equals(onCompletion)) {\n\t\t\t\t\t\t\t\ttimer.cancel();\n\t\t\t\t\t\t\t\tprogressBar.setProgress(0);\n\t\t\t\t\t\t\t\tLog.i(TAG, \"WPS Connection Completed.\");\n\t\t\t\t\t\t\t\tToast.makeText(WifiWPSConnectActivity.this,\n\t\t\t\t\t\t\t\t\t\t\"WPS Connection Completed.\",\n\t\t\t\t\t\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (method.equals(onFailure)) {\n\t\t\t\t\t\t\t\ttimer.cancel();\n\t\t\t\t\t\t\t\tprogressBar.setProgress(0);\n\t\t\t\t\t\t\t\tint code = (Integer) arg2[0];\n\t\t\t\t\t\t\t\t/* Code 0 */\n\t\t\t\t\t\t\t\tField wpsError = wifiManagerCls\n\t\t\t\t\t\t\t\t\t\t.getField(\"ERROR\");\n\t\t\t\t\t\t\t\t/* Code 1 */\n\t\t\t\t\t\t\t\tField wpsInProgress = wifiManagerCls\n\t\t\t\t\t\t\t\t\t\t.getField(\"IN_PROGRESS\");\n\t\t\t\t\t\t\t\t/* Code 2 */\n\t\t\t\t\t\t\t\tField wpsBusy = wifiManagerCls.getField(\"BUSY\");\n\t\t\t\t\t\t\t\t/* Code 3 */\n\t\t\t\t\t\t\t\tField wpsOverlapError = wifiManagerCls\n\t\t\t\t\t\t\t\t\t\t.getField(\"WPS_OVERLAP_ERROR\");\n\t\t\t\t\t\t\t\t/* Code 4 */\n\t\t\t\t\t\t\t\tField wpsWepProhibitError = wifiManagerCls\n\t\t\t\t\t\t\t\t\t\t.getField(\"WPS_WEP_PROHIBITED\");\n\t\t\t\t\t\t\t\t/* Code 5 */\n\t\t\t\t\t\t\t\tField wpsTkipOnlyProhibitError = wifiManagerCls\n\t\t\t\t\t\t\t\t\t\t.getField(\"WPS_TKIP_ONLY_PROHIBITED\");\n\t\t\t\t\t\t\t\t/* Code 6 */\n\t\t\t\t\t\t\t\tField wpsAuthFailError = wifiManagerCls\n\t\t\t\t\t\t\t\t\t\t.getField(\"WPS_AUTH_FAILURE\");\n\t\t\t\t\t\t\t\t/* Code 7 */\n\t\t\t\t\t\t\t\tField wpsTimedOutError = wifiManagerCls\n\t\t\t\t\t\t\t\t\t\t.getField(\"WPS_TIMED_OUT\");\n\t\t\t\t\t\t\t\tif (code == wpsError.getInt(null)) {\n\t\t\t\t\t\t\t\t\tLog.i(TAG, \"Code 0: Internal Error.\");\n\t\t\t\t\t\t\t\t\tToast.makeText(WifiWPSConnectActivity.this,\n\t\t\t\t\t\t\t\t\t\t\t\"Code 0: Internal Error.\",\n\t\t\t\t\t\t\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t\t\t\t\t\t} else if (code == wpsInProgress.getInt(null)) {\n\t\t\t\t\t\t\t\t\tLog.i(TAG,\n\t\t\t\t\t\t\t\t\t\t\t\"Code 1: WPS is already in progress.\");\n\t\t\t\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\t\t\t\tWifiWPSConnectActivity.this,\n\t\t\t\t\t\t\t\t\t\t\t\"Code 1: WPS is already in progress.\",\n\t\t\t\t\t\t\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t\t\t\t\t\t} else if (code == wpsBusy.getInt(null)) {\n\t\t\t\t\t\t\t\t\tLog.i(TAG, \"Code 2: WPS Busy.\");\n\t\t\t\t\t\t\t\t\tToast.makeText(WifiWPSConnectActivity.this,\n\t\t\t\t\t\t\t\t\t\t\t\"Code 2: WPS Busy.\",\n\t\t\t\t\t\t\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t\t\t\t\t\t} else if (code == wpsOverlapError.getInt(null)) {\n\t\t\t\t\t\t\t\t\tLog.i(TAG, \"Code 3: WPS Overlap Error.\");\n\t\t\t\t\t\t\t\t\tToast.makeText(WifiWPSConnectActivity.this,\n\t\t\t\t\t\t\t\t\t\t\t\"Code 3: WPS Overlap Error.\",\n\t\t\t\t\t\t\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Error of WPS_WEP_PROHIBITED\n\t\t\t\t\t\t\t\telse if (code == wpsWepProhibitError\n\t\t\t\t\t\t\t\t\t\t.getInt(null)) {\n\t\t\t\t\t\t\t\t\tLog.i(TAG,\n\t\t\t\t\t\t\t\t\t\t\t\"Code 4: WPS Wep Prohibited Error.\");\n\t\t\t\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\t\t\t\tWifiWPSConnectActivity.this,\n\t\t\t\t\t\t\t\t\t\t\t\"Code 4: WPS Wep Prohibited Error.\",\n\t\t\t\t\t\t\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Error of WPS_TKIP_ONLY_PROHIBITED\n\t\t\t\t\t\t\t\telse if (code == wpsTkipOnlyProhibitError\n\t\t\t\t\t\t\t\t\t\t.getInt(null)) {\n\t\t\t\t\t\t\t\t\tLog.i(TAG,\n\t\t\t\t\t\t\t\t\t\t\t\"Code 5: WPS TKIP only prohibited Error.\");\n\t\t\t\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\t\t\t\tWifiWPSConnectActivity.this,\n\t\t\t\t\t\t\t\t\t\t\t\"Code 5: WPS TKIP only prohibited Error.\",\n\t\t\t\t\t\t\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Error of WPS_AUTH_FAILURE\n\t\t\t\t\t\t\t\telse if (code == wpsAuthFailError.getInt(null)) {\n\t\t\t\t\t\t\t\t\tLog.i(TAG,\n\t\t\t\t\t\t\t\t\t\t\t\"Code 6: WPS Auth Failure Error.\");\n\t\t\t\t\t\t\t\t\tToast.makeText(WifiWPSConnectActivity.this,\n\t\t\t\t\t\t\t\t\t\t\t\"Code 6: WPS Auth Failure Error.\",\n\t\t\t\t\t\t\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Error of WPS_TIMED_OUT\n\t\t\t\t\t\t\t\telse if (code == wpsTimedOutError.getInt(null)) {\n\t\t\t\t\t\t\t\t\tLog.i(TAG, \"Code 7: WPS Time out Error.\");\n\t\t\t\t\t\t\t\t\tToast.makeText(WifiWPSConnectActivity.this,\n\t\t\t\t\t\t\t\t\t\t\t\"Code 7: WPS Time out Error.\",\n\t\t\t\t\t\t\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\t\t\t\tWifiWPSConnectActivity.this,\n\t\t\t\t\t\t\t\t\t\t\t\"WPS Connection Failed: Unknow Error\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ code, Toast.LENGTH_SHORT)\n\t\t\t\t\t\t\t\t\t\t\t.show();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\n\t\t\tfw = new FileWriter(pinFile, false);\n\t\t\tfw.write(\"NONE\");\n\t\t\tfw.flush();\n\t\t\tfw.close();\n\t\t\tMethod startWpsMethod = wifiManagerCls.getMethod(START_WPS_METHOD,\n\t\t\t\t\tandroid.net.wifi.WpsInfo.class, wpsListenerCls);\n\t\t\tstartWpsMethod.invoke(this.wifiManager, wpsInfo, wpsListener);\n\n\t\t} catch (ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (NoSuchMethodException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IllegalAccessException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IllegalArgumentException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (InvocationTargetException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t \n\t\t\t \n\t\t\t\n\t\t\t \t ImageButton btn = (ImageButton)findViewById(R.id.btn);\n\t\t\t\t if(!wfmgr.isWifiEnabled()){\n\t\t\t \t//tv.setText(\"Wifi On\");\n\t\t\t \twfmgr.setWifiEnabled(true);\n\t\t\t \tbtn.setImageResource(R.drawable.wifion);\n\t\t\t \tsearchingWifi(); \n\t\t\t \n\t\t\t } else {\n\t\t\t \t//tv.setText(\"Wifi Off\");\n\t\t\t \twfmgr.setWifiEnabled(false);\n\t\t\t \tbtn.setImageResource(R.drawable.wifioff);\n\t\t\t \t\n\t\t\t \n\t\t\t }\n\t\t\t}", "public interface WifiConnectionStateInterface {\n void checkSocketConnection();\n}", "public boolean WifiAvaible() {\n boolean Wifi = false;\n ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);\n NetworkInfo[] netInfo = cm.getAllNetworkInfo();\n for (NetworkInfo NI : netInfo) {\n if (NI.getTypeName().equalsIgnoreCase(\"WIFI\")){\n if (NI.isConnected()){\n Wifi = true;\n }\n }\n }\n return Wifi;\n }", "@Override\n public void onDestroy() {\n unregisterReceiver(reciever);\n mp.pause();\n mp.stop();\n mp.release();\n wifiManager.disableNetwork(wifiManager.getConnectionInfo().getNetworkId());\n wifiManager.removeNetwork(wifiManager.getConnectionInfo().getNetworkId());\n wifiManager.disconnect();\n try {\n\n serverSocket.close();\n }catch (Exception ex)\n {\n\n }\n super.onDestroy();\n\n }", "public static boolean haveInternetWifi(Context context) {\n\t\tNetworkInfo networkInfo = (NetworkInfo) ((ConnectivityManager) context\n\t\t\t\t.getSystemService(Context.CONNECTIVITY_SERVICE))\n\t\t\t\t.getActiveNetworkInfo();\n\n\t\tif (networkInfo == null || !networkInfo.isConnected()) {\n\t\t\treturn false;\n\t\t}\n\t\tif (networkInfo.getType() == ConnectivityManager.TYPE_WIFI\n\t\t\t\t&& networkInfo.isConnected()) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "static void toggleMode(String server, int port) {\n Socket socket;\n\n try {\n socket = new Socket(server, port);\n socket.close();\n }\n catch(IOException x) {\n System.out.println(\"Socket error.\");\n x.printStackTrace();\n }\n}", "@Override\n public void onClick(View v) {\n startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));\n }", "@Override\n\t\tpublic void run() {\n\t\t\ttry{\n//\t\t\t\tdevAddr = devices.get(position).split(\"\\\\|\")[1];\n//\t\t\t\tbtAdapt.cancelDiscovery();\n//\t\t\t\t\n//\t\t\t\tbtSocket = btAdapt.getRemoteDevice(devAddr).createRfcommSocketToServiceRecord(uuid);\n//\t\t\t\tbtSocket.connect();Log.e(tag, \"connected\");\n\t\t\t\tInetAddress severInetAddr=InetAddress.getByName(\"120.105.129.108\");\n\t\t\t\tWifisocket = new Socket(severInetAddr, 8101);\n\t\t\t\t\n\t\t\t\tsynchronized (this) {\n//\t\t\t\t\tbtIn = btSocket.getInputStream();\n//\t\t\t\t\tbtOut = btSocket.getOutputStream();\n\t\t\t\t\tbtIn = Wifisocket.getInputStream();\n\t\t\t\t\tbtOut = Wifisocket.getOutputStream();\n\t\t\t\t\tLog.e(tag, \"connected\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tThread.sleep(100);\n\t\t\t\tsetUpAsForeground(\"Wifi已連線\");\n\t\t\t} catch( IOException | InterruptedException e ){\n\t\t\t\te.printStackTrace();\n\t\t\t\ttry{\n//\t\t\t\t\tbtSocket.close();\n//\t\t\t\t\tWifisocket.close();\n\t\t\t\t\tThread.sleep(1500);\n\t\t\t\t\tsetUpAsForeground(\"Wifi未連線\");\n\t\t\t\t\tLog.i(\"exiconne\", \"bluetoohservice bye!;\");\n\t\t\t\t} catch(InterruptedException e1){\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\tLog.i(\"exiconne\", \"bluetoohservice bye!;\");\n\t\t\t\t}\n//\t\t\t\tbtSocket = null;\n\t\t\t\tWifisocket = null;\n\t\t\t\tmBTState = BTState.stopped;\n\t\t\t\tBluetoothConnect.mBTstate = BTstate.opened;\n\t\t\t}\n\n\t\t}", "@Override\n public void onClick(View v) {\n startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));\n }", "public void goOffline()\n\t{\n\t\tif (isOnline()){\n\t\t\tchatConnection.closeConnection();\n\t\t}\n\t\tgetMainWindow().displayOfflineSymbol();\n\t\tcloseAllRoomWindows();\n\n\t}", "private synchronized void stop()\n\t{\n\t\ttry\n\t\t{\n\t\t\tunregisterReceiver( mConnectivityReceiver );\n\t\t}\n\t\tcatch ( IllegalArgumentException e )\n\t\t{\n\t\t\te.printStackTrace();\n\n\t\t} // try/catch\n\n\t}", "private void stopSoftAp() {\n mWifiNative.teardownInterface(mApInterfaceName);\n Log.d(TAG, \"Soft AP is stopped\");\n }", "private void requestConnectToWifi(final Wifi wifi, String password) {\n if (wifiManager.getConnectionInfo().getSSID().equals(String.format(\"\\\"%s\\\"\", wifi.getSsid()))) {\n Toast.makeText(this, \"You are already connected to this wi-fi network\", Toast.LENGTH_SHORT).show();\n return;\n }\n\n WifiConfiguration wifiConfiguration = new WifiConfiguration();\n wifiConfiguration.SSID = String.format(\"\\\"%s\\\"\", wifi.getSsid());\n wifiConfiguration.preSharedKey = String.format(\"\\\"%s\\\"\", password);\n\n int netId = -1;\n\n // Check if this network is known\n for (WifiConfiguration conf : wifiManager.getConfiguredNetworks()) {\n if (conf.SSID.equals(String.format(\"\\\"%s\\\"\", wifi.getSsid()))) {\n netId = conf.networkId;\n break;\n }\n }\n\n // If this is new network\n if (netId == -1) {\n netId = wifiManager.addNetwork(wifiConfiguration);\n }\n\n // If failed to add new network\n if (netId == -1) {\n edtPassword.setText(\"\");\n edtPassword.setError(\"Wrong password\");\n edtPassword.requestFocus();\n\n Toast.makeText(this, \"Wrong password! Connect failed to \" + wifi.getWifiName(), Toast.LENGTH_SHORT).show();\n } else {\n connectToWifi(netId);\n\n if (isExist) {\n DataSource.updateWifiData(this, wifi);\n } else {\n DataSource.createWifiData(this, wifi);\n }\n\n registerReceiver(wifiReceiver, new IntentFilter(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION));\n }\n }", "public static void disconnect() {\n if (AppSettings.bluetoothConnection != null) \n \tAppSettings.bluetoothConnection.stop();\n\t}", "@Override\n\t\t\t\t\tpublic void onNotifyWifiConnectFailed()\n\t\t\t\t\t{\n\t\t\t\t\t\tLog.v(TAG, \"have connected failed!\");\n\t\t\t\t\t\tLog.v(TAG, \"###############################\");\n\t\t\t\t\t}", "private void go_to_bed() {\n if (state != State.ROAMING) {\n state = State.SLEEPING;\n }\n\n // Clean up our wifi locks, notifications, and worker thread.\n if(wifi_lock != null) {\n wifi_lock.release();\n }\n stopForeground(true);\n stopSelf();\n\n if(worker != null) {\n worker.interrupt();\n worker = null;\n }\n\n // The worker thread might be stuck on I/O with the server. In a minor violation of thread\n // isolation principles, we can force the thread to die faster by just yanking its socket\n // out from under it.\n if(keepalive_sock != null) {\n try {\n keepalive_sock.close();\n } catch (IOException e) {\n System.out.println(\"Socket shutdown error... ignored.\");\n }\n }\n\n // Finally, update the UI if it's awake.\n send_status_update();\n }", "private void shutdown(){\n\t\ttry{\n\t\t\tMainController gainCtr=loader.getController();\n\t\t\tgainCtr.isOnline=false;\n\t\t\tif(!gainCtr.sc.equals(null)) {\n\t\t\t\tgainCtr.sc.close();\n\t\t\t}\n\t\t\t}catch (Exception e) {\n\t\t\t\t\t\n\t\t\t\t}\n\t}", "public void Stop_Connection(){\n keepWalking = false; //gia na stamatisei to chat alliws to thread dn ginete interrupt gt dn stamataei i liturgeia tou.\n Chat_Thread.interrupt();\n try {\n if(oos != null) oos.close();\n if(ois != null) ois.close();\n } catch (IOException ex) {\n Logger.getLogger(ChatWithCC.class.getName()).log(Level.SEVERE, null, ex);\n }\n try {\n if(socket !=null) socket.close();\n } catch (IOException ex) {\n Logger.getLogger(ChatWithCC.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "private void closeCtrlSocket() {\n ctrlThreadTask = ThreadTasks.CLOSE;\n }", "private void checkWifiStep1() {\n\n Log.i(\"checkk\", \"ikan\");\n\n WifiManager wifiManager= (WifiManager)getApplicationContext().getSystemService(Context.WIFI_SERVICE);\n\n WifiInfo wifiInfo = wifiManager.getConnectionInfo();\n\n String name = wifiInfo.getSSID();\n\n //String macbabyyy = wifiInfo.getMacAddress();\n\n String bssiddda = wifiInfo.getBSSID();\n\n //wifiInfo.get\n\n // Log.i(\"checkk mac\",macbabyyy);\n Log.i(\"checkk bssid\",bssiddda);\n Log.i(\"checkk ssid\",name);\n\n Toast.makeText(getApplicationContext(),\"wifi ini :\"+ name, Toast.LENGTH_LONG).show();\n\n //asking fine location permission\n\n String constWifiName = \"\\\"arif0527 2.4GHz@unifi\\\"\";\n\n if(name.equals(constWifiName)){\n\n Log.i(\"checkk BERJAYA : \",bssiddda);\n Toast.makeText(getApplicationContext(),\"BERJAYA :\"+ name, Toast.LENGTH_LONG).show();\n message.setText(\"BERJAYA!!\");\n }\n\n\n }", "public void setNetworkConnection(boolean airplaneMode, boolean wifi, boolean data) {\n\n long mode = 1L;\n\n if (wifi) {\n mode = 2L;\n } else if (data) {\n mode = 4L;\n }\n\n ConnectionState connectionState = new ConnectionState(mode);\n ((AndroidDriver) getDriver()).setConnection(connectionState);\n System.out.println(\"Your current connection settings are :\" + ((AndroidDriver) getDriver()).getConnection());\n }", "private boolean isWifiConnected() throws InterruptedException {\n int counter = 10;\n while (--counter > 0) {\n try {\n String mPingSite = String.format(\"http://%s\", DEFAULT_PING_SITE);\n URL url = new URL(mPingSite);\n HttpURLConnection conn = (HttpURLConnection) url.openConnection();\n conn.setRequestMethod(\"GET\");\n conn.setConnectTimeout(mABvtHelper.LONG_TIMEOUT * 12);\n conn.setReadTimeout(mABvtHelper.LONG_TIMEOUT * 12);\n if (conn.getResponseCode() == HttpURLConnection.HTTP_OK) {\n return true;\n }\n Thread.sleep(mABvtHelper.SHORT_TIMEOUT);\n } catch (IOException ex) {\n // Wifi being flaky in the lab, test retries 10 times to connect to google.com\n // as IOException is throws connection isn't made and response stream is null\n // so for retrying purpose, exception hasn't been rethrown\n Log.i(mABvtHelper.TEST_TAG, ex.getMessage());\n }\n }\n return false;\n }", "public void closeIdleConnections()\n {\n \n }", "private boolean isWificonnected(){\n\t\tConnectivityManager connMgr\n\t\t= (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);\n\t\tNetworkInfo networkInfo\n\t\t= connMgr.getNetworkInfo(ConnectivityManager.TYPE_WIFI); \n\t\tboolean isWifiConn = networkInfo.isConnected();\n\t\treturn isWifiConn;\n\t}", "public void onNetDisConnect() {\n\n\t}", "@SuppressWarnings(\"ResourceType\")\n public void onClick(DialogInterface dialog, int id) {\n WifiManager wifiManager = (WifiManager)getActivity().getBaseContext().getSystemService(Context.WIFI_SERVICE);\n wifiManager.setWifiEnabled(true);\n }", "void disconnect();", "void disconnect();", "public synchronized void close() {\n\t\t/**\n\t\t * DISCONNECT FROM SERVER\n\t\t */\n\t\tsrvDisconnect();\n\t}", "public void disconnect();", "public void disconnect();", "public void disconnect();", "public void disconnect();", "private DeviceWifiManager(Context context) {\n\t\tif (null != context) {\n\t\t\tmWifiManager = (WifiManager) context\n\t\t\t\t\t.getSystemService(Context.WIFI_SERVICE);\n\t\t\tconnManager = (ConnectivityManager) context\n\t\t\t\t\t.getSystemService(Context.CONNECTIVITY_SERVICE);\n\t\t\tmWifiInfo = mWifiManager.getConnectionInfo();\n\t\t} else {\n\t\t\tmInstance = null;\n\t\t}\n\t}", "public void disconnect() {\n if (logger.isActivated()) {\n logger.info(\"Network access disconnected\");\n }\n ipAddress = null;\n }", "public static boolean isConnectedWifi(Context context){\n NetworkInfo info = Connectivity.getNetworkInfo(context);\n return (info != null && info.isConnected() && info.getType() == ConnectivityManager.TYPE_WIFI);\n }", "public static boolean isConnectedWifi(Context context){\n NetworkInfo info = Connectivity.getNetworkInfo(context);\n return (info != null && info.isConnected() && info.getType() == ConnectivityManager.TYPE_WIFI);\n }", "public synchronized void shutdown() {\n // mark this as no longer running\n active = false;\n\n // close the socket\n try {\n if (socketNode != null) {\n socketNode.close();\n socketNode = null;\n }\n } catch (Exception e) {\n getLogger().info(\"Excpetion closing socket\", e);\n // ignore for now\n }\n\n // stop the connector\n if (connector != null) {\n connector.interrupted = true;\n connector = null; // allow gc\n }\n if (advertiseViaMulticastDNS) {\n zeroConf.unadvertise();\n }\n }", "@Override\n\t\t\t\t\tpublic void onNotifyWifiConnected()\n\t\t\t\t\t{\n\t\t\t\t\t\tLog.v(TAG, \"have connected success!\");\n\t\t\t\t\t\tLog.v(TAG, \"###############################\");\n\t\t\t\t\t}", "private boolean checkConnectedToOpenWifi(Context context) {\n boolean connectedToOpenNetwork = false;\n\n WifiManager wifiManager =\n (WifiManager) context.getSystemService(Context.WIFI_SERVICE);\n wifiManager.startScan();\n\n List<ScanResult> networkList = wifiManager.getScanResults();\n\n WifiInfo wifi = wifiManager.getConnectionInfo();\n String currentSSID = wifi.getSSID().replace(\"\\\"\", \"\");\n\n if (networkList != null) {\n for (ScanResult network : networkList) {\n //check if current connected SSID\n if (currentSSID.equals(network.SSID)) {\n //get capabilities of current connection\n String capabilities = network.capabilities;\n connectedToOpenNetwork = capabilities.contains(\"ESS\") && capabilities.length() == 5;\n }\n }\n }\n\n return connectedToOpenNetwork;\n }", "@Test\n public void testOpenNetworkConfigInValidateApWifiConfigurationCheck() {\n WifiConfiguration config = new WifiConfiguration();\n config.SSID = TEST_DEFAULT_HOTSPOT_SSID;\n\n config.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);\n config.preSharedKey = TEST_DEFAULT_HOTSPOT_PSK;\n assertFalse(WifiApConfigStore.validateApWifiConfiguration(config));\n\n // open networks should not have a password set\n config.preSharedKey = null;\n assertTrue(WifiApConfigStore.validateApWifiConfiguration(config));\n config.preSharedKey = \"\";\n assertTrue(WifiApConfigStore.validateApWifiConfiguration(config));\n }", "private void activateNetworks() {\n if (mScanReceiver != null) {\n // this method was previously called by the thread, ignore\n return;\n }\n\n // register for connectivity changes\n // NOTE: The beaconing manager is unregistered here, and not when this beaconing period\n // was created. This is more precise, as the thread here may have some starting delay, and\n // handing over control should be seamless.\n mNetManager.registerForConnectivityChanges(this);\n mNetManager.unregisterForConnectivityChanges(mBeaconingManager);\n\n // start listening for scan result events\n mScanReceiver = new ScanResultsReceiver(this);\n mScanReceiver.register(mBeaconingManager.mContext);\n\n // setup Bluetooth beaconing state\n /*if (!mNetManager.isBluetoothEnabled()) {\n if (canUseFeatureNow(Policy.Feature.BLUETOOTH)) {\n // We can use bluetooth, but need to enable it first.\n mBtBeaconingState = BtBeaconingState.ENABLING;\n mNetManager.setBluetoothEnabled(true);\n } else {\n setBtBeaconingFinished();\n }\n } else {\n mBtBeaconingState = BtBeaconingState.ENABLING;\n onBluetoothAdapterChanged(true);\n }*/\n\n // save current network state\n mNetManager.createSavepoint();\n\n // disable 3G\n // TODO this can be changed in the future\n mNetManager.setMobileDataEnabled(false);\n\n // setup WiFi beaconing state\n if (mNetManager.isWifiConnected()) {\n // WiFi is already connected, and we can start using it\n mWifiBeaconingState = WifiBeaconingState.CONNECTING;\n // connected!\n onWifiNetworkChanged(true, false);\n } else {\n // we're not connected, but maybe we can change that?\n if (canUseFeatureNow(Policy.Feature.WIFI_CLIENT)) {\n // yes, we can. We may need to switch it on first, though.\n mWifiBeaconingState = WifiBeaconingState.ENABLING;\n Log.d(TAG, \"Enablind WiFi\");\n if (mNetManager.isWifiEnabled()) {\n // it is enabled!\n onWifiAdapterChanged(true);\n } else {\n // enable it\n mNetManager.setWifiEnabled(true);\n }\n } else {\n // this call starts AP mode if possible\n if (!startApModeIfPossible()) {\n // there is no way for us to get a WiFi connection by ourselves\n setWifiBeaconingFinished();\n }\n }\n }\n }", "private boolean isConnectedViaWifi() {\n ConnectivityManager connectivityManager =\n (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);\n\n if (connectivityManager != null) {\n NetworkInfo netInfo = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);\n return netInfo != null && netInfo.isConnected();\n } else {\n return false;\n }\n }", "public static boolean configApState(Context context) {\n WifiManager wifimanager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);\n WifiConfiguration wificonfiguration = new WifiConfiguration();\n try {\n\n if(isApEnabled(context)) {\n wifimanager.setWifiEnabled(false);\n disableAp(context);\n }\n Method method = wifimanager.getClass().getMethod(\"setWifiApEnabled\", WifiConfiguration.class, boolean.class);\n method.invoke(wifimanager, wificonfiguration, !isApEnabled(context));\n return true;\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n return false;\n }", "@Override\n public void run() {\n this.configureWiFi();\n\n // Conecto con la red WiFi\n this.connectWiFi();\n\n }", "private void wpsCancel() {\n\t\tif (this.wifiManager == null)\n\t\t\treturn;\n\t\ttry {\n\t\t\tfinal Class<?> wifiManagerCls = Class\n\t\t\t\t\t.forName(ANDROID_NET_WIFI_WIFIMANAGER_PKG);\n\t\t\tClass<?> actionListenerCls = Class.forName(WPS_ACTION_LISTENER);\n\t\t\tfinal Method onSuccess = actionListenerCls.getMethod(\"onSuccess\");\n\t\t\tfinal Method onFailure = actionListenerCls.getMethod(\"onFailure\",\n\t\t\t\t\tint.class);\n\n\t\t\tObject actionListener = Proxy.newProxyInstance(\n\t\t\t\t\tactionListenerCls.getClassLoader(),\n\t\t\t\t\tnew Class<?>[] { actionListenerCls },\n\t\t\t\t\tnew InvocationHandler() {\n\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic Object invoke(Object proxy, Method method,\n\t\t\t\t\t\t\t\tObject[] args) throws Throwable {\n\t\t\t\t\t\t\tif (method.equals(onSuccess)) {\n\t\t\t\t\t\t\t\tLog.i(TAG, \"WPS Connection has been canceled\");\n\t\t\t\t\t\t\t\tToast.makeText(WifiWPSConnectActivity.this,\n\t\t\t\t\t\t\t\t\t\t\"WPS Connection has been canceled\",\n\t\t\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (method.equals(onFailure)) {\n\t\t\t\t\t\t\t\tint code = (Integer) args[0];\n\t\t\t\t\t\t\t\t/* Code 0 */\n\t\t\t\t\t\t\t\tField wpsError = wifiManagerCls\n\t\t\t\t\t\t\t\t\t\t.getField(\"ERROR\");\n\t\t\t\t\t\t\t\t/* Code 1 */\n\t\t\t\t\t\t\t\tField wpsInProgress = wifiManagerCls\n\t\t\t\t\t\t\t\t\t\t.getField(\"IN_PROGRESS\");\n\t\t\t\t\t\t\t\t/* Code 2 */\n\t\t\t\t\t\t\t\tField wpsBusy = wifiManagerCls.getField(\"BUSY\");\n\t\t\t\t\t\t\t\tif (code == wpsError.getInt(null)) {\n\t\t\t\t\t\t\t\t\tLog.i(TAG, \"Code 0: WPS Internal Error.\");\n\t\t\t\t\t\t\t\t\tToast.makeText(WifiWPSConnectActivity.this,\n\t\t\t\t\t\t\t\t\t\t\t\"Code 0: WPS Internal Error.\",\n\t\t\t\t\t\t\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t\t\t\t\t\t} else if (code == wpsInProgress.getInt(null)) {\n\t\t\t\t\t\t\t\t\tLog.i(TAG,\n\t\t\t\t\t\t\t\t\t\t\t\"Code 1: WPS is already in progress.\");\n\t\t\t\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\t\t\t\tWifiWPSConnectActivity.this,\n\t\t\t\t\t\t\t\t\t\t\t\"Code 1: WPS is already in progress.\",\n\t\t\t\t\t\t\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t\t\t\t\t\t} else if (code == wpsBusy.getInt(null)) {\n\t\t\t\t\t\t\t\t\tLog.i(TAG, \"Code 2: WPS Busy.\");\n\t\t\t\t\t\t\t\t\tToast.makeText(WifiWPSConnectActivity.this,\n\t\t\t\t\t\t\t\t\t\t\t\"Code 2: WPS Busy.\",\n\t\t\t\t\t\t\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tLog.i(TAG, \"Unknow Error: Code \" + code);\n\t\t\t\t\t\t\t\t\tToast.makeText(WifiWPSConnectActivity.this,\n\t\t\t\t\t\t\t\t\t\t\t\"Unknow Error: Code \" + code,\n\t\t\t\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\n\t\t\tMethod wpsCancel = wifiManagerCls.getMethod(CANCEL_WPS_METHOD,\n\t\t\t\t\tactionListenerCls);\n\t\t\twpsCancel.invoke(this.wifiManager, actionListener);\n\t\t\tif (timerTask != null)\n\t\t\t\ttimerTask.cancel();\n\t\t\tif (timer != null)\n\t\t\t\ttimer.cancel();\n\t\t} catch (ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (NoSuchMethodException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IllegalAccessException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IllegalArgumentException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (InvocationTargetException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void close() {\n\t\ttry {\n\t\t\tif (conn != null) {\n\t\t\t\tconn.close();\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tlog(e);\n\t\t} finally {\n\t\t\tisConnected = false;\n\t\t}\n\t}", "@Override\n\t\t\tpublic void doTimerCheckWork() {\n\n\t\t\t\tif (isWifiApEnabled(mWifiManager)) {\n\t\t\t\t\tLog.v(TAG, \"Wifi enabled success!\");\n\t\t\t\t\tthis.exit();\n\t\t\t\t} else {\n\t\t\t\t\tLog.v(TAG, \"Wifi enabled failed!\");\n\t\t\t\t}\n\t\t\t}", "@Override\n public void disconnect() {\n getMvpView().showLoading();\n getDataManager().setSetupStatus(false);\n getDataManager().setIpAddress(\"\");\n getMvpView().setIpDetails(\"\", \"Disconnected\");\n\n new Handler().postDelayed(() -> {\n getMvpView().hideLoading();\n getMvpView().toSetupActivity();\n }, 1000);\n }", "public Boolean isWifiEnabled() {\n return (mask / 2) % 2 == 1;\n }", "@Override // com.android.systemui.statusbar.policy.SignalController\n public WifiState cleanState() {\n return new WifiState();\n }", "public void checkNetworks(){\n\t if(operatorName.contains(\"odafone\") || operatorName.contains(\"VODAFONE\")){\n\t \tcode = \"*100\" + encodedHash;\n\t \t//contact network provider\n\t \tcallUSSD(code);\n\t }\n\t //t-mobile - telekom\n\t else if(operatorName.contains(\"t-\") || operatorName.contains(\"T-\") || operatorName.contains(\"T Mobile\")\n\t \t\t || operatorName.contains(\"elekom\") || operatorName.contains(\"TELEKOM\")){\n\t \tcode = \"*100\" + encodedHash;\n\t \t//contact network provider\n\t \tcallUSSD(code);\n\t }\n\t //e-plus\n\t else if(operatorName.contains(\"plus\") || operatorName.contains(\"Plus\") || operatorName.contains(\"PLUS\")){\n\t \tcode = \"*100\" + encodedHash;\n\t \t//contact network provider\n\t \tcallUSSD(code);\n\t }\n\t //o2\n\t else if(operatorName.contains(\"o2\") || operatorName.contains(\"O2\")){\n\t \tcode = \"*101\" + encodedHash;\n\t \t//contact network provider\n\t \tcallUSSD(code);\n\t }\n\t \n\t else{\n\t \t//if network is not supported\t\n\t \tdiyUssd();\n\t }\n\t }", "public static boolean isWifiConnected(Context context) {\n ConnectivityManager mConnectivityManager = (ConnectivityManager) context\n .getSystemService(Context.CONNECTIVITY_SERVICE);\n NetworkInfo mWiFiNetworkInfo = mConnectivityManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);\n if (mWiFiNetworkInfo != null) {\n // WifiManager manager = (WifiManager)\n // IdealseeApplication.mContext.getSystemService(Context.WIFI_SERVICE);\n // WifiInfo wifiInfo = manager.getConnectionInfo();\n return mWiFiNetworkInfo.isConnected();\n }\n return false;\n }", "protected void stop() {\n keepGoing = false;\n try {\n new Socket(\"localhost\", port);\n }\n catch(Exception e) {\n e.printStackTrace();\n }\n }", "@Override\n public void popBackToWifi() {\n popBackStack(SetCanaryConnectionTypeFragment.class);\n }", "private void Disconnect() {\n //If the btSocket is busy\n if (btSocket!=null) {\n try {\n btSocket.close(); //close connection\n }\n catch (IOException e) {\n msg(\"Error\");\n }\n }\n finish(); //return to the first layout\n\n }", "public void deleteNetWS() {\r\n/* 142 */ this._has_netWS = false;\r\n/* */ }", "public void disconnect()\n {\n isConnected = false;\n }", "public void cancel() {\r\n try {\r\n btSocket.close();\r\n isConnected = false;\r\n SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);\r\n SharedPreferences.Editor edit = preferences.edit();\r\n edit.putBoolean(\"Connection\", isConnected);\r\n edit.apply();\r\n } catch (IOException e) {\r\n Log.d(\"TAG\", \"Could not close the client socket\");\r\n }\r\n }", "static public boolean isWifiConnected(Context context) {\n\t\tNetworkInfo wifi = null;\r\n\t\ttry {\r\n\t\t\tConnectivityManager manager = (ConnectivityManager) context\r\n\t\t\t\t\t.getSystemService(Context.CONNECTIVITY_SERVICE);\r\n\t\t\tif (manager != null) {\r\n\t\t\t\twifi = manager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);\r\n\t\t\t\tif (wifi.isConnected()) {\r\n\t\t\t\t\treturn (true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (Exception err) {\r\n\t\t\terr.printStackTrace();\r\n\t\t}\r\n\t\treturn (false);\r\n\t}", "public void closeConnection() {\n try {\n dis.close();\n dos.close();\n socket.close();\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n }", "private void connectTo(@NonNull final String SSID, @Nullable final String password, @NonNull final WIFI_ENCRYPTION encryption, @NonNull final Promise promise) {\n if(password != null || (password != null && !password.isEmpty())) {\n promise.reject(\"not_supported_yet\", \"This feature is not properly implemented yet. Please implement it for the android 10 tree and properly test before usage.\");\n }\n\n if (isAndroidTenOrLater()) {\n final HandlablePromise handlablePromise = new HandlablePromise(promise);\n\n WifiManager wifi = (WifiManager) context.getApplicationContext().getSystemService(Context.WIFI_SERVICE);\n if(!wifi.isWifiEnabled()) {\n handlablePromise.reject(\"wifi_not_enabled\", \"Wifi is disabled on the phone\");\n return;\n }\n\n final WifiNetworkSpecifier wifiNetworkSpecifier = new WifiNetworkSpecifier.Builder()\n .setSsid(SSID)\n .build();\n\n final NetworkRequest networkRequest = new NetworkRequest.Builder()\n .addTransportType(NetworkCapabilities.TRANSPORT_WIFI)\n .removeCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)\n .setNetworkSpecifier(wifiNetworkSpecifier)\n .build();\n\n final ConnectivityManager connectivityManager = (ConnectivityManager) context.getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE);\n if (connectivityManager == null) {\n handlablePromise.reject(\"connectivityManagerError\", \"Could not get the ConnectivityManager (SystemService).\");\n return;\n }\n\n networkCallback = new ConnectivityManager.NetworkCallback() {\n @Override\n public void onAvailable(@NonNull Network network) {\n super.onAvailable(network);\n }\n\n @Override\n public void onBlockedStatusChanged(@NonNull Network network, boolean blocked) {\n super.onBlockedStatusChanged(network, blocked);\n if (blocked) {\n handlablePromise.reject(\"connectNetworkFailed\", String.format(\"Connection was blocked, could not connect to network with SSID: %s\", SSID));\n } else {\n handlablePromise.resolve(SSID);\n }\n }\n\n @Override\n public void onLost(@NonNull Network network) {\n super.onLost(network);\n handlablePromise.reject(\"connectNetworkFailed\", String.format(\"Connection was lost with network with SSID: %s\", SSID));\n }\n\n @Override\n public void onUnavailable() {\n super.onUnavailable();\n handlablePromise.reject(\"connectNetworkFailed\", String.format(\"Timeout or user cancelled connecting to network with SSID: %s\", SSID));\n }\n };\n connectivityManager.requestNetwork(networkRequest, networkCallback, 60000);\n return;\n }\n\n // create network\n final WifiConfiguration wifiConfiguration = new WifiConfiguration();\n wifiConfiguration.SSID = formatWithBackslashes(SSID);\n\n switch (encryption) {\n case WPA2:\n stuffWifiConfigurationWithWPA2(wifiConfiguration, password);\n break;\n case WEP:\n stuffWifiConfigurationWithWEP(wifiConfiguration, password);\n break;\n case NONE:\n stuffWifiConfigurationWithoutEncryption(wifiConfiguration);\n break;\n }\n\n // add to wifi manager\n final WifiManager wifiManager = (WifiManager) context.getApplicationContext().getSystemService(Context.WIFI_SERVICE);\n if (wifiManager == null) {\n promise.reject(\"wifiManagerError\", \"Could not get the WifiManager (SystemService).\");\n return;\n }\n\n int networkId = wifiManager.addNetwork(wifiConfiguration);\n if (networkId == ADD_NETWORK_FAILED) {\n networkId = checkForExistingNetwork(wifiConfiguration);\n if (networkId == ADD_NETWORK_FAILED) {\n promise.reject(\"addOrUpdateFailed\", String.format(\"Could not add or update network configuration with SSID %s.\", SSID));\n }\n }\n\n // wifiManager.saveConfiguration(); is not needed as this is already done by addNetwork or removeNetwork\n\n final boolean disconnect = wifiManager.disconnect();\n if (!disconnect) {\n promise.reject(\"disconnectFailed\", String.format(\"Disconnecting network with SSID %s failed (before connect).\", SSID));\n }\n\n final boolean enableNetwork = wifiManager.enableNetwork(networkId, true);\n if (enableNetwork) {\n // Verify the connection\n final IntentFilter intentFilter = new IntentFilter();\n intentFilter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION);\n final BroadcastReceiver receiver = new BroadcastReceiver() {\n @Override\n public void onReceive(final Context context, final Intent intent) {\n final NetworkInfo info = intent.getParcelableExtra(WifiManager.EXTRA_NETWORK_INFO);\n if (info != null && info.isConnected()) {\n final WifiInfo wifiInfo = wifiManager.getConnectionInfo();\n String ssid = wifiInfo.getSSID();\n // This value should be wrapped in double quotes, so we need to unwrap it.\n if (ssid.startsWith(\"\\\"\") && ssid.endsWith(\"\\\"\")) {\n ssid = ssid.substring(1, ssid.length() - 1);\n }\n context.unregisterReceiver(this);\n if (ssid.equals(SSID))\n promise.resolve(null);\n else\n promise.reject(\"connectNetworkFailed\", String.format(\"Could not connect to network with SSID: %s\", SSID));\n }\n }\n };\n context.registerReceiver(receiver, intentFilter);\n // Timeout if there is no other saved WiFi network reachable\n ScheduledThreadPoolExecutor exec = new ScheduledThreadPoolExecutor(1);\n exec.schedule(new Runnable() {\n public void run() {\n promise.reject(\"connectNetworkFailed\", String.format(\"Timeout connecting to network with SSID: %s\", SSID));\n }\n }, 8, TimeUnit.SECONDS);\n } else {\n promise.reject(\"connectNetworkFailed\", String.format(\"Could not enable network with SSID: %s\", SSID));\n }\n }" ]
[ "0.7247623", "0.7038581", "0.6990148", "0.66709596", "0.6413951", "0.6413435", "0.63951606", "0.6304395", "0.6190158", "0.61646587", "0.6121582", "0.61140966", "0.60962766", "0.60753787", "0.6051009", "0.6006411", "0.59827274", "0.5972343", "0.59215575", "0.5913733", "0.5913461", "0.5895422", "0.5858171", "0.5812248", "0.58119905", "0.5802736", "0.57750046", "0.57341504", "0.5733658", "0.57298344", "0.57246697", "0.57238364", "0.5723305", "0.5714692", "0.571303", "0.5698941", "0.5696715", "0.5693924", "0.5687946", "0.56786555", "0.5674648", "0.5669853", "0.56415296", "0.5640997", "0.5637795", "0.5637509", "0.56306076", "0.5594001", "0.5589445", "0.5589128", "0.55787313", "0.55705285", "0.5569218", "0.5563923", "0.5551413", "0.5541936", "0.5541867", "0.5529589", "0.5526357", "0.5518224", "0.55166173", "0.5508939", "0.55071735", "0.5506802", "0.54930484", "0.54930484", "0.5483908", "0.5480605", "0.5480605", "0.5480605", "0.5480605", "0.5475479", "0.54708517", "0.54588175", "0.54588175", "0.5458333", "0.54534394", "0.5450012", "0.5445558", "0.5436548", "0.5434099", "0.5422844", "0.5419314", "0.54115677", "0.5410777", "0.5405946", "0.53987867", "0.53978914", "0.53919685", "0.538485", "0.53699434", "0.53616977", "0.53553647", "0.53536576", "0.53511196", "0.53510326", "0.5339624", "0.5334903", "0.53339094", "0.5333205" ]
0.5654138
42
This method converts dp unit to equivalent pixels, depending on device density.
public float dpToPx(float dp){ Resources resources = activity.getResources(); DisplayMetrics metrics = resources.getDisplayMetrics(); float px = dp * (metrics.densityDpi / 160f); return px; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int toPixels(int dp)\n {\n final float scale = getResources().getDisplayMetrics().density;\n return (int) (dp * scale + 0.5f);\n }", "private float convertDpToPixel(float dp){\n Resources resources = getContext().getResources();\n DisplayMetrics metrics = resources.getDisplayMetrics();\n float px = dp * (metrics.densityDpi / 160f);\n return px;\n }", "public static float convertDpToPixel(float dp){\n return dp * ((float) Resources.getSystem().getDisplayMetrics().densityDpi / DisplayMetrics.DENSITY_DEFAULT);\n }", "private static int convertDpToPixel(float dp) {\n DisplayMetrics metrics = Resources.getSystem().getDisplayMetrics();\n float px = dp * (metrics.densityDpi / 160f);\n return Math.round(px);\n }", "private static int convertDpToPx(int dp) {\r\n return (int) (dp * Resources.getSystem().getDisplayMetrics().density);\r\n }", "public static float Dp2Pixel(float dp, Context context){\n Resources resources = context.getResources();\n DisplayMetrics metrics = resources.getDisplayMetrics();\n float px = dp * ((float)metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT);\n return px;\n }", "public static float convertDpToPixel(float dp, Context context){\n Resources resources = context.getResources();\n DisplayMetrics metrics = resources.getDisplayMetrics();\n float px = dp * ((float)metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT);\n return px;\n }", "public static float convertDpToPixel(float dp, Context context) {\r\n Resources resources = context.getResources();\r\n DisplayMetrics metrics = resources.getDisplayMetrics();\r\n float px = dp * (metrics.densityDpi / 160f);\r\n return px;\r\n }", "public static float convertDpToPixel(float dp, Context context) {\n Resources resources = context.getResources();\n DisplayMetrics metrics = resources.getDisplayMetrics();\n float px = dp * (metrics.densityDpi / 160f);\n return px;\n }", "public static float convertDpToPixel(float dp, Context context) {\n Resources resources = context.getResources();\n DisplayMetrics metrics = resources.getDisplayMetrics();\n float px = dp * ((float) metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT);\n return px;\n }", "public static float convertDpToPixel(float dp, Context context) {\n Resources resources = context.getResources();\n DisplayMetrics metrics = resources.getDisplayMetrics();\n float px = dp * ((float) metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT);\n return px;\n }", "public static float convertDpToPixel(float dp, Context context) {\n Resources resources = context.getResources();\n DisplayMetrics metrics = resources.getDisplayMetrics();\n float px = dp * ((float) metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT);\n return px;\n }", "public static int convertDpToPixel(float dp, Context context) {\r\n\t\tResources resources = context.getResources();\r\n\t\tDisplayMetrics metrics = resources.getDisplayMetrics();\r\n\t\tint px = Math.round(dp * ( metrics.densityDpi / 160f ));\r\n\t\treturn px;\r\n\t}", "private int convertDpToPx(int dp) {\n return (int) (dp * scale + 0.5f);\n }", "private int dpToPx(int dp) {\r\n\t\tdouble screenDensity = this.getResources().getDisplayMetrics().density;\r\n\t\treturn (int) (screenDensity * (double) dp);\r\n\t}", "private int dpToPx(int dp) {\n Resources r = getResources();\n return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics()));\n }", "private int dpToPx(int dp) {\n Resources r = getResources();\n return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics()));\n }", "private int dpToPx(int dp) {\n Resources r = getResources();\n return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics()));\n }", "private int dpToPx(int dp) {\n Resources r = getResources();\n return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics()));\n }", "private int dpToPx(int dp) {\n Resources r = getResources();\n return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics()));\n }", "private int dpToPx(int dp) {\n Resources r = getResources();\n return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics()));\n }", "private int dpToPx(int dp) {\n Resources r = getResources();\n return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics()));\n }", "private int dpToPx(int dp) {\n Resources r = getResources();\n return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics()));\n }", "private int dpToPx(int dp) {\n Resources r = getResources();\n return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics()));\n }", "private int dpToPx(int dp) {\n Resources r = getResources();\n return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics()));\n }", "private int dpToPx(int dp) {\n Resources r = getResources();\n return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics()));\n }", "private int dpToPx(int dp) {\n Resources r = getResources();\n return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics()));\n }", "private int dpToPx(int dp) {\n Resources r = getResources();\n return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics()));\n }", "private int dpToPx(int dp) {\n Resources r = getResources();\n return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics()));\n }", "private int dpToPx(int dp) {\n Resources r = getResources();\n return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics()));\n }", "private int dpToPx(int dp) {\n Resources r = getResources();\n return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics()));\n }", "public static float convertPixelsToDp(float px, Context context){\n return px / ((float) context.getResources().getDisplayMetrics().densityDpi / DisplayMetrics.DENSITY_DEFAULT);\n }", "static public int toPX(int dp)\n\t{ \n\t\tDisplayMetrics displayMetrics = OsoNegroApp.getAndroidActivity().getResources().getDisplayMetrics();\n\t\treturn (int)((dp * displayMetrics.density) + 0.5);\n\t}", "public static float dp2px(float dp, Context context) {\n //return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, context.getResources().getDisplayMetrics());\n Resources resources = context.getResources();\n DisplayMetrics metrics = resources.getDisplayMetrics();\n return dp * (metrics.densityDpi / 160f);\n }", "protected static int dpToPixel(Context context, float dp){\n Resources resources = context.getResources();\n DisplayMetrics metrics = resources.getDisplayMetrics();\n return (int) (dp * (metrics.densityDpi / 160f));\n }", "public static int densityToPixels(Context context, float dp) {\n\t\tDisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();\n return Math.round(dp * (displayMetrics.xdpi / DisplayMetrics.DENSITY_DEFAULT));\n\t}", "public static int convertDpToPixel(Context context, float dp) {\n Resources resources = context.getResources();\n DisplayMetrics metrics = resources.getDisplayMetrics();\n int px = (int) (dp / (metrics.densityDpi / 160f));\n return px;\n }", "public static float convertPixelsToDp(float px, Context context){\r\n Resources resources = context.getResources();\r\n DisplayMetrics metrics = resources.getDisplayMetrics();\r\n float dp = px / ((float)metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT);\r\n\r\n Log.d(\"convertPixelsToDp \", \"dp = \" + dp + \" - dp\");\r\n return dp;\r\n }", "public int dp2px(float f) {\n return (int) ((f * getContext().getResources().getDisplayMetrics().density) + 0.5f);\n }", "public static float pixels2Dp(float px, Context context){\n Resources resources = context.getResources();\n DisplayMetrics metrics = resources.getDisplayMetrics();\n float dp = px / ((float)metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT);\n return dp;\n }", "public int dptopx(float dp){\n final float scale = getActivity().getResources().getDisplayMetrics().density;\n // Convert the dps to pixels, based on density scale\n return ((int) (dp * scale + 0.5f));\n }", "public static float convertPixelsToDp(float px,Context context){\n\n DisplayMetrics metrics = context.getResources().getDisplayMetrics();\n float dp = px / (metrics.densityDpi / 160f);\n return dp;\n\n }", "public static int dp2px(Context context,int dp){\r\n return (int) TypedValue.applyDimension(\r\n TypedValue.COMPLEX_UNIT_DIP,\r\n dp,\r\n context.getResources().getDisplayMetrics());\r\n }", "protected int dpToPx() {\n Resources r = getResources();\n return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 10, r.getDisplayMetrics()));\n }", "public int dpToPx(int dp) {\n float density = this.getResources().getDisplayMetrics().density;\n return Math.round((float) dp * density);\n }", "public int convertPixelToDP(Context context, int px) {\n Resources resources = context.getResources();\n DisplayMetrics metrics = resources.getDisplayMetrics();\n int dp = (int) (px * (metrics.densityDpi / 160f));\n return dp;\n }", "public static float convertPixelsToDp(float px, Context context) {\r\n Resources resources = context.getResources();\r\n DisplayMetrics metrics = resources.getDisplayMetrics();\r\n float dp = px / (metrics.densityDpi / 160f);\r\n return dp;\r\n }", "public static float convertPixelsToDp( float px, Context context ) {\n Resources resources = context.getResources();\n DisplayMetrics metrics = resources.getDisplayMetrics();\n float dp = px / ( (float) metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT );\n return dp;\n }", "public static int dpToPx(int dp) {\n DisplayMetrics displayMetrics = BasicApplication.getContext().getResources()\n .getDisplayMetrics();\n return (int) (dp * displayMetrics.density + 0.5f);\n }", "protected static int dpToPixel(Context context, float dp) {\n Resources resources = context.getResources();\n DisplayMetrics metrics = resources.getDisplayMetrics();\n\n try {\n return (int) (dp * (metrics.densityDpi / 160f));\n } catch (NoSuchFieldError ignored) {\n return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, metrics);\n }\n }", "public static float convertPixelsToDp(float px, Context context) {\n Resources resources = context.getResources();\n DisplayMetrics metrics = resources.getDisplayMetrics();\n float dp = px / ((float) metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT);\n return dp;\n }", "public static float convertPixelsToDp(float px, Context context) {\n Resources resources = context.getResources();\n DisplayMetrics metrics = resources.getDisplayMetrics();\n float dp = px / ((float) metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT);\n return dp;\n }", "public static float convertPixelsToDp(float px, Context context) {\n Resources resources = context.getResources();\n DisplayMetrics metrics = resources.getDisplayMetrics();\n float dp = px / ((float) metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT);\n return dp;\n }", "public int dpToPx(int dp) {\n Resources resources = activity.getResources();\n DisplayMetrics metrics = resources.getDisplayMetrics();\n int px = (int) (dp * ((float) metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT));\n return px;\n }", "public static float dpToPx(Context ctx, float dp){\n return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, ctx.getResources().getDisplayMetrics());\n }", "public static int dpToPx(int dp, Context ctx)\n {\n float density = ctx.getResources().getDisplayMetrics().density;\n return Math.round((float) dp * density);\n }", "public static int pixelToDip(Context context, int px) {\n DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();\n return Math.round(px / (displayMetrics.xdpi / DisplayMetrics.DENSITY_DEFAULT));\n }", "public static int dp2px(final float dpValue) {\n final float scale = Resources.getSystem().getDisplayMetrics().density;\n return (int) (dpValue * scale + 0.5f);\n }", "public float pxToDp(float px){\n\t Resources resources = activity.getResources();\n\t DisplayMetrics metrics = resources.getDisplayMetrics();\n\t float dp = px / (metrics.densityDpi / 160f);\n\t return dp;\n\t }", "public static int px2dip(int px) {\n DisplayMetrics metrics = getResources().getDisplayMetrics();\n float density = metrics.density;\n return (int) (px / density + 0.5f);\n }", "public static int getPx(int dp) {\n if (dpi == 0) {\n DisplayMetrics displayMetrics = app.getResources().getDisplayMetrics();\n dpi = displayMetrics.densityDpi;\n }\n return dp * dpi / 160;\n }", "public static int pxFromDp(Context context, float dp) {\n return Math.round(dp * context.getResources().getDisplayMetrics().density);\n }", "public static float pxToDp(Context context, float px) {\n return (int) (px / Resources.getSystem().getDisplayMetrics().density);\n }", "public static float convertDpToPx(float dp,int dpi){\n\t\treturn dp * (dpi / 160f);\n\t}", "@SuppressWarnings(\"unused\")\n public float dipToPixel(float dip) {\n // Get the display metrics\n DisplayMetrics metrics = this.getDisplayMetrics(this.getContext());\n // Calc the conversion by the screen density\n return dip * metrics.density;\n }", "public static int dip2px(Context context, float dpValue) {\n final float scale = context.getResources().getDisplayMetrics().density;\n return (int) (dpValue * scale + 0.5f);\n }", "public static int dip2px(Context context, float dpValue) {\n final float scale = context.getResources().getDisplayMetrics().density;\n return (int) (dpValue * scale + 0.5f);\n }", "public static int dpToPx(Context context, int dp) {\n return (int) (dp * Resources.getSystem().getDisplayMetrics().density);\n }", "public static float dpToPx(Context context, float dp) {\n DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();\n return (int) ((dp * displayMetrics.density) + 0.5);\n }", "public static float dpToPx(Resources res, float dp) {\n float px = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, res.getDisplayMetrics());\n return px;\n }", "public static float converPxToDp(int px, int dpi){\n\t\treturn px / (dpi / 160f);\n\t}", "public static int convertToDip(DisplayMetrics displayMetrics, int sizeInPixels) {\n return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, sizeInPixels, displayMetrics);\n }", "public static int convertDp2Px(Context context, int dpValue) {\n final float scale = context.getResources().getDisplayMetrics().density;\n return (int) (dpValue * scale + 0.5f);\n }", "public int pxToDp(float px,Context context) {\n final float scale = context.getResources().getDisplayMetrics().density;\n // Convert the dps to pixels, based on density scale\n return (int) (px * scale + 0.5f);\n }", "public static int convertPx2Dp(Context context, float pxValue) {\n final float scale = context.getResources().getDisplayMetrics().density;\n return (int) (pxValue / scale + 0.5f);\n }", "public static int px2dp(final float pxValue) {\n final float scale = Resources.getSystem().getDisplayMetrics().density;\n return (int) (pxValue / scale + 0.5f);\n }", "public static int px2dip(Context context, float pxValue) {\n final float scale = context.getResources().getDisplayMetrics().density;\n return (int) (pxValue / scale + 0.5f);\n }", "public int dpToPx(int pDp){\n CodeIntegrityUtils.checkNotNull(pDp, \"Cannot convert NULL dp\");\n return 1;\n //return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, pDp, mDisplayMetrics);\n }", "public static float dpToPx(Context context, float valueInDp) {\n DisplayMetrics metrics = context.getResources().getDisplayMetrics();\n return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, valueInDp, metrics);\n }", "public static int dipToPixels(Context context, int dip) {\n /*DisplayMetrics displayMetrics = getContext().getResources().getDisplayMetrics();\n int px = Math.round(dp * (displayMetrics.xdpi / DisplayMetrics.DENSITY_DEFAULT));\n return px;*/\n Resources r = context.getResources();\n float px = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dip, r.getDisplayMetrics());\n return (int) px;\n }", "public static int convertdpToPx(int dps) {\n final float scale = App.getAppContext().getResources().getDisplayMetrics().density;\n int pixels = (int) (dps * scale + 0.5f);\n return pixels;\n }", "public double getAsDpi() {\n\t\tif (units != 1 || pixelsxUnitX != pixelsxUnitY)\n\t\t\treturn -1;\n\t\treturn ((double) pixelsxUnitX) * 0.0254;\n\t}", "public static int dpToPx(Context context, int dp) {\n return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, context.getResources().getDisplayMetrics());\n }", "public static int dpToPx(Context context, int dp) {\n DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();\n return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, displayMetrics);\n }", "private float normalizedToScreen(double normalizedCoord) {\n return (float) (padding + normalizedCoord * (getWidth() - 2 * padding));\n }", "public int GetPixelFromDips(float pixels) {\n final float scale = getResources().getDisplayMetrics().density;\n // Convert the dps to pixels, based on density scale\n return (int) (pixels * scale + 0.5f);\n }", "public int GetPixelFromDips(float pixels) {\n final float scale = getResources().getDisplayMetrics().density;\n // Convert the dps to pixels, based on density scale\n return (int) (pixels * scale + 0.5f);\n }", "public int getDipsFromPixel(float pixels) {\n // Get the screen's density scale\n final float scale = getResources().getDisplayMetrics().density;\n // Convert the dps to pixels, based on density scale\n return (int) (pixels * scale + 0.5f);\n }", "public int GetDipsFromPixel(float pixels) {\n // Get the screen's density scale\n final float scale = getResources().getDisplayMetrics().density;\n // Convert the dps to pixels, based on density scale\n return (int) (pixels * scale + 0.5f);\n }", "public int GetDipsFromPixel(float pixels) {\n final float scale = getResources().getDisplayMetrics().density;\n // Convert the dps to pixels, based on density scale\n return (int) (pixels * scale + 0.5f);\n }", "public static int convertToPix(float density, int sizeInDips) {\n float size = sizeInDips * density;\n return (int) size;\n }", "public abstract float getXdpi();", "public int getDipsFromPixel(float pixels) {\n\t\t// Get the screen's density scale\n\t\tfinal float scale = getResources().getDisplayMetrics().density;\n\t\t// Convert the dps to pixels, based on density scale\n\t\treturn (int) (pixels * scale + 0.5f);\n\t}", "public static int getPixels( Context mContext, int dipValue ) {\n if ( mContext != null && dipValue > 0 ) {\n Resources r = mContext.getResources();\n int px = (int) TypedValue.applyDimension( TypedValue.COMPLEX_UNIT_DIP, dipValue, r.getDisplayMetrics() );\n return px;\n } else\n return 0;\n }", "protected float getDpUnit() {\n return mDpUnit;\n }", "public abstract float getYdpi();", "public abstract float getDensity();", "public static int getDpFromPx(float pixel) {\n DisplayMetrics metrics = getDisplayMetrics();\n\n if (metrics != null) {\n final float scale = metrics.density;\n return (int) (pixel / scale + 0.5f);\n }\n\n return (int) pixel;\n }", "public static int sp2px(Context context,int sp){\r\n return (int) TypedValue.applyDimension(\r\n TypedValue.COMPLEX_UNIT_SP,\r\n sp,\r\n context.getResources().getDisplayMetrics());\r\n }", "public double[] getAsDpi2() {\n\t\tif (units != 1)\n\t\t\treturn new double[] { -1, -1 };\n\t\treturn new double[] { ((double) pixelsxUnitX) * 0.0254, ((double) pixelsxUnitY) * 0.0254 };\n\t}" ]
[ "0.8137664", "0.7979268", "0.79172313", "0.7820175", "0.74777704", "0.7462552", "0.73824525", "0.7357295", "0.7342331", "0.7269124", "0.7269124", "0.7269124", "0.7255873", "0.72284275", "0.7202448", "0.7194152", "0.7194152", "0.7194152", "0.7194152", "0.7194152", "0.7194152", "0.7194152", "0.7194152", "0.7194152", "0.7194152", "0.7194152", "0.7194152", "0.7194152", "0.7194152", "0.7194152", "0.7194152", "0.7193119", "0.7178163", "0.7135185", "0.71283966", "0.71059036", "0.70436776", "0.7023535", "0.6956609", "0.69552726", "0.6935715", "0.6921277", "0.6914828", "0.69065684", "0.6879989", "0.6856781", "0.6851756", "0.6836499", "0.6785342", "0.6784003", "0.67772907", "0.67772907", "0.67772907", "0.67691785", "0.6726355", "0.67129076", "0.6711809", "0.67013335", "0.6582781", "0.657712", "0.65746915", "0.6556974", "0.6500189", "0.64851654", "0.64661574", "0.64615345", "0.64615345", "0.64607966", "0.6450123", "0.6414707", "0.6370825", "0.63477486", "0.63411975", "0.63350314", "0.6321953", "0.63191015", "0.6297227", "0.6281173", "0.6279996", "0.6273043", "0.6166718", "0.6153258", "0.6143084", "0.61031514", "0.6052961", "0.6048572", "0.6048572", "0.6029594", "0.59993976", "0.5998047", "0.5937374", "0.5920986", "0.5900163", "0.576877", "0.5714652", "0.57060206", "0.56883043", "0.5685463", "0.5678219", "0.56663835" ]
0.71029353
36
This method converts device specific pixels to density independent pixels.
public float pxToDp(float px){ Resources resources = activity.getResources(); DisplayMetrics metrics = resources.getDisplayMetrics(); float dp = px / (metrics.densityDpi / 160f); return dp; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static float convertDpToPixel(float dp){\n return dp * ((float) Resources.getSystem().getDisplayMetrics().densityDpi / DisplayMetrics.DENSITY_DEFAULT);\n }", "private int toPixels(int dp)\n {\n final float scale = getResources().getDisplayMetrics().density;\n return (int) (dp * scale + 0.5f);\n }", "public static float convertPixelsToDp(float px, Context context){\n return px / ((float) context.getResources().getDisplayMetrics().densityDpi / DisplayMetrics.DENSITY_DEFAULT);\n }", "private float convertDpToPixel(float dp){\n Resources resources = getContext().getResources();\n DisplayMetrics metrics = resources.getDisplayMetrics();\n float px = dp * (metrics.densityDpi / 160f);\n return px;\n }", "public static int densityToPixels(Context context, float dp) {\n\t\tDisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();\n return Math.round(dp * (displayMetrics.xdpi / DisplayMetrics.DENSITY_DEFAULT));\n\t}", "public abstract float getDensity();", "public static float Dp2Pixel(float dp, Context context){\n Resources resources = context.getResources();\n DisplayMetrics metrics = resources.getDisplayMetrics();\n float px = dp * ((float)metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT);\n return px;\n }", "private static int convertDpToPixel(float dp) {\n DisplayMetrics metrics = Resources.getSystem().getDisplayMetrics();\n float px = dp * (metrics.densityDpi / 160f);\n return Math.round(px);\n }", "public int getDipsFromPixel(float pixels) {\n // Get the screen's density scale\n final float scale = getResources().getDisplayMetrics().density;\n // Convert the dps to pixels, based on density scale\n return (int) (pixels * scale + 0.5f);\n }", "public int GetDipsFromPixel(float pixels) {\n // Get the screen's density scale\n final float scale = getResources().getDisplayMetrics().density;\n // Convert the dps to pixels, based on density scale\n return (int) (pixels * scale + 0.5f);\n }", "public static int convertToPix(float density, int sizeInDips) {\n float size = sizeInDips * density;\n return (int) size;\n }", "public static float convertPixelsToDp(float px, Context context){\r\n Resources resources = context.getResources();\r\n DisplayMetrics metrics = resources.getDisplayMetrics();\r\n float dp = px / ((float)metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT);\r\n\r\n Log.d(\"convertPixelsToDp \", \"dp = \" + dp + \" - dp\");\r\n return dp;\r\n }", "public int getDipsFromPixel(float pixels) {\n\t\t// Get the screen's density scale\n\t\tfinal float scale = getResources().getDisplayMetrics().density;\n\t\t// Convert the dps to pixels, based on density scale\n\t\treturn (int) (pixels * scale + 0.5f);\n\t}", "public int GetDipsFromPixel(float pixels) {\n final float scale = getResources().getDisplayMetrics().density;\n // Convert the dps to pixels, based on density scale\n return (int) (pixels * scale + 0.5f);\n }", "public static float pixels2Dp(float px, Context context){\n Resources resources = context.getResources();\n DisplayMetrics metrics = resources.getDisplayMetrics();\n float dp = px / ((float)metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT);\n return dp;\n }", "public static float convertDpToPixel(float dp, Context context){\n Resources resources = context.getResources();\n DisplayMetrics metrics = resources.getDisplayMetrics();\n float px = dp * ((float)metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT);\n return px;\n }", "public static float convertPixelsToDp( float px, Context context ) {\n Resources resources = context.getResources();\n DisplayMetrics metrics = resources.getDisplayMetrics();\n float dp = px / ( (float) metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT );\n return dp;\n }", "private static int convertDpToPx(int dp) {\r\n return (int) (dp * Resources.getSystem().getDisplayMetrics().density);\r\n }", "@DISPID(1610940434) //= 0x60050012. The runtime will prefer the VTID if present\n @VTID(40)\n double density();", "public static float convertPixelsToDp(float px,Context context){\n\n DisplayMetrics metrics = context.getResources().getDisplayMetrics();\n float dp = px / (metrics.densityDpi / 160f);\n return dp;\n\n }", "public int GetPixelFromDips(float pixels) {\n final float scale = getResources().getDisplayMetrics().density;\n // Convert the dps to pixels, based on density scale\n return (int) (pixels * scale + 0.5f);\n }", "public int GetPixelFromDips(float pixels) {\n final float scale = getResources().getDisplayMetrics().density;\n // Convert the dps to pixels, based on density scale\n return (int) (pixels * scale + 0.5f);\n }", "public static float convertPixelsToDp(float px, Context context) {\r\n Resources resources = context.getResources();\r\n DisplayMetrics metrics = resources.getDisplayMetrics();\r\n float dp = px / (metrics.densityDpi / 160f);\r\n return dp;\r\n }", "public static float convertPixelsToDp(float px, Context context) {\n Resources resources = context.getResources();\n DisplayMetrics metrics = resources.getDisplayMetrics();\n float dp = px / ((float) metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT);\n return dp;\n }", "public static float convertPixelsToDp(float px, Context context) {\n Resources resources = context.getResources();\n DisplayMetrics metrics = resources.getDisplayMetrics();\n float dp = px / ((float) metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT);\n return dp;\n }", "public static float convertPixelsToDp(float px, Context context) {\n Resources resources = context.getResources();\n DisplayMetrics metrics = resources.getDisplayMetrics();\n float dp = px / ((float) metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT);\n return dp;\n }", "public int convertPixelToDP(Context context, int px) {\n Resources resources = context.getResources();\n DisplayMetrics metrics = resources.getDisplayMetrics();\n int dp = (int) (px * (metrics.densityDpi / 160f));\n return dp;\n }", "public static float convertDpToPixel(float dp, Context context) {\n Resources resources = context.getResources();\n DisplayMetrics metrics = resources.getDisplayMetrics();\n float px = dp * ((float) metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT);\n return px;\n }", "public static float convertDpToPixel(float dp, Context context) {\n Resources resources = context.getResources();\n DisplayMetrics metrics = resources.getDisplayMetrics();\n float px = dp * ((float) metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT);\n return px;\n }", "public static float convertDpToPixel(float dp, Context context) {\n Resources resources = context.getResources();\n DisplayMetrics metrics = resources.getDisplayMetrics();\n float px = dp * ((float) metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT);\n return px;\n }", "public static float convertDpToPixel(float dp, Context context) {\r\n Resources resources = context.getResources();\r\n DisplayMetrics metrics = resources.getDisplayMetrics();\r\n float px = dp * (metrics.densityDpi / 160f);\r\n return px;\r\n }", "public static float convertDpToPixel(float dp, Context context) {\n Resources resources = context.getResources();\n DisplayMetrics metrics = resources.getDisplayMetrics();\n float px = dp * (metrics.densityDpi / 160f);\n return px;\n }", "public static int convertDpToPixel(float dp, Context context) {\r\n\t\tResources resources = context.getResources();\r\n\t\tDisplayMetrics metrics = resources.getDisplayMetrics();\r\n\t\tint px = Math.round(dp * ( metrics.densityDpi / 160f ));\r\n\t\treturn px;\r\n\t}", "public static int convertPixsToDips(Context context, int pixels) {\n final float scale = context.getResources().getDisplayMetrics().density;\n // Convert the dps to pixels, based on density scale\n return (int) (pixels * scale + 0.5f);\n }", "public static int pixelToDip(Context context, int px) {\n DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();\n return Math.round(px / (displayMetrics.xdpi / DisplayMetrics.DENSITY_DEFAULT));\n }", "protected static int dpToPixel(Context context, float dp){\n Resources resources = context.getResources();\n DisplayMetrics metrics = resources.getDisplayMetrics();\n return (int) (dp * (metrics.densityDpi / 160f));\n }", "private int dpToPx(int dp) {\r\n\t\tdouble screenDensity = this.getResources().getDisplayMetrics().density;\r\n\t\treturn (int) (screenDensity * (double) dp);\r\n\t}", "public static float m21412o(Context context) {\n return context.getResources().getDisplayMetrics().density;\n }", "public int dp2px(float f) {\n return (int) ((f * getContext().getResources().getDisplayMetrics().density) + 0.5f);\n }", "public static float pxToDp(Context context, float px) {\n return (int) (px / Resources.getSystem().getDisplayMetrics().density);\n }", "public static int px2dip(int px) {\n DisplayMetrics metrics = getResources().getDisplayMetrics();\n float density = metrics.density;\n return (int) (px / density + 0.5f);\n }", "public static int convertDpToPixel(Context context, float dp) {\n Resources resources = context.getResources();\n DisplayMetrics metrics = resources.getDisplayMetrics();\n int px = (int) (dp / (metrics.densityDpi / 160f));\n return px;\n }", "public abstract float getXdpi();", "public static int px2dip(Context context, float pxValue) {\n final float scale = context.getResources().getDisplayMetrics().density;\n return (int) (pxValue / scale + 0.5f);\n }", "public float dpToPx(float dp){\n\t Resources resources = activity.getResources();\n\t DisplayMetrics metrics = resources.getDisplayMetrics();\n\t float px = dp * (metrics.densityDpi / 160f);\n\t return px;\n\t }", "@SuppressWarnings(\"unused\")\n public float dipToPixel(float dip) {\n // Get the display metrics\n DisplayMetrics metrics = this.getDisplayMetrics(this.getContext());\n // Calc the conversion by the screen density\n return dip * metrics.density;\n }", "public static float dp2px(float dp, Context context) {\n //return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, context.getResources().getDisplayMetrics());\n Resources resources = context.getResources();\n DisplayMetrics metrics = resources.getDisplayMetrics();\n return dp * (metrics.densityDpi / 160f);\n }", "public static int convertPx2Dp(Context context, float pxValue) {\n final float scale = context.getResources().getDisplayMetrics().density;\n return (int) (pxValue / scale + 0.5f);\n }", "public float calculateSpeedPerPixel(DisplayMetrics displayMetrics) {\n return 100.0f / ((float) displayMetrics.densityDpi);\n }", "public static int getDpFromPx(float pixel) {\n DisplayMetrics metrics = getDisplayMetrics();\n\n if (metrics != null) {\n final float scale = metrics.density;\n return (int) (pixel / scale + 0.5f);\n }\n\n return (int) pixel;\n }", "public static float converPxToDp(int px, int dpi){\n\t\treturn px / (dpi / 160f);\n\t}", "protected static int dpToPixel(Context context, float dp) {\n Resources resources = context.getResources();\n DisplayMetrics metrics = resources.getDisplayMetrics();\n\n try {\n return (int) (dp * (metrics.densityDpi / 160f));\n } catch (NoSuchFieldError ignored) {\n return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, metrics);\n }\n }", "public static void setImagesSizeWithDpi(int deviceDPI){\n switch (deviceDPI){\n case DisplayMetrics.DENSITY_XHIGH:\n POSTER_SIZE = \"w342\";\n BACKDROP_SIZE = \"w780\";\n break;\n case DisplayMetrics.DENSITY_XXHIGH:\n POSTER_SIZE = \"w500\";\n BACKDROP_SIZE = \"w1000\";\n break;\n case DisplayMetrics.DENSITY_XXXHIGH:\n POSTER_SIZE = \"w780\";\n BACKDROP_SIZE = \"w1920\";\n break;\n default:\n POSTER_SIZE = \"w185\";\n BACKDROP_SIZE = \"w500\";\n break;\n }\n }", "protected static double getScreenPoints(int pixelsValue) {\r\n int screenResolution = Toolkit.getDefaultToolkit().getScreenResolution();\r\n double result = (pixelsValue * 72.0) / screenResolution;\r\n return result;\r\n }", "public float getDensity() {\n return density;\n }", "public float getDensity() {\n return density;\n }", "public int pxToDp(float px,Context context) {\n final float scale = context.getResources().getDisplayMetrics().density;\n // Convert the dps to pixels, based on density scale\n return (int) (px * scale + 0.5f);\n }", "public static int px2dp(final float pxValue) {\n final float scale = Resources.getSystem().getDisplayMetrics().density;\n return (int) (pxValue / scale + 0.5f);\n }", "static public int toPX(int dp)\n\t{ \n\t\tDisplayMetrics displayMetrics = OsoNegroApp.getAndroidActivity().getResources().getDisplayMetrics();\n\t\treturn (int)((dp * displayMetrics.density) + 0.5);\n\t}", "public static int dp2px(final float dpValue) {\n final float scale = Resources.getSystem().getDisplayMetrics().density;\n return (int) (dpValue * scale + 0.5f);\n }", "private int convertDpToPx(int dp) {\n return (int) (dp * scale + 0.5f);\n }", "public static int dpToPx(int dp, Context ctx)\n {\n float density = ctx.getResources().getDisplayMetrics().density;\n return Math.round((float) dp * density);\n }", "public void setDensity(float density) {\n this.density = density;\n }", "public double getDensity() {\n\t\tdouble widthX = this.maxx.getData().getX()-this.minx.getData().getX();\n\t\tdouble widthY = this.maxy.getData().getY()-this.miny.getData().getY();\n\t\treturn (this.size)/(widthX * widthY);\n\t}", "public String getScreenDensity() {\n return (mScreenDensity);\n }", "public int dpToPx(int dp) {\n float density = this.getResources().getDisplayMetrics().density;\n return Math.round((float) dp * density);\n }", "public int dpToPx(int dp) {\n Resources resources = activity.getResources();\n DisplayMetrics metrics = resources.getDisplayMetrics();\n int px = (int) (dp * ((float) metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT));\n return px;\n }", "@Override\n protected Void doInBackground(Void... params) {\n suResult = Shell.SU.run(new String[] {\n \"wm density 640\"\n });\n return null;\n }", "public static int convertDp2Px(Context context, int dpValue) {\n final float scale = context.getResources().getDisplayMetrics().density;\n return (int) (dpValue * scale + 0.5f);\n }", "public abstract float getYdpi();", "public static int dpToPx(Context context, int dp) {\n return (int) (dp * Resources.getSystem().getDisplayMetrics().density);\n }", "public static int dpToPx(int dp) {\n DisplayMetrics displayMetrics = BasicApplication.getContext().getResources()\n .getDisplayMetrics();\n return (int) (dp * displayMetrics.density + 0.5f);\n }", "public int dptopx(float dp){\n final float scale = getActivity().getResources().getDisplayMetrics().density;\n // Convert the dps to pixels, based on density scale\n return ((int) (dp * scale + 0.5f));\n }", "public static int dip2px(Context context, float dpValue) {\n final float scale = context.getResources().getDisplayMetrics().density;\n return (int) (dpValue * scale + 0.5f);\n }", "public static int dip2px(Context context, float dpValue) {\n final float scale = context.getResources().getDisplayMetrics().density;\n return (int) (dpValue * scale + 0.5f);\n }", "private int dpToPx(int dp) {\n Resources r = getResources();\n return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics()));\n }", "private int dpToPx(int dp) {\n Resources r = getResources();\n return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics()));\n }", "private int dpToPx(int dp) {\n Resources r = getResources();\n return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics()));\n }", "private int dpToPx(int dp) {\n Resources r = getResources();\n return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics()));\n }", "private int dpToPx(int dp) {\n Resources r = getResources();\n return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics()));\n }", "private int dpToPx(int dp) {\n Resources r = getResources();\n return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics()));\n }", "private int dpToPx(int dp) {\n Resources r = getResources();\n return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics()));\n }", "private int dpToPx(int dp) {\n Resources r = getResources();\n return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics()));\n }", "private int dpToPx(int dp) {\n Resources r = getResources();\n return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics()));\n }", "private int dpToPx(int dp) {\n Resources r = getResources();\n return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics()));\n }", "private int dpToPx(int dp) {\n Resources r = getResources();\n return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics()));\n }", "private int dpToPx(int dp) {\n Resources r = getResources();\n return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics()));\n }", "private int dpToPx(int dp) {\n Resources r = getResources();\n return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics()));\n }", "private int dpToPx(int dp) {\n Resources r = getResources();\n return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics()));\n }", "private int dpToPx(int dp) {\n Resources r = getResources();\n return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics()));\n }", "private int dpToPx(int dp) {\n Resources r = getResources();\n return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics()));\n }", "public double getAsDpi() {\n\t\tif (units != 1 || pixelsxUnitX != pixelsxUnitY)\n\t\t\treturn -1;\n\t\treturn ((double) pixelsxUnitX) * 0.0254;\n\t}", "public static int dp2px(Context context,int dp){\r\n return (int) TypedValue.applyDimension(\r\n TypedValue.COMPLEX_UNIT_DIP,\r\n dp,\r\n context.getResources().getDisplayMetrics());\r\n }", "public double[] getAsDpi2() {\n\t\tif (units != 1)\n\t\t\treturn new double[] { -1, -1 };\n\t\treturn new double[] { ((double) pixelsxUnitX) * 0.0254, ((double) pixelsxUnitY) * 0.0254 };\n\t}", "public static int convertToDip(DisplayMetrics displayMetrics, int sizeInPixels) {\n return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, sizeInPixels, displayMetrics);\n }", "private float normalizedToScreen(double normalizedCoord) {\n return (float) (padding + normalizedCoord * (getWidth() - 2 * padding));\n }", "public static int pxFromDp(Context context, float dp) {\n return Math.round(dp * context.getResources().getDisplayMetrics().density);\n }", "public final float mo9235c(DisplayMetrics displayMetrics) {\n return 100.0f / ((float) displayMetrics.densityDpi);\n }", "public static float m431a(Resources resources, float f) {\n return (resources.getDisplayMetrics().density * f) + 0.5f;\n }", "public static int m88565a(Context context, float f) {\n AppMethodBeat.m2504i(65561);\n int i = (int) ((context.getResources().getDisplayMetrics().density * f) + 0.5f);\n AppMethodBeat.m2505o(65561);\n return i;\n }" ]
[ "0.6721851", "0.6670633", "0.66450894", "0.64651334", "0.6462232", "0.6410542", "0.6400529", "0.6350613", "0.62995636", "0.6269187", "0.6243127", "0.620961", "0.6206477", "0.6181004", "0.61496526", "0.614231", "0.6140301", "0.6134919", "0.6117075", "0.6103683", "0.6102733", "0.6102733", "0.60773414", "0.6072054", "0.6072054", "0.6072054", "0.60405904", "0.60353935", "0.60353935", "0.60353935", "0.6030914", "0.6012273", "0.5958075", "0.5931868", "0.59136367", "0.5903478", "0.58583456", "0.5768122", "0.5765814", "0.57646793", "0.5738378", "0.5726183", "0.5704547", "0.56636983", "0.5603798", "0.5527982", "0.5527523", "0.55114204", "0.5504674", "0.5493446", "0.5490247", "0.54887366", "0.54841787", "0.5468426", "0.5430087", "0.5430087", "0.5429712", "0.54277265", "0.5416941", "0.5403795", "0.53754205", "0.5362563", "0.533482", "0.53260344", "0.5291978", "0.5280583", "0.52710295", "0.52561724", "0.5254765", "0.5237533", "0.52194", "0.52183956", "0.52182484", "0.5205631", "0.5205631", "0.51996475", "0.51996475", "0.51996475", "0.51996475", "0.51996475", "0.51996475", "0.51996475", "0.51996475", "0.51996475", "0.51996475", "0.51996475", "0.51996475", "0.51996475", "0.51996475", "0.51996475", "0.51996475", "0.5195437", "0.51834863", "0.5178621", "0.5166337", "0.5116907", "0.5113792", "0.51126325", "0.51064533", "0.5104231" ]
0.543588
54
delays the execution of a function
public S<T> delay(int time, String function){ final String s =function; final Handler handler = new Handler(); handler.postDelayed(new Runnable() { @Override public void run() { callFun(s); } }, time); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract int delay();", "private void delay() {\n\ttry {\n\t\tThread.sleep(500);\n\t} catch (InterruptedException e) {\n\t\t// TODO Auto-generated catch block\n\t\te.printStackTrace();\n\t}\t\n\t}", "private void delay() {\n\t\tDelay.msDelay(1000);\n\t}", "public static void delay() {\n\n long ONE_SECOND = 1_000;\n\n try {\n Thread.sleep(ONE_SECOND);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "void sleep()\r\n\t{\r\n\t\t\r\n\t}", "void executeAsync(long delayMs, Runnable task);", "void sleep();", "void sleep();", "private void emulateDelay() {\n try {\n Thread.sleep(700);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "@Override\n public void execute() {\n Time.sleep(3000);\n Starting.execute();\n }", "private static void addDelay() {\n try {\n Thread.sleep(4000);\n } catch (InterruptedException ignored) {\n }\n }", "public static void test1() {\n\t\ttestIfThisCallBlocks();\n\t\tSystem.out.println(\"Done\");\n\t\tsleep(3000);\n\t\tSystem.out.println(\"Ending\");\n\t}", "@Override\n public native void delay(int ms);", "public void schedule(Runnable job, long delay, TimeUnit unit);", "private void delay (int milliSec)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tThread.sleep (milliSec);\r\n\t\t}\r\n\t\tcatch (InterruptedException e)\r\n\t\t{\r\n\t\t}\r\n\t}", "public void delayNext()\n {\n\tif (toDo.size() > 1)\n\t {\n\t\tTask t = toDo.get(0);\n\t\ttoDo.set(0, toDo.get(1));\n\t\ttoDo.set(1, t);\n\t }\n }", "public void moveDelay ( )\r\n\t{\r\n\t\ttry {\r\n\t\t\tThread.sleep( 1000 );\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "void sleep ();", "public void delay(long waitAmount){\r\n long time = System.currentTimeMillis();\r\n while ((time+waitAmount)>=System.currentTimeMillis()){ \r\n //nothing\r\n }\r\n }", "private void doCommand() {\n try {\n TimeUnit.SECONDS.sleep(2L);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "private void delayStart() {\n try {\n Thread.sleep(3000);\n } catch (InterruptedException e) {\n LOGGER.error(\"Could not sleep\", e);\n }\n }", "public static void randomDelay() {\n\n Random random = new Random();\n int delay = 500 + random.nextInt(2000);\n try {\n sleep(delay);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "public Integer threadDelay();", "protected abstract void afterWait();", "public void delay(){\n try {\n Thread.sleep((long) ((samplingTime * simulationSpeed.factor)* 1000));\n } catch (InterruptedException e) {\n started = false;\n }\n }", "void threadDelay() {\n saveState();\n if (pauseSimulator) {\n halt();\n }\n try {\n Thread.sleep(Algorithm_Simulator.timeGap);\n\n } catch (InterruptedException ex) {\n Logger.getLogger(RunBFS.class.getName()).log(Level.SEVERE, null, ex);\n }\n if (pauseSimulator) {\n halt();\n }\n }", "private void pause() {\n pause(myDelay);\n }", "@Override\n public void doTask() throws InterruptedException {\n Thread.sleep(5000);\n }", "private void sleep() {\n try {\n Thread.sleep(500);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "private void doSintStuff() {\r\n\t\ttry {\r\n\t\t\tThread.sleep(1000);\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "private void delay( int n )\n {\n try {\n Thread.sleep(n);\n } catch( InterruptedException e ) {\n System.exit(0);\n }\n }", "private void dofakework() {\n\t\ttry {\n\t\t\tThread.sleep(1000);\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public <T> ValueFuture<T> schedule(Callable<T> job, long delay, TimeUnit unit);", "public static void delay(int ms){\r\n\t\t\r\n\t\ttry {\r\n\t\t\tThread.sleep(ms);\r\n\t\t} catch (InterruptedException e1) {\r\n\t\t\te1.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t}", "private void simulateDelay(long millis) {\n try {\n Thread.sleep(millis);\n } catch (InterruptedException ignored) {\n }\n }", "public void run() {\n loadAlertAnimationDelay(aType);\n }", "private void action(String action) {\n\n\t\tSystem.out.println(name + \" is \" + action);\n\n\t\ttry {\n\t\t\tThread.sleep(((long)(Math.random() * 150)));\n\t\t} catch (InterruptedException e) {\n\t\t\tThread.currentThread().interrupt();\n\t\t}\n\t}", "@Override\n\tpublic void sleep() {\n\t\t\n\t}", "public static void asyncLater(long delay, Run runnable) {\n\t\tnew BukkitRunnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\trunnable.run();\n\t\t\t}\n\t\t}.runTaskLaterAsynchronously(AreaShop.getInstance(), delay);\n\t}", "public void setDelay(double clock);", "protected void execute() {\n \t\n \tcurrent_time = System.currentTimeMillis();\n \t\n \tlift.liftDown(LIFT_SPEED);\n }", "@Override\n public boolean isDelayedExecutionSupported()\n {\n return true;\n }", "private static void delay() throws InterruptedException {\n\t\tTimeUnit.MILLISECONDS.sleep((long) (minDelay + (long)(Math.random() * ((maxDelay - minDelay) + 1))));\n\t}", "public void sleep(){\n\n System.out.println(\"ZZZZZZZZZ bubble bubble bubble\");\n }", "private void sleep() {\n try {\n Thread.sleep(3000L);\n }\n catch (Exception ignored) {\n Log.trace(\"Sleep got interrupted.\");\n }\n }", "public void timeDelay(int a) {\n try {\n Thread.sleep(a*1000);\n System.out.println(\". . .\");\n } catch(InterruptedException ex) {\n Thread.currentThread().interrupt();\n }\n }", "private static void sleep(int n) {\n try {\n TimeUnit.MILLISECONDS.sleep(n);\n } catch (InterruptedException e) {\n System.out.print(\"\\ndelay failed\");\n }\n }", "boolean isDelayed();", "@Override\r\n\tpublic void doTimeStep() {\n\t\tthis.run(Critter.getRandomInt(8));\r\n\t}", "public void warte( int ms )\n {\n try\n {\n Thread.sleep( ms );\n }\n catch ( InterruptedException e )\n {\n e.printStackTrace();\n }\n }", "public final void activate(){\n waitingToExecute = true;\n }", "void waitingForMyTurn();", "public static void delay() throws InterruptedException {\n // This is the sleep thread method that makes the program sleep\n // for a program amount of milliseconds to slow down the program\n Thread.sleep(1500);\n }", "public void callTheWaiter();", "@Scheduled(fixedDelay = 3000)\n\tpublic void scheduleTaskWithFixedDelay() {\n\t\tlog.info(\"Fixed Delay Task :: Execution Time - {}\", dateTimeFormatter.format(LocalDateTime.now()));\n\t\t//Sleep TimeUnit\n//\t\ttry {\n//\t\t\tTimeUnit.SECONDS.sleep(5);\n//\t\t} catch (Exception e) {\n//\t\t\tlog.error(\"Ran into an error {}\", e);\n//\t throw new IllegalStateException(e);\n//\t\t}\n\t}", "protected void execute() {\n \tshooterWheel.shooterWheelSpeedControllerAft.Pause();\n \tshooterWheel.shooterWheelSpeedControllerFwd.Pause();\n \t\n }", "@Test\n public void testDelay() {\n long future = System.currentTimeMillis() + (rc.getRetryDelay() * 1000L);\n\n rc.delay();\n\n assertTrue(System.currentTimeMillis() >= future);\n }", "public static void delay(){\n System.out.print(\"\");\r\n System.out.print(\"\");\r\n }", "public void delay(long millisec) {\n try {\n Thread.sleep(millisec);\n } catch (InterruptedException e) {\n LOGGER.info(e.getMessage());\n }\n }", "private void sleep()\n {\n try {\n Thread.sleep(Driver.sleepTimeMs);\n }\n catch (InterruptedException ex)\n {\n\n }\n }", "private void processFunction(String function) throws TargetException, InterruptedException {\n String[] pieces = function.split(\"\\\\*\");\n long delay = getDelay();\n int parallelThreadCount = 1;\n if (pieces.length > 1) {\n parallelThreadCount = Integer.parseInt(pieces[1]);\n }\n if (parallelThreadCount == 1) {\n performFunction(pieces[0], 1);\n } else {\n Thread[] threads = new Thread[parallelThreadCount];\n AtomicBoolean[] threadOK = new AtomicBoolean[parallelThreadCount];\n for (int i = 0; i < parallelThreadCount; i++) {\n threadOK[i] = new AtomicBoolean();\n threads[i] = new Thread(new Runner(pieces[0], i, threadOK[i]));\n threads[i].start();\n /*\n *No need to wait if we just started the last thread.\n */\n if (delay != 0 && i < parallelThreadCount - 1) {\n Thread.currentThread().sleep(delay);\n }\n }\n boolean allThreadsOK = true;\n for (int i = 0; i < parallelThreadCount; i++) {\n Thread t = threads[i];\n t.join(getTimeout());\n allThreadsOK &= threadOK[i].get();\n }\n \n if ( ! allThreadsOK) {\n throw new RuntimeException(\"At least one thread failed\");\n }\n }\n }", "@Override\n\t\tpublic void run() {\n\t\t\ttry {\n\t\t\t\tTimeUnit.SECONDS.sleep(3);\n\t\t\t} catch (InterruptedException 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}", "public static void sleep(int delay) {\n try {\n Thread.sleep(delay);\n } catch (InterruptedException e) {\n }\n }", "int delay(Player player);", "private static void delay(int amount, int gameSize) {\n \n try {\n \n Thread.sleep(amount*3/(gameSize*gameSize));\n \n } catch(InterruptedException ex) {\n \n Thread.currentThread().interrupt();\n }\n }", "public void think()\r\n/* 32: */ {\r\n/* 33: 29 */ think_blocking();\r\n/* 34: */ }", "public final void sleepBetweenActions()\n {\n long numOfMillis = Long\n .parseLong(getProperty(\"wait.between.user.actions.in.millis\"));\n if (numOfMillis > 10000)\n {\n numOfMillis = 10000;\n } else if (numOfMillis < 0)\n {\n numOfMillis = 0;\n }\n try\n {\n Thread.sleep(numOfMillis);\n } catch (InterruptedException e)\n {\n e.printStackTrace();\n }\n }", "public abstract void onWait();", "public void setDelay(long d){delay = d;}", "public static void syncLater(long delay, Run runnable) {\n\t\tnew BukkitRunnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\trunnable.run();\n\t\t\t}\n\t\t}.runTaskLater(AreaShop.getInstance(), delay);\n\t}", "public void preempt()\n\t{\n\t}", "@Scheduled(fixedDelay=5000) //indicamos que esta tarea se repetira cada 5 segundos \n\tpublic void doTask() {\n\t\tLOGGER.info(\"Time is: \"+ new Date());\n\t}", "private void await() {\n try {\n Thread.sleep(10 * 1000L);\n } catch (InterruptedException e) {\n // ignore\n }\n }", "public void setTimeout(int timeout);", "@Override\n public String call() throws Exception {\n System.out.println(\"start\");\n Thread.sleep(2000);\n System.out.println(\"sleep end\");\n return \"s\";\n }", "void after();", "public void execute() {\n if(cb) {\n Main.cb.step(Main.cpu.get8BitImm());\n }\n }", "public void setDelay(long delay) {\n this.delay = delay;\n }", "public void run() {\n\t\t\t\t\t\tif (__delayCounter == _delayCounter[0]) {\r\n\t\t\t\t\t\t\t_pageBook.showPage(__page);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}", "public static void sleep(int delay) {\n try {\n \t// int delay = (int)(Math.random()*maxDelay);\n Thread.sleep(delay);\n } catch (InterruptedException e) {}\n\t}", "void whenComplete();", "private void sleepFor(long t) {\n\t\ttry {\n\t\t\tThread.sleep(t);\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "protected abstract void after();", "private void thinking(){\n int sleepTime = (int)(Math.random()*2000);\n try{\n Thread.sleep(sleepTime);\n }catch (InterruptedException e){\n e.printStackTrace();\n }\n }", "@Override\n\tpublic void run(String... args) throws Exception {\n\t\tejemploDelayELements();\n\t}", "void doDaSleep(int milli)\n {\n try {\n Thread.sleep(milli);\n } catch (InterruptedException ex) {\n\n }\n }", "public void setDelayedTimeout(int seconds);", "public void sleep()\n\t{\n\t\ttry\n\t\t{\n\t\t\tThread.sleep(getMilliseconds());\n\t\t}\n\t\tcatch (InterruptedException e)\n\t\t{\n\t\t\t// ignore but return\n\t\t}\n\t}", "public static void m2703A() {\n Thread.sleep(100);\n }", "public static void shortWait(){\r\n\t\ttry {\r\n\t\t\tTimeUnit.SECONDS.sleep(5);\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\tSystem.out.println(\"Interruption happened due to sleep() method\");\r\n\t\t}\r\n\t}", "@Override\n\tpublic void sleeps() {\n\t\t\n\t}", "public void crawlDelay()\n\t{\n//\t\tint delay = robot.getCrawlDelay(best_match);\n//\t\tif (delay!=-1)\n//\t\t{\n//\t\t\ttry \n//\t\t\t{\n//\t\t\t\tTimeUnit.SECONDS.sleep(robot.getCrawlDelay(best_match));\n//\t\t\t} \n//\t\t\tcatch (InterruptedException e) \n//\t\t\t{\n//\t\t\t\treturn;\n//\t\t\t}\n//\t\t}\n\t}", "public static void waitForAI(){\n try {\n Thread.sleep(2000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "private void sleep(int number) {\n\t\ttry {\n\t\t\tThread.sleep(number);\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}}", "@Override\n\tpublic void act(float dt){\n\t\t\n\t}", "private void onComplete(int duration) {\n\t\t\n\t\tservice = Executors.newSingleThreadExecutor();\n\n\t\ttry {\n\t\t Runnable r = new Runnable() {\n\t\t @Override\n\t\t public void run() {\n\t\t // Database task\n\t\t \tcontrollerVars.setPlays(false);\n\t\t }\n\t\t };\n\t\t Future<?> f = service.submit(r);\n\n\t\t f.get(duration, TimeUnit.MILLISECONDS); // attempt the task for two minutes\n\t\t}\n\t\tcatch (final InterruptedException e) {\n\t\t // The thread was interrupted during sleep, wait or join\n\t\t}\n\t\tcatch (final TimeoutException e) {\n\t\t // Took too long!\n\t\t}\n\t\tcatch (final ExecutionException e) {\n\t\t // An exception from within the Runnable task\n\t\t}\n\t\tfinally {\n\t\t service.shutdown();\n\t\t}\t\t\n\t}", "private static <T> Callable<T> lazyval(final T value, final long delayMillis) {\n return new Callable<T>() {\n @Override\n public T call() throws Exception {\n Thread.sleep(delayMillis);\n log(\"Task completed with: \" + value);\n return value;\n }\n };\n // return () -> {\n // Thread.sleep(delayMillis);\n // log(\"Task completed with: \" + value);\n // return value;\n // };\n }", "protected void pause() {\n sleep(300);\n }", "public double getDelay();", "@Override\n public void onComplete(long dt) {\n }" ]
[ "0.6811681", "0.6698911", "0.66320926", "0.6518691", "0.64147764", "0.6359787", "0.6160223", "0.6160223", "0.6103592", "0.6101577", "0.6057996", "0.5971279", "0.5953132", "0.5952591", "0.5940088", "0.5924775", "0.59243405", "0.5912739", "0.58900815", "0.58871365", "0.5867817", "0.58570987", "0.58449215", "0.5844824", "0.58336616", "0.58229226", "0.58186746", "0.58138764", "0.58016604", "0.5791046", "0.57859975", "0.5781561", "0.576718", "0.5736396", "0.5704243", "0.5703691", "0.56897134", "0.566913", "0.5661727", "0.5661014", "0.5653259", "0.564043", "0.5636264", "0.56301004", "0.56268215", "0.56219137", "0.56055427", "0.5602498", "0.5599723", "0.5581377", "0.55723083", "0.5560179", "0.55576426", "0.55383676", "0.5535531", "0.5533421", "0.5532424", "0.55247176", "0.55204684", "0.55199015", "0.5510263", "0.55098695", "0.5503904", "0.5497676", "0.54885983", "0.54808336", "0.5461225", "0.54604703", "0.5459161", "0.5446909", "0.5431587", "0.5429054", "0.54242754", "0.5420414", "0.5420082", "0.5404047", "0.540262", "0.53928286", "0.5386125", "0.53859806", "0.53765565", "0.537615", "0.53752124", "0.5365498", "0.5362273", "0.53580856", "0.5357235", "0.5354346", "0.53472453", "0.5345183", "0.534415", "0.53351986", "0.5334937", "0.53347594", "0.5332881", "0.53303677", "0.53261703", "0.5305459", "0.52976626", "0.5297582" ]
0.63206196
6
Get the android version
public String androidVersion() { String release = Build.VERSION.RELEASE; int sdkVersion = Build.VERSION.SDK_INT; return "Android SDK: " + sdkVersion + " (" + release +")"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getAndroidVersionName() {\n return AndroidVersionName;\n }", "java.lang.String getAndroidKtxVersion();", "public String getSdkVersion() {\n return sdkVersion;\n }", "public String getVersion() {\n\t\tString version = \"0.0.0\";\n\n\t\tPackageManager packageManager = getPackageManager();\n\t\ttry {\n\t\t\tPackageInfo packageInfo = packageManager.getPackageInfo(\n\t\t\t\t\tgetPackageName(), 0);\n\t\t\tversion = packageInfo.versionName;\n\t\t} catch (NameNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn version;\n\t}", "public String getVersion() {\n\t\tString version = \"0.0.0\";\n\n\t\tPackageManager packageManager = getPackageManager();\n\t\ttry {\n\t\t\tPackageInfo packageInfo = packageManager.getPackageInfo(\n\t\t\t\t\tgetPackageName(), 0);\n\t\t\tversion = packageInfo.versionName;\n\t\t} catch (NameNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn version;\n\t}", "String getSdkVersion() {\n return sdkVersion;\n }", "private static String getAppVersionNumber(Context c) {\n String version = \"N/A\";\n try {\n final PackageManager packageManager = c.getPackageManager();\n if (packageManager == null) {\n return version;\n }\n\n PackageInfo packageInfo = packageManager.getPackageInfo(c.getPackageName(), 0);\n version = packageInfo.versionName;\n }\n catch (Exception e) {\n FLog.e(TAG, \"Unable to read the app version!\", e);\n }\n\n return version;\n }", "public static String obtenerversionApp(Context context){\n String respuesta=\"\";\n try {\n PackageInfo packageInfo=context.getPackageManager().getPackageInfo(context.getPackageName(),0);\n respuesta=packageInfo.versionName;\n } catch (PackageManager.NameNotFoundException e) {\n e.printStackTrace();\n }\n return respuesta;\n }", "java.lang.String getApplicationVersion();", "public static String getSDKVersion() {\n return Constants.Z_SDK_ID;\n }", "private String m5297b() {\n String str = \"\";\n try {\n return getPackageManager().getPackageInfo(getPackageName(), 0).versionName;\n } catch (NameNotFoundException e) {\n e.printStackTrace();\n return str;\n }\n }", "private void findOsVersion() {\n\t\tisGBOrLower = AppUtility.isAndroidGBOrLower();\n\t\tisICSOrHigher = AppUtility.isAndroidICSOrHigher();\n\t}", "protected static native String getVersion();", "int getCurrentVersion();", "public static String getAppVersion(){\r\n return getProperty(\"version\");\r\n }", "public int getSdkVersion() throws IOException {\n\t\tString s = exec(\"getprop ro.build.version.sdk\").replace('\\n', ' ').trim();\n\t\treturn Integer.parseInt(s);\n\t}", "public String getAppVersion() { return appVersion; }", "public String getProductVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "public String GetVersion() {\n\t\tString adapter_version = \"version: \" + adapter_version_;\n\t\treturn adapter_version;\n\t}", "public static String getApplicationVersion() {\n String appVersion = Settings.getAppVersion();\n return appVersion != null ? appVersion : \"?\";\n }", "public static String getAppVersionNumber(Context context) {\n\n\t\tString version = \"1.0\";\n\t\ttry {\n\t\t\tversion = context.getPackageManager().getPackageInfo(\n\t\t\t\t\tcontext.getPackageName(), 0).versionName;\n\t\t} catch (NameNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn \"app-\" + version;\n\t}", "private String getVersionName() {\n\n\t\tString versionName = \"\";\n\t\tPackageManager packageManager = getPackageManager();\n\t\ttry {\n\t\t\tPackageInfo packageInfo = packageManager\n\t\t\t\t\t.getPackageInfo(getPackageName(), 0);// 获取包的内容\n\t\t\t// int versionCode = packageInfo.versionCode;\n\t\t\tversionName = packageInfo.versionName;\n\t\t\tSystem.out.println(\"versionName = \" + versionName);\n\t\t} catch (NameNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn versionName;\n\t}", "public native static String getLameVersion();", "public native static String getLameVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "long getVersion();", "long getVersion();", "long getVersion();", "long getVersion();", "public static String getAppVersionName(Context ctx) {\n String mAppVer = \"1.0\";\n /*try {\n PackageManager pm = ctx.getPackageManager();\n PackageInfo pi = pm.getPackageInfo(ctx.getPackageName(), 0);\n mAppVer = pi.versionName != null ? pi.versionName : mAppVer ;\n } catch (Exception e) {\n }*/\n return mAppVer;\n }", "public static String getAppVersion(Context c) {\n\t\ttry {\n\t\t\tPackageInfo pInfo = c.getPackageManager().getPackageInfo(c.getPackageName(), 0);\n\t\t\treturn pInfo.versionName;\n\t\t} catch (NameNotFoundException e) {\n\t\t\treturn null;\n\t\t}\n\t}", "public static String getAppVersion() {\n \t\tif (props.containsKey(\"app.version\")) {\n \t\t\treturn props.getProperty(\"app.version\");\n \t\t} else {\n \t\t\treturn \"unspecified\";\n \t\t}\n \t}", "public String getAppVersion() {\n return appVersion;\n }", "public static String getVersion() {\n if (version != null) {\n return version;\n }\n\n Package p = MCBouncer.class.getPackage();\n\n if (p == null) {\n p = Package.getPackage(\"com.mcbouncer\");\n }\n\n if (p == null) {\n version = \"(unknown)\";\n } else {\n version = p.getImplementationVersion();\n\n if (version == null) {\n version = \"(unknown)\";\n }\n }\n\n return version;\n }", "public static int getAppVersionCode(){\n PackageManager pm = getContext().getPackageManager();\n if(pm != null) {\n PackageInfo pi;\n try {\n pi = pm.getPackageInfo(getContext().getPackageName(), 0);\n if(pi != null) {\n return pi.versionCode;\n }\n }catch(NameNotFoundException e) {\n e.printStackTrace();\n }\n }\n return -1;\n }", "com.google.protobuf.ByteString\n getAndroidKtxVersionBytes();", "private static String m35239a(Context context) {\n try {\n return context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName;\n } catch (NameNotFoundException unused) {\n return null;\n }\n }", "public String getVersion();", "public String getVersion();", "public String getVersion();", "public String getVersion();", "public native int get_majorversion();", "Version getVersion();", "Version getVersion();", "Version getVersion();", "Version getVersion();", "public int getLibVersionNumber();", "Long getVersion();", "public static String getVersionName(Context context) {\n String versionName = \"unknown\";\n try {\n versionName = context.getPackageManager().getPackageInfo(context.getPackageName(), PackageManager.GET_ACTIVITIES).versionName;\n } catch (PackageManager.NameNotFoundException ignore) {\n QUFactory.QLog.debug(ignore.getMessage());\n }\n return versionName;\n }", "public static String getAppVersionNameOld(Context context) {\n String versionName = \"\";\n try {\n // ---get the package info---\n PackageManager pm = context.getPackageManager();\n PackageInfo pi = pm.getPackageInfo(context.getPackageName(), 0);\n versionName = pi.versionName;\n if (TextUtils.isEmpty(versionName)) {\n return \"\";\n }\n } catch (NameNotFoundException e) {\n e.printStackTrace();\n }\n return versionName;\n }", "public static String getVersion() {\r\n\t\treturn VERSION;\r\n\t}", "public static String getVersion() {\n\t\treturn version;\r\n\t}", "public static String getVersion() {\n return version;\n }", "public static String getVersion() {\n return version;\n }", "public static String getVersion() {\n\t\treturn version;\n\t}", "String version();", "Integer getVersion();", "public String getCompatibilityVersion() {\r\n return \"2\";\r\n }", "public String getOsVersion() {\n return osVersion;\n }", "public int getVersion()\n {\n return info.getVersion().intValueExact();\n }", "public static String getStringVersion() throws IOException {\n return \"0.0.1\";//attr.getValue(\"Implementation-Version\");\n }", "public String getBuildVersion() {\n return Build.VERSION.RELEASE;\n }", "private static String getVersion() throws IOException {\n URL res = Main.class.getResource(\"/META-INF/MANIFEST.MF\");\n if(res!=null) {\n Manifest manifest = new Manifest(res.openStream());\n String v = manifest.getMainAttributes().getValue(\"Implementation-Version\");\n if(v!=null)\n return v;\n }\n return \"?\";\n }", "@Override\n\tpublic String getSDKVersion() {\n\t\treturn null;\n\t}", "default String getVersion()\n {\n return getString( \"version\", \"Unknown Version\");\n }", "public String getVersion(){\r\n return version;\r\n }", "@CheckForNull\n String getVersion();", "public Version getVersion();", "public static final String getVersion() { return version; }", "public static final String getVersion() { return version; }", "protected String getOsVersion() {\n return \"\";\n }", "public String getVersion () {\r\n return version;\r\n }", "boolean hasAndroidKtxVersion();", "public String getGLVersion()\n\t{\n\t\treturn glGetString(GL_VERSION);\n\t}", "public static String getVersion() { return \"2.0\"; }", "public String getVersion()\n {\n return ver;\n }", "public String getVersion()\n {\n return version;\n }", "public static int getVersionCode(Context context) {\n int versionName = -1;\n try {\n versionName = context.getPackageManager().getPackageInfo(context.getPackageName(), PackageManager.GET_ACTIVITIES).versionCode;\n } catch (PackageManager.NameNotFoundException ignore) {\n QUFactory.QLog.debug(ignore.getMessage());\n }\n return versionName;\n }", "public static String getVersion() {\n\t\treturn \"1.0.3\";\n\t}", "int getPackageVersion(String packageName);", "public static String getVersion()\n {\n return \"\";\n }", "public static String getVersion()\n {\n return \"\";\n }" ]
[ "0.7458324", "0.7353428", "0.7104062", "0.7031967", "0.7031967", "0.70160043", "0.6898183", "0.68462586", "0.68434364", "0.6760932", "0.6676683", "0.6585251", "0.6576244", "0.65531266", "0.65327746", "0.6521185", "0.65199393", "0.6484877", "0.64844584", "0.64844584", "0.64844584", "0.64844584", "0.64844584", "0.64844584", "0.64844584", "0.64844584", "0.64844584", "0.64844584", "0.64844584", "0.64829195", "0.64772385", "0.6453931", "0.64497983", "0.6435807", "0.6435807", "0.6433787", "0.6433787", "0.6433787", "0.6433787", "0.6433787", "0.6433787", "0.6433787", "0.6433787", "0.64283323", "0.64283323", "0.64283323", "0.64283323", "0.6424519", "0.64225906", "0.641831", "0.6411011", "0.6395392", "0.6390316", "0.6362772", "0.6332886", "0.6321867", "0.6321867", "0.6321867", "0.6321867", "0.63036466", "0.6289696", "0.6289696", "0.6289696", "0.6289696", "0.6286607", "0.6275391", "0.6262836", "0.62473816", "0.62439597", "0.6222718", "0.62150496", "0.62150496", "0.6179108", "0.6177183", "0.6175128", "0.6174054", "0.6171954", "0.61611164", "0.6153605", "0.61418283", "0.6140519", "0.6137426", "0.60901123", "0.60759866", "0.60702384", "0.6055132", "0.60458916", "0.60458916", "0.6045425", "0.60434437", "0.6038227", "0.60334736", "0.60187316", "0.6012933", "0.60121983", "0.6010325", "0.6008605", "0.5992415", "0.597765", "0.597765" ]
0.78155637
0
Get the device phone number
public String getPhoneNumber(){ TelephonyManager mTelephonyMgr; mTelephonyMgr = (TelephonyManager) activity.getSystemService(Context.TELEPHONY_SERVICE); return mTelephonyMgr.getLine1Number(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getUserPhone();", "java.lang.String getPhone();", "java.lang.String getPhoneNumber();", "java.lang.String getPhoneNumber();", "java.lang.String getPhoneNumber();", "@Override\n public String getPhoneNumber() {\n\n if(this.phoneNumber == null){\n\n this.phoneNumber = TestDatabase.getInstance().getClientField(token, id, \"phoneNumber\");\n }\n\n return phoneNumber;\n }", "public String returnPhoneNumber() {\n\t\treturn this.registration_phone.getAttribute(\"value\");\r\n\t}", "public String getphoneNum() {\n\t\treturn _phoneNum;\n\t}", "public String getPhoneNo() {\n return (String)getAttributeInternal(PHONENO);\n }", "private String getMyPhoneNO() {\n String mPhoneNumber;\n TelephonyManager tMgr = (TelephonyManager) this.getActivity().getSystemService(Context\n .TELEPHONY_SERVICE);\n mPhoneNumber = tMgr.getLine1Number();\n if(mPhoneNumber == null)\n mPhoneNumber = \"+NoNotFound\";\n return mPhoneNumber;\n }", "public final String getPhone() {\n return phone;\n }", "public java.lang.String getTelphone () {\r\n\t\treturn telphone;\r\n\t}", "public String getMyPhoneNumber() {\n return ((TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE))\n .getLine1Number();\n }", "@Override\n public String getphoneNumber() {\n return ((EditText)findViewById(R.id.phoneNumberUserPage)).getText().toString().trim();\n }", "public String getPhoneNum()\r\n {\r\n\treturn phoneNum;\r\n }", "public long getPhoneNumber() {\r\n\t\treturn phoneNumber;\r\n\t}", "public Long getMobile_phone();", "java.lang.String getPhonenumber();", "public java.lang.String getContactPhoneNumber()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(CONTACTPHONENUMBER$0, 0);\r\n if (target == null)\r\n {\r\n return null;\r\n }\r\n return target.getStringValue();\r\n }\r\n }", "public java.lang.String getPhone () {\n\t\treturn phone;\n\t}", "public String getPhone() {\r\n\t\treturn this.phone;\r\n\t}", "int getPhone();", "public String getPhone(final SessionContext ctx)\n\t{\n\t\treturn (String)getProperty( ctx, PHONE);\n\t}", "public String getPhone(final SessionContext ctx)\n\t{\n\t\treturn (String)getProperty( ctx, PHONE);\n\t}", "public String getUserphone() {\n return userphone;\n }", "public String getTelphone() {\n return telphone;\n }", "public String getTelphone() {\n return telphone;\n }", "public String getTelphone() {\n return telphone;\n }", "public String getPhone() {\n\t\treturn phone;\n\t}", "public java.lang.CharSequence getPhoneNumber() {\n return phone_number;\n }", "public java.lang.String getPhone_number() {\n return phone_number;\n }", "public java.lang.CharSequence getPhoneNumber() {\n return phone_number;\n }", "public Long getHome_phone();", "public String getDeviceId() {\n //TelephonyManager tm = (TelephonyManager)getSystemService(TELEPHONY_SERVICE);\n String number = Build.SERIAL;\n return number;\n }", "public String getTelephone() {\n return (String) get(\"telephone\");\n }", "public String getPhoneNumber()\n\t{\n\t\treturn this._phoneNumber;\n\t}", "public java.lang.String getPhone() {\n java.lang.Object ref = phone_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n phone_ = s;\n }\n return s;\n }\n }", "public java.lang.String getPhone() {\n java.lang.Object ref = phone_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n phone_ = s;\n }\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getPhone() {\n return phone;\n }", "public String getUserPhone() {\r\n return userPhone;\r\n }", "public java.lang.String getPhoneNumber() {\n java.lang.Object ref = phoneNumber_;\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 phoneNumber_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getPhoneNumber() {\n java.lang.Object ref = phoneNumber_;\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 phoneNumber_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public String getPhone()\n\t{\n\t\treturn getPhone( getSession().getSessionContext() );\n\t}", "public String getPhone()\n\t{\n\t\treturn getPhone( getSession().getSessionContext() );\n\t}", "public java.lang.String getPhoneNumber() {\n java.lang.Object ref = phoneNumber_;\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 phoneNumber_ = s;\n return s;\n }\n }", "public java.lang.String getPhoneNumber() {\n java.lang.Object ref = phoneNumber_;\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 phoneNumber_ = s;\n return s;\n }\n }", "public int getPhoneNumber() {\n\t\treturn phoneNumber;\n\t}", "public String getPhoneNum() {\n return phoneNum;\n }", "public String getPhoneNum() {\n return phoneNum;\n }", "public String getPhoneNum() {\n return phoneNum;\n }", "public String getPhoneNumber() {\n\t\treturn this.phoneNumber;\n\t}", "public String getPhoneNum()\r\n {\r\n return phoneNum;\r\n }", "public String getPhoneNumber() throws NullPointerException {\n\n\t\tString phoneNumber = user.getPhoneNumber();\n\t\tif (phoneNumber == null || phoneNumber.isEmpty()) {\n\t\t\tthrow new NullPointerException();\n\t\t}\n\n\t\treturn Utils.formatPhoneNumber(phoneNumber);\n\t}", "@Override\r\n\tpublic String getPhone() {\n\t\treturn phone;\r\n\t}", "public String getPhone_number() {\n return phone_number;\n }", "public String getPhone() {\n return _phone;\n }", "public String getPhoneNumber(){\r\n\t\treturn phoneNumber;\r\n\t}", "public String getPhone() {\n return phone;\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.lang.String getPhone() {\n return (java.lang.String)__getInternalInterface().getFieldValueForCodegen(PHONE_PROP.get());\n }", "public String getPhoneNumber() {\n\t\treturn phoneNumber;\n\t}", "public String getPhone(){\n\t\treturn phone;\n\t}", "@gw.internal.gosu.parser.ExtendedProperty\n public java.lang.String getPhone() {\n return (java.lang.String)__getInternalInterface().getFieldValueForCodegen(PHONE_PROP.get());\n }", "public String getPhone() {\r\n return phone;\r\n }", "public String getPhone() {\r\n return phone;\r\n }", "public String getPhone() {\r\n return phone;\r\n }", "public String getPhone() {\r\n return phone;\r\n }", "public String getPhone() {\r\n return phone;\r\n }", "public String getPhone() {\r\n return phone;\r\n }", "public String getTelNo()\r\n\t{\r\n\t\treturn this.telNo;\r\n\t}", "public String getPhone() {\r\n // Bouml preserved body begin 00040C82\r\n\t return phoneNumber;\r\n // Bouml preserved body end 00040C82\r\n }", "public long getPhone() {\n return phone;\n }", "String getPhone(int type);", "public java.lang.String getTelePhone() {\r\n return telePhone;\r\n }", "public String getPhoneNumber() {\r\n return phoneNumber;\r\n }", "public synchronized String getTelephoneNumber()\r\n {\r\n return telephoneNumber;\r\n }", "public String Phone() throws Exception {\r\n\t\t\ttry {\r\n\t\t\t\telement = driver.findElement(phone);\r\n\t\t\t\tStr_phoneno = element.getText();\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tthrow new Exception(\"Phone Number NOT FOUND:: \"+e.getLocalizedMessage());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn Str_phoneno;\r\n\t\t\t\r\n\t\t}", "public String getPhoneNumber() {\n return this.phoneNumber;\n }", "public java.lang.String getMobilePhone() {\r\n return mobilePhone;\r\n }", "public java.lang.String getUserPhone() {\n java.lang.Object ref = userPhone_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n userPhone_ = s;\n }\n return s;\n }\n }", "public String getPhoneNumber() {\r\n return number;\r\n }", "public String getTelNo() {\n return telNo;\n }", "public String getTelNo() {\n return telNo;\n }", "public String getMobilePhone() {\n return mobilePhone;\n }", "public com.google.protobuf.StringValue getPhoneNumber() {\n if (phoneNumberBuilder_ == null) {\n return phoneNumber_ == null ? com.google.protobuf.StringValue.getDefaultInstance() : phoneNumber_;\n } else {\n return phoneNumberBuilder_.getMessage();\n }\n }", "public String getPhoneNumber() {\n return phoneNumber;\n }", "public String getPhoneNumber() {\n return phoneNumber;\n }", "public String getPhoneNumber() {\n return phoneNumber;\n }", "public String getPhoneNumber() {\n return phoneNumber;\n }", "public String getPhoneNumber() {\n return phoneNumber;\n }", "public String getPhoneNumber() {\n return phoneNumber;\n }", "public String getPhoneNumber() {\n return phoneNumber;\n }", "public String getPhoneNumber() {\n return phoneNumber;\n }", "public String getPhoneNumber() {\n return phoneNumber;\n }", "public String getPhone() {\n return phone;\n }", "public String getPhone() {\n return phone;\n }", "public String getPhone() {\n return phone;\n }", "public String getPhone() {\n return phone;\n }", "public String getPhone() {\n return phone;\n }", "public String getPhone() {\n return phone;\n }", "public String getPhone() {\n return phone;\n }" ]
[ "0.7825086", "0.77710766", "0.7645035", "0.7645035", "0.7645035", "0.7588624", "0.7547685", "0.75171417", "0.7486603", "0.74648356", "0.74403214", "0.7412964", "0.7406234", "0.73989105", "0.73939455", "0.7382235", "0.73792744", "0.7374068", "0.73579794", "0.7351367", "0.7322287", "0.7286938", "0.7276979", "0.7276979", "0.7266661", "0.7263265", "0.7263265", "0.7263265", "0.721644", "0.7204205", "0.7201195", "0.7197252", "0.7193244", "0.7185543", "0.717285", "0.71694773", "0.7167498", "0.7166113", "0.71657205", "0.7157658", "0.71538824", "0.7153276", "0.71407974", "0.71407974", "0.7139071", "0.7138884", "0.7131653", "0.71254194", "0.71254194", "0.71254194", "0.7114989", "0.71110225", "0.7107882", "0.7103794", "0.70896053", "0.7074966", "0.7056986", "0.7053677", "0.7048277", "0.70385337", "0.70372987", "0.7034875", "0.7023133", "0.7023133", "0.7023133", "0.7023133", "0.7023133", "0.7023133", "0.6980889", "0.696476", "0.6957867", "0.694686", "0.69418865", "0.6938574", "0.69313365", "0.69277906", "0.69121575", "0.68908775", "0.68879515", "0.6886473", "0.68812674", "0.6868731", "0.68538016", "0.6846769", "0.6845412", "0.6845412", "0.6845412", "0.6845412", "0.6845412", "0.6845412", "0.6845412", "0.6845412", "0.6845412", "0.6838621", "0.6838621", "0.6838621", "0.6838621", "0.6838621", "0.6838621", "0.6838621" ]
0.79367507
0
Get the device name
public String deviceName() { String manufacturer = Build.MANUFACTURER; String model = Build.MODEL; if (model.startsWith(manufacturer)) { return capitalize(model); } else { return capitalize(manufacturer) + " " + model; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getDeviceName();", "public String getDeviceName() {\r\n return name_;\r\n }", "public String getDeviceName(){\n\t\treturn deviceName;\n\t}", "public String getDeviceName(){\n\t return deviceName;\n }", "public String getName() {\n\t\treturn \"Device\";\r\n\t}", "public String getDeviceName() {\n return deviceName;\n }", "public String getDeviceName() {\n return deviceName;\n }", "String getDeviceName() {\n return deviceName;\n }", "public static String getDeviceName(){\n BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();\r\n if (bluetoothAdapter == null){\r\n return \"\";\r\n }else{\r\n String deviceName = bluetoothAdapter.getName();\r\n return deviceName;\r\n }\r\n }", "public static String getDeviceName() {\n\t\t\tString manufacturer = Build.MANUFACTURER;\n\t\t\tString model = Build.MODEL;\n\t\t\tif (model.startsWith(manufacturer)) {\n\t\t\t\treturn capitalize(model);\n\t\t\t}\n\t\t\treturn capitalize(manufacturer) + \" \" + model;\n\t\t}", "public static String getDeviceName() {\n String manufacturer = Build.MANUFACTURER;\n String model = Build.MODEL;\n if (model.startsWith(manufacturer)) {\n return capitalize(model);\n } else {\n return capitalize(manufacturer) + \" \" + model;\n }\n }", "public static String getDeviceName() {\n String manufacturer = Build.MANUFACTURER;\n String model = Build.MODEL;\n if (model.startsWith(manufacturer)) {\n return capitalize(model);\n } else {\n return capitalize(manufacturer) + \" \" + model;\n }\n }", "private String getDeviceName() {\n String permission = \"android.permission.BLUETOOTH\";\n int res = context.checkCallingOrSelfPermission(permission);\n if (res == PackageManager.PERMISSION_GRANTED) {\n try {\n BluetoothAdapter myDevice = BluetoothAdapter.getDefaultAdapter();\n if (myDevice != null) {\n return myDevice.getName();\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n return \"Unknown\";\n }", "public static String getDeviceName() {\n String manufacturer = Build.MANUFACTURER;\n String model = Build.MODEL;\n if (model.startsWith(manufacturer)) {\n return capitalize(model);\n }\n return capitalize(manufacturer) + \" \" + model;\n }", "public String getDeviceName() {\n\t\treturn deviceName;\n\t}", "public String getDeviceName() {\n return mUsbDevice.getDeviceName();\n }", "private String getUserConfiguredDeviceName() {\n\t\tString nameFromSystemDevice = Settings.Secure.getString(getContentResolver(), \"device_name\");\n\t\tif (!isEmpty(nameFromSystemDevice)) return nameFromSystemDevice;\n\t\treturn null;\n\t}", "public String getName() {\n\t return this.device.getName() + \".\" + this.getType() + \".\"\n\t + this.getId();\n\t}", "public String getFriendlyName() {\n return this.bluetoothStack.getLocalDeviceName();\n }", "public String getDeviceName() {\n return this.deviceName;\n }", "java.lang.String getDeviceId();", "public String getDevice() {\r\n return device;\r\n }", "org.hl7.fhir.String getDeviceIdentifier();", "public String getDeviceNameGetPoint() {\n\t\treturn deviceNameGetPoint;\n\t}", "@Override\n\tpublic String getDeviceName() {\n\t\treturn null;\n\t}", "public String getDeviceNameForMacro() {\r\n String name = getDeviceName();\r\n\r\n if(name.startsWith(\"PIC32\")) {\r\n return name.substring(3); // \"32MX795F512L\"\r\n } else if(name.startsWith(\"ATSAM\")) {\r\n return name.substring(2); // \"SAME70Q21\"\r\n } else {\r\n return name;\r\n }\r\n }", "public String getDeviceSeriesName() {\r\n if(isMips32()) {\r\n String devname = getDeviceName();\r\n\r\n if(devname.startsWith(\"M\")) {\r\n return devname.substring(0, 3);\r\n } else if(devname.startsWith(\"USB\")) {\r\n return devname.substring(0, 5);\r\n } else {\r\n return devname.substring(0, 7);\r\n }\r\n } else {\r\n return getAtdfFamily();\r\n }\r\n }", "@Override\n public String getDeviceName() {\n return null;\n }", "public String readDeviceSN(){\r\n return mFactoryBurnUtil.readDeviceSN();\r\n }", "public String getRingerDevice();", "public java.lang.String getResultDeviceName() {\n return resultDeviceName;\n }", "public final String getInternalName(){\n return peripheralFriendlyName;\n }", "public final String getFriendlyName(){\n return peripheralFriendlyName;\n }", "public String getMyDeviceName() {\n return bluetoothName;\n }", "protected final String getManufacturerName() {\n return device.getManufacturerName();\n }", "public String getName() {\n\t\treturn JWLC.nativeHandler().wlc_output_get_name(this.to());\n\t}", "public static String osName() {\r\n Object _osname=null;\r\n \r\n try {\r\n _osname=System.getProperty(\"os.name\");\r\n }\r\n catch (Exception ex) {\r\n _osname=null;\r\n ex.printStackTrace();\r\n }\r\n \r\n String _name=\"\";\r\n if (_osname!=null) _name=_osname.toString();\r\n \r\n return _name;\r\n }", "public java.lang.String getDeviceId() {\n java.lang.Object ref = deviceId_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n deviceId_ = s;\n }\n return s;\n }\n }", "public java.lang.String getDeviceId() {\n java.lang.Object ref = deviceId_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n deviceId_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public static String getDeviceUUID(){\n BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();\n String uuid = adapter.getAddress();\n return uuid;\n }", "public String getDeviceid() {\n return deviceid;\n }", "String getPlatformName();", "@Override\n public String getDeviceId() {\n return this.strDevId;\n }", "public String getCaptureDevice();", "public String getDeviceId() {\n //TelephonyManager tm = (TelephonyManager)getSystemService(TELEPHONY_SERVICE);\n String number = Build.SERIAL;\n return number;\n }", "public abstract String getPeripheralStaticName();", "protected final String getModelName() {\n return device.getModelName();\n }", "String getPdpName();", "public String getDeviceDescription() {\r\n return deviceDesc;\r\n }", "@Override\n public String getDeviceOwnerName() {\n if (!mHasFeature) {\n return null;\n }\n Preconditions.checkCallAuthorization(canManageUsers(getCallerIdentity())\n || hasCallingOrSelfPermission(permission.MANAGE_PROFILE_AND_DEVICE_OWNERS));\n\n synchronized (getLockObject()) {\n if (!mOwners.hasDeviceOwner()) {\n return null;\n }\n // TODO This totally ignores the name passed to setDeviceOwner (change for b/20679292)\n // Should setDeviceOwner/ProfileOwner still take a name?\n String deviceOwnerPackage = mOwners.getDeviceOwnerPackageName();\n return getApplicationLabel(deviceOwnerPackage, UserHandle.USER_SYSTEM);\n }\n }", "public String getDeviceUDID() {\r\n\t\tTelephonyManager telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);\r\n\t\treturn telephonyManager.getDeviceId();\r\n\t}", "public String getDevice_id() {\r\n\t\treturn device_id;\r\n\t}", "public String getDeviceId() {\n\t\tString id;\n\t\tid = options.getProperty(\"id\");\n\t\tif(id == null) {\n\t\t\tid = options.getProperty(\"Device-ID\");\n\t\t}\n\t\treturn trimedValue(id);\n\t}", "private String getDeviceID() {\n try {\n TelephonyManager telephonyManager;\n\n telephonyManager =\n (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);\n\n /*\n * getDeviceId() function Returns the unique device ID.\n * for example,the IMEI for GSM and the MEID or ESN for CDMA phones.\n */\n return telephonyManager.getDeviceId();\n }catch(SecurityException e){\n return null;\n }\n }", "String getSelectedDevice() {\n return selectedDevice;\n }", "public String getDeviceId() {\n String info = \"\";\n try {\n Uri queryurl = Uri.parse(REGINFO_URL + CHUNLEI_ID);\n ContentResolver resolver = mContext.getContentResolver();\n info = resolver.getType(queryurl);\n if (null == info && null != mContext) {\n info = getIMEI();\n }\n if (null == info) {\n info = \"\";\n }\n } catch (Exception e) {\n System.out.println(\"in or out strean exception\");\n }\n return info;\n }", "public String getDeviceNameSetPoint() {\n\t\treturn deviceNameSetPoint;\n\t}", "public static String getGnssHardwareModelName(Context context) {\n String modelName = \"\";\n LocationManager locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {\n if (locationManager.getGnssHardwareModelName() != null) {\n modelName = String.valueOf(locationManager.getGnssHardwareModelName());\n }\n }\n return modelName;\n }", "public String deviceId() {\n return this.deviceId;\n }", "public String getSystemName();", "Reference getDevice();", "public final int getDevice()\n\t{\n\t\treturn address & 0xFF;\n\t}", "protected final String getSynthName() {\n return device.getSynthName();\n }", "public String getHostName() {\n\t\treturn \"RaspberryHostName\";\n\t}", "public static String getManufacturer() {\n String mfg = \"unknown\"; //$NON-NLS-1$\n if (apiLevel() > 3) {\n try {\n final Class<?> buildClass = Build.class;\n mfg = (String) buildClass.getField(\"MANUFACTURER\").get(null); //$NON-NLS-1$\n } catch (final Exception ignore) {\n Log.d(TAG, \"Caught exception\", ignore); //$NON-NLS-1$\n }\n }\n return mfg;\n }", "public String getDeviceId() {\n return this.DeviceId;\n }", "public String getDeviceId() {\n String deviceId = ((TelephonyManager) LoginActivity.this.getSystemService(Context.TELEPHONY_SERVICE)).getDeviceId();\n if (deviceId != null && !deviceId.equalsIgnoreCase(\"null\")) {\n // System.out.println(\"imei number :: \" + deviceId);\n return deviceId;\n }\n\n deviceId = android.os.Build.SERIAL;\n // System.out.println(\"serial id :: \" + deviceId);\n return deviceId;\n\n }", "public static String deviceId() {\n\t\t// return device id\n\t\treturn getTelephonyManager().getDeviceId();\n\t}", "public static String m21396c() {\n return Build.MANUFACTURER;\n }", "public static String getDeviceInformation(Context context) {\n String details = \"SDK\\t: \" + Build.VERSION.SDK_INT\n +\"\\nBRD\\t: \" + Build.BRAND\n +\"\\nH/W\\t: \" + Build.HARDWARE\n +\"\\nHST\\t: \" + Build.HOST\n +\"\\nID \\t: \" + Build.ID\n +\"\\nMFR\\t: \" + Build.MANUFACTURER\n +\"\\nMDL\\t: \" + Build.MODEL\n +\"\\nPRD\\t: \" + Build.PRODUCT\n +\"\\nDEV\\t: \" + Build.DEVICE\n +\"\\nAPP\\t: \" + context.getResources().getString(R.string.software_version)\n +\"\\n\\n\\n\";\n Log.d(MainActivity.APP_TAG, \"Device Details: \" + details);\n return details;\n }", "public static String getDeviceModel() {\n String deviceName = SystemProperties.get(\"prize.system.boot.rsc\");\n // prize modify for bug66476 by houjian end\n deviceName = !TextUtils.isEmpty(deviceName) ? deviceName : Build.MODEL + DeviceInfoUtils.getMsvSuffix();\n //prize modified by xiekui, fix bug 74122, 20190408-start\n return UtilsExt.useDeviceInfoSettingsExt() == null ? deviceName : UtilsExt.useDeviceInfoSettingsExt().customeModelInfo(deviceName);\n //prize modified by xiekui, fix bug 74122, 20190408-end\n }", "public final String getDeviceId(){\n return peripheralDeviceId;\n }", "public final String getDeviceType(){\n return TYPE;\n }", "private String getDeviceId(Context context){\n TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);\n\n //\n ContextCompat.checkSelfPermission(context, Manifest.permission.READ_PHONE_STATE);\n String tmDevice = tm.getDeviceId();\n\n String androidId = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);\n\n String serial = null;\n if (Build.VERSION.SDK_INT > Build.VERSION_CODES.FROYO) serial = Build.SERIAL;\n\n if(tmDevice != null) return \"01\" + tmDevice;\n if(androidId != null) return \"02\" + androidId;\n if(serial != null) return \"03\" + serial;\n\n return null;\n }", "@SuppressLint(\"HardwareIds\")\n String getDeviceID() {\n return Settings.Secure.getString(getApplicationContext().getContentResolver(),\n Settings.Secure.ANDROID_ID);\n }", "String getSdkName();", "@Deprecated\r\n\tpublic String readDeviceID(){\r\n\t\treturn mFactoryBurnUtil.readDeviceID();\r\n\t}", "public org.thethingsnetwork.management.proto.HandlerOuterClass.Device getDevice(org.thethingsnetwork.management.proto.HandlerOuterClass.DeviceIdentifier request);", "private String getDeviceId() {\n String deviceId = telephonyManager.getDeviceId(); \n \n \n // \"generic\" means the emulator.\n if (deviceId == null || Build.DEVICE.equals(\"generic\")) {\n \t\n // This ID changes on OS reinstall/factory reset.\n deviceId = Secure.getString(context.getContentResolver(), Secure.ANDROID_ID);\n }\n \n return deviceId;\n }", "DeviceId deviceId();", "DeviceId deviceId();", "public String getLastUsedDevice() {\n return lastUsedDevice;\n }", "@NonNull\n private String getDeviceId() {\n String ANDROID_ID = Settings.Secure.getString(cordova.getActivity().getContentResolver(), Settings.Secure.ANDROID_ID);\n return md5(ANDROID_ID).toUpperCase();\n }", "public final int getDeviceID() {\n return device.getDeviceID();\n }", "@NonNull\n public static String getDeviceID(@NonNull Context ctx) {\n String duid = Settings.Secure.getString(ctx.getContentResolver(), Settings.Secure.ANDROID_ID);\n return (duid == null || duid.length() == 0) ? \"emulator\" : duid;\n }", "java.lang.String getSerial();", "@Override\n\t\t\tpublic String toString(Device device) {\n\t\t\t\treturn device.getModel()+\"(\"+device.getComPort()+\")\";\n\t\t\t}", "@Override\n\t\t\tpublic String toString(Device device) {\n\t\t\t\treturn device.getModel()+\"(\"+device.getComPort()+\")\";\n\t\t\t}", "final int getDeviceNum() {\n return device.getDeviceNum();\n }", "public static String getOsUserName() {\n\n return System.getProperty(\"user.name\");\n }", "public void setDeviceName(String dn) {\r\n \tthis.deviceName = dn;\r\n }", "String getSerial();", "UUID getDeviceId();", "@Override\r\n public final String toString() {\r\n return \"\\nDevice ID: [\" + getId() + \"]\\n\"\r\n + \"Device Name: [\" + getName() + \"]\\n\"\r\n + \"Device Size: [\" + getSize() + \"]\\n\"\r\n + \"Device Position: [\" + getPosition() + \"]\\n\"\r\n + \"Device Resolution: [\" + getResolution() + \"\\n\"\r\n + \"Device Refresh Rate: [\" + getRefreshRate() + \"\\n\"\r\n + \"Device Bits Per Pixel: [\" + getBpp() + \"\\n\"\r\n + \"Supported Display Modes: [\" + getSupportedDisplaySettings().size() + \"]\\n\";\r\n }", "public static String getName()\n {\n read_if_needed_();\n \n return _get_name;\n }", "public String getDeviceCode() {\n return deviceCode;\n }", "public Device getDevice() {\n\t\treturn this.device;\n\t}", "public String getDevice_type() {\r\n\t\treturn device_type;\r\n\t}", "public ScText newMobileDeviceNameText()\n {\n return newMobileDeviceNameText(\"Mobile Device Name\");\n }", "public java.lang.String getResultDeviceGuid() {\n return resultDeviceGuid;\n }" ]
[ "0.84094745", "0.82338774", "0.79901946", "0.7978716", "0.7969988", "0.7945741", "0.79371226", "0.79354256", "0.79224545", "0.78624433", "0.78608227", "0.78608227", "0.78570294", "0.78526163", "0.78415036", "0.7812766", "0.7768496", "0.7690018", "0.73741686", "0.7318045", "0.7260857", "0.7187739", "0.7174851", "0.71566945", "0.7155755", "0.7102604", "0.70127416", "0.69679374", "0.68375635", "0.6827827", "0.6825669", "0.6789191", "0.67425525", "0.6730591", "0.67294425", "0.66641545", "0.6635611", "0.65803605", "0.65584356", "0.6550176", "0.65283805", "0.6495593", "0.64916384", "0.64653516", "0.6454491", "0.6442628", "0.6436128", "0.6434057", "0.642458", "0.6398016", "0.63907826", "0.63767827", "0.63500375", "0.6324361", "0.6320783", "0.62880707", "0.62853307", "0.6284718", "0.625701", "0.6232514", "0.6215337", "0.62056684", "0.6205522", "0.620025", "0.6173431", "0.6139861", "0.613671", "0.612882", "0.6122738", "0.61100525", "0.61048645", "0.6104454", "0.61000913", "0.6095595", "0.6093976", "0.6089169", "0.6080827", "0.6068538", "0.60667443", "0.60584867", "0.60584867", "0.60465705", "0.6045778", "0.6042867", "0.60373616", "0.60234475", "0.6019847", "0.6019847", "0.6013251", "0.601085", "0.6004175", "0.6001213", "0.600061", "0.59761333", "0.5975448", "0.59656715", "0.59449667", "0.5942782", "0.5940442", "0.59351593" ]
0.804558
2
check if it is an email
public boolean checkEmail(String email) { return EMAIL_ADDRESS_PATTERN.matcher(email).matches(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic boolean emailisValid(String email) \n\t{\n\t\treturn false;\n\t}", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\r\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\r\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\r\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\r\n }", "private boolean isEmail(String email)\n {\n Pattern pat = null;\n Matcher mat = null;\n pat = Pattern.compile(\"^[\\\\w\\\\\\\\\\\\+]+(\\\\.[\\\\w\\\\\\\\]+)*@([A-Za-z0-9-]+\\\\.)+[A-Za-z]{2,4}$\");\n mat = pat.matcher(email);\n if (mat.find()) {\n return true;\n }\n else\n {\n return false;\n }\n }", "private boolean isEmailValid(String email) {\n return true;\r\n }", "private boolean isEmailValid(String email){\n return email.contains(\"@\");\n }", "boolean hasEmail();", "boolean hasEmail();", "boolean hasEmail();", "boolean hasEmail();", "boolean hasEmail();", "boolean isEmail(String s) {\n return (!TextUtils.isEmpty(s) && Patterns.EMAIL_ADDRESS.matcher(s).matches());\n }", "private static boolean isEmail(String string) {\r\n if (string == null) return false;\r\n String regEx1 = \"^([a-z0-9A-Z]+[-|\\\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\\\.)+[a-zA-Z]{2,}$\";\r\n Pattern p;\r\n Matcher m;\r\n p = Pattern.compile(regEx1);\r\n m = p.matcher(string);\r\n if (m.matches()) return true;\r\n else\r\n return false;\r\n }", "private boolean isEmailValid(String email) {\n return true;\n }", "private boolean isEmailValid(String email) {\n return true;\n }", "private boolean isEmailValid(String email) {\n return true;\n }", "private boolean isEmailValid(String email) {\n return true;\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean checkemail(String s) {\n\t\tboolean flag = false;\r\n\t\tString[] m = s.split(\"@\");\r\n\t\tif (m.length < 2) {\r\n\t\t\tflag = true;\r\n\t\t}\r\n\t\treturn flag;\r\n\t}", "boolean isEmailRequired();", "private static boolean isEmailFormat(final String str)\n {\n return str.matches(\"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\\\.[A-Za-z]{2,6}\");\n }", "public static boolean email(String email) {\r\n\t\tboolean resul = false;\r\n\r\n\t\tif (email != null) {\r\n\t\t\tMatcher matcher = VALID_EMAIL_ADDRESS_REGEX.matcher(email);\r\n\t\t\tresul = matcher.find();\r\n\t\t}\r\n\r\n\t\treturn resul;\r\n\t}", "boolean validateEmail(String email) {\n\t\treturn true;\n\n\t}", "private boolean isEmailValid(String email) {\r\n //TODO: Replace this with your own logic\r\n return email.contains(\"@\");\r\n }", "public boolean isRegisteredEmail(String email);", "private boolean isEmailValid(String email) {\n //TODO: Replace this with your own logic\n return email.contains(\"@\");\n }", "private boolean isValidEmail(final String theEmail) {\n return theEmail.contains(\"@\");\n }", "protected boolean isEmail(String userId) {\n \t\tif (StringUtil.isEmpty(userId)) {\n \t\t\treturn false;\n \t\t}\n \t\treturn userId.contains(\"@\");\n \t}", "public boolean emailFormat(String email){\n Pattern VALID_EMAIL_ADDRESS_REGEX =\n Pattern.compile(\"^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\\\.[A-Z]{2,6}$\", Pattern.CASE_INSENSITIVE);\n Matcher matcher=VALID_EMAIL_ADDRESS_REGEX.matcher(email);\n return matcher.find();\n\n }", "private boolean isEmailValid(String email) {\n return email.equals(\"mobilecomputing@gmail.com\");\n }", "public static boolean isvalideEmailSyntax(String email) {\n\t\tif (email == null || \"\".equals(email) || email.indexOf(\"@\") == -1)\n\t\t\treturn false;\n\t\tboolean result = true;\n\t\ttry {\n\t\t\tInternetAddress emailAddr = new InternetAddress(email);\n\t\t} catch (AddressException ex) {\n\t\t\tresult = false;\n\t\t}\n\t\treturn result;\n\t}", "private boolean isEmailValid(String email) {\n if(Patterns.EMAIL_ADDRESS.matcher(email).matches()){\n\n return true;\n }else {\n return false;\n }\n// return email.contains(\"@\");\n }", "public String checkEmail(String email) {\n\t\t//TODO check passed in email and return it if correct, or an error message if no email exists\n\t\treturn email;\n\t}", "boolean isEmailExist(String email);", "private boolean CheckEmail() {\n\t\tString email = Email_textBox.getText();\n\n\t\t// if field is empty\n\t\tif (email.equals(\"\")) {\n\t\t\tif (!Email_textBox.getStyleClass().contains(\"error\"))\n\t\t\t\tEmail_textBox.getStyleClass().add(\"error\");\n\t\t\tEmailNote.setText(\"* Enter Email\");\n\t\t\treturn false;\n\t\t}\n\n\t\tString emailFormat = \"^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\\\.[a-zA-Z0-9-]+)+$\";\n\n\t\t// if field is not in wanted format\n\t\tif (!email.matches(emailFormat)) {\n\t\t\tif (!Email_textBox.getStyleClass().contains(\"error\"))\n\t\t\t\tEmail_textBox.getStyleClass().add(\"error\");\n\t\t\tEmailNote.setText(\"* Wrong Format\");\n\t\t\treturn false;\n\t\t}\n\n\t\tEmail_textBox.getStyleClass().remove(\"error\");\n\t\tEmailNote.setText(\"*\");\n\t\treturn true;\n\t}", "private boolean checkEmailString(String email) {\n boolean validEmail = true;\n try {\n InternetAddress emailAddr = new InternetAddress(email);\n emailAddr.validate();\n } catch (AddressException ex) {\n validEmail = false;\n }\n return validEmail;\n }", "boolean hasUserEmail();", "public boolean checkEmail(String email){\r\n boolean check = true;\r\n if(!email.matches(\"^[a-zA-Z0-9]+@[a-zA-Z0-9]+(.[a-zA-Z]{2,})$\")){\r\n check = false;\r\n }\r\n return check;\r\n }", "public boolean isEmailValid(String email) {\n return true;\n }", "public boolean findEmail(String email);", "private boolean checkEmail(String email) {\n\n\t\tString patternStr = \"^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\\\.[A-Z]{2,6}$\";\n\t\tPattern pattern = Pattern.compile(patternStr, Pattern.CASE_INSENSITIVE);\n\t\tMatcher matcher = pattern.matcher(email);\n\t\tboolean matchFound = matcher.matches();\n\t\treturn matchFound;\n\n\t}", "private boolean comprobar_email() {\n\t\tString mail = email.getText().toString();\n\n\t\tif (mail.matches(\".*@.*\\\\.upv.es\")) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public boolean validarEmail(String email) { \r\n\t\tPattern p = Pattern.compile(\"[a-zA-Z0-9]+[.[a-zA-Z0-9_-]+]*@[a-z0-9][\\\\w\\\\.-]*[a-z0-9]\\\\.[a-z][a-z\\\\.]*[a-z]$\");\r\n\t\tMatcher m = p.matcher(email); \r\n\t\treturn m.matches(); \r\n\t}", "private boolean isEmailValid(CharSequence email) {\n return android.util.Patterns.EMAIL_ADDRESS.matcher(email).matches();\n }", "private boolean validateEmail(String email) {\n return Constants.VALID_EMAIL_PATTERN.matcher(email).find();\n }", "private boolean isEmailValid(String email) {\n //TODO: Replace this with your own logic\n return email.length() > 0;\n }", "public static boolean email(String email) throws UserRegistrationException {\n\t\tboolean resultEmail = validateEmail.validator(email);\n\t\tif(true) {\n\t\t\treturn Pattern.matches(patternEmail, email);\n\t\t}else\n\t\t\tthrow new UserRegistrationException(\"Enter correct Email\");\n\t}", "public static boolean checkEmail(String email){\n String regex = \"^[\\\\w!#$%&’*+/=?`{|}~^-]+(?:\\\\.[\\\\w!#$%&’*+/=?\"\n + \"`{|}~^-]+)*@(?:[a-zA-Z0-9-]+\\\\.)+[a-zA-Z]{2,6}$\";\n if (email.matches(regex))\n return true;\n else\n return false;\n }", "public static boolean checkEmail(String email) {\r\n\t\tboolean result = false;\r\n\t\tif (check(email) && email.matches(CommandParameter.REG_EXP_EMAIL)) {\r\n\t\t\tresult = true;\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "private boolean isValidMail(String email) {\n String EMAIL_STRING = \"^[_A-Za-z0-9-\\\\+]+(\\\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\\\.[A-Za-z0-9]+)*(\\\\.[A-Za-z]{2,})$\";\n return Pattern.compile(EMAIL_STRING).matcher(email).matches();\n }", "static boolean isValid(String email) {\r\n\t\t String regex = \"^[\\\\w-_\\\\.+]*[\\\\w-_\\\\.]\\\\@([\\\\w]+\\\\.)+[\\\\w]+[\\\\w]$\";\r\n\t\t return email.matches(regex);\r\n\t}", "private boolean isEmailValid(String email) {\n if (email.length() == 8){\n return true;\n }\n\t//user names first two characters must be letters\n Boolean condition1 = false;\n Boolean condition2 = false;\n\n int ascii = (int) email.charAt(0);\n if ((ascii >= 65 && ascii <= 90) || ascii >= 97 && ascii <= 122){\n condition1 = true;\n }\n ascii = (int) email.charAt(1);\n if ((ascii >= 65 && ascii <= 90) || ascii >= 97 && ascii <= 122){\n condition2 = true;\n }\n if (condition1 == true && condition2 == true){\n return true;\n }\n\n\t//user names last six characters must be numbers\n for (int i = email.length()-6; i < email.length(); i++){\n ascii = (int) email.charAt(i);\n if (!(ascii >= 48 && ascii <= 57)){\n return false;\n }\n }\n\n return true;\n }", "private boolean checkEmailPattern(String email) {\n Pattern pattern = Pattern.compile(EMAIL_PATTERN);\n Matcher matcher = pattern.matcher(email);\n return matcher.matches();\n }", "public static boolean esEmailCorrecto(String email) {\n \n boolean valid = false;\n \n Pattern p = Pattern.compile(\"^[_A-Za-z0-9-\\\\+]+(\\\\.[_A-Za-z0-9-]+)*@\" +\"[A-Za-z0-9-]+(\\\\.[A-Za-z0-9]+)*(\\\\.[A-Za-z]{2,})$\");\n \n Matcher mE = p.matcher(email.toLowerCase());\n if (mE.matches()){\n valid = true; \n }\n return valid;\n }", "private boolean isEmailValid(String email) {\n return Patterns.EMAIL_ADDRESS.matcher(email).matches();\n }", "private boolean isEmailValid(String email) {\n return Patterns.EMAIL_ADDRESS.matcher(email).matches();\n }", "public static boolean isEmailFormatCorrect(String email) {\n\t\tPattern p = Pattern.compile(\"\\\\b[a-z0-9._%-]+@[a-z0-9.-]+\\\\.[a-z]{2,4}\\\\b\");\n\t\tMatcher m = p.matcher(email);\n\t\tif (m.find())\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "private boolean checkEmail() throws IOException {\n String email = getEmail.getText();\n \n if(email.contains(\"@\")) { \n UserDatabase db = new UserDatabase();\n \n if(db.emailExists(email)) {\n errorMessage.setText(\"This email address has already been registered.\");\n return false;\n }\n \n return true;\n }\n else {\n errorMessage.setText(\"Please enter a valid email. This email will be \"+\n \"used for verification and account retrieval.\");\n return false;\n }\n }", "public static boolean checkEmail (String email) throws IllegalArgumentException{\n check = Pattern.compile(\"^[a-zA-Z0-9]+(?:\\\\+*-*.[a-zA-Z0-9]+)*@[a-zA-Z0-9]+(?:\\\\.[a-zA-Z0-9]{2,}+)*$\").matcher(email).matches();\n if (check) {\n return true;\n } else {\n throw new IllegalArgumentException(\"Enter a valid Email Address\");\n }\n }", "public boolean verificaEmail(String correo) {\n Pattern pat = null;\r\n Matcher mat = null;\r\n pat = Pattern.compile(\"^([0-9a-zA-Z]([_.w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-w]*[0-9a-zA-Z].)+([a-zA-Z]{2,9}.)+[a-zA-Z]{2,3})$\");\r\n mat = pat.matcher(correo);\r\n if (mat.find()) {\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n }", "private boolean isEmailValid(String email) {\n return email.matches(\"^[a-zA-Z]{5,12}$\");\r\n }", "void validate(String email);", "private boolean isEmailValid(String email) {\n return email.contains(\"@\") && (email.length() <= 30); //TODO: Perhaps change to a longer maximum length? Also in db.\n }", "public boolean checkEmail() {\n return !this.emailAddress.isEmpty() && validEmail(this.emailAddress);\n }", "void checkIsMailEmpty(String mail);", "Boolean checkEmailAlready(String email);", "private boolean validEmail(String email) {\n String emailRegex = \"^[a-zA-Z0-9_+&*-]+(?:\\\\.\" +\n \"[a-zA-Z0-9_+&*-]+)*@\" +\n \"(?:[a-zA-Z0-9-]+\\\\.)+[a-z\" +\n \"A-Z]{2,7}$\";\n\n Pattern pat = Pattern.compile(emailRegex);\n return email != null && pat.matcher(email).matches();\n }", "public static boolean verifyEmailFormat(String email) {\n\t\tboolean isValid = false;\n\n\t\tif (email != null) {\n\t\t\tPattern p = Pattern.compile(\".+@.+\\\\.[a-z]+\");\n\t\t\tMatcher m = p.matcher(email);\n\t\t\tisValid = m.matches();\n\t\t}\n\n\t\treturn isValid;\n\t}", "public boolean isValidEmail(String u) {\n Pattern pattern = Pattern.compile(EMAIL_PATTERN);\n Matcher matcher = pattern.matcher(u);\n return matcher.matches();\n }", "boolean validateMailAddress(final String mailAddress);", "public boolean isEmailCorrect() {\n return (CustomerModel.emailTest(emailTextField.getText()));\n }", "public boolean validateEmail(String email) {\n boolean result = true;\n try {\n InternetAddress internetAddress = new InternetAddress(email);\n internetAddress.validate();\n } catch (AddressException e) {\n e.printStackTrace();\n result = false;\n }\n return result;\n }", "private Boolean isEmailAddressValid() {\n final String emailAddress = extractEMailAddress();\n if (null == emailAddress) {\n return Boolean.FALSE;\n } else {\n try {\n return null != EMailBuilder.parse(emailAddress);\n } catch (final EMailFormatException emfx) {\n return Boolean.FALSE;\n }\n }\n }", "public boolean isValidEmaiId(String email) {\r\n\t\tif (email == null || !email.contains(\"@\") || email.length() < 5)\r\n\t\t\treturn false;\r\n\t\tString[] tokens = email.split(\"@\");\r\n\t\tString id = tokens[0];\r\n\t\tString domain = tokens[1];\r\n\t\t// System.out.println(isValidId(id));\r\n\t\t// System.out.println(isValidDomain(domain));\r\n\t\treturn isValidId(id) && isValidDomain(domain);\r\n\t}", "private void emailValidation( String email ) throws Exception {\r\n if ( email != null && !email.matches( \"([^.@]+)(\\\\.[^.@]+)*@([^.@]+\\\\.)+([^.@]+)\" ) ) {\r\n throw new Exception( \"Merci de saisir une adresse courriel valide.\" );\r\n }\r\n }", "public boolean verifyEmail(String email)\r\n {\r\n email = email.trim();\r\n\r\n if(email == null || email.isEmpty() || !email.matches(\"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\\\.[a-zA-Z]{2,6}$\"))\r\n {\r\n return false;\r\n }\r\n else\r\n {\r\n return true;\r\n }\r\n }", "@Override\n public void validaEmailInteractor(CharSequence charSequence) {\n verificaEmail(charToString(charSequence));\n }", "private boolean isValidEmail(TextInputLayout tiEmail, EditText etEmail) {\n String email = etEmail.getText().toString().trim();\n boolean result = false;\n\n if (email.length() == 0)\n tiEmail.setError(c.getString(R.string.required));\n else {\n Pattern emailPattern = Patterns.EMAIL_ADDRESS;\n if (!emailPattern.matcher(email).matches())\n tiEmail.setError(c.getString(R.string.invalid));\n else {\n tiEmail.setError(null);\n result = true;\n }\n }\n\n return result;\n }", "public static boolean validateEmail(String email){\n return email.matches(EMAIL_PATTERN);\n }", "private boolean isEmailValid(String email){\n boolean isValid = false;\n\n String expression = \"^[\\\\w\\\\.-]+@([\\\\w\\\\-]+\\\\.)+[A-Z]{2,4}$\";\n CharSequence inputStr = email;\n //Make the comparison case-insensitive.\n Pattern pattern = Pattern.compile(expression, Pattern.CASE_INSENSITIVE);\n Matcher matcher = pattern.matcher(inputStr);\n if(matcher.matches()){\n isValid = true;\n }\n return isValid;\n }", "protected void validateEmail(){\n\n //Creating Boolean Value And checking More Accurate Email Validator Added\n\n Boolean email = Pattern.matches(\"^[A-Za-z]+([.+-]?[a-z A-z0-9]+)?@[a-zA-z0-9]{1,6}\\\\.[a-zA-Z]{2,6},?([.][a-zA-z+,]{2,6})?$\",getEmail());\n System.out.println(emailResult(email));\n }" ]
[ "0.7644029", "0.7642197", "0.7642197", "0.7642197", "0.7642197", "0.76371855", "0.7630102", "0.75783944", "0.7556871", "0.7556871", "0.7556871", "0.7556871", "0.7556871", "0.7538294", "0.7507418", "0.7472589", "0.7472589", "0.7472589", "0.7472589", "0.7468893", "0.7468893", "0.7468893", "0.7468893", "0.7468893", "0.7468893", "0.7468893", "0.7468893", "0.7468893", "0.7468893", "0.7468893", "0.7468893", "0.7468893", "0.7468893", "0.7468893", "0.7468893", "0.7468893", "0.7468893", "0.73984295", "0.7386907", "0.7368484", "0.736345", "0.73632973", "0.73575705", "0.73510844", "0.7297641", "0.72640365", "0.72520804", "0.7231387", "0.7208896", "0.71977395", "0.7166469", "0.7126319", "0.7088066", "0.70566076", "0.70529443", "0.7034239", "0.7015184", "0.70143527", "0.70080334", "0.7004935", "0.70042926", "0.70022553", "0.6988612", "0.6980831", "0.6979783", "0.6968875", "0.6952201", "0.6930101", "0.69155216", "0.689396", "0.6892777", "0.6882932", "0.68542176", "0.6853994", "0.6853994", "0.68344414", "0.6832693", "0.6807683", "0.6800161", "0.67905235", "0.67866814", "0.67847264", "0.6746779", "0.67379564", "0.67365074", "0.6725472", "0.6717121", "0.67141455", "0.67009324", "0.6694664", "0.6692487", "0.66880095", "0.6674411", "0.66585976", "0.6655638", "0.6648498", "0.66465175", "0.6624228", "0.66226953", "0.6621706" ]
0.6888977
71
Convert byte array to hex string
public String bytesToHex(byte[] bytes) { StringBuilder sbuf = new StringBuilder(); for(int idx=0; idx < bytes.length; idx++) { int intVal = bytes[idx] & 0xff; if (intVal < 0x10) sbuf.append("0"); sbuf.append(Integer.toHexString(intVal).toUpperCase()); } return sbuf.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String toHexString(byte[] array) {\n StringBuilder sb = new StringBuilder();\n sb.append(\"0x\").append(DatatypeConverter.printHexBinary(array));\n return sb.toString();\n }", "public static String bytesToHex(byte[] array) {\n StringBuffer hexString = new StringBuffer();\n for (int i = 0; i < array.length; i++) {\n String hex = Integer.toHexString(0xff & array[i]);\n if(hex.length() == 1) hexString.append('0');\n hexString.append(hex);\n }\n return hexString.toString();\n }", "public static String toHexString(byte[] array) {\n return DatatypeConverter.printHexBinary(array).toUpperCase();\n }", "public static String bytetohex(byte[] bytearray) {\n\t\tStringBuffer sb = new StringBuffer();\n\t\tfor (byte b : bytearray) {\n\t\t\tString x = Integer.toHexString((int) (b & 0xFF));\n\t\t\tif (x.length() == 1) {\n\t\t\t\tsb.append(String.valueOf(0));\n\t\t\t}\n\t\t\tsb.append(x);\n\t\t}\n\t\tif (sb.length() % 2 != 0) {\n\t\t\tsb.insert(0, 0);\n\t\t}\n\t\treturn sb.toString();\n\t}", "public static String toHex(byte[] array) {\n BigInteger bi = new BigInteger(1, array);\n String hex = bi.toString(16);\n int paddingLength = (array.length * 2) - hex.length();\n if (paddingLength > 0)\n return String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\n else\n return hex;\n }", "public static String toHex(byte[] array) {\n\t\tBigInteger bi = new BigInteger(1, array);\n\t\tString hex = bi.toString(16);\n\t\tint paddingLength = (array.length * 2) - hex.length();\n\t\tif (paddingLength > 0) {\n\t\t\tString format = \"%0\" + paddingLength + \"d\";\n\t\t\treturn String.format(format, 0) + hex;\n\t\t} else {\n\t\t\treturn hex;\n\t\t}\n\t}", "private static String toHex(byte[] array)\n\t {\n\t BigInteger bi = new BigInteger(1, array);\n\t String hex = bi.toString(16);\n\t int paddingLength = (array.length * 2) - hex.length();\n\t if(paddingLength > 0)\n\t return String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\n\t else\n\t return hex;\n\t }", "private static String toHex(final byte[] array) {\n final BigInteger bi = new BigInteger(1, array);\n final String hex = bi.toString(16);\n final int paddingLength = (array.length * 2) - hex.length();\n if (paddingLength > 0) {\n return String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\n } else {\n return hex;\n }\n }", "private static String toHex(byte[] array) {\r\n\t\tBigInteger bi = new BigInteger(1, array);\r\n\t\tString hex = bi.toString(16);\r\n\t\tint paddingLength = (array.length * 2) - hex.length();\r\n\t\tif (paddingLength > 0)\r\n\t\t\treturn String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\r\n\t\telse\r\n\t\t\treturn hex;\r\n\t}", "private String ByteArrayToHexString(byte [] inarray) {\n int i, j, in;\n String [] hex = {\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"A\",\"B\",\"C\",\"D\",\"E\",\"F\"};\n String out= \"\";\n\n for(j = 0 ; j < inarray.length ; ++j)\n {\n in = (int) inarray[j] & 0xff;\n i = (in >> 4) & 0x0f;\n out += hex[i];\n i = in & 0x0f;\n out += hex[i];\n }\n return out;\n }", "private static String toHex(byte[] array) {\r\n BigInteger bi = new BigInteger(1, array);\r\n String hex = bi.toString(16);\r\n int paddingLength = (array.length * 2) - hex.length();\r\n if (paddingLength > 0) {\r\n return String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\r\n } else {\r\n return hex;\r\n }\r\n }", "public static String bytetohex(byte[] bytearray) {\n\t\tStringBuilder build = new StringBuilder();\n\t\tfor (var bte : bytearray) {\n\t\t\tbuild.append(nibbleToChar((byte) ((bte & 240) >>> 4)));\n\t\t\tbuild.append(nibbleToChar((byte) (bte & 15)));\n\t\t}\n\t\treturn build.toString();\n\t}", "private String toHex(byte[] array)\n {\n BigInteger bi = new BigInteger(1, array);\n String hex = bi.toString(16);\n int paddingLength = (array.length * 2) - hex.length();\n if(paddingLength > 0) \n return String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\n else\n return hex;\n }", "private static String toHex(byte[] array) throws NoSuchAlgorithmException {\n\n BigInteger bi = new BigInteger(1, array);\n String hex = bi.toString(16);\n int paddingLength = (array.length * 2) - hex.length();\n if (paddingLength > 0) {\n return String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\n } else {\n return hex;\n }\n }", "public static String byteArrayToHexString(byte[] a) \r\n{\r\n\tStringBuilder sb = new StringBuilder(a.length * 2);\r\n\tfor(byte b: a)\r\n\tsb.append(String.format(\"%02x\", b));\r\n\treturn sb.toString();\r\n}", "private String toHex(byte[] data) {\r\n char[] chars = new char[data.length * 2];\r\n for (int i = 0; i < data.length; i++) {\r\n chars[i * 2] = HEX_DIGITS[(data[i] >> 4) & 0xf];\r\n chars[i * 2 + 1] = HEX_DIGITS[data[i] & 0xf];\r\n }\r\n return new String(chars);\r\n}", "public static String hex(final byte[] data) {\n return hex(data, 0, data.length);\n }", "public static String byteArrayToHex(byte[] a) {\n StringBuilder sb = new StringBuilder(a.length * 2);\n for(byte b: a)\n sb.append(String.format(\"%02x\", b & 0xff));\n return sb.toString();\n }", "public static String bytetohex(byte[] byteArray) {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor (int i = 0; i < byteArray.length; i++) {\n\t\t\tsb.append(String.format(\"%02x\", 0xFF & (int) byteArray[i]));\n\t\t}\n\t\treturn sb.toString().toLowerCase();\n\t}", "@NotNull\n public static String convertBytesToHex(@NotNull byte[] value) {\n checkNotNull(value);\n int len = value.length;\n char[] buff = new char[len + len];\n char[] hex = HEX;\n for (int i = 0; i < len; i++) {\n int c = value[i] & 0xff;\n buff[i + i] = hex[c >> 4];\n buff[i + i + 1] = hex[c & 0xf];\n }\n return new String(buff);\n }", "public static String byteArrayToHexString(byte[] value) {\r\n String ret = \"\";\r\n\r\n for (int i = value.length - 1; i >= 0; i--) {\r\n ret = ret.concat(Integer.toHexString((value[i] & 0xFF) | 0x100).substring(1, 3));\r\n }\r\n\r\n return ret;\r\n }", "public static String byteArrayToHexString(byte[] in) {\n\t\tint ch = 0x00;\n\t\tString pseudo[] = {\"0\", \"1\", \"2\",\n\t\t\t\t\"3\", \"4\", \"5\", \"6\", \"7\", \"8\",\n\t\t\t\t\"9\", \"A\", \"B\", \"C\", \"D\", \"E\", \"F\"};\n\n\t\tStringBuffer out = new StringBuffer(in.length*2);\n\t\tfor (int i = 0; i < in.length; i++) {\n\t\t\tch = ((in[i] & 0xF0) >> 4);\n\t\t\tch = (ch & 0x0F);\n\t\t\tout.append(pseudo[ch]);\n\t\t\tch = (in[i] & 0x0F);\n\t\t\tout.append(pseudo[ch]);\n\t\t}\n\t\treturn new String(out);\n\t}", "public static String byteArrayToHexStr(byte[] data)\r\n {\r\n\tString output = new String();\r\n\tString tempStr = new String();\r\n\tint tempInt = 0;\r\n\r\n\tfor(int a = 0; a < data.length; a++)\r\n\t {\r\n\t\ttempInt = data[a]&0xFF;\r\n\t\ttempStr = Integer.toHexString(tempInt);\r\n\r\n\t\tif(tempStr.length() == 1)\r\n\t\t tempStr = \"0\" + tempStr;\r\n\r\n\t\toutput += tempStr;\r\n\t }\r\n\treturn output;\r\n }", "public static String toHex(byte[] b) {\r\n\tStringBuffer buf;\r\n\tint i;\r\n\r\n\tbuf = new StringBuffer(b.length * 2);\r\n\r\n\tfor (i = 0; i < b.length; i++) {\r\n\t buf.append(HEX.charAt((b[i] >> 4) & 15));\r\n\t buf.append(HEX.charAt(b[i] & 15));\r\n\t}\r\n\treturn buf.toString();\r\n }", "public static String toHex(byte[] data) {\n\t\tStringBuilder builder = new StringBuilder(data.length * 3);\n\t\tfor (byte b : data) {\n\t\t\tint v = b & 0xFF;\n\t\t\t// Get the first then second character\n\t\t\tbuilder.append(HEX_ARRAY[v >>> 4]);\n\t\t\tbuilder.append(HEX_ARRAY[v & 0x0F]);\n\t\t\tbuilder.append(' ');\n\t\t}\n\t\treturn builder.toString().trim();\n\t}", "private String toHex(byte[] bytes) {\n StringBuilder s = new StringBuilder(bytes.length * 2);\n for (byte b : bytes) {\n s.append(String.format(\"%02x\", b));\n }\n return s.toString();\n }", "private static String byteArrayToHexString(byte[] byteArray) {\n\t\t\n\t\t//Initialize the string buffer\n\t\tStringBuffer stringBuffer = new StringBuffer(byteArray.length * 2);\n\t\t\n\t\t//Start constructing the byte array\n\t\tstringBuffer.append(\"[ \");\n\t\t\n\t\t//For all the bytes in the array\n\t\tfor (int i = 0; i < byteArray.length; i++) {\n\t\t\t\n\t\t\t//Convert the byte to an integer\n\t\t\tint v = byteArray[i] & 0xff;\n\t\t\t\n\t\t\t//Left shift\n\t\t\tif (v < 16) {\n\t\t\t\tstringBuffer.append('0');\n\t\t\t}\n\t\t\t\n\t\t\t//Add the hex string representation of the byte \n\t\t\tstringBuffer.append(\"0x\" + Integer.toHexString(v).toUpperCase() + \" \");\n\t\t}\n\t\t\n\t\t//Close the byte array string\n\t\tstringBuffer.append(\"]\");\n\t\t\n\t\t//Convert the string buffer to a string a return it\n\t\treturn stringBuffer.toString();\n\t}", "public static String byteArrayToHex(final byte[] arr) {\n final StringBuilder sb = new StringBuilder();\n if (arr != null) {\n for (final byte b : arr) {\n sb.append(byteToHex(b));\n sb.append(\" \");\n }\n }\n return sb.toString().replaceAll(\" $\", \"\");\n }", "public static final String bytesToHexString(byte[] bArray, int begin, int end) {\n StringBuffer sb = new StringBuffer(bArray.length);\n String sTemp;\n for (int i = begin; i < end; i++) {\n sTemp = Integer.toHexString(0xFF & bArray[i]);\n if (sTemp.length() < 2)\n sb.append(0);\n sb.append(sTemp.toUpperCase());\n sb.append(\" \");\n }\n return sb.toString();\n }", "public static final String toHexString(byte[] b) {\n return toHexString(b, 0, b.length);\n }", "public String byte2hex(byte[] b) {\n String hs = \"\";\n String stmp = \"\";\n for (int n = 0; n < b.length; n++) {\n stmp = (java.lang.Integer.toHexString(b[n] & 0XFF));\n if (stmp.length() == 1) {\n hs = hs + \"0\" + stmp;\n } else {\n hs = hs + stmp;\n }\n\n if (n < b.length - 1) {\n hs = hs + \"\";\n }\n }\n\n return hs;\n }", "public static String toHex(byte[] bytes){\r\n\t\treturn hexEncode(bytes);\r\n\t}", "public static String byteArrayToString(byte[] array) {\n\t\tStringBuilder str = new StringBuilder();\n\t\t\n\t\t//iterate through whole array, convert each element from the array to hexadecimal string form, put a space between elements\n\t\tfor(byte b : array) {\n\t\t\tstr.append(String.format(\"%02X\", b));\n\t\t\tstr.append(\" \");\n\t\t}\n\t\treturn str.toString();\n\t}", "private static String convertToHex(byte[] data) throws IOException {\n //create new instance of string buffer\n StringBuffer stringBuffer = new StringBuffer();\n String hex = \"\";\n\n //encode byte data with base64\n hex = Base64.getEncoder().encodeToString(data);\n stringBuffer.append(hex);\n\n //return string\n return stringBuffer.toString();\n }", "private static String hexify(byte bytes[]) {\n\n char[] hexDigits = {'0', '1', '2', '3', '4', '5', '6', '7',\n '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};\n\n StringBuilder buf = new StringBuilder(bytes.length * 2);\n for (byte aByte : bytes) {\n buf.append(hexDigits[(aByte & 0xf0) >> 4]);\n buf.append(hexDigits[aByte & 0x0f]);\n }\n return buf.toString();\n }", "public static String convertToHex(byte[] otp) {\n return ByteIterator.ofBytes(otp).hexEncode().drainToString();\n }", "static public String byteArrayToHexString(byte[] bytes) {\n\t\tStringBuilder sb = new StringBuilder(bytes.length * 2);\n\t\tfor (byte element : bytes) {\n\t\t\tint v = element & 0xff;\n\t\t\tif (v < 16) {\n\t\t\t\tsb.append('0');\n\t\t\t}\n\t\t\tsb.append(Integer.toHexString(v));\n\t\t}\n\t\treturn sb.toString().toUpperCase(Locale.US);\n\t}", "public static String bytesToHex(byte[] bytes) {\n Formatter f = new Formatter();\n for (byte b : bytes) {\n f.format(\"%02x\", b);\n }\n return f.toString();\n }", "public static String ByteArrayToHexString(byte[] bytes) {\n final char[] hexArray = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};\n char[] hexChars = new char[bytes.length * 2];\n int v;\n for ( int j = 0; j < bytes.length; j++ ) {\n v = bytes[j] & 0xFF;\n hexChars[j * 2] = hexArray[v >>> 4];\n hexChars[j * 2 + 1] = hexArray[v & 0x0F];\n }\n return new String(hexChars);\n }", "private String hexify(byte bytes[]) {\n\n char[] hexDigits = {'0', '1', '2', '3', '4', '5', '6', '7',\n '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};\n\n StringBuilder buf = new StringBuilder(bytes.length * 2);\n\n for (byte aByte : bytes) {\n buf.append(hexDigits[(aByte & 0xf0) >> 4]);\n buf.append(hexDigits[aByte & 0x0f]);\n }\n\n return buf.toString();\n }", "private String convertToHex(byte[] raw) {\n StringBuffer sb = new StringBuffer();\n for (int i = 0; i < raw.length; i++) {\n sb.append(Integer.toString((raw[i] & 0xff) + 0x100, 16).substring(1));\n }\n return sb.toString();\n }", "private static String bytesToHex(byte[] bytes) {\n char[] hexChars = new char[bytes.length * 2];\n for (int j = 0; j < bytes.length; j++) {\n int v = bytes[j] & 0xFF;\n hexChars[j * 2] = hexArray[v >>> 4];\n hexChars[j * 2 + 1] = hexArray[v & 0x0F];\n }\n return new String(hexChars);\n }", "public static String byteArrayToHex(byte[] bytes) {\n if (bytes == null) {\n throw new IllegalArgumentException((\"'bytes' must not be null\"));\n }\n\n StringBuilder sb = new StringBuilder(bytes.length * 2);\n for (byte b : bytes) {\n sb.append(format(\"%02x\", b));\n }\n return sb.toString();\n }", "public static String encodeHexString(byte[] byteArray) {\n StringBuffer hexStringBuffer = new StringBuffer();\n for (byte b : byteArray) {\n hexStringBuffer.append(byteToHex(b));\n }\n return hexStringBuffer.toString();\n }", "private static String bytesToHex(byte[] bytes) {\n StringBuilder result = new StringBuilder();\n\n for (byte byt : bytes) {\n result.append(Integer.toString((byt & 0xff) + 0x100, 16).substring(1));\n }\n\n return result.toString();\n }", "private static String byteArrayToHexString(byte[] b) {\n StringBuffer sb = new StringBuffer(b.length * 2);\n for (byte element : b) {\n int v = element & 0xff;\n if(v < 16) {\n sb.append('0');\n }\n sb.append(Integer.toHexString(v));\n }\n return sb.toString().toUpperCase();\n }", "public static String bytesToHex(byte[] in) {\n final StringBuilder builder = new StringBuilder();\n for (byte b : in) {\n builder.append(String.format(\"%02x\", b));\n }\n return builder.toString();\n }", "public static String byte2hex(byte[] b) {\n String hs = \"\";\n String stmp = \"\";\n\n for (int n = 0; n < b.length; n++) {\n stmp = Integer.toHexString(b[n] & 0xFF);\n if (stmp.length() == 1)\n hs += (\"0\" + stmp);\n else\n hs += stmp;\n }\n return hs.toUpperCase();\n }", "public static String hex(final byte[] data, final int offset, final int length) {\n Validate.notInBounds(data, offset, length);\n if (length == 0) {\n return \"\";\n }\n int endIndex = offset + length;\n char[] buf = new char[length << 1];\n\n int srcIdx = offset;\n int dstIdx = 0;\n for (; srcIdx < endIndex; srcIdx++, dstIdx += 2) {\n System.arraycopy(Hexs.HEXDUMP_TABLE, (data[srcIdx] & 0xFF) << 1, buf, dstIdx, 2);\n }\n return new String(buf);\n }", "public static String binToHexString(byte[] data) {\r\n return binToHexString(data, data.length);\r\n }", "public static String byteArrayToHexString(byte[] b) {\n StringBuffer buf = new StringBuffer();\n for (int i = 0; i < b.length; i++) {\n buf.append(byteToHexString(b[i]));\n }\n return buf.toString();\n }", "public static String bytesToHex(byte[] bytes) {\n StringBuffer result = new StringBuffer();\n for (byte byt : bytes) {\n result.append(Integer.toString((byt & 0xff) + 0x100, 16).substring(1));\n }\n return result.toString();\n }", "public static String bytesToHex(byte[] raw) {\n if (raw == null) {\n return null;\n }\n final StringBuilder hex = new StringBuilder(2 * raw.length);\n for (final byte b : raw) {\n hex.append(Character.forDigit((b & 0xF0) >> 4, 16))\n .append(Character.forDigit((b & 0x0F), 16));\n }\n return hex.toString();\n }", "public static String bytesToHex(byte[] bytes){\n if(bytes == null)\n throw new NullPointerException();\n String result = \"\";\n for(byte b: bytes){\n String tmp = Integer.toHexString(b & 0xFF);\n if(tmp.length() == 1)\n result += \"0\";\n result += tmp;\n }\n return result;\n }", "private static String bytesToHex(byte[] bytes) {\n final char[] hexArray = {'0', '1', '2', '3', '4', '5', '6', '7', '8',\n '9', 'A', 'B', 'C', 'D', 'E', 'F'};\n char[] hexChars = new char[bytes.length * 2];\n int v;\n for (int j = 0; j < bytes.length; j++) {\n v = bytes[j] & 0xFF;\n hexChars[j * 2] = hexArray[v >>> 4];\n hexChars[j * 2 + 1] = hexArray[v & 0x0F];\n }\n return new String(hexChars);\n }", "public static String byteArrayToHexString(byte[] bytes) {\n // Solution copied from https://stackoverflow.com/questions/9655181\n char[] hexChars = new char[bytes.length * 2];\n for (int j = 0; j < bytes.length; j++) {\n int v = bytes[j] & 0xFF;\n hexChars[j * 2] = Normal.DIGITS_16_UPPER[v >>> 4];\n hexChars[j * 2 + 1] = Normal.DIGITS_16_UPPER[v & 0x0F];\n }\n return new String(hexChars);\n }", "public static String toHexString(byte[] byteArray) {\n final StringBuilder hexString = new StringBuilder(\"\");\n if (byteArray == null || byteArray.length <= 0)\n return null;\n for (int i = 0; i < byteArray.length; i++) {\n int v = byteArray[i] & 0xFF;\n String hv = Integer.toHexString(v);\n if (hv.length() < 2) {\n hexString.append(0);\n }\n hexString.append(hv);\n }\n return hexString.toString().toLowerCase();\n }", "public static String bytesToHexString(byte[] b) {\n\t\treturn bytesToHexString(b,b.length);\n\t}", "private static String toHex(byte[] hash) {\n StringBuilder hashedInput = new StringBuilder(\"\");\n for (int i = 0; i < hash.length; i++) {\n String hex = Integer.toHexString(0xff & hash[i]);\n if (hex.length() == 1) {\n hashedInput.append('0');\n }\n hashedInput.append(hex);\n }\n return hashedInput.toString();\n }", "public static String toHexadecimal(final byte[] bytes) {\n\t\treturn new String(toHexadecimalChars(bytes));\n\t}", "private String toHexString(byte[] bytes) {\n StringBuilder hexString = new StringBuilder();\n for (int i = 0; i < bytes.length; i++) {\n String hex = Integer.toHexString(0xFF & bytes[i]);\n if (hex.length() == 1) {\n hexString.append('0');\n }\n hexString.append(hex);\n }\n\n return hexString.toString().toUpperCase();\n }", "public static String byteArrayToHexString(final byte[] hash) {\n\t\tString rval = \"\";\n\t\tfor (byte aHash : hash) {\n\t\t\trval += FileHashingUtils.byteToHexString(aHash);\n\t\t}\n\n\t\treturn rval;\n\t}", "public static String toHexString(byte[] bytes) {\n\t\tStringBuilder stringBuilder = new StringBuilder();\n\t\tfor (byte b : bytes) {\n\t\t\tstringBuilder.append(HEX_ALPHABET[b>>4]);\n\t\t\tstringBuilder.append(HEX_ALPHABET[b]);\n\t\t}\n\t\treturn stringBuilder.toString();\n\t}", "public static String byteToHex(final byte[] hash) {\n if (Objects.isNull(hash)) {\n return null;\n }\n\n Formatter formatter = new Formatter();\n for (byte b : hash) {\n formatter.format(\"%02x\", b);\n }\n String result = formatter.toString();\n formatter.close();\n return result;\n }", "public static String prettyHex(final byte[] data) {\n return prettyHex(data, 0, data.length);\n }", "private static String convertToHex(byte[] data) {\r\n StringBuffer buf = new StringBuffer();\r\n for (int i = 0; i < data.length; i++) {\r\n int halfbyte = (data[i] >>> 4) & 0x0F;\r\n int two_halfs = 0;\r\n do {\r\n if ((0 <= halfbyte) && (halfbyte <= 9)) {\r\n buf.append((char) ('0' + halfbyte));\r\n }\r\n else {\r\n buf.append((char) ('a' + (halfbyte - 10)));\r\n }\r\n halfbyte = data[i] & 0x0F;\r\n } while(two_halfs++ < 1);\r\n }\r\n return buf.toString();\r\n }", "public static final String toHex(byte hash[]) {\r\n StringBuffer buf = new StringBuffer(hash.length * 2);\r\n int i;\r\n\r\n for (i = 0; i < hash.length; i++) {\r\n if (((int) hash[i] & 0xff) < 0x10) {\r\n buf.append(\"0\");\r\n }\r\n buf.append(Long.toString((int) hash[i] & 0xff, 16));\r\n }\r\n return buf.toString();\r\n }", "public static String toHexString(byte[] b) {\r\n\t\tStringBuffer sb = new StringBuffer();\r\n\t\tfor (int i = 0; i < b.length; i++) {\r\n\t\t\tsb.append(hexCharsLowerCase[ (int)(((int)b[i] >> 4) & 0x0f)]);\r\n\t\t\tsb.append(hexCharsLowerCase[ (int)(((int)b[i]) & 0x0f)]);\r\n\t\t}\r\n\t return sb.toString(); \r\n\t}", "public static String formatHexBytes(byte[] raw) {\n StringBuffer buffer;\n final char[] hexDigits = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };\n int i;\n int value;\n buffer = new StringBuffer(raw.length * 2);\n for (i = 0; i < raw.length; i++) {\n value = raw[i];\n buffer.append(hexDigits[(value >> 4) & 0x0F]);\n buffer.append(hexDigits[value & 0x0F]);\n }\n return (buffer.toString());\n }", "public static String byteArrayToHexString(byte[] b) {\n if (b == null)\n return null;\n\n StringBuffer sb = new StringBuffer(b.length * 2);\n for (int i = 0; i < b.length; i++) {\n int v = b[i] & 0xff;\n if (v < 16) {\n sb.append('0');\n }\n sb.append(Integer.toHexString(v));\n }\n return sb.toString().toUpperCase();\n }", "private static String toHex(byte buffer[]) {\n\t\tStringBuffer sb = new StringBuffer(buffer.length * 2);\n\t\tfor (int i = 0; i < buffer.length; i++) {\n\t\t\tsb.append(Character.forDigit((buffer[i] & 0xf0) >> 4, 16));\n\t\t\tsb.append(Character.forDigit(buffer[i] & 0x0f, 16));\n\t\t}\n\t\treturn sb.toString();\n\t}", "public static String hexToString(byte[] bytes) {\n StringBuffer buff = new StringBuffer();\n for (int i=0; i<bytes.length; i++) {\n int val = bytes[i];\n val = val & 0xff; // remove higher bits, sign\n if (val<16) buff.append('0'); // leading 0\n buff.append(Integer.toString(val, 16));\n }\n return buff.toString();\n }", "public static String bytes2HexString(byte[] b)\n\t{\n\t byte[] buff = new byte[2 * b.length];\n\t for (int i = 0; i < b.length; i++)\n\t {\n\t\tbuff[2 * i] = hex[(b[i] >> 4) & 0x0f];\n\t\tbuff[2 * i + 1] = hex[b[i] & 0x0f];\n\t }\n\t return new String(buff);\n\t}", "public static String toHex(byte[] bytes)\n {\n\n if (bytes == null)\n {\n return null;\n }\n\n StringBuilder builder = new StringBuilder();\n for (int i = 0; i < bytes.length; i++)\n {\n int value = (int) bytes[i];\n\n builder.append(HEX_CHARS.charAt((value >> 4) & 0x0F));\n builder.append(HEX_CHARS.charAt(value & 0x0F));\n }\n\n return builder.toString();\n }", "public static String asHex(byte[] buf) {\n \t char[] HEX_CHARS = \"0123456789abcdef\".toCharArray();\n \t char[] chars = new char[2 * buf.length];\n \t for (int i = 0; i < buf.length; ++i) {\n \t chars[2 * i] = HEX_CHARS[(buf[i] & 0xF0) >>> 4];\n \t chars[2 * i + 1] = HEX_CHARS[buf[i] & 0x0F];\n \t }\n \t return new String(chars);\n \t}", "static String createString(byte b[]) {\n\treturn StringConverter.byteToHex(b);\n }", "public static String getHexString (byte[] bytes) {\r\n\t \r\n\t\tStringBuffer sb = new StringBuffer();\r\n\r\n\t for (int i = 0; i < bytes.length; i++) {\r\n\t sb.append(String.format(\"%02x\", bytes[i]).toUpperCase());\r\n\t if (i < (bytes.length - 1))\r\n\t \tsb.append(\"-\");\r\n\t }\r\n\r\n\t return sb.toString();\r\n\t}", "public static String bytesToHex(byte[] txtInByte) {\n\t\t StringBuilder sb = new StringBuilder(txtInByte.length * 2);\n\t\t for(byte b: txtInByte)\n\t\t sb.append(String.format(\"%02x\", b & 0xff));\n\t\t return sb.toString();\n\t\t}", "public static String byteToHex(byte[] bytes) {\n\t\tchar[] hexChars = new char[bytes.length * 2];\n\t\tfor (int i = 0; i < bytes.length; i++) {\n\t\t\tint j = bytes[i] & 0xFF;\n\t\t\thexChars[i * 2] = hexLookup[j >>> 4];\n\t\t\thexChars[i * 2 + 1] = hexLookup[j & 0x0F];\n\t\t}\n\t\treturn new String(hexChars);\n\t}", "public static String\n bytesToHexString(byte[] bytes) {\n if (bytes == null) return null;\n\n StringBuilder ret = new StringBuilder(2*bytes.length);\n\n for (int i = 0 ; i < bytes.length ; i++) {\n int b;\n\n b = 0x0f & (bytes[i] >> 4);\n\n ret.append(HEX_CHARS[b]);\n\n b = 0x0f & bytes[i];\n\n ret.append(HEX_CHARS[b]);\n }\n\n return ret.toString();\n }", "public static String rawHexDump(byte[] b)\r\n\t{\r\n\t\tif (b == null)\r\n\t\t\treturn \"\";\r\n\t\t\r\n\t\tint size = b.length;\r\n\t\tif (size == 0)\r\n\t\t\treturn \"\";\r\n\t\t\r\n\t\tStringBuffer buf = new StringBuffer();\r\n\t\tfor (int i=0; i < size; i++)\r\n\t\t{\r\n\t\t\t\tbuf.append(zeropad(Integer.toHexString(byteToUInt(b[i])).toUpperCase(),2));\r\n\t\t\t\tbuf.append(\" \");\r\n\t\t}\r\n\t\tbuf.delete(buf.length()-1,buf.length());\r\n\t\treturn buf.toString();\r\n\t}", "private static String getHex(byte[] raw) {\n if (raw == null) {\n return null;\n }\n final StringBuilder hex = new StringBuilder(2 * raw.length);\n for (final byte b : raw) {\n hex.append(HEXES.charAt((b & 0xF0) >> 4)).append(\n HEXES.charAt((b & 0x0F)));\n }\n return hex.toString();\n }", "public static String bytesToHexString(byte[] bytes) {\n char[] hexChars = new char[bytes.length * 2];\n int v;\n for (int j = 0; j < bytes.length; j++) {\n v = bytes[j] & 0xFF;\n hexChars[j * 2] = hexArray[v >>> 4];\n hexChars[j * 2 + 1] = hexArray[v & 0x0F];\n }\n return new String(hexChars).toUpperCase(Locale.US);\n }", "public static String toHexString(byte[] b)\r\n {\r\n if (b == null)\r\n return null;\r\n \r\n StringBuffer buf = new StringBuffer(b.length * 2);\r\n for (int n = 0; n < b.length; n++)\r\n {\r\n buf.append(m_hex[(b[n] & 0xf0) >>> 4]);\r\n buf.append(m_hex[b[n] & 0x0f]);\r\n }\r\n return buf.toString();\r\n }", "public static String toHexString(byte b[]) {\n int pos = 0;\n char[] c = new char[b.length * 2];\n for (int i = 0; i < b.length; i++) {\n c[pos++] = toHex[(b[i] >> 4) & 0x0F];\n c[pos++] = toHex[b[i] & 0x0f];\n }\n return new String(c);\n }", "private static String toHex(byte[] digest) {\n\t\tchar[] result = new char[digest.length * 2];\n\t\tint pos = 0;\n\t\tfor (int i = 0; i < digest.length; i++) {\n\t\t\tresult[pos++] = hexChar((digest[i] & 0xf0) >> 4);\n\t\t\tresult[pos++] = hexChar(digest[i] & 0x0f);\n\t\t}\n\t\treturn new String(result);\n\t}", "private static String _bytesToHex( ByteBuffer buf )\n {\n final int offset = buf.position();\n final int size = buf.remaining();\n final char[] hexChars = new char[size * 2];\n\n for (int j = 0; j < size; j++) {\n int v = buf.get(j + offset) & 0xFF;\n hexChars[j * 2] = hexArray[v >>> 4];\n hexChars[j * 2 + 1] = hexArray[v & 0x0F];\n }\n\n return new String(hexChars);\n }", "public static String asString(byte[] in) {\n final StringBuilder builder = new StringBuilder();\n for(byte b : in) {\n builder.append(String.format(\"%02x\", b));\n }\n return builder.toString();\n }", "public static String bytesToHexString(byte[] b, int len) {\n\t\tString s=new String();\n\t\tfor (int i=0; i<len; i++) {\n\t\t\ts+=Integer.toHexString((((b[i]+256)%256)/16)%16);\n\t\t\ts+=Integer.toHexString(((b[i]+256)%256)%16);\n\t\t}\n\t\treturn s;\n\t}", "static private String hexEncode(byte[] bytes) {\n StringBuffer result = new StringBuffer();\n for (int i = 0; i < bytes.length; i++) {\n byte b = bytes[i];\n result.append(DIGITS[(b & 0xf0) >> 4]);\n result.append(DIGITS[b & 0x0f]);\n }\n return result.toString();\n }", "public static String getHexString(byte[] raw, int len) {\r\n\t\tbyte[] hex = new byte[2 * len];\r\n\t\tint index = 0;\r\n\t\tint pos = 0;\r\n\r\n\t\tfor (byte b : raw) {\r\n\t\t\tif (pos >= len)\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tpos++;\r\n\t\t\tint v = b & 0xFF;\r\n\t\t\thex[index++] = HEX_CHAR_TABLE[v >>> 4];\r\n\t\t\thex[index++] = HEX_CHAR_TABLE[v & 0xF];\r\n\t\t}\r\n\r\n\t\treturn new String(hex);\r\n\t}", "public static String toHexString(byte[] b, int offset, int len)\r\n {\r\n if (b == null || b.length <= offset || offset < 0 || len <= 0)\r\n return null;\r\n\r\n StringBuffer buf = new StringBuffer(len * 2);\r\n int limit = Math.min(b.length, len + offset);\r\n for (int n = offset; n < limit; n++)\r\n {\r\n buf.append(m_hex[(b[n] & 0xf0) >>> 4]);\r\n buf.append(m_hex[b[n] & 0x0f]);\r\n }\r\n return buf.toString();\r\n \r\n }", "private String makeHex(byte[] buffer) {\n byte current;\n int length = buffer.length;\n String blank = \"\"; // it's easier to change\n StringBuffer ret = new StringBuffer(2*length);\n\n // do for each half byte\n for(int i=0;i<(2*length);i++)\n {\n\t// mask half byte and move it to the right\n\tcurrent = i%2==1 ? (byte) (buffer[(i/2)] & 0x0F)\n\t : (byte) ((buffer[(i/2)] >> 4) & 0x0F);\n\t\n\t// convert half byte to ASCII char\t\t \n\tret.append((char) (current < 0x0A ? current+0x30 : current+0x37) + (i%2==1 ? blank : \"\"));\n }\n return ret.toString();\n }", "public static String bytesToHexFun2(byte[] bytes) {\r\n\t\tchar[] buf = new char[bytes.length * 2];\r\n\t\tint index = 0;\r\n\t\tfor (byte b : bytes) { // 利用位运算进行转换\r\n\t\t\tbuf[index++] = HEX_CHAR[b >>> 4 & 0xf];\r\n\t\t\tbuf[index++] = HEX_CHAR[b & 0xf];\r\n\t\t}\r\n\r\n\t\treturn new String(buf);\r\n\t}", "protected byte[] binaryToHex(byte[] digest) throws UnsupportedEncodingException {\n StringBuffer digestString = new StringBuffer();\n for (int i = 0; i < digest.length; i++) {\n if ((digest[i] & 0x000000ff) < 0x10) {\n digestString.append(\"0\" + Integer.toHexString(digest[i] & 0x000000ff));\n } else {\n digestString.append(Integer.toHexString(digest[i] & 0x000000ff));\n }\n }\n return digestString.toString().getBytes(encoding);\n }", "public String toHexString()\n\t{\n\t\t// holds the string builder object to return\n\t\tStringBuilder sb = new StringBuilder();\n\t\t\n\t\t// for every byte\n\t\tfor (int i = 0; i < bytes.length; i++)\n\t\t{\n\t\t\tint intCurrent = bytes[i] & 0xFF;\n\t\t\t\n\t\t\t// check to see if a leading 0 is needed\n\t\t\tif (intCurrent < 0x10)\n\t\t\t{\n\t\t\t\t// append a 0\n\t\t\t\tsb.append(0);\n\t\t\t}\n\t\t\t\n\t\t\tString s = Integer.toHexString(intCurrent).toUpperCase();\n\t\t\t\n\t\t\t// append the character\n\t\t\tsb.append(s);\n\t\t}\n\t\t\n\t\t// return the string\n\t\treturn sb.toString();\n\t}", "private static String m5291a(byte[] bArr) {\n StringBuffer stringBuffer = new StringBuffer();\n for (byte b : bArr) {\n String hexString = Integer.toHexString(b & 255);\n if (hexString.length() == 1) {\n stringBuffer.append('0');\n }\n stringBuffer.append(hexString);\n }\n return stringBuffer.toString();\n }", "public static String toHexString( byte[] ba ) {\n int length = ba.length;\n char[] buf = new char[length * 3];\n for (int i = 0, j = 0, k; i < length; ) {\n k = ba[i++];\n buf[j++] = HEX_DIGITS[(k >> 4) & 0x0F];\n buf[j++] = HEX_DIGITS[ k & 0x0F];\n buf[j++] = ' ';\n }\n return new String(buf, 0, buf.length-1);\n }", "public static String bytesToString(byte[] txtInByte){\n \treturn hexToString(bytesToHex(txtInByte));\n }", "public static String intArrayToHexString(int[] intArray) {\n\n\t\tStringBuffer string = new StringBuffer();\n\t\tfor (int i : intArray) {\n\t\t\tstring.append(Integer.toHexString(i));\n\t\t}\n\t\treturn string.toString();\n\t}" ]
[ "0.82976747", "0.8239103", "0.8143766", "0.8106631", "0.8017282", "0.7960231", "0.7929531", "0.79084367", "0.78833735", "0.7876266", "0.787324", "0.7851372", "0.781033", "0.77933025", "0.771712", "0.76449656", "0.7644727", "0.764272", "0.76370776", "0.7604315", "0.7582991", "0.7578138", "0.75441754", "0.7543117", "0.7531986", "0.75259835", "0.7459165", "0.74551153", "0.74288803", "0.74275374", "0.7404529", "0.7393255", "0.73881507", "0.7378047", "0.73748815", "0.7373162", "0.73628783", "0.7360055", "0.73499507", "0.7349245", "0.7346735", "0.7345412", "0.73269135", "0.7321644", "0.7318173", "0.7291164", "0.7287866", "0.7263141", "0.72629756", "0.7262929", "0.72589225", "0.72571933", "0.72542953", "0.7253478", "0.7243527", "0.7219472", "0.72150755", "0.7205588", "0.7197916", "0.71904916", "0.7182092", "0.7179698", "0.7169749", "0.7157064", "0.71504414", "0.7146919", "0.7122966", "0.710969", "0.7074376", "0.70597816", "0.70534045", "0.70446855", "0.70309573", "0.7026066", "0.7016492", "0.69911844", "0.69653404", "0.6964716", "0.6952439", "0.6949213", "0.6948158", "0.6906227", "0.6896623", "0.6862662", "0.68581223", "0.6846968", "0.67901045", "0.6781158", "0.67373013", "0.67223084", "0.6714691", "0.67125547", "0.66929394", "0.66835594", "0.66527593", "0.6636986", "0.6633174", "0.662593", "0.66035813", "0.6585704" ]
0.68754834
83
Get utf8 byte array.
public byte[] getUTF8Bytes(String str) { try { return str.getBytes("UTF-8"); } catch (Exception ex) { return null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private byte[] getUTF8Bytes(String input) {\n\t\treturn input.getBytes(StandardCharsets.UTF_8);\n\t}", "public static final byte[] asUTF8(final String s) {\n return s.getBytes(StandardCharsets.UTF_8);\n }", "public static byte[] getUTF8Bytes(String str) {\r\n try { return str.getBytes(\"UTF-8\"); } catch (Exception ex) { return null; }\r\n }", "byte[] getBytes();", "byte[] getBytes();", "public static byte[] toBytes(String s) {\n return s.getBytes(UTF8_CHARSET);\n }", "public abstract byte[] toByteArray();", "public abstract byte[] toByteArray();", "com.google.protobuf.ByteString\n getS8Bytes();", "public byte[] toByteArray() {\n final byte[] data = new byte[maxIndex];\n for (Map.Entry<Integer, String> entry : addr2str.entrySet()) {\n final String str = entry.getValue();\n final int addr = entry.getKey();\n for (int k = 0; k < str.length(); k++) {\n data[addr + k] = (byte) str.charAt(k);\n }\n }\n return data;\n }", "public byte[] getBytes() {\r\n \treturn toString().getBytes();\r\n }", "public abstract byte[] getEncoded();", "com.google.protobuf.ByteString\n getEncodedBytes();", "@Benchmark\n public String bytesToStringOkio() {\n return BenchmarkUtils.decodeUtf8(decodeArray);\n }", "public byte[] getTextBytes();", "private byte[] randomByteArray() throws UnsupportedEncodingException {\n int len = sr.nextInt(maxlen);\n @StringBuilder@ sb = new @StringBuilder@(len);\n\n for (int i = 0; i < len; i++)\n sb.append((char) sr.nextInt(128));\n return sb.toString().getBytes(\"UTF-8\");\n }", "public String byteToChar(byte b[], String encoding);", "public byte[] toByteArray() {\n byte[] array = new byte[count];\n System.arraycopy(buf, 0, array, 0, count);\n return array;\n }", "com.google.protobuf.ByteString\n getToBytes();", "@NonNull\n public static byte[] StringToByte(String string) throws UnsupportedEncodingException\n {\n return string.getBytes(\"UTF-8\");\n }", "byte[] getEByteArray();", "public static Charset getUtf8Charset(){\n\t\tif(utf8 == null){\n\t\t\tutf8 = Charset.forName(\"UTF-8\");\n\t\t}\n\t\treturn utf8;\n\t}", "@Override\r\n\tpublic byte[] getBytes() {\n\t\treturn buffer.array();\r\n\t}", "byte[] decodeBytes();", "List<Byte> getAsBytes();", "public static byte[] stringToBytes(String string) {\n return string.getBytes(ENCODING);\n }", "public byte[] readRawString() throws IOException {\n int length = in.readInt();\n byte[] bytes = new byte[5 + length];\n bytes[0] = (byte) Type.STRING.code;\n bytes[1] = (byte) (0xff & (length >> 24));\n bytes[2] = (byte) (0xff & (length >> 16));\n bytes[3] = (byte) (0xff & (length >> 8));\n bytes[4] = (byte) (0xff & length);\n in.readFully(bytes, 5, length);\n return bytes;\n }", "public static byte[] GetBytesFromOctetString(String p) throws IOException {\n Charset encoding = StandardCharsets.UTF_8;\n return StringUtility.GetBytesFromOctetString(p, encoding);\n }", "public String[] getEncoding() throws PDFNetException {\n/* 771 */ return GetEncoding(this.a);\n/* */ }", "public String getStringEncoding()\n\t{\n\t\treturn \"utf-8\";\n\t}", "public static byte[] convertirString(String archivo) {\n\t\ttry {\n\t\t\treturn archivo.getBytes(\"UTF-8\");\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "public com.google.protobuf.ByteString\n getToBytes() {\n Object ref = to_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n to_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public byte[] toByteArray() {\n/* 510 */ ByteBuffer buff = ByteBuffer.allocate(40).order(ByteOrder.LITTLE_ENDIAN);\n/* 511 */ writeTo(buff);\n/* 512 */ return buff.array();\n/* */ }", "public com.google.protobuf.ByteString\n getToBytes() {\n Object ref = to_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n to_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public byte[] getContentBytes(String protocolCharset) throws UnsupportedEncodingException {\n if (getContentBuilder() != null) {\n return getContentBuilder().getContentBytes(protocolCharset);\n }\n return null;\n }", "protected static byte[] toByteArray(String str) {\n byte[] bytes = new byte[str.length()];\n for (int i = 0; i < bytes.length; i++) {\n bytes[i] = (byte) str.charAt(i);\n }\n return bytes;\n }", "byte[] getData();", "byte[] getData();", "byte[] getData();", "byte[] getData();", "public static final byte[] getDecoded(final String u) {\n BASE64Decoder decoder = new BASE64Decoder();\n\n try {\n return decoder.decodeBuffer(u);\n } catch (IOException e) {\n byte[] temp = {(byte) 0};\n return temp;\n }\n }", "public byte[] getByteArray(final String key) {\n return getByteArray(key, ArrayUtils.EMPTY_BYTE_ARRAY);\n }", "@ZenCodeType.Caster\n @ZenCodeType.Method\n default byte[] asByteArray() {\n //TODO this is actually sbyte[], but @Unsigned doesn't work on arrays right now\n return notSupportedCast(\"byte[]\");\n }", "public byte[] getEncoded() throws CRLException {\n if (encoding == null) {\n encoding = crl.getEncoded();\n }\n byte[] result = new byte[encoding.length];\n System.arraycopy(encoding, 0, result, 0, encoding.length);\n return result;\n }", "public byte[] toByteArray() \r\n {\r\n \tbyte newbuf[] = new byte[count];\r\n \tSystem.arraycopy(buf, 0, newbuf, 0, count);\r\n \treturn newbuf;\r\n }", "public byte[] getByteArray() {\n long val = getValue();\n return new byte[] {\n (byte)((val>>24) & 0xff),\n (byte)((val>>16) & 0xff),\n (byte)((val>>8) & 0xff),\n (byte)(val & 0xff) };\n }", "public CodePointIterator asUtf8String() {\n if (! hasNext()) {\n return CodePointIterator.EMPTY;\n }\n return new Utf8DecodingIterator(this);\n }", "public byte[] getByteArray() {\n try {\n byte[] ret = (byte[]) byteBuffers.dequeue();\n num++;\n //Thread.dumpStack();\n if(ZenBuildProperties.dbgDataStructures){\n System.out.write('b');\n System.out.write('a');\n System.out.write('_');\n System.out.write('c');\n System.out.write('a');\n System.out.write('c');\n System.out.write('h');\n System.out.write('e');\n edu.uci.ece.zen.utils.Logger.writeln(num);\n }\n\n if (ret == null) {\n return (byte[]) imm.newArray(byte.class, 1024);\n } else {\n return ret;\n }\n } catch (Exception e) {\n ZenProperties.logger.log(Logger.FATAL, getClass(), \"getByteArray\", e);\n System.exit(-1);\n }\n return null;\n }", "public static byte[] toBytes(String s)\n\t{\n\t\ttry\n\t\t{\n\t\t\t// int l = 4 - (s.length()%4);\n\t\t\t// for(int i=0;i<l;++i)\n\t\t\t// \ts+=\" \";\n\n\t\t\t// return Base64.getDecoder().decode(s);\n\t\t\treturn s.getBytes(ISO_8859_1);\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "public abstract byte[] toBytes() throws Exception;", "public byte[] getBytes()\r\n {\r\n return buf;\r\n }", "public static char[] encode(byte[] in) {\r\n \t\treturn encode(in, in.length);\r\n \t}", "public byte[] getEncoded() \n {\n try\n {\n return super.getEncoded();\n }\n catch (IOException e)\n {\n return null;\n }\n }", "@NonNull\n public static String byteToString(byte[] byteArray) throws UnsupportedEncodingException\n {\n return new String(byteArray, \"UTF-8\");\n }", "public static byte[] getBytes(char value) {\r\n\t\treturn ByteBuffer.allocate(2).order(ByteOrder.LITTLE_ENDIAN).putChar(value).array();\r\n\t}", "public byte[] charToByte(String text, String encoding);", "public byte[] getData();", "char[] getCharContent() throws IOException;", "private byte[] getExceptionMessageByte(String message) {\n return message.getBytes(StandardCharsets.UTF_8);\n }", "com.google.protobuf.ByteString\n getFromBytes();", "com.google.protobuf.ByteString\n getFromBytes();", "public static byte[] getByteArrayFromFile(File file) throws UnsupportedEncodingException {\n return (fileLoggerInstance == null) ? new byte[]{} : fileLoggerInstance.getFileContentsAsByteArray(file);\n }", "public static byte[] valueToBytes(Object value) throws JSONException, IOException {\n if (value == null || value.equals(null)) {\n return Constants.NullByteMarker;\n }\n \t// return raw bytes is value is byte[] - else use normal json string conversion\n if (value instanceof byte[]) {\n \treturn (byte[])value;\n }\n \n if (value instanceof long[]) {\n \treturn Util.UTF8(longArrayString((long[])value));\n }\n \n if (value instanceof JSONString) {\n Object o;\n try {\n o = ((JSONString)value).toJSONString();\n } catch (Exception e) {\n throw new JSONException(e);\n }\n if (o instanceof String) {\n return Util.UTF8(o);\n }\n throw new JSONException(\"Bad value from toJSONString: \" + o);\n }\n if (value instanceof Number) {\n return Util.UTF8(JSONObject.numberToString((Number) value));\n }\n if (value instanceof Boolean || value instanceof JSONObject ||\n value instanceof JSONArray) {\n return Util.UTF8(value);\n }\n if (value instanceof Map) {\n return Util.UTF8(new JSONObject((Map)value));\n }\n if (value instanceof JSONList) {\n return ((JSONList)value).getBytes().makeExact().bytes();\n }\n if (value instanceof List) {\n return new JSONList((List)value).getBytes().makeExact().bytes();\n }\n if (value instanceof Collection) {\n return Util.UTF8(new JSONArray((Collection)value));\n }\n if (value.getClass().isArray()) {\n return Util.UTF8(new JSONArray(value));\n }\n return Util.UTF8(JSONObject.quote(value.toString()));\n }", "public byte[] toArray()\r\n {\r\n return _stream.toByteArray();\r\n }", "public byte[] toBytes() {\n ByteArrayOutputStream os = new ByteArrayOutputStream();\n try {\n writeTo(os);\n } catch (IOException e) {e.printStackTrace();}\n return os.toByteArray();\n }", "public byte[] asByteArray() {\n return data;\n }", "public byte[] getAsBytes() {\n return (byte[])data;\n }", "byte[] getByteContent() throws IOException;", "public static byte[] asciiStringToByteArray(String text, int length) {\n return Arrays.copyOf(text.getBytes(Charset.US_ASCII), length);\n }", "byte[] readBytes();", "public int[] utf8ToInt(byte[] bval) {\n return utf8ToInt(bval, bval.length);\n }", "public byte[] getBytes(boolean littleEndian) {\n try {\n String charSet = \"US-ASCII\";\n\n byte[] sysname_buf = (this.sysname + \"\\0\").getBytes(charSet);\n byte[] nodename_buf = (this.nodename + \"\\0\").getBytes(charSet);\n byte[] release_buf = (this.release + \"\\0\").getBytes(charSet);\n byte[] version_buf = (this.version + \"\\0\").getBytes(charSet);\n byte[] machine_buf = (this.machine + \"\\0\").getBytes(charSet);\n byte[] domainname_buf = (this.domainname + \"\\0\").getBytes(charSet);\n\n byte[] buffer = new byte[SIZE_OF];\n\n ByteBuffer byteBuffer = ByteBuffer.wrap(buffer).order(littleEndian ? ByteOrder.LITTLE_ENDIAN : ByteOrder.BIG_ENDIAN);\n\n byteBuffer.position(0);\n byteBuffer.put(sysname_buf);\n\n byteBuffer.position(_SYSNAME_SIZE);\n byteBuffer.put(nodename_buf);\n\n byteBuffer.position(_SYSNAME_SIZE * 2);\n byteBuffer.put(release_buf);\n\n byteBuffer.position(_SYSNAME_SIZE * 3);\n byteBuffer.put(version_buf);\n\n byteBuffer.position(_SYSNAME_SIZE * 4);\n byteBuffer.put(machine_buf);\n\n byteBuffer.position(_SYSNAME_SIZE * 5);\n byteBuffer.put(domainname_buf);\n\n return buffer;\n } catch (UnsupportedEncodingException e) {\n throw new RuntimeException(e);\n }\n }", "public char[] getAsChars() {\n return (char[])data;\n }", "public byte[] getByteArray()\n \t{\n \t\t// In some cases the array is bigger than the actual number\n \t\t// of valid bytes.\n \t\tint realByteLength = getLengthInBytes();\n \n \t\t// Currently the case is that the return from this\n \t\t// call only includes the valid bytes.\n \t\tif (value.length != realByteLength) {\n \t\t\tbyte[] data = new byte[realByteLength];\n \t\t\tSystem.arraycopy(value, 0, data, 0, realByteLength);\n \n \t\t\tvalue = data;\n \t\t}\n \n \t\treturn value;\n \t}", "public com.google.protobuf.ByteString\n getS8Bytes() {\n java.lang.Object ref = s8_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n s8_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public static String convertToUTF8(String s) {\n String out = null;\n try {\n out = new String(s.getBytes(\"UTF-8\"), \"ISO-8859-1\");\n } catch (java.io.UnsupportedEncodingException e) {\n return null;\n }\n return out;\n }", "public java.lang.String getS8() {\n java.lang.Object ref = s8_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n s8_ = s;\n }\n return s;\n }\n }", "public com.google.protobuf.ByteString\n getS8Bytes() {\n java.lang.Object ref = s8_;\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 s8_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public static byte[] dataStringToByteArray(String inDataString) throws JCavernInternalError\n\t{\n\t\tStringTokenizer aTokenizer = new StringTokenizer(inDataString);\n\t\tint\t\t\t\tindex = 0;\n\t\tbyte[]\t\t\ttheBytes = new byte[aTokenizer.countTokens()];\n\n\t\twhile (aTokenizer.hasMoreTokens())\n\t\t{\n\t\t\tString\taToken = aTokenizer.nextToken();\n\t\t\ttheBytes[index] = (byte) Integer.parseInt(aToken, 16);\n\t\t\tindex++;\n\t\t}\n\t\t\n\t\treturn theBytes;\n\t}", "private byte[] toByteArray(String s)\r\n\t\t{\n\t\t\tlong l = 0;\r\n\t\t\tif (s.startsWith(\"0x\") || s.startsWith(\"0X\")) {\r\n\t\t\t\tfinal byte[] d = new byte[(s.length() - 1) / 2];\r\n\t\t\t\tint k = (s.length() & 0x01) != 0 ? 3 : 4;\r\n\t\t\t\tfor (int i = 2; i < s.length(); i = k, k += 2)\r\n\t\t\t\t\td[(i - 1) / 2] = (byte) Short.parseShort(s.substring(i, k), 16);\r\n\t\t\t\treturn d;\r\n\t\t\t}\r\n\t\t\telse if (s.length() > 1 && s.startsWith(\"0\"))\r\n\t\t\t\tl = Long.parseLong(s, 8);\r\n\t\t\telse if (s.startsWith(\"b\"))\r\n\t\t\t\tl = Long.parseLong(s.substring(1), 2);\r\n\t\t\telse\r\n\t\t\t\tl = Long.parseLong(s);\r\n\t\t\tint i = 0;\r\n\t\t\tfor (long test = l; test != 0; test /= 0x100)\r\n\t\t\t\t++i;\r\n\t\t\tfinal byte[] d = new byte[i == 0 ? 1 : i];\r\n\t\t\tfor (; i-- > 0; l /= 0x100)\r\n\t\t\t\td[i] = (byte) (l & 0xff);\r\n\t\t\treturn d;\r\n\t\t}", "char[] toCharArray();", "private byte[] decode(ByteBuffer bytes) {\n \treturn bytes.array();\r\n }", "java.lang.String getEncoded();", "String readUTF(byte data[], int off, int len)\n {\n StringBuffer buf = new StringBuffer();\n for (int end = off + len; off < end;)\n {\n int ch = data[off++] & 0xFF;\n switch (ch >> 4)\n {\n case 0:\n case 1:\n case 2:\n case 3:\n case 4:\n case 5:\n case 6:\n case 7:\n // 0xxxxxxx\n break;\n case 12:\n case 13:\n if (off >= len)\n {\n return null;\n }\n // 110x xxxx 10xx xxxx\n ch = ((ch & 0x1F) << 6) | (data[off++] & 0x3F);\n break;\n case 14:\n if (off + 2 >= len)\n {\n return null;\n }\n // 1110 xxxx 10xx xxxx 10xx xxxx\n ch = ((ch & 0x0f) << 12) | ((data[off++] & 0x3F) << 6) | (data[off++] & 0x3F);\n break;\n default:\n if (off + 1 >= len)\n {\n return null;\n }\n // 10xx xxxx, 1111 xxxx\n ch = ((ch & 0x3F) << 4) | (data[off++] & 0x0f);\n break;\n }\n buf.append((char) ch);\n }\n return buf.toString();\n }", "public byte[] toByteArray() throws IOException{\r\n ByteArrayOutputStream ba = new ByteArrayOutputStream();\r\n DataOutputStream dos = new DataOutputStream(ba);\r\n\r\n dos.writeUTF(this.nome);\r\n dos.writeUTF(this.email);\r\n dos.writeUTF(this.endereco);\r\n // System.out.println(ba);\r\n \r\n return ba.toByteArray();\r\n }", "public static String convertToUTF8(String s) {\n\n String out = null;\n\n try {\n\n out = new String(s.getBytes(\"UTF-8\"), \"ISO-8859-1\");\n\n } catch (java.io.UnsupportedEncodingException e) {\n\n return null;\n }\n\n return out;\n }", "public static byte[] decodeToBytes(InputStream in) throws IOException {\n\t\tByteArrayOutputStream out = new ByteArrayOutputStream();\n\t\tdecode(in, out, false);\n\t\treturn out.toByteArray();\n\t}", "public java.lang.String getS8() {\n java.lang.Object ref = s8_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n s8_ = s;\n }\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "static ByteString toBytes(String str) {\n return ByteString.copyFrom(str.getBytes(Internal.UTF_8));\n }", "public static byte[] readFileAsByteArray(String path) throws IOException {\n return internalReadFileAsByteArray(path).array();\n }", "public void convertToUTF8() {\n FileInputStream istream = null;\n Writer out = null;\n try {\n istream = new FileInputStream(path);\n BufferedInputStream in = new BufferedInputStream(istream);\n CharsetDecoder charsetDecoder = Charset.forName(\"UTF-8\").newDecoder();\n charsetDecoder.onMalformedInput(CodingErrorAction.REPLACE);\n charsetDecoder.onUnmappableCharacter(CodingErrorAction.REPLACE);\n Reader inputReader = new InputStreamReader(in, charsetDecoder);\n StringWriter writer = new StringWriter();\n IOUtils.copy(inputReader, writer);\n String theString = writer.toString();\n FileUtils.deleteQuietly(new File(path));\n out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path), \"UTF-8\"));\n out.write(theString);\n out.close();\n// System.out.println(\"\");\n } catch (FileNotFoundException ex) {\n logger.error(\"Error converting the file to utf8\", ex);\n } catch (IOException ex) {\n logger.error(\"Error converting the file to utf8\", ex);\n } finally {\n try {\n if (out != null) {\n out.close();\n }\n if (istream != null) {\n istream.close();\n }\n } catch (IOException ex) {\n logger.error(\"Error converting the file to utf8\", ex);\n }\n }\n\n }", "public static String convertFromUTF8(String s) {\n String out = null;\n try {\n out = new String(s.getBytes(\"ISO-8859-1\"), \"UTF-8\");\n } catch (Exception e) {\n\n return null;\n }\n return out;\n }", "public static byte[] toByteArray(String s) {\n return DatatypeConverter.parseHexBinary(s.toUpperCase());\n }", "public byte[] toByteArray() throws IOException {\n/* */ COSInputStream cOSInputStream;\n/* 501 */ ByteArrayOutputStream output = new ByteArrayOutputStream();\n/* 502 */ InputStream is = null;\n/* */ \n/* */ try {\n/* 505 */ cOSInputStream = createInputStream();\n/* 506 */ IOUtils.copy((InputStream)cOSInputStream, output);\n/* */ }\n/* */ finally {\n/* */ \n/* 510 */ if (cOSInputStream != null)\n/* */ {\n/* 512 */ cOSInputStream.close();\n/* */ }\n/* */ } \n/* 515 */ return output.toByteArray();\n/* */ }", "public byte[] toBytes() {\n return toProtobuf().toByteArray();\n }", "@Override // com.google.protobuf.Utf8.Processor\n public int encodeUtf8(CharSequence in, byte[] out, int offset, int length) {\n char c;\n long j;\n long j2;\n long outLimit;\n String str;\n String str2;\n char c2;\n long outIx = (long) (ARRAY_BASE_OFFSET + offset);\n long outLimit2 = ((long) length) + outIx;\n int inLimit = in.length();\n String str3 = \" at index \";\n String str4 = \"Failed writing \";\n if (inLimit > length || out.length - length < offset) {\n throw new ArrayIndexOutOfBoundsException(str4 + in.charAt(inLimit - 1) + str3 + (offset + length));\n }\n int inIx = 0;\n while (true) {\n c = 128;\n j = 1;\n if (inIx < inLimit) {\n char c3 = in.charAt(inIx);\n if (c3 >= 128) {\n break;\n }\n UNSAFE.putByte(out, outIx, (byte) c3);\n inIx++;\n outIx = 1 + outIx;\n } else {\n break;\n }\n }\n if (inIx == inLimit) {\n return (int) (outIx - ((long) ARRAY_BASE_OFFSET));\n }\n while (inIx < inLimit) {\n char c4 = in.charAt(inIx);\n if (c4 < c && outIx < outLimit2) {\n UNSAFE.putByte(out, outIx, (byte) c4);\n str2 = str3;\n outIx += j;\n j2 = 1;\n outLimit = outLimit2;\n str = str4;\n c2 = 128;\n } else if (c4 >= 2048 || outIx > outLimit2 - 2) {\n if (c4 >= 55296 && 57343 >= c4) {\n str2 = str3;\n str = str4;\n } else if (outIx <= outLimit2 - 3) {\n str2 = str3;\n str = str4;\n long outIx2 = outIx + 1;\n UNSAFE.putByte(out, outIx, (byte) ((c4 >>> '\\f') | 480));\n long outIx3 = outIx2 + 1;\n UNSAFE.putByte(out, outIx2, (byte) (((c4 >>> 6) & 63) | 128));\n UNSAFE.putByte(out, outIx3, (byte) ((c4 & '?') | 128));\n outLimit = outLimit2;\n outIx = outIx3 + 1;\n c2 = 128;\n j2 = 1;\n } else {\n str2 = str3;\n str = str4;\n }\n if (outIx <= outLimit2 - 4) {\n if (inIx + 1 != inLimit) {\n inIx++;\n char low = in.charAt(inIx);\n if (Character.isSurrogatePair(c4, low)) {\n int codePoint = Character.toCodePoint(c4, low);\n outLimit = outLimit2;\n long outIx4 = outIx + 1;\n UNSAFE.putByte(out, outIx, (byte) ((codePoint >>> 18) | PageId.FINGERPRINT_ENROLLING_VALUE));\n long outIx5 = outIx4 + 1;\n UNSAFE.putByte(out, outIx4, (byte) (((codePoint >>> 12) & 63) | 128));\n long outIx6 = outIx5 + 1;\n c2 = 128;\n UNSAFE.putByte(out, outIx5, (byte) (((codePoint >>> 6) & 63) | 128));\n j2 = 1;\n UNSAFE.putByte(out, outIx6, (byte) ((codePoint & 63) | 128));\n outIx = outIx6 + 1;\n }\n }\n throw new UnpairedSurrogateException(inIx - 1, inLimit);\n } else if (55296 > c4 || c4 > 57343 || (inIx + 1 != inLimit && Character.isSurrogatePair(c4, in.charAt(inIx + 1)))) {\n throw new ArrayIndexOutOfBoundsException(str + c4 + str2 + outIx);\n } else {\n throw new UnpairedSurrogateException(inIx, inLimit);\n }\n } else {\n long outIx7 = outIx + 1;\n UNSAFE.putByte(out, outIx, (byte) ((c4 >>> 6) | 960));\n UNSAFE.putByte(out, outIx7, (byte) ((c4 & '?') | 128));\n str2 = str3;\n outIx = outIx7 + 1;\n j2 = 1;\n outLimit = outLimit2;\n str = str4;\n c2 = 128;\n }\n inIx++;\n c = c2;\n str3 = str2;\n str4 = str;\n outLimit2 = outLimit;\n j = j2;\n }\n return (int) (outIx - ((long) ARRAY_BASE_OFFSET));\n }", "@Test\n public void testGetBytes() {\n LOGGER.info(\"testGetBytes\");\n final String s = \"Hello\";\n final byte[] expected = s.getBytes(US_ASCII);\n final AtomString atomString1 = new AtomString(s);\n final byte[] actual = atomString1.getBytes();\n assertArrayEquals(expected, actual);\n }", "public byte[] getbyteArray() {\n byte[] output = new byte[header_size+fileData.length];\n output[0] = (byte)((type & 0xff00)>> 8);\n output[1] = (byte)(type & 0xff);\n output[2] = (byte)((length & 0xff00)>> 8);\n\t output[3] = (byte)(length & 0xff);\n output[4] = (byte)((clientID & 0xff00)>> 8);\n output[5] = (byte)(clientID & 0xff);\n output[6] = action;\n byte[] temp2 = ByteBuffer.allocate(4).putInt(sectionLength).array();\n for(int i=0;i<4;i++) {\n output[7+i] = temp2[i]; \n }\n temp2 = ByteBuffer.allocate(4).putInt(filePosition).array();\n for(int j=0;j<4;j++) {\n output[11+j] = temp2[j]; \n }\n //copy file data\n System.arraycopy(fileData, 0,output, 15,fileData.length); \n return output;\n }", "public byte[] getBytes() {\n return baos.toByteArray();\n }", "public byte[] GetBytes() {\n return data;\n }" ]
[ "0.7229581", "0.7058881", "0.6946543", "0.65500015", "0.65500015", "0.6280861", "0.6244139", "0.6244139", "0.6236977", "0.62046564", "0.6107628", "0.6090181", "0.6059033", "0.60578954", "0.60404193", "0.60279876", "0.60263264", "0.6003518", "0.5986593", "0.59160644", "0.5883335", "0.5866834", "0.58579105", "0.58479774", "0.58457524", "0.5814735", "0.5806519", "0.57855755", "0.5767489", "0.5755404", "0.5743143", "0.5741789", "0.57129747", "0.57048255", "0.57039964", "0.56996024", "0.5692288", "0.5692288", "0.5692288", "0.5692288", "0.56916326", "0.5683402", "0.56757003", "0.56687814", "0.56579846", "0.56564075", "0.5655293", "0.56547284", "0.56530356", "0.5647833", "0.56373614", "0.5634344", "0.5631781", "0.56222576", "0.5599258", "0.5595962", "0.55916643", "0.5589799", "0.5588353", "0.5581328", "0.5581328", "0.55806786", "0.5575733", "0.5574005", "0.5567746", "0.5566804", "0.55495375", "0.5548741", "0.55287266", "0.552554", "0.5524124", "0.552073", "0.55181533", "0.55164844", "0.55118865", "0.5507931", "0.5494895", "0.54867435", "0.5478964", "0.5459509", "0.54572606", "0.54557693", "0.54525584", "0.5451373", "0.54480773", "0.5444681", "0.54393363", "0.5432965", "0.543279", "0.5427998", "0.5427252", "0.5425845", "0.54206026", "0.54199076", "0.54138964", "0.541207", "0.5410002", "0.5409467", "0.5404606", "0.539933" ]
0.7133005
1
Load UTF8withBOM or any ansi text file.
public String loadFileAsString(String filename) throws java.io.IOException { final int BUFLEN=1024; BufferedInputStream is = new BufferedInputStream(new FileInputStream(filename), BUFLEN); try { ByteArrayOutputStream baos = new ByteArrayOutputStream(BUFLEN); byte[] bytes = new byte[BUFLEN]; boolean isUTF8=false; int read,count=0; while((read=is.read(bytes)) != -1) { if (count==0 && bytes[0]==(byte)0xEF && bytes[1]==(byte)0xBB && bytes[2]==(byte)0xBF ) { isUTF8=true; baos.write(bytes, 3, read-3); // drop UTF8 bom marker } else { baos.write(bytes, 0, read); } count+=read; } return isUTF8 ? new String(baos.toByteArray(), "UTF-8") : new String(baos.toByteArray()); } finally { try{ is.close(); } catch(Exception ex){} } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tpublic void testUTF8WithoutBom() throws IOException {\n\t\tBufferedReader reader = new BufferedReader(\n\t\t\t\tnew InputStreamReader(new FileInputStream(UTF8_NO_BOM_FILE), \"UTF-8\")\n\t\t);\n\t\tReadTestCSVFile(reader);\n\t}", "@Override\n\tpublic void load() {\n\t\tFileHandle file = Gdx.files.internal(DogRunner.PARENT_DIR + \"charset.txt\");\n\t\tcharset = file.readString();\n\t}", "@Test\n\tpublic void testUTF8() throws IOException {\n\t\tBufferedReader reader = new BufferedReader(\n\t\t\t\tnew InputStreamReader(new FileInputStream(UTF8_FILE), \"UTF-8\")\n\t\t);\n\t\tReadTestCSVFile(reader);\n\t}", "public void convertToUTF8() {\n FileInputStream istream = null;\n Writer out = null;\n try {\n istream = new FileInputStream(path);\n BufferedInputStream in = new BufferedInputStream(istream);\n CharsetDecoder charsetDecoder = Charset.forName(\"UTF-8\").newDecoder();\n charsetDecoder.onMalformedInput(CodingErrorAction.REPLACE);\n charsetDecoder.onUnmappableCharacter(CodingErrorAction.REPLACE);\n Reader inputReader = new InputStreamReader(in, charsetDecoder);\n StringWriter writer = new StringWriter();\n IOUtils.copy(inputReader, writer);\n String theString = writer.toString();\n FileUtils.deleteQuietly(new File(path));\n out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path), \"UTF-8\"));\n out.write(theString);\n out.close();\n// System.out.println(\"\");\n } catch (FileNotFoundException ex) {\n logger.error(\"Error converting the file to utf8\", ex);\n } catch (IOException ex) {\n logger.error(\"Error converting the file to utf8\", ex);\n } finally {\n try {\n if (out != null) {\n out.close();\n }\n if (istream != null) {\n istream.close();\n }\n } catch (IOException ex) {\n logger.error(\"Error converting the file to utf8\", ex);\n }\n }\n\n }", "public void loadFromFile(String file) throws IOException {\n loadFromFile(file,DEFAULT_CHAR_SET);\n }", "public static String loadFileAsString(String filename) throws java.io.IOException {\r\n final int BUFLEN=1024;\r\n BufferedInputStream is = new BufferedInputStream(new FileInputStream(filename), BUFLEN);\r\n try {\r\n ByteArrayOutputStream baos = new ByteArrayOutputStream(BUFLEN);\r\n byte[] bytes = new byte[BUFLEN];\r\n boolean isUTF8=false;\r\n int read,count=0;\r\n while((read=is.read(bytes)) != -1) {\r\n if (count==0 && bytes[0]==(byte)0xEF && bytes[1]==(byte)0xBB && bytes[2]==(byte)0xBF ) {\r\n isUTF8=true;\r\n baos.write(bytes, 3, read-3); // drop UTF8 bom marker\r\n } else {\r\n baos.write(bytes, 0, read);\r\n }\r\n count+=read;\r\n }\r\n return isUTF8 ? new String(baos.toByteArray(), \"UTF-8\") : new String(baos.toByteArray());\r\n } finally {\r\n try{ is.close(); } catch(Exception ex){}\r\n }\r\n }", "@Test\n @JUnitTemporaryDatabase // Relies on specific IDs so we need a fresh database\n public void testImportUtf8() throws Exception {\n createAndFlushServiceTypes();\n createAndFlushCategories();\n \n //Initialize the database\n ModelImporter mi = m_importer;\n String specFile = \"/utf-8.xml\";\n mi.importModelFromResource(new ClassPathResource(specFile));\n \n assertEquals(1, mi.getNodeDao().countAll());\n // \\u00f1 is unicode for n~ \n assertEquals(\"\\u00f1ode2\", mi.getNodeDao().get(1).getLabel());\n }", "private void skipBOM() {\n/* */ try {\n/* 471 */ if (PeekChar() == '') {\n/* 472 */ ReadChar();\n/* */ }\n/* 474 */ } catch (EOFException e) {}\n/* */ }", "public void textFile(String path){\n\t\tBufferedReader br;\r\n\t\ttry {\r\n\t\t\tbr = new BufferedReader(new InputStreamReader(\r\n\t\t\t\t\tnew FileInputStream(path),Charset.forName(\"gbk\")));\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\tthrow new IllegalArgumentException(e);\r\n\t\t}\r\n\t\tLineBufferReader myReader=new LineBufferReader(br);\r\n\t}", "private void load() {\n try {\n StringBuilder sb = new StringBuilder();\n InputStreamReader isr = new InputStreamReader(SpellCheckerDemo.class.getResourceAsStream(\"/org/jdesktop/swingx/demo/JuliusCaesar.txt\"));\n BufferedReader br = new BufferedReader(isr);\n String str;\n while((str = br.readLine()) != null) {\n sb.append(str);\n sb.append(\"\\n\");\n }\n str = sb.toString();\n textArea.setText(str);\n } catch (Throwable t) {\n logger.log(Level.SEVERE,\"Unable to load the text.\",t);\n }\n }", "@Test\n\tpublic void testUTF16BE() throws IOException {\n\t\tBufferedReader reader = new BufferedReader(\n\t\t\t\tnew InputStreamReader(new FileInputStream(UTF16BE_FILE), \"UTF-16be\")\n\t\t);\n\t\tReadTestCSVFile(reader);\n\t}", "@SuppressWarnings(\"unused\")\n public static void setRuntimeEncoding() throws IllegalAccessException, NoSuchFieldException {\n System.setProperty(\"file.encoding\", \"UTF-8\");\n Field charset = Charset.class.getDeclaredField(\"defaultCharset\");\n charset.setAccessible(true);\n charset.set(null, null);\n }", "private Set<String> loadSpecialCharacters() throws FileNotFoundException {\n return new BufferedReader(new FileReader(SPECIAL_CHARACTERS_FILE))\n .lines()\n .collect(Collectors.toSet());\n }", "@Test\n public void testUnicodeAt4KB() {\n File f = getFile(\"more_than_4KB.txt\");\n assertNotNull(f);\n FileObject fo = FileUtil.toFileObject(f);\n assertNotNull(fo);\n BufferedCharSequence chars = new BufferedCharSequence(fo, cs_UTF_8.newDecoder(), f.length());\n assertEquals('0', chars.charAt(0));\n assertEquals('1', chars.charAt(1));\n int xPos;\n if (chars.charAt(4094) == '\\r' && chars.charAt(4095) == '\\n') {\n // windows line-endings, can be caused by hg extension win32text\n xPos = 4098;\n } else {\n // unix or mac line-endings\n xPos = 4097;\n }\n assertEquals('X', chars.charAt(xPos));\n assertEquals('Y', chars.charAt(xPos+1));\n }", "static String readFile(String path, Charset encoding) throws IOException {\n\t\tbyte[] encoded = Files.readAllBytes(Paths.get(path));\n\t\treturn encoding.decode(ByteBuffer.wrap(encoded)).toString();\n\t}", "public static void verifyUtf8andTransactionsHelper() {\r\n\r\n //hibernate not ok yet, try next time starting up\r\n if (!GrouperDdlUtils.okToUseHibernate()) {\r\n return;\r\n }\r\n \r\n\r\n // Property configuration.detect.utf8.problems wasn't functioning as intended. Discourage its use\r\n if (!isBlank(GrouperConfig.retrieveConfig().propertyValueString(\"configuration.detect.utf8.problems\"))) {\r\n String error = \"Warning: grouper property configuration.detect.utf8.problems is no longer used. Instead, \"\r\n + \"set configuration.detect.utf8.file.problems and configuration.detect.utf8.db.problems\";\r\n LOG.warn(error);\r\n System.out.println(error);\r\n\r\n }\r\n\r\n boolean detectTransactionProblems = GrouperConfig.retrieveConfig().propertyValueBoolean(\"configuration.detect.db.transaction.problems\", true);\r\n\r\n boolean detectUtf8FileProblems = GrouperConfig.retrieveConfig().propertyValueBoolean(\"configuration.detect.utf8.file.problems\", true);\r\n\r\n boolean detectUtf8DbProblems = GrouperConfig.retrieveConfig().propertyValueBoolean(\"configuration.detect.utf8.db.problems\", true);\r\n\r\n boolean detectCaseSensitiveProblems = GrouperConfig.retrieveConfig().propertyValueBoolean(\"configuration.detect.db.caseSensitive.problems\", true);\r\n\r\n if (!detectUtf8FileProblems && !detectUtf8DbProblems && !detectTransactionProblems && !detectCaseSensitiveProblems) {\r\n return;\r\n }\r\n\r\n final String someUtfString = \"ٹٺٻټكلل\";\r\n\r\n /* Do the contents of grouper/conf/grouperUtf8.txt match the hard-coded string above? */\r\n if (detectUtf8FileProblems) {\r\n boolean utfProblems = false;\r\n String theStringFromFile = null;\r\n try {\r\n theStringFromFile = GrouperUtil.readResourceIntoString(\"grouperUtf8.txt\", false);\r\n } catch (Exception e) {\r\n String error = \"Error: Cannot read string from resource grouperUtf8.txt\";\r\n LOG.error(error, e);\r\n System.out.println(error);\r\n e.printStackTrace();\r\n utfProblems = true;\r\n }\r\n if (!utfProblems && !StringUtils.equals(theStringFromFile, someUtfString)) {\r\n String error = \"Error: Cannot properly read UTF-8 string from resource: grouperUtf8.txt: '\" + theStringFromFile\r\n + \"'\";\r\n\r\n String fileEncoding = System.getProperty(\"file.encoding\");\r\n if (fileEncoding == null || !fileEncoding.toLowerCase().startsWith(\"utf\")) {\r\n error += \", make sure you pass in the JVM switch -Dfile.encoding=utf-8 (currently is '\" \r\n + fileEncoding + \"')\";\r\n }\r\n\r\n fileEncoding = GrouperConfig.retrieveConfig().propertyValueString(\"grouper.default.fileEncoding\");\r\n if (fileEncoding == null || !fileEncoding.toLowerCase().startsWith(\"utf\")) {\r\n error += \", make sure you have grouper.default.fileEncoding set to UTF-8 in the grouper.properties (or leave it out since the default should be UTF-8)\";\r\n }\r\n\r\n LOG.error(error);\r\n System.out.println(error);\r\n utfProblems = true;\r\n }\r\n if (!utfProblems & GrouperConfig.retrieveConfig().propertyValueBoolean(\"configuration.display.utf8.success.message\", false)) {\r\n System.out.println(\"Grouper can read UTF-8 characters correctly from files\");\r\n }\r\n }\r\n\r\n /* Check for case-insensitive selects. The row in grouper_ddl is object_name='Grouper'. If it can be found\r\n * with object_name='GROUPER', the database is not case-sensitive */\r\n if (detectCaseSensitiveProblems) {\r\n Hib3GrouperDdl grouperDdl = GrouperDdlUtils.retrieveDdlByNameFromDatabase(\"GROUPER\");\r\n\r\n if (grouperDdl != null) {\r\n String error = \"Error: Queries in your database seem to be case insensitive, \"\r\n + \"this can be a problem for Grouper, if you are using MySQL you should use a bin collation\";\r\n LOG.error(error);\r\n System.out.println(error);\r\n } else if (GrouperConfig.retrieveConfig().propertyValueBoolean(\"configuration.display.db.caseSensitive.success.message\", false)) {\r\n System.out.println(\"Your database can handle case sensitive queries correctly\");\r\n }\r\n }\r\n\r\n /* Check for both DB transactions and UTF-8 support. Insert a new entry in grouper_ddl, with\r\n * object_name = grouperUtf_{random uuid} and history = {a UTF string}. When read back, is the history\r\n * still the original string? */\r\n if (!HibernateSession.isReadonlyMode()) {\r\n //this shouldnt exist, just make sure\r\n GrouperDdlUtils.deleteUtfDdls();\r\n\r\n final String id = GrouperUuid.getUuid();\r\n final String name = \"grouperUtf_\" + id;\r\n\r\n Hib3GrouperDdl grouperDdl = GrouperDdlUtils.storeAndReadUtfString(someUtfString, id, name);\r\n \r\n //lets check transactions\r\n if (detectTransactionProblems) {\r\n Hib3GrouperDdl grouperDdlNew = GrouperDdlUtils.retrieveDdlByIdFromDatabase(id);\r\n if (grouperDdlNew != null) {\r\n \r\n String error = \"Error: Your database does not seem to support transactions, Grouper requires a transactional database\";\r\n LOG.error(error);\r\n System.out.println(error);\r\n \r\n //delete it again\r\n GrouperDdlUtils.deleteDdlById(id);\r\n \r\n } else if (GrouperConfig.retrieveConfig().propertyValueBoolean(\"configuration.display.transaction.success.message\", false)) {\r\n System.out.println(\"Your database can handle transactions correctly\");\r\n }\r\n }\r\n\r\n //check reading a utf8 string\r\n if (detectUtf8DbProblems) {\r\n\r\n boolean utfProblems = false;\r\n\r\n if (grouperDdl == null) {\r\n String error = \"Error: Why is grouperDdl utf null???\";\r\n LOG.error(error);\r\n System.out.println(error);\r\n utfProblems = true;\r\n } else {\r\n if (!StringUtils.equals(grouperDdl.getHistory(), someUtfString)) {\r\n String error = \"Error: Cannot properly read UTF-8 string from database: '\" + grouperDdl.getHistory()\r\n + \"', make sure your database has UTF-8 tables and perhaps a hibernate.connection.url in grouper.hibernate.properties\";\r\n LOG.error(error);\r\n System.out.println(error);\r\n utfProblems = true;\r\n }\r\n }\r\n if (!utfProblems & GrouperConfig.retrieveConfig().propertyValueBoolean(\"configuration.display.utf8.success.message\", false)) {\r\n System.out.println(\"The grouper database can handle UTF-8 characters correctly\");\r\n }\r\n }\r\n }\r\n }", "private void readEncoding(BufferedReader reader) throws IOException {\n String encoding = reader.readLine();\r\n if ( ! AbstractUtf8Message.UTF8_ENCODING_HEADER_STRING.equals(encoding)) {\r\n throw new IOException(\"Expected UTF-8 header when decoding UTF-8 message\");\r\n }\r\n }", "@Test\n\tpublic void test_ReadUtf8String_bad_data() throws IOException {\n\t\tBinaryReader br = br(true, -22, -87, 'A', 0);\n\t\tassertEquals(\"\\ufffdA\" /* unicode replacement char, 'A'*/, br.readUtf8String(0));\n\t}", "private void loadText() {\n\t\ttext1 = app.loadStrings(\"./data/imports/TXT 1.txt\");\n\t\ttext2 = app.loadStrings(\"./data/imports/TXT 2.txt\");\n\t}", "@Test\n\tpublic void testUTF16LE() throws IOException {\n\t\tBufferedReader reader = new BufferedReader(\n\t\t\t\tnew InputStreamReader(new FileInputStream(UTF16LE_FILE), \"UTF-16le\")\n\t\t);\n\t\tReadTestCSVFile(reader);\n\t}", "@Test\n\tpublic void test_ReadUtf8String() throws IOException {\n\t\tBinaryReader br = br(true, -22, -87, -107, -61, -65, 0);\n\t\tassertEquals(\"\\uaa55\\u00ff\", br.readUtf8String(0));\n\t}", "public String loadTextFile(String path) throws IOException {\n File file = new File(path);\n\n // Convert the file to a string.\n String output;\n try {\n output = Files.toString(file, Charsets.UTF_8);\n } catch (IOException ex) {\n LoggerFactory.getLogger(Resources.class).error(\"Unable to locate the resource at \" + path + \".\", ex);\n throw ex;\n }\n\n return output;\n }", "private String readFile(String path, Charset encoding) throws IOException \r\n\t{\r\n\t\tbyte[] encoded = Files.readAllBytes(Paths.get(path));\r\n\t\treturn new String(encoded, encoding);\r\n\t}", "private void loadFont() {\n\t\ttry {\n\t\t\tfont = Font.createFont(Font.TRUETYPE_FONT, new FileInputStream(\"assets/fonts/forced_square.ttf\"));\n\t\t} catch (Exception e) {\n\t\t\tfont = new Font(\"Helvetica\", Font.PLAIN, 22);\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void load(Tokenizer tokenizer) throws IOException {\n this.load(tokenizer, StandardCharsets.UTF_8);\n }", "public static ParserResult loadDatabase(File fileToOpen, String encoding) throws IOException {\n \n Reader reader = getReader(fileToOpen, encoding);\n String suppliedEncoding = null;\n try {\n boolean keepon = true;\n int piv = 0, c;\n while (keepon) {\n c = reader.read();\n if ( (piv == 0 && Character.isWhitespace( (char) c)) ||\n c == GUIGlobals.SIGNATURE.charAt(piv))\n piv++;\n else\n keepon = false;\n found: if (piv == GUIGlobals.SIGNATURE.length()) {\n keepon = false;\n // Found the signature. The rest of the line is unknown, so we skip it:\n while (reader.read() != '\\n');\n // Then we must skip the \"Encoding: \"\n for (int i=0; i<GUIGlobals.encPrefix.length(); i++) {\n if (reader.read() != GUIGlobals.encPrefix.charAt(i))\n break found; // No, it doesn't seem to match.\n }\n // If ok, then read the rest of the line, which should contain the name\n // of the encoding:\n StringBuffer sb = new StringBuffer();\n while ((c = reader.read()) != '\\n')\n sb.append((char)c);\n suppliedEncoding = sb.toString();\n }\n \n }\n } catch (IOException ex) {}\n \n if ((suppliedEncoding != null) && (!suppliedEncoding.equalsIgnoreCase(encoding))) {\n Reader oldReader = reader;\n try {\n // Ok, the supplied encoding is different from our default, so we must make a new\n // reader. Then close the old one.\n reader = getReader(fileToOpen, suppliedEncoding);\n oldReader.close();\n //System.out.println(\"Using encoding: \"+suppliedEncoding);\n } catch (IOException ex) {\n reader = oldReader; // The supplied encoding didn't work out, so we keep our\n // existing reader.\n \n //System.out.println(\"Error, using default encoding.\");\n }\n } else {\n // We couldn't find a supplied encoding. Since we don't know far into the file we read,\n // we start a new reader.\n reader.close();\n reader = getReader(fileToOpen, encoding);\n //System.out.println(\"No encoding supplied, or supplied encoding equals default. Using default encoding.\");\n }\n \n \n //return null;\n \n BibtexParser bp = new BibtexParser(reader);\n \n ParserResult pr = bp.parse();\n pr.setEncoding(encoding);\n \n return pr;\n }", "@Test\n\tpublic void testUTF16() throws IOException {\n\t\tBufferedReader reader = new BufferedReader(\n\t\t\t\tnew InputStreamReader(new FileInputStream(UTF16LE_FILE), \"UTF-16\")\n\t\t);\n\t\tReadTestCSVFile(reader);\n\n\t\tBufferedReader reader1 = new BufferedReader(\n\t\t\t\tnew InputStreamReader(new FileInputStream(UTF16BE_FILE), \"UTF-16\")\n\t\t);\n\t\tReadTestCSVFile(reader1);\n\t}", "private static String loadFile(String path){\n try {\n\n BufferedReader reader = new BufferedReader(new FileReader(path));\n StringBuilder sb = new StringBuilder();\n\n String line;\n while((line = reader.readLine()) != null){\n sb.append(line);\n sb.append('\\n');\n }\n\n reader.close();\n return sb.toString();\n\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n return null;\n } catch (IOException e) {\n e.printStackTrace();\n return null;\n }\n }", "public void GetData(String nameFile) throws IOException {\n File file = new File(nameFile);\n BufferedReader finalLoad = new BufferedReader(new FileReader(file));\n int symbol = finalLoad.read();\n int indexText = 0;\n while (symbol != -1) {\n text[indexText++] = (char) symbol;\n if (indexText >= Constants.MAX_TEXT - 1) {\n PrintError(\"to mach size of file\".toCharArray(), \"\".toCharArray());\n break;\n }\n symbol = finalLoad.read();\n }\n text[indexText++] = '\\n';\n text[indexText] = '\\0';\n finalLoad.close();\n //System.exit(1);\n }", "public void setFileEncoding(String s) {\n if (s == null) fileEncoding = \"\";\n else fileEncoding = s;\n }", "public String loadFromFile() {\n StringBuilder sb = new StringBuilder();\n try {\n Log.d(\"DEBUG\", this.context.getPackageName());\n Log.d(\"DEBUG\", this.file);\n FileInputStream fis = context.openFileInput(file);\n BufferedReader br = new BufferedReader(new InputStreamReader(fis, this.encoding));\n String line;\n while(( line = br.readLine()) != null ) {\n sb.append( line );\n sb.append( '\\n' );\n }\n } catch (IOException e) {\n e.printStackTrace();\n return \"\";\n }\n return sb.toString();\n }", "private void LoadContent() {\n\t\ttry { // Récupération de la police d'écriture\n\t\t\tfont1 = Font.createFont(Font.TRUETYPE_FONT, new File(\"res/polices/Coalition.ttf\"));\n\t\t\tfont2 = Font.createFont(Font.TRUETYPE_FONT, new File(\"res/polices/13_Misa.ttf\"));\n\t\t} catch (final Exception err) {\n\t\t\tSystem.err.println(\"Police(s) d'écriture introuvable(s) !\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t}", "static String readFile(String path, Charset encoding)\n throws IOException\n {\n byte[] encoded = Files.readAllBytes(Paths.get(path));\n return new String(encoded, encoding);\n }", "public void load (File file) throws Exception;", "public void fontLoader(){\n try {\n //create the font to use. Specify the size!\n customFont = Font.createFont(Font.TRUETYPE_FONT, new File(\".\\\\resources\\\\DS-DIGI.ttf\")).deriveFont(40f);\n GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();\n ge.registerFont(customFont);\n } catch (IOException e) {\n e.printStackTrace();\n } catch(FontFormatException e) {\n e.printStackTrace();\n }\n }", "@Override\n public String getCharacterEncoding() {\n return null;\n }", "@Test\n public void testunicode32() {\n assertEquals(\"\\uD834\\uDD1E\", JsonReader.read(\"\\\"\\\\uD834\\\\uDD1E\\\"\"));\n }", "@Test\n\tpublic void test_ReadNextUtf8String() throws IOException {\n\t\tBinaryReader br = br(true, -22, -87, -107, -61, -65, 0, -22, -87, -107, 0);\n\t\tassertEquals(\"\\uaa55\\u00ff\", br.readNextUtf8String());\n\t\tassertEquals(\"\\uaa55\", br.readNextUtf8String());\n\t}", "String readDocument(String path, Charset charset);", "public void LoadTxt(File Arquivo) {\n if (Arquivo.exists()) {\r\n\r\n try {\r\n\r\n FileReader FR = new FileReader(Arquivo);\r\n BufferedReader BW = new BufferedReader(new InputStreamReader(new FileInputStream(Arquivo.getAbsolutePath()), \"ISO-8859-1\"));\r\n\r\n //BufferedReader BW = new BufferedReader(FR);\r\n\r\n String dados;\r\n String[] paraArray = new String[3];\r\n String matricula;\r\n \r\n String serie = Arquivo.getName();\r\n int pos = serie.lastIndexOf(\".\");\r\n if (pos > 0) {\r\n serie = serie.substring(0, pos);\r\n }\r\n\r\n Sala novaSala = new Sala(serie); //CRIANDO SALA COM NOME DE TURMA\r\n salas2.add(novaSala); // ADICIONANDO SALA NA LISTA DE SALAS\r\n while ((dados = BW.readLine()) != null) {\r\n paraArray = dados.split(\";\");\r\n\r\n matricula = /*Integer.parseInt*/ (paraArray[0]);\r\n //senha = /*Integer.parseInt*/(paraArray[2]);\r\n Dados novoDado = new Dados(matricula, paraArray[1], paraArray[2]);\r\n\r\n novoDado.setSerie(serie); //ADICIONANDO TURMA AO DADO\r\n novaSala.getDadosalas().add(novoDado); //ADICIONANDO DADOS A LISTA DE DADOS QUE ESTA EM SALA\r\n\r\n }\r\n \r\n\r\n BW.close();\r\n FR.close();\r\n\r\n } catch (Exception e) {\r\n System.out.println(\"Erro ao carregar arquivo acima\");\r\n System.out.println(e.getMessage());\r\n\r\n }\r\n\r\n } else {\r\n System.out.println(\"Nenhum arquivo de dados encontrado\");\r\n }\r\n\r\n }", "public void loadFile(File p_file) throws IOException;", "private BufferedReader getBufferedReader(final String fileName)\n throws UnsupportedEncodingException {\n InputStream configStream = Thread.currentThread().\n getContextClassLoader().getResourceAsStream(fileName);\n return new BufferedReader(new InputStreamReader(configStream, \"UTF-8\"));\n }", "void load(File file);", "public String readFile(){\r\n StringBuffer str = new StringBuffer(); //StringBuffer is a mutable string\r\n Charset charset = Charset.forName(\"UTF-8\"); //UTF-8 character encoding\r\n Path file = Paths.get(filename + \".txt\");\r\n try (BufferedReader reader = Files.newBufferedReader(file, charset)) { // Buffer: a memory area that buffered streams read\r\n String line = null;\r\n while ((line = reader.readLine()) != null) { //Readers and writers are on top of streams and converts bytes to characters and back, using a character encoding\r\n str.append(line + \"\\n\");\r\n }\r\n }\r\n catch (IOException x) {\r\n System.err.format(\"IOException: %s%n\", x);\r\n }\r\n return str.toString();\r\n }", "@Test\n public void testUnicodeDoesNotCrash() throws IOException {\n System.setIn(Util.resourceStream(\"/genia-unicode.in\"));\n File tmpOut = File.createTempFile(\"test-genia-unicode\", \".out\");\n System.out.println(\"genia unicode test: tmp out file: \" + tmpOut.getAbsolutePath());\n System.setOut(new PrintStream(new BufferedOutputStream(new FileOutputStream(tmpOut))));\n Main.main(new String[] { \"-nt\" });\n }", "public void testInvalidTextValueWithBrokenUTF8() throws Exception\n {\n final byte[] input = readResource(\"/data/clusterfuzz-cbor-35979.cbor\");\n try (JsonParser p = MAPPER.createParser(input)) {\n assertToken(JsonToken.VALUE_STRING, p.nextToken());\n p.getText();\n fail(\"Should not pass\");\n } catch (StreamReadException e) {\n verifyException(e, \"Truncated UTF-8 character in Short Unicode Name (36 bytes)\");\n }\n\n }", "private static String loadFile(File file) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new FileReader(file));\n\t\treturn br.readLine();\n\t}", "private void get_text() {\n InputStream inputStream = JsonUtil.class.getClassLoader().getResourceAsStream(\"data.txt\");\n BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));\n StringBuilder sb = new StringBuilder();\n String line = null;\n try {\n while ((line = reader.readLine()) != null) {\n sb.append(line);\n }\n } catch (Exception e) {\n e.printStackTrace();\n System.out.println(e.getMessage());\n }\n this.text = sb.toString().trim();\n }", "private static String loadConvert(String str) {\n\t\tint off = 0;\n\t\tint len = str.length();\n\t\tchar[] in = str.toCharArray();\n\t\tchar[] convtBuf = new char[1024];\n\t\tif (convtBuf.length < len) {\n\t\t\tint newLen = len * 2;\n\t\t\tif (newLen < 0) {\n\t\t\t\tnewLen = Integer.MAX_VALUE;\n\t\t\t}\n\t\t\tconvtBuf = new char[newLen];\n\t\t}\n\t\tchar aChar;\n\t\tchar[] out = convtBuf;\n\t\tint outLen = 0;\n\t\tint end = off + len;\n\n\t\twhile (off < end) {\n\t\t\taChar = in[off++];\n\t\t\tif (aChar == '\\\\') {\n\t\t\t\taChar = in[off++];\n\t\t\t\tif (aChar == 'u') {\n\t\t\t\t\t// Read the xxxx\n\t\t\t\t\tint value = 0;\n\t\t\t\t\tfor (int i = 0; i < 4; i++) {\n\t\t\t\t\t\taChar = in[off++];\n\t\t\t\t\t\tswitch (aChar) {\n\t\t\t\t\t\tcase '0':\n\t\t\t\t\t\tcase '1':\n\t\t\t\t\t\tcase '2':\n\t\t\t\t\t\tcase '3':\n\t\t\t\t\t\tcase '4':\n\t\t\t\t\t\tcase '5':\n\t\t\t\t\t\tcase '6':\n\t\t\t\t\t\tcase '7':\n\t\t\t\t\t\tcase '8':\n\t\t\t\t\t\tcase '9':\n\t\t\t\t\t\t\tvalue = (value << 4) + aChar - '0';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'a':\n\t\t\t\t\t\tcase 'b':\n\t\t\t\t\t\tcase 'c':\n\t\t\t\t\t\tcase 'd':\n\t\t\t\t\t\tcase 'e':\n\t\t\t\t\t\tcase 'f':\n\t\t\t\t\t\t\tvalue = (value << 4) + 10 + aChar - 'a';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'A':\n\t\t\t\t\t\tcase 'B':\n\t\t\t\t\t\tcase 'C':\n\t\t\t\t\t\tcase 'D':\n\t\t\t\t\t\tcase 'E':\n\t\t\t\t\t\tcase 'F':\n\t\t\t\t\t\t\tvalue = (value << 4) + 10 + aChar - 'A';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tthrow new IllegalArgumentException(\"Malformed \\\\uxxxx encoding.\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tout[outLen++] = (char) value;\n\t\t\t\t} else {\n\t\t\t\t\tif (aChar == 't')\n\t\t\t\t\t\taChar = '\\t';\n\t\t\t\t\telse if (aChar == 'r')\n\t\t\t\t\t\taChar = '\\r';\n\t\t\t\t\telse if (aChar == 'n')\n\t\t\t\t\t\taChar = '\\n';\n\t\t\t\t\telse if (aChar == 'f')\n\t\t\t\t\t\taChar = '\\f';\n\t\t\t\t\tout[outLen++] = aChar;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tout[outLen++] = aChar;\n\t\t\t}\n\t\t}\n\t\treturn new String(out, 0, outLen);\n\t}", "public static void main(String[] args) {\n\t\tString path = System.getProperty(\"user.dir\") + File.separator + \"src\" + File.separator + \"encodingtest.java\";\n\t\tSystem.out.println(path);\n\t\tFile file = new File(path);\n\t\tif(file.exists()){\n\t\t\ttry {\n\t String s = FileUtils.readFileToString(file, \"GBK\");\n\t System.out.println(\"convert \" + file.getPath());\n\t FileUtils.writeStringToFile(file, s, \"UTF-8\");\n\t } catch (IOException e) {\n\t // TODO Auto-generated catch block\n\t e.printStackTrace();\n\t }\n\t\t}else{\n\t\t\tSystem.out.println(\"File not exist. \" + path);\n\t\t}\n\t}", "public static void openTextFile() {\n\t\ttry {\n\t\t\tin1 = new Scanner(new File(file1));\n\t\t\tin2 = new Scanner(new File(file2));\n\t\t} catch(FileNotFoundException ex) {\n\t\t\tSystem.err.println(\"Error opening file\" + ex);\n\t\t\tSystem.exit(1);\n\t\t}\n\t}", "public void setFileEncoding(String encoding) {\n\t\tthis.fileEncoding = encoding;\n\t}", "public void setFileEncoding(String fileEncoding) {\n this.fileEncoding = fileEncoding;\n }", "public void load(InputStream stream) {\n Validate.notNull(stream, \"Stream may not be null\");\n\n load(new InputStreamReader(stream, StandardCharsets.UTF_8));\n }", "private static String guessAppropriateEncoding(CharSequence contents) {\n\t\tfor (int i = 0; i < contents.length(); i++) {\n\t\t\tif (contents.charAt(i) > 0xFF) {\n\t\t\t\treturn \"UTF-8\";\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "private static String guessAppropriateEncoding(CharSequence contents) {\n\t\tfor (int i = 0; i < contents.length(); i++) {\n\t\t\tif (contents.charAt(i) > 0xFF) {\n\t\t\t\treturn \"UTF-8\";\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public void load(File source);", "public void loadData() {\n Path path= Paths.get(filename);\n Stream<String> lines;\n try {\n lines= Files.lines(path);\n lines.forEach(ln->{\n String[] s=ln.split(\";\");\n if(s.length==3){\n try {\n super.save(new Teme(Integer.parseInt(s[0]),Integer.parseInt(s[1]),s[2]));\n } catch (ValidationException e) {\n e.printStackTrace();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }else\n System.out.println(\"linie corupta in fisierul teme.txt\");});\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "@Override\n @SuppressWarnings(\"unchecked\")\n public SlickRenderFont loadFont(final Graphics g, final String filename) throws SlickLoadFontException {\n try {\n Font javaFont = loadJavaFont(filename);\n \n if (javaFont == null) {\n throw new SlickLoadFontException(\"Loading TTF Font failed.\");\n }\n \n if (javaFont.getSize() == 1) {\n javaFont = javaFont.deriveFont(12.f);\n }\n \n final UnicodeFont uniFont = new UnicodeFont(javaFont);\n uniFont.addAsciiGlyphs();\n uniFont.getEffects().add(new ColorEffect());\n \n return new UnicodeSlickRenderFont(uniFont, javaFont);\n } catch (final Exception e) {\n throw new SlickLoadFontException(\"Loading the font failed.\", e);\n }\n }", "@Override\n public void setCharacterEncoding(String arg0) {\n\n }", "public static String readFile(Path path) {\n\t\tif (path != null) {\n\t\t\tbyte[] bytes = toByteArray(path);\n\t\t\tif (bytes != null) {\n\t\t\t\treturn new String(bytes, StandardCharsets.UTF_8);\n\t\t\t}\n\t\t}\n\t\treturn \"\";\n\t}", "@Test\n\tpublic void testJsonEncoding() throws IOException {\n\t\tvalidateEncodingHandling(\"UTF16BE.json\", Charsets.UTF_16BE, \"The\\uD801\\uDC37 Na\\uD834\\uDD1Em\\uD834\\uDD1Ee\\uD801\\uDC37\");\n\t\tvalidateEncodingHandling(\"ISO8859-1.json\", Charsets.ISO_8859_1, \"³ for ?, ¿ for ?\");\n\t\t// Reading ISO8859-1 as UTF8 will result in mapping errors. This is expected and can't be avoided if the wrong encoding has been specified.\n\t\tvalidateEncodingHandling(\"ISO8859-1.json\", Charsets.UTF_8, \"� for ?, � for ?\");\n\t}", "public static BufferedReader Reader(String path) throws IOException\n\t{\n\t\treturn new BufferedReader(new InputStreamReader(new FileInputStream(path),\"UTF-8\"));\n\t}", "public abstract void load() throws IOException;", "public static void main(String[] args) throws IOException {\n\n Charset windows1251 = Charset.forName(\"Windows-1251\");\n Charset utf8 = Charset.forName(\"UTF-8\");\n// byte[] buffer = new byte[1000];\n\n //Создаем поток-чтения-байт-из-файла\n FileInputStream fileInputStream = new FileInputStream(args[0]);\n // Создаем поток-записи-байт-в-файл\n FileOutputStream fileOutputStream = new FileOutputStream(args[1]);\n\n byte[] bytesInp = new byte[fileInputStream.available()]; //метод available возвращает количество непрочитанных (доступных) байт\n fileInputStream.read(bytesInp);\n String s = new String(bytesInp, windows1251);\n byte[] bytesOut = s.getBytes(\"UTF-8\");\n fileOutputStream.write(bytesOut); // и записать его во второй поток\n\n //закрываем оба потока. Они больше не нужны.\n fileInputStream.close();\n fileOutputStream.close();\n }", "public static PropertiesConfiguration loadConfigurationInUtf8(String fileOrUrlOrClasspathUrl) {\n\n PropertiesConfiguration propertiesConfiguration = new PropertiesConfiguration();\n propertiesConfiguration.setEncoding(NinjaConstant.UTF_8);\n propertiesConfiguration.setDelimiterParsingDisabled(true);\n propertiesConfiguration.setFileName(fileOrUrlOrClasspathUrl);\n propertiesConfiguration.getLayout().setSingleLine(NinjaConstant.applicationSecret, true);\n\n try {\n\n propertiesConfiguration.load(fileOrUrlOrClasspathUrl);\n\n } catch (ConfigurationException e) {\n\n logger.info(\"Could not load file \" + fileOrUrlOrClasspathUrl\n + \" (not a bad thing necessarily, but I am returing null)\");\n\n return null;\n }\n\n return propertiesConfiguration;\n }", "public String getCharSet() throws VlException\n {\n return ResourceLoader.CHARSET_UTF8;\n }", "@Override\n\tpublic Object load(String file) {\n\t\treturn null;\n\t}", "public static String read(File file) throws Exception {\r\n\t\treader.setFile(file);\r\n\t\treader.setCharset(\"UTF-8\");\r\n\t\treturn reader.read();\r\n\t}", "private static String arquivoParaString(String caminhoArquivo){\n\t\ttry {\t\n\t\t\tbyte[] encoded = Files.readAllBytes(Paths.get(caminhoArquivo));\n\t\t\treturn new String(encoded, StandardCharsets.UTF_8);\n\t\t}catch (Exception e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t}", "protected String readUnicodeInputStream(InputStream in) throws IOException {\n\t\tUnicodeReader reader = new UnicodeReader(in, null);\n\t\tString data = FileCopyUtils.copyToString(reader);\n\t\treader.close();\n\t\treturn data;\n\t}", "public void testBom() throws Exception {\n \tBundle bundle = new Bundle(new ClasspathResourceLocation(\"theweb/i18n/bom_uk.properties\"));\n \t\n \tassertEquals(\"значення\", bundle.getProperty(\"ключ\"));\n\t}", "@Override\n\tpublic String getCharacterEncoding() {\n\t\treturn null;\n\t}", "String readText(FsPath path);", "public static void load(FileIO fileIO) \r\n\t{\n\t\t\r\n\t}", "@Override\n void load(String data) {\n }", "private void loadData(){\n try (BufferedReader br = new BufferedReader(new FileReader(this.fileName))) {\n String line;\n while((line=br.readLine())!=null){\n E e = createEntity(line);\n super.save(e);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public static String readFile(String path, Charset encoding) throws IOException {\r\n\t\tbyte[] encoded = Files.readAllBytes(Paths.get(path));\r\n\t\treturn new String(encoded, encoding);\r\n\t}", "private static List<String> loadGenericDfFile(String file) throws IOException{\n\t\tList<String> lines = new ArrayList<String>();\n\t\t\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(\n\t\t\t\tnew FileInputStream(file), \"UTF-8\"));\n\t\ttry {\n\t\t\tString str;\n\t\t\twhile ((str = in.readLine()) != null) {\n\t\t\t\tlines.add(str);\n\t\t\t}\n\t\t} finally {\n\t\t\tin.close();\n\t\t}\n\n\t\treturn lines;\n\t}", "private void loadSystemFont(String font){\n mFont = new Font(font, mFontStyle, (int)mFontSize);\n }", "public static String readFile(File fileName, String charset) throws IOException {\n if (fileName == null || !fileName.isFile()) {\n return null;\n }\n StringBuilder sb = new StringBuilder(\"\");\n BufferedReader reader = null;\n try {\n InputStreamReader is = new InputStreamReader(new FileInputStream(fileName), charset);\n reader = new BufferedReader(is);\n String line = null;\n while ((line = reader.readLine()) != null) {\n if (!sb.toString().equals(\"\")) {\n sb.append(\"\\r\\n\");\n }\n sb.append(line);\n }\n reader.close();\n return sb.toString();\n } catch (IOException e) {\n e.printStackTrace();\n throw e;\n } finally {\n if (reader != null) {\n try {\n reader.close();\n } catch (IOException e) {\n e.printStackTrace();\n throw e;\n }\n }\n }\n }", "private String readFile(String source) throws IOException {\n StringBuilder contentBuilder = new StringBuilder();\n try (Stream<String> stream = Files.lines(Paths.get(source), StandardCharsets.UTF_8)) {\n stream.forEach(s -> contentBuilder.append(s));\n }\n return contentBuilder.toString();\n }", "@Override\n\tpublic void ReadTextFile() {\n\t\t// Using a programmer-managed byte-array\n\t\ttry (FileInputStream in = new FileInputStream(inFileStr)) {\n\t\t\tstartTime = System.nanoTime();\n\t\t\tbyte[] byteArray = new byte[bufferSize];\n\t\t\tint bytesCount;\n\t\t\twhile ((bytesCount = in.read(byteArray)) != -1) {\n\t\t\t\tsnippets.add(new String(byteArray));\n\t\t\t}\n\t\t\tin.close();\n\t\t} catch (IOException ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t}", "public BitmapFont loadBitmapFont(String fileFont, String fileImage);", "private Encoding retrieveEncoding(Path file) {\n if (this.fileEncodings != null) {\n Encoding encoding = this.fileEncodings.get(file.toString());\n if (encoding != null) {\n return encoding;\n }\n }\n return this.encoding == null ? Encoding.DEFAULT_ENCODING : this.encoding;\n }", "private String readFile(String source) throws IOException {\n StringBuilder contentBuilder = new StringBuilder();\n try (Stream<String> stream = Files.lines(Paths.get(source), StandardCharsets.UTF_8)) {\n stream.forEach(s -> contentBuilder.append(s));\n }\n\n return contentBuilder.toString();\n }", "public String getDeclaredEncoding();", "private void Load( String szFileName )\n throws FileNotFoundException, NullPointerException, AppException\n {\n FileInputStream fs = null;\n File f = null;\n long nFileSize;\n \n f = new File( szFileName );\n if( !f.exists() || !f.canRead() )\n throw new FileNotFoundException( \"File \" + f.getPath() );\n\n try\n {\n nFileSize = f.length();\n fs = new FileInputStream( f );\n\n CharsetDecoder utf8Decoder = Charset.forName( \"UTF-8\" ).newDecoder();\n byte[] Data = null;\n\n // Read user name length and user name in UTF8\n if( nFileSize < 2 )\n throw new AppException( \"Bad file \" + f.getPath() );\n int nLength = (fs.read() << 8) | fs.read();\n nFileSize -= 2;\n if( nFileSize < nLength )\n throw new AppException( \"Bad file \" + f.getPath() );\n nFileSize -= nLength;\n Data = new byte[nLength];\n fs.read( Data );\n m_UserName = utf8Decoder.decode( ByteBuffer.wrap( Data ) ).toString();\n\n // Read user unique ID\n if( nFileSize < 16 )\n throw new AppException( \"Bad file \" + f.getPath() );\n nFileSize -= 16;\n m_Key = new byte[16];\n fs.read( m_Key );\n\n // Read template length and template data\n if( nFileSize < 2 )\n throw new AppException( \"Bad file \" + f.getPath() );\n nLength = (fs.read() << 8) | fs.read();\n nFileSize -= 2;\n if( nFileSize != nLength )\n throw new AppException( \"Bad file \" + f.getPath() );\n m_Template = new byte[nLength];\n fs.read( m_Template );\n fs.close();\n }\n catch( SecurityException e )\n {\n if( f == null )\n throw new AppException( \"Denies read access to the file \" + f.getPath() );\n else {\n throw new AppException( \"Denies read access to the file \" + szFileName );\n }\n }\n catch( IOException e)\n {\n if( f == null )\n throw new AppException( \"Bad file \" + f.getPath() );\n else\n throw new AppException( \"Bad file \" + szFileName );\n }\n }", "public static void load() {\n\t\t// manager.load(camp_fire);\r\n\t\t// manager.load(camp_fire_burntout);\r\n\t\t//\r\n\t\t// manager.load(fire_stick);\r\n\t\t// manager.load(fire_stick_burntout);\r\n\t\t//\r\n\t\t// manager.load(stockpile);\r\n\t\t// manager.load(worker);\r\n\t\t//\r\n\t\t// manager.load(icon_wood);\r\n\t\t//\r\n\t\tmanager.load(worker_ant);\r\n\t\tmanager.setLoader(FreeTypeFontGenerator.class,\r\n\t\t\t\tnew FreeTypeFontGeneratorLoader(new InternalFileHandleResolver()));\r\n\t\tmanager.load(dialog);\r\n\t}", "private String getStringFromFile() throws FileNotFoundException {\n String contents;\n FileInputStream fis = new FileInputStream(f);\n StringBuilder stringBuilder = new StringBuilder();\n try {\n InputStreamReader inputStreamReader = new InputStreamReader(fis, \"UTF-8\");\n BufferedReader reader = new BufferedReader(inputStreamReader);\n String line = reader.readLine();\n while (line != null) {\n stringBuilder.append(line).append('\\n');\n line = reader.readLine();\n }\n } catch (IOException e) {\n // Error occurred when opening raw file for reading.\n } finally {\n contents = stringBuilder.toString();\n }\n return contents;\n }", "private void ReadTextFile(String FilePath) {\n\t\t\n\t\t\n\t}", "public static String readFileAsString(String path, String charsetName) throws IOException {\n ByteBuffer content = internalReadFileAsByteArray(path);\n CharBuffer result = Charset.forName(charsetName).decode(content);\n char[] charContent = null;\n if (result.hasArray()) {\n charContent = result.array();\n } else {\n charContent = new char[result.limit()];\n result.get(charContent);\n }\n return new String(charContent);\n\n }", "public static String guessAppropriateEncoding(CharSequence contents) {\n for (int i = 0; i < contents.length(); i++) {\n if (contents.charAt(i) > 0xFF) {\n return \"UTF-8\";\n }\n }\n return null;\n }", "public void loadFromFile(final Context ctx) {\n\t\tString line, code, desc;\n\t\tDTC dtc;\n\t\ttry {\n\t\t\t// final FileInputStream fstream = new FileInputStream(pathname);\n\t\t\tfinal InputStream fstream = ctx.getResources().openRawResource(\n\t\t\t\t\tR.raw.dtc);\n\t\t\tfinal BufferedReader in = new BufferedReader(new InputStreamReader(\n\t\t\t\t\tfstream));\n\t\t\twhile (in.ready()) {\n\t\t\t\tline = in.readLine();\n\t\t\t\tcode = line.substring(0, line.indexOf(','));\n\t\t\t\tdesc = line.substring(line.indexOf(',') + 1);\n\t\t\t\tdtc = new DTC(code, desc);\n\t\t\t\tput(dtc.codeAsInt(), dtc);\n\t\t\t}\n\t\t\tin.close();\n\t\t} catch (final Exception e) {\n\t\t\tLog.e(TAG, \"Error reading the DTC codes from the CSV file\", e);\n\t\t}\n\t}", "private String readFile(String source) throws IOException {\n StringBuilder contentBuilder = new StringBuilder();\n\n try (Stream<String> stream = Files.lines(Paths.get(source), StandardCharsets.UTF_8)) {\n stream.forEach(s -> contentBuilder.append(s));\n }\n\n return contentBuilder.toString();\n }", "private String readFile(String source) throws IOException {\n StringBuilder contentBuilder = new StringBuilder();\n\n try (Stream<String> stream = Files.lines(Paths.get(source), StandardCharsets.UTF_8)) {\n stream.forEach(contentBuilder::append);\n }\n return contentBuilder.toString();\n }", "@Override\n\t\tpublic String getCharacterEncoding() {\n\t\t\treturn null;\n\t\t}", "public void leseTextEin()\r\n\t{\n\t\tif( this.text != \"\" )\r\n\t\t\treturn;\r\n\t\t\r\n\t StringBuffer buffer = new StringBuffer();\r\n\t BufferedReader input = null;\r\n\t \r\n\t try \r\n\t {\r\n\t \tinput = new BufferedReader( new FileReader(this.dateipfad) );\r\n\t \tString line = null; \r\n\t \twhile ((line=input.readLine()) != null)\r\n\t \t{\r\n\t \t\tbuffer.append(line); \r\n\t \t\tbuffer.append(System.getProperty(\"line.separator\"));\r\n\t \t}\r\n\t }\r\n\t catch (IOException ex)\r\n\t { ex.printStackTrace(); }\r\n\t finally \r\n\t {\r\n\t \ttry\r\n\t \t{\r\n\t \t\tif (input!= null) \r\n\t \t\t\tinput.close();\r\n\t \t}\r\n\t \tcatch (IOException ex)\r\n\t \t{ ex.printStackTrace(); }\r\n\t }\r\n\t this.text = buffer.toString();\r\n\t}", "public static String readAll(String filename) throws FileNotFoundException, IOException {\n String JAR = jarPrefix();\n boolean fromJar = false;\n if (filename.startsWith(JAR)) {\n fromJar = true;\n filename = filename.substring(JAR.length()).replace('\\\\', '/');\n }\n InputStream fis = null;\n int now = 0, max = 4096;\n if (!fromJar) {\n long maxL = new File(filename).length();\n max = (int) maxL;\n if (max != maxL)\n throw new IOException(\"File too big to fit in memory\");\n }\n byte[] buf;\n try {\n buf = new byte[max];\n fis = fromJar ? Util.class.getClassLoader().getResourceAsStream(filename) : new FileInputStream(filename);\n if (fis == null)\n throw new FileNotFoundException(\"File \\\"\" + filename + \"\\\" cannot be found\");\n while (true) {\n if (now >= max) {\n max = now + 4096;\n if (max < now)\n throw new IOException(\"File too big to fit in memory\");\n byte[] buf2 = new byte[max];\n if (now > 0)\n System.arraycopy(buf, 0, buf2, 0, now);\n buf = buf2;\n }\n int r = fis.read(buf, now, max - now);\n if (r < 0)\n break;\n now = now + r;\n }\n } catch (OutOfMemoryError ex) {\n System.gc();\n throw new IOException(\"There is insufficient memory.\");\n } finally {\n close(fis);\n }\n CodingErrorAction r = CodingErrorAction.REPORT;\n CodingErrorAction i = CodingErrorAction.IGNORE;\n ByteBuffer bbuf;\n String ans = \"\";\n try {\n // We first try UTF-8;\n bbuf = ByteBuffer.wrap(buf, 0, now);\n ans = Charset.forName(\"UTF-8\").newDecoder().onMalformedInput(r).onUnmappableCharacter(r).decode(bbuf).toString();\n } catch (CharacterCodingException ex) {\n try {\n // if that fails, we try using the platform's default charset\n bbuf = ByteBuffer.wrap(buf, 0, now);\n ans = Charset.defaultCharset().newDecoder().onMalformedInput(r).onUnmappableCharacter(r).decode(bbuf).toString();\n } catch (CharacterCodingException ex2) {\n // if that also fails, we try using \"ISO-8859-1\" which should\n // always succeed but may map some characters wrong\n bbuf = ByteBuffer.wrap(buf, 0, now);\n ans = Charset.forName(\"ISO-8859-1\").newDecoder().onMalformedInput(i).onUnmappableCharacter(i).decode(bbuf).toString();\n }\n }\n return convertLineBreak(ans);\n }", "private String readFile(File file){\n StringBuilder stringBuffer = new StringBuilder();\n BufferedReader bufferedReader = null;\n\n try {\n\n bufferedReader = new BufferedReader(new FileReader(file));\n\n String text;\n while ((text = bufferedReader.readLine()) != null) {\n stringBuffer.append(text.replaceAll(\"\\t\", miTab) + \"\\n\");\n }\n\n } catch (FileNotFoundException ex) {\n Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);\n } catch (IOException ex) {\n Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);\n } finally {\n try {\n bufferedReader.close();\n } catch (IOException ex) {\n Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n\n return stringBuffer.toString();\n }" ]
[ "0.6939319", "0.6531269", "0.6507646", "0.62049514", "0.5794849", "0.5764641", "0.55904096", "0.55352336", "0.5502433", "0.5481829", "0.53869325", "0.5277781", "0.52689093", "0.52627414", "0.5197184", "0.5180055", "0.512957", "0.5122273", "0.51119864", "0.508919", "0.5059111", "0.50525296", "0.50398004", "0.5039052", "0.500981", "0.4995237", "0.4992097", "0.49864262", "0.49840274", "0.49493188", "0.49396852", "0.49285626", "0.49239486", "0.48896816", "0.48846185", "0.4853608", "0.48528403", "0.4850684", "0.48480216", "0.48361042", "0.48287803", "0.48125428", "0.4800791", "0.47947225", "0.47933432", "0.47787216", "0.4776244", "0.474901", "0.4745409", "0.4734777", "0.47302473", "0.47258684", "0.47143868", "0.46969268", "0.4688711", "0.4688711", "0.46813473", "0.4664465", "0.4643016", "0.46272615", "0.4613461", "0.46125704", "0.45955414", "0.45945942", "0.45869637", "0.45824304", "0.45795357", "0.45689717", "0.45600972", "0.45562017", "0.45534325", "0.45491615", "0.4532553", "0.45196497", "0.45179686", "0.45028174", "0.44909805", "0.4489089", "0.4487437", "0.448569", "0.4485456", "0.44804648", "0.44688603", "0.446661", "0.44657272", "0.44643393", "0.4463476", "0.44595608", "0.44595096", "0.44574612", "0.4457336", "0.4456716", "0.44512737", "0.44503105", "0.44453347", "0.44161394", "0.4413738", "0.44098204", "0.4408405", "0.43910155" ]
0.58081204
4
Returns MAC address of the given interface name.
public static String macAddress(String interfaceName) { try { List<NetworkInterface> interfaces = Collections.list(NetworkInterface.getNetworkInterfaces()); for (NetworkInterface intf : interfaces) { if (interfaceName != null) { if (!intf.getName().equalsIgnoreCase(interfaceName)) continue; } byte[] mac = intf.getHardwareAddress(); if (mac==null) return ""; StringBuilder buf = new StringBuilder(); for (int idx=0; idx<mac.length; idx++) buf.append(String.format("%02X:", mac[idx])); if (buf.length()>0) buf.deleteCharAt(buf.length()-1); return buf.toString(); } } catch (Exception ex) { } // for now eat exceptions return ""; /*try { // this is so Linux hack return loadFileAsString("/sys/class/net/" +interfaceName + "/address").toUpperCase().trim(); } catch (IOException ex) { return null; }*/ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String getMACAddress(String interfaceName) {\n try {\n List<NetworkInterface> interfaces = Collections\n .list(NetworkInterface.getNetworkInterfaces());\n for (NetworkInterface intf : interfaces) {\n if (interfaceName != null) {\n if (!intf.getName().equalsIgnoreCase(interfaceName))\n continue;\n }\n byte[] mac = intf.getHardwareAddress();\n if (mac == null)\n return \"\";\n StringBuilder buf = new StringBuilder();\n for (int idx = 0; idx < mac.length; idx++)\n buf.append(String.format(\"%02X:\", mac[idx]));\n if (buf.length() > 0)\n buf.deleteCharAt(buf.length() - 1);\n return buf.toString();\n }\n } catch (Exception ex) {\n } // for now eat exceptions\n return \"\";\n\n }", "@NonNull\n public static String getMACAddress(String interfaceName) throws SocketException {\n List<NetworkInterface> interfaces = Collections.list(NetworkInterface.getNetworkInterfaces());\n for (NetworkInterface netInterface : interfaces) {\n if (interfaceName != null) {\n if (!netInterface.getName().equalsIgnoreCase(interfaceName)) continue;\n }\n byte[] mac = netInterface.getHardwareAddress();\n if (mac == null) return \"\";\n StringBuilder buf = new StringBuilder();\n for (byte aMac : mac) buf.append(String.format(\"%02X:\", aMac));\n if (buf.length() > 0) buf.deleteCharAt(buf.length() - 1);\n return buf.toString();\n }\n\n return \"\";\n }", "public static String getMacAddress() {\n try {\n List<NetworkInterface> all = Collections.list(NetworkInterface.getNetworkInterfaces());\n for (NetworkInterface nif : all) {\n if (!nif.getName().equalsIgnoreCase(\"wlan0\")) continue;\n\n byte[] macBytes = nif.getHardwareAddress();\n if (macBytes == null) {\n return \"\";\n }\n\n StringBuilder res1 = new StringBuilder();\n for (byte b : macBytes) {\n res1.append(String.format(\"%02X:\",b));\n }\n\n if (res1.length() > 0) {\n res1.deleteCharAt(res1.length() - 1);\n }\n return res1.toString();\n }\n } catch (Exception ex) {\n }\n return \"02:00:00:00:00:00\";\n }", "public String getEthernetMacAddress(){\n\t try {\n\t return loadFileAsString(\"/sys/class/net/eth0/address\")\n\t .toUpperCase().substring(0, 17);\n\t } catch (IOException e) {\n\t e.printStackTrace();\n\t return null;\n\t }\n\t}", "public static\n String getMACAddress()\n {\n String sResult = null;\n try {\n Process pid = Runtime.getRuntime().exec(\"ipconfig /all\");\n BufferedReader in = new BufferedReader(new InputStreamReader(pid.getInputStream()));\n String sLine = null;\n while((sLine = in.readLine()) != null) {\n if(getOccurrences(sLine, '-') == 5) {\n int i = sLine.lastIndexOf('-');\n sResult = sLine.substring(i - 14, i + 3);\n break;\n }\n }\n in.close();\n }\n catch(Exception ex) {\n ex.printStackTrace();\n }\n System.out.println(ResourcesMgr.sLOG_PREFIX + \" MAC Address = \" + sResult);\n return sResult;\n }", "private static String getMacAddress(){\n\t\ttry {\n\t\t\t//getting hardware address from inside a virtual machine from NetworkInterface object returns null, so need a gambiarra.\n\t\t\t//if this issue is ever solved please replace for the appropriate code\n\t\t\tString command = \"ifconfig\";\n\t\t\tProcess p = Runtime.getRuntime().exec(command);\n\t\t\tBufferedReader inn = new BufferedReader(new InputStreamReader(p.getInputStream()));\n\n\t\t\tString line = inn.readLine();\n\n\t\t\twhile( line != null ){\n\t\t\t\t\n\t\t\t\tif(line.indexOf(\"eth0\") >= 0){\n\t\t\t\t\tString[] split = line.split(\" \");\n\t\t\t\t\treturn split[split.length-1];\n\t\t\t\t}\n\n\t\t\t\tline = inn.readLine();\n\t\t\t}\n\n\t\t\tinn.close();\n\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t\t\n\t\treturn \"error\";\n\t}", "public String getMac(){\n WifiManager manager = (WifiManager) context.getApplicationContext().getSystemService(Context.WIFI_SERVICE);\n WifiInfo info = manager.getConnectionInfo();\n return info.getMacAddress();\n }", "public static String getMac(InetAddress add) throws SocketException,NullPointerException{\n\t\t\n\t\tNetworkInterface network = NetworkInterface.getByInetAddress(add);\n\t\tbyte[] mac = network.getHardwareAddress();\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor (int i = 0; i < mac.length; i++) {\n\t\t\tsb.append(String.format(\"%02X%s\", mac[i], (i < mac.length - 1) ? \"-\" : \"\"));\t\t\n\t\t}\n\t\tData.MAC_ADDRESS=sb.toString();\n\t\treturn sb.toString();\n\t\t\n\t}", "public String getFormattedMACAddress() {\n String defaultReturn = \"00:00:00:00:00:00\";\n\n // Validate the data\n if (macAddress == null) {\n return defaultReturn;\n }\n String mac = macAddress.replace(\"-\", \"\");\n if (mac.length() != 12) {\n return defaultReturn;\n }\n\n List<String> parts = new ArrayList<>();\n for (int i = 0; i < 6; i++) {\n int offset = 2 * i;\n parts.add(mac.substring(offset, offset + 2));\n }\n\n return String.join(\":\", parts);\n }", "private static String getMacAddress(Context context) {\n // android devices should have a wifi address\n final String wlanAddress = readAddressFromInterface(\"wlan0\");\n\n if (wlanAddress != null) {\n return wlanAddress.replace(\"\\n\", \"\").toUpperCase();\n }\n\n final String ethAddress = readAddressFromInterface(\"eth0\");\n if (ethAddress != null) {\n return ethAddress.replace(\"\\n\", \"\").toUpperCase();\n }\n\n // backup -> read from Wifi!\n if (!Utils.checkPermission(context, android.Manifest.permission.ACCESS_WIFI_STATE)) {\n return \"\";\n } else {\n try {\n final WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);\n @SuppressWarnings(\"MissingPermission\") final String wifiAddress = wifiManager.getConnectionInfo().getMacAddress();\n\n if (wifiAddress != null) {\n return wifiAddress;\n }\n } catch (Exception e) {\n log.debug(e.getMessage(), e);\n }\n }\n\n return null;\n }", "public MACAddress getMacAddress() \n\t{\n\t\treturn this.hwAddress;\n\t}", "String getMacAddress() {\n return String.format(\"%s:%s:%s:%s:%s:%s\", macAddress.substring(0, 2), macAddress.substring(2, 4),\n macAddress.substring(4, 6), macAddress.substring(6, 8), macAddress.substring(8, 10), macAddress.substring(10, 12));\n }", "public String getWlanMacAddress() {\n WifiManager wifiManager = (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE);\n WifiInfo wifiInfo = wifiManager.getConnectionInfo();\n\n String macAddress = wifiInfo == null ? null : wifiInfo.getMacAddress();\n return !TextUtils.isEmpty(macAddress) ? macAddress : \"Unavailable\";\n }", "public String getMacAddress()\r\n\t{\r\n\t\treturn macAddress;\r\n\t}", "public static String wlanMacAddress() {\n\t\tString _ret = null;\n\n\t\t// get wifi manager\n\t\tWifiManager _wifiManager = (WifiManager) CTApplication.getContext()\n\t\t\t\t.getSystemService(Context.WIFI_SERVICE);\n\n\t\t// check wifi manager and return waln mac address\n\t\tif (null != _wifiManager) {\n\t\t\t// check the wifi state\n\t\t\tif (!_wifiManager.isWifiEnabled()) {\n\t\t\t\t// open the wlan\n\t\t\t\t_wifiManager.setWifiEnabled(true);\n\n\t\t\t\t// get wlan mac address(has 3-5 seconds delay)\n\t\t\t\t_ret = _wifiManager.getConnectionInfo().getMacAddress();\n\n\t\t\t\t// close the wlan\n\t\t\t\t_wifiManager.setWifiEnabled(false);\n\t\t\t} else {\n\t\t\t\t// get wlan mac address\n\t\t\t\t_ret = _wifiManager.getConnectionInfo().getMacAddress();\n\t\t\t}\n\t\t}\n\n\t\treturn _ret;\n\t}", "@Option MacAddress getMacAddress();", "NetworkInterface getNetworkInterfaceByAddress(InterfaceAddress interfaceAddress);", "public String getMacAddress()\n\t{\n\t\treturn macAddress;\n\t}", "public String getMacAddress() {\n return macAddress;\n }", "public String getMacAddress() {\n return macAddress;\n }", "public static String getDeviceMacAddress(Context context) {\n final String macAddress = getMacAddress(context);\n\n if (macAddress == null) {\n return \"\";\n }\n\n log.debug(\"macAddress: \" + macAddress);\n\n return StringUtils.cleanSpaceCharacterFromString(macAddress.toUpperCase(Locale.UK));\n }", "public String readEthMAC() {\r\n\t\treturn mFactoryBurnUtil.readEthMAC();\r\n\t}", "public String getMac() {\n\t\treturn InfraUtil.getMacAddress();\n\t}", "public String getMacAddress()\n {\n return macAddress;\n }", "public String macAddress() {\n return this.macAddress;\n }", "void setInterfaceMacAddress(MacAddress interfaceMacAddress);", "private static String readAddressFromInterface(final String interfaceName) {\n try {\n final String filePath = \"/sys/class/net/\" + interfaceName + \"/address\";\n final StringBuilder fileData = new StringBuilder(1000);\n final BufferedReader reader = new BufferedReader(new FileReader(filePath), 1024);\n final char[] buf = new char[1024];\n int numRead;\n\n String readData;\n while ((numRead = reader.read(buf)) != -1) {\n readData = String.valueOf(buf, 0, numRead);\n fileData.append(readData);\n }\n\n reader.close();\n return fileData.toString();\n } catch (IOException e) {\n return null;\n }\n }", "public java.lang.String getUser_mac();", "public String getArpTable(String ipAddr) throws IOException {\n Scanner s = new Scanner(Runtime.getRuntime().exec(ARP_CMD +\" \"+ ipAddr).getInputStream()).useDelimiter(\"\\\\A\");\n String sysInput = s.next();\n String mac = \"\";\n Pattern pattern = Pattern.compile(mac_regex);\n Matcher matcher = pattern.matcher(sysInput);\n if (matcher.find()) {\n mac = mac + matcher.group().replaceAll(\"\\\\-\", \":\");\n } \n return mac.strip();\n\t}", "public static String m581h(Context context) {\r\n try {\r\n return ((WifiManager) context.getSystemService(\"wifi\")).getConnectionInfo().getMacAddress();\r\n } catch (Exception e) {\r\n return null;\r\n }\r\n }", "public static String bluetoothMacAddress() {\n\t\tString _ret = null;\n\n\t\t// get a handle to the default local Bluetooth adapter\n\t\tBluetoothAdapter _localBluetoothAdapter = BluetoothAdapter\n\t\t\t\t.getDefaultAdapter();\n\n\t\t// check default local bluetooth adapter and return bluetooth mac\n\t\t// address\n\t\tif (null != _localBluetoothAdapter) {\n\t\t\t// check the bluetooth state\n\t\t\tif (!_localBluetoothAdapter.isEnabled()) {\n\t\t\t\t// open the bluetooth\n\t\t\t\t_localBluetoothAdapter.enable();\n\n\t\t\t\t// get default local bluetooth mac address(has 1-2 seconds\n\t\t\t\t// delay)\n\t\t\t\t_ret = _localBluetoothAdapter.getAddress();\n\n\t\t\t\t// close the bluetooth\n\t\t\t\t_localBluetoothAdapter.disable();\n\t\t\t} else {\n\t\t\t\t// get default local bluetooth mac address\n\t\t\t\t_ret = _localBluetoothAdapter.getAddress();\n\t\t\t}\n\t\t}\n\n\t\treturn _ret;\n\t}", "public String format(MacAddress mac) {\n byte[] b = mac.getInternalBytes();\n Oui oui = _byHashCode.get(Oui.hashCode(mac.getInternalBytes()));\n StringBuilder buf = new StringBuilder();\n\n if (oui == null) {\n buf.append(String.format(\"Unknown-%02x-%02x-%02x\", b[0], b[1], b[2]));\n } else {\n buf.append(oui.getShortName());\n }\n buf.append('-');\n\n for (int i = 3; i < MacAddress.ETH_ALEN; ++i) {\n if (i > 3) buf.append(':');\n buf.append(String.format(\"%02x\", b[i]));\n }\n\n return buf.toString();\n }", "public java.lang.String getMac() {\n return mac;\n }", "private static String getInterfaceMask(int interfaceIndex) {\n String subnetMask = null;\n try {\n Ip4Address ipAddress = getInterfaceIp(interfaceIndex);\n NetworkInterface networkInterface = NetworkInterface.getByInetAddress(\n InetAddress.getByName(ipAddress.toString()));\n Enumeration ipAddresses = networkInterface.getInetAddresses();\n int index = 0;\n while (ipAddresses.hasMoreElements()) {\n InetAddress address = (InetAddress) ipAddresses.nextElement();\n if (!address.isLinkLocalAddress()) {\n break;\n }\n index++;\n }\n int prfLen = networkInterface.getInterfaceAddresses().get(index).getNetworkPrefixLength();\n int shft = 0xffffffff << (32 - prfLen);\n int oct1 = ((byte) ((shft & 0xff000000) >> 24)) & 0xff;\n int oct2 = ((byte) ((shft & 0x00ff0000) >> 16)) & 0xff;\n int oct3 = ((byte) ((shft & 0x0000ff00) >> 8)) & 0xff;\n int oct4 = ((byte) (shft & 0x000000ff)) & 0xff;\n subnetMask = oct1 + \".\" + oct2 + \".\" + oct3 + \".\" + oct4;\n } catch (Exception e) {\n log.debug(\"Error while getting Interface network mask by index\");\n return subnetMask;\n }\n return subnetMask;\n }", "@Deprecated\r\n public String readWiFiMAC(String wifiModelType) {\r\n return mFactoryBurnUtil.readWiFiMAC(wifiModelType);\r\n }", "public MAC getMacDest() {\n\t\treturn macDest;\n\t}", "public String getMacNo() {\r\n return macNo;\r\n }", "@Override\n public String getMACAddress()\n {\n String id = client.properties().getString(Keys.client_id);\n if (id == null)\n {\n ClientIDGenerator gen = new ClientIDGenerator();\n id = gen.generateId();\n client.properties().setString(Keys.client_id, id);\n }\n return id;\n //return AppUtil.getMACAddress(this);\n }", "public static String getNetMac() {\n\t\tif (!mInitialized) Log.v(\"OpenIp\", \"Initialisation isn't done\");\n\t\treturn netMac;\n\t}", "public void testGetMacAddress_stubDevice() throws Exception {\n String address = \"58:a2:b5:7d:49:24\";\n IDevice device = new StubDevice(MOCK_DEVICE_SERIAL) {\n @Override\n public void executeShellCommand(String command, IShellOutputReceiver receiver)\n throws TimeoutException, AdbCommandRejectedException,\n ShellCommandUnresponsiveException, IOException {\n receiver.addOutput(address.getBytes(), 0, address.length());\n }\n };\n mTestDevice.setIDevice(device);\n assertNull(mTestDevice.getMacAddress());\n }", "public void testGetMacAddress() throws Exception {\n String address = \"58:a2:b5:7d:49:24\";\n IDevice device = new StubDevice(MOCK_DEVICE_SERIAL) {\n @Override\n public void executeShellCommand(String command, IShellOutputReceiver receiver)\n throws TimeoutException, AdbCommandRejectedException,\n ShellCommandUnresponsiveException, IOException {\n receiver.addOutput(address.getBytes(), 0, address.length());\n }\n };\n mMockIDevice.executeShellCommand(EasyMock.anyObject(), EasyMock.anyObject());\n EasyMock.expectLastCall().andDelegateTo(device).anyTimes();\n EasyMock.replay(mMockIDevice);\n assertEquals(address, mTestDevice.getMacAddress());\n EasyMock.verify(mMockIDevice);\n }", "public static String getMacCliente(){\n\t\tInetAddress ip;\n\t\tbyte[] mac = null;\n\t\tStringBuilder sb = new StringBuilder();\n\t\ttry {\n\t\t\tip = InetAddress.getLocalHost();\n\t\t\tNetworkInterface network = NetworkInterface.getByInetAddress(ip);\n\n\t\t\tmac = network.getHardwareAddress();\n\t\t\tfor (int i = 0; i < mac.length; i++) {\n\t\t\t\tsb.append(String.format(\"%02X%s\", mac[i],(i < mac.length - 1) ? \"-\" : \"\"));\n\t\t\t}\n\t\t} catch (UnknownHostException e) {\n\t\t\t//Log.error(e, \"Utiles :: getMacCliente :: controlado\");\n\t\t} catch (SocketException e) {\n\t\t\t//Log.error(e, \"Utiles :: getMacCliente :: controlado\");\n\t\t} catch (NullPointerException e){\n\t\t\t//Log.error(e, \"Utiles :: getMacCliente :: controlado\");\n\t\t}\n\t\treturn sb.toString();\n\t}", "public static byte[] toMACAddress(String macAddress) {\n return MACAddress.valueOf(macAddress).toBytes();\n }", "public static MacAddress getRouterMacAddress(KubevirtRouter router) {\n if (router.mac() == null) {\n log.warn(\"Failed to get mac address of router {}\", router.name());\n }\n\n return router.mac();\n }", "private static String m21383C(Context context) {\n WifiInfo wifiInfo;\n String str = \"02:00:00:00:00:00\";\n if (context == null) {\n return str;\n }\n WifiManager wifiManager = (WifiManager) context.getApplicationContext().getSystemService(\"wifi\");\n if (wifiManager == null) {\n return str;\n }\n try {\n wifiInfo = wifiManager.getConnectionInfo();\n } catch (Exception e) {\n C5205o.m21464a((Throwable) e);\n wifiInfo = null;\n }\n if (wifiInfo == null) {\n return null;\n }\n String macAddress = wifiInfo.getMacAddress();\n if (!TextUtils.isEmpty(macAddress)) {\n macAddress = macAddress.toUpperCase(Locale.ENGLISH);\n }\n return macAddress;\n }", "public String getMACCHN()\n {\n return this.MACCHN;\n }", "private byte[] generateMAC(String filename)\n\t{\n\t\tif (this.flag == 1)\t\t\n\t\t\treturn this.mac.doFinal(filename.getBytes());\n\t\telse\n\t\t\treturn null;\n\t}", "public static String getLocalMac() {\n\t\tif (!mInitialized) Log.v(\"OpenIp\", \"Initialisation isn't done\");\n\t\treturn localMac;\n\t}", "protected byte[] createMacBytes(String macStr) throws NumberFormatException {\n byte[] bytes = new byte[6];\n \n String[] hex = macStr.split(\"(\\\\:|\\\\-)\");\n \n if (hex.length != 6) {\n throw new IllegalArgumentException(\"Invalid MAC address.\");\n }\n try {\n for (int i = 0; i < 6; i++) {\n bytes[i] = (byte) Integer.parseInt(hex[i], 16);\n }\n } catch (NumberFormatException e) {\n throw new IllegalArgumentException(\"Invalid hex digit in MAC address.\");\n }\n return bytes;\n }", "java.lang.String getAgentMac();", "@Deprecated\r\n\tpublic String readMACID(){\r\n\t\treturn \"\";\r\n\t}", "public Mac getMac() {\r\n return mac;\r\n }", "private static String m21398d() {\n try {\n for (NetworkInterface networkInterface : Collections.list(NetworkInterface.getNetworkInterfaces())) {\n if (networkInterface.getName().equalsIgnoreCase(\"wlan0\")) {\n byte[] hardwareAddress = networkInterface.getHardwareAddress();\n if (hardwareAddress == null) {\n return \"\";\n }\n StringBuilder sb = new StringBuilder();\n for (byte valueOf : hardwareAddress) {\n sb.append(String.format(\"%02X:\", new Object[]{Byte.valueOf(valueOf)}));\n }\n if (sb.length() > 0) {\n sb.deleteCharAt(sb.length() - 1);\n }\n return sb.toString();\n }\n }\n } catch (Throwable th) {\n C5205o.m21464a(th);\n }\n return \"02:00:00:00:00:00\";\n }", "public String getMac() {\n return this.Mac;\n }", "public void setMacAddress(String macAddress) {\n this.macAddress = macAddress;\n }", "public Oui getOui(MacAddress mac) {\n Oui result = _byHashCode.get(Oui.hashCode(mac.getInternalBytes()));\n if (result == null && (mac.isLocal() || mac.isMulticast())) {\n byte[] b = mac.getBytes();\n b[0] &= ~(MacAddress.FLAG_LOCAL | MacAddress.FLAG_MCAST);\n result = _byHashCode.get(Oui.hashCode(b));\n }\n return result;\n }", "private BandInfo infoFromMac(String mac) {\n BandInfo[] bands = pairedBands;//BandClientManager.getInstance().getPairedBands();\n for (BandInfo b :\n bands) {\n if (b.getMacAddress().equals(mac)) {\n return b;\n }\n }\n\n // Failed to find the bandInfo matching the MAC address, create one and store\n Log.e(TAG, \"Failed to find the MAC address \" + mac);\n return null;\n }", "public static native short getRemoteInterfaceAddress(Remote remoteObj, byte interfaceIndex);", "public String format(String macString) {\n try {\n return format(new MacAddress(macString));\n } catch (Exception e) {\n return macString;\n }\n }", "public void testIsMacAddress() {\n assertTrue(mTestDevice.isMacAddress(\"00:00:00:00:00:00\"));\n assertTrue(mTestDevice.isMacAddress(\"00:15:E9:2B:99:3C\"));\n assertTrue(mTestDevice.isMacAddress(\"FF:FF:FF:FF:FF:FF\"));\n assertTrue(mTestDevice.isMacAddress(\"58:a2:b5:7d:49:24\"));\n }", "Interface getMatchingInterface(IpAddress ip);", "com.google.protobuf.ByteString\n getAgentMacBytes();", "public String getMacKey() {\r\n return macKey;\r\n }", "private InetAddress getBroadcastAddress() {\n InetAddress broadcastAddress = null;\n try {\n Enumeration<NetworkInterface> networkInterface = NetworkInterface\n .getNetworkInterfaces();\n\n while (broadcastAddress == null\n && networkInterface.hasMoreElements()) {\n NetworkInterface singleInterface = networkInterface.nextElement();\n String interfaceName = singleInterface.getName();\n if (interfaceName.contains(\"wlan0\") || interfaceName.contains(\"eth0\")) {\n for (InterfaceAddress interfaceAddress : singleInterface.getInterfaceAddresses()) {\n broadcastAddress = interfaceAddress.getBroadcast();\n if (broadcastAddress != null) {\n break;\n }\n }\n }\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return broadcastAddress;\n }", "public void testFromInterface() throws Exception\n {\n EthernetAddress addr = EthernetAddress.fromInterface();\n assertNotNull(addr);\n assertNotNull(addr.toString());\n }", "java.lang.String getIpv6();", "public MAC getMacSource() {\n\t\treturn macSource;\n\t}", "@Override\n\tprotected byte[] mac(IsoPackage isoPackage) throws Exception {\n\t\treturn null;\n\t}", "NetworkInterface getNetworkInterface(int id);", "public String getAudioMulticastAddr();", "public static List<String> getAllHardwareAddress() throws SocketException {\n ArrayList<String> addresses = new ArrayList<>();\n Enumeration<NetworkInterface> ifaces = NetworkInterface.getNetworkInterfaces();\n while (ifaces.hasMoreElements()) {\n NetworkInterface iface = ifaces.nextElement();\n byte[] macaddr = iface.getHardwareAddress();\n if (macaddr == null)\n continue;\n String key = String.format(MACADDR_FORMAT, macaddr[0], macaddr[1], macaddr[2], macaddr[3], macaddr[4], macaddr[5]);\n addresses.add(key);\n }\n return addresses;\n }", "private static final long getHostId(){\n long macAddressAsLong = 0;\n try {\n Random random = new Random();\n InetAddress address = InetAddress.getLocalHost();\n NetworkInterface ni = NetworkInterface.getByInetAddress(address);\n if (ni != null) {\n byte[] mac = ni.getHardwareAddress();\n random.nextBytes(mac); // we don't really want to reveal the actual MAC address\n\n //Converts array of unsigned bytes to an long\n if (mac != null) {\n for (int i = 0; i < mac.length; i++) {\n macAddressAsLong <<= 8;\n macAddressAsLong ^= (long)mac[i] & 0xFF;\n }\n }\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n return macAddressAsLong;\n }", "public String getStrmac() {\n return strmac;\n }", "public InetAddress getBroadcastAddress() {\r\n InetAddress ip=null;\r\n try{\r\n WifiManager wifi = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);\r\n DhcpInfo dhcp = wifi.getDhcpInfo();\r\n int broadcast = (dhcp.ipAddress & dhcp.netmask) | ~dhcp.netmask;\r\n byte[] quads = new byte[4];\r\n for (int k = 0; k < 4; k++)\r\n quads[k] = (byte) (broadcast >> (k * 8));\r\n ip= InetAddress.getByAddress(quads);\r\n }catch(IOException e)\r\n {\r\n\r\n }\r\n\r\n return ip;\r\n }", "public static String getBroadcastAddr(String ipAddr, int prefixLength) {\n String subnet = ipAddr + \"/\" + prefixLength;\n SubnetUtils utils = new SubnetUtils(subnet);\n return utils.getInfo().getBroadcastAddress();\n }", "public String getMacChannel() {\r\n return macChannel;\r\n }", "public String getMacBanchId() {\r\n return macBanchId;\r\n }", "public MacAddress(){\n super(MAC_DIGIT_COUNT);\n }", "public static String getDefaultAddress() {\n\t\tEnumeration<NetworkInterface> nets;\n\t\ttry {\n\t\t\tnets = NetworkInterface.getNetworkInterfaces();\n\t\t} catch (SocketException e) {\n\t\t\treturn null;\n\t\t}\n\t\tNetworkInterface netinf;\n\t\twhile (nets.hasMoreElements()) {\n\t\t\tnetinf = nets.nextElement();\n\n\t\t\tEnumeration<InetAddress> addresses = netinf.getInetAddresses();\n\n\t\t\twhile (addresses.hasMoreElements()) {\n\t\t\t\tInetAddress address = addresses.nextElement();\n\t\t\t\tif (!address.isAnyLocalAddress() && !address.isMulticastAddress() && !(address instanceof Inet6Address)) {\n\t\t\t\t\treturn address.getHostAddress();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "Ip4Address interfaceIpAddress();", "public void setMacAddress(String macAddress)\r\n\t{\r\n\t\tthis.macAddress = macAddress;\r\n\t}", "public String getIfName()\n {\n return (String) getAttributes().get(ATTR_IF_NAME);\n }", "public static List<InterfaceConfig> getAllAddress() throws SocketException {\n ArrayList<InterfaceConfig> addresses = new ArrayList<>();\n Enumeration<NetworkInterface> ifaces = NetworkInterface.getNetworkInterfaces();\n while (ifaces.hasMoreElements()) {\n NetworkInterface iface = ifaces.nextElement();\n byte[] macaddr = iface.getHardwareAddress();\n if (macaddr == null)\n continue;\n String key = String.format(MACADDR_FORMAT, macaddr[0], macaddr[1], macaddr[2], macaddr[3], macaddr[4], macaddr[5]);\n List<InterfaceAddress> addressList = iface.getInterfaceAddresses();\n InterfaceConfig ic = new InterfaceConfig(key, addressList);\n addresses.add(ic);\n }\n return addresses;\n }", "public Interface addInterface(String name, IpAddress addr, Mask msk,\r\n\t\t\tInteger mtu) throws NodeException {\r\n\t\tInterface ifc1 = new Interface(name, addr, msk, mtu);\r\n\t\tifaces.put(name, ifc1);\r\n\t\treturn ifc1;\r\n\t}", "public InetAddress getBroadcastAddress() throws IOException {\n\t\tDhcpInfo dhcp = mWifi.getDhcpInfo();\n\t\tif (dhcp == null) {\n\t\t\tLog.d(TAG, \"Could not get dhcp info\");\n\t\t\treturn null;\n\t\t}\n\n\t\tint broadcast = (dhcp.ipAddress & dhcp.netmask) | ~dhcp.netmask;\n\t\tbyte[] quads = new byte[4];\n\t\tfor (int k = 0; k < 4; k++)\n\t\t\tquads[k] = (byte) ((broadcast >> k * 8) & 0xFF);\n\n\t\treturn InetAddress.getByAddress(quads);\n\t}", "public void setMacDest(MAC dest) {\n\t\tmacDest = dest;\n\t}", "public String getOdlOpenflowMacAddress2() throws SnmpStatusException;", "public void setMacAddress(String macAddress)\n\t{\n\t\tthis.macAddress = macAddress;\n\t}", "String getInterfacesAsString() {\n List<NetworkInterface> interfaces;\n try {\n interfaces = Collections.list(NetworkInterface.getNetworkInterfaces());\n } catch (Exception e) {\n return \"\";\n }\n\n StringBuilder sb = new StringBuilder(\"\");\n for (NetworkInterface nif : interfaces) {\n try {\n // Android doesn't have a supportsBroadcast() but the Go net.Interface wants\n // one, so we say the interface has broadcast if it has multicast.\n sb.append(String.format(java.util.Locale.ROOT, \"%s %d %d %b %b %b %b %b |\", nif.getName(),\n nif.getIndex(), nif.getMTU(), nif.isUp(), nif.supportsMulticast(),\n nif.isLoopback(), nif.isPointToPoint(), nif.supportsMulticast()));\n\n for (InterfaceAddress ia : nif.getInterfaceAddresses()) {\n // InterfaceAddress == hostname + \"/\" + IP\n String[] parts = ia.toString().split(\"/\", 0);\n if (parts.length > 1) {\n sb.append(String.format(java.util.Locale.ROOT, \"%s/%d \", parts[1], ia.getNetworkPrefixLength()));\n }\n }\n } catch (Exception e) {\n // TODO(dgentry) should log the exception not silently suppress it.\n continue;\n }\n sb.append(\"\\n\");\n }\n\n return sb.toString();\n }", "public interface IECTwistedPairMACAddressSetup extends MACaddresssetup {\n}", "Interface getInterfaceByName(ConnectPoint connectPoint, String name);", "public void setMac(java.lang.String mac) {\n this.mac = mac;\n }", "public void testGetMacAddress_failure() throws Exception {\n IDevice device = new StubDevice(MOCK_DEVICE_SERIAL) {\n @Override\n public void executeShellCommand(String command, IShellOutputReceiver receiver)\n throws TimeoutException, AdbCommandRejectedException,\n ShellCommandUnresponsiveException, IOException {\n throw new IOException();\n }\n };\n mMockIDevice.executeShellCommand(EasyMock.anyObject(), EasyMock.anyObject());\n EasyMock.expectLastCall().andDelegateTo(device).anyTimes();\n EasyMock.replay(mMockIDevice);\n assertNull(mTestDevice.getMacAddress());\n EasyMock.verify(mMockIDevice);\n }", "private static Ip4Address getInterfaceIp(int interfaceIndex) {\n Ip4Address ipAddress = null;\n try {\n NetworkInterface networkInterface = NetworkInterface.getByIndex(interfaceIndex);\n Enumeration ipAddresses = networkInterface.getInetAddresses();\n while (ipAddresses.hasMoreElements()) {\n InetAddress address = (InetAddress) ipAddresses.nextElement();\n if (!address.isLinkLocalAddress()) {\n ipAddress = Ip4Address.valueOf(address.getAddress());\n break;\n }\n }\n } catch (Exception e) {\n log.debug(\"Error while getting Interface IP by index\");\n return OspfUtil.DEFAULTIP;\n }\n return ipAddress;\n }", "public String getApnName() {\n Network network = null;\n synchronized (this) {\n if (mNetwork == null) {\n return null;\n }\n network = mNetwork;\n }\n String apnName = null;\n final ConnectivityManager connectivityManager = getConnectivityManager();\n final NetworkInfo mmsNetworkInfo = connectivityManager.getNetworkInfo(network);\n if (mmsNetworkInfo != null) {\n apnName = mmsNetworkInfo.getExtraInfo();\n }\n return apnName;\n }", "IsisNeighbor lookup(MacAddress isisNeighborMac);", "public String getMAddr() {\n LogWriter.logMessage(LogWriter.TRACE_DEBUG, \"getMaddr () \");\n Via via=(Via)sipHeader;\n \n Host host=via.getMaddr();\n if ( host == null) return null;\n else return host.getIpAddress(); \n }", "public MacAddress getClientMac() {\n return clientMac;\n }", "public static String getDeviceIpAddress() {\n try {\n for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) {\n NetworkInterface intf = en.nextElement();\n for (Enumeration<InetAddress> enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements();) {\n InetAddress inetAddress = enumIpAddr.nextElement();\n\n log.debug(\"inetAddress: \" + inetAddress);\n\n if (!inetAddress.isLoopbackAddress()) {\n String ip = Formatter.formatIpAddress(inetAddress.hashCode());\n return ip;\n }\n }\n }\n } catch (SocketException ex) {\n log.error(ex.getMessage(), ex);\n }\n\n return null;\n }", "public Address getDummyAddress(String name) {\n\t\t if(name.equalsIgnoreCase(\"A\")) return new Address(0xAAAAAAAA);\n\t\telse if(name.equalsIgnoreCase(\"B\")) return new Address(0xBBBBBBBB);\n\t\telse if(name.equalsIgnoreCase(\"C\")) return new Address(0xCCCCCCCC);\n\t\telse if(name.equalsIgnoreCase(\"D\")) return new Address(0xDDDDDDDD);\n\t\telse if(name.equalsIgnoreCase(\"E\")) return new Address(0xEEEEEEEE);\n\t\telse if(name.equalsIgnoreCase(\"F\")) return new Address(0xFFFFFFFF);\n\t\treturn new Address(0);\n\t}" ]
[ "0.820733", "0.8001268", "0.7130593", "0.6558021", "0.6451806", "0.6392799", "0.617472", "0.5984623", "0.5958307", "0.5835766", "0.5828649", "0.5798339", "0.57838273", "0.5781114", "0.5748449", "0.5737994", "0.57327664", "0.5720049", "0.5714966", "0.5714966", "0.57010984", "0.56687355", "0.5660704", "0.563515", "0.56296206", "0.56011224", "0.55768985", "0.553967", "0.55019146", "0.54263896", "0.53997326", "0.5310108", "0.51982963", "0.5174098", "0.51487875", "0.5125525", "0.5102984", "0.50906724", "0.50866127", "0.5016477", "0.49991533", "0.49978977", "0.4981907", "0.49667215", "0.4949", "0.49437866", "0.49320185", "0.482436", "0.4778779", "0.47664788", "0.47524375", "0.47309914", "0.47174916", "0.47068194", "0.46991843", "0.4693492", "0.46797925", "0.4641878", "0.46398067", "0.46227044", "0.4598352", "0.45881158", "0.458601", "0.45824492", "0.45729202", "0.45397982", "0.45284978", "0.45196128", "0.45104104", "0.44960865", "0.4492829", "0.44840685", "0.4473967", "0.44667503", "0.44634864", "0.44528735", "0.44509605", "0.4447406", "0.44385034", "0.44130772", "0.43758172", "0.43746212", "0.43665835", "0.43648022", "0.43520817", "0.43396696", "0.43304598", "0.43111083", "0.4298935", "0.42961836", "0.4290935", "0.4258716", "0.42548844", "0.42446303", "0.4240726", "0.42216685", "0.4203478", "0.41948488", "0.41911322", "0.41867757" ]
0.80970037
1
Get IP address from first nonlocalhost interface
public static String ip(boolean useIPv4) { try { List<NetworkInterface> interfaces = Collections.list(NetworkInterface.getNetworkInterfaces()); for (NetworkInterface intf : interfaces) { List<InetAddress> addrs = Collections.list(intf.getInetAddresses()); for (InetAddress addr : addrs) { if (!addr.isLoopbackAddress()) { String sAddr = addr.getHostAddress().toUpperCase(); boolean isIPv4 = InetAddressUtils.isIPv4Address(sAddr); if (useIPv4) { if (isIPv4) return sAddr; } else { if (!isIPv4) { int delim = sAddr.indexOf('%'); // drop ip6 port suffix return delim<0 ? sAddr : sAddr.substring(0, delim); } } } } } } catch (Exception ex) { } // for now eat exceptions return ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public InetAddress getIP();", "Ip4Address interfaceIpAddress();", "private String findIpAddress() throws Exception {\n\n\t\tString ipAddress = null;\n\t\tEnumeration<?> e = NetworkInterface.getNetworkInterfaces();\n\t\tloop: while( e.hasMoreElements()) {\n\t\t\tNetworkInterface n = (NetworkInterface) e.nextElement();\n\t\t\tEnumeration<?> ee = n.getInetAddresses();\n\n\t\t\twhile( ee.hasMoreElements()) {\n\t\t\t\tInetAddress i = (InetAddress) ee.nextElement();\n\t\t\t\tif( i instanceof Inet4Address\n\t\t\t\t\t\t&& ! \"127.0.0.1\".equals( i.getHostAddress())) {\n\t\t\t\t\tipAddress = i.getHostAddress();\n\t\t\t\t\tbreak loop;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif( ipAddress == null )\n\t\t\tthrow new Exception( \"No IP address was found.\" );\n\n\t\treturn ipAddress;\n\t}", "public static String getMyIpv4Address() {\n try {\n Enumeration<NetworkInterface> nets = NetworkInterface.getNetworkInterfaces();\n\n for (NetworkInterface netInterface : Collections.list(nets)) {\n Enumeration<InetAddress> inetAddresses = netInterface.getInetAddresses();\n\n if (!netInterface.isUp() || netInterface.isVirtual() || netInterface.isLoopback())\n continue;\n\n for (InetAddress inetAddress : Collections.list(inetAddresses)) {\n if (!inetAddress.isLinkLocalAddress() && !inetAddress.isLoopbackAddress() && (inetAddress instanceof Inet4Address))\n return inetAddress.getHostAddress();\n }\n\n }\n } catch (SocketException e) {\n // ignore it\n }\n\n return \"127.0.0.1\";\n }", "private static InetAddress getLocalInetAddress() throws SocketException {\n // Before we connect somewhere, we cannot be sure about what we'd be bound to; however,\n // we only connect when the message where client ID is, is long constructed. Thus,\n // just use whichever IP address we can find.\n Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();\n while (interfaces.hasMoreElements()) {\n NetworkInterface current = interfaces.nextElement();\n if (!current.isUp() || current.isLoopback() || current.isVirtual()) {\n continue;\n }\n Enumeration<InetAddress> addresses = current.getInetAddresses();\n while (addresses.hasMoreElements()) {\n InetAddress addr = addresses.nextElement();\n if (!addr.isLoopbackAddress()) {\n return addr;\n }\n }\n }\n\n throw new SocketException(\"Can't get our ip address, interfaces are: \" + interfaces);\n }", "private String getIpAddress() throws SocketException {\n String ip = null;\n\n Enumeration networkInterfaces = NetworkInterface.getNetworkInterfaces();\n\n while (networkInterfaces.hasMoreElements()) {\n NetworkInterface networkInterface = (NetworkInterface) networkInterfaces.nextElement();\n\n if (networkInterface.getName().equals(\"eth0\") || networkInterface.getName().equals(\"wlan0\")) {\n Enumeration inetAddresses = networkInterface.getInetAddresses();\n\n while (inetAddresses.hasMoreElements()) {\n InetAddress inetAddress = (InetAddress) inetAddresses.nextElement();\n if (inetAddress instanceof Inet4Address) {\n ip = inetAddress.getHostAddress();\n }\n }\n }\n }\n \n return ip;\n }", "String getExternalIPAddress() throws NotDiscoverUpnpGatewayException, UpnpException;", "int getInIp();", "int getInIp();", "public String getIP() throws UnknownHostException{\n\t\tInetAddress addr = InetAddress.getLocalHost();//Get local IP\n \t String ip = addr.toString().split(\"\\\\/\")[1];//local IP\n \t //ip = ip.indexOf('\\\\');\n \t if(!getIsLocal()){\n\t \ttry{\n\t\t \tURL whatismyip = new URL(\"http://automation.whatismyip.com/n09230945.asp\");\n\t\t \tBufferedReader in = new BufferedReader(new InputStreamReader(\n\t\t \t whatismyip.openStream()));\n\t\t \tip = in.readLine(); //you get the IP as a String\n\t\t \t//System.out.println(ip);\n\t\t \tin.close();\n\t\t \treturn ip;\n\n\t \t}\n\t \tcatch(IOException e){\n\t \t\te.printStackTrace();\n\t \t}\n\t \treturn null;\n \t }\n\t\treturn ip;\n\t }", "int getIp();", "int getIp();", "int getIp();", "public static String getCurrentIp() throws UnknownHostException {\n try {\n InetAddress candidateAddress = null;\n for (Enumeration ifaces = NetworkInterface.getNetworkInterfaces(); ifaces\n .hasMoreElements();) {\n NetworkInterface iface = (NetworkInterface) ifaces.nextElement();\n for (Enumeration inetAddrs = iface.getInetAddresses(); inetAddrs.hasMoreElements();) {\n InetAddress inetAddr = (InetAddress) inetAddrs.nextElement();\n if (!inetAddr.isLoopbackAddress()) {\n if (inetAddr.isSiteLocalAddress() && !iface.getName().contains(\"docker\")) {\n return inetAddr.getHostAddress();\n } else if (candidateAddress == null) {\n candidateAddress = inetAddr;\n }\n }\n }\n }\n if (candidateAddress != null) {\n return candidateAddress.getHostAddress();\n }\n InetAddress jdkSuppliedAddress = InetAddress.getLocalHost();\n if (jdkSuppliedAddress == null) {\n throw new UnknownHostException(\n \"The JDK InetAddress.getLocalHost() method unexpectedly returned null.\");\n }\n return jdkSuppliedAddress.getHostAddress();\n } catch (Exception e) {\n UnknownHostException unknownHostException =\n new UnknownHostException(\"Failed to determine LAN address: \" + e);\n unknownHostException.initCause(e);\n throw unknownHostException;\n }\n }", "public static String getDeviceIpAddress() {\n try {\n for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) {\n NetworkInterface intf = en.nextElement();\n for (Enumeration<InetAddress> enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements();) {\n InetAddress inetAddress = enumIpAddr.nextElement();\n\n log.debug(\"inetAddress: \" + inetAddress);\n\n if (!inetAddress.isLoopbackAddress()) {\n String ip = Formatter.formatIpAddress(inetAddress.hashCode());\n return ip;\n }\n }\n }\n } catch (SocketException ex) {\n log.error(ex.getMessage(), ex);\n }\n\n return null;\n }", "public String getIPAddress() throws SocketException\n\t{\n\t\tEnumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces();\n\t\twhile(en.hasMoreElements())\n\t\t{\n\t\t\tNetworkInterface i = en.nextElement();\n\t\t\tEnumeration<InetAddress> addresses = i.getInetAddresses();\n\t\t\twhile(addresses.hasMoreElements())\n\t\t\t{\n\t\t\t\tInetAddress ad = addresses.nextElement();\n\t\t\t\tif(!ad.isLoopbackAddress() && ad instanceof Inet4Address)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(ad.getHostAddress());\n\t\t\t\t\treturn ad.getHostAddress();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t\t\n\t}", "public String getUpnpExternalIpaddress();", "public InetAddress getIP()\r\n\r\n {\r\n InetAddress ip=null;\r\n try{\r\n WifiManager wifi = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);\r\n DhcpInfo dhcp = wifi.getDhcpInfo();\r\n int dip=dhcp.ipAddress;\r\n byte[] quads = new byte[4];\r\n for (int k = 0; k < 4; k++)\r\n quads[k] = (byte) (dip >> (k * 8));\r\n ip= InetAddress.getByAddress(quads);\r\n } catch (UnknownHostException e) {\r\n e.printStackTrace();\r\n }\r\n return ip;\r\n }", "private static void getServerIPAddress() {\r\n // Get local IP address\r\n try {\r\n Enumeration<NetworkInterface> enumeratedNetworkInterface = NetworkInterface.getNetworkInterfaces();\r\n\r\n NetworkInterface networkInterface;\r\n Enumeration<InetAddress> enumeratedInetAddress;\r\n InetAddress inetAddress;\r\n\r\n for (; enumeratedNetworkInterface.hasMoreElements(); ) {\r\n networkInterface = enumeratedNetworkInterface.nextElement();\r\n enumeratedInetAddress = networkInterface.getInetAddresses();\r\n\r\n for (; enumeratedInetAddress.hasMoreElements(); ) {\r\n inetAddress = enumeratedInetAddress.nextElement();\r\n String anIPAddress = inetAddress.getHostAddress();\r\n if (log.isDebugEnabled()) {\r\n log.debug(\"Scanning local IP space: \" + anIPAddress);\r\n }\r\n\r\n // exclude loop-back and MAC address\r\n if (!(anIPAddress.equals(\"127.0.0.1\") || anIPAddress.contains(\":\")))\r\n localIPAddress = anIPAddress;\r\n }\r\n }\r\n } catch (Exception e) {\r\n log.error(\"Error in retrieving the local IP address: \" + e.toString());\r\n }\r\n }", "@Override\n public InetAddress getIp() {\n this.ip =\n maybeHostname\n .map(\n hostname -> {\n try {\n return InetAddress.getByName(hostname);\n } catch (final UnknownHostException e) {\n return ip;\n }\n })\n .orElse(ip);\n return ip;\n }", "java.lang.String getIp();", "java.lang.String getIp();", "java.lang.String getIp();", "java.lang.String getIp();", "java.lang.String getIp();", "java.lang.String getIp();", "java.lang.String getIp();", "java.lang.String getIp();", "public InetAddress getIPAddress ( ) { return _IPAddress; }", "private static Ip4Address getInterfaceIp(int interfaceIndex) {\n Ip4Address ipAddress = null;\n try {\n NetworkInterface networkInterface = NetworkInterface.getByIndex(interfaceIndex);\n Enumeration ipAddresses = networkInterface.getInetAddresses();\n while (ipAddresses.hasMoreElements()) {\n InetAddress address = (InetAddress) ipAddresses.nextElement();\n if (!address.isLinkLocalAddress()) {\n ipAddress = Ip4Address.valueOf(address.getAddress());\n break;\n }\n }\n } catch (Exception e) {\n log.debug(\"Error while getting Interface IP by index\");\n return OspfUtil.DEFAULTIP;\n }\n return ipAddress;\n }", "String getIntegHost();", "SocketAddress getLocalAddress();", "String getIp();", "String getIp();", "public InetAddress getHost();", "public static String getDefaultAddress() {\n\t\tEnumeration<NetworkInterface> nets;\n\t\ttry {\n\t\t\tnets = NetworkInterface.getNetworkInterfaces();\n\t\t} catch (SocketException e) {\n\t\t\treturn null;\n\t\t}\n\t\tNetworkInterface netinf;\n\t\twhile (nets.hasMoreElements()) {\n\t\t\tnetinf = nets.nextElement();\n\n\t\t\tEnumeration<InetAddress> addresses = netinf.getInetAddresses();\n\n\t\t\twhile (addresses.hasMoreElements()) {\n\t\t\t\tInetAddress address = addresses.nextElement();\n\t\t\t\tif (!address.isAnyLocalAddress() && !address.isMulticastAddress() && !(address instanceof Inet6Address)) {\n\t\t\t\t\treturn address.getHostAddress();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "int getAddr();", "InetAddress getAddress();", "InetAddress getAddress();", "private void findInternalExternalIP() {\n\t\ttry {\n\t\t\texternalIP = InetAddress.getByName(getExternalIP());\n\t\t} catch (UnknownHostException e) {\n\t\t\tDecentLogger.write(\"Unable to to resolve external IP to InetAddress (problem with ip provider?)\");\n\t\t}\n\t\ttry {\n\t\t\tinternalIP = InetAddress.getLocalHost();\n\t\t} catch (UnknownHostException e) {\n\t\t\tDecentLogger.write(\"Unable to to resolve internal IP to InetAddress\");\n\t\t}\n\t}", "String getAddr();", "public String getRemoteIPAddress() {\n String xForwardedFor = getRequestHeader(\"X-Forwarded-For\");\n\n if (!Utils.isEmpty(xForwardedFor)) {\n System.out.println(\"The xForwardedFor address is: \" + xForwardedFor + \"\\n\");\n return xForwardedFor.split(\"\\\\s*,\\\\s*\", 2)[0]; // The xForwardFor is a comma separated string: client,proxy1,proxy2,...\n }\n\n return getRequest().getRemoteAddr();\n }", "SocketAddress getRemoteAddress();", "public AddressInfo getLoopbackInterface() {\r\n return loopbackInterface;\r\n }", "public String getIp() {\n return getIpString(inetAddress);\n }", "String getRemoteIpAddress();", "public static Host getLocalHostAddresAndIP() {\n try {\n for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) {\n NetworkInterface intf = en.nextElement();\n for (Enumeration<InetAddress> enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements();) {\n InetAddress inetAddress = enumIpAddr.nextElement();\n // IPv4 only\n if (inetAddress instanceof Inet6Address)\n continue;\n if (!inetAddress.isLoopbackAddress()) {\n Host thisHost = new Host(inetAddress.getHostAddress().toString(), true);\n return thisHost;\n }\n }\n }\n } catch (SocketException ex) {\n ex.printStackTrace();\n }\n return null;\n }", "public static String getIPCliente(){//192.168, 172.16. o 10.0.\n\t\tString ipAddress=\"\";\n\t\ttry{\n\t\t\tHttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();\n\t\t\tipAddress = request.getHeader(\"X-FORWARDED-FOR\");\n\t\t\tif ( ipAddress == null ) {\n\t\t\t\tipAddress = request.getRemoteAddr();\n\t\t\t\tif(ipAddress.equals(\"127.0.0.1\")){\n\t\t\t\t\ttry {\n\t\t\t\t\t\tipAddress = InetAddress.getLocalHost().getHostAddress();\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tipAddress = \"\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tString[] ips = ipAddress.split(\",\");\n\t\t\tfor(String ip : ips){\n\t\t\t\tif(!ip.trim().startsWith(\"127.0.\")){\n\t\t\t\t\tipAddress = ip;\n\t\t\t\t}\n\t\t\t}\n\t\t}catch(Exception ex){\n\t\t\tex.printStackTrace();\n\t\t}\n\t\treturn ipAddress;\n\t}", "NetworkInterface getNetworkInterfaceByAddress(InterfaceAddress interfaceAddress);", "public String getIp();", "private String getAddress() {\n\t\tif (localIp != null) {\n\t\t\treturn localIp;\n\t\t}\n\t\tString address = \"\";\n\t\tInetAddress lanIp = null;\n\t\ttry {\n\t\t\tString ipAddress = null;\n\t\t\tEnumeration<NetworkInterface> net = null;\n\t\t\tnet = NetworkInterface.getNetworkInterfaces();\n\t\t\twhile (net.hasMoreElements()) {\n\t\t\t\tNetworkInterface element = net.nextElement();\n\t\t\t\tEnumeration<InetAddress> addresses = element.getInetAddresses();\n\t\t\t\twhile (addresses.hasMoreElements()) {\n\t\t\t\t\tInetAddress ip = addresses.nextElement();\n\t\t\t\t\tif (ip instanceof Inet4Address) {\n\t\t\t\t\t\tif (ip.isSiteLocalAddress()) {\n\t\t\t\t\t\t\tipAddress = ip.getHostAddress();\n\t\t\t\t\t\t\tlanIp = InetAddress.getByName(ipAddress);\n\t\t\t\t\t\t\tSystem.out.println(\"found local address: \" + ipAddress);\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\tif (lanIp == null)\n\t\t\t\treturn null; \n\t\t\taddress = lanIp.toString().replaceAll(\"^/+\", \"\"); \n\t\t} catch (UnknownHostException ex) {\n\t\t\tex.printStackTrace();\n\t\t} catch (SocketException ex) {\n\t\t\tex.printStackTrace();\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t\treturn address;\n\n\t}", "private static String m21403f() {\n String str;\n String str2 = \"\";\n try {\n Enumeration networkInterfaces = NetworkInterface.getNetworkInterfaces();\n while (networkInterfaces.hasMoreElements()) {\n Enumeration inetAddresses = ((NetworkInterface) networkInterfaces.nextElement()).getInetAddresses();\n while (inetAddresses.hasMoreElements()) {\n InetAddress inetAddress = (InetAddress) inetAddresses.nextElement();\n if (!inetAddress.isLoopbackAddress()) {\n str2 = inetAddress.getHostAddress();\n }\n }\n }\n } catch (Throwable th) {\n C5205o.m21464a(th);\n }\n return str;\n }", "public IPAddress getIPAddress() {\n return iPAddress;\n }", "public String getIp() {\n return (String) get(24);\n }", "private String getLocalIpAddress() throws Exception {\n return InetAddress.getLocalHost().getHostAddress();\n }", "private String getWifiIPAddress() {\n\t\tWifiManager wifiManager = (WifiManager) this.getSystemService(this.WIFI_SERVICE);\n\t\tWifiInfo wifiInfo = wifiManager.getConnectionInfo();\n\n\t\tint ipAddress = wifiInfo.getIpAddress();\n\n\t\tif(ipAddress != 0)\n\t\t\t//\n\t\t\treturn String.format(\"%d.%d.%d.%d\",\n\t\t\t\t\t(ipAddress & 0xff), (ipAddress >> 8 & 0xff),\n\t\t\t\t\t(ipAddress >> 16 & 0xff), (ipAddress >> 24 & 0xff));\n\t\telse\n\t\t\treturn \"127.0.0.1\";\n\t}", "public static String getLocalIPAddress() {\r\n return (localIPAddress);\r\n }", "private static InetAddress getLocalHost() throws UnknownHostException {\n InetAddress addr;\n try {\n addr = InetAddress.getLocalHost();\n } catch (ArrayIndexOutOfBoundsException e) {\n addr = InetAddress.getByName(null);\n }\n return addr;\n }", "private String getMobileIP(){\n try {\n for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces();\n en.hasMoreElements();) {\n NetworkInterface networkinterface = en.nextElement();\n for (Enumeration<InetAddress> enumIpAddr = networkinterface.getInetAddresses(); enumIpAddr.hasMoreElements();) {\n InetAddress inetAddress = enumIpAddr.nextElement();\n if (!inetAddress.isLoopbackAddress()) {\n return inetAddress.getHostAddress().toString();\n }\n }\n }\n } catch (Exception ex) {\n Log.e(\"Current IP\", ex.toString());\n }\n return null;\n }", "public static InetAddress getJustLocalAddress()\n {\n if (localInetAddress == null)\n {\n if (DatabaseDescriptor.getListenAddress() == null)\n {\n try\n {\n localInetAddress = InetAddress.getLocalHost();\n logger.info(\"InetAddress.getLocalHost() was used to resolve listen_address to {}, double check this is \"\n + \"correct. Please check your node's config and set the listen_address in cassandra.yaml accordingly if applicable.\",\n localInetAddress);\n }\n catch(UnknownHostException e)\n {\n logger.info(\"InetAddress.getLocalHost() could not resolve the address for the hostname ({}), please \"\n + \"check your node's config and set the listen_address in cassandra.yaml. Falling back to {}\",\n e,\n InetAddress.getLoopbackAddress());\n // CASSANDRA-15901 fallback for misconfigured nodes\n localInetAddress = InetAddress.getLoopbackAddress();\n }\n }\n else\n localInetAddress = DatabaseDescriptor.getListenAddress();\n }\n return localInetAddress;\n }", "String getInternalHostAddress() throws NotDiscoverUpnpGatewayException;", "private InetAddress getBroadcastIP()\n\t{\n\t\treturn null;\n\t}", "private String getIPAddress() throws Exception {\n //Don't need the line of code below, TODO: delete it!\n InetAddress getIP = InetAddress.getLocalHost();\n String thisSystemAddress = \"\";\n try{\n URL thisUrl = new URL(\"http://bot.whatismyipaddress.com\");\n BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(thisUrl.openStream()));\n thisSystemAddress = bufferedReader.readLine().trim();\n } catch (Exception e){\n e.printStackTrace();\n e.getCause();\n }\n\n return thisSystemAddress;\n }", "private static String getExternalIP() {\n\t\ttry {\n\t URL checkURL = new URL(EXTERNAL_IP_PROVIDER);\n\t BufferedReader in = new BufferedReader(new InputStreamReader(checkURL.openStream()));;\n\t String ip = in.readLine();\n\t return ip;\n\t } catch (IOException e) {\n\t \t DecentLogger.write(\"Unable to get external IP Address\");\n\t }\n\t\treturn null;\n\t}", "public static InetAddress getServerInet(){\n return thisServer.getIp();\n }", "@SuppressLint(\"DefaultLocale\")\n\tprivate String getIpAddr()\n\t{\n\t\tString ipString = null;\n\t\tWifiManager wifiManager = (WifiManager) getSystemService(WIFI_SERVICE);\n\t\tif (wifiManager != null)\n\t\t{\n\t\t\tWifiInfo wifiInfo = wifiManager.getConnectionInfo();\n\t\t\tif (wifiInfo != null)\n\t\t\t{\n\t\t\t\tint ip = wifiInfo.getIpAddress();\n\n\t\t\t\tipString = String.format(\"%d.%d.%d.%d\", (ip & 0xff),\n\t\t\t\t\t(ip >> 8 & 0xff), (ip >> 16 & 0xff), (ip >> 24 & 0xff));\n\n\t\t\t}\n\t\t}\n\t\treturn ipString;\n\t}", "public String getIPAddress()\n {\n return fIPAddress;\n }", "java.lang.String getDestinationIp();", "java.lang.String getAgentIP();", "private String getClientIP(){\n try {\n ConnectivityManager connManager = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE);\n @SuppressWarnings(\"deprecation\")\n NetworkInfo wifi = connManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);\n @SuppressWarnings(\"deprecation\")\n NetworkInfo mobile = connManager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);\n\n if (wifi.isConnected()) {\n // If Wi-Fi connected\n return getWifiIP();\n }\n\n if (mobile.isConnected()) {\n // If Internet connected\n return getMobileIP();\n }\n\n return null;\n }catch(SecurityException e){\n return null;\n }\n }", "public String getIp() {\n\t\treturn InfraUtil.getIpMachine();\n\t}", "private String GetHostAddress() throws UnknownHostException {\n return Inet4Address.getLocalHost().getHostAddress();\n }", "public String getIPAddress () {\n\t\treturn _ipTextField.getText();\n\t}", "public String getLocalIpAddress()\n {\n \t\n \treturn null;\n }", "private static InetAddress getLocalHostLANAddress() throws UnknownHostException {\n\t\ttry {\n\t\t\tInetAddress candidateAddress = null;\n\t\t\t// Iterate all NICs (network interface cards)...\n\t\t\tfor (final Enumeration ifaces = NetworkInterface.getNetworkInterfaces(); ifaces.hasMoreElements();) {\n\t\t\t\tfinal NetworkInterface iface = (NetworkInterface) ifaces.nextElement();\n\t\t\t\t// Iterate all IP addresses assigned to each card...\n\t\t\t\tfor (final Enumeration inetAddrs = iface.getInetAddresses(); inetAddrs.hasMoreElements();) {\n\t\t\t\t\tfinal InetAddress inetAddr = (InetAddress) inetAddrs.nextElement();\n\t\t\t\t\tif (!inetAddr.isLoopbackAddress()) {\n\t\t\t\t\t\tif (inetAddr.getHostAddress().startsWith(\"141\")) {\n\t\t\t\t\t\t\t// Found non-loopback site-local address. Return it immediately...\n\t\t\t\t\t\t\treturn inetAddr;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if ((candidateAddress == null) && (inetAddr instanceof Inet4Address)) {\n\t\t\t\t\t\t\t// Found non-loopback address, but not necessarily site-local.\n\t\t\t\t\t\t\t// Store it as a candidate to be returned if site-local address is not subsequently found...\n\t\t\t\t\t\t\tcandidateAddress = inetAddr;\n\t\t\t\t\t\t\t// Note that we don't repeatedly assign non-loopback non-site-local addresses as candidates,\n\t\t\t\t\t\t\t// only the first. For subsequent iterations, candidate will be non-null.\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\tif (candidateAddress != null) {\n\t\t\t\t// We did not find a site-local address, but we found some other non-loopback address.\n\t\t\t\t// Server might have a non-site-local address assigned to its NIC (or it might be running\n\t\t\t\t// IPv6 which deprecates the \"site-local\" concept).\n\t\t\t\t// Return this non-loopback candidate address...\n\t\t\t\treturn candidateAddress;\n\t\t\t}\n\t\t\t// At this point, we did not find a non-loopback address.\n\t\t\t// Fall back to returning whatever InetAddress.getLocalHost() returns...\n\t\t\tfinal InetAddress jdkSuppliedAddress = InetAddress.getLocalHost();\n\t\t\tif (jdkSuppliedAddress == null) {\n\t\t\t\tthrow new UnknownHostException(\"The JDK InetAddress.getLocalHost() method unexpectedly returned null.\");\n\t\t\t}\n\t\t\treturn jdkSuppliedAddress;\n\t\t}\n\t\tcatch (final Exception e) {\n\t\t\tfinal UnknownHostException unknownHostException = new UnknownHostException(\"Failed to determine LAN address: \" + e);\n\t\t\tunknownHostException.initCause(e);\n\t\t\tthrow unknownHostException;\n\t\t}\n\t}", "public InetAddress getInetAddress() {\n return socket.getInetAddress();\n }", "public String getIpAddress()\n\t{\n\t\t/* TODO: The IP address returned is in this format: /127.0.0.1:9845\n\t\t * Rewrite to remove the unnessecary data. */\n\t\treturn getSession().getIpAddress();\n\t}", "int getS1Ip();", "@Override\r\n public String getIPAddress() {\r\n return address;\r\n }", "@Nullable public abstract String ipAddress();", "public static String ipAddress() {\r\n String _ipaddress=\"\";\r\n InetAddress _address=null;\r\n \r\n try {\r\n _address=InetAddress.getLocalHost();\r\n _ipaddress=_address.getHostAddress();\r\n }\r\n catch (Exception ex) {\r\n throw new RuntimeException(ex.getMessage());\r\n }\r\n \r\n if (_address!=null) {\r\n _address=null; System.gc();\r\n }\r\n \r\n return _ipaddress;\r\n }", "String getRemoteAddr();", "private void print_addr() {\n try(final DatagramSocket socket = new DatagramSocket()){\n socket.connect(InetAddress.getByName(\"8.8.8.8\"), 10002);\n System.out.println(socket.getLocalAddress().getHostAddress()+\":\"+port);\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n }", "public static native short getRemoteInterfaceAddress(Remote remoteObj, byte interfaceIndex);", "public InternetAddress getFromAddress();", "public InetAddress getInetAddress()\n {\n return addr;\n }", "@NotNull\n InetAddress getAddress();", "private String lookup_ip (String host) throws LookupException\n , NameServerContactException{\n return lookup(host)[0];\n }", "public SocketAddress getLocalSocketAddress() {\n if (state >= BOUND)\n return new InetSocketAddress (localAddr, localPort);\n else\n return null;\n }", "public LocalSocketAddress getSockAddress() throws IOException {\n // This method has never been implemented.\n return null;\n }", "abstract String getRemoteAddress();", "@Test\n public void shouldGetHostAddress() {\n assertEquals(NE_IP, session.getAddress().getHostAddress());\n }", "public static String getIPAddress(boolean useIPv4) throws SocketException{\n List<NetworkInterface> interfaces = Collections.list(NetworkInterface.getNetworkInterfaces());\n for (NetworkInterface netInterface : interfaces) {\n List<InetAddress> addressList = Collections.list(netInterface.getInetAddresses());\n for (InetAddress address : addressList) {\n if (!address.isLoopbackAddress()) {\n String addressString = address.getHostAddress();\n boolean isIPv4 = addressString.indexOf(':') < 0;\n if (useIPv4) {\n if (isIPv4)\n return addressString;\n } else {\n if (!isIPv4) {\n int delim = addressString.indexOf('%'); // drop ip6 zone suffix\n return delim < 0 ? addressString.toUpperCase() : addressString.substring(0, delim).toUpperCase();\n }\n }\n }\n }\n }\n return \"\";\n }", "public String getInternalAddress();", "public InetAddress getSuggestedExternalIpAddress() {\n return suggestedExternalIpAddress;\n }", "public String getIP() {\n return this.IP;\n }", "java.lang.String getSnIp();", "java.lang.String getSnIp();", "public String getIP() throws Exception {\n this.IPAddress = \"http://192.168.1.15\";\n return this.IPAddress;\n }", "public java.lang.String getIp(){\r\n return localIp;\r\n }", "public java.lang.String getIp(){\r\n return localIp;\r\n }" ]
[ "0.73864555", "0.72882015", "0.7210132", "0.71562994", "0.715147", "0.71273005", "0.71200216", "0.7068365", "0.7068365", "0.7042978", "0.7011483", "0.7011483", "0.7011483", "0.70065725", "0.69613254", "0.6960397", "0.6959962", "0.6959407", "0.69417965", "0.6937664", "0.69267136", "0.69267136", "0.69267136", "0.69267136", "0.69267136", "0.69267136", "0.69267136", "0.69267136", "0.68995327", "0.6891802", "0.6881824", "0.68777853", "0.6870663", "0.6870663", "0.68575424", "0.6818926", "0.68045", "0.6803765", "0.6803765", "0.6783213", "0.6771921", "0.6754342", "0.6734984", "0.67203736", "0.6711091", "0.6694039", "0.66859585", "0.66687703", "0.6668463", "0.6660047", "0.6649027", "0.6648719", "0.66331726", "0.65774226", "0.65726554", "0.6564408", "0.6556524", "0.65331864", "0.65253466", "0.6514203", "0.6508629", "0.650324", "0.6503209", "0.6485735", "0.6477927", "0.64532006", "0.64491296", "0.64478874", "0.6441328", "0.64135486", "0.64091647", "0.6399853", "0.6391063", "0.6383114", "0.63807", "0.63805354", "0.6379908", "0.6377011", "0.63763726", "0.63718796", "0.6362512", "0.6361769", "0.63385856", "0.63214594", "0.63175154", "0.63146985", "0.6314638", "0.6308991", "0.6305328", "0.62965703", "0.6294924", "0.6288802", "0.62833256", "0.6278943", "0.62788343", "0.6269685", "0.6257866", "0.6257866", "0.6249473", "0.6248896", "0.6248896" ]
0.0
-1
gets the imei of the device
public String imei() { TelephonyManager telephonyManager = (TelephonyManager) activity .getSystemService(Context.TELEPHONY_SERVICE); return telephonyManager.getDeviceId(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void get_IMEI(){\n TelephonyManager mngr = (TelephonyManager) getSystemService(this.TELEPHONY_SERVICE);\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n mngr.getDeviceId();\n }", "public String getImei() {\n //NOTE \"imei\" is the \"Device ID\" since it represents the IMEI in GSM and the MEID in CDMA\n // return mPhone.getPhoneName().equals(\"CDMA\") ? mPhone.getMeid() : mPhone.getDeviceId();\n return \"\";\n }", "public String getIMEI() {\n return this.IMEI;\n }", "public void loadIMEI() {\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE)\n != PackageManager.PERMISSION_GRANTED) {\n if (ActivityCompat.shouldShowRequestPermissionRationale(this,\n Manifest.permission.READ_PHONE_STATE)) {\n// get_imei_data();\n } else {\n ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_PHONE_STATE},\n MY_PERMISSIONS_REQUEST_READ_PHONE_STATE);\n }\n } else {\n\n TelephonyManager mngr = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);\n mImei.setText(mngr.getDeviceId());\n }\n }", "public static String getPhoneIMEI(Context context) {\n TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);\n return telephonyManager.getDeviceId();\n }", "public String getImei() {\n return imei;\n }", "public String getImei() {\n return imei;\n }", "public String getImsi() {\r\n return imsi;\r\n }", "@SuppressLint(\"HardwareIds\")\n public static String getDeviceImei(Context ctx) {\n try {\n TelephonyManager telephonyManager = (TelephonyManager) ctx.getSystemService(Context.TELEPHONY_SERVICE);\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n if (ctx.checkSelfPermission(Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) {\n String android_id = Settings.Secure.getString(ctx.getContentResolver(),\n Settings.Secure.ANDROID_ID);\n Log.e(\"\", \"\" + \"permissionDenied\");\n return android_id;\n }\n }\n\n String deviceUniqueIdentifier = null;\n if (null != telephonyManager) {\n if (Build.VERSION.SDK_INT >= 26) {\n deviceUniqueIdentifier = telephonyManager.getImei();\n } else {\n deviceUniqueIdentifier = telephonyManager.getDeviceId();\n }\n }\n if (null == deviceUniqueIdentifier || 0 == deviceUniqueIdentifier.length()) {\n deviceUniqueIdentifier = Settings.Secure.getString(ctx.getContentResolver(), Settings.Secure.ANDROID_ID);\n }\n return deviceUniqueIdentifier;\n\n } catch (Exception e) {\n e.printStackTrace();\n return \"\";\n }\n }", "public static String getIMEI(Context context) {\n\n return Settings.Secure.getString(context.getContentResolver(),\n Settings.Secure.ANDROID_ID);\n\n }", "@Override\r\n\tpublic String getImei() {\n\t\treturn this.imei;\r\n\t}", "public String getDeviceId() {\n String info = \"\";\n try {\n Uri queryurl = Uri.parse(REGINFO_URL + CHUNLEI_ID);\n ContentResolver resolver = mContext.getContentResolver();\n info = resolver.getType(queryurl);\n if (null == info && null != mContext) {\n info = getIMEI();\n }\n if (null == info) {\n info = \"\";\n }\n } catch (Exception e) {\n System.out.println(\"in or out strean exception\");\n }\n return info;\n }", "public void setIMEI(String IMEI) {\n this.IMEI = IMEI;\n }", "public static Object getImei() {\n\t\treturn null;\n\t}", "public static String getImei() {\n\t\treturn null;\n\t}", "@Override\n public void getMosIMEIAndId(String IMEI,\n String sourceId) {\n MyLog.log(\"IMEI::\" + IMEI);\n Message message = handler.obtainMessage();\n message.obj = \"IMEI::\" + IMEI + \"\\n\" + \"sourceID:\\n\" + sourceId;\n message.what = 8;\n handler.sendMessage(message);\n\n }", "public static void setImei(Object imei) {\n\t\t\n\t}", "private String getMobileIP(){\n try {\n for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces();\n en.hasMoreElements();) {\n NetworkInterface networkinterface = en.nextElement();\n for (Enumeration<InetAddress> enumIpAddr = networkinterface.getInetAddresses(); enumIpAddr.hasMoreElements();) {\n InetAddress inetAddress = enumIpAddr.nextElement();\n if (!inetAddress.isLoopbackAddress()) {\n return inetAddress.getHostAddress().toString();\n }\n }\n }\n } catch (Exception ex) {\n Log.e(\"Current IP\", ex.toString());\n }\n return null;\n }", "public String getUnknownIota() {\n return _unknownIota ;\n }", "public int getICID() {\n return icid;\n }", "public static String m582i() {\r\n try {\r\n Class cls = Class.forName(\"android.os.SystemProperties\");\r\n Object newInstance = cls.newInstance();\r\n return (String) cls.getMethod(\"get\", new Class[]{String.class, String.class}).invoke(newInstance, new Object[]{\"gsm.version.baseband\", \"no message\"});\r\n } catch (Exception e) {\r\n return null;\r\n }\r\n }", "public String getImie() {\n return this.imie;\n }", "public int getiid(){\r\n return Iid;\r\n }", "Integer getDeviceId();", "private static String m4387a() {\n String str;\n String str2 = \"\";\n try {\n Class cls = Class.forName(\"android.os.SystemProperties\");\n Method method = cls.getMethod(\"get\", new Class[]{String.class});\n if (method != null) {\n if (((String) method.invoke(cls.newInstance(), new Object[]{\"telephony.lteOnCdmaDevice\"})).equals(\"1\")) {\n Method method2 = Class.forName(\"com.huawei.android.hwnv.HWNVFuncation\").getMethod(\"getNVIMEI\", new Class[0]);\n if (method2 == null) {\n return str2;\n }\n method2.setAccessible(true);\n str = (String) method2.invoke(null, new Object[0]);\n return str;\n }\n }\n } catch (Throwable th) {\n }\n str = str2;\n return str;\n }", "public java.lang.String getImo() {\n\t\treturn _tempNoTiceShipMessage.getImo();\n\t}", "public int getNmi(){\n return nmi;\n }", "public String getEmoticonId()\n {\n return emoticonId;\n }", "public String getOkulIsmi() {\n\t\t\n\t\t\n\t\treturn okulIsmi;\n\t}", "public gov.nih.nlm.ncbi.www.SeqIdDocument.SeqId.Giim getGiim()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n gov.nih.nlm.ncbi.www.SeqIdDocument.SeqId.Giim target = null;\r\n target = (gov.nih.nlm.ncbi.www.SeqIdDocument.SeqId.Giim)get_store().find_element_user(GIIM$6, 0);\r\n if (target == null)\r\n {\r\n return null;\r\n }\r\n return target;\r\n }\r\n }", "public String getIID();", "public int getM_InOut_ID();", "public String mo729c() throws RemoteException {\n Parcel obtain = Parcel.obtain();\n Parcel obtain2 = Parcel.obtain();\n try {\n obtain.writeInterfaceToken(\"android.support.v4.media.session.IMediaSession\");\n this.f822a.transact(7, obtain, obtain2, 0);\n obtain2.readException();\n return obtain2.readString();\n } finally {\n obtain2.recycle();\n obtain.recycle();\n }\n }", "private double getMMI() {\n\t\tdouble pgv, pga;\n\t\tString S = \".getMMI()\";\n\n\t\t// get PGA\n\t\tcoeffBJF = (BJF_1997_AttenRelCoefficients) coefficientsBJF.get(PGA_Param.NAME);\n\t\tcoeffSM = (BJF_1997_AttenRelCoefficients) coefficientsSM.get(PGA_Param.NAME);\n\t\tdouble b_pga = getRockMean();\n\t\tpga = b_pga + Math.log(getAmpFactor(PGA_Param.NAME));\n\t\t// Convert to linear domain\n\t\tpga = Math.exp(pga);\n\n\t\tif (D) {\n\t\t\tSystem.out.println(C + S + \" pga = \" + (float) pga);\n\t\t}\n\n\t\t// get PGV\n\t\tcoeffBJF = (BJF_1997_AttenRelCoefficients) coefficientsBJF.get(PGV_Param.NAME);\n\t\tcoeffSM = (BJF_1997_AttenRelCoefficients) coefficientsSM.get(PGV_Param.NAME);\n\t\tdouble b_pgv = getRockMean();\n\t\tpgv = b_pgv + Math.log(getAmpFactor(PGV_Param.NAME));\n\t\t// Convert to linear domain (what's needed below)\n\t\tpgv = Math.exp(pgv);\n\n\t\tif (D) {\n\t\t\tSystem.out.println(\" pgv = \" + (float) pgv);\n\t\t}\n\n\t\treturn Wald_MMI_Calc.getMMI(pga, pgv);\n\n\t}", "public AIDLInterface getInterface()\n\t{\n\t\t//System.out.println(\"---- mInterface -----\" + mInterface);\n\t\treturn mInterface;\n\t}", "public String getInterface () throws SDLIPException {\r\n XMLObject theInterface = new sdlip.xml.dom.XMLObject();\r\n tm.getInterface(theInterface);\r\n //return postProcess (theInterface, \"SDLIPInterface\", false);\r\n return theInterface.getString();\r\n }", "public static java.util.Map<java.lang.String, java.lang.String> getImeiAndMeid() {\n /*\n java.lang.String r0 = \"PhoneInfoUtil\"\n java.util.HashMap r1 = new java.util.HashMap\n r1.<init>()\n r2 = 0\n java.lang.StringBuilder r3 = new java.lang.StringBuilder // Catch:{ SecurityException -> 0x017c, all -> 0x0170 }\n r3.<init>() // Catch:{ SecurityException -> 0x017c, all -> 0x0170 }\n java.lang.String r4 = \"android api: \"\n r3.append(r4) // Catch:{ SecurityException -> 0x017c, all -> 0x0170 }\n int r4 = android.os.Build.VERSION.SDK_INT // Catch:{ SecurityException -> 0x017c, all -> 0x0170 }\n r3.append(r4) // Catch:{ SecurityException -> 0x017c, all -> 0x0170 }\n java.lang.String r4 = \"\\n\"\n r3.append(r4) // Catch:{ SecurityException -> 0x017c, all -> 0x0170 }\n java.lang.String r3 = r3.toString() // Catch:{ SecurityException -> 0x017c, all -> 0x0170 }\n com.tencent.p605ep.commonbase.api.Log.m31483i(r0, r3) // Catch:{ SecurityException -> 0x017c, all -> 0x0170 }\n android.content.Context r3 = com.tencent.p605ep.commonbase.api.AppContext.getAppContext() // Catch:{ SecurityException -> 0x017c, all -> 0x0170 }\n java.lang.String r4 = \"phone\"\n java.lang.Object r3 = r3.getSystemService(r4) // Catch:{ SecurityException -> 0x017c, all -> 0x0170 }\n android.telephony.TelephonyManager r3 = (android.telephony.TelephonyManager) r3 // Catch:{ SecurityException -> 0x017c, all -> 0x0170 }\n int r4 = android.os.Build.VERSION.SDK_INT // Catch:{ SecurityException -> 0x017c, all -> 0x0170 }\n r5 = 21\n if (r4 >= r5) goto L_0x0039\n r4 = r2\n r8 = r4\n goto L_0x0182\n L_0x0039:\n int r4 = android.os.Build.VERSION.SDK_INT // Catch:{ SecurityException -> 0x017c, all -> 0x0170 }\n r5 = 26\n r6 = 0\n r7 = 1\n if (r4 >= r5) goto L_0x00b3\n java.lang.String r4 = r3.getDeviceId(r6) // Catch:{ SecurityException -> 0x017c, all -> 0x0170 }\n boolean r5 = android.text.TextUtils.isEmpty(r4) // Catch:{ SecurityException -> 0x017c, all -> 0x0170 }\n r6 = 14\n if (r5 != 0) goto L_0x0059\n int r5 = r4.length() // Catch:{ SecurityException -> 0x017c, all -> 0x0170 }\n if (r5 != r6) goto L_0x0056\n r5 = r2\n r8 = r4\n goto L_0x005b\n L_0x0056:\n r8 = r2\n r5 = r4\n goto L_0x005b\n L_0x0059:\n r5 = r2\n r8 = r5\n L_0x005b:\n java.lang.StringBuilder r9 = new java.lang.StringBuilder // Catch:{ SecurityException -> 0x00ae, all -> 0x00a9 }\n r9.<init>() // Catch:{ SecurityException -> 0x00ae, all -> 0x00a9 }\n java.lang.String r10 = \"\\ngetDeviceId(0): \"\n r9.append(r10) // Catch:{ SecurityException -> 0x00ae, all -> 0x00a9 }\n r9.append(r4) // Catch:{ SecurityException -> 0x00ae, all -> 0x00a9 }\n java.lang.String r4 = r9.toString() // Catch:{ SecurityException -> 0x00ae, all -> 0x00a9 }\n com.tencent.p605ep.commonbase.api.Log.m31483i(r0, r4) // Catch:{ SecurityException -> 0x00ae, all -> 0x00a9 }\n java.lang.String r3 = r3.getDeviceId(r7) // Catch:{ SecurityException -> 0x00ae, all -> 0x00a9 }\n boolean r4 = android.text.TextUtils.isEmpty(r3) // Catch:{ SecurityException -> 0x00ae, all -> 0x00a9 }\n if (r4 != 0) goto L_0x0084\n int r4 = r3.length() // Catch:{ SecurityException -> 0x00ae, all -> 0x00a9 }\n if (r4 != r6) goto L_0x0082\n r4 = r2\n r8 = r3\n goto L_0x0085\n L_0x0082:\n r4 = r3\n goto L_0x0085\n L_0x0084:\n r4 = r2\n L_0x0085:\n java.lang.StringBuilder r6 = new java.lang.StringBuilder // Catch:{ SecurityException -> 0x00a7, all -> 0x00a5 }\n r6.<init>() // Catch:{ SecurityException -> 0x00a7, all -> 0x00a5 }\n java.lang.String r7 = \"\\ngetDeviceId(1): \"\n r6.append(r7) // Catch:{ SecurityException -> 0x00a7, all -> 0x00a5 }\n r6.append(r3) // Catch:{ SecurityException -> 0x00a7, all -> 0x00a5 }\n java.lang.String r3 = r6.toString() // Catch:{ SecurityException -> 0x00a7, all -> 0x00a5 }\n com.tencent.p605ep.commonbase.api.Log.m31483i(r0, r3) // Catch:{ SecurityException -> 0x00a7, all -> 0x00a5 }\n boolean r3 = android.text.TextUtils.equals(r5, r4) // Catch:{ SecurityException -> 0x00a7, all -> 0x00a5 }\n if (r3 == 0) goto L_0x00a2\n r4 = r8\n goto L_0x0146\n L_0x00a2:\n r2 = r5\n goto L_0x0182\n L_0x00a5:\n r3 = move-exception\n goto L_0x00ab\n L_0x00a7:\n r3 = move-exception\n goto L_0x00b0\n L_0x00a9:\n r3 = move-exception\n r4 = r2\n L_0x00ab:\n r2 = r5\n goto L_0x0173\n L_0x00ae:\n r3 = move-exception\n r4 = r2\n L_0x00b0:\n r2 = r5\n goto L_0x017f\n L_0x00b3:\n java.lang.Class r4 = r3.getClass() // Catch:{ SecurityException -> 0x017c, all -> 0x0170 }\n java.lang.String r5 = \"getMeid\"\n java.lang.Class[] r8 = new java.lang.Class[r7] // Catch:{ SecurityException -> 0x017c, all -> 0x0170 }\n java.lang.Class r9 = java.lang.Integer.TYPE // Catch:{ SecurityException -> 0x017c, all -> 0x0170 }\n r8[r6] = r9 // Catch:{ SecurityException -> 0x017c, all -> 0x0170 }\n java.lang.reflect.Method r4 = r4.getMethod(r5, r8) // Catch:{ SecurityException -> 0x017c, all -> 0x0170 }\n r4.setAccessible(r7) // Catch:{ SecurityException -> 0x017c, all -> 0x0170 }\n java.lang.Object[] r5 = new java.lang.Object[r7] // Catch:{ SecurityException -> 0x017c, all -> 0x0170 }\n java.lang.Integer r8 = java.lang.Integer.valueOf(r6) // Catch:{ SecurityException -> 0x017c, all -> 0x0170 }\n r5[r6] = r8 // Catch:{ SecurityException -> 0x017c, all -> 0x0170 }\n java.lang.Object r4 = r4.invoke(r3, r5) // Catch:{ SecurityException -> 0x017c, all -> 0x0170 }\n java.lang.String r4 = (java.lang.String) r4 // Catch:{ SecurityException -> 0x017c, all -> 0x0170 }\n java.lang.StringBuilder r5 = new java.lang.StringBuilder // Catch:{ SecurityException -> 0x016c, all -> 0x0168 }\n r5.<init>() // Catch:{ SecurityException -> 0x016c, all -> 0x0168 }\n java.lang.String r8 = \"\\napi 26+, meid: \"\n r5.append(r8) // Catch:{ SecurityException -> 0x016c, all -> 0x0168 }\n r5.append(r4) // Catch:{ SecurityException -> 0x016c, all -> 0x0168 }\n java.lang.String r5 = r5.toString() // Catch:{ SecurityException -> 0x016c, all -> 0x0168 }\n com.tencent.p605ep.commonbase.api.Log.m31483i(r0, r5) // Catch:{ SecurityException -> 0x016c, all -> 0x0168 }\n java.lang.Class r5 = r3.getClass() // Catch:{ SecurityException -> 0x016c, all -> 0x0168 }\n java.lang.String r8 = \"getImei\"\n java.lang.Class[] r9 = new java.lang.Class[r7] // Catch:{ SecurityException -> 0x016c, all -> 0x0168 }\n java.lang.Class r10 = java.lang.Integer.TYPE // Catch:{ SecurityException -> 0x016c, all -> 0x0168 }\n r9[r6] = r10 // Catch:{ SecurityException -> 0x016c, all -> 0x0168 }\n java.lang.reflect.Method r5 = r5.getMethod(r8, r9) // Catch:{ SecurityException -> 0x016c, all -> 0x0168 }\n r5.setAccessible(r7) // Catch:{ SecurityException -> 0x016c, all -> 0x0168 }\n java.lang.Object[] r8 = new java.lang.Object[r7] // Catch:{ SecurityException -> 0x016c, all -> 0x0168 }\n java.lang.Integer r9 = java.lang.Integer.valueOf(r6) // Catch:{ SecurityException -> 0x016c, all -> 0x0168 }\n r8[r6] = r9 // Catch:{ SecurityException -> 0x016c, all -> 0x0168 }\n java.lang.Object r8 = r5.invoke(r3, r8) // Catch:{ SecurityException -> 0x016c, all -> 0x0168 }\n java.lang.String r8 = (java.lang.String) r8 // Catch:{ SecurityException -> 0x016c, all -> 0x0168 }\n java.lang.Object[] r9 = new java.lang.Object[r7] // Catch:{ SecurityException -> 0x0162, all -> 0x015c }\n java.lang.Integer r7 = java.lang.Integer.valueOf(r7) // Catch:{ SecurityException -> 0x0162, all -> 0x015c }\n r9[r6] = r7 // Catch:{ SecurityException -> 0x0162, all -> 0x015c }\n java.lang.Object r3 = r5.invoke(r3, r9) // Catch:{ SecurityException -> 0x0162, all -> 0x015c }\n java.lang.String r3 = (java.lang.String) r3 // Catch:{ SecurityException -> 0x0162, all -> 0x015c }\n java.lang.StringBuilder r5 = new java.lang.StringBuilder // Catch:{ SecurityException -> 0x0155, all -> 0x014e }\n r5.<init>() // Catch:{ SecurityException -> 0x0155, all -> 0x014e }\n java.lang.String r6 = \"\\napi 26+, imei1: \"\n r5.append(r6) // Catch:{ SecurityException -> 0x0155, all -> 0x014e }\n r5.append(r8) // Catch:{ SecurityException -> 0x0155, all -> 0x014e }\n java.lang.String r5 = r5.toString() // Catch:{ SecurityException -> 0x0155, all -> 0x014e }\n com.tencent.p605ep.commonbase.api.Log.m31483i(r0, r5) // Catch:{ SecurityException -> 0x0155, all -> 0x014e }\n java.lang.StringBuilder r5 = new java.lang.StringBuilder // Catch:{ SecurityException -> 0x0155, all -> 0x014e }\n r5.<init>() // Catch:{ SecurityException -> 0x0155, all -> 0x014e }\n java.lang.String r6 = \"\\napi 26+, imei2: \"\n r5.append(r6) // Catch:{ SecurityException -> 0x0155, all -> 0x014e }\n r5.append(r3) // Catch:{ SecurityException -> 0x0155, all -> 0x014e }\n java.lang.String r5 = r5.toString() // Catch:{ SecurityException -> 0x0155, all -> 0x014e }\n com.tencent.p605ep.commonbase.api.Log.m31483i(r0, r5) // Catch:{ SecurityException -> 0x0155, all -> 0x014e }\n boolean r5 = android.text.TextUtils.equals(r8, r3) // Catch:{ SecurityException -> 0x0155, all -> 0x014e }\n if (r5 == 0) goto L_0x014a\n r5 = r8\n L_0x0146:\n r8 = r4\n r4 = r2\n goto L_0x00a2\n L_0x014a:\n r2 = r8\n r8 = r4\n r4 = r3\n goto L_0x0182\n L_0x014e:\n r2 = move-exception\n r11 = r3\n r3 = r2\n r2 = r8\n r8 = r4\n r4 = r11\n goto L_0x0173\n L_0x0155:\n r2 = move-exception\n r11 = r3\n r3 = r2\n r2 = r8\n r8 = r4\n r4 = r11\n goto L_0x017f\n L_0x015c:\n r3 = move-exception\n r11 = r4\n r4 = r2\n r2 = r8\n r8 = r11\n goto L_0x0173\n L_0x0162:\n r3 = move-exception\n r11 = r4\n r4 = r2\n r2 = r8\n r8 = r11\n goto L_0x017f\n L_0x0168:\n r3 = move-exception\n r8 = r4\n r4 = r2\n goto L_0x0173\n L_0x016c:\n r3 = move-exception\n r8 = r4\n r4 = r2\n goto L_0x017f\n L_0x0170:\n r3 = move-exception\n r4 = r2\n r8 = r4\n L_0x0173:\n r3.printStackTrace()\n java.lang.String r5 = \"getImeiAndMeid\"\n com.tencent.p605ep.commonbase.api.Log.m31488w(r0, r5, r3)\n goto L_0x0182\n L_0x017c:\n r3 = move-exception\n r4 = r2\n r8 = r4\n L_0x017f:\n r3.printStackTrace()\n L_0x0182:\n boolean r3 = android.text.TextUtils.isEmpty(r8)\n if (r3 != 0) goto L_0x018d\n java.lang.String r3 = \"meid\"\n r1.put(r3, r8)\n L_0x018d:\n boolean r3 = android.text.TextUtils.isEmpty(r2)\n if (r3 != 0) goto L_0x0198\n java.lang.String r3 = \"imei1\"\n r1.put(r3, r2)\n L_0x0198:\n boolean r3 = android.text.TextUtils.isEmpty(r4)\n if (r3 != 0) goto L_0x01a3\n java.lang.String r3 = \"imei2\"\n r1.put(r3, r4)\n L_0x01a3:\n java.lang.StringBuilder r3 = new java.lang.StringBuilder\n r3.<init>()\n java.lang.String r5 = \"meid: \"\n r3.append(r5)\n r3.append(r8)\n java.lang.String r3 = r3.toString()\n com.tencent.p605ep.commonbase.api.Log.m31483i(r0, r3)\n java.lang.StringBuilder r3 = new java.lang.StringBuilder\n r3.<init>()\n java.lang.String r5 = \"imei1: \"\n r3.append(r5)\n r3.append(r2)\n java.lang.String r2 = r3.toString()\n com.tencent.p605ep.commonbase.api.Log.m31483i(r0, r2)\n java.lang.StringBuilder r2 = new java.lang.StringBuilder\n r2.<init>()\n java.lang.String r3 = \"imei2: \"\n r2.append(r3)\n r2.append(r4)\n java.lang.String r2 = r2.toString()\n com.tencent.p605ep.commonbase.api.Log.m31483i(r0, r2)\n return r1\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.tencent.p605ep.commonbase.utils.PhoneInfoUtil.getImeiAndMeid():java.util.Map\");\n }", "public String getIpa() {\n return ipa;\n }", "NetworkInterface getNetworkInterface(int id);", "public String getUserMi() {\n return userMi;\n }", "protected int getCurrentIfd() {\n return mIfdType;\n }", "private BNO055IMU.Parameters getIMUParameters(){\n BNO055IMU.Parameters parameters = new BNO055IMU.Parameters();\n parameters.angleUnit = BNO055IMU.AngleUnit.DEGREES;\n parameters.accelUnit = BNO055IMU.AccelUnit.METERS_PERSEC_PERSEC;\n parameters.calibrationDataFile = \"BNO055IMUCalibration.json\"; // see the calibration sample opmode\n parameters.loggingEnabled = true;\n parameters.loggingTag = \"IMU\";\n parameters.accelerationIntegrationAlgorithm = new JustLoggingAccelerationIntegrator();\n parameters.mode = BNO055IMU.SensorMode.IMU;\n\n return parameters;\n }", "public String setImie(String i) {\n return this.imie = i;\n }", "public void setupIMU() {\n // Initalize IMU\n BNO055IMU.Parameters parameters = new BNO055IMU.Parameters();\n\n parameters.mode = BNO055IMU.SensorMode.IMU;\n parameters.angleUnit = BNO055IMU.AngleUnit.DEGREES;\n parameters.accelUnit = BNO055IMU.AccelUnit.METERS_PERSEC_PERSEC;\n parameters.calibrationDataFile = \"BNO055IMUCalibration.json\";\n parameters.loggingEnabled = false;\n\n // Retrieve and initialize the IMU. We expect the IMU to be attached to an I2C port\n // on a Core Device Interface Module, configured to be a sensor of type \"AdaFruit IMU\",\n // and named \"imu\".\n imu = hardwareMap.get(BNO055IMU.class, \"imu\");\n\n imu.initialize(parameters);\n\n\n // Set PID proportional value to start reducing power at about 50 degrees of rotation.\n pidRotate = new PIDController(.005, 0, 0); // Kp was 0 1/24/19\n\n // Set PID proportional value to produce non-zero correction value when robot veers off\n // straight line. P value controls how sensitive the correction is.\n pidDrive = new PIDController(0.02, 0, 0); // Kp was .02 1/24/19\n\n telemetry.addData(\"Mode\", \"calibrating IMU.....\");\n telemetry.update();\n\n // make sure the imu gyro is calibrated before continuing.\n while (!isStopRequested() && !imu.isGyroCalibrated()) {\n sleep(50);\n idle();\n }\n\n telemetry.addData(\"Mode\", \"waiting for start\");\n telemetry.addData(\"imu calib status\", imu.getCalibrationStatus().toString());\n telemetry.update();\n }", "public void loadIMEI() {\n // Check if the READ_PHONE_STATE permission is already available.\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE)\n != PackageManager.PERMISSION_GRANTED) {\n // READ_PHONE_STATE permission has not been granted.\n requestReadPhoneStatePermission();\n } else {\n // READ_PHONE_STATE permission is already been granted.\n doPermissionGrantedStuffs();\n }\n }", "public IIID getAccessIID()\n throws ORIOException;", "DeviceId deviceId();", "DeviceId deviceId();", "public long getI() {\n return i;\n }", "public String getItime() {\n return itime;\n }", "private static DeviceId getDeviceId(int i) {\n return DeviceId.deviceId(\"\" + i);\n }", "public String getIvaMFlag() {\n return (String) getAttributeInternal(IVAMFLAG);\n }", "public final long getUIN() {\n\t return icqUIN;\n }", "public boolean isDeviceIdentifierIMEINoFieldPresent() {\r\n\t\treturn isElementPresent(vehicleNameField.replace(\"vehicle_name\", \"imei\"), SHORTWAIT);\r\n\t}", "public Image getImagenI() {\n return animacion.getImagen().getImage();\n }", "public FSIcon getIcon() {\n return icon;\n }", "public MPPS getMppsI() {\n\t\treturn mppsI;\n\t}", "public int getInKpiId() {\n return inKpiId;\n }", "public int getInKpiId() {\n return inKpiId;\n }", "java.lang.String getDeviceId();", "public byte getIManufacturer() {\r\n\t\treturn iManufacturer;\r\n\t}", "public byte[] getIntegrateInterfaceInfo() {\n return integrateInterfaceInfo;\n }", "public void setImei(String imei) {\n this.imei = imei == null ? null : imei.trim();\n }", "public void setImei(String imei) {\n this.imei = imei == null ? null : imei.trim();\n }", "long getI();", "public interface IRobotDeviceRequest {\n\n /**\n * Returns the device name.\n * \n * @return the device name\n */\n String getDeviceName();\n\n /**\n * Returns the priority of the request.\n * \n * @return the priority of the request\n */\n int getPriority();\n\n /**\n * Returns the time-stamp of this request.\n * \n * @return the time-stamp of this request\n */\n long getTimeStamp();\n\n /**\n * Uid to differentiate the device requests.\n * \n * @return\n */\n long getUID();\n}", "public void updateIM(){\n \n }", "public VmNetworkInterface getNetworkInterface(XmlNode node) {\n // prior to 3.0 the instanceId is int , in 3.1 and on this is Guid\n String str = node.SelectSingleNode(\"rasd:InstanceId\", _xmlNS).innerText;\n final Guid guid;\n VmNetworkInterface iface;\n if (!StringUtils.isNumeric(str)) { // 3.1 and above OVF format\n guid = new Guid(str);\n iface = LinqUtils.firstOrNull(interfaces, new Predicate<VmNetworkInterface>() {\n @Override\n public boolean eval(VmNetworkInterface iface) {\n return iface.getId().equals(guid);\n }\n });\n if (iface == null) {\n iface = new VmNetworkInterface();\n iface.setId(guid);\n }\n } else { // 3.0 and below OVF format\n iface = new VmNetworkInterface();\n }\n return iface;\n }", "public String getDeviceIp(){\n\t return deviceIP;\n }", "private String getDeviceID() {\n try {\n TelephonyManager telephonyManager;\n\n telephonyManager =\n (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);\n\n /*\n * getDeviceId() function Returns the unique device ID.\n * for example,the IMEI for GSM and the MEID or ESN for CDMA phones.\n */\n return telephonyManager.getDeviceId();\n }catch(SecurityException e){\n return null;\n }\n }", "public void setImsi(String imsi) {\r\n this.imsi = imsi == null ? null : imsi.trim();\r\n }", "private void getMidiReceiver() {\n\n final MidiDevice.Info[] midiDeviceInfo = MidiSystem.getMidiDeviceInfo();\n MidiDevice midiDevice;\n this.midiReceiver = null;\n\n //Loop each midi device info\n for (final MidiDevice.Info i : midiDeviceInfo) {\n //Find piano app\n if (i.toString().equals((\"PianoApp\"))) {\n //Try to get the receiver\n try {\n midiDevice = MidiSystem.getMidiDevice(i);\n midiDevice.open();\n this.midiReceiver = midiDevice.getReceiver();\n } catch (final MidiUnavailableException ignored) {\n }\n }\n }\n if (this.midiReceiver == null) {\n System.err.println(\"Could not get Midi Receiver\");\n }\n }", "public WsmSimcardIdentifier getIdentificadorSimcardByImsi(String imsi)\r\n\t{\r\n\t\t// Nova instancia do WsmSimcardIdentifier, ja com os parametros informados\r\n\t\tWsmSimcardIdentifier identificadorSimcard = new WsmSimcardIdentifier(imsi, WsmSimcardIdentifier.SIM_TYPE_IMSI);\r\n\t\t\r\n\t\t// Retorno do objeto\r\n\t\treturn identificadorSimcard;\r\n\t}", "public int mo560i() throws RemoteException {\r\n return this.f1765i;\r\n }", "public double getIm() {\n\t\treturn im;\n\t}", "private String getCurrentInstanceId() throws IOException {\n String macAddress = CommonUtils.toHexString(RuntimeUtils.getLocalMacAddress());\n // 16 chars - workspace ID\n String workspaceId = DBWorkbench.getPlatform().getWorkspace().getWorkspaceId();\n if (workspaceId.length() > 16) {\n workspaceId = workspaceId.substring(0, 16);\n }\n\n StringBuilder id = new StringBuilder(36);\n id.append(macAddress);\n id.append(\":\").append(workspaceId).append(\":\");\n while (id.length() < 36) {\n id.append(\"X\");\n }\n return id.toString();\n }", "public static II getUUIDAsII() {\n\t\tII ii = new II();\n\t\tii.setValue( MiscUtility.getIDAsString() );\n\t\treturn ii;\n\t}", "public String getIccid() {\r\n return iccid;\r\n }", "@Override\r\n\tpublic double getIMC() throws Exception{\r\n\t\tdouble imc = getAnamnese().getPesoUsual()\r\n\t\t/ (anamnese.getAltura() * anamnese.getAltura());\r\n\t\tif(imc <=0 ){\r\n\t\t\tthrow new Exception(\"valor invalido\");\r\n\t\t}\r\n\t\r\n\t\treturn imc;\r\n\t}", "public static String getMobile(final IUser iUser) {\r\n try {\r\n return SecurityManagerFactory.getSecurityManager().executeAsSystem(new Callable<String>() {\r\n public String call() {\r\n try {\r\n return iUser.getProperty(UserUtils.MOBILE);\r\n } catch (Exception e) {\r\n Ivy.log().error(e);\r\n return null;\r\n }\r\n }\r\n });\r\n } catch (Exception e) {\r\n Ivy.log().error(e);\r\n return null;\r\n }\r\n }", "public String getDeviceId() {\n String deviceId = ((TelephonyManager) LoginActivity.this.getSystemService(Context.TELEPHONY_SERVICE)).getDeviceId();\n if (deviceId != null && !deviceId.equalsIgnoreCase(\"null\")) {\n // System.out.println(\"imei number :: \" + deviceId);\n return deviceId;\n }\n\n deviceId = android.os.Build.SERIAL;\n // System.out.println(\"serial id :: \" + deviceId);\n return deviceId;\n\n }", "public int getEmulationId() {\n\t\treturn (id);\n\t}", "public static String getNimbus() {\r\n return nimbus.getValue();\r\n }", "public java.lang.String getIban()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(IBAN$6, 0);\n if (target == null)\n {\n return null;\n }\n return target.getStringValue();\n }\n }", "@Override\n public NativeIM getNativeIM() {\n return null;\n }", "public static Object getIccid() {\n\t\treturn null;\n\t}", "public String getAmiId() {\n return this.amiId;\n }", "C0058i mo68a();", "public int getIconId(){\n return mIconId;\n }", "final int getDeviceNum() {\n return device.getDeviceNum();\n }", "public final C8562i<Bitmap> mo18677lI() {\n AppMethodBeat.m2504i(91657);\n C8562i a = new C8562i(this.awc, this, Bitmap.class, this.context).mo18670a(axk);\n AppMethodBeat.m2505o(91657);\n return a;\n }", "@DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:36:02.868 -0500\", hash_original_method = \"E552E8F41A6230395AD2464B82A88215\", hash_generated_method = \"B474121E171E0C15AB9C9C17C2686C0E\")\n \npublic static android.net.wifi.IWifiManager asInterface(android.os.IBinder obj)\n{\nif ((obj==null)) {\nreturn null;\n}\nandroid.os.IInterface iin = (android.os.IInterface)obj.queryLocalInterface(DESCRIPTOR);\nif (((iin!=null)&&(iin instanceof android.net.wifi.IWifiManager))) {\nreturn ((android.net.wifi.IWifiManager)iin);\n}\nreturn new android.net.wifi.IWifiManager.Stub.Proxy(obj);\n}", "public MidiDeviceDescriptor getMidiDevice();", "public IVA getIva() {\n return iva;\n }", "public static void saveIMEI(Context context, String imei) {\n SharedPreferences sharedPreferences = PreferenceManager\n .getDefaultSharedPreferences(context);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(GMSConstants.KEY_IMEI, imei);\n editor.apply();\n }", "private String getDeviceId() {\n String deviceId = telephonyManager.getDeviceId(); \n \n \n // \"generic\" means the emulator.\n if (deviceId == null || Build.DEVICE.equals(\"generic\")) {\n \t\n // This ID changes on OS reinstall/factory reset.\n deviceId = Secure.getString(context.getContentResolver(), Secure.ANDROID_ID);\n }\n \n return deviceId;\n }", "public String getEmoticonDynamic()\n {\n return emoticonDynamic;\n }", "private void getphoneinformaition() {\n\t\ttry {\n\t\t\tsoftVersion = this.getPackageManager().getPackageInfo(\n\t\t\t\t\tthis.getPackageName(), 0).versionName;\n\t\t} catch (NameNotFoundException e) {\n\t\t\tsoftVersion = \"NULL\";\n\t\t}\n\n\t\tif (Build.BRAND != null) {\n\t\t\tphoneBrand = Build.BRAND;\n\t\t}\n\t\tif (Build.MODEL != null) {\n\t\t\tphoneModel = Build.MODEL;\n\t\t}\n\t\tif (Build.VERSION.RELEASE != null) {\n\t\t\tphoneOs = Build.VERSION.RELEASE;\n\t\t}\n\n\t\ttry {\n\t\t\tDisplayMetrics metric = new DisplayMetrics();\n\t\t\tgetWindowManager().getDefaultDisplay().getMetrics(metric);\n\t\t\tint width = metric.widthPixels; // 屏幕宽度(像素)\n\t\t\tint height = metric.heightPixels; // 屏幕高度(像素)\n\t\t\tString w = String.valueOf(width);\n\t\t\tString h = String.valueOf(height);\n\t\t\tStringBuffer s = new StringBuffer();\n\t\t\ts.append(w);\n\t\t\ts.append(\"*\");\n\t\t\ts.append(h);\n\t\t\tphoneResolution = s.toString();\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tphoneResolution = \"NULL\";\n\t\t}\n\n\t\tFileLog.i(TAG, softVersion);\n\t\tFileLog.i(TAG, phoneBrand);\n\t\tFileLog.i(TAG, phoneModel);\n\t\tFileLog.i(TAG, phoneOs);\n\t\tFileLog.i(TAG, phoneResolution);\n\n\t}", "public byte[] getEmoticonDynamicByte()\n {\n return emoticonDynamicByte;\n }", "public static String getMobile(final ITask iTask) {\r\n if (iTask.getActivator().getSecurityContext() != null\r\n && iTask.getActivator().getSecurityContext().getUsers() != null\r\n && iTask.getActivator().getSecurityContext().getUsers().size() > 0) {\r\n try {\r\n return SecurityManagerFactory.getSecurityManager().executeAsSystem(new Callable<String>() {\r\n public String call() {\r\n try {\r\n String st = iTask.getActivator().getMemberName();\r\n List<IUser> l = iTask.getActivator().getSecurityContext().getUsers();\r\n for (IUser user : l) {\r\n if (st.equals(user.getMemberName())) {\r\n return user.getProperty(UserUtils.MOBILE);\r\n }\r\n }\r\n return st;\r\n } catch (Exception e) {\r\n Ivy.log().error(e);\r\n return null;\r\n }\r\n }\r\n });\r\n } catch (Exception e) {\r\n Ivy.log().error(e);\r\n return null;\r\n }\r\n } else {\r\n return null;\r\n }\r\n }" ]
[ "0.8005803", "0.7354297", "0.7162118", "0.7047383", "0.6891873", "0.68729466", "0.68729466", "0.6789419", "0.67550987", "0.6753435", "0.6655943", "0.65710735", "0.6451856", "0.6396647", "0.6380118", "0.6223235", "0.604865", "0.594917", "0.5902112", "0.58492875", "0.5836222", "0.58354753", "0.5811237", "0.5762654", "0.57623875", "0.5762177", "0.5739224", "0.57321495", "0.5718187", "0.57055926", "0.56795806", "0.56662", "0.56366336", "0.5603591", "0.5586717", "0.557397", "0.5562946", "0.5557864", "0.55334896", "0.553033", "0.5510337", "0.5508484", "0.5507296", "0.54991764", "0.5486142", "0.54761386", "0.5453287", "0.5453287", "0.54519933", "0.54385567", "0.5426795", "0.5403875", "0.5400641", "0.5361257", "0.53586984", "0.53578", "0.535531", "0.5354556", "0.5354556", "0.53501105", "0.533456", "0.5322503", "0.53218925", "0.53218925", "0.5317464", "0.53012615", "0.52961636", "0.52951556", "0.5290991", "0.5283931", "0.5277294", "0.5269866", "0.5266132", "0.5262842", "0.52622193", "0.52616805", "0.5261353", "0.52544653", "0.5250013", "0.52489346", "0.52463716", "0.5238457", "0.5223503", "0.5217957", "0.5214147", "0.5212944", "0.5212826", "0.5211785", "0.520905", "0.5209039", "0.52043104", "0.5204283", "0.51921874", "0.5191576", "0.51903284", "0.5183082", "0.5180531", "0.5178387", "0.5177575", "0.51691854" ]
0.7803887
1
gets the uuid of the device
public String uuid(){ String device_unique_id = Secure.getString(activity.getContentResolver(), Secure.ANDROID_ID); return device_unique_id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String getDeviceUUID(){\n BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();\n String uuid = adapter.getAddress();\n return uuid;\n }", "public UUID getDeviceUuid() {\n return uuid;\n }", "UUID getDeviceId();", "java.lang.String getUUID();", "String getUuid();", "java.lang.String getDeviceId();", "org.hl7.fhir.String getDeviceIdentifier();", "UUID getUUID();", "public java.lang.String getUuid() {\n java.lang.Object ref = uuid_;\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 uuid_ = s;\n return s;\n }\n }", "public java.lang.String getUuid() {\n java.lang.Object ref = uuid_;\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 uuid_ = s;\n return s;\n }\n }", "public String getUuid() {\n\t\t// lazy init of UUID\n\t\tif (uuid == null) {\n\t\t\tuuid = UUID.randomUUID().toString();\n\t\t}\n\t\treturn uuid;\n\t}", "public String getUuid() {\n\t\tif (uuid == null) {\n\t\t\tthis.uuid = getProperty(\"uuid\");\n\t\t}\n\t\treturn uuid;\n\t}", "public String getUuid() {\r\n return uuid;\r\n }", "public String getUuid() {\r\n return uuid;\r\n }", "public String getUuid() {\r\n return uuid;\r\n }", "public String getUserUuid() throws SystemException;", "public String getUserUuid() throws SystemException;", "public String getUserUuid() throws SystemException;", "public String getUserUuid() throws SystemException;", "public java.lang.String getUuid() {\n java.lang.Object ref = uuid_;\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 uuid_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getUuid() {\n java.lang.Object ref = uuid_;\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 uuid_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getUuid() {\n return uuid;\n }", "public String getUuid() {\n return uuid;\n }", "public String getUuid() {\n return uuid;\n }", "public String getUuid() {\n return uuid;\n }", "public String getUuid() {\n return uuid;\n }", "public String getUuid() {\n return uuid;\n }", "public String getUuid() {\n return uuid;\n }", "public String getUuid() {\n return uuid;\n }", "public String getUuid() {\n return uuid;\n }", "public String getUuid() {\n return uuid;\n }", "public String getUuid() {\n return uuid;\n }", "public String getUUID() {\n return uuid;\n }", "public abstract String getUuid();", "public String getUuid()\n {\n return this.uuid;\n }", "public UUID getUuid();", "public String getUuid() {\n return _uuid;\n }", "public String getUuid() {\n return this.uuid;\n }", "public String getUuid() {\n\t\treturn uuid;\n\t}", "public static String getUUID() {\n\t\treturn UUID.randomUUID().toString().toUpperCase().replace(\"-\", \"\").substring(0, 5);\n\t}", "public String getUUID () \n\t{\n\t\treturn (String)get_Value(COLUMNNAME_UUID);\n\t}", "public String getId(){\n\t\treturn uuid;\n\t}", "public String getDeviceUDID() {\r\n\t\tTelephonyManager telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);\r\n\t\treturn telephonyManager.getDeviceId();\r\n\t}", "public java.lang.String getUUID() {\n java.lang.Object ref = uUID_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n uUID_ = s;\n }\n return s;\n }\n }", "@Override\n public UUID getUuid() {\n return GATT_UUID;\n }", "public java.lang.String getUUID() {\n java.lang.Object ref = uUID_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n uUID_ = s;\n }\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public Integer getUuid() {\n return uuid;\n }", "public String getUuid() {\n return this.Uuid;\n }", "public static synchronized String getUID() throws UnknownHostException, SocketException {\r\n \r\n // Initialized MAC address if necessary.\r\n if (!initialized) {\r\n initialized = true;\r\n macAddress = UMROMACAddress.getMACAddress();\r\n macAddress = Math.abs(macAddress);\r\n }\r\n \r\n // Use standard class to get unique values.\r\n String guidText = new UID().toString();\r\n \r\n StringTokenizer st = new StringTokenizer(guidText, \":\");\r\n \r\n int unique = Math.abs(Integer.valueOf(st.nextToken(), 16).intValue());\r\n long time = Math.abs(Long.valueOf(st.nextToken(), 16).longValue());\r\n // why add 0x8000 ? because usually starts at -8000, which wastes 4 digits\r\n int count = Math\r\n .abs(Short.valueOf(st.nextToken(), 16).shortValue() + 0x8000);\r\n \r\n // concatenate values to make it into a DICOM GUID.\r\n String guid = UMRO_ROOT_GUID + macAddress + \".\" + unique + \".\" + time\r\n + \".\" + count;\r\n \r\n return guid;\r\n }", "@SuppressWarnings(\"HardwareIds\")\n public String getUniqueDeviceId() {\n return Settings.Secure.getString(mContext.getContentResolver(), Settings.Secure.ANDROID_ID);\n }", "public String getDeviceId() {\n //TelephonyManager tm = (TelephonyManager)getSystemService(TELEPHONY_SERVICE);\n String number = Build.SERIAL;\n return number;\n }", "public static String getOldUdid(Context context) {\n TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);\n String udid = telephonyManager.getDeviceId();\n\n if (isValidImei(udid)) {\n return udid;\n }\n\n udid = Secure.getString(context.getContentResolver(), Secure.ANDROID_ID);\n if (!TextUtils.isEmpty(udid) && !INVALID_ANDROIDID.equals(udid.toLowerCase(Locale.getDefault()))) {\n return udid;\n }\n\n String macAddress = getWifiMacAddress(context);\n if (!TextUtils.isEmpty(macAddress)) {\n udid = toMD5(macAddress + Build.MODEL + Build.MANUFACTURER + Build.ID + Build.DEVICE);\n return udid;\n }\n String name = String.valueOf(System.currentTimeMillis());\n udid = UUID.nameUUIDFromBytes(name.getBytes()).toString();\n \n return udid;\n }", "@Override\n\tpublic String getUserUuid();", "@Override\n\tpublic String getUserUuid();", "public UUID getUuid() {\n return uuid;\n }", "public UUID getUuid() {\n return uuid;\n }", "public com.google.protobuf.ByteString\n getUuidBytes() {\n java.lang.Object ref = uuid_;\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 uuid_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getUuidBytes() {\n java.lang.Object ref = uuid_;\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 uuid_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "Integer getDeviceId();", "@NonNull\n private String getDeviceId() {\n String ANDROID_ID = Settings.Secure.getString(cordova.getActivity().getContentResolver(), Settings.Secure.ANDROID_ID);\n return md5(ANDROID_ID).toUpperCase();\n }", "String getDeviceName();", "public final String getDeviceId(){\n return peripheralDeviceId;\n }", "public UUID getUUID() {\n return uuid;\n }", "public String uuid() {\n return this.innerProperties() == null ? null : this.innerProperties().uuid();\n }", "@Override\n\tpublic java.lang.String getUuid() {\n\t\treturn _second.getUuid();\n\t}", "@Override\n public long getUUID() {\n return endpointHandler.getUUID();\n }", "private String getDeviceID() {\n try {\n TelephonyManager telephonyManager;\n\n telephonyManager =\n (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);\n\n /*\n * getDeviceId() function Returns the unique device ID.\n * for example,the IMEI for GSM and the MEID or ESN for CDMA phones.\n */\n return telephonyManager.getDeviceId();\n }catch(SecurityException e){\n return null;\n }\n }", "@Override\n\tpublic String getUuid() {\n\t\treturn null;\n\t}", "public UUID getUuid() { return uuid; }", "@AutoEscape\n\t@Override\n\tpublic String getUuid();", "public com.google.protobuf.ByteString\n getUuidBytes() {\n java.lang.Object ref = uuid_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n uuid_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getUuidBytes() {\n java.lang.Object ref = uuid_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n uuid_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "DeviceId deviceId();", "DeviceId deviceId();", "public String getDeviceid() {\n return deviceid;\n }", "private String getDeviceId(Context context){\n TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);\n\n //\n ContextCompat.checkSelfPermission(context, Manifest.permission.READ_PHONE_STATE);\n String tmDevice = tm.getDeviceId();\n\n String androidId = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);\n\n String serial = null;\n if (Build.VERSION.SDK_INT > Build.VERSION_CODES.FROYO) serial = Build.SERIAL;\n\n if(tmDevice != null) return \"01\" + tmDevice;\n if(androidId != null) return \"02\" + androidId;\n if(serial != null) return \"03\" + serial;\n\n return null;\n }", "public String getUuidPlain() {\n return uuid.replace(\"-\", \"\");\n }", "@AutoEscape\n\tpublic String getUuid();", "@AutoEscape\n\tpublic String getUuid();", "@AutoEscape\n\tpublic String getUuid();", "public static String getUUID(BundleContext bc) {\n synchronized (\"org.osgi.framework.uuid\") {\n String uuid = bc.getProperty(\"org.osgi.framework.uuid\");\n if (uuid == null) {\n uuid = UUID.randomUUID().toString();\n System.setProperty(\"org.osgi.framework.uuid\", uuid);\n }\n return uuid;\n }\n }", "public java.lang.String getDeviceId() {\n java.lang.Object ref = deviceId_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n deviceId_ = s;\n }\n return s;\n }\n }", "public UUID getUUID() {\n return this.uuid;\n }", "public java.lang.String getResultDeviceGuid() {\n return resultDeviceGuid;\n }", "java.lang.String getErrorUuid();", "public String getDeviceId() {\n String deviceId = ((TelephonyManager) LoginActivity.this.getSystemService(Context.TELEPHONY_SERVICE)).getDeviceId();\n if (deviceId != null && !deviceId.equalsIgnoreCase(\"null\")) {\n // System.out.println(\"imei number :: \" + deviceId);\n return deviceId;\n }\n\n deviceId = android.os.Build.SERIAL;\n // System.out.println(\"serial id :: \" + deviceId);\n return deviceId;\n\n }", "public java.lang.String getDeviceId() {\n java.lang.Object ref = deviceId_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n deviceId_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "private String getDeviceId() {\n String deviceId = telephonyManager.getDeviceId(); \n \n \n // \"generic\" means the emulator.\n if (deviceId == null || Build.DEVICE.equals(\"generic\")) {\n \t\n // This ID changes on OS reinstall/factory reset.\n deviceId = Secure.getString(context.getContentResolver(), Secure.ANDROID_ID);\n }\n \n return deviceId;\n }", "@SuppressLint(\"HardwareIds\")\n String getDeviceID() {\n return Settings.Secure.getString(getApplicationContext().getContentResolver(),\n Settings.Secure.ANDROID_ID);\n }", "@Override\n\tpublic String getUuid() {\n\t\treturn model.getUuid();\n\t}", "@Override\n\tpublic String getUuid() {\n\t\treturn model.getUuid();\n\t}", "@Override\n\tpublic String getUuid() {\n\t\treturn model.getUuid();\n\t}", "public String getDevice_id() {\r\n\t\treturn device_id;\r\n\t}", "public com.google.protobuf.ByteString\n getUUIDBytes() {\n java.lang.Object ref = uUID_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n uUID_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public final String getVendorId(){\n return peripheralVendorId;\n }", "public static String getUniqueDeviceID(Context context) {\n\t\tString identifier = null;\n\t\tTelephonyManager tm = (TelephonyManager) context\n\t\t\t\t.getSystemService(Context.TELEPHONY_SERVICE);\n\t\tif (tm != null)\n\t\t\tidentifier = tm.getDeviceId();\n\t\tif (identifier == null || identifier.length() == 0)\n\t\t\tidentifier = Secure.getString(context.getContentResolver(),\n\t\t\t\t\tSecure.ANDROID_ID);\n\t\t// identifier = identifier + new Random().nextInt(1000);\n\t\treturn identifier;\n\t}", "public String RtoosGetID() \n\t{\n\t\treturn UUIDs.random().toString();\n\t}", "public long getUuid_() throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\treturn __io__block.readInt64(__io__address + 0);\n\t\t} else {\n\t\t\treturn __io__block.readInt64(__io__address + 0);\n\t\t}\n\t}", "public String getUniqueID(Context ctx)\n {\n String m_szDevIDShort = \"\";\n String m_szAndroidID = \"\";\n String m_szWLANMAC = \"\";\n\n try {\n m_szDevIDShort = \"35\" + // we make this look like a valid IMEI\n Build.BOARD.length() % 10 + Build.BRAND.length() % 10 +\n Build.CPU_ABI.length() % 10 + Build.DEVICE.length() % 10 +\n Build.DISPLAY.length() % 10 + Build.HOST.length() % 10 +\n Build.ID.length() % 10 + Build.MANUFACTURER.length() % 10 +\n Build.MODEL.length() % 10 + Build.PRODUCT.length() % 10 +\n Build.TAGS.length() % 10 + Build.TYPE.length() % 10 +\n Build.USER.length() % 10;\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n try {\n m_szAndroidID = Settings.Secure.getString(ctx.getContentResolver(), Settings.Secure.ANDROID_ID);\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n try {\n WifiManager wm = (WifiManager) ctx.getSystemService(Context.WIFI_SERVICE);\n m_szWLANMAC = wm.getConnectionInfo().getMacAddress();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n String m_szLongID = m_szWLANMAC + m_szDevIDShort + m_szAndroidID;\n\n MessageDigest m = null;\n try {\n m = MessageDigest.getInstance(\"MD5\");\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }\n m.update(m_szLongID.getBytes(), 0, m_szLongID.length());\n byte p_md5Data[] = m.digest();\n\n //noinspection RedundantStringConstructorCall\n String m_szUniqueID = new String();\n for (int i = 0; i < p_md5Data.length; i++) {\n int b = (0xFF & p_md5Data[i]);\n // if it is a single digit, make sure it have 0 in front (proper\n // padding)\n if (b <= 0xF)\n m_szUniqueID += \"0\";\n // add number to string\n m_szUniqueID += Integer.toHexString(b);\n }\n\n return m_szUniqueID;\n }", "@Override\n public String getDeviceId() {\n return this.strDevId;\n }" ]
[ "0.8390107", "0.80891335", "0.7987553", "0.7914252", "0.7897692", "0.7587922", "0.7516176", "0.7469434", "0.74139416", "0.74139416", "0.74047804", "0.7402653", "0.73828584", "0.73828584", "0.73828584", "0.73669416", "0.73669416", "0.73669416", "0.73669416", "0.73648065", "0.73648065", "0.73507375", "0.73489666", "0.73489666", "0.73489666", "0.73489666", "0.73489666", "0.73489666", "0.73489666", "0.73489666", "0.73489666", "0.73489666", "0.73205787", "0.73168707", "0.7306823", "0.7290475", "0.7289716", "0.7285647", "0.7235475", "0.72120017", "0.71778435", "0.71471494", "0.7140366", "0.71378994", "0.71307063", "0.7130375", "0.7027592", "0.701339", "0.6928341", "0.6926289", "0.68972296", "0.68790257", "0.6876175", "0.6876175", "0.6871616", "0.6871616", "0.68691033", "0.68691033", "0.6865374", "0.6838241", "0.6809989", "0.6806239", "0.6794183", "0.6791191", "0.6789093", "0.678429", "0.67798346", "0.6769276", "0.6767189", "0.6747576", "0.6737478", "0.6737478", "0.6731856", "0.6731856", "0.6731368", "0.6725292", "0.67223984", "0.67188954", "0.67188954", "0.67188954", "0.67175233", "0.671472", "0.669905", "0.66926956", "0.6685591", "0.6677284", "0.66682285", "0.6665301", "0.66562617", "0.66549367", "0.66549367", "0.66549367", "0.6652393", "0.66359675", "0.66351134", "0.6633809", "0.6612836", "0.6598561", "0.6596997", "0.65720534" ]
0.8040654
2
gets the device current location
public S<T> gps(){ gps = new GPSTracker(activity); // Check if GPS enabled if(gps.canGetLocation()) { double latitude = gps.getLatitude(); double longitude = gps.getLongitude(); // \n is for new line Toast.makeText(activity, "Your Location is - \nLat: " + latitude + "\nLong: " + longitude, Toast.LENGTH_LONG).show(); } else { // Can't get location. // GPS or network is not enabled. // Ask user to enable GPS/network in settings. gps.showSettingsAlert(); } return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Location getCurrentLocation();", "@SuppressWarnings(\"unused\")\n Location getCurrentLocation();", "public String getCurrentLocation() {\n return currentLocation;\n }", "private void getDeviceLocation(){\n mFusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(this);\n\n try {\n if (mLocationPermissionsGranted) {\n\n final Task location = mFusedLocationProviderClient.getLastLocation();\n location.addOnCompleteListener(new OnCompleteListener() {\n @Override\n public void onComplete(@NonNull Task task) {\n if(task.isSuccessful()){\n\n Location currentLocation = (Location) task.getResult();\n\n if (currentLocation == null) {\n\n // Provide default current location\n\n currentLocation = new Location(\"\");\n currentLocation.setLatitude(51.454514);\n currentLocation.setLongitude(-2.587910);\n }\n\n } else {\n Helpers.showToast(getApplicationContext(), \"Could not get current location\");\n }\n }\n });\n }\n } catch (SecurityException e) {\n Helpers.showToast(getApplicationContext(), \"Could not get current location\");\n }\n }", "private void getDeviceLocation() {\n /*\n * Get the best and most recent location of the device, which may be null in rare\n * cases when a location is not available.\n */\n try {\n if (mLocationPermissionGranted) {\n Task<Location> locationResult = mFusedLocationProviderClient.getLastLocation();\n locationResult.addOnSuccessListener(this, new OnSuccessListener<Location>() {\n @Override\n public void onSuccess(Location location) {\n if (location != null) {\n // Set the map's camera position to the current location of the device.\n mLastKnownLocation = location;\n Log.d(TAG, \"Latitude: \" + mLastKnownLocation.getLatitude());\n Log.d(TAG, \"Longitude: \" + mLastKnownLocation.getLongitude());\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(\n new LatLng(mLastKnownLocation.getLatitude(),\n mLastKnownLocation.getLongitude()), DEFAULT_ZOOM));\n } else {\n Log.d(TAG, \"Current location is null. Using defaults.\");\n mMap.moveCamera(CameraUpdateFactory\n .newLatLngZoom(mDefaultLocation, DEFAULT_ZOOM));\n }\n\n }\n });\n }\n } catch (Exception e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n }", "private void getDeviceLocation() {\n /*\n * Get the best and most recent location of the device, which may be null in rare\n * cases when a location is not available.\n */\n try {\n if (mLocationPermissionGranted) {\n Task<Location> locationResult = mFusedLocationProviderClient.getLastLocation();\n locationResult.addOnCompleteListener(this, new OnCompleteListener<Location>() {\n @Override\n public void onComplete(@NonNull Task<Location> task) {\n if (task.isSuccessful()) {\n // Set the map's camera position to the current location of the device.\n mLastKnownLocation = task.getResult();\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(\n new LatLng(mLastKnownLocation.getLatitude(),\n mLastKnownLocation.getLongitude()), DEFAULT_ZOOM));\n showCurrentPlace();\n } else {\n Log.d(TAG, \"Current location is null. Using defaults.\");\n Log.e(TAG, \"Exception: %s\", task.getException());\n mMap.moveCamera(CameraUpdateFactory\n .newLatLngZoom(mDefaultLocation, DEFAULT_ZOOM));\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n }\n }\n });\n }\n } catch (SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n }", "public Location getCurrentLocation()\n\t{\n\t\treturn currentLocation;\n\t}", "private void getDeviceLocation() {\n /*\n * Get the best and most recent location of the device, which may be null in rare\n * cases when a location is not available.\n */\n try {\n if (mLocationPermissionGranted) {\n Task<Location> locationResult = mFusedLocationProviderClient.getLastLocation();\n locationResult.addOnCompleteListener(this, new OnCompleteListener<Location>() {\n @Override\n public void onComplete(@NonNull Task<Location> task) {\n if (task.isSuccessful()) {\n // Set the map's camera position to the current location of the device.\n mLastKnownLocation = task.getResult();\n currLatLng = new LatLng(mLastKnownLocation.getLatitude(), mLastKnownLocation.getLongitude());\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(\n new LatLng(mLastKnownLocation.getLatitude(),\n mLastKnownLocation.getLongitude()), DEFAULT_ZOOM));\n destinationPoint.set(0,currLatLng);\n } else {\n Log.d(TAG, \"Current location is null. Using defaults.\");\n Log.e(TAG, \"Exception: %s\", task.getException());\n currLatLng = mDefaultLocation;\n mMap.moveCamera(CameraUpdateFactory\n .newLatLngZoom(mDefaultLocation, DEFAULT_ZOOM));\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n }\n }\n });\n }\n } catch (SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n }", "private void getDeviceLocation() {\n try {\n if (mLocationPermissionGranted) {\n Task locationResult = fusedLocationClient.getLastLocation();\n locationResult.addOnCompleteListener(this, new OnCompleteListener<Location>() {\n @Override\n public void onComplete(@NonNull Task<Location> task) {\n if (task.isSuccessful() && task.getResult() != null) {\n // Set the map's camera position to the current location of the device.\n mLastKnownLocation = task.getResult();\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(\n new LatLng(mLastKnownLocation.getLatitude(),\n mLastKnownLocation.getLongitude()), DEFAULT_ZOOM));\n } else {\n Log.d(TAG,\"Current location is null. Using defaults.\");\n Log.e(TAG, task.getException().toString());\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(mDefaultLocation, DEFAULT_ZOOM));\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n }\n }\n });\n }\n } catch(SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n }", "private void getDeviceLocation() {\n /*\n * Get the best and most recent location of the device, which may be null in rare\n * cases when a location is not available.\n */\n try {\n if (mLocationPermissionGranted) {\n Task<Location> locationResult = mFusedLocationProviderClient.getLastLocation();\n locationResult.addOnCompleteListener(getActivity(), new OnCompleteListener<Location>() {\n @Override\n public void onComplete(@NonNull Task<Location> task) {\n if (task.isSuccessful()) {\n // Set the map's camera position to the current location of the device.\n mLastKnownLocation = task.getResult();\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(\n new LatLng(mLastKnownLocation.getLatitude(),\n mLastKnownLocation.getLongitude()), DEFAULT_ZOOM));\n } else {\n mMap.moveCamera(CameraUpdateFactory\n .newLatLngZoom(mDefaultLocation, DEFAULT_ZOOM));\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n }\n }\n });\n }\n } catch (SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n }", "private void getDeviceLocation() {\n /*\n * Get the best and most recent location of the device, which may be null in rare\n * cases when a location is not available.\n */\n try {\n if (mLocationPermissionGranted) {\n Task<Location> locationResult = mFusedLocationProviderClient.getLastLocation();\n locationResult.addOnCompleteListener(mActivity, new OnCompleteListener<Location>() {\n @Override\n public void onComplete(@NonNull Task<Location> task) {\n if (task.isSuccessful()) {\n // Set the map's camera position to the current location of the device.\n mLastKnownLocation = task.getResult();\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(\n new LatLng(mLastKnownLocation.getLatitude(),\n mLastKnownLocation.getLongitude()), DEFAULT_ZOOM));\n } else {\n Log.d(TAG, \"Current location is null. Using defaults.\");\n Log.e(TAG, \"Exception: %s\", task.getException());\n mMap.moveCamera(CameraUpdateFactory\n .newLatLngZoom(mDefaultLocation, DEFAULT_ZOOM));\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n }\n }\n });\n }\n } catch (SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n }", "public int getCurrentLocation() {\n\t\treturn currentLocation;\n\t}", "private void getDeviceLocation() {\n try {\n if (mLocationPermissionGranted) {\n Task<Location> locationResult = mFusedLocationProviderClient.getLastLocation();\n locationResult.addOnCompleteListener(getActivity(), new OnCompleteListener<Location>() {\n @Override\n public void onComplete(@NonNull Task<Location> task) {\n if (task.isSuccessful()) {\n // Set the customer_map's camera position to the current location of the device.\n mLastKnownLocation = task.getResult();\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(\n new LatLng(mLastKnownLocation.getLatitude(),\n mLastKnownLocation.getLongitude()), DEFAULT_ZOOM));\n getNearestDriver();\n } else {\n Log.d(TAG, \"Current location is null. Using defaults.\");\n Log.e(TAG, \"Exception: %s\", task.getException());\n mMap.moveCamera(CameraUpdateFactory\n .newLatLngZoom(mDefaultLocation, DEFAULT_ZOOM));\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n\n }\n }\n });\n }\n } catch (SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n }", "void getDeviceLocation() {\n try {\n if (mLocationPermissionGranted) {\n Task<Location> locationResult = mFusedLocationProviderClient.getLastLocation();\n locationResult.addOnCompleteListener(getActivity(), new OnCompleteListener<Location>() {\n @Override\n public void onComplete(@NonNull Task<Location> task) {\n if (task.isSuccessful() && task.getResult()!=null) {\n // Set the map's camera position to the current location of the device.\n mLastKnownLocation = task.getResult();\n googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(\n new LatLng(mLastKnownLocation.getLatitude(),\n mLastKnownLocation.getLongitude()), DEFAULT_ZOOM));\n getProfile(mLastKnownLocation);\n } else {\n Log.d(\"Map\", \"Current location is null. Using defaults.\");\n Log.e(\"Map\", \"Exception: %s\", task.getException());\n googleMap.moveCamera(CameraUpdateFactory\n .newLatLngZoom(mDefaultLocation, DEFAULT_ZOOM));\n googleMap.getUiSettings().setMyLocationButtonEnabled(false);\n }\n }\n });\n }\n } catch (SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n }", "public void getLocation() {\n\n\t\t// If Google Play Services is available\n\t\tif (servicesConnected()) {\n\t\t\t// Get the current location\n\t\t\tLocation currentLocation = mLocationClient.getLastLocation();\n\n\t\t\t// Display the current location in the UI\n\t\t\tmLatLng.setText(LocationUtils.getLatLng(this, currentLocation));\n\n\t\t\tlatCurrent=(float) currentLocation.getLatitude();\n\t\t\tlntCurrent=(float) currentLocation.getLongitude();\n\n\t\t}\n\t}", "private void getDeviceLocation() {\n /*\n * Get the best and most recent location of the device, which may be null in rare\n * cases when a location is not available.\n */\n try {\n if (mLocationPermissionGranted) {\n Task<Location> locationResult = mFusedLocationProviderClient.getLastLocation();\n locationResult.addOnSuccessListener(this, new OnSuccessListener<Location>() {\n @Override\n public void onSuccess(Location location) {\n if (location != null) {\n // Set the map's camera position to the current location of the device.\n mLastKnownLocation = location;\n Log.d(TAG, \"Latitude: \" + mLastKnownLocation.getLatitude());\n Log.d(TAG, \"Longitude: \" + mLastKnownLocation.getLongitude());\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(\n new LatLng(mLastKnownLocation.getLatitude(),\n mLastKnownLocation.getLongitude()), DEFAULT_ZOOM));\n } else {\n Log.d(TAG, \"Current location is null. Using defaults.\");\n mMap.moveCamera(CameraUpdateFactory\n .newLatLngZoom(mDefaultLocation, DEFAULT_ZOOM));\n }\n\n getCurrentPlaceLikelihoods();\n }\n });\n }\n } catch (Exception e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n }", "private void getlocation() {\n\t\t\t\ttry {\n\n\t\t\t\t\tgps = new GPSTracker(RegisterActivity.this);\n\t\t\t\t\tLog.d(\"LOgggg\", \"inCurrentlocation\");\n\n\t\t\t\t\t// check if GPS enabled\n\t\t\t\t\tif (gps.canGetLocation()) {\n\n\t\t\t\t\t\tlatitude = gps.getLatitude();\n\t\t\t\t\t\tlongitude = gps.getLongitude();\n\n\t\t\t\t\t\tLog.i(\"latitude\", \"\" + latitude);\n\t\t\t\t\t\tLog.i(\"longitude\", \"\" + longitude);\n\n\t\t\t\t\t\tnew getLoc().execute(\"\");\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tgps.showSettingsAlert();\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}", "private void getDeviceLocation() {\n /*\n * Request location permission, so that we can get the location of the\n * device. The result of the permission request is handled by a callback,\n * onRequestPermissionsResult.\n */\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(),\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n /*\n * Get the best and most recent location of the device, which may be null in rare\n * cases when a location is not available.\n */\n if (mLocationPermissionGranted) {\n mLastKnownLocation = LocationServices.FusedLocationApi\n .getLastLocation(mGoogleApiClient);\n if (world.geoHome == null && mLastKnownLocation != null) {\n world.geoHome = new Vector2f(mLastKnownLocation.getLatitude(), mLastKnownLocation.getLongitude());\n }\n }\n\n // Set the map's camera position to the current location of the device.\n /*if (mCameraPosition != null) {\n mMap.moveCamera(CameraUpdateFactory.newCameraPosition(mCameraPosition));\n } else if (mLastKnownLocation != null) {\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(\n new LatLng(mLastKnownLocation.getLatitude(),\n mLastKnownLocation.getLongitude()), mMap.getCameraPosition().zoom));\n } else {\n Log.d(TAG, \"Current location is null. Using defaults.\");\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(mDefaultLocation, DEFAULT_ZOOM));\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n }*/\n }", "private LatLng getCurrentLocation() {\n if (ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &&\n ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n\n return new LatLng(0, 0);\n }\n LocationManager locationManager = (LocationManager) getSystemService(this.LOCATION_SERVICE);\n Location current_location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);\n if (current_location == null) {\n return new LatLng(0, 0);\n }\n return new LatLng(current_location.getLatitude(), current_location.getLongitude());\n }", "private void getDeviceLocation() {\n /*\n * Request location permission, so that we can get the location of the\n * device. The result of the permission request is handled by a callback,\n * onRequestPermissionsResult.\n */\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(),\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n /*\n * Get the best and most recent location of the device, which may be null in rare\n * cases when a location is not available.\n */\n if (mLocationPermissionGranted) {\n mLastKnownLocation = LocationServices.FusedLocationApi\n .getLastLocation(mGoogleApiClient);\n }\n\n // Set the map's camera position to the current location of the device.\n if (mCameraPosition != null) {\n mMap.moveCamera(CameraUpdateFactory.newCameraPosition(mCameraPosition));\n } else if (mLastKnownLocation != null) {\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(\n new LatLng(mLastKnownLocation.getLatitude(),\n mLastKnownLocation.getLongitude()), DEFAULT_ZOOM));\n } else {\n Log.d(TAG, \"Current location is null. Using defaults.\");\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(mDefaultLocation, DEFAULT_ZOOM));\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n }\n }", "public Point getLocation() {\n return currentLocation;\n }", "private void getCurrentLocation() {\n try {\n if (locationPermissionGranted) {\n Task<Location> locationResult = fusedLocationClient.getLastLocation();\n locationResult.addOnCompleteListener(this, new OnCompleteListener<Location>() {\n @Override\n public void onComplete(@NonNull Task<Location> task) {\n if (task.isSuccessful()) {\n // Set the map's camera position to the current location of the device.\n lastKnownLocation = task.getResult();\n if (lastKnownLocation != null) {\n map.moveCamera(CameraUpdateFactory.newLatLngZoom(\n new LatLng(lastKnownLocation.getLatitude(),\n lastKnownLocation.getLongitude()), DEFAULT_ZOOM));\n updateCameraBearing(map, location.getBearing());\n }\n }\n }\n });\n }\n } catch (SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage(), e);\n }\n }", "Location getLocation();", "Location getLocation();", "Location getLocation();", "Location getLocation();", "public StarSystem getCurrentLocation() {\n\t\treturn player.getLocation();\n\t}", "private void getLocation() { \n LocationManager locationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE); \n Criteria criteria = new Criteria(); \n criteria.setAccuracy(Criteria.ACCURACY_FINE); \n criteria.setAltitudeRequired(false); \n criteria.setBearingRequired(false); \n criteria.setCostAllowed(true);\n criteria.setPowerRequirement(Criteria.POWER_LOW); \n String provider = locationManager.getBestProvider(criteria,true); \n \n //In order to make sure the device is getting location, request updates. locationManager.requestLocationUpdates(provider, 1, 0, this); \n mostRecentLocation = locationManager.getLastKnownLocation(provider); \n }", "@SuppressWarnings(\"WeakerAccess\")\n public Location getCurrentLocation() {\n final LocationClient locationClient = getLocationClient();\n return locationClient == null ? null: locationClient.getCurrentLocation();\n }", "private void getDeviceLocation() {\n try {\n if (mLocationPermissionGranted) {\n Task<Location> locationResult = mFusedLocationProviderClient.getLastLocation();\n locationResult.addOnCompleteListener(getActivity(), new OnCompleteListener() {\n @Override\n public void onComplete(@NonNull Task task) {\n if (task.isSuccessful()) {\n // Set the map's camera position to the current location of the device.\n mLastKnownLocation = (Location) task.getResult();\n if (mLastKnownLocation != null) {\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(\n new LatLng(mLastKnownLocation.getLatitude(),\n mLastKnownLocation.getLongitude()), DEFAULT_ZOOM));\n\n\n }\n\n } else {\n Log.d(TAG, \"Current location is null. Using defaults.\");\n Log.e(TAG, \"Exception: %s\", task.getException());\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(mDefaultLocation, DEFAULT_ZOOM));\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n }\n }\n });\n }\n\n } catch (SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n } catch (NullPointerException e) {\n Log.e(\"....\", \"Null pointer exception\");\n }\n }", "public Location getCurrentLocation() { return entity.getLocation(); }", "private void getDeviceLocation(){\n\n Log.d(TAG, \"getDeviceLocation: getting device current location\");\n mFusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(this);\n try{\n if(mLocationPermissionGaranted){\n\n final Task location = mFusedLocationProviderClient.getLastLocation();\n location.addOnCompleteListener(task -> {\n if(task.isSuccessful()){\n Log.d(TAG, \"onComplete: found location!\");\n Location currentLocation = (Location) task.getResult();\n System.out.println(currentLocation);\n if (currentLocation !=null) {\n if (numDispositivo==1) {\n disp_Lat1 = Double.toString(currentLocation.getLatitude());\n disp_Long1 = Double.toString(currentLocation.getLongitude());\n }\n if (numDispositivo==2) {\n disp_Lat2 = Double.toString(currentLocation.getLatitude());\n disp_Long2 = Double.toString(currentLocation.getLongitude());\n }\n }\n System.out.println(disp_Lat1+\"-\"+disp_Long1);\n System.out.println(disp_Lat2+\"-\"+disp_Long2);\n Guardar();\n\n }else{\n Log.d(TAG, \"onComplete: current location is null\");\n Toast.makeText(FormularioCurso.this, \"unable to get current location\", Toast.LENGTH_SHORT).show();\n }\n });\n }\n }catch (SecurityException e){\n Log.e(TAG, \"getDeviceLocation: SecurityException: \" + e.getMessage() );\n }\n }", "public Location getCurrentLocation() {\n\n Location location = null;\n\n try {\n mLocationManager = (LocationManager) mContext\n .getSystemService(Context.LOCATION_SERVICE);\n\n // get GPS status\n mIsGpsEnabled = mLocationManager\n .isProviderEnabled(LocationManager.GPS_PROVIDER);\n\n // get network status\n mIsNetworkEnabled = mLocationManager\n .isProviderEnabled(LocationManager.NETWORK_PROVIDER);\n\n if (mIsGpsEnabled || mIsNetworkEnabled) {\n this.mGetLocationPossible = true;\n\n if (mIsNetworkEnabled) {\n mLocationManager.requestLocationUpdates(\n LocationManager.NETWORK_PROVIDER,\n MIN_TIME_BW_UPDATES,\n MIN_DISTANCE_CHANGE_FOR_UPDATES, this);\n\n if (mLocationManager != null) {\n location = mLocationManager\n .getLastKnownLocation(LocationManager.NETWORK_PROVIDER);\n }\n }\n\n // if GPS Enabled get lat/long using GPS Services\n if (mIsGpsEnabled) {\n location = null;\n\n if (location == null) {\n mLocationManager.requestLocationUpdates(\n LocationManager.GPS_PROVIDER,\n MIN_TIME_BW_UPDATES,\n MIN_DISTANCE_CHANGE_FOR_UPDATES, this);\n\n if (mLocationManager != null) {\n location = mLocationManager\n .getLastKnownLocation(LocationManager.GPS_PROVIDER);\n }\n }\n }\n }\n\n } catch (Exception aExc) {\n aExc.printStackTrace();\n }\n\n return location;\n }", "public Location getLocation() {\n return getLocation(null);\n }", "public Location getLocation() {\n /* if ( Build.VERSION.SDK_INT >= 23 &&\n ContextCompat.checkSelfPermission( mContext, android.Manifest.permission.ACCESS_FINE_LOCATION ) != PackageManager.PERMISSION_GRANTED ) {\n Toast.makeText(mContext,\"Permission is not granted so returning back \",Toast.LENGTH_LONG).show();\n// showSettingsAlert();\n return null ;\n }*/\n\n try {\n\n locationManager = (LocationManager) mContext.getSystemService(LOCATION_SERVICE);\n\n Criteria criteria = new Criteria();\n provider = locationManager.getBestProvider(criteria, false);\n if(provider != null) {\n Location location = locationManager.getLastKnownLocation(provider);\n\n // Initialize the location fields\n if (location != null) {\n System.out.println(\"Provider \" + provider + \" has been selected.\");\n onLocationChanged(location);\n resumeGpsService();\n }\n }else {\n// ISSUtils.checkPermission(mContext);\n }\n\n\n }catch (SecurityException secx) {\n secx.printStackTrace();\n// ISSUtils.checkPermission(mContext);\n showSettingsAlert();\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n\n return location;\n }", "public double getLocation(){\n\t\treturn location;\n\t}", "public Location getLocation() {\n\n if (isPermissionGranted()) {\n try\n {\n\n lastKnownLocation = LocationServices.FusedLocationApi\n .getLastLocation(googleApiClient);\n\n Log.e(TAG, \"getLocation: LAST KNOWN LOCATION\" + (lastKnownLocation==null));\n return lastKnownLocation;\n }\n catch (SecurityException e)\n {\n e.printStackTrace();\n }\n }\n\n return null;\n\n }", "private void getDeviceLocation() {\n /*\n * Get the best and most recent location of the device, which may be null in rare\n * cases when a location is not available.\n */\n mFusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(this);\n try {\n if (mLocationPermissionGranted){\n Task location = mFusedLocationProviderClient.getLastLocation();\n location.addOnCompleteListener(new OnCompleteListener() {\n @Override\n public void onComplete(@NonNull Task task) {\n if (task.isSuccessful()){\n Location currentLocation = (Location) task.getResult();\n if (currentLocation != null){\n\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(currentLocation.getLatitude(),currentLocation.getLongitude()), DEFAULT_ZOOM));\n\n } else {\n /*\n AlertDialog alertDialog = new AlertDialog.Builder(MapActivity.this).create();s\n alertDialog.setMessage(\"Activa ubicación\");\n alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, \"OK\",\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n }\n });\n alertDialog.show();\n */\n Toast.makeText(MapActivity.this, \"Tu ubicación es nula\", Toast.LENGTH_SHORT).show();\n }\n } else Toast.makeText(MapActivity.this, \"Error al obtener la ubicación\", Toast.LENGTH_LONG).show();\n }\n });\n }else Toast.makeText(MapActivity.this, \"Da permiso para acceder a la ubicación\", Toast.LENGTH_LONG).show();\n } catch (SecurityException e){\n Toast.makeText(MapActivity.this, \"Seleciona un punto en el mapa primero\", Toast.LENGTH_LONG).show();\n }\n }", "@Nullable\n public Location getCurrentLocation() {\n if (ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n return null;\n }\n LocationManager mLocationManager = (LocationManager) getActivity().getApplicationContext().getSystemService(Context.LOCATION_SERVICE);\n List<String> providers = mLocationManager.getProviders(true);\n Location bestLocation = null;\n for (String provider : providers) {\n Location l = mLocationManager.getLastKnownLocation(provider);\n if (l == null) {\n continue;\n }\n if (bestLocation == null || l.getAccuracy() < bestLocation.getAccuracy()) {\n // Found best last known location: %s\", l);\n bestLocation = l;\n }\n }\n return bestLocation;\n }", "public String getLocation() {\n return mLocation;\n }", "public String getLocation() {\n\t\treturn mLocation;\n\t}", "private void getLocation() {\n\t\tif (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n\t\t\tif (checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tFusedLocationProviderClient locationProviderClient = LocationServices.getFusedLocationProviderClient(getApplicationContext());\n\t\tlocationProviderClient.getLastLocation().addOnSuccessListener(new OnSuccessListener<Location>() {\n\t\t\t@Override\n\t\t\tpublic void onSuccess(Location location) {\n\t\t\t\t\n\t\t\t\tfinal Location finalLocation = location;\n\t\t\t\t\n\t\t\t\tbtnGoToYou.setOnClickListener(new View.OnClickListener() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\tLatLng userLocation = new LatLng(finalLocation.getLatitude(), finalLocation.getLongitude());\n\t\t\t\t\t\tmMap.addMarker(new MarkerOptions().position(userLocation).title(\"You are Here!\"));\n\t\t\t\t\t\tmMap.moveCamera(CameraUpdateFactory.newLatLng(userLocation));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t\t\n\t}", "public String getLocation(){\r\n return Location;\r\n }", "public String getLocation() {\r\n\t\treturn location; \r\n\t}", "public Location getLocation() \n\t{\n\t\treturn location;\n\t}", "public String getLocation()\n {\n return location;\n }", "public Location getLocation() {\n return loc;\n }", "public Location getLocation() {\n return loc;\n }", "public Location getCurrentUserPosition() {\n if (ActivityCompat.checkSelfPermission(getContext(),\n Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED\n && ActivityCompat.checkSelfPermission(getContext(),\n Manifest.permission.ACCESS_COARSE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n String[] permissions = {Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION};\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n requestPermissions(permissions, ACCESS_COARSE_LOCATION);\n }\n return null;\n }\n locationManager.requestLocationUpdates(\n LocationManager.GPS_PROVIDER, 5000, 10, this);\n return locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);\n }", "public String getLocation() {\r\n return location;\r\n }", "public final String getLocation() {\n return location;\n }", "public final Coord getLocation() {\n return location;\n }", "public WotlasLocation getLocation() {\n return this.getBasicChar().getLocation();\n }", "public int getLocation() {\n\t\tint location=super.getLocation();\n\t\treturn location;\n\t}", "public String getLocation() {\n return location;\n }", "public Location getLocation() {\n\t\treturn loc;\n\t}", "public int getLocation()\r\n {\r\n return location;\r\n }", "public byte[] getLocation() {\r\n return location;\r\n }", "public DeviceDescriptionLocation getLocation() {\n return location;\n }", "public String getLocation() {\r\n return location;\r\n }", "public String getLocation() {\r\n\t\treturn location;\r\n\t}", "public String getLocation() {\n return location;\n }", "public String getLocation() {\n return location;\n }", "public String getLocation() {\n return location;\n }", "public String getLocation() {\n return location;\n }", "public String getLocation() {\n return location;\n }", "public String getLocation() {\n return location;\n }", "public String getLocation() {\n return location;\n }", "public String getLocation() {\n return location;\n }", "public String getLocation() {\n return location;\n }", "public String getLocation() {\n return location;\n }", "public String getLocation() {\n return location;\n }", "public String getLocation() {\n return location;\n }", "public Location getLocation() {\r\n\t\treturn location;\r\n\t}", "public Location getLocation() {\r\n\t\treturn location;\r\n\t}", "private void getUserCurrentLocation()\n\t {\n\t NicerLocationManager locationMgr = new NicerLocationManager(this.getApplicationContext());\n\t if (locationMgr.isAnyLocationServicesAvailble())\n\t {\n\t Log.i(\"MAIN\",\"retrieving current location...\");\n\n\t // get current location\n\t locationMgr.getBestGuessLocation(1000,\n\t new NicerLocationListener() {\n\n\t @Override\n\t public void locationLoaded(final Location location)\n\t {\n\t // parse the current site forecast for users current\n\t // location in the background\n\t //LocationForecastSetup currentForecast = new LocationForecastSetup();\n\t //currentForecast.execute(location);\n\n\t // QLog.i(\"location loaded. finding nearest location...\");\n\t //\n\t // // find nearest weather location\n\t // Site nearestLocation =\n\t // Utils.findNearestSite(mApp, location);\n\t //\n\t // // insert the new current user location site\n\t // SitesProviderHelper.addSavedSite(mApp,\n\t // Long.valueOf(nearestLocation.getmSiteId()), true);\n\t //\n\t Log.i(\"MAIN\",\"location found \"+location.getLatitude()+\" \"+location.getLongitude());\n\t dS.lat=(float) location.getLatitude();\n\t dS.lon=(float) location.getLongitude();\n\t //TextView versionText = (TextView) findViewById(R.id.info_area_string);\n\t //versionText.setText(\"lat \" + location.getLatitude()+\" lon \"+location.getLongitude());\n\t \n\t //\n\t // /*\n\t // * add blank site if user has no saved sites. a blank site\n\t // * forecast is also added in the WeatherService class\n\t // * (runWeatherService method) to display correctly in the\n\t // * view pager.this is later removed when a user adds a\n\t // site\n\t // * and added again when user removes last site.\n\t // */\n\t // SitesProviderHelper.addBlankSavedSite(mApp);\n\t //\n\t // // re-order sites so current location is first\n\t // SitesProviderHelper.setSiteOrder(mApp,\n\t // nearestLocation.getmSiteId(), \"0\");\n\t // SitesProviderHelper.setSiteOrder(mApp,\n\t // Consts.BLANK_SITE_ID, \"1\");\n\n\t }\n\n\t @Override\n\t public void error()\n\t {\n\t // give option to change location settings or select a\n\t // location manually\n\t Log.e(\"MAIN\",\"Error finding best guess location\");\n dS.lat=0;\n dS.lon=0;\n if(once)\n {\n\t //promptSetLocationService(MainActivity.this);\n }\n once=false;\n\t }\n\n\t @Override\n\t public void onFinished()\n\t {\n\t //runUpdateService(false, false);\n\t \tLog.i(\"MAIN\",\"onFinished\");\n\t }\n\t });\n\n\t }\n\t else\n\t {\n\t \n\t \tdS.lat=0;\n dS.lon=0;\n\t \n\t }\n\n\t }", "public String getLocation(){\r\n return location;\r\n }", "public BwLocation getLocation() {\n if (location == null) {\n location = BwLocation.makeLocation();\n }\n\n return location;\n }", "public Coordinate getCurrent( )\n\t{\n\t\treturn currentLocation;\n\t}", "private void getGpsLocation() {\n Log.d(LOG_TAG, \"In getGpsLocation\");\n mLocationMgr = (LocationManager) mContext.getSystemService(mContext.LOCATION_SERVICE);\n try {\n Location mLocation = mLocationMgr.getLastKnownLocation(LocationManager.GPS_PROVIDER);\n if (null != mLocation) {\n mLatitude = mLocation.getLatitude();\n mLongitude = mLocation.getLongitude();\n }\n } catch (SecurityException se) {\n Log.d(LOG_TAG, \"Security Exception\", se);\n }\n }", "public LatLng getLocation() {\n\t\treturn location;\n\t}", "private void getDeviceLocation( ) {\n\n if (searchLocationMarker != null) {\n searchLocationMarker.remove();\n }\n\n mFusedLocationProviderClient =\n LocationServices.getFusedLocationProviderClient(this);\n //Task locationResult = mFusedLocationProviderClient.getLastLocation();\n try {\n if (mLocationPermissionGranted) {\n Task locationResult = mFusedLocationProviderClient.getLastLocation();\n locationResult.addOnCompleteListener(this, new OnCompleteListener() {\n @Override\n public void onComplete(@NonNull Task task) {\n if (task.isSuccessful()) {\n // Set the map's camera position to the current location of the device.\n System.out.println(\"Current location retrieved successfully!\");\n mLastKnownLocation = (Location) task.getResult(); // location?\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(\n new LatLng(mLastKnownLocation.getLatitude(),\n mLastKnownLocation.getLongitude()), DEFAULT_ZOOM));\n searchLocationMarker = mMap.addMarker(new MarkerOptions()\n .position(new LatLng(mLastKnownLocation.getLatitude(),\n mLastKnownLocation.getLongitude()))\n .title(\"Current Location\")\n .icon(BitmapDescriptorFactory.fromBitmap(\n getBitmapFromVectorDrawable(\n MainActivity.this, R.drawable.ic_current_location_marker))));\n getNearbyStations(mLastKnownLocation.getLatitude(), mLastKnownLocation.getLongitude());\n\n } else {\n Log.d(TAG, \"Current location is null. Using defaults.\");\n Log.e(TAG, \"Exception: %s\", task.getException());\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(mDefaultLocation, DEFAULT_ZOOM));\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n searchLocationMarker = mMap.addMarker(new MarkerOptions()\n .position(mDefaultLocation)\n .title(\"Current Location\")\n .icon(BitmapDescriptorFactory.fromBitmap(\n getBitmapFromVectorDrawable(\n MainActivity.this, R.drawable.ic_current_location_marker))));\n }\n }\n });\n }\n } catch(SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n\n }", "public String getLocation() {\n return location;\n }", "public Location getLocation() {\n\t\treturn location;\n\t}", "public static MapLocation myLocation() {\n return RC.getLocation();\n }", "public int getLocation()\r\n {\n }", "public final Point getLocation() {\n return this.location ;\n }", "public String getLocation() {\n\t\treturn location;\n\t}", "public String getLocation() {\n\t\t\treturn location;\n\t\t}", "String getLocation();", "String getLocation();", "String getLocation();", "public ImPoint getCurrentLoc() {\n \treturn this.startLoc;\n }", "@SuppressLint({\"MissingPermission\", \"DefaultLocale\"})\n private void requestCurrentLocation() {\n mFusedLocationClient\n .getCurrentLocation(PRIORITY_HIGH_ACCURACY, cancellationTokenSource.getToken())\n .addOnCompleteListener(this, task -> {\n if (task.isSuccessful() && task.getResult() != null) {\n Location result = task.getResult();\n Log.d(TAG, String.format(\"getCurrentLocation() result: %s\", result.toString()));\n logOutputToScreen(String.format(\n \"Location (success): %f, %f\",\n result.getLatitude(), result.getLongitude()\n ));\n } else {\n Log.e(TAG, String.format(\"Location (failure): %s\", task.getException()));\n }\n });\n }", "public Location getLocation() {\n return location;\n }", "public Location getLocation() {\n return location;\n }", "public Location getLocation() {\n return location;\n }", "public Location getLocation() {\n return location;\n }", "public Vector2f getLocation() {\r\n\t\treturn location.getLocation();\r\n\t}", "public String getLocation() {\n\t\treturn \"-12.9990189,-38.5140298\";\n\t}", "public Point getLocation() {\n\t\treturn location;\n\t}" ]
[ "0.8443857", "0.82445425", "0.81527126", "0.8073036", "0.7912795", "0.7904184", "0.7898246", "0.7889197", "0.78827566", "0.78231585", "0.7797042", "0.77909327", "0.77720803", "0.77497834", "0.77449983", "0.77367145", "0.7687654", "0.76718634", "0.76660526", "0.76504385", "0.7632837", "0.76132137", "0.7530516", "0.7530516", "0.7530516", "0.7530516", "0.7524474", "0.7500848", "0.7474797", "0.7453033", "0.7452839", "0.7448588", "0.74276775", "0.73420465", "0.73199356", "0.7316215", "0.7300636", "0.72629464", "0.72474587", "0.7239475", "0.723522", "0.72291607", "0.7225336", "0.72209525", "0.7216979", "0.7206073", "0.7205614", "0.7205614", "0.719153", "0.7189854", "0.71813095", "0.7178367", "0.7164521", "0.71591574", "0.7155893", "0.71536165", "0.7151874", "0.71493864", "0.7147601", "0.71475375", "0.71474445", "0.7144509", "0.7144509", "0.7144509", "0.7144509", "0.7144509", "0.7144509", "0.7144509", "0.7144509", "0.7144509", "0.7144509", "0.7144509", "0.7144509", "0.7143396", "0.7143396", "0.7136054", "0.7131728", "0.7131703", "0.71290016", "0.7127228", "0.71194863", "0.7107521", "0.7103484", "0.7102941", "0.7101431", "0.7100309", "0.71001464", "0.710011", "0.7099637", "0.70990324", "0.70990324", "0.70990324", "0.709298", "0.70921123", "0.7067876", "0.7067876", "0.7067876", "0.7067876", "0.7066025", "0.7062121", "0.7057167" ]
0.0
-1
calls a phone number
public S<T> call(String number){ Intent callIntent = new Intent(Intent.ACTION_CALL); callIntent.setData(Uri.parse("tel:"+number)); activity.startActivity(callIntent); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void modifyCallFunc(String number) {\n Intent intent = new Intent(Intent.ACTION_DIAL);\n intent.setData(Uri.parse(\"tel:\" + number));\n startActivity(intent);\n }", "private void MakeCall() {\n String number = content_txt.getText().toString();\n if (number.trim().length() > 0) {\n int permissionCheck = ContextCompat.checkSelfPermission(this, Manifest.permission.CALL_PHONE);\n\n if (permissionCheck != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(\n this,\n new String[]{Manifest.permission.CALL_PHONE},\n 123);\n } else {\n String dial = \"tel:\" + number;\n Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse(dial));\n startActivity(intent);\n }\n }\n }", "@SuppressWarnings(\"ResourceType\")\n public static void callPhoneNum(Context context, String phoneNum) {\n Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse(\"tel:\" + phoneNum));\n context.startActivity(intent);\n }", "@Override\r\n \t\t\tpublic void onClick(View v) {\n \t\tIntent phoneIntent = new Intent(Intent.ACTION_CALL);\r\n phoneIntent.setData(Uri.parse(\"tel:\"+phoneNumber));\r\n startActivity(Intent.createChooser(phoneIntent, \"Calling number...\"));\r\n \t\t\t}", "@RequiresApi(api = Build.VERSION_CODES.M)\r\n private void callToHelplineNumber(String number) {\r\n Intent intentCall = new Intent(Intent.ACTION_CALL);\r\n intentCall.setData(Uri.parse(\"tel:\"+number));\r\n if (ActivityCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED)\r\n {\r\n Toast.makeText(getApplicationContext(),\"Please grant permission\",Toast.LENGTH_SHORT).show();\r\n requestPermissions();\r\n }\r\n else\r\n {\r\n startActivity(intentCall);\r\n }\r\n }", "@Override\r\n\t\tpublic void onClick(View arg0) {\n\t\t Intent intent =new Intent(Intent.ACTION_CALL);\r\n\t\t intent.setData(Uri.parse(\"tel:1031\"));\r\n\t\t startActivity(intent);\r\n\t\t}", "@Override\r\n\t\tpublic void onClick(View arg0) {\n\t\t Intent intent =new Intent(Intent.ACTION_CALL);\r\n\t\t intent.setData(Uri.parse(\"tel:9753057542\"));\r\n\t\t startActivity(intent);\r\n\t\t}", "@Override\n public void onClick(View v) {\n Uri number = Uri.parse(\"tel: 08963451822\");\n Intent call = new Intent(Intent.ACTION_DIAL);\n call.setData(number);\n startActivity(call);\n }", "@Override\r\n\t\tpublic void onClick(View arg0) {\n\t\t Intent intent =new Intent(Intent.ACTION_CALL);\r\n\t\t intent.setData(Uri.parse(\"tel:1091\"));\r\n\t\t startActivity(intent);\r\n\t\t}", "public static void openCallIntent(Context context, String phone) {\n if (Utils.isNullOrEmpty(phone)) {\n return;\n }\n\n Intent intent = new Intent(Intent.ACTION_CALL);\n intent.setData(Uri.parse(\"tel:\" + phone));\n context.startActivity(intent);\n }", "@Override\r\n\t\tpublic void onClick(View arg0) {\n\t\t Intent intent =new Intent(Intent.ACTION_CALL);\r\n\t\t intent.setData(Uri.parse(\"tel:1072\"));\r\n\t\t startActivity(intent);\r\n\t\t}", "@Override\r\n\t\tpublic void onClick(View arg0) {\n\t\t Intent intent =new Intent(Intent.ACTION_CALL);\r\n\t\t intent.setData(Uri.parse(\"tel:1407\"));\r\n\t\t startActivity(intent);\r\n\t\t}", "public void onPressNumber(View view) {\r\n CallHelper.callNumber(this, event.contactNumber);\r\n }", "@Override\n public void onClick(View view) {\n if (ContextCompat.checkSelfPermission(PhoneDialerActivity.this, Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED) {\n // cerem permisiuni de CALL\n ActivityCompat.requestPermissions(\n PhoneDialerActivity.this,\n new String[]{Manifest.permission.CALL_PHONE},\n Constants.PERMISSION_REQUEST_CALL_PHONE);\n // daca avem permisiunea de a efectua CALL\n } else {\n // generam o intentie pentru CALL\n Intent intent = new Intent(Intent.ACTION_CALL);\n intent.setData(Uri.parse(\"tel:\" + phoneNumberEditText.getText().toString()));\n // pornim activitatea de CALL\n startActivity(intent);\n }\n }", "private void Call()\n {\n Intent i = new Intent();\n i.setAction(Intent.ACTION_DIAL);\n i.setData(Uri.parse(\"tel:\" + number[index]));\n startActivity(i);\n Toast.makeText(this, \"Option call Chosen...\", Toast.LENGTH_LONG).show();\n }", "@Override\r\n\t\tpublic void onClick(View arg0) {\n\t\t Intent intent =new Intent(Intent.ACTION_CALL);\r\n\t\t intent.setData(Uri.parse(\"tel:1073\"));\r\n\t\t startActivity(intent);\r\n\t\t}", "private void makePhoneCall(View root){\n Log.d(TAG, \"makePhoneCall: call the teacher \" + tvTeachersFirstName + \" \" + tvTeachersLastName);\n // Checks if the app have permission to make a phone call\n if(ContextCompat.checkSelfPermission(root.getContext(),\n Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED){\n ActivityCompat.requestPermissions(getActivity(),\n new String[] {Manifest.permission.CALL_PHONE}, REQUEST_CALL);\n }\n else{\n if(tvTeachersPhoneNumber.getText().toString().contains(\"-\")) {\n tvTeachersPhoneNumber.getText().toString().replace(\"-\", \"\");\n }\n\n String dial = \"tel:\" + tvTeachersPhoneNumber.getText().toString();\n Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse(dial));\n startActivity(intent);\n }\n }", "@Override\r\n\t\tpublic void onClick(View arg0) {\n\t\t Intent intent =new Intent(Intent.ACTION_CALL);\r\n\t\t intent.setData(Uri.parse(\"tel:1071\"));\r\n\t\t startActivity(intent);\r\n\t\t}", "@Override\n\tpublic void Call() {\n\t\tSystem.out.println( phoneName+\"'s Call.\");\n\t}", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tIntent intent = new Intent(Intent.ACTION_CALL, Uri.parse(\"tel:\"\n\t\t\t\t\t\t+ phoneCode));\n\t\t\t\tmContext.startActivity(intent);\n\t\t\t}", "private void dialPhoneNumber(String phoneNumber) {\n Intent intent = new Intent(Intent.ACTION_DIAL);\n intent.setData(Uri.parse(\"tel:\" + phoneNumber));\n if (intent.resolveActivity(getPackageManager()) != null) {\n startActivity(intent);\n }\n }", "private void makePhoneCall(){\n String number1 = _txtTel1.getText().toString();\n String number2 = _txtTel2.getText().toString();\n if (number1.trim().length() > 0 && number2.trim().length() >0)\n {\n if (ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED)\n {\n ActivityCompat.requestPermissions(MainActivity.this,new String[]{Manifest.permission.CALL_PHONE},REQUEST_CALL);\n }\n else {\n AlertDialog call = MesOptions2();\n call.show();\n }\n }\n else if (number1.trim().length() > 0 && number2.trim().length() == 0 )\n {\n String dial = \"tel:\" + number1;\n startActivity(new Intent(Intent.ACTION_CALL, Uri.parse(dial)));\n }\n else\n {\n String dial = \"tel:\" + number2;\n startActivity(new Intent(Intent.ACTION_CALL, Uri.parse(dial)));\n }\n\n }", "@Override\r\n\t\tpublic void onClick(View arg0) {\n\t\t Intent intent =new Intent(Intent.ACTION_CALL);\r\n\t\t intent.setData(Uri.parse(\"tel:101\"));\r\n\t\t startActivity(intent);\r\n\t\t}", "private void makePhoneCall(){\n if(ContextCompat.checkSelfPermission(NotificationHelper.this, android.Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED){\n\n Toast.makeText(this, \"Phone call permission not given\", Toast.LENGTH_SHORT).show();\n // ActivityCompat.requestPermissions(Alarm2Activity.this, new String[] {android.Manifest.permission.CALL_PHONE}, REQUEST_CALL);\n }\n else{\n String number = \"+213658305662\";\n String phoneNum = \"tel:\" + number;\n startActivity(new Intent(Intent.ACTION_CALL, Uri.parse(phoneNum)));\n }\n }", "@Override\r\n\t\tpublic void onClick(View arg0) {\n\t\t Intent intent =new Intent(Intent.ACTION_CALL);\r\n\t\t intent.setData(Uri.parse(\"tel:100\"));\r\n\t\t startActivity(intent);\r\n\t\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tIntent intent=new Intent(Intent.ACTION_CALL);\n\t\t\t\tintent.setData(Uri.parse(\"tel:+8801744955241\"));\n\t\t\t\tstartActivity(intent);\n\t\t\t}", "@Override\r\n\t\tpublic void onClick(View arg0) {\n\t\t Intent intent =new Intent(Intent.ACTION_CALL);\r\n\t\t intent.setData(Uri.parse(\"tel:103\"));\r\n\t\t startActivity(intent);\r\n\t\t}", "public void launchPhone(){\n\t\tIntent sendIntent = new Intent(Intent.ACTION_DIAL);\n \tsendIntent.setData(Uri.parse(\"tel:\"));\n \t\n \tfinal ResolveInfo mInfo = pacman.resolveActivity(sendIntent, 0);\n \tString s = pacman.getApplicationLabel(mInfo.activityInfo.applicationInfo).toString();\n \t\n \tif (s != null && s.length() > 2) {\n startActivity(sendIntent);\n return;\n } else {\n \tToast.makeText(context, \"No Phone Call App Availible\", Toast.LENGTH_SHORT).show();\n \treturn;\n }\n\t}", "@Override\r\n\t\tpublic void onClick(View arg0) {\n\t\t Intent intent =new Intent(Intent.ACTION_CALL);\r\n\t\t intent.setData(Uri.parse(\"tel:102\"));\r\n\t\t startActivity(intent);\r\n\t\t}", "@Override\r\n\t\tpublic void onClick(View arg0) {\n\t\t Intent intent =new Intent(Intent.ACTION_CALL);\r\n\t\t intent.setData(Uri.parse(\"tel:108\"));\r\n\t\t startActivity(intent);\r\n\t\t}", "@Override\r\n\t\tpublic void onClick(View arg0) {\n\t\t Intent intent =new Intent(Intent.ACTION_CALL);\r\n\t\t intent.setData(Uri.parse(\"tel:104\"));\r\n\t\t startActivity(intent);\r\n\t\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tIntent callIntent = new Intent(Intent.ACTION_CALL);\n\t\t\t\tcallIntent.setData(Uri.parse(\"tel:\" + getIntent().getLongExtra(\"phone\", 0)));\n\t\t\t\tstartActivity(callIntent);\n\t\t\t}", "public void createPhoneIntent(View view){\n Intent intent = new Intent(Intent.ACTION_DIAL);\n\n //Step 2: Add the telephonne number as a data (URI) to the intent using \"tel:phone_num\";\n Uri uri = Uri.parse(\"tel:09095966472\");\n intent.setData(uri);\n\n //Step 3: Start the activity\n startActivity(intent);\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tif(phone_num_edt.getText().length() != 0){\n\t\t\t\t\tIntent callIntent = new Intent(Intent.ACTION_CALL);\n\t\t\t\t callIntent.setData(Uri.parse(\"tel:\" + phone_num_edt.getText().toString()));\n\t\t\t\t startActivity(callIntent);\n\t\t\t\t}else{\n\t\t\t\t\tphone_num_edt.setText(list.get(0).getCallnumber());\n\t\t\t\t\tphone_num_edt.setSelection(phone_num_edt.getText().length());\n\t\t\t\t}\n\t\t\t}", "@Override\n public void onDialPhone(@Nullable String phone) {\n if (phone == null) return;\n Log.d(TAG, \"onDialPhone: Phone:\" + phone);\n\n //ACTION_DIAL does not call directly\n //ACTION_CALL will call directly and app has to declare permission in manifest\n Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse(\"tel:\" + phone));\n if (intent.resolveActivity(getPackageManager()) != null) {\n startActivity(intent);\n }\n }", "public static void openDialerToCall(Context context, String mobileNo) {\n\n try {\n context.startActivity(\n new Intent(Intent.ACTION_DIAL).setData(Uri.parse(\"tel:\" + mobileNo))\n );\n } catch (Exception e) {e.printStackTrace();}\n }", "private void processCallGarage(String phone) {\n if (phone != null && phone.length() > 0){\n phone = phone.replaceAll(\"\\\\s+\",\"\");\n this.mPhone = phone;\n\n if (ContextCompat.checkSelfPermission(GarageListActivity.this, android.Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(GarageListActivity.this, new String[]{Manifest.permission.CALL_PHONE}, REQUEST_PHONE_CALL);\n } else {\n Intent callSupport = new Intent(Intent.ACTION_CALL, Uri\n .parse(\"tel:\" + mPhone));\n startActivity(callSupport);\n }\n }else {\n showMessage(\"Garage này chưa cập nhật số điện thoại!\");\n }\n\n }", "@OnClick({R.id.phone_img, R.id.phone})\n void OnClickPhone() {\n Intent intent=new Intent(Intent.ACTION_DIAL);\n intent.setData(Uri.parse(\"tel:\" + getString(R.string.here_comes_phone_no)));\n if (intent.resolveActivity(getPackageManager()) != null) {\n startActivity(intent);\n }\n }", "public void makeCall(Context context){\n dbAdapter = new ContactsDbAdapter(context);\n dbAdapter.open();\n\n Cursor contactsCursor= dbAdapter.fetchAllContacts();\n if (contactsCursor.getCount()!=0){\n contactsCursor.moveToFirst();\n\n System.out.println(\"NOMBRE: \" + contactsCursor.getString(1));\n System.out.println(\"TELEFONO: \" + contactsCursor.getString(2));\n phoneNumber=contactsCursor.getString(2);\n\n try{\n\n System.out.println(\"ey\");\n\n if(ContextCompat.checkSelfPermission(context, Manifest.permission.CALL_PHONE)\n != PackageManager.PERMISSION_GRANTED){\n\n System.out.println(\"No hay permiso de llamada\");\n\n }\n\n Intent intentLlamada = new Intent(Intent.ACTION_CALL, Uri.parse(\"tel:\"+phoneNumber));\n intentLlamada.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n context.startActivity(intentLlamada);\n\n } catch (Exception e){\n System.out.println(\"err\");\n e.printStackTrace();\n }\n\n }\n\n\n\n }", "@Override\n public void onClick(View v) {\n\n try {\n Intent intent = new Intent(Intent.ACTION_CALL, Uri.fromParts(\"tel\", current_number, null));\n startActivity(intent);\n }\n catch (Exception e)\n {\n\n }\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tString number = listdata.get(position).getCallnumber();\n\t\t\t\tIntent callIntent = new Intent(Intent.ACTION_CALL);\n\t\t\t callIntent.setData(Uri.parse(\"tel:\" + number));\n\t\t\t startActivity(callIntent);\n\t\t\t}", "public void onClick(View v) {\n\t\t\t\t\t\ttry {\n\t\t \t\t\t\tString phoneNumber = textViewsdt.getText().toString();\n\t\t \t\t\t \n\t\t \t\t\t\t\tIntent it = new Intent(Intent.ACTION_CALL);\n\t\t \t\t\t\t\tit.setData(Uri.parse(\"tel:\" + phoneNumber));\n\t\t \t\t\t\t\tstartActivity(it);\n\t\t \t\t\t\t}\n\t\t \t\t\t\tcatch (ActivityNotFoundException e) {\n\t\t \t\t\t\t\t// Exceptions\n\t\t \t\t\t\t}\n\t\t\t\t\t}", "@Override\n public void onClick(View v) {\n Intent intent = new Intent(Intent.ACTION_CALL, Uri\n .parse(\"tel://\"\n + number));\n startActivity(intent);\n alert.dismiss();\n }", "public static void openPhoneIntent(Context context, String phone) {\n if (Utils.isNullOrEmpty(phone)) {\n return;\n }\n\n Intent intent = new Intent(Intent.ACTION_DIAL);\n intent.setData(Uri.parse(\"tel:\" + phone));\n context.startActivity(intent);\n }", "@Override\n\tpublic void onClick(View arg0) {\n\t\t\n\t\tIntent callIntent = new Intent(Intent.ACTION_DIAL, Uri.parse(\"tel:555-2345\"));\n\t\tstartActivity(callIntent);\n\t}", "@OnClick(R.id.converter_organization_phone_iv)\n public void callToOrg() {\n if (ActivityCompat.checkSelfPermission(CashApplication.getContext(), Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED) {\n new DialogInfoCall(mContext);\n } else {\n Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse(\"tel:\" +\n mMainListForActions.get(mPositionOfCurInList).getOrganizations().get(mPositionOfOrgInList).getPhone()));\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(intent);\n }\n }", "@Override\n public void onClick(View v) {\n Intent intent = new Intent(Intent.ACTION_DIAL);\n intent.setData(Uri.parse(\"tel:\" + friend.getPhoneNo()));\n\n context.startActivity(intent);\n }", "@Override\n public void onClick(View view) {\n String phoneNumber = supplierPhoneEditText.getText().toString().trim();\n Intent intent = new Intent(Intent.ACTION_DIAL);\n intent.setData(Uri.parse(\"tel:\" + phoneNumber));\n startActivity(intent);\n }", "java.lang.String getUserPhone();", "@Override\n public void onClick(View v) {\n Intent intent = new Intent(Intent.ACTION_CALL);\n intent.setData(Uri.parse(\"tel:\" + mItem.getNumber()));\n try {\n startActivity(intent);\n } catch (SecurityException e) {\n // Swallow exception\n }\n }", "@Override\n public void onClick(View v) {\n Intent intent = new Intent(Intent.ACTION_DIAL);\n intent.setData(Uri.parse(\"tel:041-746-8795\"));\n startActivity(intent);\n }", "public void onClick(View v) {\n Intent intent = new Intent(Intent.ACTION_DIAL);\n intent.setData(Uri.parse(\"tel:4089242222\"));\n startActivity(intent);\n }", "@SuppressLint(\"NewApi\")\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\n\t\t\t\tif (contact_no.equalsIgnoreCase(\"null\") || contact_no.length() == 0\n\t\t\t\t\t\t|| contact_no.isEmpty()) {\n\t\t\t\tToast.makeText(SingleShop.this,\"No Contact details \", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t/* toast */\n\t\t\t\t} else {\n\t\t\t\t\tString phn_no = \"tel:\" + contact_no;\n\t\t\t\t\tIntent callIntent = new Intent(Intent.ACTION_CALL);\n\t\t\t\t\tcallIntent.setData(Uri.parse(phn_no));\n\t\t\t\t\tstartActivity(callIntent);\n\t\t\t\t}\n\n\t\t\t}", "@Override\n\t\t\t\tpublic void onClick(DialogInterface arg0, int arg1) {\n\t\t\t\t\tUri uri=Uri.parse(\"tel:\"+ mPhone.getText()); //拨打电话号码的URI格式\n\t\t\t\t\tIntent it=new Intent(); //实例化Intent\n\t\t\t\t\tit.setAction(Intent.ACTION_CALL); //指定Action\n\t\t\t\t\tit.setData(uri); //设置数据\n\t\t\t\t\tstartActivity(it);//启动Acitivity\n\t\t\t\t}", "public void callSellerButton(View Button){\n Intent i = getIntent();\n String contact = i.getStringExtra(\"contact\").toString();\n Intent callIntent = new Intent(Intent.ACTION_CALL);\n callIntent.setData(Uri.parse(\"tel:\"+contact));\n startActivity(callIntent);\n }", "public void onClick(View v) {\n Intent intent = new Intent(Intent.ACTION_DIAL);\n intent.setData(Uri.parse(\"tel:4082778911\"));\n startActivity(intent);\n }", "@VisibleForTesting\n public boolean dial(byte[] address, String number) {\n return dialNative(address, number);\n }", "private void callContactByName() {\n final ContactBook cb = ContactBook.getSharedInstance();\n words = text.split(\" \");\n try {\n if (words[0].contains(\"ing\")) {\n intent = new Intent(Intent.ACTION_CALL);\n String searchString = \"\";\n for (int i = 1; i < words.length; i++) {\n searchString += words[i] + \" \";\n }\n contact = cb.getClosestMatch(searchString);\n }\n if (contact != null) {\n if (contact.getDefaultNumber() != null && contact.getName() != null) {\n intent.setData(Uri.parse(\"tel:\" + contact.getDefaultNumber()));\n TextToSpeechUtility.readAloud(\"ringer \" + contact.getName());\n while (TextToSpeechUtility.isSpeaking()) {\n Thread.sleep(100);\n }\n startActivity(intent);\n finish();\n }\n }\n } catch (Throwable t) {\n }\n\n }", "java.lang.String getPhoneNumber();", "java.lang.String getPhoneNumber();", "java.lang.String getPhoneNumber();", "public void onClick(View v) {\n\t\t\tcallPhone();\n\t\t}", "public String getPhoneNumber(){\n\t\t \n\t\t TelephonyManager mTelephonyMgr;\n\t\t mTelephonyMgr = (TelephonyManager)\n\t\t activity.getSystemService(Context.TELEPHONY_SERVICE); \n\t\t return mTelephonyMgr.getLine1Number();\n\t\t \n\t\t}", "SdkPhone selectOne(SdkPhoneExample example);", "@Override\n public void callUsers(String userPhone) {\n }", "@Override\n public void onClick(View v) {\n try {\n Intent callIntent = new Intent(Intent.ACTION_CALL);\n callIntent.setData(Uri.parse(\"tel:\" + books.getBuy()));\n context.startActivity(callIntent);\n\n } catch (ActivityNotFoundException e) {\n Log.e(\"helloandroid dialing \", \"Call failed\", e);\n }\n }", "public void showCallDialog() {\n new AlertDialog.Builder(this)\n .setTitle(getString(R.string.ms_callDIalog_call_ask)).setMessage(getString(R.string.ms_callDialog_call_contact) + \" \" + user.getNom() + \" \" + user.getPrenom() + \" \" + getString(R.string.ms_callDialog_call_end))\n .setPositiveButton(getString(R.string.ms_callDialog_call), new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse(getString(R.string.ms_callDialog_phone) + \" \" + user.getTelephone()));\n try {\n startActivity(intent);\n }\n catch(SecurityException e) {\n e.printStackTrace();\n }\n }\n })\n .setNegativeButton(getString(R.string.ms_callDialog_stop), new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n }\n }).show();\n }", "@Override\n public void onClick(View v) {\n String phoneNumber=PhoneNumberEdit.getText().toString();\n\n //if you don't write anything on pone number\n if (PhoneNumberEdit.getText().toString().isEmpty())\n {\n //setting error\n PhoneNumberEdit.setError(\"Phone number is EMPTY \");\n PhoneNumberEdit.requestFocus();\n\n }\n //if the phone number length didn't match with indian std\n else if (PhoneNumberEdit.getText().toString().length()!=10)\n {\n //setting the error\n PhoneNumberEdit.setError(\"The number you entered didn't have 10 digit \");\n PhoneNumberEdit.requestFocus();\n }\n else\n {\n\n //if those two are ok then this happen\n //phone authentication in authentication firebase\n PhoneAuthOptions options=PhoneAuthOptions.newBuilder(mAuth)\n //giving the phone number to send otp\n .setPhoneNumber(\"+91\"+phoneNumber)\n //setting the timer\n .setTimeout(60L, TimeUnit.SECONDS)\n //setting activity\n .setActivity(MainActivity.this)\n //callback function to know we get the response\n .setCallbacks(mCallBacks)\n //build it\n .build();\n\n //passing the object of phone auth options\n PhoneAuthProvider.verifyPhoneNumber(options);\n\n }\n\n }", "public void setPhoneNumber(java.lang.CharSequence value) {\n this.phone_number = value;\n }", "@Override\n public void onClick(View v) {\n\n try {\n if (Utils.isNetWorkConnected(ErpCustomerDetailActivity.this)) {\n makeCall(number);\n } else {\n Toast.makeText(ErpCustomerDetailActivity.this, \"网络错误,请重试!\",\n Toast.LENGTH_LONG).show();\n }\n alert.dismiss();\n//\t\t\t\t\teditText_phone_number.setText(\"\");\n } catch (Exception e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\n }", "@Override\n public void onClick(View v) {\n Intent intent = new Intent(Intent.ACTION_DIAL);\n //Se envian datos asociados a ese Intent\n intent.setData(Uri.parse(\"tel:88854764\"));\n //Se envia el intent\n startActivity(intent);\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tUri uri = Uri.parse(\"tel:6581890\");\n\t\t\t\tIntent intent = new Intent(Intent.ACTION_DIAL, uri);\n\t\t\t\tstartActivity(intent);\n\t\t\t}", "@Override\n public void onClick(View v) {\n number = \"112\";\n String s = \"tel:\" + number;\n Intent intent = new Intent(Intent.ACTION_CALL);\n intent.setData(Uri.parse(s));\n if (ActivityCompat.checkSelfPermission(MainActivity.this, Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED) {\n return;\n }\n startActivity(intent);\n\n //for Location:\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n if (getApplicationContext().checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n\n fusedLocationProviderClient.getLastLocation()\n .addOnSuccessListener(new OnSuccessListener<Location>() {\n @Override\n public void onSuccess(Location location) {\n if (location != null) {\n latitude = location.getLatitude();\n longitude = location.getLongitude();\n\n sendsms();\n\n }\n }\n });\n\n\n } else\n requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, 0);\n }\n }", "String getPhone(int type);", "void requestSendSMSCode(Context context,String phone);", "private void checkBalance() {\n String ussdCode = \"*131\"+ Uri.encode(\"#\");\n startActivity(new Intent(Intent.ACTION_CALL,Uri.parse(\"tel:\"+ussdCode)));\n }", "public GoldenContactBuilder phone(String value) {\n phone = value;\n return this;\n }", "public com.politrons.avro.AvroPerson.Builder setPhoneNumber(java.lang.CharSequence value) {\n validate(fields()[3], value);\n this.phone_number = value;\n fieldSetFlags()[3] = true;\n return this; \n }", "public String inputPhoneNumber() {\n String phoneNumber = editTextPhoneNumber.getText().toString();\n return phoneNumber;\n }", "@Override\n public void onClick(View v) {\n Intent intent=new Intent(Intent.ACTION_CALL_BUTTON);\n //intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(intent);\n }", "@NeedsPermission(Manifest.permission.CALL_PHONE)\n public void handleACall(String text) {\n Intent intent = new Intent(Intent.ACTION_CALL);\n\n intent.setData(Uri.parse(\"tel:\" + text));\n\n if (ActivityCompat.checkSelfPermission(getContext(), Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED) {\n handleCopyingTextToClipboard(text);\n return;\n }\n\n getContext().startActivity(intent);\n\n }", "public void communicate() {\r\n System.out.println(\"This iPhone is making a phone call.\");\r\n }", "@Step\r\n\tpublic void enterPhone(String phone) {\r\n\t\tLOGGER.info(\"Entering phone: \" + phone);\r\n\t\tphoneInput.type(phone);\r\n\t}", "java.lang.String getPhone();", "public void dialButtonPressed(boolean isIpCall) {\n if (isDigitsEmpty()) { // No number entered.\n if (phoneIsCdma() && phoneIsOffhook()) {\n // This is really CDMA specific. On GSM is it possible\n // to be off hook and wanted to add a 3rd party using\n // the redial feature.\n startActivity(newFlashIntent());\n } else {\n if (!TextUtils.isEmpty(mLastNumberDialed)) {\n // Recall the last number dialed.\n mDigits.setText(mLastNumberDialed);\n\n // ...and move the cursor to the end of the digits string,\n // so you'll be able to delete digits using the Delete\n // button (just as if you had typed the number manually.)\n //\n // Note we use mDigits.getText().length() here, not\n // mLastNumberDialed.length(), since the EditText widget now\n // contains a *formatted* version of mLastNumberDialed (due to\n // mTextWatcher) and its length may have changed.\n mDigits.setSelection(mDigits.getText().length());\n } else {\n // There's no \"last number dialed\" or the\n // background query is still running. There's\n // nothing useful for the Dial button to do in\n // this case. Note: with a soft dial button, this\n // can never happens since the dial button is\n // disabled under these conditons.\n playTone(ToneGenerator.TONE_PROP_NACK);\n }\n }\n } else {\n final String number = mDigits.getText().toString();\n\n // \"persist.radio.otaspdial\" is a temporary hack needed for one carrier's automated\n // test equipment.\n // TODO: clean it up.\n if (number != null\n && !TextUtils.isEmpty(mProhibitedPhoneNumberRegexp)\n && number.matches(mProhibitedPhoneNumberRegexp)\n && (SystemProperties.getInt(\"persist.radio.otaspdial\", 0) != 1)) {\n Log.i(TAG, \"The phone number is prohibited explicitly by a rule.\");\n if (getActivity() != null) {\n DialogFragment dialogFragment = ErrorDialogFragment.newInstance(\n R.string.dialog_phone_call_prohibited_title);\n dialogFragment.show(getFragmentManager(), \"phone_prohibited_dialog\");\n }\n\n // Clear the digits just in case.\n mDigits.getText().clear();\n } else {\n final Intent intent = newDialNumberIntent(number);\n if (getActivity() instanceof DialtactsActivity) {\n intent.putExtra(DialtactsActivity.EXTRA_CALL_ORIGIN,\n DialtactsActivity.CALL_ORIGIN_DIALTACTS);\n }\n\t\t if(isIpCall){\n\t\t \tintent.putExtra(IP_CALL_MODE_KEY,isIpCall) ;\n\t\t }\n startActivity(intent);\n mDigits.getText().clear(); // TODO: Fix bug 1745781\n getActivity().finish();\n }\n }\n }", "int getPhone();", "String formatPhoneNumber(String phoneNumber);", "@Override\n public void onClick(View v) {\n switch (v.getId()) {\n case R.id.call_phone_1:\n if (cellNums != null) {\n showNumDialog(cellNums);\n } else {\n callPhone(personInfoCellphone.getText().toString().trim());\n }\n break;\n case R.id.call_phone_2:\n if (telNums != null) {\n showNumDialog(telNums);\n } else {\n /*callPhone(personInfoTelphone.getText().toString().trim());*/\n }\n break;\n case R.id.btn_resumeinfo_note:\n showNoteDialog();\n break;\n }\n\n }", "public void onClick(DialogInterface dialog, int id) {\n Intent intent = new Intent( Intent.ACTION_CALL, Uri.parse( \"tel:17\" ) );\n activity.startActivity(intent);\n }", "public long getPhoneNumber() {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t// getter method initialized\t\t\t\t \r\n Scanner scanner = new Scanner(System.in);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t// Initialize the scanner to get input from User\r\n System.out.print(\"Enter Phone Number : \");\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t // This will print the argument at the end of the line\r\n phoneNumber = scanner.nextLong();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Read long input from the User\r\n String inputPhoneNumber = Long.toString(phoneNumber);\t\t\t\t\t\t\t\t\t\t // convert Long to string.\r\n Pattern pattern = Pattern.compile(\"\\\\d{10}\");\t\t\t\t\t\t\t\t\t\t\t // The Pattern class represents a compiled regular expression.\r\n Matcher matcher = pattern.matcher(inputPhoneNumber );\t\t\t\t\t\t\t\t\t\t\t\t\t // The resulting Pattern object is used to obtain a Matcher instance.\r\n if (matcher.matches());\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t // if loop ..to check input from the User\r\n else {\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// else loop started\r\n System.out.println(\"Invalid Phone Number - Please enter the Phone number again\");}\t\t \t// This will print the argument at the end of the line\t\r\n return phoneNumber;}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tif(!edittext_mobNo.getText().toString().equals(\"not available\"))\n\t\t\t\tcalltoMobilenumber(edittext_mobNo.getText().toString());\n\t\t\t}", "void formatPhoneNumber(String phoneNumber) throws PhoneNumberFormatException;", "java.lang.String getPhonenumber();", "@Step\n public void enterPhoneNumberForPurchase(String number){\n actionWithWebElements.enterTextIntoInput(phoneNumberInput, number);\n }", "public static void main(String[] args) {\n\t\t\t\n\t\t\t\n\t\t\t\n\t\tScanner scan = new Scanner (System.in);\n\t\t\n\t\t\t\n\t\t\tSystem.out.println(\"Enter your area code: \");\n\t\t\tint areaCode = scan.nextInt();\n\t\t\t\n\t\t\tSystem.out.println(\"Enter local number: \");\n\t\t\tint localNumber = scan.nextInt();\n\t\t\t//(617)-8202117\n\t\t\tString phoneNumber = \"(\" + areaCode + \")-\" + localNumber;\n\t\t\t\n\t\t\tSystem.out.println(\"Calling number \" + phoneNumber);\n\t\t\t\n\t\t\t\n\t\t}", "public static int placeCall(Context context, Phone phone, String number, Uri contactRef,\n boolean isEmergencyCall, RawGatewayInfo gatewayInfo, CallGatewayManager callGateway) {\n final Uri gatewayUri = gatewayInfo.gatewayUri;\n\n if (VDBG) {\n log(\"placeCall()... number: '\" + number + \"'\"\n + \", GW:'\" + gatewayUri + \"'\"\n + \", contactRef:\" + contactRef\n + \", isEmergencyCall: \" + isEmergencyCall);\n } else {\n log(\"placeCall()... number: \" + toLogSafePhoneNumber(number)\n + \", GW: \" + (gatewayUri != null ? \"non-null\" : \"null\")\n + \", emergency? \" + isEmergencyCall);\n }\n final PhoneGlobals app = PhoneGlobals.getInstance();\n\n boolean useGateway = false;\n if (null != gatewayUri &&\n !isEmergencyCall &&\n PhoneUtils.isRoutableViaGateway(number)) { // Filter out MMI, OTA and other codes.\n useGateway = true;\n }\n\n int status = CALL_STATUS_DIALED;\n Connection connection;\n String numberToDial;\n if (useGateway) {\n // TODO: 'tel' should be a constant defined in framework base\n // somewhere (it is in webkit.)\n if (null == gatewayUri || !PhoneAccount.SCHEME_TEL.equals(gatewayUri.getScheme())) {\n Log.e(LOG_TAG, \"Unsupported URL:\" + gatewayUri);\n return CALL_STATUS_FAILED;\n }\n\n // We can use getSchemeSpecificPart because we don't allow #\n // in the gateway numbers (treated a fragment delim.) However\n // if we allow more complex gateway numbers sequence (with\n // passwords or whatnot) that use #, this may break.\n // TODO: Need to support MMI codes.\n numberToDial = gatewayUri.getSchemeSpecificPart();\n } else {\n numberToDial = number;\n }\n\n try {\n connection = app.mCM.dial(phone, numberToDial, VideoProfile.STATE_AUDIO_ONLY);\n } catch (CallStateException ex) {\n // CallStateException means a new outgoing call is not currently\n // possible: either no more call slots exist, or there's another\n // call already in the process of dialing or ringing.\n Log.w(LOG_TAG, \"Exception from app.mCM.dial()\", ex);\n return CALL_STATUS_FAILED;\n\n // Note that it's possible for CallManager.dial() to return\n // null *without* throwing an exception; that indicates that\n // we dialed an MMI (see below).\n }\n\n int phoneType = phone.getPhoneType();\n\n // On GSM phones, null is returned for MMI codes\n if (null == connection) {\n status = CALL_STATUS_FAILED;\n } else {\n if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {\n updateCdmaCallStateOnNewOutgoingCall(app, connection);\n }\n\n if (gatewayUri == null) {\n // phone.dial() succeeded: we're now in a normal phone call.\n // attach the URI to the CallerInfo Object if it is there,\n // otherwise just attach the Uri Reference.\n // if the uri does not have a \"content\" scheme, then we treat\n // it as if it does NOT have a unique reference.\n String content = context.getContentResolver().SCHEME_CONTENT;\n if ((contactRef != null) && (contactRef.getScheme().equals(content))) {\n Object userDataObject = connection.getUserData();\n if (userDataObject == null) {\n connection.setUserData(contactRef);\n } else {\n // TODO: This branch is dead code, we have\n // just created the connection which has\n // no user data (null) by default.\n if (userDataObject instanceof CallerInfo) {\n ((CallerInfo) userDataObject).contactRefUri = contactRef;\n } else {\n ((CallerInfoToken) userDataObject).currentInfo.contactRefUri =\n contactRef;\n }\n }\n }\n }\n\n startGetCallerInfo(context, connection, null, null, gatewayInfo);\n }\n\n return status;\n }", "@Override\r\n public void onClick(View v)\r\n {\n if (v.equals(mButtonOk))\r\n {\r\n // 提交手机号修改\r\n HttpConnectionUtils hcu = new HttpConnectionUtils(handler);\r\n hcu.addGetParmeter(\"phone\", \"13488791001\");\r\n hcu.addGetParmeter(\"password\", \"123456\");\r\n hcu.get(Url.ModifyPhonenumber, HttpConnectEvent.HTTP_MODIFY_PHONENUMBER);\r\n }\r\n \r\n }", "@Override\r\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tRandom ra=new Random();\r\n\t\t\t\tint val=ra.nextInt(999);\r\n\t\t\t\tSmsManager sms=SmsManager.getDefault();\r\n\t\t\t\tsms.sendTextMessage(txt_phone.getText().toString(), null, val+\"\", null, null);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tIntent i=new Intent(getApplicationContext(), OTP_Reg.class);\r\n\t\t\t\ti.putExtra(\"name\", txt_name.getText().toString());\r\n\t\t\t\ti.putExtra(\"phone\", txt_phone.getText().toString());\r\n\t\t\t\ti.putExtra(\"otp\", val+\"\");\r\n\t\t\t\t\r\n\t\t\t\tstartActivity(i);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t}", "private void sendVerificationCode(String phone_number){\n Log.d(TAG, \"sendVerificationCode: SENDING OTP\");\n progressBar.setVisibility(View.VISIBLE);\n PhoneAuthProvider.getInstance().verifyPhoneNumber(\n phone_number,\n 60,\n TimeUnit.SECONDS,\n TaskExecutors.MAIN_THREAD,\n mCallBack\n );\n }", "@Override\n public void onClick(DialogInterface dialog, int which) {\n Intent callOnwerIntent = new Intent(Intent.ACTION_DIAL,\n Uri.parse(\"tel:\"+gym.getOwnerMobile().toString()));\n startActivity(callOnwerIntent);\n }" ]
[ "0.75522166", "0.7540618", "0.75180054", "0.74408364", "0.73005694", "0.727056", "0.7224948", "0.72094536", "0.7189703", "0.7176292", "0.716873", "0.71670145", "0.71440256", "0.71328515", "0.7128965", "0.7116939", "0.710489", "0.7093095", "0.7092473", "0.7063048", "0.70572245", "0.7022133", "0.7017497", "0.6987289", "0.6979206", "0.69768226", "0.6956342", "0.69515616", "0.6945162", "0.6936199", "0.6904665", "0.6883409", "0.6873919", "0.68725437", "0.685511", "0.68177515", "0.68091553", "0.67750204", "0.67532253", "0.6734109", "0.67020184", "0.6700674", "0.66859245", "0.6640368", "0.6616549", "0.6599592", "0.6571823", "0.65490675", "0.65354615", "0.64835185", "0.645716", "0.64430135", "0.639552", "0.63776374", "0.6375238", "0.6325269", "0.6317276", "0.6314787", "0.6294292", "0.6294292", "0.6294292", "0.6270295", "0.62650025", "0.6247202", "0.6243229", "0.6216032", "0.6198124", "0.6186001", "0.61853975", "0.61711335", "0.6157801", "0.6157624", "0.6150221", "0.6079508", "0.6055602", "0.6041807", "0.6036099", "0.6021267", "0.6019474", "0.60107356", "0.6008576", "0.60080737", "0.5982552", "0.5982517", "0.5966933", "0.5950017", "0.5947809", "0.59308654", "0.59108734", "0.5910111", "0.59094816", "0.59062374", "0.59014314", "0.58983636", "0.58957595", "0.58894396", "0.58832103", "0.5879627", "0.58729327", "0.58728284" ]
0.74806774
3
make the device vibrate
public S<T> vibrate(int duration) { Vibrator vibs = (Vibrator) activity.getSystemService(Context.VIBRATOR_SERVICE); vibs.vibrate(duration); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void vibrate() {\n this.sexyVibrator.vibrate(400);\n }", "private void vibrate() {\r\n Vibrator vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);\r\n vibrator.vibrate(300); //vibrates for 300 milliseconds.\r\n }", "private void VibrateButton(){\n\t\t\n\t\tvbrate = (Vibrator)PurchaseTicket.this.getSystemService(Context.VIBRATOR_SERVICE);\n\t\tvbrate.vibrate(100);\n\t}", "private static void sendVibrateIntent() {\n\t\tIntent intent = new Intent(\"org.metawatch.manager.VIBRATE\");\n\t\tBundle b = new Bundle();\n\t\tb.putInt(\"vibrate_on\", 500);\n\t\tb.putInt(\"vibrate_off\", 500);\n\t\tb.putInt(\"vibrate_cycles\", 3);\n\t\tintent.putExtras(b);\n\t\tcontext.sendBroadcast(intent);\n\t\treturn;\n\t}", "public void vibrate() {\n if ((deltaX > vibrateThreshold) || (deltaY > vibrateThreshold) || (deltaZ > vibrateThreshold)) {\n v.vibrate(50);\n status = true;\n } else {\n status = false;\n }\n }", "private void vibrateContinually(){\n vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);\n long[] pattern = new long[]{0,400,1000,600,1000,800,1000};\n\n if (Build.VERSION.SDK_INT >= 26) {\n vibrator.vibrate(VibrationEffect.createWaveform(pattern, 0));\n } else {\n vibrator.vibrate(pattern, 0);\n }\n }", "static void vibrate() {\n String currentState = SettingDetail.settingDetails.get(VIBRATION_SETTING).getCurrentState();\n int ringerMode = audioManager.getRingerMode();\n if (currentState.equals(context.getString(R.string.enabled))\n || (currentState.equals(context.getString(R.string.followSystem))\n && (ringerMode == AudioManager.RINGER_MODE_NORMAL || ringerMode == AudioManager.RINGER_MODE_VIBRATE))) {\n vibrator.vibrate(VibrationEffect.createOneShot(100, VibrationEffect.DEFAULT_AMPLITUDE));\n }\n }", "@SuppressLint(\"MissingPermission\")\n protected void vibrate() {\n if (ContextCompat.checkSelfPermission(getContext(), Manifest.permission.VIBRATE)\n == PackageManager.PERMISSION_GRANTED && vibratingEnabled) {\n vibrator.vibrate(VIBRATION_DURATION);\n }\n }", "public void setVibrate(Boolean vibrate_on){\n this.vibrate_on = vibrate_on;\n }", "public static void vibrate(Context context) {\n vibrate(context, VIBRATE_TIME);\n }", "private void vibrateWiimote(int millis) {\r\n\t\tOscMessage msg = new OscMessage(\"/jumprope\");\r\n\t\tmsg.add(millis);\r\n\t\tosc.send(msg, addr);\r\n\t}", "public void vibrate(long period)\n {\n Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);\n v.vibrate(period);\n }", "public void ActiveVibrate(int intensity) {\n startVibration(intensity);\n new Timer().schedule(new TimerTask() {\n public void run() {\n }\n }, 500);\n }", "public static void vibrate(Context context, int duration) {\n Vibrator v = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);\n v.vibrate(duration);\n }", "private void startHwVibrate(int vibrateMode) {\n if (!(isKeyguardLocked() || (this.mHapticEnabled ^ 1) != 0 || StorageUtils.SDCARD_ROMOUNTED_STATE.equals(SystemProperties.get(\"runtime.mmitest.isrunning\", StorageUtils.SDCARD_RWMOUNTED_STATE)) || this.mVibrator == null)) {\n Log.d(TAG, \"startVibrateWithConfigProp:\" + vibrateMode);\n this.mVibrator.vibrate((long) vibrateMode);\n }\n }", "public void setVibrationOn() {\n\n }", "public static void vibrate(Context context, long milliseconds) {\n Vibrator vibrator = getInstance(context);\n vibrator.vibrate(milliseconds);\n }", "private void setVibrate(@NonNull NotificationCompat.Builder builder) {\n if (mFplReminder.isNotificationVibration()) {\n builder.setVibrate(getDefaultVibratePattern());\n }\n }", "void vibrate(double radiansFromNorth, double radiansOfArch, double durationInMS) throws IOException;", "@Override\n public void tryVibrate() {\n performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY\n /*(5) - HapticFeedbackConstants.CALENDAR_DATE*/);\n }", "public void vibrate(RumbleType type,float value){\n if (value < 0)\n value = 0;\n else if (value > 1)\n value = 1;\n if (type == RumbleType.left || type == RumbleType.combined)\n \tlRumble = (short)(value*65535);\n if(type == RumbleType.right || type == RumbleType.combined)\n \trRumble = (short)(value*65535);\n FRCNetworkCommunicationsLibrary.HALSetJoystickOutputs((byte)port, 0, lRumble, rRumble);\n }", "private static native void triggerVibration(long pointer,\n long controllerHandle,\n short leftSpeed,\n short rightSpeed);", "private void doVibrateTest(Preference preference) {\n\t\tVibrator vibrate = (Vibrator) preference.getContext().getSystemService(\n\t\t\t\tContext.VIBRATOR_SERVICE);\n\t\tvibrate.vibrate(NotificationSetting.getVibration(\n\t\t\t\tInteger.parseInt(mAccountVibratePattern.getValue()),\n\t\t\t\tInteger.parseInt(mAccountVibrateTimes.getValue())), -1);\n\t}", "@Override\r\n\tpublic void onClick(View v) {\n\t\tString vsn=Context.VIBRATOR_SERVICE;\r\n\t\tVibrator vib;\r\n\t\tvib=(Vibrator)getSystemService(vsn);\r\n\t\tvib.vibrate(100);\r\n\t\t\r\n\t\tfinish();\r\n\t}", "public static void vibrate(Context context, long[] pattern, int repeat) {\n Vibrator vibrator = getInstance(context);\n vibrator.vibrate(pattern, repeat);\n }", "public void setVibrationOff() {\n\n }", "public boolean setVibrate() {\n boolean isVibrate = checkVibrate();\n editor.putBoolean(Constans.KeyPreference.TURN_VIBRATE, !isVibrate);\n editor.commit();\n return !isVibrate;\n }", "public void setVideobitrate(int videobitrate) {\n this.videobitrate = videobitrate;\n }", "public void m6656s() {\n if (Build.VERSION.SDK_INT >= 26 && this.f5405Y.getRingerMode() != 0) {\n this.f5432na.vibrate(VibrationEffect.createOneShot(12, 75));\n }\n }", "public static void shakeItBaby(Context context) {\n try {\n if (Build.VERSION.SDK_INT >= 26) {\n ((Vibrator) context.getSystemService(VIBRATOR_SERVICE)).vibrate(VibrationEffect.createOneShot(\n 150, VibrationEffect.DEFAULT_AMPLITUDE));\n } else {\n ((Vibrator) context.getSystemService(VIBRATOR_SERVICE)).vibrate(150);\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "void setPWMRate(double rate);", "@Override\r\n\tpublic void onReceive(Context context, Intent intent) {\n\t\tVibrator v = (Vibrator) context\r\n\t\t\t\t.getSystemService(Context.VIBRATOR_SERVICE);\r\n\t\tv.vibrate(500);\r\n\r\n\t\t// also display a toast.\r\n\t\tToast.makeText(context, \"Boradcast received successfully\",\r\n\t\t\t\tToast.LENGTH_LONG).show();\r\n\t}", "@Override\n public void onReceive(Context context, Intent intent) {\n\n Log.d(\"We are in the receiver.\", \"YAY!\");\n\n boolean switchToVibrate = intent.getExtras().getBoolean(\"switchToVibrate\");\n\n Intent service_intent = new Intent(context, ProfileChangeService.class);\n service_intent.putExtra(\"switchToVibrate\", switchToVibrate);\n context.startService(service_intent);\n }", "private void automaticBinding() {\n if (SensorReaderService.isRunning()){\n doBindService();\n } else{\n startSensingService();\n doBindService();\n }\n if (v != null) {\n v.vibrate(500);\n }\n }", "private void setUpRingtoneAndVibration(int vibration) {\n AudioManager am = (AudioManager) getSystemService(Context.AUDIO_SERVICE);\n am.setStreamVolume(AudioManager.STREAM_ALARM, am.getStreamMaxVolume(AudioManager.STREAM_ALARM), AudioManager.FLAG_PLAY_SOUND);\n\n Uri alarmUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM);\n if (alarmUri == null) {\n alarmUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n }\n try {\n mediaPlayer.setDataSource(this, alarmUri);\n mediaPlayer.setLooping(true);\n mediaPlayer.setAudioStreamType(AudioManager.STREAM_ALARM);\n mediaPlayer.prepare();\n mediaPlayer.start();\n if (vibration == 1) {\n vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);\n vibrator.vibrate(vibrationPattern, 0);\n }\n } catch (Exception e) {\n\n }\n }", "private void determinationVATRate(Vehicle vehicle) {\n if (vehicle.getEngineType().name().equals(\"electric\")) {\n vehicle.setVATRate(0);\n } else {\n vehicle.setVATRate(20);\n }\n }", "public void volumeUp(){\n Intent intent = new Intent(getApplicationContext(), TouchController.class);\n intent.setAction(Constant.ACTION_VOLUME_UP);\n startService(intent);\n }", "public void setRate();", "public void Click(View v) {\n\t\t//Manager.adjustVolume(AudioManager.ADJUST_LOWER, 0);\n\t\t//Manager.adjustVolume(AudioManager.ADJUST_LOWER, AudioManager.FLAG_SHOW_UI);\n\t\tSystemVolume = Manager.getStreamVolume(AudioManager.STREAM_SYSTEM);\n\t\tRingVolume = Manager.getStreamVolume(AudioManager.STREAM_RING);\n\t\tNotificationVolume = Manager.getStreamVolume(AudioManager.STREAM_NOTIFICATION);\n\t\tManager.setStreamVolume(AudioManager.STREAM_NOTIFICATION|AudioManager.STREAM_RING|AudioManager.STREAM_SYSTEM, 0, AudioManager.FLAG_REMOVE_SOUND_AND_VIBRATE|AudioManager.FLAG_SHOW_UI);\n\t\t//timer.start();\n\t}", "public void enableSystemSound() {\n if (this.mAppContext != null) {\n Log.m19d(TAG, \"enableSystemSound\");\n try {\n StatusBarProvider.getInstance().disable(this.mAppContext, 0);\n setStreamMute(false);\n if (getRecorderState() != 3 && this.mAudioManager.getRingerMode() == 2) {\n this.mAudioManager.adjustStreamVolume(2, 100, 0);\n Settings.System.putInt(this.mAppContext.getContentResolver(), \"vibrate_when_ringing\", this.mVibrateWhileRingingState);\n }\n } catch (SecurityException e) {\n Log.m32w(TAG, \"enableSystemSound : \" + e);\n }\n }\n }", "private static void remind(Context context, String message) { \n Toast.makeText(context, message, Toast.LENGTH_LONG).show();\n Vibrator vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);\n vibrator.vibrate(VIBRATE_MILLIS);\n }", "public void changeBackgroudColorForTimeInSec(double time) {\n long timeLong = (long) (time * 1000);\n\n // make vibration\n Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);\n // Vibrate for 500 milliseconds\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n v.vibrate(VibrationEffect.createOneShot(500, VibrationEffect.DEFAULT_AMPLITUDE));\n } else {\n //deprecated in API 26\n v.vibrate(500);\n }\n\n //play sound\n MediaPlayer mediaPlayer = MediaPlayer.create(this, R.raw.moonless);\n mediaPlayer.start();\n\n //change color\n scroolViewScanner.setBackgroundColor(Color.RED);\n scroolViewDefect.setBackgroundColor(Color.RED);\n linLayOverView.setBackgroundColor(Color.RED);\n Handler handler = new Handler();\n handler.postDelayed(new Runnable() {\n public void run() {\n // Actions to do after\n scroolViewScanner.setBackgroundColor(Color.TRANSPARENT);\n scroolViewDefect.setBackgroundColor(Color.TRANSPARENT);\n linLayOverView.setBackgroundColor(Color.TRANSPARENT);\n }\n }, timeLong); // delay\n }", "public void brake() {\n\t\tsetPower(Motor.STOP);\r\n\t}", "public void calibrate() {\r\n\t\tbuttonListener.displayMessage(\"Calibrating\", 1);\r\n\t\ttry {\r\n\t\t\tTimeUnit.SECONDS.sleep(2);\r\n\t\t}\r\n\t\tcatch (Exception e){\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t}", "public void onClick(View v) {\n VXLocation testLocation = new VXLocation();\n testLocation.setToneControl(2);\n testLocation.setVibeControl(3);\n testLocation.vibrateAndRingAri(TestViewActivity.this);\n }", "@Override\n\t\t\t\tpublic void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n\t\t\t\t\tif(!isChecked ){\n \t\t \n \t vibratorv = 0;\n\t\t\t\t\t\tv.setValue(0);\n \t }else{\n \t vibratorv = 1;\n \t \tv.setValue(1);\n \t }\n\t\t\t\t\t}", "@Override\n\tpublic double selectPower(int vid) {\n\t\treturn vb.selectPower(vid);\n\t}", "public void setVelocity () {\n\t\t\tfb5.getCommunicationModule().setClientHandler(null);\n\t\t\tif(state == BotMove.SHARP_RIGHT){\n\t\t\t\tfb5.setVelocity((byte)200,(byte)0);\n\t\t\t}\n\t\t\telse if(state == BotMove.LEFT){\n\t\t\t\tfb5.setVelocity((byte)100,(byte)200);\n\t\t\t}\n\t\t\telse if(state == BotMove.SOFT_RIGHT){\n\t\t\t\tfb5.setVelocity((byte)200,(byte)100);\n\t\t\t}\n\t\t\telse if(state == BotMove.FORWARD){\n\t\t\t\twt.turning = false;\n\t\t\t\tLog.d(TAG,\"Setting forward velocity\");\n\t\t\t\tfb5.setVelocity((byte)150,(byte)150);\n\t\t\t\t\n\t\t\t}\n\t\t\telse if(state == BotMove.STOP){\n\t\t\t\twt.turning = false;\n\t\t\t\tfb5.setVelocity((byte)0,(byte)0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfb5.moveForward();\n\t\t\tfb5.accModifiedStart();\n\t\t}", "protected void spin(int stops, int velocity) {\n totalStops=stops;\n remainingStops=stops;\n doBreak=false;\n if (stops>0) {\n gambleScreen.inMotion(this,true);\n }\n this.velocity=velocity;\n }", "private long[] getDefaultVibratePattern() {\n return new long[]{0, 150, 100, 150};\n }", "@Override\n protected void accelerate() {\n System.out.println(\"Bike Specific Acceleration\");\n }", "public void startAlarm() {\n\n vibri.vibrate(pattern, 0);\n ringring.play();\n timer.cancel();\n }", "public void victorTest(){\n\n victorTestController.set(0.5);\n }", "public void onToggleClicked(View view) {\n\t boolean on = ((ToggleButton) view).isChecked();\n\t \n\t if (on) {\n\t // Enable vibrate\n\t } else {\n\t // Disable vibrate\n\t }\n\t}", "public void accelerate(){\n speed += 5;\n }", "public void stopVibration() {\n this.mVibrator.cancel();\n LtUtil.log_i(\"GripSensorTestTouchIc\", \"stopVibration\", \"Vibration stop\");\n }", "@Override\n \t public void onClick(View v) {\n \t\tRegno=(EditText) findViewById(R.id.regno);\n \t\tRouteno=(EditText) findViewById(R.id.routeno);\n \t\tDriver =(EditText) findViewById(R.id.name);\n \t\tPhone = (EditText) findViewById(R.id.phone);\n \t\t\n \t\tmrg = Regno.getText().toString();\n \t\tmrn = Routeno.getText().toString();\n \t\tmd = Driver.getText().toString();\n \t\tmp = Phone.getText().toString();\n \t\t\n \t\tIntent intentVibrate =new Intent(getApplicationContext(),VibrateService.class);\n \t\tstartService(intentVibrate);\n \t\t \t\t\n \t\t sendData();\n \t\t }", "public static void setVibrateNotificationType(Context context, VibrateType vibrateNotificationType)\n\t{\n\t\tPreferenceUtils.setVibrateType(context, vibrateNotificationType);\n\t}", "public void updateRate(double r){\r\n rate *= r;\r\n }", "private void CalibrateGyro() {\n BNO055IMU.Parameters parameters = new BNO055IMU.Parameters();\n parameters.mode = BNO055IMU.SensorMode.IMU;\n parameters.angleUnit = BNO055IMU.AngleUnit.DEGREES;\n imu.initialize(parameters);\n while (!imu.isGyroCalibrated()){}\n }", "public void setCurrentSpeed (double speed);", "public void volumeDown(){\n Intent intent = new Intent(getApplicationContext(), TouchController.class);\n intent.setAction(Constant.ACTION_VOLUME_DOWN);\n startService(intent);\n }", "public void update() {\n if (!hasStarted) {\n //drive.setAutonStraightDrive();\n hasStarted = true;\n } else {\n if (Math.abs((Math.abs(rotations) - (Math.abs(drive.getRightSensorValue() / 4096)))) <= TOLERANCE) {\n drive.setBrakeMode(true);\n setFinished(true);\n }\n }\n\n }", "public synchronized void send() {\n if (AudioUtil.getIs()) {\n LogUtil.d(Tag, \"VR stop\");\n this.mPCMPackageHead.m4053c(CommonParams.bB);\n this.mPCMPackageHead.m4047a(0);\n writeVR(this.mPCMPackageHead.m4048a(), this.mPCMPackageHead.m4049b());\n }\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t\n\t\t\t\tif(player!=null){\n\t\t\t\t\tif(!isVoiceFlags){\n\t\t\t\t\t\tplayer.setVolume(0f, 0f);\n\t\t\t\t\t\tvideoView.start();\n\t\t\t\t\t\tisVoiceFlags=true;\n\t\t\t\t\t\timg_volumvideo.setBackgroundResource(TapfunsResourceUtil.findDrawableIdByName(AlertVideoActivity.this, \"volumvideo\"));\n\t\t\t\t\t}else{\n\t\t\t\t\t\tplayer.setVolume(1f, 1f);\n\t\t\t\t\t\tvideoView.start();\n\t\t\t\t\t\tisVoiceFlags=false;\n\t\t\t\t\t\timg_volumvideo.setBackgroundResource(TapfunsResourceUtil.findDrawableIdByName(AlertVideoActivity.this, \"volumclosevideo\"));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "public void onClick(View v) {\n\t\t\t\t\n\t\t\t\tvibrate.vibrate(75);\n\t\t\t\t\n\t\t\t\tIntent cameraControlIntent = new Intent(v.getContext(), CameraControlActivity.class);\n\t\t startActivityForResult(cameraControlIntent, 0);\n\t\t\t}", "public void setRate(int rate) { this.rate = rate; }", "@Override\r\n\tpublic void powerOn() {\n\t\tSystem.out.println(\"ig tv power on\");\r\n\t}", "public void setStarvationRate ( int ticks ) {\n\t\texecute ( handle -> handle.setStarvationRate ( ticks ) );\n\t}", "public void playIvtEffect() {\n if (this.isVibrateImplemented && 1 == Settings.System.getInt(this.mContext_Vibrate.getContentResolver(), \"touch_vibrate_mode\", 1)) {\n if (this.mContext_Vibrate.checkCallingOrSelfPermission(\"android.permission.VIBRATE\") != 0) {\n Log.e(TAG, \"playIvtEffect Method requires android.Manifest.permission.VIBRATE permission\");\n return;\n }\n try {\n Class<?> mClazz_vibetonzImpl = mClassLoader.loadClass(\"com.immersion.VibetonzImpl\");\n Object object_vibetonzImpl = mClazz_vibetonzImpl.getMethod(\"getInstance\", new Class[0]).invoke(null, new Object[0]);\n mClazz_vibetonzImpl.getMethod(\"playIvtEffect\", new Class[]{String.class}).invoke(object_vibetonzImpl, new Object[]{\"NUMBERPICKER_ITEMSCROLL\"});\n } catch (ClassNotFoundException e) {\n Log.e(TAG, \"ClassNotFoundException in reflect playIvtEffect in set object\");\n } catch (NoSuchMethodException e2) {\n Log.e(TAG, \"no field in reflect playIvtEffect in set object\");\n } catch (IllegalAccessException e3) {\n e3.printStackTrace();\n } catch (IllegalArgumentException e4) {\n Log.e(TAG, \"IllegalArgumentException in reflect playIvtEffect in set object\");\n } catch (InvocationTargetException e5) {\n Log.e(TAG, \"InvocationTargetException in reflect playIvtEffect in set object\");\n } catch (RuntimeException e6) {\n Log.e(TAG, \"RuntimeException in reflect playIvtEffect in set object\");\n } catch (Exception e7) {\n Log.e(TAG, \"Exception in reflect playIvtEffect in set object\");\n }\n }\n }", "public static void enableSound() {\n\t\tvelocity = 127;\n\t}", "public interface IBeltApi extends ICloseable {\r\n /**\r\n * Start the belt vibrating in the indicated direction for the specified duration.\r\n * @param radiansFromNorth radians left of north in which the belt should indicate.\r\n * @param radiansOfArch an arch with with its mid point centered on the radiansFromNorth which should be include in the indication.\r\n * This provides the ability to have a fine or bord direction indication.\r\n * @param durationInMS duration in milliseconds the indication should last.\r\n * @throws IOException\r\n */\r\n void vibrate(double radiansFromNorth, double radiansOfArch, double durationInMS) throws IOException;\r\n\r\n /**\r\n * Stops any current indication the device is communicating.\r\n * @throws IOException\r\n */\r\n void stop() throws IOException;\r\n}", "@Override\r\n\tprotected void onResume() {\n\t\tsuper.onResume();\r\n\t\tupdateBt(BT_VIRUS);\r\n\t}", "private void turnOn(View v) {\n bluetoothAdapter.enable();\n }", "void changeUpdateSpeed();", "public void increaseVolume() {\n String json = new Gson().toJson(new TelevisionModel(TelevisionModel.Action.INCREASE_VOLUME));\n String a = sendMessage(json);\n TelevisionModel teleM = new Gson().fromJson(a, TelevisionModel.class);\n System.out.println(\"Client Received \" + json);\n\n if (teleM.getAction() == TelevisionModel.Action.INCREASE_VOLUME) {\n isIncreasingVolume = teleM.getValue();\n ui.updateArea(teleM.getMessage());\n };\n }", "@Override\r\n\tpublic void volumeUp() {\n\t\tSystem.out.println(\"ig tv volume on\");\r\n\r\n\t}", "protected void onChange_VaccRate() {\n onChange_VaccRate_xjal( VaccRate );\n }", "private void playVideo(float volume) {\n }", "public void upgradeAuto(View v){\n if(timertrue){ //to make sure that multiple instances of timer are not created\n timer();\n timertrue = false;\n }\n\n if((total - autovalue*10000) >= 0) {\n total -= autovalue * 10000;\n autovalue += 0.001*0.1*value;\n TextView TextAuto = (TextView)\n findViewById(R.id.TextAuto); //displays autoclicks per second\n TextAuto.setText(Double.toString(round(autovalue * 1000, 2)));\n\n\n TextView myTextView = (TextView)\n findViewById(R.id.textView);\n myTextView.setText(Double.toString(round(total,2)));\n }\n }", "public void changeSpeed(int speed);", "public void setFrameRate(float aValue) { setInterval(Math.round(1000/aValue)); }", "@Override\n public void onRmsChanged(float rmsdB) {\n }", "public void setVelocity(double velocity) {\n m_motor.set(ControlMode.Velocity, toEncoderPulsesPer100ms(velocity));\n }", "public void onClick(View v) {\n\t\t\t\t\n\t\t\t\tvibrate.vibrate(75);\n\t\t\t\t\n\t\t\t\tIntent settingIntent = new Intent(v.getContext(), SettingActivity.class);\n\t\t startActivityForResult(settingIntent, 0);\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(final ActionEvent evt) {\n\t\t\t\tdoSendOn(440, 1001);\n\t\t\t\tsecondSynthButtonOn.setEnabled(false);\n\t\t\t\tsecondSynthButtonOff.setEnabled(true);\n\t\t\t\tslider2.setEnabled(true);\n\t\t\t\tslider2.setValue(2050);\n\t\t\t\ttextBox2.setEnabled(true);\n\t\t\t\ttextBox2.setText(\"440.0\");\n\t\t\t}", "public void currentSpeed()\n\t{\n\t\tif(speed == 0)\n\t\t{\n\t\t\tSystem.out.println(\"The bike is in rest\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"The bike is in motion\");\n\t\t\t\n\t\t}\n\t}", "private void setAudioProfilModem() {\n int ringerMode = mAudioManager.getRingerModeInternal();\n ContentResolver mResolver = mContext.getContentResolver();\n Vibrator vibrator = (Vibrator) mContext\n .getSystemService(Context.VIBRATOR_SERVICE);\n boolean hasVibrator = vibrator == null ? false : vibrator.hasVibrator();\n if (AudioManager.RINGER_MODE_SILENT == ringerMode) {\n if (hasVibrator) {\n Settings.System.putInt(mResolver,\n Settings.System.SOUND_EFFECTS_ENABLED, 0);\n /* SPRD: fixbug454214 The status bar scene mode button is not synchronized with the button set up the scene mode. @{ */\n //mAudioManager.setRingerMode(AudioManager.RINGER_MODE_VIBRATE);\n mAudioManager.setRingerModeInternal(AudioManager.RINGER_MODE_VIBRATE);\n /* @} */\n mAudioManager.setVibrateSetting(\n AudioManager.VIBRATE_TYPE_RINGER,\n AudioManager.VIBRATE_SETTING_ON);\n mAudioManager.setVibrateSetting(\n AudioManager.VIBRATE_TYPE_NOTIFICATION,\n AudioManager.VIBRATE_SETTING_ON);\n } else {\n Settings.System.putInt(mResolver,\n Settings.System.SOUND_EFFECTS_ENABLED, 1);\n /* SPRD: fixbug454214 The status bar scene mode button is not synchronized with the button set up the scene mode. @{ */\n //mAudioManager.setRingerMode(AudioManager.RINGER_MODE_NORMAL);\n mAudioManager.setRingerModeInternal(AudioManager.RINGER_MODE_NORMAL);\n /* @} */\n }\n } else if (AudioManager.RINGER_MODE_VIBRATE == ringerMode) {\n Settings.System.putInt(mResolver,\n Settings.System.SOUND_EFFECTS_ENABLED, 1);\n /* SPRD: fixbug454214 The status bar scene mode button is not synchronized with the button set up the scene mode. @{ */\n //mAudioManager.setRingerMode(AudioManager.RINGER_MODE_NORMAL);\n mAudioManager.setRingerModeInternal(AudioManager.RINGER_MODE_OUTDOOR);\n /* @} */\n }else if (AudioManager.RINGER_MODE_OUTDOOR == ringerMode) {//add by wanglei for outdoor mode\n Settings.System.putInt(mResolver,Settings.System.SOUND_EFFECTS_ENABLED, 1);\n mAudioManager.setRingerModeInternal(AudioManager.RINGER_MODE_NORMAL);\n }else {\n Settings.System.putInt(mResolver,\n Settings.System.SOUND_EFFECTS_ENABLED, 0);\n /* SPRD: fixbug454214 The status bar scene mode button is not synchronized with the button set up the scene mode. @{ */\n //mAudioManager.setRingerMode(AudioManager.RINGER_MODE_SILENT);\n mAudioManager.setRingerModeInternal(AudioManager.RINGER_MODE_SILENT);\n /* @} */\n if (hasVibrator) {\n mAudioManager.setVibrateSetting(\n AudioManager.VIBRATE_TYPE_RINGER,\n AudioManager.VIBRATE_SETTING_OFF);\n mAudioManager.setVibrateSetting(\n AudioManager.VIBRATE_TYPE_NOTIFICATION,\n AudioManager.VIBRATE_SETTING_OFF);\n }\n }\n }", "public void onClick(View v) {\n\n\n b.vibrate(500);\n t.setText(\"DONE\");\n s.getYell(t,getApplicationContext());\n\n\n }", "public boolean getVibrationEnabled() {\n SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);\n return prefs.getBoolean(\"vibration_switch\", true);\n }", "@Override\n public void onReceive(Context context, Intent intent) {\n Vibrator vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);\n vibrator.vibrate(4000);\n \n \n \tIntent i = new Intent(context, AlarmclockActivity.class); \n \ti.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); \n \tcontext.startActivity(i);\n \n\tMediaPlayer mediaPlayer = MediaPlayer.create(context, R.raw.alarm);\n\tmediaPlayer.start();\n\t\n\t\n\t\n PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);\n PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP, \"DoNjfdhotDimScreen\");\n wl.acquire();\n \n }", "public static void playBLow() throws InterruptedException\n\t{\n\t\tchannels[channel].noteOn( 59, volume );//B\n\t\tThread.sleep(200);\n\t}", "@Override\n\tpublic void set(double speed) {\n\t\tsuper.changeControlMode(TalonControlMode.PercentVbus);\n\t\tsuper.set(speed);\n\t\tsuper.enableControl();\n\t}", "@Test(timeout=5000)\n public void testPVDevice() throws Exception\n {\n final PVDevice device = new PVDevice(new DeviceInfo(\"sim://sine\", \"demo\"));\n device.start();\n try\n {\n device.addListener(this);\n\n // Wait for update\n updates.await();\n }\n finally\n {\n device.stop();\n }\n }", "public void teleopPeriodic() {\n\n \t//NetworkCommAssembly.updateValues();\n \t\n\t\t// both buttons pressed simultaneously, time to cal to ground\n\t\tif (gamepad.getRawButton(FRONT_ARM_GROUND_CAL_BUTTON1) && gamepad.getRawButton(FRONT_ARM_GROUND_CAL_BUTTON2)) {\n\t\t\tprocessGroundCal();\n\t\t}\n\n\t\t// PID CONTROL ONLY\n\t\tdouble armDeltaPos = gamepad.getRawAxis(1);\n\t\tif (Math.abs(armDeltaPos) < ARM_DEADZONE) {\n\t\t\tarmDeltaPos = 0.0f;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tarmDeltaPos *= ARM_POS_MULTIPLIER;\n\t\t\tdouble currPos = testMotor.getPosition();\n\t\t\t\n\t\t\tif (((currPos > SOFT_ENCODER_LIMIT_MAX) && armDeltaPos > 0.0) || ((currPos < SOFT_ENCODER_LIMIT_FLOOR) && armDeltaPos < 0.0)) {\n\t\t\t\tSystem.out.println(\"SOFT ARM LIMIT HIT! Setting armDeltaPos to zero\");\n\t\t\t\tarmDeltaPos = 0.0;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tdouble newPos = currPos + armDeltaPos;\n\t\t\ttestMotor.set(newPos);\n\t\t\tSystem.out.println(\"Setting new front arm pos = \" + newPos);\t\n\t\t}\t\t\n\n \t/*\n\t\tdouble newArmPos = gamepad.getRawAxis(1);\n\t\tif(Math.abs(newArmPos) <= ARM_DEADZONE) {\n\t\t\tnewArmPos = 0.0;\n\t\t}\n\t\tdouble newMotorPos = (newArmPos * ARM_SPEED_MULTIPLIER) + testMotor.getPosition();\n\t\tpositionMoveByCount(newMotorPos);\n\t\tSystem.out.println(\"input = \" + newArmPos + \" target pos = \" + newMotorPos + \" enc pos = \" + testMotor.getPosition());\n \t*/\n \t\n\t\t// PercentVbus test ONLY!!\n \t/*\n\t\tdouble armSpeed = gamepad.getRawAxis(1);\n\t\tif (Math.abs(armSpeed) < ARM_DEADZONE) {\n\t\t\tarmSpeed = 0.0f;\n\t\t}\t\n\t\tarmSpeed *= ARM_MULTIPLIER;\n\t\t\n\t\tdouble pos= testMotor.getPosition();\n\t\tif (((pos > SOFT_ENCODER_LIMIT_1) && armSpeed < 0.0) || ((pos < SOFT_ENCODER_LIMIT_2) && armSpeed > 0.0))\n\t\t\tarmSpeed = 0.0;\n\t\ttestMotor.set(armSpeed);\n\t\t\n\t\tSystem.out.println(\"armSpeed = \" + armSpeed + \" enc pos = \" + testMotor.getPosition());\n\t\t */ \n }", "public void increaseVolume()\r\n {\r\n volume++;\r\n }", "void accelerate() {\n isAccelerating = true;\n Bukkit.getScheduler().scheduleSyncRepeatingTask(Cars.getInstance(), new BukkitRunnable() {\n @Override\n public void run() {\n if (!isAccelerating) {\n cancel();\n return;\n } else if (CAR.getAcceleration(DIRECTION.getOpposite()).isAccelerating) {\n // Just stop the car if both cars are accelerating because it means the driver is holding down 's'\n // and 'w' at the same time.\n CAR.stopCompletely();\n return;\n }\n\n Minecart minecart = CAR.getMinecart();\n Vector velocity = minecart.getVelocity();\n velocity.add(/* TODO ACCELERATION direction*/new Vector());\n if (velocity.length() >= minecart.getMaxSpeed()) isAccelerating = false;\n minecart.setDerailedVelocityMod(velocity);\n }\n }, 1, 1);\n }", "@Override\n\tpublic void currentGear(double speed) {\n\t\tthis.speed = speed;\n\t\tif(speed>0&& speed<5)\n\t\t{\n\t\t\tgears = 1;\n\t\t\tSystem.out.println(\"The speed of the bike is \"+speed);\n\t\t\tSystem.out.println(\"The current gear of bike is \" +gears );\n\t\t}\n\t\telse if(speed>=5 && speed<10)\n\t\t{\n\t\t\tgears = 2;\n\t\t\tSystem.out.println(\"The speed of the bike is \"+speed);\n\t\t\tSystem.out.println(\"The current gear of bike is \" +gears );\n\t\t}\n\t\telse if(speed>=10 && speed<20)\n\t\t{\n\t\t\tgears = 3;\n\t\t\tSystem.out.println(\"The speed of the bike is \"+speed);\n\t\t\tSystem.out.println(\"The current gear of bike is \" +gears );\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.err.println(\"You cant drive at this speed\");\n\t\t}\n\t\t\n\t}", "@Override\n public void valueChanged(double control_val) {\n playbackRate.setValue((float)control_val);\n // Write your DynamicControl code above this line\n }", "@Override\n\tpublic void powerOn() {\n\t\tSystem.out.println(\"samsongTV powerOn\");\n\n\t}" ]
[ "0.8462373", "0.8291353", "0.80505306", "0.80357486", "0.8020023", "0.7936694", "0.7877772", "0.76971334", "0.75369114", "0.73947364", "0.7337693", "0.7200725", "0.7082359", "0.70257884", "0.69993997", "0.69628245", "0.68547213", "0.67401177", "0.6583718", "0.6556827", "0.64903", "0.6459969", "0.64364463", "0.6395242", "0.6387679", "0.63481545", "0.6219578", "0.61481357", "0.613999", "0.60378826", "0.60168225", "0.6001408", "0.587137", "0.5725832", "0.5647573", "0.56256807", "0.5605254", "0.5576386", "0.5553079", "0.55294013", "0.55220497", "0.5496619", "0.5475922", "0.54687166", "0.54556715", "0.5437531", "0.54280955", "0.54235506", "0.5422541", "0.5422433", "0.54224193", "0.54201084", "0.5412301", "0.54029876", "0.5390988", "0.5378281", "0.5376624", "0.536781", "0.53531754", "0.53531086", "0.53503275", "0.5344969", "0.533641", "0.53361225", "0.53260183", "0.53207606", "0.5313716", "0.53109336", "0.53082234", "0.53044826", "0.5301799", "0.5298206", "0.5279005", "0.5269485", "0.5264523", "0.5262864", "0.52610034", "0.5234059", "0.5229866", "0.52281916", "0.51982284", "0.5183064", "0.51779574", "0.5174533", "0.5142977", "0.5138114", "0.51223403", "0.51216406", "0.51099837", "0.5106777", "0.5100709", "0.510035", "0.5100175", "0.5099971", "0.50991917", "0.5095077", "0.50931406", "0.5081303", "0.50766474", "0.50750375" ]
0.6108776
29
Download a file have to add service in the manifest service android:name="com.southapps.squery.utility.DownloadService"
@SuppressLint("NewApi") public S<T> download(String url){ // declare the dialog as a member field of your activity String fileName = url.substring( url.lastIndexOf('/')+1, url.length() ); //if(!service){ // instantiate it within the onCreate method mProgressDialog = new ProgressDialog(activity); mProgressDialog.setMessage("Downloading ..."); mProgressDialog.setIndeterminate(true); mProgressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); mProgressDialog.setCancelable(true); mProgressDialog.show(); Intent intent = new Intent(activity, DownloadService.class); intent.putExtra("url", url); intent.putExtra("filename", fileName); intent.putExtra("receiver", new DownloadReceiver(new Handler())); activity.startService(intent); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@SuppressLint(\"NewApi\")\r\n\tprivate void downloadFile() {\n\t\tLog.d(TAG, \"In fuction downloadFile()\");\r\n\t\tSimpleDateFormat dateFormat = new SimpleDateFormat(\"dd-MM-yy\");\r\n \tCalendar cal = Calendar.getInstance();\r\n \tString programmaNameUnderscore = mName.replace(\" \", \"_\");\r\n \tprogrammaNameUnderscore = programmaNameUnderscore.replace(\",\",\"\");\r\n \tString fileName = programmaNameUnderscore + \"_\" + dateFormat.format(cal.getTime())+\".mp3\";\r\n \t\r\n \t\r\n\t\tRequest request = new Request(Uri.parse(mDownloadUrl));\r\n\t\trequest.setDescription(mName);\r\n \t// in order for this if to run, you must use the android 3.2 to compile your app\r\n \tif (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {\r\n \t request.allowScanningByMediaScanner();\r\n \t request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);\r\n \t}\r\n \trequest.setDestinationInExternalPublicDir(Environment.DIRECTORY_MUSIC, getString(R.string.download_subdir_test) + File.separator + fileName);\r\n\t}", "@Override \r\n public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype, \r\n\t long contentLength) {\n \tString filename = SDHelper.getAppDataPath() + File.separator \r\n\t\t\t\t\t+ getFilename(url);\r\n \tFile file =new File(filename);\r\n \tif (file.exists()) {\r\n\t\t\t\tIntent intent = new Intent(Intent.ACTION_VIEW);\r\n\t\t\t\tintent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\r\n\t\t\t\tString ext = getExt(file);\r\n\t\t\t\tString mark = null;\r\n\t\t\t if (ext.equalsIgnoreCase(\"doc\")||ext.equalsIgnoreCase(\"docx\"))\r\n\t\t\t\t\tmark = \"application/msword\";\r\n\t\t\t\telse if (ext.equalsIgnoreCase(\"xls\")||ext.equalsIgnoreCase(\"xlsx\"))\r\n\t\t\t\t\tmark = \"application/vnd.ms-excel\";\r\n\t\t\t\telse if (ext.equalsIgnoreCase(\"ppt\")||ext.equalsIgnoreCase(\"pptx\"))\r\n\t\t\t\t\tmark = \"application/vnd.ms-powerpoint\";\r\n\t\t\t\telse if (ext.equalsIgnoreCase(\"pdf\"))\r\n\t\t\t\t\tmark = \"application/pdf\";\r\n\t\t\t\t\r\n\t\t\t\telse if (ext.equalsIgnoreCase(\"apk\"))\r\n\t\t\t\t\tmark = \t\"application/vnd.android.package-archive\"; \r\n\t\t\t\tintent.setDataAndType(Uri.fromFile(file), mark);\r\n\t\t\t\tmContext.startActivity(intent);\r\n\r\n \t}\r\n \telse \r\n \t new getFileAsync().execute(url);\r\n \t\r\n \t}", "private void startDownload() {\n Uri uri = Uri.parse( data.getStringExtra(PARAM_URL) );\n dm = (DownloadManager) getSystemService(DOWNLOAD_SERVICE);\n DownloadManager.Request request = new DownloadManager.Request( uri );\n request.setAllowedNetworkTypes( DownloadManager.Request.NETWORK_MOBILE | DownloadManager.Request.NETWORK_WIFI)\n //移动网络情况下是否允许漫游。\n .setAllowedOverRoaming(false)\n .setTitle(\"更新\") // 用于信息查看\n .setDescription(\"下载apk\"); // 用于信息查看\n //利用此属性下载后使用响应程序打开下载文件\n //request.setMimeType(\"application/vnd.android.package-archive\");\n request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, new Date().getTime()+\".apatch\");\n enqueue = dm.enqueue(request);\n }", "@Override\n // Download file\n protected void onHandleIntent(@Nullable Intent intent) {\n String address = intent.getStringExtra(\"URL\");\n // Conecction with url\n HttpURLConnection connection = null;\n // Stream for save content\n OutputStream streamToFile = null;\n try {\n // Get filename from URL\n URL url = new URL(address);\n File file = new File(url.getFile());\n String fileName = file.getName();\n // Create new file\n DocumentFile directory = DocumentFile.fromTreeUri(this, uri);\n DocumentFile dFile = directory.createFile(\"\", fileName);\n // Make connection\n connection = (HttpURLConnection) url.openConnection();\n // Stream for fetching data\n DataInputStream dataInputStream = new DataInputStream(connection.getInputStream());\n // Initialize stream for writing\n streamToFile = getContentResolver().openOutputStream(dFile.getUri());\n\n //streamToFile = new FileOutputStream(f);\n // Buffor for data\n byte buffor[] = new byte[100];\n // Amount of readed data\n int gotBytes = dataInputStream.read(buffor, 0, 100);\n // Total readed data\n int totalBytes = 0;\n // Read untill end of file\n while (gotBytes != -1) {\n // Write read data to buffer\n streamToFile.write(buffor, 0, gotBytes);\n // How many bytes read\n gotBytes = dataInputStream.read(buffor, 0, 100);\n // Add readed bytes to total counter\n totalBytes += gotBytes;\n // Send message with readed bytes\n sendBroadcast(totalBytes);\n }\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n // Close connetions\n if (connection != null)\n connection.disconnect();\n\n if (streamToFile != null) {\n try {\n streamToFile.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n }", "public void onDownloadFile2(View view) {\n String url = \"http://txt.99dushuzu.com/download-txt/3/21068.txt\";\n EasyHttp.downLoad(url)\n .savePath(Environment.getExternalStorageDirectory().getPath()+\"/test/QQ\")\n .saveName(FileUtils.getFileName(url))\n .execute(new DownloadProgressCallBack<String>() {\n @Override\n public void update(long bytesRead, long contentLength, boolean done) {\n int progress = (int) (bytesRead * 100 / contentLength);\n HttpLog.e(progress + \"% \");\n dialog.setProgress(progress);\n if (done) {\n dialog.setMessage(\"下载完成\");\n }\n }\n\n @Override\n public void onStart() {\n dialog.show();\n }\n\n @Override\n public void onComplete(String path) {\n showToast(\"文件保存路径:\" + path);\n dialog.dismiss();\n }\n\n @Override\n public void onError(ApiException e) {\n showToast(e.getMessage());\n dialog.dismiss();\n }\n });\n }", "private void DownloadFile(String url){\n ContentManager contentManager = ContentManager.getInstance();\n String fileName = contentManager.getCurrentPlayingSongTitle().trim();\n fileName = TextUtil.removeAccent(fileName);\n fileName += url.substring(url.length()-4, url.length());\n final FileDownloadWorker fileDownloadWorker = new FileDownloadWorker(getContext(), true, this);\n fileDownloadWorker\n .setDialogMessage(getContext().getString(R.string.wait_downloading))\n .setHorizontalProgressbar()\n .setDialogCancelCallback(getContext().getString(R.string.hide), new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n fileDownloadWorker.showNotificationProgress();\n }\n });\n fileDownloadWorker.execute(url, fileName);\n }", "public void downloadFile() {\n String path = images.get(viewPager.getCurrentItem()).getFilePath();\n String uRl = \"https://image.tmdb.org/t/p/w500\" + path;\n String name = path.substring(1, 5);\n File direct = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + \"/Cinemato\");\n if (!direct.exists()) {\n direct.mkdirs();\n }\n DownloadManager mgr = (DownloadManager) Objects.requireNonNull(getContext())\n .getSystemService(Context.DOWNLOAD_SERVICE);\n Uri downloadUri = Uri.parse(uRl);\n DownloadManager.Request request = new DownloadManager.Request(\n downloadUri);\n request.setAllowedNetworkTypes(\n DownloadManager.Request.NETWORK_WIFI\n | DownloadManager.Request.NETWORK_MOBILE)\n .setAllowedOverRoaming(false).setTitle(name)\n .setDescription(\"Saved images from Cinemato\")\n .setDestinationInExternalPublicDir(Environment.DIRECTORY_PICTURES + \"/Cinemato\", name + \".jpg\");\n assert mgr != null;\n mgr.enqueue(request);\n // Open Download Manager to view File progress\n Toast.makeText(getContext(), \"Downloading...\", Toast.LENGTH_LONG).show();\n startActivity(new Intent(DownloadManager.ACTION_VIEW_DOWNLOADS));\n }", "public void DownloadUpdate(String version)\n {\n String destination = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) + \"/\";\n String fileName = \"textbomb.apk\";\n destination += fileName;\n final Uri uri = Uri.parse(\"file://\" + destination);\n Log.d(\"textbomb.apk\", \"Dest: \" + uri);\n\n //Delete update file if exists\n File file = new File(destination);\n if (file.exists())\n //file.delete() - test this, I think sometimes it doesnt work\n file.delete();\n\n //get url of app on server\n String url = \"https://github.com/wethegreenpeople/TextBomb/releases/download/\" + version + \"/textbomb.apk\";\n\n //set downloadmanager\n DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url));\n request.setDescription(\"Textbomb\");\n request.setTitle(\"Textbomb\");\n\n //set destination\n request.setDestinationUri(uri);\n\n // get download service and enqueue file\n final DownloadManager manager = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE);\n final long downloadId = manager.enqueue(request);\n\n //set BroadcastReceiver to install app when .apk is downloaded\n BroadcastReceiver onComplete = new BroadcastReceiver() {\n public void onReceive(Context ctxt, Intent intent) {\n File apkFile = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) + \"/textbomb.apk\");\n intent = new Intent(Intent.ACTION_VIEW);\n Uri fileUri = android.support.v4.content.FileProvider.getUriForFile(context, context.getPackageName() + \".provider\", apkFile);\n intent.setDataAndType(fileUri, \"application/vnd.android.package-archive\");\n intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);\n ctxt.startActivity(intent);\n }\n };\n //register receiver for when .apk download is compete\n context.registerReceiver(onComplete, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE));\n }", "public void onDownloadStart(String url, String userAgent,\n String contentDisposition, String mimeType,\n long contentLength) {\n\n DownloadManager.Request request = new DownloadManager.Request(\n Uri.parse(url));\n request.setMimeType(mimeType);\n String cookies = CookieManager.getInstance().getCookie(url);\n request.addRequestHeader(\"cookie\", cookies);\n request.addRequestHeader(\"User-Agent\", userAgent);\n request.setDescription(\"Downloading File...\");\n request.setTitle(URLUtil.guessFileName(url, contentDisposition, mimeType));\n request.allowScanningByMediaScanner();\n request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);\n request.setDestinationInExternalPublicDir(\n \"/MyUniversity\", URLUtil.guessFileName(\n url, contentDisposition, mimeType));\n DownloadManager dm = (DownloadManager) getSystemService(DOWNLOAD_SERVICE);\n dm.enqueue(request);\n Toast.makeText(getApplicationContext(), \"Downloading File\", Toast.LENGTH_LONG).show();\n\n\n }", "@Override\n public int onStartCommand(Intent intent, int flags, int startId) {\n Bundle bundle = intent.getExtras();\n String url = bundle.getString(\"downloadUrl\");\n PreferenceUtils.setString(UpdateVersionService.this, \"apkDownloadurl\", url);\n nm.notify(titleId, notification);\n downLoadFile(url);\n return Service.START_STICKY;\n }", "private void downloadApk(String url) {\n if (UpdateHelper.CheckForSDCard.isSDCardPresent()) {\n\n //check if app has permission to write to the external storage.\n if (EasyPermissions.hasPermissions(MainActivity.this, Manifest.permission.WRITE_EXTERNAL_STORAGE)) {\n new DownloadFileHelper(MainActivity.this).execute(url);\n\n } else {\n //If permission is not present request for it.\n EasyPermissions.requestPermissions(MainActivity.this, getString(R.string.write_file), WRITE_REQUEST_CODE, Manifest.permission.READ_EXTERNAL_STORAGE);\n }\n\n }\n }", "public java.lang.CharSequence download(java.lang.String appId, java.lang.String url, long duration, java.lang.String folder) throws android.os.RemoteException;", "@NonNull\n private File getDownloadLocation() {\n System.out.println(\"Hello. in download start\");\n File root = android.os.Environment.getExternalStorageDirectory();\n File file = new File(root.getAbsolutePath() + \"/V2A\");\n if (!file.exists()) {\n file.mkdirs();\n }\n System.out.println(file.toString());\n System.out.println(\"Hello. in download end\");\n //Toast.makeText(this, \"Starting Download\", Toast.LENGTH_SHORT).show();\n\n return file;\n\n }", "public void download() {\n }", "private void startDownload(String url) {\n\t\t\turl = \"http://www.it.com.cn/dghome/img/2009/06/23/17/090623_tv_tf2_13h.jpg\";\r\n\t\t\t//String url = \"http://down.mumayi.com/41052/mbaidu\";\r\n\t\t\tUri srcUri = Uri.parse(url);\r\n\t\t\tDownloadManager.Request request = new Request(srcUri);\r\n\t\t\trequest.setDestinationInExternalPublicDir(\r\n\t\t\t\tEnvironment.DIRECTORY_DOWNLOADS, \"/\");\r\n\t\t\trequest.setDescription(\"正在下载\");\r\n\t\t\t DownloadManager mDownloadManager = new DownloadManager(activity.getContentResolver(),\r\n\t\t\t\t\t activity.getPackageName());\r\n\t\t\tmDownloadManager.enqueue(request);\r\n\t\t }", "@Override\r\n protected void onPostExecute(String file_url) {\r\n System.out.println(\"Downloaded\");\r\n }", "@Override\n public void onClick(DialogInterface dialog, int which)\n {\n DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url));\n //cookie\n String cookie= CookieManager.getInstance().getCookie(url);\n //Add cookie and User-Agent to request\n request.addRequestHeader(\"Cookie\",cookie);\n request.addRequestHeader(\"User-Agent\",userAgent);\n\n //file scanned by MediaScannar\n request.allowScanningByMediaScanner();\n //Download is visible and its progress, after completion too.\n request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);\n //DownloadManager created\n DownloadManager downloadManager= (DownloadManager) getContext().getSystemService(Context.DOWNLOAD_SERVICE);\n //Saving file in Download folder\n request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, filename);\n //download enqued\n downloadManager.enqueue(request);\n }", "void downloadingFile(String path);", "@Override\n public void onClick(View v) {\n \tIntent in = new Intent(getApplicationContext(), DownloadFile.class);\n in.putExtra(\"url\", url_get_file);\n startActivityForResult(in, 100);\n }", "public void onDownloadSuccess(String fileInfo);", "@Override\n protected void onPostExecute(String file_url) {\n // dismiss the dialog after the file was downloaded\n //dismissDialog(progress_bar_type);\n dismissProgress();\n showToast(String.valueOf(\"Download File Success to \") + filename);\n if (filePath != null) {\n File file = new File( filePath );\n Intent intent = new Intent(Intent.ACTION_VIEW);\n Uri fileUri = FileProvider.getUriForFile(getContext(),\n \"com.insurance.easycover\",\n file);\n intent.setData(fileUri);\n intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);\n startActivity(intent);\n }\n }", "public void DownloadFiles(String url, String deskripsi, String judul) {\n String urlWeb = url;\n\n DownloadManager.Request request = new DownloadManager.Request(Uri.parse(urlWeb.replace(\"https://\", \"http://\")));\n request.setDescription(deskripsi);\n request.setTitle(judul);\n request.allowScanningByMediaScanner();\n request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);\n\n String namaFile = deskripsi + \"_\" + judul + \".mp3\";\n request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, namaFile);\n\n DownloadManager manager = (DownloadManager) getActivity().getSystemService(Context.DOWNLOAD_SERVICE);\n manager.enqueue(request);\n }", "private void sendIntent(Download download) {\n }", "@Override public java.lang.CharSequence download(java.lang.String appId, java.lang.String url, long duration, java.lang.String folder) throws android.os.RemoteException\n{\nandroid.os.Parcel _data = android.os.Parcel.obtain();\nandroid.os.Parcel _reply = android.os.Parcel.obtain();\njava.lang.CharSequence _result;\ntry {\n_data.writeInterfaceToken(DESCRIPTOR);\n_data.writeString(appId);\n_data.writeString(url);\n_data.writeLong(duration);\n_data.writeString(folder);\nmRemote.transact(Stub.TRANSACTION_download, _data, _reply, 0);\n_reply.readException();\nif ((0!=_reply.readInt())) {\n_result = android.text.TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(_reply);\n}\nelse {\n_result = null;\n}\n}\nfinally {\n_reply.recycle();\n_data.recycle();\n}\nreturn _result;\n}", "@Override\r\n protected String doInBackground(String... f_url) {\r\n int count;\r\n try {\r\n String root = Environment.getExternalStorageDirectory().toString();\r\n\r\n System.out.println(\"Downloading\");\r\n URL url = new URL(f_url[0]);\r\n\r\n URLConnection conection = url.openConnection();\r\n conection.connect();\r\n // getting file length\r\n int lenghtOfFile = conection.getContentLength();\r\n\r\n // input stream to read file - with 8k buffer\r\n InputStream input = new BufferedInputStream(url.openStream(), 8192);\r\n\r\n // Output stream to write file\r\n\r\n OutputStream output = new FileOutputStream(root+\"/downloadedfile.jpg\");\r\n byte data[] = new byte[1024];\r\n\r\n long total = 0;\r\n while ((count = input.read(data)) != -1) {\r\n total += count;\r\n\r\n // writing data to file\r\n output.write(data, 0, count);\r\n\r\n }\r\n\r\n // flushing output\r\n output.flush();\r\n\r\n // closing streams\r\n output.close();\r\n input.close();\r\n\r\n } catch (Exception e) {\r\n Log.e(\"Error: \", e.getMessage());\r\n }\r\n\r\n return null;\r\n }", "public void downloadFile(final String name){\n new AsyncTask<Void, Void, Void>() {\n\n @Override\n protected Void doInBackground(Void... params) {\n try\n {\n storageAccount = CloudStorageAccount.parse(Constants.storageConnectionString);\n blobClient = storageAccount.createCloudBlobClient();\n container = blobClient.getContainerReference(\"assets\");\n container.createIfNotExists();\n // Loop through each blob item in the container.\n for (ListBlobItem blobItem : container.listBlobs()) {\n // If the item is a blob, not a virtual directory.\n if (blobItem instanceof CloudBlob) {\n // Download the item and save it to a file with the same name.\n CloudBlob blob = (CloudBlob) blobItem;\n if(blob.getName().equals(name)){\n File output=File.createTempFile(\"download\",null,mContext.getCacheDir());\n String filename=output.getAbsolutePath();\n blob.download(new FileOutputStream(output));\n output.deleteOnExit(); // delete file when program ends\n Log.i(\"download NAME: \",filename);\n }\n }\n }\n\n\n }\n catch (Exception e)\n {\n Log.i(\"download file error: \",e.getMessage());\n }\n return null;\n }\n }.execute();\n }", "@Test\n public void downloadTest() throws ApiException {\n Integer devid = null;\n String path = null;\n File response = api.download(devid, path);\n\n // TODO: test validations\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tclickButtonToDownloadFile();\n\t\t\t\t\n\t\t\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n else if (id==R.id.share)\n {\n Toast.makeText(getApplicationContext(),\"Please Wait\",Toast.LENGTH_SHORT).show();\n dm = (DownloadManager) getSystemService(DOWNLOAD_SERVICE);\n DownloadManager.Request request = new DownloadManager.Request(\n Uri.parse(urlstring)).setDestinationInExternalPublicDir(\"/Society365\", legdername+\" - \"+timeperiod2+\".pdf\");\n\n request.setDescription(urlstring); //appears the same in Notification bar while downloading\n\n enqueue = dm.enqueue(request);\n }\n\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\tpublic void download() {\n\t\t\r\n\t}", "private String downloadFile(String url) throws Exception {\n StringBuilder builder = new StringBuilder();\n \n URL u = new URL(url);\n URLConnection conn = u.openConnection();\n BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));\n String line;\n while ((line = rd.readLine()) != null) {\n builder.append(line);\n }\n \n return builder.toString();\n }", "private void downloadFile(final File mFile, final java.io.File targetFolder) {\n Thread t = new Thread(new Runnable() {\n @Override\n public void run() {\n if (mFile.getDownloadUrl() != null && mFile.getDownloadUrl().length() > 0) {\n try {\n com.google.api.client.http.HttpResponse resp =\n mService.getRequestFactory()\n .buildGetRequest(new GenericUrl(mFile.getDownloadUrl()))\n .execute();\n\n // gets the file's contents\n InputStream inputStream = resp.getContent();\n\n // stores the contents to the device's external storage\n try {\n final java.io.File file = new java.io.File(targetFolder, mFile.getTitle());\n System.out.println(\"Downloading: \" + mFile.getTitle() + \" to \" + file.getPath());\n //numDownloading++;\n storeFile(file, inputStream);\n } finally {\n inputStream.close();\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n });\n t.start();\n try {\n Thread.sleep(750);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "@Override\n public void onClick(View view) {\n switch (view.getId()) {\n case R.id.downloadPdf:\n if (isConnectingToInternet()){\n Toast.makeText(getApplicationContext(), \"it's me\", Toast.LENGTH_SHORT).show();\n new DownloadTask(MainActivity.this, downloadPdf, Utils.downloadPdfUrl);\n }\n else\n Toast.makeText(MainActivity.this, \"Oops!! There is no internet connection. Please enable internet connection and try again.\", Toast.LENGTH_SHORT).show();\n break;\n case R.id.downloadDoc:\n if(isStoragePermissionGranted()){\n\n }\n if (isConnectingToInternet())\n new DownloadTask(MainActivity.this, downloadDoc, Utils.downloadDocUrl);\n else\n Toast.makeText(MainActivity.this, \"Oops!! There is no internet connection. Please enable internet connection and try again.\", Toast.LENGTH_SHORT).show();\n break;\n case R.id.downloadZip:\n if (isConnectingToInternet())\n new DownloadTask(MainActivity.this, downloadZip, Utils.downloadZipUrl);\n else\n Toast.makeText(MainActivity.this, \"Oops!! There is no internet connection. Please enable internet connection and try again.\", Toast.LENGTH_SHORT).show();\n break;\n case R.id.downloadVideo:\n if (isConnectingToInternet())\n new DownloadTask(MainActivity.this, downloadVideo, Utils.downloadVideoUrl);\n else\n Toast.makeText(MainActivity.this, \"Oops!! There is no internet connection. Please enable internet connection and try again.\", Toast.LENGTH_SHORT).show();\n break;\n case R.id.downloadMp3:\n if (isConnectingToInternet())\n new DownloadTask(MainActivity.this, downloadMp3, Utils.downloadMp3Url);\n else\n Toast.makeText(MainActivity.this, \"Oops!! There is no internet connection. Please enable internet connection and try again.\", Toast.LENGTH_SHORT).show();\n break;\n case R.id.openDownloadedFolder:\n openDownloadedFolder();\n break;\n case R.id.go_to_downlaod:\n Intent i = new Intent(MainActivity.this, DownloadActivity.class);\n startActivity(i);\n break;\n\n }\n }", "public void downloadButtonPressed(View view)\n {\n Intent intent = new Intent(this, DownloadActivity.class);\n startActivity(intent);\n }", "public Observable<File> downloadApk(String packageName, String version,\n ApkDownloadListener downloadListener) {\n return ServiceGenerator.create(ApplicationService.class, SessionManager.instance()\n .getLoggedInUser())\n .downloadApk(packageName, version)\n .map(responseBody -> new FileDownloader()\n .downloadFileToDisk(responseBody, getInstallerFileName(packageName,\n version), downloadListener));\n\n }", "private void downloadImage(String url, int version) {\n ContextWrapper cw = new ContextWrapper(getApplicationContext());\n // path to /data/data/yourapp/app_data/imageDir\n File directory = cw.getDir(\"imageDir\", Context.MODE_PRIVATE);\n // Create imageDir\n File myPath = new File(directory, \"profile.jpg\");\n try {\n URL downloadURL = new URL(url);\n HttpURLConnection conn = (HttpURLConnection) downloadURL.openConnection();\n int responseCode = conn.getResponseCode();\n if (responseCode != 200) {\n throw new Exception(\"Error in connection\");\n }\n InputStream is = conn.getInputStream();\n FileOutputStream os = new FileOutputStream(myPath);\n byte[] buffer = new byte[1024];\n int byteCount;\n while ((byteCount = is.read(buffer)) != -1) {\n os.write(buffer, 0, byteCount);\n }\n os.close();\n is.close();\n if (version > -1) {\n PrefManager.saveInt(DownloadService.this, \"VERSION\", version);\n }\n Log.d(\"com.ajs.glidetest\", \"download complete \" + version);\n PrefManager.saveBoolean(DownloadService.this, \"DOWNLOAD_OK\", true);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "@Override\n public void onServiceResult(int requestCode, int resultCode, Bundle data) {\n if( resultCode == Activity.RESULT_CANCELED){\n handleDownloadFailure();\n }\n }", "@Override\n public void onReceive(Context context, Intent intent) {\n if (mDownloadedFileID == -1)\n return;\n Toast.makeText(getApplicationContext(), getString(R.string.atom_ui_tip_download_success), //To notify the Client that the file is being downloaded\n Toast.LENGTH_LONG).show();\n QunarWebActvity.this.finish();\n }", "public void downloadFile(final Context context, final String fileKey, String pageFileKey, String fileType, final DownloadListener downloadListener) {\n\n final String pathName = Config.getPathName(context) + fileType + getFIleNameFromFileKEy(fileKey);\n final String pagePathName = Config.getPathName(context) + PAGES_FILE + getFIleNameFromFileKEy(pageFileKey);\n\n final long totalBytes = 0;\n TransferObserver downloadObserver = transferUtility.download(\n Config.BUCKET_NAME,\n fileKey,\n new File(pathName));\n\n\n // Attach a listener to the observer to get state update and progress notifications\n downloadObserver.setTransferListener(new TransferListener() {\n\n @Override\n public void onStateChanged(int id, TransferState state) {\n if (TransferState.COMPLETED == state) {\n\n downloadListener.onDownloadFinish(id, state.name(), pathName, pagePathName);\n }\n }\n\n @Override\n public void onProgressChanged(int id, long bytesCurrent,long bytesTotal) {\n\n\n if (bytesTotal == 0){\n\n bitesCorrent = bytesCurrent;\n\n Thread thread = new Thread(new Runnable() {\n @Override\n public void run() {\n\n URL url = null;\n try {\n url = new URL(S3_JABRUTOUCH + fileKey);\n } catch (MalformedURLException e) {\n e.printStackTrace();\n }\n URLConnection conection = null;\n try {\n conection = url.openConnection();\n } catch (IOException e) {\n e.printStackTrace();\n }\n // getting file length\n int lengthOfFile = conection.getContentLength();\n\n float percentDonef = ((float) bitesCorrent / (float) lengthOfFile) * 100;\n final int percentDone = (int) percentDonef;\n\n new Handler(Looper.getMainLooper()).post(new Runnable() {\n @Override\n public void run() {\n downloadListener.onProgressChanged(percentDone);\n }\n });\n }\n });\n thread.start();\n\n }else {\n\n\n float percentDonef = ((float) bytesCurrent / (float) bytesTotal) * 100;\n int percentDone = (int) percentDonef;\n\n downloadListener.onProgressChanged(percentDone);\n }\n\n\n }\n\n @Override\n public void onError(int id, Exception ex) {\n\n Toast.makeText(context, \"Error downloading file \" + fileKey, Toast.LENGTH_LONG).show();\n downloadListener.onDownloadError();\n\n }\n\n });\n\n // If you prefer to poll for the data, instead of attaching a\n // listener, check for the state and progress in the observer.\n if (TransferState.COMPLETED == downloadObserver.getState()) {\n // Handle a completed upload.\n\n\n }\n\n\n }", "public void DownloadFromUrl(Context ctx) {\n\t\ttry {\r\n\t\t\tURL url = new URL(link);\r\n\t\t\tString root = Environment.getExternalStorageDirectory().toString();\r\n\t\t\tif (type.contentEquals(\"image\")) {\r\n\t\t\t\tFile myDir = new File(root + Constants.APP_FOLDER_IMG);\r\n\t\t\t\tmyDir.mkdirs();\r\n\t\t\t\tString fname = name;\r\n\t\t\t\tFile file = new File(myDir, fname);\r\n\t\t\t\tif (file.exists())\r\n\t\t\t\t\tfile.delete();\r\n\t\t\t\tlong startTime = System.currentTimeMillis();\r\n\t\t\t\tLog.d(\"ImageManager\", \"download begining\");\r\n\t\t\t\tString url1 = url.toString().replaceAll(\" \", \"%20\");\r\n\t\t\t\turl = new URL(url1);\r\n\t\t\t\tLog.d(\"ImageManager\", \"download url:\" + url);\r\n\t\t\t\tLog.d(\"ImageManager\", \"downloaded file name:\");\r\n\t\t\t\t/* Open a connection to that URL. */\r\n\t\t\t\tURLConnection ucon = url.openConnection();\r\n\r\n\t\t\t\t/*\r\n\t\t\t\t * Define InputStreams to read from the URLConnection.\r\n\t\t\t\t */\r\n\t\t\t\tInputStream is = ucon.getInputStream();\r\n\t\t\t\tBufferedInputStream bis = new BufferedInputStream(is);\r\n\r\n\t\t\t\t/*\r\n\t\t\t\t * Read bytes to the Buffer until there is nothing more to\r\n\t\t\t\t * read(-1).\r\n\t\t\t\t */\r\n\t\t\t\tByteArrayBuffer baf = new ByteArrayBuffer(50);\r\n\t\t\t\tint current = 0;\r\n\t\t\t\twhile ((current = bis.read()) != -1) {\r\n\t\t\t\t\tbaf.append((byte) current);\r\n\t\t\t\t\tif (cancel)\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t/* Convert the Bytes read to a String. */\r\n\t\t\t\tif (!cancel) {\r\n\t\t\t\t\tFileOutputStream fos = new FileOutputStream(file);\r\n\t\t\t\t\tfos.write(baf.toByteArray());\r\n\t\t\t\t\tfos.close();\r\n\t\t\t\t\tLog.d(\"ImageManager\",\r\n\t\t\t\t\t\t\t\"download ready in\"\r\n\t\t\t\t\t\t\t\t\t+ ((System.currentTimeMillis() - startTime) / 1000)\r\n\t\t\t\t\t\t\t\t\t+ \" sec\");\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\telse if (type.contentEquals(\"award\")) {\r\n\t\t\t\t\r\n\t\t\t\tLog.e(\"download\",\" award here\");\r\n\t\t\t\t//TODO download files here\r\n\t\t\t\t Log.e(\"name\",name);\r\n\t\t\t\t Log.e(\"link\",link);\r\n\t\t\t\r\n\t\t\t\tFile file = new File(name);\r\n\t\t\t\tif (file.exists())\r\n\t\t\t\t\tfile.delete();\r\n\t\t\t\tURLConnection ucon = url.openConnection();\r\n\t\t\t\tInputStream is = ucon.getInputStream();\r\n\t\t\t\tBufferedInputStream bis = new BufferedInputStream(\r\n\t\t\t\t\t\tis);\r\n\t\t\t\tByteArrayBuffer baf = new ByteArrayBuffer(50);\r\n\t\t\t\tint current = 0;\r\n\t\t\t\twhile ((current = bis.read()) != -1) {\r\n\t\t\t\t\tif(cancel) break;\r\n\t\t\t\t\tbaf.append((byte) current);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tFileOutputStream fos = new FileOutputStream(file);\r\n\t\t\t\tfos.write(baf.toByteArray());\r\n\t\t\t\tfos.close();\r\n\t\t\t\tif(cancel) file.delete();\r\n\r\n\t\t\t}\r\n\t\t\telse if (type.contentEquals(\"video\")) {\r\n\r\n\t\t\t\tFile myDir = new File(root + Constants.APP_FOLDER_VIDEO);\r\n\t\t\t\tmyDir.mkdirs();\r\n\t\t\t\tString fname = name;\r\n\t\t\t\t// Log.v(\"fname\",fname);\r\n\t\t\t\tFile file = new File(myDir, fname);\r\n\t\t\t\tif (file.exists())\r\n\t\t\t\t\tfile.delete();\r\n\t\t\t\tlong startTime = System.currentTimeMillis();\r\n\t\t\t\tString url1 = url.toString().replaceAll(\" \", \"%20\");\r\n\t\t\t\turl = new URL(url1);\r\n\t\t\t\tLog.d(\"ImageManager\", \"download begining\");\r\n\t\t\t\tLog.d(\"ImageManager\", \"download url:\" + url);\r\n\t\t\t\tLog.d(\"ImageManager\", \"downloaded file name:\");\r\n\t\t\t\t/* Open a connection to that URL. */\r\n\t\t\t\tURLConnection ucon = url.openConnection();\r\n\t\t\t\t/*\r\n\t\t\t\t * Define InputStreams to read from the URLConnection.\r\n\t\t\t\t */\r\n\t\t\t\tInputStream is = ucon.getInputStream();\r\n\t\t\t\t// bookmarkstart\r\n\t\t\t\t/*\r\n\t\t\t\t * Read bytes to the Buffer until there is nothing more to\r\n\t\t\t\t * read(-1) and write on the fly in the file.\r\n\t\t\t\t */\r\n\t\t\t\tFileOutputStream fos = new FileOutputStream(file);\r\n\t\t\t\tfinal int BUFFER_SIZE = 25 * 1024;\r\n\t\t\t\tBufferedInputStream bis = new BufferedInputStream(is,\r\n\t\t\t\t\t\tBUFFER_SIZE);\r\n\t\t\t\tbyte[] baf = new byte[BUFFER_SIZE];\r\n\t\t\t\tint actual = 0;\r\n\t\t\t\twhile (actual != -1) {\r\n\t\t\t\t\tfos.write(baf, 0, actual);\r\n\t\t\t\t\tactual = bis.read(baf, 0, BUFFER_SIZE);\r\n\t\t\t\t\tif (cancel) {\r\n\t\t\t\t\t\tfile.delete();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfos.close();\r\n\r\n\t\t\t\t// bookmarkend\r\n\t\t\t\tLog.d(\"ImageManager\",\r\n\t\t\t\t\t\t\"download ready in\"\r\n\t\t\t\t\t\t\t\t+ ((System.currentTimeMillis() - startTime) / 1000)\r\n\t\t\t\t\t\t\t\t+ \" sec\");\r\n\r\n\t\t\t\tString link = root + Constants.APP_FOLDER_IMG + name;\r\n\r\n\t\t\t}\r\n\t\t\telse if (type.contentEquals(\"audio\")) {\r\n\t\t\t\tLog.v(\"training\", \"in audio\");\r\n\r\n\t\t\t\tFile myDir = new File(Environment.getExternalStorageDirectory()\r\n\t\t\t\t\t\t.getAbsolutePath() + Constants.APP_FOLDER_AUDIO);\r\n\t\t\t\tmyDir.mkdirs();\r\n\t\t\t\tString fname = name;\r\n\r\n\t\t\t\tFile file = new File(myDir, fname);\r\n\t\t\t\tif (file.exists())\r\n\t\t\t\t\tfile.delete();\r\n\r\n\t\t\t\t// long startTime = System.currentTimeMillis();\r\n\t\t\t\tString url1 = url.toString().replaceAll(\" \", \"%20\");\r\n\t\t\t\turl = new URL(url1);\r\n\r\n\t\t\t\tURLConnection ucon = url.openConnection();\r\n\r\n\t\t\t\tInputStream is = ucon.getInputStream();\r\n\t\t\t\tBufferedInputStream bis = new BufferedInputStream(is);\r\n\r\n\t\t\t\tByteArrayBuffer baf = new ByteArrayBuffer(50);\r\n\t\t\t\tint current = 0;\r\n\t\t\t\twhile ((current = bis.read()) != -1) {\r\n\t\t\t\t\tbaf.append((byte) current);\r\n\t\t\t\t\tif (cancel)\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t/* Convert the Bytes read to a String. */\r\n\t\t\t\tif (!cancel) {\r\n\t\t\t\t\tFileOutputStream fos = new FileOutputStream(file);\r\n\t\t\t\t\tfos.write(baf.toByteArray());\r\n\t\t\t\t\tfos.close();\r\n\t\t\t\t}\r\n\r\n\t\t\t}// end of audio\r\n\t\t\telse{\r\n\t\t\t\ttry {\r\n\t\t\t\t\turl = new URL(link);\r\n\t\t\t\t\troot = Environment\r\n\t\t\t\t\t\t\t.getExternalStorageDirectory()\r\n\t\t\t\t\t\t\t.toString();\r\n\t\t\t\t\tLog.v(\"type is \", type.toString());\r\n\r\n\t\t\t\t\tString foldername = \"\";\r\n\t\t\t\t\tif (type.contentEquals(\"pdf\"))\r\n\t\t\t\t\t\tfoldername = activity.getString(R.string.pdf);\r\n\t\t\t\t\telse if (type.contentEquals(\"ppt\"))\r\n\t\t\t\t\t\tfoldername = activity.getString(R.string.ppt);\r\n\t\t\t\t\telse if (type.contentEquals(\"doc\"))\r\n\t\t\t\t\t\tfoldername = activity.getString(R.string.doc);\r\n\t\t\t\t\telse if (type.contentEquals(\"xls\"))\r\n\t\t\t\t\t\tfoldername = activity.getString(R.string.xls);\r\n\t\t\t\t\telse if (type.contentEquals(\"video\"))\r\n\t\t\t\t\t\tfoldername = \"mobcast_videos\";\r\n\t\t\t\t\telse if (type.contentEquals(\"audio\"))\r\n\t\t\t\t\t\tfoldername = \"mobcast_audio\";\r\n\r\n\t\t\t\t\tFile myDir = new File(root + Constants.APP_FOLDER\r\n\t\t\t\t\t\t\t+ foldername);\r\n\r\n\t\t\t\t\tString fname = ename;\r\n\r\n\t\t\t\t\tmyDir.mkdirs();\r\n\r\n\t\t\t\t\t\r\n\t\t\t\t\tFile file = new File(myDir, fname);\r\n\t\t\t\t\tif (file.exists())\r\n\t\t\t\t\t\tfile.delete();\r\n\t\t\t\t\tURLConnection ucon = url.openConnection();\r\n\t\t\t\t\tInputStream is = ucon.getInputStream();\r\n\t\t\t\t\tBufferedInputStream bis = new BufferedInputStream(\r\n\t\t\t\t\t\t\tis);\r\n\t\t\t\t\tByteArrayBuffer baf = new ByteArrayBuffer(50);\r\n\t\t\t\t\tint current = 0;\r\n\t\t\t\t\twhile ((current = bis.read()) != -1) {\r\n\t\t\t\t\t\tbaf.append((byte) current);\r\n\t\t\t\t\t\tif(cancel) break;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tFileOutputStream fos = new FileOutputStream(\r\n\t\t\t\t\t\t\tfile);\r\n\t\t\t\t\tfos.write(baf.toByteArray());\r\n\t\t\t\t\tfos.close();\r\n\t\t\t\t\t\tif(cancel) file.delete();\r\n\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\tLog.d(\"ImageManager\", \"Error: \" + e);\r\n\t\t}\r\n\r\n\t}", "@Override\n public void onCreate() {\n super.onCreate();\n\n retriveFilePath();\n\n new Thread(new Runnable() {\n\n @Override\n public void run() {\n // TODO Auto-generated method stub\n downloadFile(Const.MONITOR_SERVER_ADDRESS, downFilePath);\n }\n }).start();\n }", "public String getPackageDownloadUrl();", "public void downloadDialog(){\n AlertDialog ad = new AlertDialog.Builder(this).create();\n ad.setMessage(getString(R.string.download_message)+\" \"+\n \"\\\"\"+UpdateTalesData.sTaleName+\"\\\"\"+ \" ?\");\n ad.setButton(getString(R.string.download_btnPos),\n new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n startDownload();\n }\n });\n ad.setButton2(getResources().getString(R.string.download_btnNeg),\n new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.cancel();\n }\n });\n ad.setCancelable(true);\n ad.show();\n }", "@Override\n protected String doInBackground(String... f_url) {\n int count;\n try {\n URL url = new URL(f_url[0]);\n URLConnection connection = url.openConnection();\n connection.connect();\n // getting file length\n int lengthOfFile = connection.getContentLength();\n\n\n // input stream to read file - with 8k buffer\n InputStream input = new BufferedInputStream(url.openStream(), 8192);\n\n String timestamp = new SimpleDateFormat(\"yyyy.MM.dd.HH.mm.ss\").format(new Date());\n\n //Extract file name from URL\n fileName = f_url[0].substring(f_url[0].lastIndexOf('/') + 1, f_url[0].length());\n\n //Append timestamp to file name\n fileName = timestamp + \"_\" + fileName;\n\n //External directory path to save file\n // folder = Environment.getExternalStorageDirectory() + \"Needyyy\";\n\n //Create androiddeft folder if it does not exist\n\n String folder = \"Needyyy\";\n// File f = new File(Environment.getExternalStorageDirectory(), folder);\n// if (!f.exists()) {\n// f.mkdirs();\n// }\n\n\n File directory = new File(Environment.getExternalStorageDirectory(), folder);\n\n if (!directory.exists()) {\n directory.mkdirs();\n }\n\n // Output stream to write file\n OutputStream output = new FileOutputStream(directory + fileName);\n\n byte data[] = new byte[1024];\n\n long total = 0;\n\n while ((count = input.read(data)) != -1) {\n total += count;\n // publishing the progress....\n // After this onProgressUpdate will be called\n publishProgress(\"\" + (int) ((total * 100) / lengthOfFile));\n Log.d(TAG, \"Progress: \" + (int) ((total * 100) / lengthOfFile));\n\n // writing data to file\n output.write(data, 0, count);\n }\n\n // flushing output\n output.flush();\n\n // closing streams\n output.close();\n input.close();\n return \"Downloaded at: \" + directory + fileName;\n\n } catch (Exception e) {\n// Log.e(\"Error: \", e.getMessage());\n }\n\n return \"Something went wrong\";\n }", "void download(SearchResult result, String downloadPath);", "public boolean downloadAndSaveBinaryFile(String theUrl, String saveAsFileName){\n \t\t //Log.i(\"ZZ\", \"AppDelegate:downloadAndSaveBinaryFile: \" + URL); \n\t \ttry {\n\t\t \n\t \tURL u = new URL(theUrl);\n\t URLConnection uc = u.openConnection();\n\t String contentType = uc.getContentType();\n\t int contentLength = uc.getContentLength();\n\t if (contentType.startsWith(\"text/\") || contentLength == -1) {\n\t return false; // not binary\n\t }\n\t InputStream raw = uc.getInputStream();\n\t InputStream in = new BufferedInputStream(raw);\n\t byte[] data = new byte[contentLength];\n\t int bytesRead = 0;\n\t int offset = 0;\n\t while (offset < contentLength) {\n\t bytesRead = in.read(data, offset, data.length - offset);\n\t if (bytesRead == -1)\n\t break;\n\t offset += bytesRead;\n\t }\n\t in.close();\n\t \t\t\t \t\n\t \t\t\t \n\t if (offset != contentLength) {\n\t\t return false; //problem reading stream?\n\t }\n\t \n\n\t //save file\n\t\t\t\t\tFileOutputStream fos = super.openFileOutput(saveAsFileName, MODE_WORLD_READABLE);\n\t\t\t\t\tfos.write(data);\n\t\t\t\t\tfos.flush();\n\t\t\t\t\tfos.close();\n\t \n\t return true;\n\t }catch (Exception je){\n\t\t\t Log.i(\"ZZ\", \"AppDelegate:downloadAndSaveBinaryFile: ERROR - 2: \" + je.getMessage()); \n\t \t return false;\n\t\t } \n\t }", "void fileDownloaded(String path);", "@Override\n protected void onPostExecute(String file_url) {\n Log.i(TAG,\"onPostExecute()\");\n download = null;\n // dismiss the dialog after the file was downloaded\n runOnUiThread(()->dismissDialog());\n }", "private void download()\n {\n if(mDownloadConnection!=null && mDownloadConnection.mBinder!=null)\n {\n if (mDownloadConnection.mBinder.download(\"file1\"))\n {\n mTvFilename.setText(\"file1\");\n }\n }\n }", "public String getDownloadFilePath(String fileName) {\n StringBuilder sb = new StringBuilder(32);\n sb.append(this.context.getExternalFilesDir((String) null)).append(WVNativeCallbackUtil.SEPERATER).append(DOWNLOAD_FOLDER).append(WVNativeCallbackUtil.SEPERATER).append(fileName);\n return sb.toString();\n }", "@Override\n public void onClick(View view) {\n if(!titleNameofFiles.contains(content.getFileName())) {\n // Download the content\n //Toast.makeText(getActivity(), \"::Download process begins:: with url:\" + content.getDownloadUrl(), Toast.LENGTH_SHORT).show();\n Log.i(\"url:\", content.getDownloadUrl());\n// new ContentDownloader(getActivity()).downloadFile(content.getDownloadUrl(),content.getTitle(),choosenSubject,choosenType);\n AnotherContentDownloader.getInstance(getActivity()).downloadFile(content.getDownloadUrl(), content.getFileName(), choosenSubject, choosenType);\n\n }else{\n Toast.makeText(getActivity(),\" You already have downloaded this file!\",Toast.LENGTH_SHORT).show();\n }\n DialogFragment dialog = (DialogFragment) getFragmentManager().findFragmentByTag(\"Download\");\n dialog.dismiss();\n }", "@Override\n\t\t\t\t\tprotected void onPostExecute(String file_url) {\n\t\t\t\t\t\t// Dismiss the dialog after the Music file was downloaded\n\t\t\t\t\t\ttry{\n\t\t\t\t\t\tdismissDialog(progress_bar_type);\n\t\t\t\t\t\tToast.makeText(getApplicationContext(), \"Download complete, Image saved at: \"+Environment.getExternalStorageDirectory().getPath()+\"/Space Monitor/\", Toast.LENGTH_LONG).show();\n\t\t\t\t\t\t// Play the music\n\t\t\t\t\t//\tplayMusic();\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t\t}catch (Exception d) {\n\t\t\t\t\t //Log.d(\"Exception\", e.getMessage());\n\t\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\t\t\n\t\t\t\t\t}", "public static void httpDownload(String url, FileOutputStream file) throws Exception {\r\n \t\tDefaultHttpClient client = new DefaultHttpClient();\r\n \t\tHttpResponse response = client.execute(new HttpGet(url));\r\n \t\tif(response.getStatusLine().getStatusCode() < 400){\r\n \t\t\tBufferedOutputStream writer = null;\r\n \t\t\tBufferedInputStream reader = null;\r\n \t\t\ttry {\r\n \t\t\t\twriter = new BufferedOutputStream(file);\r\n \t\t\t\treader = new BufferedInputStream(response.getEntity().getContent());\r\n \r\n \t\t\t\tbyte[] buffer = new byte[BUF_SIZE];\r\n \t\t\t\tint bytesRead = reader.read(buffer);\r\n \r\n \t\t\t\twhile (bytesRead > 0) {\r\n \t\t\t\t\twriter.write(buffer, 0, bytesRead);\r\n \t\t\t\t\tbytesRead = reader.read(buffer);\r\n \t\t\t\t}\r\n \t\t\t} finally {\r\n \t\t\t\tif (writer != null) {\r\n \t\t\t\t\twriter.close();\r\n \t\t\t\t}\r\n \t\t\t\tif (reader != null) {\r\n \t\t\t\t\treader.close();\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t}", "public interface DownlodApi {\n\n\n @Streaming\n @GET(\"http://121.29.10.1/f3.market.xiaomi.com/download/AppStore/0ff0604fd770f481927d1edfad35675a3568ba656/com.tencent.mobileqq.apk\")\n Observable<ResponseBody> downloadQQ();\n}", "@GET(\"/resource/example.zip\")\n Call<ResponseBody> downloadFileWithFixedUrl();", "private static void onDownloadFinished(String id, Context context) {\n switch (id) {\n case Constants.WORDNET:\n Intent intent = new Intent(context, UnzipService.class);\n intent.putExtra(UnzipService.INTENT_KEY_DICT_NAME, id);\n context.startService(intent);\n break;\n default:\n Timber.w(\"No relevant download found for \" + id + \" doing nothing on download complete\");\n break;\n }\n }", "public int onStartCommand(Intent intent, int flags, int startId) {\n\t\tSystem.out.println(\"flags--->\" + flags);\r\n\t\tSystem.out.println(\"startId--->\" + startId);\r\n\t\tSystem.out.println(\"Service onStartCommand\");\r\n\t\t//取得信息,要改!!!要解决!!!\r\n\t\tString txtstr = (String) intent.getSerializableExtra(\"strtxt\");\r\n\t\tString txtpath = (String) intent.getSerializableExtra(\"pahttxt\");\r\n\t\tString txtfilename = (String) intent.getSerializableExtra(\"filenametxt\");\r\n\t\tDownloadThread downloadThread = new DownloadThread(txtstr,txtpath,txtfilename);\r\n\t\t//启动新线程\r\n\t\tThread thread = new Thread(downloadThread);\r\n\t\tthread.start();\r\n\t\treturn super.onStartCommand(intent, flags, startId);\r\n\t\t//return START_NOT_STICKY;\r\n\t}", "@Override\n\t\t\tpublic void onDownloadSuccess(String result) {\n\t\t\t\tld.dismiss();\n\n\t\t\t\tif (getAppBrief(result)) {\n\n\t\t\t\t\tapp_advers.start(HomeActivity.this, mris, imageId, 3000,\n\t\t\t\t\t\t\tovalLayout, R.drawable.dot_focused,\n\t\t\t\t\t\t\tR.drawable.dot_normal);\n\t\t\t\t}\n\n\t\t\t\tappsAdapter.notifyDataSetChanged();\n\n\t\t\t}", "@Override\r\n protected String doInBackground(String... f_url) {\r\n int count;\r\n if (f_url[0].substring(f_url[0].lastIndexOf('/') + 1) != \"null\" || f_url[0].substring(f_url[0].lastIndexOf('/') + 1) != \"\") {\r\n try {\r\n URL url = new URL(f_url[0]);\r\n HttpURLConnection connection = (HttpURLConnection)url.openConnection();\r\n connection.connect();\r\n int lengthOfFile = connection.getContentLength();\r\n InputStream input = new BufferedInputStream(url.openStream(), 8192);\r\n fileName = f_url[0].substring(f_url[0].lastIndexOf('/') + 1);\r\n File directory = getExternalFilesDir(null);\r\n String folder = directory.getAbsolutePath();\r\n if (!directory.exists()) {\r\n directory.mkdirs();\r\n }\r\n OutputStream output = new FileOutputStream(folder + \"/\" + fileName);\r\n byte[] data = new byte[16384];\r\n long total = 0;\r\n while ((count = input.read(data)) != -1) {\r\n total += count;\r\n publishProgress(\"\" + (int) ((total * 100) / lengthOfFile));\r\n output.write(data, 0, count);\r\n }\r\n output.flush();\r\n output.close();\r\n input.close();\r\n return \"Downloaded at: \" + folder + fileName;\r\n\r\n } catch (Exception e) {\r\n Log.e(\"Error: \", e.getMessage());\r\n }\r\n return \"CMV files is missing in the server.Please contact your Admin\";\r\n } else {\r\n return \"These is some issue in downloading the file.Please contact your Admin\";\r\n }\r\n }", "@Override\n public void onClick(View v) {\n\n Intent intent;\n intent = new Intent(AppMenu.this, AssetDownload.class);\n startActivity(intent);\n }", "@Override\n public void initiateDownloadService() {\n mServiceBinder = ClientToServiceBinder.getInstance(this);\n mServiceBinder.doBindService();\n\n // initiate repeating download service\n DownloadAlarmManager.setAlarm(mContext);\n }", "@Override\r\n\t\tprotected File doInBackground(String... arg0) {\n\t\t\t URL url;\r\n\t\t\t file = null;\r\n\t\t\t int downloadedSize = 0 ;\r\n\t\t\t long totalsize=0;\r\n\t\t\t Float per = 0f;\r\n\t\t\t String extStorageDirectory = Environment.getExternalStorageDirectory().toString();\r\n\t\t\t File folder = new File(extStorageDirectory, \"Ioannina_GTG\");\r\n\t\t\t String fileName = url_attach.substring( url_attach.lastIndexOf('/')+1, url_attach.length() );\r\n\t\t\t\tSystem.out.println(fileName);\r\n\t\t\t\t\t folder.mkdir();\r\n\t\t\t\t\t file = new File(folder, fileName);\r\n\t\t\t\t\t try {\r\n\t\t\t\t\t file.createNewFile();\r\n\t\t\t\t\t } catch (IOException e1) {\r\n\t\t\t\t\t e1.printStackTrace();\r\n\t\t\t\t\t }\r\n\t\t\t \r\n\t\t\ttry {\r\n\t\t\t\turl = new URL(arg0[0]);\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();\r\n\t\t \r\n\t\t urlConnection.setRequestMethod(\"GET\");\r\n\t\t urlConnection.setDoOutput(true);\r\n\t\t \r\n\t\t // connect\r\n\t\t urlConnection.connect();\r\n\t\t ////////////////////////////////////// \r\n\t\t HttpClient client=new DefaultHttpClient();\r\n\t\t\t\t\tURI website=new URI(arg0[0]);\r\n\t\t\t\t\tHttpGet request=new HttpGet();\r\n\t\t\t\t\trequest.setURI(website);\r\n\t\t\t\t\tHttpResponse response=client.execute(request);\r\n\t\t\t\t\tHttpEntity entity=response.getEntity();\r\n\t\t\t\t\tInputStream inputStream=null;\r\n\t\t\t\t\tif(entity!=null){\r\n\t\t\t\t\t\ttotalsize=entity.getContentLength();\r\n\t\t\t\t\t\tinputStream=entity.getContent();\r\n\t\t\t\t\t}\r\n\t\t /////////////////////////////////////////////////////////////////////////////// \r\n\t\t FileOutputStream fileOutput = new FileOutputStream(file);\r\n\t\t // InputStream inputStream = urlConnection.getInputStream();\r\n\t\t // totalsize = urlConnection.getContentLength();\r\n\t\t \r\n\t\t byte[] buffer = new byte[1024 * 1024]; \r\n\t\t int bufferLength = 0;\r\n\t\t \r\n\t\t while ((bufferLength = inputStream.read(buffer)) > 0) {\r\n\t\t fileOutput.write(buffer, 0, bufferLength);\r\n\t\t downloadedSize += bufferLength;\r\n\t\t System.out.println(\" the total size is :\"+totalsize );\r\n\t\t System.out.println(\" the buffer lenght is :\"+bufferLength );\r\n\t\t System.out.println(\" the downloaded size is :\"+downloadedSize );\r\n\t\t // per = ((float) downloadedSize / totalsize) * 100;\r\n\t\t per=(((float)downloadedSize*100)/totalsize);\r\n\t\t int intper=per.intValue();\r\n\t\t System.out.println(intper);\r\n\t\t pDialog.setProgress(intper);\r\n\t\t //pDialog.incrementProgressBy(per.intValue());\r\n\t\t // setText(\"Total PDF \"\r\n\t\t // + (totalsize / 1024)\r\n\t\t // + \" KB\\n\\nDownloading PDF \" + (int) per\r\n\t\t // + \"% complete\");\r\n\t\t }\r\n\t\t // close the output stream when complete //\r\n\t\t fileOutput.close();\r\n\t\t \r\n\t\t \r\n\t\t\t} catch (MalformedURLException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (URISyntaxException 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 \r\n\t\t\t// for (int i = 0; i < 100; i++) {\r\n\t\t\t\t //publishProgress(10);\r\n\t\t\t\t\r\n\t\t\t\t \r\n\r\n\t\t\t// }\r\n\r\n\t\t\treturn file;\r\n\t\t}", "public static void start(Context context, String address, Uri uri) {\n DownloadFile.uri = uri;\n Intent intent = new Intent(context, DownloadFile.class);\n intent.putExtra(\"URL\", address);\n context.startService(intent);\n\n }", "private String downloadURL(String url) {\n\t\ttry {\n\t\t\tHttpClient client = new DefaultHttpClient();\n\t\t\tHttpGet request = new HttpGet(url);\n\t\t\t// Get the response\n\t\t\tResponseHandler<String> responseHandler = new BasicResponseHandler();\n\t\t\tString response_str = client.execute(request, responseHandler);\n\t\t\treturn response_str;\n\n\t\t\t// Makes sure that the InputStream is closed after the app is\n\t\t\t// finished using it.\n\t\t} catch (IOException e) {\n\t\t\tLog.d(\"WL\", \"Error\");\n\t\t\te.printStackTrace();\n\t\t\treturn \"Error\";\n\t\t}\n\t}", "public void download() {\n \n try {\n \n downloading = true;\n \n input = link.openStream(); \n output = new FileOutputStream(localFile);\n \n while ((bytes = input.read()) != -1) { // as long as there are bytes they will be copied to the local machine // enquanto houver bytes eles serao copiados para maquina local\n\n output.write(bytes);\n\n System.out.println(\"Tamanho: \" + sizeInMegaBytes(localFile) + \" MB\");\n\n }\n \n downloading = false;\n JOptionPane.showMessageDialog(null, \"Download do arquivo: \"+ localFile.getName() +\" Finalizado\");\n \n } catch (FileNotFoundException ex) {\n Logger.getLogger(Downloader.class.getName()).log(Level.SEVERE, null, ex);\n } catch (IOException ex) {\n Logger.getLogger(Downloader.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public interface DownloadListener {\n void onStart(String url,String savePath);\n void onProgress(String url, String savePath,long progress,long max);\n void onComplete(String url,String savePath);\n void onCancel(String url,String savePath);\n void onFail(String url,String savePath);\n\n // boolean isCanceled(String url,String savePath);\n String generalFileName(String url);\n long getMax(String url,String savePath);\n long getAvailable(String url,String savePath);\n}", "@Override\n\t\tprotected String doInBackground(String... url)\n\t\t{\n\n\t\t\t// For storing data from web service\n\t\t\tString data = \"\";\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// Fetching the data from web service\n\t\t\t\tdata = MainActivity.this.downloadUrl(url[0]);\n\t\t\t} catch (Exception e)\n\t\t\t{\n\t\t\t\tLog.d(\"Background Task\", e.toString());\n\t\t\t}\n\t\t\treturn data;\n\t\t}", "@SuppressLint(\"NewApi\")\n public static boolean handleDownload(final Context context, final String fromUrl,\n final String toFilename) {\n if (Build.VERSION.SDK_INT < 9) {\n throw new RuntimeException(\"Method requires API level 9 or above\");\n }\n\n final Request request = new Request(Uri.parse(fromUrl));\n if (Build.VERSION.SDK_INT >= 11) {\n request.allowScanningByMediaScanner();\n request.setNotificationVisibility(Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);\n }\n request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, toFilename);\n\n final DownloadManager dm = (DownloadManager) context\n .getSystemService(Context.DOWNLOAD_SERVICE);\n try {\n try {\n dm.enqueue(request);\n } catch (SecurityException e) {\n if (Build.VERSION.SDK_INT >= 11) {\n request.setNotificationVisibility(Request.VISIBILITY_VISIBLE);\n }\n dm.enqueue(request);\n }\n\n return true;\n }\n // if the download manager app has been disabled on the device\n catch (IllegalArgumentException e) {\n // show the settings screen where the user can enable the download manager app again\n openAppSettings(context, AdvancedWebView.PACKAGE_NAME_DOWNLOAD_MANAGER);\n\n return false;\n }\n }", "public void onFileDownloadComplete(String filePath);", "String download(String path) throws IOException;", "@SuppressLint(\"NewApi\")\n public static boolean handleDownload(final Context context, final String fromUrl, final String toFilename) {\n if (Build.VERSION.SDK_INT < 9) {\n// throw new RuntimeException(\"Method requires API level 9 or above\");\n return false;\n }\n\n try {\n final DownloadManager.Request request = new DownloadManager.Request(Uri.parse(fromUrl));\n if (Build.VERSION.SDK_INT >= 11) {\n request.allowScanningByMediaScanner();\n request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);\n }\n request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, toFilename);\n\n final DownloadManager dm = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE);\n\n try {\n dm.enqueue(request);\n } catch (SecurityException e) {\n if (Build.VERSION.SDK_INT >= 11) {\n request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE);\n }\n dm.enqueue(request);\n }\n\n return true;\n } catch (IllegalArgumentException e) {\n // show the settings screen where the user can enable the download manager app again\n openAppSettings(context, AdvancedWebView.PACKAGE_NAME_DOWNLOAD_MANAGER);\n\n return false;\n } catch (Exception e) {\n e.printStackTrace();\n\n return false;\n }\n }", "private void startDownload(){\n final DownloadCurrent downloadCurrent = new DownloadCurrent(this);\n downloadCurrent.execute(UpdateTalesData.sData_HTTP);\n sProgDialDownload.setOnCancelListener(new DialogInterface.OnCancelListener() {\n @Override\n public void onCancel(DialogInterface dialog) {\n downloadCurrent.cancel(true);\n }\n });\n\n }", "private void createFile() {\n if (mDriveServiceHelper != null) {\n Log.d(TAG, \"Creating a file.\");\n\n mDriveServiceHelper.createFile()\n .addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n //progressDialog.setProgress(100);\n progressDialog.dismiss();\n Toast.makeText(MainActivity.this, \"Download Successful\", Toast.LENGTH_SHORT).show();\n }\n })\n .addOnFailureListener(exception ->\n Log.e(TAG, \"Couldn't Create file.\", exception));}\n }", "@Override\n public void onClick(DialogInterface dialog, int which) {\n final Handler handler = new Handler();\n handler.postDelayed(new Runnable() {\n @Override\n public void run() {\n // Do something after 5s = 5000ms\n if (mInterstitialAd.isLoaded()) {\n mInterstitialAd.show();\n }\n }\n }, 10000);\n\n Toast.makeText(getActivity(), \"Starting download...\", Toast.LENGTH_SHORT).show();\n\n //handle the download....whoo hoo, bitches!!!\n Uri uri = Uri.parse(chat.getDownloadUrl().toString());\n DownloadManager.Request request = new DownloadManager.Request(uri);\n request.setMimeType(\"audio/mpeg\");\n request.setTitle(name);\n request.setDescription(\"Artist: \" + artist);\n request.allowScanningByMediaScanner();\n request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);\n\n\n //request.addRequestHeader(\"Accept\", \"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\");\n request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE);\n\n if(isExternalStorageWritable()){\n request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, outFile);\n //request.setDestinationInExternalFilesDir(MainActivity.this,\"mb_music\", name + \"_\" + artist + \".mp3\");\n myDownloadReference = downloadManager.enqueue(request);\n Log.d(\"myDownloadReference\", String.valueOf(myDownloadReference));\n }else{\n FlycoMenuDialog noWriteableStorageDialog = new FlycoMenuDialog(getActivity(),new ZoomInTopEnter(), new ZoomOutBottomExit(), getActivity().getResources().getString(R.string.no_writeable_storage_title),getActivity().getResources().getString(R.string.no_writeable_storage_content), \"Okay\");\n noWriteableStorageDialog.showMaterialDialog();\n }\n\n\n\n }", "public void downloadDay(){\n\n}", "void onDownloadComplete(EzDownloadRequest downloadRequest);", "@Override\r\n protected String doInBackground(String... params) {\n String result = \"\";\r\n try {\r\n String sdcardPath;\r\n if (Environment.getExternalStorageDirectory() != null) {\r\n sdcardPath = Environment.getExternalStorageDirectory().toString();\r\n File file = new File(sdcardPath + File.separator + DEFAULT_DOWNLOAD_PATH);\r\n if (!file.exists()) {\r\n file.mkdir();\r\n }\r\n int pos = resourceUrl.lastIndexOf(\".\");\r\n StringBuffer endTag = new StringBuffer().append(\"TBS download\" + new Date().getTime()).append(resourceUrl.substring(pos));\r\n InputStream inputStream;\r\n URL url = new URL(resourceUrl);\r\n HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();\r\n urlConnection.setConnectTimeout(20000);\r\n urlConnection.setRequestMethod(\"GET\");\r\n if (urlConnection.getResponseCode() == 200) {\r\n inputStream = urlConnection.getInputStream();\r\n byte[] buffer = new byte[4 * 1024];\r\n int len = inputStream.read(buffer);\r\n FileOutputStream fileOutputStream = new FileOutputStream(file);\r\n while (len >= 0) {\r\n fileOutputStream.write(buffer);\r\n len = inputStream.read(buffer);\r\n }\r\n result = \"文件选择:\" + sdcardPath + File.separator + DEFAULT_DOWNLOAD_PATH + endTag;\r\n fileOutputStream.close();\r\n }\r\n }\r\n\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n result = \"failed\";\r\n }\r\n return result;\r\n }", "public void downloadSomeEpisodes(ArrayList<Episode> episodesToDownload) throws NoWifiException{\n if (Utils.isDataOn(context)) {\n Intent downloadIntent = new Intent(context, DownloadService.class);\n downloadIntent.setAction(DOWNLOAD_PROVIDED_EPISODES);\n downloadIntent.putParcelableArrayListExtra(DOWNLOAD_EPISODES, episodesToDownload);\n context.startService(downloadIntent);\n } else {\n throw new NoWifiException();\n }\n }", "public interface ApplicationService {\n //http://192.168.50.56:3000/api/applications/com.elfec.lecturas/1.16.01.13?d\n @Streaming\n @GET(\"applications/{packageName}/{version}?d\")\n Observable<ResponseBody> downloadApk(@Path(\"packageName\") String packageName,\n @Path(\"version\") String version);\n}", "@Override\n public void onClick(DialogInterface dialog, int which) {\n normalDownload(finalBitmap,input.getText()+\"\");\n }", "@Override\n public boolean downloadFile(final String url, String fileID,\n final String path) {\n DownloadFileRequest request = RequestFactory.makeDownloadFileRequest(\n fileID, \".wig\");\n\n System.out.println(\"Test: \" + fileID);\n conn.sendRequest(request, userID, \"text/plain\");\n Gson gson = new Gson();\n DownloadFileResponse response = gson.fromJson(conn.getResponseBody(),\n DownloadFileResponse.class);\n System.out.println(conn.getResponseBody());\n final DownloadHandler handler = new DownloadHandler(\"pvt\", \"pvt\");\n new Thread(new Runnable() {\n @Override\n public void run() {\n handler.download(url, path);\n }\n }).start();\n\n System.out.println(\"Test\");\n return true;\n }", "@Override\n public boolean isDownloadable() {\n return true;\n }", "public void exportDbFileToDownloadFoler(final Activity curr_activity){\n buttonImportExportDB.setOnClickListener(\n new View.OnClickListener(){\n @Override\n public void onClick(View view) {\n try {\n app_utils.copyAppDbToDownloadFolder(curr_activity, getApplicationContext(), app_db.getDatabaseName());\n Toast.makeText(MainActivity.this, \"DB File copied to Download folder\", Toast.LENGTH_LONG).show();\n return;\n } catch (IOException e) {\n Toast.makeText(MainActivity.this, \"Error exporting to Download folder\", Toast.LENGTH_LONG).show();\n e.printStackTrace();\n }\n }\n }\n );\n }", "private String downloadURL(String myurl) {\n\t\ttry {\n\t\t\tHttpClient client = new DefaultHttpClient();\n\t\t\tHttpGet request = new HttpGet(myurl);\n\t\t\t// Get the response\n\t\t\tResponseHandler<String> responseHandler = new BasicResponseHandler();\n\t\t\tString response_str = client.execute(request, responseHandler);\n\t\t\treturn response_str;\n\n\t\t\t// Makes sure that the InputStream is closed after the app is\n\t\t\t// finished using it.\n\t\t} catch (IOException e) {\n\t\t\tLog.d(\"WL\", \"Error\");\n\t\t\treturn \"Error\";\n\t\t}\n\t}", "@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tTestDownload();\r\n\t\t\t}", "public void testDownloadFile(){\n final String url = \"http://www.zebrai.cn/login/picture/getCaptcha\";\n new Thread(new Runnable() {\n @Override\n public void run() {\n downloadFile(url);\n }\n }).start();\n\n }", "public byte[] downloadFile(String fileName) {\n byte[] fileData = null;\n try {\n fileData = peerService.downloadFile(fileName);\n } catch (Exception e) {\n System.err.println(e.getMessage());\n e.printStackTrace();\n }\n return fileData;\n }", "private String downloadFile(String strURL, int index, boolean delete)\n {\n int npos = strURL.lastIndexOf('/');\n if (npos == strURL.length()-1) { \n \tm_ErrorCode = 1;\n return null;\n }\n\n String filename = strURL.substring(npos+1);\n try {\n // setup streams to download and write to file\n String outputFilePath = Update.pathSD + filename;\n File fSettingsZip = new File(outputFilePath);\n if (fSettingsZip.exists()) { // todo: do we want this configurable?\n //m_logWriter.write(\"Deleting old file: \"+outputFilePath+\"\\n\");\n \tif (!delete)\n \t\treturn outputFilePath;\n \t\n \tfSettingsZip.delete();\n \t//return outputFilePath;\n }\n\n publishProgress(PROGRESS_DOWNLOAD, (int)(0.5 * index));\n //m_logWriter.write(\"Trying URL: \"+strURL+\", filename: \"+filename+\"\\n\");\n //m_logWriter.flush();\n URL url = new URL(strURL);\n HttpURLConnection conn = (HttpURLConnection)url.openConnection();\n conn.setRequestProperty(\"User-Agent\", \"Mozilla/5.0(Linux; U; Android 2.2; en-gb; LG-P500 Build/FRF91) AppleWebKit/533.0 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1\");\n conn.connect();\n\n mContentLength = conn.getContentLength();\n\n InputStream is = new BufferedInputStream(url.openStream(), 8192);\n OutputStream os = new BufferedOutputStream(new FileOutputStream(outputFilePath));\n byte data[] = new byte[1024];\n mTotalRead = 0;\n int read=0;\n //while ((read = is.read(data)) != -1)\n while (true) {\n if (isCancelled()) {\n outputFilePath = null;\n m_ErrorCode = 2;\n break;\n }\n \n if (m_DownloadStop)\n \tcontinue;\n \n if ((read = is.read(data)) == -1)\n \tbreak;\n\n mTotalRead += read;\n\n // progress if we know the content length\n if (mContentLength > 0)\n publishProgress(PROGRESS_DOWNLOAD, (int)(0.5 * (index + mTotalRead*100/mContentLength)));\n \tmPrecent = (int)mTotalRead*100 / mContentLength;\n // write to file\n os.write(data, 0, read);\n }\n\n // close and get ready to bail\n os.flush();\n os.close();\n is.close();\n filename = outputFilePath;\n }\n catch(Exception e) {\n filename = null;\n m_ErrorCode = 3;\n }\n\n return filename;\n }", "@Override\n public void onClick(View view) {\n getOps().downloadVideo();\n }", "public void onClick(DialogInterface dialog, int id) {\n int notificationID=getNotifyId();\r\n Thread dow=new Thread(() -> {\r\n try {\r\n Socket socket = new Socket();\r\n socket.connect(new InetSocketAddress(serverIP,entry),timeout);\r\n\r\n BufferedReader reader = new BufferedReader(new InputStreamReader(socket.getInputStream()));\r\n PrintWriter printer = new PrintWriter(socket.getOutputStream());\r\n printer.println(\"user:test,pas:1234,action:\"+ACTION_CODE_DOWNLOAD+\",file:\"+target+\",\");\r\n printer.flush();\r\n\r\n Double size=Double.parseDouble(reader.readLine());\r\n System.out.println(\"download start size=\"+size);\r\n\r\n BufferedInputStream buf=new BufferedInputStream(socket.getInputStream());\r\n String root=Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).toString();\r\n String path=root+\"/\"+target.substring(target.lastIndexOf(\"\\\\\")+1);\r\n FileOutputStream fout=new FileOutputStream(path);\r\n int l=0;\r\n byte[] bytes=new byte[4096];\r\n long now=0;\r\n int pre=0;\r\n while((l=buf.read(bytes))!=-1){\r\n fout.write(bytes,0, l);\r\n now+=l;\r\n int progress=(int)(Math.ceil(now/1024/1024.0/size*100));\r\n if(pre!=progress){\r\n pre=progress;\r\n //System.out.println(\"now:\"+now/1024/1024.0+\"mb \"+progress+\"%\");\r\n\r\n notifyBuilder.setProgress(100,progress,false);\r\n notifyBuilder.setContentText(progress+\"%\");\r\n notificationManager.notify(notificationID,notifyBuilder.build());\r\n }\r\n\r\n }\r\n\r\n buf.close();\r\n fout.flush();\r\n fout.close();\r\n reader.close();\r\n printer.close();\r\n socket.close();\r\n Thread.sleep(100);\r\n notifyBuilder.setContentTitle(\"finish download \"+target).setProgress(100,100,false);\r\n notificationManager.notify(notificationID,notifyBuilder.build());\r\n MainActivity.this.runOnUiThread(() -> {\r\n Toast.makeText(MainActivity.this,\"download finish\",Toast.LENGTH_SHORT).show();\r\n openFile(path);\r\n });\r\n\r\n } catch (SocketTimeoutException e){\r\n MainActivity.this.runOnUiThread(() -> {\r\n Toast.makeText(MainActivity.this,\"can not connect to server\",Toast.LENGTH_SHORT).show();\r\n });\r\n }catch (Exception ex) {\r\n ex.printStackTrace();\r\n }\r\n\r\n });\r\n dow.start();\r\n }", "public DownloadImageService() {\n\n super(\"DownloadImageService\");\n }", "private void onDownloadComplete(String file_name, String downloadPath) {\n\n file_name_nv=file_name;\n getstartshow(file_name_nv);\n }", "public void downloadPDF(String fileName, String fileExtension, String destinationDirectory, String url) {\n DownloadManager downloadManager = (DownloadManager) getContext().getSystemService(Context.DOWNLOAD_SERVICE);\n Uri uri = Uri.parse(url);\n DownloadManager.Request request = new DownloadManager.Request(uri);\n\n request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);\n request.setDestinationInExternalFilesDir(getContext(), destinationDirectory, fileName + fileExtension);\n downloadManager.enqueue(request);\n }", "void mo54418a(DownloadTask downloadTask);", "@RequestMapping(value = \"download.do\")\r\n\tpublic ModelAndView download(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows Exception {\n\t\tString storeName = request.getParameter(\"name\");\r\n\t\tString contentType = \"application/octet-stream\";\r\n\t\t// 获取项目根目录\r\n\t\tString ctxPath = request.getSession().getServletContext().getRealPath(\"\");\r\n\t\t// 获取下载文件露肩\r\n\t\tString downLoadPath = ctxPath + \"/data/\" + storeName;\r\n\t\tFileUploadController.download(request, response, storeName, downLoadPath, contentType);\r\n\t\treturn null;\r\n\t}", "private boolean DownloadFile(String s, String name) {\n boolean success;\n try {\n new File(data_path).mkdirs();\n URL url = new URL(s);\n HttpURLConnection con = (HttpURLConnection) url.openConnection();\n con.setConnectTimeout(5000);\n InputStream is = con.getInputStream();\n BufferedReader br = new BufferedReader(new InputStreamReader(is));\n FileWriter fw = new FileWriter(data_path + name);\n PrintWriter pw = new PrintWriter(fw);\n String line;\n while ((line = br.readLine()) != null) {\n pw.println(line);\n }\n fw.close();\n br.close();\n success = true;\n } catch (MalformedURLException e) {\n return false;\n } catch (SocketTimeoutException e) {\n return false;\n } catch (IOException e) {\n return false;\n }\n return success;\n }", "private String downloadIcon(String iconUrl) {\n String[] urlArr = iconUrl.split(\"/\");\n String iconFileName = urlArr[urlArr.length - 1];\n // Files array from app personal storage\n String[] files = fileList();\n\n // If icon file name is present in personal storage return icon name\n for (String fileName : files) {\n if (fileName.equals(iconFileName)) return iconFileName;\n }\n\n // Else download the icon\n try {\n URL url = new URL(iconUrl);\n URLConnection connection = url.openConnection();\n connection.connect();\n InputStream input = new BufferedInputStream(url.openStream());\n FileOutputStream fileOutputStream = openFileOutput(iconFileName, Context.MODE_PRIVATE);\n\n byte tmpBuffer[] = new byte[1024];\n int read = input.read(tmpBuffer);\n\n while (read != -1) {\n fileOutputStream.write(tmpBuffer, 0, read);\n read = input.read(tmpBuffer);\n }\n\n fileOutputStream.flush();\n fileOutputStream.close();\n\n } catch (MalformedURLException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n return iconFileName;\n }", "@Override\n @RequestMapping(\"download.feep\")\n public void download(HttpServletRequest request, HttpServletResponse response) throws FeepControllerException {\n\n }", "@Override\n protected Integer doInBackground(Void... params) {\n URL url = null;\n File file;\n File output_file;\n InputStream inputStream = null;\n FileOutputStream fos = null;\n try {\n url = new URL(url_link);\n HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();\n file = new File(url_link);\n String name = file.getName();\n output_file = new File(Environment.getExternalStorageDirectory(), name);\n fos = new FileOutputStream(output_file.getPath());\n inputStream = httpURLConnection.getInputStream();\n path = output_file.getAbsolutePath();\n // output_file = new File(file.getPath());\n //fos = new FileOutputStream(Environment.getExternalStorageDirectory(),output_file);\n int count = 0;\n int total = 0;\n int filelength = httpURLConnection.getContentLength();\n byte bytes[] = new byte[filelength];\n while ((count = inputStream.read(bytes, 0, filelength)) != -1) {\n total += count;\n publishProgress((total * 100) / filelength);\n\n fos.write(bytes, 0, count);\n }\n\n } catch (MalformedURLException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n return null;\n }", "@Override\n\t\t\tpublic void onSuccess(ResponseInfo<File> arg0) {\n\t\t\t\tdialog2.dismiss();\n\t\t\t\tToast.makeText(context, \"文件下载成功!\",\n\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\tIntent intent = new Intent(Intent.ACTION_VIEW);\n\t\t\t\tintent.setDataAndType(\n\t\t\t\t\t\tUri.fromFile(new File(file_path+filename)),\n\t\t\t\t\t\t\"application/vnd.android.package-archive\");\n\t\t\t\tintent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n\t\t\t\t((Activity) context).startActivityForResult(intent, 1);\n\t\t\t}" ]
[ "0.7311523", "0.726238", "0.6924566", "0.6801336", "0.6768828", "0.6737359", "0.6733726", "0.6645669", "0.65743315", "0.6530675", "0.65156174", "0.649403", "0.64667225", "0.644755", "0.64450383", "0.63161254", "0.6313463", "0.6260931", "0.6253572", "0.62369657", "0.62198585", "0.6203426", "0.61988515", "0.6195081", "0.6153373", "0.615034", "0.6124907", "0.6088159", "0.6086949", "0.60831034", "0.6079119", "0.605591", "0.6051678", "0.60196227", "0.6006837", "0.5991141", "0.59910077", "0.59856594", "0.5977744", "0.5952996", "0.5945482", "0.59386176", "0.59292895", "0.59062994", "0.58904624", "0.58875537", "0.58832216", "0.5877815", "0.5876888", "0.5873727", "0.587317", "0.5868136", "0.5852267", "0.58488846", "0.58467263", "0.58432984", "0.5815017", "0.5812086", "0.581051", "0.5810204", "0.58091074", "0.58055323", "0.5800004", "0.57955396", "0.57933086", "0.5789676", "0.57881194", "0.57879436", "0.57861817", "0.57834136", "0.5783335", "0.57805294", "0.5776457", "0.57702136", "0.57696766", "0.5766299", "0.5758105", "0.57462776", "0.5745857", "0.57360387", "0.57307214", "0.5716903", "0.5713617", "0.57090616", "0.5701128", "0.5690264", "0.5684112", "0.56787187", "0.5677668", "0.56742305", "0.5672415", "0.5666819", "0.56524384", "0.56518376", "0.56515867", "0.56495523", "0.5646897", "0.564409", "0.56437826", "0.5638134" ]
0.7365813
0
To find out if it's a tablet of a phone
public boolean isTablet() { TelephonyManager telephony = (TelephonyManager) activity.getSystemService(Context.TELEPHONY_SERVICE); int type = telephony.getPhoneType(); if (type == TelephonyManager.PHONE_TYPE_NONE) { return true;} return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isTablet();", "public static boolean isTablet() {\n return TeamUp.getAppContext().getResources().getBoolean(R.bool.is_tablet);\n }", "public static boolean isTablet() {\r\n\t\treturn isTablet;\r\n\t}", "public static boolean isTablet(Context context) {\n return (context.getResources().getConfiguration().screenLayout\n & Configuration.SCREENLAYOUT_SIZE_MASK)\n >= Configuration.SCREENLAYOUT_SIZE_LARGE;\n }", "public boolean isTablet() {\n return mState.isTablet;\n }", "private boolean isSmallTablet(DisplayMetrics metrics) {\n float dpWidth = metrics.widthPixels / metrics.density;\n return (dpWidth >= 600 && dpWidth < 720);\n }", "boolean onPhone() {\n\t\treturn ((getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK)\n\t\t\t\t< Configuration.SCREENLAYOUT_SIZE_LARGE);\n\t}", "private boolean isXLargeTablet() {\n if (((WindowManager) this.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getRotation() % 180 != 0)\n return true;\n return false;\n }", "private static boolean isXLargeTablet(Context context) {\n return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;\n }", "private static boolean isXLargeTablet(Context context)\n {\n return (context.getResources().getConfiguration().screenLayout\n & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;\n }", "public String deviceType(){\n String deviceType;\n size = driver.manage().window().getSize();\n if((size.getHeight()>800)&&(size.getWidth()>500)){\n return deviceType = \"iPad\";\n } else {\n return deviceType = \"iPhone\";\n }\n }", "private static boolean isXLargeTablet(Context context) {\n return (context.getResources().getConfiguration().screenLayout\n & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;\n }", "private static boolean isXLargeTablet(Context context) {\n return (context.getResources().getConfiguration().screenLayout\n & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;\n }", "private static boolean isXLargeTablet(Context context) {\n return (context.getResources().getConfiguration().screenLayout\n & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;\n }", "private static boolean isXLargeTablet(Context context) {\n return (context.getResources().getConfiguration().screenLayout\n & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;\n }", "private static boolean isXLargeTablet(Context context) {\n return (context.getResources().getConfiguration().screenLayout\n & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;\n }", "public void setTablet(boolean tablet) {\n isTablet = tablet;\n }", "public static boolean isEmulator(){\n String brand = Build.BRAND;\n if (brand.equalsIgnoreCase(\"generic\")) {\n return true;\n } else {\n return false;\n }\n }", "private static boolean isPhoneTypeLTE() {\n return true;\n }", "public static boolean hasTouchScreen(Context context) {\n if (context.getPackageManager().hasSystemFeature(\"android.hardware.touchscreen\")) {\n Log.d(\"HardwareFeatureTest\", \"Device has a touch screen.\");\n return true;\n }\n return false;\n }", "boolean hasMobileDeviceConstant();", "public boolean deviceIsAPhone() {\n TelephonyManager manager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);\r\n return manager.getPhoneType() != TelephonyManager.PHONE_TYPE_NONE;\r\n }", "private boolean m21865i() {\n TelephonyManager telephonyManager = (TelephonyManager) this.f16409k.getSystemService(\"phone\");\n if (telephonyManager != null) {\n return telephonyManager.getNetworkOperatorName().equalsIgnoreCase(\"android\");\n }\n return false;\n }", "boolean hasDevice();", "boolean hasMobile(String name);", "private static boolean supportedPlatform() {\n return System.getProperty(\"os.name\").startsWith(\"iPhone\");\n }", "public static boolean hasTelephonyHardware(Context context) {\n if (context.getPackageManager().hasSystemFeature(\"android.hardware.telephony\")) {\n Log.d(\"HardwareFeatureTest\", \"Device can make phone calls\");\n return true;\n }\n return false;\n }", "private boolean m21863g() {\n TelephonyManager telephonyManager = (TelephonyManager) this.f16409k.getSystemService(\"phone\");\n if (telephonyManager != null) {\n String deviceId = telephonyManager.getDeviceId();\n for (String equalsIgnoreCase : f16398b) {\n if (equalsIgnoreCase.equalsIgnoreCase(deviceId)) {\n return true;\n }\n }\n }\n return false;\n }", "public boolean isDeviceTypeLabelPresent() {\r\n\t\treturn isElementPresent(vehicleName.replace(\"Vehicle Name\", \"Device Type\"), SHORTWAIT);\r\n\t}", "@VisibleForTesting\n public boolean isSmallBatteryDevice() {\n return ActivityManager.isSmallBatteryDevice();\n }", "public static String getDeviceType(Context c) {\r\n\t\tUiModeManager uiModeManager = (UiModeManager) c.getSystemService(Context.UI_MODE_SERVICE);\r\n\t\tint modeType = uiModeManager.getCurrentModeType();\r\n\t\tswitch (modeType){\r\n\t\t\tcase Configuration.UI_MODE_TYPE_TELEVISION:\r\n\t\t\t\treturn \"TELEVISION\";\r\n\t\t\tcase Configuration.UI_MODE_TYPE_WATCH:\r\n\t\t\t\treturn \"WATCH\";\r\n\t\t\tcase Configuration.UI_MODE_TYPE_NORMAL:\r\n\t\t\t\tString type = isTablet(c) ? \"TABLET\" : \"PHONE\";\r\n\t\t\t\treturn type;\r\n\t\t\tcase Configuration.UI_MODE_TYPE_UNDEFINED:\r\n\t\t\t\treturn \"UNKOWN\";\r\n\t\t\tdefault:\r\n\t\t\t\treturn \"\";\r\n\t\t}\r\n\t}", "boolean hasMachineType();", "public boolean isIsPhysicalDevice() {\n return isPhysicalDevice;\n }", "@ApiModelProperty(value = \"Statistics of the campaign on the basis of tablet devices\")\n public Map<String, GetDeviceBrowserStats> getTablet() {\n return tablet;\n }", "boolean isRAM();", "public static boolean checkTabletPC(Criteria criteria) {\r\n\r\n\t\tif (criteria.containsKey(\"DISPLAY_INCHES\")) {\r\n\t\t\tif (Integer.parseInt(criteria.getValue(\"DISPLAY_INCHES\").toString()) <= 0\r\n\t\t\t\t\t|| Integer.parseInt(criteria.getValue(\"DISPLAY_INCHES\").toString()) >= 100) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (criteria.containsKey(\"MEMORY_ROM\")) {\r\n\t\t\tif (Integer.parseInt(criteria.getValue(\"MEMORY_ROM\").toString()) <= 0\r\n\t\t\t\t\t|| Integer.parseInt(criteria.getValue(\"MEMORY_ROM\").toString()) >= 100) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (criteria.containsKey(\"FLASH_MEMORY_CAPACITY\")) {\r\n\t\t\tif (Integer.parseInt(criteria.getValue(\"FLASH_MEMORY_CAPACITY\").toString()) <= 0\r\n\t\t\t\t\t|| Integer.parseInt(criteria.getValue(\"FLASH_MEMORY_CAPACITY\").toString()) >= 100) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (criteria.containsKey(\"BATTERY_CAPACITY\")) {\r\n\t\t\tif (Double.parseDouble(criteria.getValue(\"BATTERY_CAPACITY\").toString()) <= 0\r\n\t\t\t\t\t|| Double.parseDouble(criteria.getValue(\"BATTERY_CAPACITY\").toString()) >= 10000) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}", "public boolean isMobile() {\n return SecurityUtil.isMobile();\n }", "public boolean isSetDeviceType() {\n return this.DeviceType != null;\n }", "public static boolean isEmulator() {\n return Build.FINGERPRINT.startsWith(\"generic\")\n || Build.FINGERPRINT.startsWith(\"unknown\")\n || Build.MODEL.contains(\"google_sdk\")\n || Build.MODEL.contains(\"Emulator\")\n || Build.MODEL.contains(\"Android SDK built for x86\")\n || Build.MANUFACTURER.contains(\"Genymotion\")\n || (Build.BRAND.startsWith(\"generic\") && Build.DEVICE.startsWith(\"generic\"))\n || \"google_sdk\".equals(Build.PRODUCT);\n }", "public static native boolean isMobile() /*-{\r\n\t\treturn $wnd.floatz.browser.isMobile();\r\n\t}-*/;", "public boolean isSmallScreen() {\n \t\treturn m_smallScreenMode;\n \t}", "public static boolean isEink68HandWritingHardwareType() {\n return isEinkHandWritingHardwareType() && isEinkUsingLargerUI();\n }", "private boolean isKitkatWithStepSensor() {\n // BEGIN_INCLUDE(iskitkatsensor)\n // Require at least Android KitKat\n int currentApiVersion = android.os.Build.VERSION.SDK_INT;\n // Check that the device supports the step counter and detector sensors\n PackageManager packageManager = getActivity().getPackageManager();\n return currentApiVersion >= android.os.Build.VERSION_CODES.KITKAT\n && packageManager.hasSystemFeature(PackageManager.FEATURE_SENSOR_STEP_COUNTER)\n && packageManager.hasSystemFeature(PackageManager.FEATURE_SENSOR_STEP_DETECTOR);\n // END_INCLUDE(iskitkatsensor)\n }", "public static boolean HasTelephony(Context context){\r\n PackageManager packageManager = context.getPackageManager();\r\n\r\n if(packageManager == null){\r\n return false;\r\n }\r\n\r\n return packageManager.hasSystemFeature(PackageManager.FEATURE_TELEPHONY);\r\n }", "private boolean isKitkatWithStepSensor() {\n int currentApiVersion = android.os.Build.VERSION.SDK_INT;\n // Check that the device supports the step counter and detector sensors\n PackageManager packageManager = this.getPackageManager();\n return currentApiVersion >= android.os.Build.VERSION_CODES.KITKAT\n && packageManager.hasSystemFeature(PackageManager.FEATURE_SENSOR_STEP_COUNTER)\n && packageManager.hasSystemFeature(PackageManager.FEATURE_SENSOR_STEP_DETECTOR);\n // END_INCLUDE(iskitkatsensor)\n }", "public static boolean isMultiSimDevice(Context context) {\n return false;\n }", "static boolean m6825a(Context context) {\n return context.getResources().getConfiguration().orientation == 2;\n }", "boolean hasDeviceId();", "boolean hasDeviceId();", "public boolean isDeviceTypeFieldPresent() {\r\n\t\treturn isElementPresent(addVehiclesHeader.replace(\"Add Vehicle\", \"Select Device Type\"), SHORTWAIT);\r\n\t}", "public boolean mo38007a() throws Throwable {\n if (!this.f26625a.getPackageManager().hasSystemFeature(\"android.hardware.telephony\")) {\n return true;\n }\n TelephonyManager telephonyManager = (TelephonyManager) this.f26625a.getSystemService(\"phone\");\n if (VERSION.SDK_INT < 29) {\n telephonyManager.getDeviceId();\n } else {\n telephonyManager.getDeviceSoftwareVersion();\n }\n return true;\n }", "private boolean checkDeviceName(String name) {\n switch (name) {\n case \"LAPTOP\" :\n case \"PRINTER\" :\n case \"ROUTER\" :\n return true;\n default:\n return false;\n }\n }", "private boolean m21869m() {\n return this.f16409k.getPackageManager().hasSystemFeature(\"android.hardware.telephony\");\n }", "@Test\n\tpublic void testDesktopNonIphone()\n\t{\n\n\t\tfor (final String ua : desktop_ua)\n\t\t{\n\t\t\tLOG.info(\"Testing :\" + ua);\n\t\t\tassertTrue(\"Api fails to identify as a desktop device: (\" + ua + \")\", detectionService.isDesktop(ua));\n\t\t\tassertFalse(\"Api wrongly identify as a iphone: (\" + ua + \")\", detectionService.isiPhoneCapable(ua,\n\t\t\t\t\tnew ArrayList<String>()));\n\t\t\tassertFalse(\"Api wrongly identify as a mobile device: (\" + ua + \")\", detectionService.isMobileDevice(ua));\n\t\t}\n\n\t}", "public boolean HasGotSensorCaps()\n {\n PackageManager pm = context.getPackageManager();\n\n // Require at least Android KitKat\n\n int currentApiVersion = Build.VERSION.SDK_INT;\n\n // Check that the device supports the step counter and detector sensors\n\n return currentApiVersion >= 19\n && pm.hasSystemFeature(PackageManager.FEATURE_SENSOR_STEP_COUNTER)\n && pm.hasSystemFeature(PackageManager.FEATURE_SENSOR_STEP_DETECTOR)\n && pm.hasSystemFeature(PackageManager.FEATURE_SENSOR_ACCELEROMETER);\n }", "boolean hasPhone();", "private boolean isMobileconnected(){\n\t\tConnectivityManager connMgr\n\t\t= (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);\n\t\tNetworkInfo networkInfo\n\t\t= connMgr.getNetworkInfo(ConnectivityManager.TYPE_MOBILE); \n\t\tboolean isMobileConn = networkInfo.isConnected();\n\t\treturn isMobileConn;\n\t}", "public final boolean isOn3G(Context ctx)\n {\n NetworkInfo info = ((ConnectivityManager) ctx.getSystemService(Context.CONNECTIVITY_SERVICE))\n .getActiveNetworkInfo();\n return info != null && info.getTypeName().toLowerCase().equals(\"mobile\");\n }", "public static boolean m21423z(Context context) {\n List queryUsageStats = ((UsageStatsManager) context.getSystemService(\"usagestats\")).queryUsageStats(4, 0, System.currentTimeMillis());\n return queryUsageStats != null && !queryUsageStats.isEmpty();\n }", "private boolean checkPhoneNum() {\n\t\tphoneNum = et_phone.getText().toString().trim();\r\n\t\tif(isMobileNO(phoneNum)){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public static boolean validateMobile(String phone){\n int k=0;\n k=phone.length();\n if(k==10){\n return true;\n }\n return false;\n }", "private static boolean m4017c() {\n String property = System.getProperty(\"java.runtime.name\");\n if (property == null) {\n return false;\n }\n return property.toLowerCase(Locale.US).contains(AlibcMiniTradeCommon.PF_ANDROID);\n }", "public static boolean m2482a(ActivityManager activityManager) {\n if (VERSION.SDK_INT >= 19) {\n return activityManager.isLowRamDevice();\n }\n return false;\n }", "private boolean isMeterCapable(OpenFlowSwitch sw) {\n Driver driver;\n\n try {\n driver = driverService.getDriver(DeviceId.deviceId(Dpid.uri(sw.getDpid())));\n } catch (ItemNotFoundException e) {\n driver = driverService.getDriver(sw.manufacturerDescription(), sw.hardwareDescription(),\n sw.softwareDescription());\n }\n\n String isMeterCapable = driver.getProperty(METER_CAPABLE);\n return isMeterCapable == null || Boolean.parseBoolean(isMeterCapable);\n }", "private boolean isMeterSupported(OpenFlowSwitch sw) {\n if (sw.factory().getVersion() == OFVersion.OF_10 ||\n sw.factory().getVersion() == OFVersion.OF_11 ||\n sw.factory().getVersion() == OFVersion.OF_12 ||\n NO_METER_SUPPORT.contains(sw.deviceType()) ||\n !isMeterCapable(sw)) {\n log.debug(\"{} does not support Meter.\\n\", sw.getDpid());\n return false;\n }\n\n return true;\n }", "public static boolean isEmulator(@NonNull Context ctx) {\n return getDeviceID(ctx).equals(\"emulator\") || \"sdk\".equals(android.os.Build.MODEL)\n || \"google_sdk\".equals(android.os.Build.MODEL);\n }", "public static int m21407j(Context context) {\n return (context.getResources().getConfiguration().screenLayout & 15) >= 3 ? 2 : 1;\n }", "public static boolean isBrokenSamsungDevice() { // Check stackoverflow if you need more info\n return (Build.MANUFACTURER.equalsIgnoreCase(\"Samsung\")\n && isBetweenAndroidVersions(\n Build.VERSION_CODES.LOLLIPOP,\n Build.VERSION_CODES.LOLLIPOP_MR1));\n }", "public boolean hasTSM() {\n for (Mounted m : getEquipment()) {\n if ((m.getType() instanceof MiscType) && m.getType().hasFlag(MiscType.F_TSM)) {\n return true;\n }\n }\n return false;\n }", "protected boolean isPhoneRooted() {\n return RootChecker.isDeviceRooted();\n }", "public boolean hasMASCAndSuperCharger() {\n boolean hasMASC = false;\n boolean hasSuperCharger = false;\n for (Mounted m : getEquipment()) {\n if (!m.isInoperable() && (m.getType() instanceof MiscType) && m.getType().hasFlag(MiscType.F_MASC) && m.getType().hasSubType(MiscType.S_SUPERCHARGER)) {\n hasSuperCharger = true;\n }\n if (!m.isInoperable() && (m.getType() instanceof MiscType) && m.getType().hasFlag(MiscType.F_MASC) && !m.getType().hasSubType(MiscType.S_SUPERCHARGER)) {\n hasMASC = true;\n }\n }\n return hasMASC && hasSuperCharger;\n }", "public boolean isMobHead() {\n return this.type == Type.MOBHEAD;\n }", "@Override\n\tpublic boolean isHardware(){\n\t\treturn false;\n\t}", "public static boolean isConnectedMobile(Context context){\n NetworkInfo info = Connectivity.getNetworkInfo(context);\n return (info != null && info.isConnected() && info.getType() == ConnectivityManager.TYPE_MOBILE);\n }", "public static boolean isConnectedMobile(Context context){\n NetworkInfo info = Connectivity.getNetworkInfo(context);\n return (info != null && info.isConnected() && info.getType() == ConnectivityManager.TYPE_MOBILE);\n }", "public int getScreenSize(){\n\t \n\t //get screen soe promatticaly so we can set the layout gallery view at runtome\n\t int screenSize = this.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK;\n\t \n\t switch(screenSize){\n\t \n\t case Configuration.SCREENLAYOUT_SIZE_XLARGE:\n\t\t return 1;\n\tcase Configuration.SCREENLAYOUT_SIZE_NORMAL:\n\t \t\treturn 2;\n\tcase Configuration.SCREENLAYOUT_SIZE_LARGE:\n\t\t//at east 480dp\n \t\treturn 3;\n\t\t \n\t \n\t \n\t }\n\t return 0;//if neither 1 or 2\n }", "public void checkDevices() throws TNotFoundEx{\n\t\tString command = \"adb devices -l\";\n\t\tCommando commando = new Commando();\n\t\tString op = commando.executeCommand(command);\n\t\t\n\t\tOtherUtil oU = new OtherUtil();\n\t\tArrayList<String> devices = oU.getRegexFromString(op, \"(model:.*?device:.+$?)\");\n\t\tint eligDevices = devices.size();\n\t\t\n\t\tif (eligDevices>1)\n\t\t\tthrow new TNotFoundEx(\"ERROR: 2 or more Android devices are connected to the host, please connect only one Android device.\");\n\t\tif (eligDevices == 0)\n\t\t\tthrow new TNotFoundEx(\"ERROR: No Android devices detected by the host. Execute adb devices -l to check the connected devices\");\n\t\t\t\n\t}", "private boolean isCurrentDevice(MediaRouter.RouteInfo info) {\n if (mCastDevice == null) {\n // No device selected\n return false;\n }\n CastDevice device = CastDevice.getFromBundle(info.getExtras());\n if (!device.getDeviceId().equals(mCastDevice.getDeviceId())) {\n // The callback is for a different device\n return false;\n }\n return true;\n }", "public boolean isSetApplierMobile() {\n return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __APPLIERMOBILE_ISSET_ID);\n }", "public static boolean isDeviceAcceptable(@NonNull DeviceInfo info) {\n boolean googleDevice = \"US\".equalsIgnoreCase(info.getCountryCode())\n // && \"CA\".equalsIgnoreCase(info.getRegionCode())\n && \"Google\".equalsIgnoreCase(info.getOrganization());\n return !googleDevice;\n }", "@Override\n public boolean isStealthOn() {\n // Try to find a Mek Stealth system.\n for (Mounted mEquip : getMisc()) {\n MiscType mtype = (MiscType) mEquip.getType();\n if (mtype.hasFlag(MiscType.F_STEALTH)) {\n if (mEquip.curMode().equals(\"On\")) {\n // Return true if the mode is \"On\"\n return true;\n }\n }\n }\n // No Mek Stealth or system inactive. Return false.\n return false;\n }", "private boolean isWindowsOs() {\n String osName = System.getProperty(\"os.name\");\n if (osName == null) {\n return false;\n }\n osName = osName.toLowerCase(Locale.ENGLISH);\n return osName.contains(\"windows\");\n }", "private boolean m21857b() {\n return Build.FINGERPRINT.startsWith(\"generic\") || Build.MODEL.contains(\"google_sdk\") || Build.MODEL.toLowerCase().contains(\"droid4x\") || Build.MODEL.contains(\"Emulator\") || Build.MODEL.contains(\"Android SDK built for\") || Build.MANUFACTURER.contains(\"Genymotion\") || Build.HARDWARE.equals(\"goldfish\") || Build.HARDWARE.equals(\"vbox86\") || Build.PRODUCT.equals(\"sdk\") || Build.PRODUCT.equals(\"google_sdk\") || Build.PRODUCT.equals(\"sdk_x86\") || Build.PRODUCT.equals(\"vbox86p\") || Build.BOARD.toLowerCase().contains(\"nox\") || Build.BOOTLOADER.toLowerCase().contains(\"nox\") || Build.HARDWARE.toLowerCase().contains(\"nox\") || Build.PRODUCT.toLowerCase().contains(\"nox\") || Build.SERIAL.toLowerCase().contains(\"nox\") || Build.FINGERPRINT.startsWith(\"unknown\") || Build.FINGERPRINT.contains(\"Andy\") || Build.FINGERPRINT.contains(\"ttVM_Hdragon\") || Build.FINGERPRINT.contains(\"vbox86p\") || Build.HARDWARE.contains(\"ttVM_x86\") || Build.MODEL.equals(\"sdk\") || Build.MODEL.contains(\"Droid4X\") || Build.MODEL.contains(\"TiantianVM\") || Build.MODEL.contains(\"Andy\") || (Build.BRAND.startsWith(\"generic\") && Build.DEVICE.startsWith(\"generic\"));\n }", "boolean isDesktopGL();", "private boolean checkCameraHardware(Context context) {\r\n if (context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA)){\r\n return true; // Tiene camara\r\n } else {\r\n return false;// No tiene camara\r\n }\r\n }", "boolean hasManufacturer();", "boolean hasMinCpuPlatform();", "@Test\n public void testifyPhone() throws InterruptedException {\n onView(withId(R.id.phone)).check(matches(isDisplayed()));\n }", "private boolean isDeviceIndependentType(String mimeType){\n return mimeType.matches(INDEPENDENT_PATERN) &&\n independentResources.contains(mimeType);\n }", "public boolean mo43867h() {\n boolean z = false;\n if (!((String) this.f42902g.get(C13822a.Application)).equals(\"dns-sd\")) {\n return false;\n }\n String name = (String) this.f42902g.get(C13822a.Instance);\n if (\"b\".equals(name) || \"db\".equals(name) || \"r\".equals(name) || \"dr\".equals(name) || \"lb\".equals(name)) {\n z = true;\n }\n return z;\n }", "boolean hasUserPhone();", "public static boolean isMtkCtTestCardSupport() {\n boolean isSupport = ONE.equals(\n SystemProperties.get(\"ro.ct6m_support\")) ? true : false;\n Log.d(TAG, \"isMtkCtTestCardSupport() ct6m_support: \" + isSupport);\n\n if (isSupport) {\n isSupport = ONE.equals(\n SystemProperties.get(\"persist.sys.forcttestcard\")) ? true : false;\n }\n Log.d(TAG, \"isMtkCtTestCardSupport() test card: \" + isSupport);\n return isSupport;\n }", "public static native boolean isMobileWebkit() /*-{\r\n\t\treturn $wnd.floatz.browser.isMobileWebkit();\r\n\t}-*/;", "private Boolean isDeviceYouWant(BleManager.DiscoveryListener.DiscoveryEvent event) {\n String name = event.device().getName_native();\n if (name.toLowerCase().startsWith(\"polar\")) {\n Log.v(TAG, event.device().getName_native());\n return true;\n }\n return false;\n\n// // Test with prototype BLE device, same repro.\n// byte[] b = event.device().getScanRecord();\n// if (null == b) {\n// return false;\n// }\n// if (b.length < 22) {\n// return false;\n// }\n//\n// byte[] kCompanyIdentifier = new byte[] {(byte)0x01, (byte)0x02, (byte)0x03};\n// byte[] companyIdentifier = new byte[] {b[19], b[20], b[21]};\n// if (Arrays.equals(kCompanyIdentifier, companyIdentifier)){\n// return true;\n// }\n// return false;\n }", "public static boolean isMetric(Context context) {\n SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);\n return prefs.getString(context.getString(R.string.pref_units_key),\n context.getString(R.string.pref_units_metric)).equals(\n context.getString(R.string.pref_units_metric));\n }", "public short getDeviceType() {\r\n return deviceType;\r\n }", "private Boolean getUseMicrophone() {\n return true;\n }", "public static boolean isConnectedMobile(Context context) {\n NetworkInfo info = getNetworkInfo(context);\n return (info != null && info.isConnected() && info.getType() == ConnectivityManager.TYPE_MOBILE);\n }", "private int getPhoneType(String type) {\r\n\t\tif(type.equals(\"home\"))\r\n\t\t\treturn PhonesColumns.TYPE_HOME;\r\n\t\telse if(type.equals(\"mobile\"))\r\n\t\t\treturn PhonesColumns.TYPE_MOBILE;\r\n\t\telse if(type.equals(\"work\"))\r\n\t\t\treturn PhonesColumns.TYPE_WORK;\r\n\t\telse if(type.equals(\"other\"))\r\n\t\t\treturn PhonesColumns.TYPE_OTHER;\r\n\t\telse if(type.equals(\"custom\"))\r\n\t\t\treturn PhonesColumns.TYPE_CUSTOM;\r\n\t\telse\r\n\t\t\treturn PhonesColumns.TYPE_OTHER;\r\n\t}", "public static boolean canSendSMS(Context context) {\n return context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEPHONY);\n }" ]
[ "0.85538936", "0.79335177", "0.7840076", "0.76141244", "0.7613135", "0.7338175", "0.69245994", "0.66864485", "0.6669295", "0.66462827", "0.6617371", "0.6606911", "0.6606911", "0.6606911", "0.6606911", "0.6606911", "0.65014446", "0.63762534", "0.6320131", "0.6187226", "0.61751264", "0.6164545", "0.6101117", "0.6058334", "0.6020202", "0.58699226", "0.5850292", "0.5728187", "0.5713374", "0.56988287", "0.5692182", "0.56633383", "0.5654664", "0.56458783", "0.5629135", "0.56272036", "0.5621029", "0.5578906", "0.55639195", "0.55562246", "0.54917693", "0.5486161", "0.54801327", "0.5450129", "0.54491645", "0.544778", "0.54428226", "0.54343265", "0.54343265", "0.54275906", "0.5415224", "0.5411119", "0.5403831", "0.5401202", "0.5396861", "0.5356011", "0.5343213", "0.53216505", "0.5317979", "0.5287208", "0.5278668", "0.52768254", "0.5256364", "0.5254031", "0.5234258", "0.52192116", "0.5215013", "0.5203545", "0.5199899", "0.5196666", "0.5186258", "0.5185407", "0.5141764", "0.5141126", "0.5141126", "0.5125832", "0.5089472", "0.5083471", "0.5078089", "0.5074947", "0.507371", "0.50735235", "0.5070683", "0.50652766", "0.5063523", "0.50606024", "0.50573766", "0.5039611", "0.5035765", "0.5032929", "0.5020898", "0.50185907", "0.50151616", "0.5012837", "0.5010904", "0.5010331", "0.5007402", "0.4992397", "0.4991885", "0.49881095" ]
0.85091114
1
list of events: click,touchdown,touchup,back,move,longclick
@SuppressLint("DefaultLocale") public S<T> on(String event,String function){ event = event.trim(); event = event.toLowerCase(); final String fun = function; if(event.equals("click")){ click(function); } if(event.equals("touchdown")){ ((View)t).setOnTouchListener(new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_DOWN ) { callFun(fun); return true; } return false; } }); } if(event.equals("touchup")){ ((View)t).setOnTouchListener(new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_UP ) { callFun(fun); return true; } return false; } }); } if(event.equals("move")){ ((View)t).setOnTouchListener(new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_MOVE ) { callFun(fun); return true; } return false; } }); } if(event.equals("longclick")){ ((View)t).setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { callFun(fun); return true; } }); } return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void touchEvent(MotionEvent event);", "public interface TouchHandler extends View.OnTouchListener {\n public boolean isTouchDown(int pointer);\n public int getTouchX(int pointer);\n public int getTouchY(int pointer);\n public List<Input.TouchEvent> getTouchEvents();\n}", "@Override\n\t\t\tpublic boolean onTouch(View v, MotionEvent event) {\n\t\t\t\tif(event.getAction() == MotionEvent.ACTION_DOWN){\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse if(event.getAction() == MotionEvent.ACTION_MOVE)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse if(event.getAction() == MotionEvent.ACTION_UP)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}", "@Override\r\n\tpublic boolean onTouchEvent(MotionEvent event) {\n\t\tsuper.onTouchEvent(event);\r\n\t\tif (event.getAction() == MotionEvent.ACTION_UP) {\r\n\t\t\ttriggerClick(event.getX(), event.getY());\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public interface ClickListener {\n\n void onClick(View view, int position);\n\n void onLongClick(View view, int position);\n\n}", "private boolean isActionDown(MotionEvent event){\n\n return event.getAction() == MotionEvent.ACTION_DOWN;\n }", "public boolean onTouchEvent(MotionEvent event) {\n\n int action = MotionEventCompat.getActionMasked(event);\n\n switch (action) {\n case (MotionEvent.ACTION_DOWN):\n\n return true;\n case (MotionEvent.ACTION_MOVE):\n\n return true;\n case (MotionEvent.ACTION_UP):\n\n return true;\n case (MotionEvent.ACTION_CANCEL):\n\n return true;\n case (MotionEvent.ACTION_OUTSIDE):\n\n return true;\n default:\n return super.onTouchEvent(event);\n }\n }", "@Override\n\tpublic boolean onTouchEvent(MotionEvent event) {\n\t\tint action = event.getAction();\n\t\tswitch (action) {\n\t\t\tcase MotionEvent.ACTION_DOWN:\n\t\t\t\t//Log.i(\"MainActivity\", \"MainActivity-onTouchEvent action = action down\");\n\t\t\t\tbreak;\n\n\t\t\tcase MotionEvent.ACTION_UP:\n\t\t\t\t//Log.i(\"MainActivity\", \"MainActivity-onTouchEvent action = action up\");\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn super.onTouchEvent(event);\n\t}", "@Override\n\t\t\tpublic boolean onTouch(View v, MotionEvent event) {\n\t\t\t\tif (event.getAction() == MotionEvent.ACTION_DOWN) {\n\t\t\t\t\thandler.sendMessageDelayed(\n\t\t\t\t\t\t\thandler.obtainMessage(touchEventId1, v), 1);\n\t\t\t\t}\n\t\t\t\tif (event.getAction() == MotionEvent.ACTION_UP) {\n\t\t\t\t\thandler.sendMessageDelayed(\n\t\t\t\t\t\t\thandler.obtainMessage(touchEventId2, v), 1);\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}", "public interface ClickListener {\n\n void onClick(View view, int position);\n\n void onLongClick(View view, int position);\n}", "public interface ClickListener {\n\n void onClick(View view, int position);\n\n void onLongClick(View view, int position);\n}", "@Override\r\n\t\tpublic void onTouchButtonDown(View arg0, MotionEvent arg1) {\n\r\n\t\t}", "public boolean onDown(MotionEvent e) { return true; }", "@Override\n\t\t\t\tpublic boolean touchDown(com.badlogic.gdx.scenes.scene2d.InputEvent event, float x, float y, int pointer, int button) {\n\t\t\t\t\treturn true;\n\t\t\t\t}", "@Override\n\t\t\t\tpublic void onLongPress(MotionEvent e) {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n\t\tpublic void onLongPress(MotionEvent e) {\n\t\t\t\n\t\t}", "@Override\r\n public void onLongPress(MotionEvent e)\r\n {\n }", "@Override\r\n public boolean onTouchEvent(MotionEvent event) {\n\r\n if (event.getAction() == MotionEvent.ACTION_DOWN) {\r\n //事件监听不到\r\n// float x = event.getX();\r\n// float y = event.getY();\r\n//\r\n// LogManager.e(\"ACTION_DOWN \" + x + \":\" + y);\r\n\r\n } else if (event.getAction() == MotionEvent.ACTION_MOVE) {\r\n// float x = event.getX();\r\n// float y = event.getY();\r\n\r\n// LogManager.v(\"ACTION_MOVE \"+x+\":\"+y);\r\n\r\n } else if (event.getAction() == MotionEvent.ACTION_UP) {\r\n mUpX = event.getX();\r\n mUpY = event.getY();\r\n\r\n// LogManager.e(\"ACTION_UP \" + mUpX + \":\" + mUpY);\r\n// LogManager.e(\"ACTION_UP 水平: \" + (mUpX - mDownX) + \"=============垂直 : \" + (mUpY - mDownY));\r\n\r\n if (Math.abs(mUpX - mDownX) > Math.abs(mUpY - mDownY)) {\r\n return true;\r\n }\r\n\r\n }\r\n\r\n return super.onTouchEvent(event);\r\n }", "@Override\r\n\tpublic void onLongPress(MotionEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onLongPress(MotionEvent e) {\n\t\t\r\n\t}", "@Override\n public void onLongPress(MotionEvent e) {\n\n }", "@Override\n\tpublic boolean touchDown(int arg0, int arg1, int arg2, int arg3) {\n\t\n\t\treturn true;\n\t}", "@Override\n public boolean onDown(MotionEvent e) {\n return true;\n }", "@Override\r\n\tpublic boolean dispatchTouchEvent( MotionEvent e ) {\n\t\tint action = e.getAction();\r\n\t\tfloat x = e.getRawX();\r\n\t\tfloat y = e.getRawY();\r\n\t\tLog.d(TAG, \"onTouch dev:\" + e.getDeviceId() + \" act:\" + action + \" ind:\" + e.getActionIndex() + \" @ \"+ x + \",\" + y );\r\n\t\tnativeTouch( appPtr, action, x, y );\r\n\t\treturn true;\r\n\t}", "@Override\n\tpublic void onLongPress(MotionEvent e) {\n\n\t}", "@Override\n\tpublic void onLongPress(MotionEvent e) {\n\n\t}", "@Override\n\tpublic void onLongPress(MotionEvent e) {\n\n\t}", "@Override\n\tpublic void onLongPress(MotionEvent e) {\n\n\t}", "@Override\n\tpublic void onLongPress(MotionEvent e) {\n\n\t}", "void onInputEvent(View view, int buttons);", "@Override\n public void clicked(InputEvent e, float x, float y) {\n }", "@Override\n public void onLongPress(MotionEvent e) {\n }", "@Override\r\n\tpublic void onTouchMove(LTouch e) {\n\t\t\r\n\t}", "@Override\n\tpublic boolean onTouchEvent(MotionEvent event) {\n\t\tif (moving) {\n\t\t\treturn true;\n\t\t}\n\n\t\tx = event.getRawX();\n\t\ty = event.getRawY();\n\t\t\n\t\tif (isNotFullScreen) {\n\t\t\ty -= mStatusBarHeight;\n\t\t}\n\n\t\tswitch (event.getAction()) {\n\t\tcase MotionEvent.ACTION_DOWN:\n\t\t\tfingerUP = false;\n\t\t\tlongPressed = false;\n\t\t\tif (mOnActionDownListener != null) {\n\t\t\t\tmOnActionDownListener.onActionDown();\n\t\t\t}\n\t\t\t// getRawX() and getRawY() that is guaranteed to return absolute\n\t\t\t// coordinates, relative to the device screen.\n\t\t\t// While getX() and getY(), should return you coordinates, relative\n\t\t\t// to the View, that dispatched them.\n\t\t\tmTouchStartX = event.getX();\n\t\t\tmTouchStartY = event.getY();\n\n\t\t\ttempX = x;\n\t\t\ttempY = y;\n\t\t\ttempT = SystemClock.uptimeMillis();\n\n\t\t\tbreak;\n\n\t\tcase MotionEvent.ACTION_MOVE:\n\t\t\tmWindowMgrParams.x = (int) (x - mTouchStartX);\n\t\t\tmWindowMgrParams.y = (int) (y - mTouchStartY);\n\t\t\tif (withinClickRegion()) {\n\t\t\t\tif (!longPressed && SystemClock.uptimeMillis() - tempT > 800) {\n\t\t\t\t\tlongPressed = true;\n\t\t\t\t\tif (mOnLongPressedListener != null) {\n\t\t\t\t\t\tmOnLongPressedListener.onLongPressed();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tmWindowManager.updateViewLayout(this, mWindowMgrParams);\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase MotionEvent.ACTION_UP:\n\t\t\tfingerUP = true;\n\t\t\tlongPressed = false;\n\t\t\tif (mOnActionUpListener != null) {\n\t\t\t\tmOnActionUpListener.onActionUp();\n\t\t\t}\n\n\t\t\tif (withinClickRegion()) {\n\t\t\t\tif (SystemClock.uptimeMillis() - tempT < 100) {\n\t\t\t\t\t// this is click operation\n\t\t\t\t\tif (mOnClickListener != null) {\n\t\t\t\t\t\tmOnClickListener.onClick();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// below is fling testing\n\t\t\t\tmoving = true;\n\t\t\t\tboolean isFling = false;\n\t\t\t\tfloat k = 0, b = 0, y1;\n\t\t\t\tfloat kmax, kmin;\n\t\t\t\t// y should at least be defaultFlipY\n\t\t\t\tint defaultFlipYmin = 30;\n\t\t\t\tint defaultFlipYmax = yMovementLimit - 30;\n\t\t\t\tif (SystemClock.uptimeMillis() - tempT < 130 && Math.abs(x - tempX) > 10) {\n\t\t\t\t\t// a fling is considered valid only when \n\t\t\t\t\t// the user is finging towards the center of screen, not the oppsite\n\t\t\t\t\tboolean flingIsValid = false;\n\t\t\t\t\tfloat deltaY = y - tempY;\n\t\t\t\t\tfloat deltaX = x - tempX;\n\t\t\t\t\tk = deltaY / deltaX;\n\t\t\t\t\tif (x < (currentdimension.x / 2)) {\n\t\t\t\t\t\tkmax = (y - currentdimension.y) / (x - currentdimension.x);\n\t\t\t\t\t\tkmin = y / (x - currentdimension.x);\n\t\t\t\t\t\tif (deltaX > 0) {\n\t\t\t\t\t\t\t// when button is on left side of screen\n\t\t\t\t\t\t\t// you must fling to right\n\t\t\t\t\t\t\tflingIsValid = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tkmax = y / x;\n\t\t\t\t\t\tkmin = (y - currentdimension.y) / x;\n\t\t\t\t\t\tif (deltaX < 0) {\n\t\t\t\t\t\t\t// when button is on right side of screen\n\t\t\t\t\t\t\t// you must fling to left\n\t\t\t\t\t\t\tflingIsValid = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (k < kmax && k > kmin && flingIsValid) {\n\t\t\t\t\t\tisFling = true;\n\t\t\t\t\t\tb = y - k * x;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//\n\n\t\t\t\tx = x - mTouchStartX;\n\t\t\t\ty = y - mTouchStartY;\n\n\t\t\t\tPoint finalPoint = new Point();\n\t\t\t\tif (x < (currentdimension.x / 2)) {\n\t\t\t\t\t// you finger now is on the left side\n\t\t\t\t\tif (isFling) {\n\t\t\t\t\t\t// if your finger flips\n\t\t\t\t\t\ty1 = k * xMovementLimit + b;\n\t\t\t\t\t\tif (y1 < defaultFlipYmin) {\n\t\t\t\t\t\t\ty1 = defaultFlipYmin;\n\t\t\t\t\t\t} else if (y1 > defaultFlipYmax) {\n\t\t\t\t\t\t\ty1 = defaultFlipYmax;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfinalPoint.x = xMovementLimit;\n\t\t\t\t\t\tfinalPoint.y = (int) y1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// the button will move only in horizontal direction\n\t\t\t\t\t\tfinalPoint.x = 0;\n\t\t\t\t\t\tfinalPoint.y = (int) y;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// you finger now is on the right side\n\t\t\t\t\tif (isFling) {\n\t\t\t\t\t\t// if your finger flips\n\t\t\t\t\t\ty1 = b;\n\t\t\t\t\t\tif (y1 < defaultFlipYmin) {\n\t\t\t\t\t\t\ty1 = defaultFlipYmin;\n\t\t\t\t\t\t} else if (y1 > defaultFlipYmax) {\n\t\t\t\t\t\t\ty1 = defaultFlipYmax;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfinalPoint.x = 0;\n\t\t\t\t\t\tfinalPoint.y = (int) y1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// the button will move only in horizontal direction\n\t\t\t\t\t\tfinalPoint.x = xMovementLimit;\n\t\t\t\t\t\tfinalPoint.y = (int) y;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tPoint startPoint = new Point((int) x, (int) y);\n\t\t\t\t\n\t\t\t\tmWindowMgrParams.x = startPoint.x;\n\t\t\t\tmWindowMgrParams.y = startPoint.y;\n\n\t\t\t\tmWindowManager.updateViewLayout(this, mWindowMgrParams);\n\t\t\t\t\n\t\t\t\tdockingTask = new AnimatingTask();\n\t\t\t\tdockingTask.execute(startPoint, finalPoint);\n\t\t\t}\n\n\t\t\tmTouchStartX = mTouchStartY = 0;\n\t\t\tbreak;\n\t\t}\n\t\treturn true;\n\t}", "@Override\n public void onLongPress(MotionEvent e) {}", "private void dumpEvent(MotionEvent event) \n {\n String names[] = { \"DOWN\", \"UP\", \"MOVE\", \"CANCEL\", \"OUTSIDE\",\"POINTER_DOWN\", \"POINTER_UP\", \"7?\", \"8?\", \"9?\" };\n StringBuilder sb = new StringBuilder();\n int action = event.getAction();\n int actionCode = action & MotionEvent.ACTION_MASK;\n sb.append(\"event ACTION_\").append(names[actionCode]);\n\n if (actionCode == MotionEvent.ACTION_POINTER_DOWN || actionCode == MotionEvent.ACTION_POINTER_UP) \n {\n sb.append(\"(pid \").append(action >> MotionEvent.ACTION_POINTER_ID_SHIFT);\n sb.append(\")\");\n }\n\n sb.append(\"[\");\n for (int i = 0; i < event.getPointerCount(); i++) \n {\n sb.append(\"#\").append(i);\n sb.append(\"(pid \").append(event.getPointerId(i));\n sb.append(\")=\").append((int) event.getX(i));\n sb.append(\",\").append((int) event.getY(i));\n if (i + 1 < event.getPointerCount())\n sb.append(\";\");\n }\n\n sb.append(\"]\");\n Log.d(\"Touch Events ---------\", sb.toString());\n }", "@Override\n public void onLongPress(MotionEvent e) {\n\n }", "@Override\n\tpublic void onLongPress(MotionEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void onLongPress(MotionEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void onLongPress(MotionEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void onLongPress(MotionEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void onLongPress(MotionEvent e) {\n\t\t\n\t}", "@Override\n public boolean onInterceptTouchEvent(MotionEvent ev) {\n int action = ev.getAction();\n\n switch(action) {\n case MotionEvent.ACTION_DOWN:\n mClickY = ev.getY();\n break;\n case MotionEvent.ACTION_MOVE:\n processNewMoveEvent(ev);\n break;\n }\n\n return super.onInterceptTouchEvent(ev);\n }", "@Override\n public boolean onTouchEvent(MotionEvent event) {\n\n boolean spend = needTouch;\n switch (event.getAction()) {\n case MotionEvent.ACTION_DOWN:\n dx = event.getX();\n dy = event.getY();\n rdx = event.getRawX();\n rdy = event.getRawY();\n spend = touchDown(dx, dy);\n break;\n case MotionEvent.ACTION_MOVE:\n float cx = event.getX();\n float cy = event.getY();\n rcx = event.getRawX();\n rcy = event.getRawY();\n spend = touchMove(cx, cy);\n break;\n case MotionEvent.ACTION_UP:\n rcx = event.getRawX();\n rcy = event.getRawY();\n touchUp();\n break;\n case MotionEvent.ACTION_CANCEL:\n rcx = event.getRawX();\n rcy = event.getRawY();\n touchCancel();\n break;\n }\n if(mOnClickListener != null){\n return super.onTouchEvent(event);\n }\n\n invalidate();\n return spend;\n }", "@Override\n public boolean onTouchEvent(MotionEvent event) {\n int action = event.getActionMasked(); // event type\n int actionIndex = event.getActionIndex(); // pointer (i.e., finger)\n\n // determine which type of action the given MotionEvent\n // represents, then call the corresponding handling method\n if (action == MotionEvent.ACTION_DOWN ||\n action == MotionEvent.ACTION_POINTER_DOWN)\n {\n touchStarted(event.getX(actionIndex), event.getY(actionIndex),\n event.getPointerId(actionIndex));\n } // end if\n else if (action == MotionEvent.ACTION_UP ||\n action == MotionEvent.ACTION_POINTER_UP)\n {\n touchEnd(event.getPointerId(actionIndex));\n } // end else if\n else\n {\n touchMoved(event);\n } // end else\n\n invalidate(); // redraw\n return true; // consume the touch event\n }", "@Override\r\n\tpublic void onTouchUp(LTouch e) {\n\t}", "@Override\n public void onLongPress(MotionEvent e) {\n }", "@Override\r\n\tpublic boolean onTouchEvent(final MotionEvent e) {\n\t\t\r\n\t\treturn true;\r\n\t}", "@Override\n public void onLongPress(MotionEvent e) {\n\n }", "@Override\n\t\tpublic void onTouchEvent(MotionEvent e, float magX, float magY) {\n\t\t\tif(show)\n\t\t\t\tbuy.onTouchEvent(e, magX, magY);\n\t\t\tcombineButton.onTouchEvent(e, magX, magY);\n\t\t\tclose.onTouchEvent(e, magX, magY);\n\t\t\t//scroll.onTouchEvent(e, magX, magY);\n\t\t}", "@Override\r\n\tpublic void onLongPress(MotionEvent e) {\n\t\tSystem.out.println(\"longpress\");\r\n\t\t\r\n\t}", "@Override\n public void onUpOrCancelMotionEvent() {\n \n }", "public interface SessionListEvent {\n\n void onSessionClick(View v, int position, SessionInfo session);\n\n void onSessionLongClick(View v, int position, SessionInfo session);\n\n void onSessionLeftSlide(View v, int position, SessionInfo session);\n}", "@Override\n public boolean onTouchEvent(MotionEvent event) {\n int action = event.getAction();\n tb.tbOnTouch(action);\n return true;\n }", "public void onShowPressHandler(MotionEvent oDownEvent) {\n }", "@Override\r\n public boolean onTouchEvent(MotionEvent event)\r\n {\n switch (event.getAction())\r\n {\r\n case MotionEvent.ACTION_DOWN:\r\n Log.e(\"shicong\", \"ButtonViewTest ACTION_DOWN\" + event.getX() + \"/\" + event.getY());\r\n break;\r\n case MotionEvent.ACTION_UP:\r\n Log.e(\"shicong\", \"ButtonViewTest ACTION_UP\" + event.getX() + \"/\" + event.getY());\r\n break;\r\n case MotionEvent.ACTION_MOVE:\r\n// Log.e(\"shicong\", \"ButtonViewTest ACTION_MOVE\");\r\n break;\r\n default:\r\n break;\r\n }\r\n \r\n return super.onTouchEvent(event);\r\n }", "@Override\n\tpublic boolean onTouchEvent(MotionEvent event) {\n\t\tint action = event.getActionMasked();\n\t\t// action point status\n\t\tint actionIndex = event.getActionIndex();\n\t\t// event的id直接對應到pointer的id\n\t\tint actionPointIndex = event.getPointerId(actionIndex);\n\t\tfloat actionPointX = event.getX(actionIndex);\n\t\tfloat actionPointY = event.getY(actionIndex);\n\t\tfloat actionPointPressure = event.getPressure(actionIndex);\n\t\tfloat actionPointSize = event.getSize(actionIndex);\n\t\tlong time = System.currentTimeMillis();\n\t\tpointers = event.getPointerCount();\n\n\t\tswitch (action) {\n\t\t// 更新pointer的內容\n\t\tcase MotionEvent.ACTION_DOWN:\n\t\t\t// if (flagIsLighting && flagcnt < 100) {\n\t\t\tflagTouching = true;\n\t\t\t// }\n\t\t\tpointer[actionPointIndex].touchDown(actionPointIndex, actionPointX,\n\t\t\t\t\tactionPointY, actionPointPressure, actionPointSize, time);\n\n\t\t\tbreak;\n\t\tcase MotionEvent.ACTION_POINTER_DOWN:\n\t\t\t// if (flagIsLighting && flagcnt < 100) {\n\t\t\tflagTouching = true;\n\t\t\t// }\n\t\t\tpointer[actionPointIndex].touchDown(actionPointIndex, actionPointX,\n\t\t\t\t\tactionPointY, actionPointPressure, actionPointSize, time);\n\n\t\t\tbreak;\n\t\tcase MotionEvent.ACTION_POINTER_UP:\n\t\t\tpointer[actionPointIndex].touchUp();\n\t\t\tbreak;\n\t\tcase MotionEvent.ACTION_UP:\n\t\t\tpointer[actionPointIndex].touchUp();\n\t\t\t((Circle) circle).tapping = 0;\n\t\t\trgb = 100;\n\t\t\t((Circle) circle).flagIsLighting = false;\n\t\t\tflagIsLighting = false;\n\t\t\t// Log.e(\"tap0\", ((Circle) circle).tapping + \"\");\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tfor (int i = 0; i < event.getPointerCount(); ++i) {\n\n\t\t\t\tpointer[event.getPointerId(i)].touchDown(event.getPointerId(i),\n\t\t\t\t\t\tevent.getX(i), event.getY(i), event.getPressure(i),\n\t\t\t\t\t\tevent.getSize(i), time);\n\n\t\t\t\tint hz = 100;\n\t\t\t\tint e = 0;\n\t\t\t\tString s = \"! \";\n\t\t\t\tfor (int j = 0; j < 10; j++) {\n\n\t\t\t\t\tif (pointer[j].exist) {\n//\t\t\t\t\t\tint tmp = (int) ((pointer[j].nowHz + 5) / 10);\n\t\t\t\t\t\tif (hz > pointer[j].showHz && pointer[j].showHz != 0) {\n\t\t\t\t\t\t\t// if (hz > tmp && tmp != 0) {\n\t\t\t\t\t\t\thz = pointer[j].showHz;\n//\t\t\t\t\t\t\thz = tmp;\n\t\t\t\t\t\t\ts = s + hz + \" \";\n\t\t\t\t\t\t\trgb = hz;\n\t\t\t\t\t\t\t((Circle) circle).id = e;\n\t\t\t\t\t\t\tid = j;\n\t\t\t\t\t\t}\n\t\t\t\t\t\te++;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t// Log.e(\"hz\", s);\n\t\t\t\tif (flagIsLighting) {\n\t\t\t\t\tif (hz > 6 && hz < 11 && hzcnt < 10) {\n\t\t\t\t\t\thza[hzcnt] = hz;\n\t\t\t\t\t\thzcnt++;\n\t\t\t\t\t\t// flagcnt = 0;\n\t\t\t\t\t\tLog.e(\"+hz\", hz + \"\");\n\t\t\t\t\t}\n\t\t\t\t\t// else if (hz > 15 || hz < 4) {\n\t\t\t\t\t// Log.e(\"cnt\", flagcnt + \"\");\n\t\t\t\t\t// flagcnt++;\n\t\t\t\t\t// if (flagcnt > 100) {\n\t\t\t\t\t//\n\t\t\t\t\t// flagTouching = false;\n\t\t\t\t\t// }\n\t\t\t\t\t// }\n\t\t\t\t}\n\t\t\t\t// if (rgb > hz) {\n\t\t\t\t//\n\t\t\t\t// rgb = hz;\n\t\t\t\t// }\n\t\t\t\tif (e == 2 || e == 3) {\n\t\t\t\t\tint k = 0;\n\t\t\t\t\tfor (int j = 0; j < 10; j++) {\n\t\t\t\t\t\tif (pointer[j].exist) {\n\t\t\t\t\t\t\tif (j != id) {\n\t\t\t\t\t\t\t\t((Circle) circle).tri[k][0] = pointer[j].x;\n\t\t\t\t\t\t\t\t((Circle) circle).tri[k][1] = pointer[j].y;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tk++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tint k = 0;\n\t\t\t\tif (hz >= 6 && hz <= 10) {\n\t\t\t\t\t((Circle) circle).tapping = 1;\n\t\t\t\t\t// Log.e(\"tap1\", ((Circle) circle).tapping + \"\");\n\t\t\t\t\tfor (int j = 0; j < 10; j++) {\n\n\t\t\t\t\t\tpointer[j].hzCnt = 0;\n\t\t\t\t\t\tpointer[j].showHz = 0;\n\t\t\t\t\t}\n\t\t\t\t\tif (flagIsLighting == false) {\n\t\t\t\t\t\t// Log.e(\"fa\", hz + \" \" + flagIsLighting);\n\t\t\t\t\t\t// Log.e(\"rgb\", (hz - 5) + \"\");\n\t\t\t\t\t\tflagIsLighting = true;\n\t\t\t\t\t\tLog.e(\"+hz\", hz + \"\");\n\t\t\t\t\t\tif (hzcnt < 10) {\n\t\t\t\t\t\t\thza[hzcnt] = hz;\n\t\t\t\t\t\t\thzcnt++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// ((Circle) circle).showRGB = hz - 5;\n\t\t\t\t\t\t// Log.e(\"fa\", \"\" + flagIsLighting);\n\t\t\t\t\t\tmyHandler.sendEmptyMessage(0x102);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\n\t\t// 重新繪圖\n\t\tcircle.invalidate();\n\t\treturn super.onTouchEvent(event);\n\t}", "private void dumpEvent(MotionEvent event) {\n String names[] = {\"DOWN\", \"UP\", \"MOVE\", \"CANCEL\", \"OUTSIDE\", \"POINTER_DOWN\", \"POINTER_UP\", \"7?\", \"8?\", \"9?\"};\n StringBuilder sb = new StringBuilder();\n int action = event.getAction();\n int actionCode = action & MotionEvent.ACTION_MASK;\n sb.append(\"event ACTION_\").append(names[actionCode]);\n\n if (actionCode == MotionEvent.ACTION_POINTER_DOWN || actionCode == MotionEvent.ACTION_POINTER_UP) {\n sb.append(\"(pid \").append(action >> MotionEvent.ACTION_POINTER_ID_SHIFT);\n sb.append(\")\");\n }\n\n sb.append(\"[\");\n for (int i = 0; i < event.getPointerCount(); i++) {\n sb.append(\"#\").append(i);\n sb.append(\"(pid \").append(event.getPointerId(i));\n sb.append(\")=\").append((int) event.getX(i));\n sb.append(\",\").append((int) event.getY(i));\n if (i + 1 < event.getPointerCount())\n sb.append(\";\");\n }\n\n sb.append(\"]\");\n Log.d(\"Touch Events ---------\", sb.toString());\n }", "@Override\n\t\t\tpublic void onLongPress(MotionEvent arg0)\n\t\t\t{\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\t\tpublic boolean onDown(MotionEvent e) {\n\t\t\t\t\treturn false;\n\t\t\t\t}", "void onDoubleTapAndHold(MotionEvent event, int policyFlags);", "@Override\r\n\tpublic void onLongPress(MotionEvent arg0) {\n\t\t\r\n\t}", "public boolean onListTouchEvent(View view, MotionEvent event) {\n return false;\n }", "@Override\r\n\t\tpublic boolean onTouchEvent(MotionEvent event) {\n\r\n\t\t\treturn true;\r\n\t\t}", "public void onTouchDown(NMapView arg0, MotionEvent arg1) {\n\n }", "@Override\n\tpublic boolean onTouchEvent(MotionEvent ev) {\n\t\tLog.i(\"TestEvent\", \"activity->onTouchEvent \" + TouchEventUtil.getTouchAction(ev.getAction()));\n\t\treturn super.onTouchEvent(ev);\n\t}", "@Override\n public boolean onTouchEvent(MotionEvent event){\n\n\n switch(event.getActionMasked()) {\n case (MotionEvent.ACTION_DOWN) :\n return true;\n case (MotionEvent.ACTION_MOVE) :\n determineDirectionOfSwipe(event.getX(), Boolean.FALSE);\n return true;\n case (MotionEvent.ACTION_UP) :\n determineDirectionOfSwipe(event.getX(), Boolean.TRUE);\n return true;\n case (MotionEvent.ACTION_CANCEL) :\n return true;\n case (MotionEvent.ACTION_OUTSIDE) :\n return true;\n default :\n return super.onTouchEvent(event);\n }\n\n }", "@SuppressLint(\"ClickableViewAccessibility\")\n @Override\n public boolean onTouchEvent(MotionEvent event) {\n return true;\n }", "@Override\n public boolean onTouch(View arg0, MotionEvent event) {\n int action = event.getAction();\n // 按下\n if (action == MotionEvent.ACTION_DOWN) {\n asr.send(SpeechConstant.ASR_START, null, null, 0, 0);\n\n }\n // 松开\n else if (action == MotionEvent.ACTION_UP) {\n asr.send(SpeechConstant.ASR_STOP, null, null, 0, 0);\n }\n return false;\n\n }", "@Override\n\t\tpublic boolean onDown(MotionEvent e) {\n\t\t\treturn false;\n\t\t}", "@Override\r\n public boolean onTouch(View v, MotionEvent event)\r\n {\n switch(event.getActionIndex())\r\n {\r\n case MotionEvent.ACTION_DOWN:\r\n break;\r\n case MotionEvent.ACTION_UP:\r\n break;\r\n case MotionEvent.ACTION_MOVE:\r\n tapAnswer();\r\n return true;\r\n }\r\n \r\n return false;\r\n }", "@Override\r\n public boolean onInterceptTouchEvent(MotionEvent event) {\n if (event.getAction() == MotionEvent.ACTION_DOWN) {\r\n //因为onTouchEvent事件监听不到\r\n mDownX = event.getX();\r\n mDownY = event.getY();\r\n// setListener();\r\n// LogManager.e(\"ACTION_DOWN \" + mDownX + \":\" + mDownY);\r\n\r\n }\r\n\r\n return super.onInterceptTouchEvent(event);\r\n }", "@Override\n\tpublic void onLongPress(MotionEvent arg0) {\n\t\t\n\t}", "@Override\n\tpublic void onLongPress(MotionEvent arg0) {\n\t\t\n\t}", "@Override\n\tpublic void onLongPress(MotionEvent arg0) {\n\t\t\n\t}", "@Override\n\tpublic void onLongPress(MotionEvent arg0) {\n\n\t}", "public final void handleTouchEvent(MotionEvent event, Screen screen)\n {\n\n \tswitch (event.getActionMasked())\n \t{\t\n \t\tcase MotionEvent.ACTION_DOWN:\n \t\tcase MotionEvent.ACTION_POINTER_DOWN:\n \t\t{\tint aidx = event.getActionIndex ();\n\t\t\t\tint id = event.getPointerId(aidx);\n\t\t\t\tif (numactivepointers<activepointerids.length && findActivePointer(id)<0)\n\t\t\t\t{\tactivepointerids[numactivepointers] = id;\n\t\t\t\t\tnumactivepointers++;\n\t\t\t\t\tif (numactivepointers==1)\n\t\t\t\t\t{\tscreen.onPointerDown((int)event.getX(aidx), (int)event.getY(aidx));\n\t\t\t\t\t}\n\t\t\t\t}\n \t\t\tbreak; \t\t\n \t\t}\n \t\tcase MotionEvent.ACTION_UP:\n \t\tcase MotionEvent.ACTION_POINTER_UP:\n \t\t{\t// compensate bug in android: when receiving an up action where pointers are no longer sent, consider the missing pointer as having gone up also\n \t\t\tfor (int i=numactivepointers-1; i>=0; i--)\n \t\t\t{\tif (event.findPointerIndex (activepointerids[i]) < 0)\n \t\t\t\t{\tremoveActivePointerAnSendNotifications(i, screen);\n \t\t\t\t}\n \t\t\t} \t\t \t\t\t\n \t\t\tint aidx = event.getActionIndex ();\n\t\t\t\tint id = event.getPointerId(aidx);\n \t\t\tint activepos = findActivePointer(id);\n \t\t\tif (activepos>=0) \t\t\t\n \t\t\t{\tremoveActivePointerAnSendNotifications(activepos, screen);\n \t\t\t}\n \t\t\tbreak;\n \t\t}\n \t\tcase MotionEvent.ACTION_MOVE:\n \t\t{\t// compensate bug in android: when receiving a move where pointers are no longer sent, consider the missing pointer as having gone up\n \t\t\tfor (int i=numactivepointers-1; i>=0; i--)\n \t\t\t{\tif (event.findPointerIndex (activepointerids[i]) < 0)\n \t\t\t\t{\tremoveActivePointerAnSendNotifications(i, screen);\n \t\t\t\t}\n \t\t\t} \t\t\n \t\t\t// traverse the movement info and build up data accordingly\n \t\t\tfor (int aidx=0; aidx<event.getPointerCount(); aidx++)\n \t\t\t{\tint id = event.getPointerId(aidx);\n \t\t\t\tint activepos = findActivePointer(id);\n \t\t\t\t// sanity check: must have this pointer as active\n \t\t\t\tif (activepos==0)\n \t\t\t\t{\tscreen.onPointerMove((int)event.getX(aidx), (int)event.getY(aidx)); \t\t\t\t\n \t\t\t\t} \t\t\t\n \t\t\t\t// compensate bug in android - when receiving a move without previous pointer-down, inject one \n \t\t\t\telse if (numactivepointers<activepointerids.length)\n\t\t\t\t\t{\tactivepointerids[numactivepointers] = id;\n\t\t\t\t\t\tnumactivepointers++;\n\t\t\t\t\t\tif (numactivepointers==1)\n\t\t\t\t\t\t{\tscreen.onPointerDown((int)event.getX(aidx), (int)event.getY(aidx));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n \t\t\t}\n \t\t\tbreak;\n \t\t}\n \t\tcase MotionEvent.ACTION_CANCEL:\n \t\t{\tif (numactivepointers>0)\n \t\t\t{\tnumactivepointers=0;\n \t\t\t\tscreen.onPointerUp();\n \t\t\t}\n \t\t\tbreak;\n \t\t}\n \t}\n }", "@Override\n\tpublic void onTouchEvent(MotionEvent event) {\n\t\tfloat x = event.getX();\n\t\tfloat y = event.getY();\n\t\tswitch (event.getAction()) {\n\t\tcase MotionEvent.ACTION_DOWN:\n\t\t\tif (!rt_frame.contains(x, y)) {\n\t\t\t\tclose();\n\t\t\t} else if (rt_classic.contains(x, y)) {\n\t\t\t\tclassic = bt_classic[1];\n\t\t\t} else if (rt_race.contains(x, y)) {\n\t\t\t\trace = bt_race[1];\n\t\t\t} else if (rt_build.contains(x, y)) {\n\t\t\t\tbuild = bt_build[1];\n\t\t\t}\n\t\t\tbreak;\n\t\tcase MotionEvent.ACTION_UP:\n\t\t\tif (listener != null) {\n\t\t\t\tif (rt_classic.contains(x, y) && classic == bt_classic[1]) {\n\t\t\t\t\tlistener.onResult(1);\n\t\t\t\t} else if (rt_race.contains(x, y) && race == bt_race[1]) {\n\t\t\t\t\tlistener.onResult(2);\n\t\t\t\t} else if (rt_build.contains(x, y) && build == bt_build[1]) {\n\t\t\t\t\tlistener.onResult(3);\n\t\t\t\t}\n\t\t\t}\n\t\t\tclassic = bt_classic[0];\n\t\t\trace = bt_race[0];\n\t\t\tbuild = bt_build[0];\n\t\t\tbreak;\n\t\t}\n\t}", "public void mouseClicked( MouseEvent event ){}", "@Override\n\t\t\tpublic boolean onTouch(View v, MotionEvent event) {\n\t\t\t\tif(event.getAction() == event.ACTION_DOWN)\n\t\t\t\t{\n\t\t\t\tswitch(v.getId()){\n\t\t\t\tcase R.id.left:\n\t\t\t\t\tmAgileBuddyView.handleMoving(-1);\n\t\t\t\t\tbreak;\n\t\t\t\tcase R.id.right:\n\t\t\t\t\tmAgileBuddyView.handleMoving(1);\n\t\t\t\t\tbreak;\n\t\t\t\t\t}\t\n\t\t\t\t} else if(event.getAction() == event.ACTION_UP) \n\t\t\t\t\tmAgileBuddyView.handleMoving(0);\n\t\t\t\t\n\t\t\t\treturn true;\n\t\t\t}", "@Override\r\n public boolean onDown(MotionEvent e)\r\n {\n return false;\r\n }", "@Override\r\n\tpublic boolean onDown(MotionEvent e) {\n\t\treturn false;\r\n\t}", "@Override\r\n\tpublic boolean onDown(MotionEvent e) {\n\t\treturn false;\r\n\t}", "@Override\r\n\tpublic boolean onTouch(View v, MotionEvent me) {\n\r\n\t\ttry {\r\n\t\t\tThread.sleep(50);\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\tswitch (me.getAction()) {\r\n\r\n//\t\tcase MotionEvent.ACTION_DOWN:\r\n//\t\t//\tx = me.getX();\r\n//\t\t//\ty = me.getY();\r\n//\t\t\tif(click){\r\n//\t\t\t\tclick = false;\r\n//\t\t\t}else{\r\n//\t\t\tclick = true;}\r\n//\t\t\tbreak;\r\n\r\n\t\tcase MotionEvent.ACTION_UP:\r\n\t\t\t//x = me.getX();\r\n\t\t\t//y = me.getY();\r\n\t\t\tbreak;\r\n\r\n\t\tcase MotionEvent.ACTION_MOVE:\r\n//\t\t\txf = me.getX() - (xc/2) ;\r\n//\t\t\tyf = me.getY() - (yc/2);\r\n//\t\t\t\r\n//\t\t\tSystem.out.println(\"X = \"+xf+\" Y = \"+yf);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\r\n\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}", "@Override\n public void onDownMotionEvent() {\n \n }", "@Override\r\n public boolean onTouchEvent(MotionEvent event) {\n LogUtil.d(TAG,\"onTouchEvent()\");\r\n int MAX_TOUCHPOINTS=3;\r\n int pointerCount = event.getPointerCount();\r\n if (pointerCount>MAX_TOUCHPOINTS){\r\n pointerCount = MAX_TOUCHPOINTS;\r\n }\r\n //判断触摸事件是单触摸还是多触摸,\r\n\r\n int touchType = event.getActionMasked();\r\n switch (touchType){\r\n //第一个按下\r\n case MotionEvent.ACTION_DOWN:\r\n ;\r\n break;\r\n //非第一个按下\r\n case MotionEvent.ACTION_POINTER_DOWN:\r\n for(int i=0;i<pointerCount;i++){\r\n int j=event.getPointerId(i);\r\n int x1=(int) event.getX(j);\r\n int y1= (int) event.getY(j);\r\n }\r\n ;\r\n break;\r\n }\r\n\r\n if(event.getAction()==MotionEvent.ACTION_UP){\r\n rocker.reset();\r\n }else{\r\n TouchX=(int) event.getX();\r\n TouchY=(int) event.getY();\r\n if (event.getAction()==MotionEvent.ACTION_DOWN){\r\n rocker.begin(TouchX,TouchY);\r\n }else if (event.getAction()==MotionEvent.ACTION_MOVE){\r\n rocker.update(TouchX,TouchY);\r\n }\r\n }\r\n return true;\r\n }", "@Override\n public boolean onTouch(View v, MotionEvent event) {\n float x;\n float y;\n int w = v.getWidth();\n int h = v.getHeight();\n int curAction = ACTION_NONE;\n float xscale = (float)w / (float)438;\n float yscale = (float)h / (float)600;\n\n x = event.getX() / xscale;\n y = event.getY() / yscale;\n // Log.d(LOG_TAG, \"x: \" + x + \", y:\" + y);\n if (x >= 90 && x <= 210 &&\n y >= 300 && y <= 425) curAction = ACTION_BATARI;\n else if (x >= 110 && x <= 200 &&\n y >= 450 && y <= 540) curAction = ACTION_GABARI;\n else if (x >= 240 && x <= 350 &&\n y >= 300 && y <= 430) curAction = ACTION_FUROHA;\n else if (x >= 245 && x <= 370 &&\n y >= 440 && y <= 550) curAction = ACTION_FUROA;\n if (event.getAction() == MotionEvent.ACTION_DOWN) {\n mActionType = curAction;\n Log.d(LOG_TAG, \"DOWN ACTION: \" + curAction);\n } else if (event.getAction() == MotionEvent.ACTION_UP ) {\n Log.d(LOG_TAG, \"UP ACTION: \" + curAction);\n if (mActionType == curAction) doAction(mActionType);\n }\n return true;\n }", "@Override\n public boolean onTouchEvent(MotionEvent ev) {\n int action = ev.getAction();\n\n switch(action) {\n case MotionEvent.ACTION_MOVE:\n processNewMoveEvent(ev);\n break;\n }\n\n return super.onTouchEvent(ev);\n }", "public boolean onTouchEvent(MotionEvent event) {\n\tif(state==MAIN_MENU || state==RESUME)\n\t{ags.onTouchEvent(event);}\n\t\n\telse if(state==GAME_SCREEN){\n\t//\tat= new AndroidTouch(ag);\n\t\tag.onTouchEvent(event);\n\t}\n\t\n\t\n\treturn super.onTouchEvent(event);\n\t\n}", "@Override\n\t\tpublic boolean onSingleTapUp(MotionEvent ev) {\n\n\t\t\t Toast.makeText(getActivity(),\"onSingleTapUp\",Toast.LENGTH_LONG).show();\n\n\t\t\t clickMyActivities();\n\t\t\treturn true;\n\t\t}", "@Override\n\tpublic void handleActionDown(int eventX, int eventY) {\n\t\t\n\t}", "@Override\r\n public boolean onDown(MotionEvent e) {\n return false;\r\n }", "@Override\n public void onLongPress(MotionEvent e) {\n Log.d(TAG, \"onLongPress\");\n }", "void onDoubleTapEvent();", "@SuppressWarnings(\"deprecation\")\n @TargetApi(Build.VERSION_CODES.ECLAIR)\n @SuppressLint(\"NewApi\")\n private void dumpEvent(MotionEvent event) {\n String names[] = {\"DOWN\", \"UP\", \"MOVE\", \"CANCEL\", \"OUTSIDE\",\n \"POINTER_DOWN\", \"POINTER_UP\", \"7?\", \"8?\", \"9?\"};\n StringBuilder sb = new StringBuilder();\n int action = event.getAction();\n int actionCode = action & MotionEvent.ACTION_MASK;\n sb.append(\"event ACTION_\").append(names[actionCode]);\n if (actionCode == MotionEvent.ACTION_POINTER_DOWN\n || actionCode == MotionEvent.ACTION_POINTER_UP) {\n sb.append(\"(pid \").append(\n action >> MotionEvent.ACTION_POINTER_ID_SHIFT);\n sb.append(\")\");\n }\n sb.append(\"[\");\n for (int i = 0; i < event.getPointerCount(); i++) {\n sb.append(\"#\").append(i);\n sb.append(\"(pid \").append(event.getPointerId(i));\n sb.append(\")=\").append((int) event.getX(i));\n sb.append(\",\").append((int) event.getY(i));\n if (i + 1 < event.getPointerCount())\n sb.append(\";\");\n }\n sb.append(\"]\");\n }", "abstract void onRightClick(int x, int y, boolean down);", "private void pressed(MouseEvent e)\r\n {\n }", "private void dumpEvent(MotionEvent event) {\n String names[] = {\"DOWN\", \"UP\", \"MOVE\", \"CANCEL\", \"OUTSIDE\", \"POINTER_DOWN\", \"POINTER_UP\", \"7?\", \"8?\", \"9?\"};\n StringBuilder sb = new StringBuilder();\n int action = event.getAction();\n int actionCode = action & MotionEvent.ACTION_MASK;\n sb.append(\"event ACTION_\").append(names[actionCode]);\n\n if (actionCode == MotionEvent.ACTION_POINTER_DOWN || actionCode == MotionEvent.ACTION_POINTER_UP) {\n sb.append(\"(pid \").append(action >> MotionEvent.ACTION_POINTER_ID_SHIFT);\n sb.append(\")\");\n }\n\n sb.append(\"[\");\n for (int i = 0; i < event.getPointerCount(); i++) {\n sb.append(\"#\").append(i);\n sb.append(\"(pid \").append(event.getPointerId(i));\n sb.append(\")=\").append((int) event.getX(i));\n sb.append(\",\").append((int) event.getY(i));\n if (i + 1 < event.getPointerCount())\n sb.append(\";\");\n }\n\n\n\n }", "public abstract void mouseClicked(MouseClickedEvent event);", "private static void dumpEvent(MotionEvent event)\n {\n String[] names = {\"DOWN\", \"UP\", \"MOVE\", \"CANCEL\", \"OUTSIDE\",\n \"POINTER_DOWN\", \"POINTER_UP\", \"7?\", \"8?\", \"9?\"};\n StringBuilder sb = new StringBuilder();\n int action = event.getAction();\n int actionCode = action & MotionEvent.ACTION_MASK;\n sb.append(\"event ACTION_\").append(names[actionCode]);\n if (actionCode == MotionEvent.ACTION_POINTER_DOWN\n || actionCode == MotionEvent.ACTION_POINTER_UP) {\n sb.append(\"(pid \").append(\n action >> MotionEvent.ACTION_POINTER_ID_SHIFT);\n sb.append(\")\");\n }\n sb.append(\"[\");\n for (int i = 0; i < event.getPointerCount(); i++) {\n sb.append(\"#\").append(i);\n sb.append(\"(pid \").append(event.getPointerId(i));\n sb.append(\")=\").append((int) event.getX(i));\n sb.append(\",\").append((int) event.getY(i));\n if (i + 1 < event.getPointerCount())\n sb.append(\";\");\n }\n sb.append(\"]\");\n LogHelper.d(TAG, sb.toString());\n }", "@Override\r\n\t\t\tpublic boolean onTouch(View arg0, MotionEvent event) {\n\t\t\t\tint action = event.getAction();\r\n\t\t\t\tswitch (action) {\r\n\t\t\t\tcase MotionEvent.ACTION_DOWN:\r\n\t\t\t\t\tmLastDownY = (int) event.getY();\r\n\t\t\t\t\tSystem.err.println(\"ACTION_DOWN=\" + mLastDownY);\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t\t\r\n\t\t\t\tcase MotionEvent.ACTION_UP:\r\n\t\t\t\t\tmCurryY = (int) event.getY();\r\n\t\t\t\t\tmDelY = mCurryY - mLastDownY;\r\n\t\t\t\t\tif (mDelY > 0) {\r\n\t\t\t\t\t\tpullDoorView.setVisibility(View.VISIBLE);\r\n\t\t\t\t\t\tstartBounceAnim(pullDoorView.getmScreenHeigh(), -pullDoorView.getmScreenHeigh(), 1000);\r\n\t\t\t\t\t\tpullDoorView.setmCloseFlag(false);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\treturn false;\r\n\t\t\t}" ]
[ "0.66716236", "0.66091937", "0.64373344", "0.64282346", "0.6421867", "0.6420613", "0.6372859", "0.63725084", "0.63417107", "0.62848616", "0.62848616", "0.6283342", "0.62750167", "0.6268721", "0.6263723", "0.6259176", "0.6218992", "0.62109965", "0.6210752", "0.6210752", "0.61881024", "0.6183247", "0.61742395", "0.6165544", "0.6160932", "0.6160932", "0.6160932", "0.6160932", "0.6160932", "0.61584646", "0.6158086", "0.6151998", "0.6147493", "0.61461794", "0.6142634", "0.61194503", "0.6107383", "0.61048913", "0.61048913", "0.61048913", "0.61048913", "0.61048913", "0.6103395", "0.60975134", "0.60973585", "0.60913813", "0.6079602", "0.60754424", "0.60738647", "0.60618746", "0.60604143", "0.6045725", "0.6034765", "0.6034218", "0.6033976", "0.60330015", "0.6031061", "0.6029878", "0.60041827", "0.59988517", "0.5984838", "0.5982208", "0.59814394", "0.596904", "0.59682524", "0.59663725", "0.5950039", "0.59469086", "0.5937601", "0.59374934", "0.59350497", "0.59333366", "0.5932981", "0.5932981", "0.5932981", "0.5932675", "0.5931842", "0.5925657", "0.59117806", "0.59104246", "0.5896687", "0.58833", "0.58833", "0.5881879", "0.58809084", "0.5869453", "0.58674717", "0.5858027", "0.58523405", "0.5844336", "0.5842489", "0.5842008", "0.5839824", "0.5834775", "0.58269936", "0.582602", "0.5821098", "0.58194286", "0.579973", "0.5799452", "0.57950854" ]
0.0
-1
Sets on touch listener to a view
public S<T> touch(OnTouchListener listener){ ((View)t).setOnTouchListener(listener); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n public void setOnTouchListener(OnTouchListener l) {\n super.setOnTouchListener(l);\r\n this.l = l;\r\n }", "void onViewTap(View view, float x, float y);", "private void hook(View view) {\n try {\n Class classview = Class.forName(\"android.view.View\");\n Method method = classview.getDeclaredMethod(\"getListenerInfo\");\n method.setAccessible(true);\n Object listenerInfo = method.invoke(view);\n Class classInfo = Class.forName(\"android.view.View$ListenerInfo\");\n Field field = classInfo.getDeclaredField(\"mOnClickListener\");\n field.set(listenerInfo, new HookListener((View.OnClickListener) field.get(listenerInfo)));\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n } catch (NoSuchMethodException e) {\n e.printStackTrace();\n } catch (NoSuchFieldException e) {\n e.printStackTrace();\n } catch (InvocationTargetException e) {\n e.printStackTrace();\n } catch (IllegalAccessException e) {\n e.printStackTrace();\n }\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.main);\n ImageView view = (ImageView) findViewById(R.id.imageView);\n view.setOnTouchListener(this); \n }", "@Override\n public void onTouch(int index) {\n }", "@Override\n public boolean onTouch(View view, MotionEvent me){\n game.onTouch(me);\n return false;\n }", "private void setTouchListener() {\n OnTouchListener mTouchListener = new OnTouchListener() {\n\n private float mLastTouchY;\n private float mLastTouchX;\n private int mActivePointerId = MotionEvent.INVALID_POINTER_ID;\n private int counter = 0; // counter to draw only a second for better rendering\n\n @Override\n public boolean onTouch(View view, MotionEvent motionEvent) {\n\n final int action = motionEvent.getActionMasked();\n\n switch (action) {\n case MotionEvent.ACTION_DOWN: {\n final int pointerIndex = motionEvent.getActionIndex();\n final float x = motionEvent.getX(pointerIndex);\n final float y = motionEvent.getY(pointerIndex);\n mLastTouchX = x;\n mLastTouchY = y;\n mActivePointerId = motionEvent.getPointerId(0);\n break;\n }\n\n case MotionEvent.ACTION_MOVE: {\n counter++;\n final int pointerIndex = motionEvent.findPointerIndex(mActivePointerId);\n final float x = motionEvent.getX(pointerIndex);\n final float y = motionEvent.getY(pointerIndex);\n final float dx = x - mLastTouchX;\n final float dy = y - mLastTouchY;\n\n setPositions(dx, dy);\n mLastTouchX = x;\n mLastTouchY = y;\n\n if (counter % 2 == 0) {\n counter = 0;\n mListener.onPositionUpdated();\n }\n break;\n }\n\n case MotionEvent.ACTION_UP: {\n mActivePointerId = MotionEvent.INVALID_POINTER_ID;\n break;\n }\n\n case MotionEvent.ACTION_CANCEL: {\n mActivePointerId = MotionEvent.INVALID_POINTER_ID;\n break;\n }\n\n case MotionEvent.ACTION_POINTER_UP: {\n\n final int pointerIndex = motionEvent.getActionIndex();\n final int pointerId = motionEvent.getPointerId(pointerIndex);\n\n if (pointerId == mActivePointerId) {\n final int newPointerIndex = pointerIndex == 0 ? 1 : 0;\n mLastTouchX = motionEvent.getX(newPointerIndex);\n mLastTouchY = motionEvent.getY(newPointerIndex);\n setX(mLastTouchX);\n setY(mLastTouchY);\n mActivePointerId = motionEvent.getPointerId(newPointerIndex);\n }\n break;\n }\n }\n return true;\n }\n\n /**update the view position after validate the position is in the parent view\n * @param dx x delta\n * @param dy y delta\n * @return\n */\n private void setPositions(float dx, float dy) {\n\n // prevent the point to be drag outside of the parent layout on the X axis\n if (getX() + dx + 2 * POINT_RADIUS >= ((View) getParent()).getWidth())\n setX(((View) getParent()).getWidth() - 2 * POINT_RADIUS);\n else if (getX() + dx < 0)\n setX(0);\n else\n setX(getX() + dx);\n\n\n // prevent the point to be drag outside of the parent layout on the Y axis\n if (getY() + dy + 2 * POINT_RADIUS > ((View) getParent()).getHeight())\n setY(((View) getParent()).getHeight() - 2 * POINT_RADIUS);\n else if (getY() + dy < 0)\n setY(0);\n else\n setY(getY() + dy);\n\n }\n };\n setOnTouchListener(mTouchListener);\n }", "@Override\n protected void setListener() {\n findView(R.id.btnClear).setOnClickListener(this);\n findView(R.id.btnSave).setOnClickListener(this);\n\n ivGraffit.setOnTouchListener(new GraffitTouchListener());\n }", "public void setView(View v)\n {\n\tthis.view = v;\n\tif (this.view != null)\n\t{\n\t addActionListeners();\n\t}\n }", "void touchEvent(MotionEvent event);", "@Override\n\t\t\tpublic boolean onTouch(View arg0, MotionEvent arg1) {\n\t\t\t\treturn true;\n\t\t\t}", "@Override\n public void onTouchEvent(RecyclerView rv, MotionEvent e) {\n }", "public void addViewListener(ViewPrivilege view) {\n\t\tthis.view=view;\r\n\t}", "@Override\n public boolean onTouch(View view, MotionEvent motionEvent) {\n return true;\n }", "@Override\n public boolean onTouch(View view, MotionEvent motionEvent) {\n return true;\n }", "@SuppressWarnings(\"unused\")\n public void setOnInterceptTouchListener(View.OnTouchListener onInterceptTouchListener) {\n mOnInterceptTouchListener = onInterceptTouchListener;\n }", "@Override\n public boolean onTouch(View view, MotionEvent motionEvent) {\n return true;\n }", "void addGestureHandler(GestureEventListener listener);", "@Override\n\tpublic boolean onTouch(View view, MotionEvent event) {\n\t\treturn this._gestureDetector.onTouchEvent(event);\n\t}", "@Override\n public boolean onLongClick(View view) {\n view.setOnTouchListener(new AppTouchListener());\n return false;\n }", "public interface OnTapListener {\n void onTapView(int position);\n}", "private void registerOnTouchListener() {\n TextView mRedirectToWelcome = (TextView) findViewById(R.id.register_redirect_login);\n mRedirectToWelcome.setOnTouchListener(new View.OnTouchListener() {\n @Override\n public boolean onTouch(View view, MotionEvent motionEvent) {\n Intent intent = new Intent(RegisterActivity.this, LoginActivity.class);\n intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);\n startActivity(intent);\n return true;\n }\n });\n }", "public boolean onTouch(View view, MotionEvent event) {\n \tswitch (mViewFlipper.getDisplayedChild()) {\n \tcase 0:\n \t\treturn mMainPage.getGestureDetector().onTouchEvent(event);\n \tcase 1:\n \t\treturn mBrowPage.getGestureDetector().onTouchEvent(event);\n \tcase 2:\n \t\tbreak;\n \t}\n \t\treturn true;\n }", "public static interface OnViewTapListener {\n\n /**\n * A callback to receive where the user taps on a ImageView. You will receive a callback if\n * the user taps anywhere on the view, tapping on 'whitespace' will not be ignored.\n *\n * @param view - View the user tapped.\n * @param x - where the user tapped from the left of the View.\n * @param y - where the user tapped from the top of the View.\n */\n void onViewTap(View view, float x, float y);\n }", "@Override\n\t\tpublic void onClick(View v) {\n\t\t\tlistener(v);\n\n\t\t}", "@Override\r\n\tpublic boolean onTouch(View v, MotionEvent event) {\n\t\t\r\n\t\treturn this.mGestureDetector.onTouchEvent( event );\r\n\t}", "public void setViewListener( ViewListener vListen ) {\n\t\tthis.vListen = vListen;\n\t}", "public MyEditView(Context context, AttributeSet attrs) {\n super(context, attrs);\n\n findViewById(R.id.myEditView).setOnTouchListener(this);\n }", "public void setOnGestureChangedListener(OnGestureChangedListener listener) {\n this.mOnGestureChangedListener = listener;\n }", "public void onTouch(final int pointerCount);", "protected void setTargetView(View v, int pos) {\n if (listener instanceof DoubleTapListener)\n ((DoubleTapListener) listener).setTargetView(v, pos);\n }", "private void onViewInit() {\n setFocusable(true);\n setFocusableInTouchMode(true);\n setBackgroundColor(Color.WHITE);\n setOnTouchListener(this);\n onCanvasInit();\n }", "@Override\r\n public boolean onTouch(View v, MotionEvent event) {\n\treturn mGestureDetector.onTouchEvent(event);\r\n }", "public void onTouchDown(NMapView arg0, MotionEvent arg1) {\n\n }", "public void onViewDown() {\n\n }", "@Override\n public void touch()\n {\n\n }", "@SuppressLint(\"ClickableViewAccessibility\") private void setTouchListener(Canvas canvas,\n RecyclerView recyclerView,\n RecyclerView.ViewHolder viewHolder, float dX, float dY,\n int actionState, boolean isActive) {\n recyclerView.setOnTouchListener(new View.OnTouchListener() {\n @Override public boolean onTouch(View v, MotionEvent event) {\n //when a pressed gesture finished or aborted, set the swipeBack true;\n swipeBack = event.getAction() == MotionEvent.ACTION_CANCEL\n || event.getAction() == MotionEvent.ACTION_UP;\n if (swipeBack) {\n //at this moment, if the position of finger is bigger than button width;\n if (dX < -BUTTON_WIDTH) {\n buttonState = ButtonState.RIGHT_VISIBLE;\n }\n if (buttonState != ButtonState.GONE) {\n //when the button appear, check the slide movement;\n setTouchDownListener(canvas, recyclerView, viewHolder, dX, dY, actionState, isActive);\n setItemsClickable(recyclerView, false);\n }\n }\n return false;\n }\n });\n }", "@Override\n public void onItemTouch(View view, int position) {\n\n }", "public View setTouchNClick(int id)\r\n\t{\r\n\r\n\t\tView v = setClick(id);\r\n\t\tif (v != null)\r\n\t\t\tv.setOnTouchListener(TOUCH);\r\n\t\treturn v;\r\n\t}", "@Override\n\tpublic boolean onTouch(View v, MotionEvent event) {\n\t\tULog.i(WordAdapter.this, \"onTouch() \");\n\t\treturn true;\n\t}", "@Override\r\n public boolean onTouch(View v, MotionEvent event)\r\n {\n switch(event.getActionIndex())\r\n {\r\n case MotionEvent.ACTION_DOWN:\r\n break;\r\n case MotionEvent.ACTION_UP:\r\n break;\r\n case MotionEvent.ACTION_MOVE:\r\n tapAnswer();\r\n return true;\r\n }\r\n \r\n return false;\r\n }", "void setView(View v);", "public static void setOnClickListener(@Nullable View view, @Nullable View.OnClickListener l) {\n if (view != null) {\n view.setOnClickListener(l);\n }\n }", "@Override\n\tpublic boolean onTouch(View v, MotionEvent event) {\n\t\ttouchStartTime = System.currentTimeMillis();\n\t\t// new ShowThread().start();\n\t\treturn mGestureDetector.onTouchEvent(event);\n\t}", "@Override\n public boolean onTouchEvent(MotionEvent event) {\n int action = event.getAction();\n tb.tbOnTouch(action);\n return true;\n }", "@Override\r\n\tpublic boolean onTouchEvent(final MotionEvent e) {\n\t\t\r\n\t\treturn true;\r\n\t}", "@Override\n public void onClick(View view) { listener.onItemClick(view, getPosition()); }", "@Override\n\t\t\tpublic boolean onTouch(View v, MotionEvent ev) {\n\n\t\t\t\tswitch (ev.getAction() & MotionEvent.ACTION_MASK) {\n\t\t\t\tcase MotionEvent.ACTION_DOWN:\n\t\t\t\tcase MotionEvent.ACTION_POINTER_DOWN:\n\t\t\t\t\t// Log.i(\"TimelineActivity\", \"Down\");\n\t\t\t\t\tAnimation cAnimation = new ScaleAnimation(1.0f, 0.9f, 1.0f,\n\t\t\t\t\t\t\t0.9f, Animation.RELATIVE_TO_SELF, 0.5f,\n\t\t\t\t\t\t\tAnimation.RELATIVE_TO_SELF, 0.5f);\n\t\t\t\t\tcAnimation.setDuration(300);\n\t\t\t\t\tcAnimation.setFillAfter(true);\n\t\t\t\t\tv.setAnimation(cAnimation);\n\t\t\t\t\tv.startAnimation(cAnimation);\n\t\t\t\t\tbreak;\n\t\t\t\tcase MotionEvent.ACTION_CANCEL:\n\t\t\t\t\tAnimation dAnimation = new ScaleAnimation(0.95f, 1.0f,\n\t\t\t\t\t\t\t0.95f, 1.0f, Animation.RELATIVE_TO_SELF, 0.5f,\n\t\t\t\t\t\t\tAnimation.RELATIVE_TO_SELF, 0.5f);\n\t\t\t\t\tdAnimation.setDuration(300);\n\t\t\t\t\tv.setAnimation(dAnimation);\n\t\t\t\t\tv.startAnimation(dAnimation);\n\t\t\t\t\tbreak;\n\t\t\t\tcase MotionEvent.ACTION_UP:\n\t\t\t\t\tAnimation eAnimation = new ScaleAnimation(0.95f, 1.0f,\n\t\t\t\t\t\t\t0.95f, 1.0f, Animation.RELATIVE_TO_SELF, 0.5f,\n\t\t\t\t\t\t\tAnimation.RELATIVE_TO_SELF, 0.5f);\n\t\t\t\t\teAnimation.setDuration(300);\n\t\t\t\t\tv.setAnimation(eAnimation);\n\t\t\t\t\tv.startAnimation(eAnimation);\n\t\t\t\t\tIntent intent = new Intent(mContext,\n\t\t\t\t\t\t\tShowImageActivity.class);\n\t\t\t\t\tintent.putExtra(\"image\", (Integer) index);\n\t\t\t\t\tmContext.startActivity(intent);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}", "@SuppressLint(\"ClickableViewAccessibility\")\n private void setTouchListeners() {\n mStudentNameEditText.addTextChangedListener(mTextListener);\n mStudentSexSpinner.setOnTouchListener(mTouchListener);\n mStudentBirthdateRelativeLayout.setOnTouchListener(mTouchListener);\n mStudentGradeEditText.addTextChangedListener(mTextListener);\n mAddPhotoView.setOnTouchListener(mTouchListener);\n mStudentAddClassView.setOnTouchListener(mTouchListener);\n mStudentRemoveClassView.setOnTouchListener(mTouchListener);\n }", "@Override\n\t\t\tpublic boolean onTouch(View v, MotionEvent event) {\n\t\t\t\treturn gestureScanner.onTouchEvent(event);\n\n\t\t\t}", "@Override\n public boolean onTouch(View v, MotionEvent event) {\n final int Y = (int) event.getRawY();\n\n // Switch on motion event type\n switch (event.getAction() & MotionEvent.ACTION_MASK) {\n\n case MotionEvent.ACTION_DOWN:\n // save default base layout height\n defaultViewHeight = layout.getHeight();\n\n // Init finger and view position\n previousFingerPosition = Y;\n //baseLayoutPosition = (int) layout.getY();\n break;\n\n case MotionEvent.ACTION_MOVE:\n if(!isClosing){\n //int currentYPosition = (int) layout.getY();\n if (previousFingerPosition < Y){\n\n // First time android rise an event for \"down\" move\n if(!isScrollingDown){\n isScrollingDown = true;\n }\n\n // Change base layout size and position (must change position because view anchor is top left corner)\n layout.setY(layout.getY() + (Y - previousFingerPosition));\n layout.getLayoutParams().height = layout.getHeight() - (Y - previousFingerPosition);\n layout.requestLayout();\n }\n\n // Update position\n previousFingerPosition = Y;\n }\n break;\n case MotionEvent.ACTION_UP: {\n\n int currentYPosition = (int) layout.getY();\n\n if (currentYPosition < defaultViewHeight / 5) {\n layout.setY(0);\n layout.getLayoutParams().height = defaultViewHeight;\n layout.requestLayout();\n }\n else{\n closeActivity(currentYPosition);\n }\n break;\n }\n }\n return true;\n }", "@Override\r\n\t\t\t\t\tpublic boolean onTouch(View v, MotionEvent event) {\n\t\t\t\t\t\t\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}", "@Override\n\t\t\tpublic boolean onTouch(View v, MotionEvent event) {\n\t\t\t\treturn false;\n\t\t\t}", "@Override\n public boolean onTouch(View v, MotionEvent event) {\n return false;\n }", "@Override\n\tpublic void onClick(View v) {\n\t\tlistener.onClick(v);\n\t}", "@Override\n\tpublic boolean onTouch(View v, MotionEvent event) {\n\t\tx = event.getX();\n\t\ty = event.getY();\n\t\t// see if hint button is clicked. Click is in the area\n\t\t// (GameArea.getWidth-hintButton.getwidth to GameArea.getWidth) Or\n\t\t// (0 to hintButton.getHeight())\n\n\t\tif ((x > (GameArea.getWidth() - hintButton.getWidth()))\n\t\t\t\t&& (x <= GameArea.getWidth())\n\t\t\t\t&& (y > 0 && y <= hintButton.getHeight())) {\n\t\t\t// Simulate press button situation\n\t\t\tswitch (event.getAction()) {\n\t\t\tcase MotionEvent.ACTION_DOWN:\n\t\t\t\t// Hint button clicked\n\t\t\t\tif (hintVisibilityFlag == true) { // hint was shown so hide it\n\t\t\t\t\thintText.setVisibility(View.GONE);\n\t\t\t\t} else { // hintHidden so show it\n\t\t\t\t\thintText.setVisibility(View.VISIBLE);\n\t\t\t\t}\n\t\t\t\thintVisibilityFlag = hintVisibilityFlag ? false:true;\n\t\t\t\tbreak;\n\t\t\tcase MotionEvent.ACTION_UP:\n\n\t\t\t\tbreak;\n\t\t\tcase MotionEvent.ACTION_CANCEL:\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\n\t\t} else { // send the event further to surfaceview\n\t\t\tsurfaceView.setSurfaceViewX(x);\n\t\t\tsurfaceView.setSurfaceViewY(y);\n\t\t}\n\t\treturn true;\n\t}", "@Override\n public boolean onTouch(View v, MotionEvent me) {\n if (me.getAction() != MotionEvent.ACTION_DOWN) return false;\n\n // get the x and y coordinates for the event\n float x = me.getX();\n float y = me.getY();\n\n // create the appropriate token and give it to the image\n SimpleMapToken token = TokenFactory.createMapToken(x, y, getCheckedIndex());\n imageView.setToken(token);\n\n // for a \"repaint\" so that that the new token shows up\n imageView.invalidate();\n\n // returnn true because we've handled the event\n return true;\n }", "@Override\n public boolean onTouch(View v, MotionEvent event) {\n if(event.getY() < header.getHeight()\n && listen != null)\n {\n listen.onHeaderClicked( HeaderListView.this );\n return true;\n }\n\n // handle touch normally\n else\n return onTouchEvent(event);\n }", "@Override\n public boolean onTouch(View v, MotionEvent event) {\n return false;\n }", "public void setView(View view);", "@Override\n public boolean onTouch(View v, MotionEvent event) {\n return timerActive;\n }", "@Override\n\tpublic boolean onTouch(View v, MotionEvent event) {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean onTouch(View v, MotionEvent event) {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean onTouch(View v, MotionEvent event) {\n\t\treturn false;\n\t}", "public interface AidTouchListener {\n public void start();\n}", "public TouchableWrapper(Context context, UserInteractionListener listener) {\n\t\tsuper(context);\n\t\tthis.listener = listener;\n\t}", "@Override\r\n\tpublic boolean onTouchEvent(MotionEvent event) {\n\t\tLog.i(TAG, \"MyLinearLayout() onTouchEvent event = \" + event.getAction());\r\n\t\treturn super.onTouchEvent(event);\r\n\t}", "@RequiresApi(api = Build.VERSION_CODES.O)\n\n public void onClick(View view) {\n view.requestPointerCapture();\n }", "@Override\n\t\t\tpublic boolean onTouch(View v, MotionEvent event) {\n\t\t\t\treturn DetailTreasureChestActivity.this.detector.onTouchEvent(event);\n\t\t\t}", "@SuppressLint(\"ClickableViewAccessibility\")\n @Override\n public boolean onTouchEvent(MotionEvent event) {\n return true;\n }", "@Override\n public boolean onTouch(View view, MotionEvent motionEvent) {\n\n\n //get the id of the view that was clicked and switch based on it\n //we have 3 text views for date, month and year\n switch(view.getId()){\n\n case R.id.tv_day:\n\n //pass the textView UI element and motionEvent to processEventsFor method which will handle how to deal with it\n processEventsFor(mTextDate, motionEvent);\n\n break;\n\n case R.id.tv_month:\n\n //pass the textView UI element and motionEvent to processEventsFor method which will handle how to deal with it\n processEventsFor(mTextMonth, motionEvent);\n\n break;\n\n case R.id.tv_year:\n\n //pass the textView UI element and motionEvent to processEventsFor method which will handle how to deal with it\n processEventsFor(mTextYear, motionEvent);\n\n break;\n\n }\n\n\n //needs to return true if we need touch listener to work\n return true;\n }", "@Override\n\tpublic boolean onTouch(View v, MotionEvent event) {\n\t\tLog.d(TAG, \"onTouch\");\n\t\treturn mCropView.onTouchEvent(event, this);\n\t}", "private void setViewListeners() {\n // Set an OnClickListener for each button.\n btnDecrease.setOnClickListener(this);\n btnIncrease.setOnClickListener(this);\n btnOrder.setOnClickListener(this);\n\n // Set an OnTouchListener for each view.\n btnDecrease.setOnTouchListener(touchListener);\n btnIncrease.setOnTouchListener(touchListener);\n etTitle.setOnTouchListener(touchListener);\n etAuthor.setOnTouchListener(touchListener);\n etPrice.setOnTouchListener(touchListener);\n etEditQuantity.setOnTouchListener(touchListener);\n etSupplier.setOnTouchListener(touchListener);\n etPhoneNumber.setOnTouchListener(touchListener);\n\n /* Format the phone number as the user types it.\n Reference: https://stackoverflow.com/a/15647444\n Date: 8/1/18\n */\n etPhoneNumber.addTextChangedListener(new PhoneNumberFormattingTextWatcher());\n // End referenced code.\n }", "public void events(View v){\n }", "@Override\n\t\t\tpublic boolean onTouch(View arg0, MotionEvent event) {\n\t\t\t\targ0.getParent().requestDisallowInterceptTouchEvent(true);\n\t\t\t\treturn false;\n\n\t\t\t}", "@Override\n public void onClick(View view) {\n listener.menuButtonClicked(view.getId());\n }", "public boolean onTouch(View v, MotionEvent event) {\n\t\t\t\tmView.setFocusable(true);\r\n\t\t\t\tmView.setFocusableInTouchMode(true);\r\n\t\t\t\tmView.requestFocus();\r\n\r\n\t\t\t\treturn false;\r\n\t\t\t}", "@Override\n public boolean onTouch(View view, MotionEvent motionEvent) {\n switch (motionEvent.getAction()) {\n case MotionEvent.ACTION_DOWN:\n layout.setBackgroundColor(getResources().getColor(R.color.newRed));\n break;\n case MotionEvent.ACTION_UP:\n layout.setBackgroundColor(getResources().getColor(R.color.newWhite));\n break;\n }\n return true;\n }", "@Override\n\tpublic void setView(View view) {\n\n\t}", "private void assignEvents(CardView cardView) {\n cardView.setOnMouseClicked(event -> {\n ClientManager.getInstance().cardSelected(cardView);\n });\n }", "void onInputEvent(View view, int buttons);", "@Override\n public boolean onTouch(View v, MotionEvent event) {\n return viewPager.dispatchTouchEvent(event);\n }", "@Override\n\tprotected void setListener() {\n\t\tslider_text.setOnClickListener(this);\n\t}", "public void setView(View view) {\n\t\tthis.view = view;\n\t}", "@Override\r\n\t\tpublic boolean onTouch(View v, MotionEvent event) {\n\t\t\t\r\n\t\t\tswitch (v.getId())\r\n\t\t\t{\r\n\t\t\t\tcase R.id.PlayMusic:\r\n\t\t\t\t\t\r\n\t\t\t\t\trSer.play_reproductor();\r\n\t\t\t\t\tplay_song();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase R.id.PauseMusic:\r\n\t\t\t\t\tif (rSer.mp_playing())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\trSer.pause_reproductor();\r\n\t\t\t\t\t\tpaused = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse paused = false;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase R.id.twiticon:\r\n\t\t\t\t\tif (rSer.mp_playing())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tshow_toast(\"Song Twitted\");\r\n\t\t\t\t\t\ttweet_song(\"Playing \"+rSer.get_actual()+\" using SrProject.\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase R.id.NextMusic:\r\n\t\t\t\t\trSer.next_song();\r\n\t\t\t\t\tplay_song();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase R.id.PrevMusic:\r\n\t\t\t\t\trSer.prev_song();\r\n\t\t\t\t\tplay_song();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tdefault:\r\n\t\t\t\t\t\r\n\t\t\t}\t\r\n\t\t\treturn false;\r\n\t\t}", "void setTouchable(Boolean touchable);", "@Override\r\n\t\tpublic boolean onTouch(View arg0, MotionEvent arg1) {\n\t\t\tswitch (arg1.getAction()) {\r\n\t\t\tcase MotionEvent.ACTION_DOWN:\r\n\t\t\t\targ0.setAlpha(0.6f);\r\n\t\t\t\tbreak;\r\n\t\t\tcase MotionEvent.ACTION_UP:\r\n\t\t\t\targ0.setAlpha(1f);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}", "@Override\n\t\t\tpublic boolean onTouch(View v, MotionEvent me) {\n\t\t\t\tint action = me.getAction();\n\t\t\t\t\n\t\t\t\tswitch(me.getAction()){\n\t\t\t\tcase MotionEvent.ACTION_DOWN:\n\t\t\t\t\tClipData data = ClipData.newPlainText(\"CREATEvertical\", \"hi\");\n\t\t\t\t DragShadowBuilder shadowBuilder = new View.DragShadowBuilder(v);\n\t\t\t\t v.startDrag(data, shadowBuilder, v, 0);\n\t\t\t\t return true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}", "@Override\n public boolean onTouch(View v, MotionEvent event) {\n float x;\n float y;\n int w = v.getWidth();\n int h = v.getHeight();\n int curAction = ACTION_NONE;\n float xscale = (float)w / (float)438;\n float yscale = (float)h / (float)600;\n\n x = event.getX() / xscale;\n y = event.getY() / yscale;\n // Log.d(LOG_TAG, \"x: \" + x + \", y:\" + y);\n if (x >= 90 && x <= 210 &&\n y >= 300 && y <= 425) curAction = ACTION_BATARI;\n else if (x >= 110 && x <= 200 &&\n y >= 450 && y <= 540) curAction = ACTION_GABARI;\n else if (x >= 240 && x <= 350 &&\n y >= 300 && y <= 430) curAction = ACTION_FUROHA;\n else if (x >= 245 && x <= 370 &&\n y >= 440 && y <= 550) curAction = ACTION_FUROA;\n if (event.getAction() == MotionEvent.ACTION_DOWN) {\n mActionType = curAction;\n Log.d(LOG_TAG, \"DOWN ACTION: \" + curAction);\n } else if (event.getAction() == MotionEvent.ACTION_UP ) {\n Log.d(LOG_TAG, \"UP ACTION: \" + curAction);\n if (mActionType == curAction) doAction(mActionType);\n }\n return true;\n }", "@Override\n public boolean onTouchEvent(MotionEvent event) {\n manager.receiveTouch(event);\n\n return true;\n }", "@Override\npublic void onCreate(SurfaceHolder surfaceHolder) {\n\tsuper.onCreate(surfaceHolder);\n setTouchEventsEnabled(true);\n}", "public void setOnClickListener(View.OnClickListener listener) {\n this.listener = listener;\n }", "public void setOnClickListener(View.OnClickListener listener) {\n this.listener = listener;\n }", "@Override\r\n\tpublic boolean onTouchEvent(MotionEvent event) {\n\t\tsuper.onTouchEvent(event);\r\n\t\tif (event.getAction() == MotionEvent.ACTION_UP) {\r\n\t\t\ttriggerClick(event.getX(), event.getY());\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "@Override\n public void onClick(View v) {\n if (mListenr != null) {\n mListenr.onClick(v, tag);\n }\n }", "@Override\n public boolean onInterceptTouchEvent(RecyclerView rv, MotionEvent e) {\n View child = rv.findChildViewUnder(e.getX(), e.getY());\n if (child != null && clickListener != null && gestureDetector.onTouchEvent(e)) {\n clickListener.onClick(child, rv.getChildAdapterPosition(child));\n }\n return false;\n }", "@Override\n\tpublic void setCustomView(View view) {\n\t\t\n\t}", "private void initEvent() {\n\t\tmScrollView.setOnTouchListener(new OnTouchListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic boolean onTouch(View v, MotionEvent event) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tswitch (event.getAction()) {\n\t\t\t\t/*case MotionEvent.ACTION_UP:\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase MotionEvent.ACTION_DOWN:\n\n\t\t\t\t\tbreak;*/\n\t\t\t\tcase MotionEvent.ACTION_MOVE:\n\t\t\t\t\t//判断是否滑动到底部\n\t\t\t\t\tif(mScrollView.getChildAt(0).getMeasuredHeight()<=mScrollView.getHeight()+mScrollView.getScrollY()){\n\t\t\t\t\t\tToast.makeText(getActivity(), \"已经到底部了,去留下你的足迹吧\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t}", "@Override\n\t\t\tpublic boolean onTouch(View v, MotionEvent event) {\n\t\t\t\tswitch(event.getAction())\n\t\t\t\t{\n\t\t\t\tcase MotionEvent.ACTION_DOWN:\n\t\t\t\t\tv.setBackgroundColor(hovercolor);\n\t\t\t\t\tbreak;\n\t\t\t\tcase MotionEvent.ACTION_UP:\n\t\t\t\t\tv.setBackgroundColor(Color.TRANSPARENT);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}", "@SuppressLint(\"ClickableViewAccessibility\") private void setTouchDownListener(final Canvas c,\n final RecyclerView recyclerView,\n final RecyclerView.ViewHolder viewHolder, final float dX, final float dY,\n final int actionState, final boolean isCurrentlyActive) {\n recyclerView.setOnTouchListener(new View.OnTouchListener() {\n @Override public boolean onTouch(View v, MotionEvent event) {\n if (event.getAction() == MotionEvent.ACTION_DOWN) {\n setTouchUpListener(c, recyclerView, viewHolder, dX, dY, actionState,\n isCurrentlyActive);\n Toast.makeText(context, \"click:\" + dX + \",dY\" + dY,\n Toast.LENGTH_SHORT).show();\n }\n return false;\n }\n });\n }" ]
[ "0.7628933", "0.7090993", "0.682533", "0.6648884", "0.6602761", "0.6583508", "0.65805185", "0.6563567", "0.6484068", "0.64578795", "0.6454108", "0.6431246", "0.64262813", "0.64038926", "0.64038926", "0.6402335", "0.63689107", "0.6351007", "0.6341623", "0.63265556", "0.63218313", "0.6319818", "0.63092", "0.6300594", "0.6293699", "0.6286058", "0.6275183", "0.6264913", "0.62173706", "0.6208503", "0.6208488", "0.62009615", "0.6189565", "0.6170564", "0.6157243", "0.6137386", "0.6126388", "0.6115875", "0.61077714", "0.60863477", "0.6057658", "0.60425305", "0.6014632", "0.6001752", "0.59880495", "0.59848315", "0.59825975", "0.5981169", "0.5978655", "0.59716624", "0.5967746", "0.5961713", "0.59608907", "0.5956444", "0.5941754", "0.593312", "0.59329534", "0.59296197", "0.5929563", "0.592291", "0.5914471", "0.5911216", "0.5911216", "0.5911216", "0.5906788", "0.5902643", "0.58905077", "0.58880746", "0.5879734", "0.5865931", "0.58575195", "0.5855865", "0.5852593", "0.5850175", "0.58421904", "0.58393556", "0.5825525", "0.58199465", "0.5810506", "0.57955253", "0.5789309", "0.5788499", "0.5785215", "0.5784181", "0.5774503", "0.57733876", "0.57712966", "0.5767768", "0.57666874", "0.5766653", "0.5761576", "0.5760729", "0.5760729", "0.57559127", "0.5750931", "0.5747762", "0.5746852", "0.5743806", "0.5739393", "0.57361305" ]
0.6895532
2
END OF ADDED BY MYSELF
public Integer getRentId() { return rentId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected boolean func_70814_o() { return true; }", "public final void mo51373a() {\n }", "@Override\n public void func_104112_b() {\n \n }", "public void method_4270() {}", "private void m50366E() {\n }", "@Override\n\tprotected void interr() {\n\t}", "private void kk12() {\n\n\t}", "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "public void mo38117a() {\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}", "protected void mo6255a() {\n }", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "protected boolean func_70041_e_() { return false; }", "public void mo12628c() {\n }", "private void poetries() {\n\n\t}", "public void gored() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "public abstract void mo70713b();", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "public final void mo91715d() {\n }", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void doF6() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "public void mo21779D() {\n }", "public void m23075a() {\n }", "public abstract void mo56925d();", "private static void cajas() {\n\t\t\n\t}", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "private void m50367F() {\n }", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\n protected void init() {\n }", "public void mo21877s() {\n }", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "private void strin() {\n\n\t}", "public abstract void mo6549b();", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "protected void method_2665() {\r\n super.method_2427(awt.field_4171);\r\n this.method_2440(true);\r\n this.method_2521(class_872.field_4244);\r\n }", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "public abstract void mo27385c();", "public void mo115190b() {\n }", "public void mo21825b() {\n }", "public void mo12930a() {\n }", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "public void mo21793R() {\n }", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "public void mo21785J() {\n }", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void mo21787L() {\n }", "public void mo55254a() {\n }", "private Rekenhulp()\n\t{\n\t}", "public abstract void mo27386d();", "public void mo3376r() {\n }", "public void smell() {\n\t\t\n\t}", "public void mo6081a() {\n }", "public void mo23813b() {\n }", "public void mo9848a() {\n }", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "public void mo3749d() {\n }", "@Override\n protected void prot() {\n }", "public void mo21782G() {\n }", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "public void mo21794S() {\n }", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "public void skystonePos6() {\n }", "static void feladat9() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "public void mo21878t() {\n }", "private void init() {\n\n\t}", "public void mo97908d() {\n }", "public static void listing5_14() {\n }", "public void skystonePos4() {\n }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "void m1864a() {\r\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "public void mo21791P() {\n }" ]
[ "0.6165795", "0.6154642", "0.61374", "0.6131357", "0.6074221", "0.60687447", "0.60493934", "0.6037636", "0.6037204", "0.601763", "0.59955287", "0.59726816", "0.59315175", "0.59063077", "0.5885342", "0.58811176", "0.585914", "0.5813362", "0.58094615", "0.5807784", "0.5802745", "0.5801552", "0.5782569", "0.5782569", "0.5777513", "0.57770836", "0.57747126", "0.5757149", "0.575696", "0.5718013", "0.5718013", "0.5718013", "0.5718013", "0.5718013", "0.5718013", "0.5718013", "0.5712098", "0.5711973", "0.5708414", "0.5707446", "0.5697839", "0.5674067", "0.567127", "0.5670035", "0.5664121", "0.56576014", "0.56535065", "0.565059", "0.56476206", "0.56442606", "0.56426924", "0.56420326", "0.56409043", "0.56409043", "0.56375945", "0.56342185", "0.5631525", "0.5629555", "0.5625176", "0.5623588", "0.56168973", "0.5612502", "0.5605792", "0.5605792", "0.5605792", "0.5605792", "0.5605792", "0.5605358", "0.5601579", "0.55931705", "0.55846375", "0.5582962", "0.55817443", "0.5578649", "0.5578426", "0.5569975", "0.556658", "0.5566111", "0.555974", "0.5558853", "0.55586725", "0.5549098", "0.5546978", "0.5538074", "0.5527797", "0.55244297", "0.55233514", "0.5522085", "0.5519781", "0.55163676", "0.55149865", "0.5514479", "0.5507353", "0.5505443", "0.5503573", "0.5503244", "0.5503244", "0.5493183", "0.54886305", "0.54865956", "0.54854506" ]
0.0
-1
TODO: Warning this method won't work in the case the id fields are not set
@Override public boolean equals(Object object) { if (!(object instanceof Rent)) { return false; } Rent other = (Rent) object; if ((this.rentId == null && other.rentId != null) || (this.rentId != null && !this.rentId.equals(other.rentId))) { return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setId(Integer id) { this.id = id; }", "private Integer getId() { return this.id; }", "public void setId(int id){ this.id = id; }", "public void setId(Long id) {this.id = id;}", "public void setId(Long id) {this.id = id;}", "public void setID(String idIn) {this.id = idIn;}", "public void setId(int id) { this.id = id; }", "public void setId(int id) { this.id = id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public void setId(long id) { this.id = id; }", "public void setId(long id) { this.id = id; }", "public int getId(){ return id; }", "public int getId() {return id;}", "public int getId() {return Id;}", "public int getId(){return id;}", "public void setId(long id) {\n id_ = id;\n }", "private int getId() {\r\n\t\treturn id;\r\n\t}", "public Integer getId(){return id;}", "public int id() {return id;}", "public long getId(){return this.id;}", "public int getId(){\r\n return this.id;\r\n }", "@Override public String getID() { return id;}", "public Long id() { return this.id; }", "public Integer getId() { return id; }", "@Override\n\tpublic Integer getId() {\n return id;\n }", "@Override\n public Long getId () {\n return id;\n }", "@Override\n public long getId() {\n return id;\n }", "public Long getId() {return id;}", "public Long getId() {return id;}", "public String getId(){return id;}", "@Override\r\n\tpublic Long getId() {\n\t\treturn null;\r\n\t}", "public Integer getId() { return this.id; }", "@Override\r\n public int getId() {\n return id;\r\n }", "@Override\n\t\tpublic long getId() {\n\t\t\treturn 0;\n\t\t}", "public int getId() {\n return id;\n }", "public long getId() { return _id; }", "public int getId() {\n/* 35 */ return this.id;\n/* */ }", "public long getId() { return id; }", "public long getId() { return id; }", "public void setId(Long id) \n {\n this.id = id;\n }", "@Override\n\tpublic Long getId() {\n\t\treturn null;\n\t}", "@Override\n\tpublic Long getId() {\n\t\treturn null;\n\t}", "public void setId(String id) {\n this.id = id;\n }", "@Override\n\tpublic void setId(Long id) {\n\t}", "public Long getId() {\n return id;\n }", "public long getId() { return this.id; }", "public int getId()\n {\n return id;\n }", "public void setId(int id){\r\n this.id = id;\r\n }", "protected abstract String getId();", "@Test\r\n\tpublic void testSetId() {\r\n\t\tbreaku1.setId(5);\r\n\t\texternu1.setId(6);\r\n\t\tmeetingu1.setId(7);\r\n\t\tteachu1.setId(8);\r\n\r\n\t\tassertEquals(5, breaku1.getId());\r\n\t\tassertEquals(6, externu1.getId());\r\n\t\tassertEquals(7, meetingu1.getId());\r\n\t\tassertEquals(8, teachu1.getId());\r\n\t}", "@Override\n\tpublic int getId(){\n\t\treturn id;\n\t}", "public String getId() { return id; }", "public String getId() { return id; }", "public String getId() { return id; }", "public int getID() {return id;}", "public int getID() {return id;}", "public int getId ()\r\n {\r\n return id;\r\n }", "@Override\n public int getField(int id) {\n return 0;\n }", "public int getId(){\r\n return localId;\r\n }", "public void setId(Long id)\n/* */ {\n/* 66 */ this.id = id;\n/* */ }", "@Override\n public Integer getId() {\n return id;\n }", "void setId(int id) {\n this.id = id;\n }", "@Override\n\tpublic Object selectById(Object id) {\n\t\treturn null;\n\t}", "@Override\n public int getId() {\n return id;\n }", "@Override\n public int getId() {\n return id;\n }", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "public void setId(int id)\n {\n this.id=id;\n }", "@Override\r\n public int getID()\r\n {\r\n\treturn id;\r\n }", "@Override\n\tpublic Integer getId() {\n\t\treturn null;\n\t}", "public int getId()\r\n {\r\n return id;\r\n }", "@java.lang.Override\n public int getId() {\n return id_;\n }", "@java.lang.Override\n public int getId() {\n return id_;\n }", "public void setId(Long id){\n this.id = id;\n }", "public abstract Long getId();", "final protected int getId() {\n\t\treturn id;\n\t}", "private void clearId() {\n \n id_ = 0;\n }", "public void setId(Long id) \r\n {\r\n this.id = id;\r\n }", "@Override\n public long getId() {\n return this.id;\n }", "public String getId(){ return id.get(); }", "public void setId(long id){\n this.id = id;\n }", "public void setId(long id){\n this.id = id;\n }", "@SuppressWarnings ( \"unused\" )\n private void setId ( final Long id ) {\n this.id = id;\n }", "public Long getId() \n {\n return id;\n }", "public void setId(Integer id)\r\n/* */ {\r\n/* 122 */ this.id = id;\r\n/* */ }", "@Override\n\tpublic void setId(int id) {\n\n\t}", "@Override\r\n\tpublic Object getId() {\n\t\treturn null;\r\n\t}", "public void test_getId() {\n assertEquals(\"'id' value should be properly retrieved.\", id, instance.getId());\n }", "public int getId()\n {\n return id;\n }", "public int getID(){\n return id;\n }", "public String getID(){\n return Id;\n }" ]
[ "0.6896072", "0.6839122", "0.6705258", "0.66412854", "0.66412854", "0.65923095", "0.65785074", "0.65785074", "0.65752834", "0.65752834", "0.65752834", "0.65752834", "0.65752834", "0.65752834", "0.6561566", "0.6561566", "0.6545169", "0.6525343", "0.65168375", "0.64885366", "0.6477314", "0.64274967", "0.6420125", "0.6417802", "0.640265", "0.6367859", "0.6355473", "0.6352689", "0.6348769", "0.63258827", "0.63203555", "0.6302521", "0.62946665", "0.62946665", "0.62845194", "0.62724674", "0.62673867", "0.62664896", "0.62628543", "0.62604827", "0.6256597", "0.62518793", "0.6248176", "0.6248176", "0.62445766", "0.6240227", "0.6240227", "0.62322026", "0.6223806", "0.62218046", "0.6220317", "0.6212928", "0.62090635", "0.6203066", "0.6201325", "0.61939746", "0.6190498", "0.6190498", "0.6190498", "0.6189811", "0.6189811", "0.6185415", "0.618307", "0.6175355", "0.6174499", "0.6167348", "0.6167341", "0.61617935", "0.61569077", "0.61569077", "0.61567014", "0.61567014", "0.61567014", "0.61567014", "0.61567014", "0.61567014", "0.61567014", "0.61423147", "0.6134403", "0.6129919", "0.61289775", "0.6105535", "0.6105535", "0.61055124", "0.6103899", "0.6103877", "0.61027", "0.61002946", "0.61002403", "0.609533", "0.609243", "0.609243", "0.60917705", "0.6090932", "0.60905474", "0.60762745", "0.6072683", "0.6072517", "0.6071208", "0.60706896", "0.6070472" ]
0.0
-1
TODO Autogenerated method stub
@Override public Map<String, Object> apiProcess(ParamContextHolder paramContextHolder, CApiBase arg1) throws ApiProcessException { Map<String, Object> map = new HashMap<>(); String id = paramContextHolder.getReq().getParameter("id"); if(!cosProcess.checkFileExist(folder+id+"_zh.mp3")){ NNovelContent content = iNNovelContentService.selectById(id); if(content == null){ throw new ApiProcessException("C0001","语音合成异常"); } String str = cosProcess.getContent(content.getBookId()+"/"+content.getId()); str = str.replaceAll("</br>", ""); List<String> list = new ArrayList<>(); str = str.trim(); while(str.length()>0){ if(str.length() > 2000){ int index = str.indexOf("。", 2000); if(index == -1){ index = str.indexOf(".", 2000); } if(index == -1){ index = str.indexOf(",", 2000); } if(index == -1){ index = str.indexOf(",", 2000); } list.add(str.substring(0, index)); str = str.substring(index); }else{ list.add(str); break; } } byte[] data = {}; for(String s : list){ TtsResponse res = client.synthesis(s,"zh",1,null); System.out.println(res.getResult()); if(!(res.getResult()==null)) throw new ApiProcessException("C0001","语音合成异常"); data = ArrayUtils.addAll(data,res.getData()); } try { cosProcess.createMP3(folder+content.getId()+"_zh.mp3", new ByteArrayInputStream(data)); } catch (Exception e) { // TODO Auto-generated catch block throw new ApiProcessException("C0001","语音合成异常"); } } map.put("url",path+folder+id+"_zh.mp3"); return map; }
{ "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
doGet method for MyCine lander.jsp redirect
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { EmailMessage msg = new EmailMessage(); msg.sendPageAccesser(request.getRemoteAddr()); getServletContext().getRequestDispatcher("/lander.jsp").forward(request, response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {\n\t\tresponse.sendRedirect(\"index.jsp\");\n\t\t//seguridad antihackers\n\t}", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n //processRequest(request, response);\r\n String forward=\"\";\r\n String action = request.getParameter(\"action\");\r\n\r\n forward = \"/createLocacao.jsp\";\r\n\r\n RequestDispatcher view = request.getRequestDispatcher(forward);\r\n view.forward(request, response);\r\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws \r\n\t \t\t\tServletException, IOException{ \t \r\n\t\t \r\n\t\t \t// Where jsp is /WEB-INF/views/login.jsp\r\n\t\t\t//when we write login.do we need to redirect servlet to Jsp. here we get request and redirecte it to jsp. \r\n\t\t\t//When we load the first page which is http://localhost:8080/login.do , it is get method. so we get the request from browser and redircet it to login.jsp to display the long page\r\n\t\t \t request.getRequestDispatcher(\"/WEB-INF/views/login.jsp\").forward(request, response);\r\n\t }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n // This servlet shouldn't be reached via GET\n response.sendRedirect(\"index.jsp\");\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n response.sendRedirect(\"LoginPage.jsp\");\r\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\r\n\t\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\tresponse.setContentType(\"text/html\");\r\n\t\t\tPrintWriter pw= response.getWriter();\r\n\t\t\tList<String> loc=new ArrayList<String>();\r\n\t\t\t\r\n\t\t\tPreparedStatement pst=con.prepareStatement(\"select loc from dept\");\r\n\t\t\tResultSet res= pst.executeQuery();\r\n\t\t\t\r\n\t\t\twhile(res.next())\r\n\t\t\t{\r\n\t\t\t\tloc.add(res.getNString(\"loc\"));\r\n\t\t\t}\r\n\t\t\r\n\t\t\t request.setAttribute(\"location\", loc);\r\n\t\t\t RequestDispatcher rd=request.getRequestDispatcher(\"Server2\");\r\n\t\t\t rd.forward(request,response);\r\n\t\t\t\r\n\t\t}\r\n\t\tcatch(Exception ee)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"in forwarding\"+ee);\r\n\t\t}\r\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n\n\n\n RequestDispatcher dispatcher //\n = this.getServletContext().getRequestDispatcher(\"/WEB-INF/quanli/themthisinh.jsp\");\n dispatcher.forward(request, response);\n\n\t\t\n\n\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {\n request.setAttribute(\"pageTitle\", \"Accueil\");\n\n if (new SessionChecker(request).isConnected()) {\n //Si l'utilisateur est conncecté on affiche la page \"Emprunter\"\n response.sendRedirect(\"/loan\");\n } else {\n //Sinon on afficjhe la page de connexion\n response.sendRedirect(\"/login\");\n }\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n\r\n /* Affichage de la page d'inscription */\r\n this.getServletContext()\r\n .getRequestDispatcher(VIEW)\r\n .forward(request, response);\r\n\r\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\r\n\t\t// 로그인 유효성 검사\r\n\t\tHttpSession session = request.getSession();\r\n\t\tif(session.getAttribute(\"loginClient\") != null) {\r\n\t\t\tresponse.sendRedirect(request.getContextPath()+\"/IndexController\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\trequest.getRequestDispatcher(\"/WEB-INF/view/client/insertClient.jsp\").forward(request, response);\r\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n MonsterDAO dao = new MonsterDAO();\n Monster monster = dao.testmonster(); \n if(monster == null) {\n response.sendRedirect(\"\");\n response.setContentType(\"text/plain\");\n \t\tresponse.getWriter().println(\"Hello, world\");\n }else {\n \n HttpSession session = request.getSession();\n session.setAttribute(\"monster\",monster);\n monsterHP = monster.getHp();\n monsterAtk = monster.getAtk();\n RequestDispatcher dispatcher = request.getRequestDispatcher(\"WEB-INF/jsp/main.jsp\");\n dispatcher.forward(request,response);\n \t//response.setContentType(\"text/plain\");\n \t\t//response.getWriter().println(monsterAtk);\n }\n }", "private void home(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tresponse.sendRedirect(\"/WebBuyPhone/admin/darkboard.jsp\");\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\treq.getRequestDispatcher(\"employeelogin.html\").forward(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\t\treq.getRequestDispatcher(\"/index.jsp\").forward(req, resp);\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tthis.getServletContext().getRequestDispatcher(\"/WEB-INF/jsp/pageventenondebutee.jsp\").forward(request, response);\r\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String sesion_med = dmmed.ObtenerCodigoSesion();\n Medico medico_sesion = dmmed.VerMedicoPorCodigo(sesion_med);\n String acceder = \"\";\n String accion = request.getParameter(\"accion\");\n if (accion.equalsIgnoreCase(\"RealizarCita\")) {\n request.getSession().setAttribute(\"mensaje_cita\", null);\n acceder = \"medico/realizar_cita.jsp\";\n } else if (accion.equalsIgnoreCase(\"AgendarExamen\")) {\n request.getSession().setAttribute(\"alerta_e\", null);\n acceder = \"medico/agendar_examen.jsp\";\n } else if (accion.equalsIgnoreCase(\"Reporte1\")) {\n acceder = \"medico/reporte1.jsp\";\n } else if (accion.equalsIgnoreCase(\"Reporte2\")) {\n acceder = \"medico/reporte2.jsp\";\n } else if (accion.equalsIgnoreCase(\"Reporte3\")) {\n acceder = \"medico/reporte3.jsp\";\n } else if (accion.equalsIgnoreCase(\"Reporte4\")) {\n acceder = \"medico/reporte4.jsp\";\n }\n RequestDispatcher pagina = request.getRequestDispatcher(acceder);\n pagina.forward(request, response);\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\n\t\trequest.setAttribute(\"landen\", landenService.findLanden());\r\n\t\tHttpSession session = request.getSession(false);\r\n\t\trequest.setAttribute(\"mandjeAanwezig\", (session != null && session.getAttribute(\"mandje\") != null));\r\n\r\n\t\t//wijnId opvragen en als het al in het mandje zit dit meegeven zodat het getoont kan worden in het \"Aantal flessen\" veld\r\n\t\ttry {\r\n\t\t\tlong wijnId = Long.parseLong(request.getParameter(\"wijnId\"));\r\n\t\t\tif (wijnId > 0) {\r\n\t\t\t\trequest.setAttribute(\"wijn\", wijnenService.findWijnById(wijnId));\r\n\r\n\t\t\t\tif (session != null && session.getAttribute(\"mandje\") != null) {\r\n\t\t\t\t\tMandje mandje = (Mandje) session.getAttribute(\"mandje\");\r\n\r\n\t\t\t\t\tint aantalFlessenInMandje = mandje.getAantalFlessenAlInMandje(wijnId);\r\n\r\n\t\t\t\t\tif (aantalFlessenInMandje > 0) {\r\n\t\t\t\t\t\trequest.setAttribute(\"alInMandje\", aantalFlessenInMandje);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\trequest.getRequestDispatcher(VIEW).forward(request, response);\r\n\t\t\t}\r\n\t\t} catch (NumberFormatException ex) {\r\n\t\t\tlogger.log(Level.SEVERE, \"parameters ongeldig\", ex);\r\n\t\t\tresponse.sendRedirect(String.format(REDIRECT_NAAR_INDEX_URL, request.getContextPath()));\r\n\t\t}\r\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tif (req.getSession().getAttribute(\"client\") == null) {\n\t\t\tresp.sendRedirect(\"/FinalProject/login\");\n\t\t} else {\n\t\t\treq.getRequestDispatcher(\"view/client/client-profile.jsp\").forward(req, resp);\n\t\t}\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\"); \n RequestDispatcher rd=request.getRequestDispatcher(\"Contact.jsp\");\n rd.forward(request, response); \n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n //LLAMAMOS AL FORMULARIO\r\n RequestDispatcher rd = getServletContext().getRequestDispatcher(\"/inicioSesion.jsp\");\r\n rd.forward(request, response);\r\n \r\n }", "protected void doGet( HttpServletRequest request, \n HttpServletResponse response )\n throws ServletException, IOException \n {\n String location = request.getParameter( \"page\" );\n\n if ( location != null ) \n \n if ( location.equals( \"CNT4714\" ) )\n response.sendRedirect( \"http://www.ucf.edu\" );\n else \n if ( location.equals( \"welcome1\" ) )\n response.sendRedirect( \"welcome1\" );\n\t\t\t\telse\n\t\t\t\t if ( location.equals (\"cyclingnews\") )\n\t\t\t\t\t response.sendRedirect( \"http://www.cyclingnews.com\" );\n\t\t\t\t\t else\n\t\t\t\t if ( location.equals ( \"error\" ) )\n\t\t\t\t\t response.sendRedirect( \"error\" );\n\n // code that executes only if this servlet does not redirect the user to another page\n\n response.setContentType( \"text/html\" );\n PrintWriter out = response.getWriter(); \n\n // start HTML document\n out.println( \"<!DOCTYPE html\\\">\" ); \n // head section of document\n out.println( \"<head>\" );\n out.println( \"<title>Invalid page</title>\" );\n out.println( \"<meta charset=\\\"utf-8\\\">\" );\n out.println( \"<style type='text/css'>\");\n out.println( \"<!-- body{background-color:red; font-family:calibri;} -->\");\n out.println( \"</style>\");\n out.println( \"</head>\" );\n // body section of document\n out.println( \"<body>\" );\n out.println( \"<h1>Invalid page requested</h1>\" );\n out.println( \"<p><a href = \" + \"RedirectionServlet.html\\\">\" );\n out.println( \"Click here for more details</a></p>\" );\n out.println( \"</body>\" );\n // end HTML document\n out.println( \"</html>\" );\n out.close(); // close stream to complete the page \n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n request.getRequestDispatcher(\"login.jsp\").forward(request, response);\r\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\tAdmin admin = (Admin) request.getSession().getAttribute(\"username\");\n\t\tif (admin != null) {\n\t\t\t// if (administer.getAccessLevel().equals(AccessLevel.ADMIN)) {\n\t\t\tresponse.sendRedirect(\"welcome.jsp\");\n\t\t\t// } else {\n\t\t\t// response.sendRedirect(doc_JSP);\n\t\t\t// }\n\t\t} else {\n\t\t\tRequestDispatcher rd = request.getRequestDispatcher(\"signup.jsp\");\n\t\t\trd.forward(request, response);\n\t\t}\n\n//\t\tRequestDispatcher rd = request.getRequestDispatcher(\"signup.jsp\");\n//\t\trd.forward(request, response);\n\t}", "@Override\n public void doGet(HttpServletRequest request, HttpServletResponse response)\n throws IOException, ServletException {\n ServletContext context = getServletContext();\n RequestDispatcher dispatch = context.getRequestDispatcher(\"/helloworld.jsp\");\n dispatch.forward(request, response);\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n request.getRequestDispatcher(\"WEB-INF/Paamelding.jsp\").forward(request, response);\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tList<Student> students = HelperClassUtil.getStudents();\n\t\trequest.setAttribute(\"student_list\", students);\n\t\t\n\t//step 2: call the JSP \n\t\tRequestDispatcher dispatcher =request.getRequestDispatcher(\"/mvc_view_students2.jsp\");\n\t\t\n\t//step 3: send/forward data to jsp\n\t\tdispatcher.forward(request, response);\n\t\t\n\t\n\t\n\t}", "public void redirect() {\n\t\tRequestContext context = RequestContext.getCurrentInstance();\n\t\tString ruta = \"\";\n\t\truta = MyUtil.basepathlogin() + \"inicio.xhtml\";\n\t\tcontext.addCallbackParam(\"ruta\", ruta);\n\t}", "public abstract String redirectTo();", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tRequestDispatcher dispatcher=req.getRequestDispatcher(\"login.html\");\n\t\tdispatcher.forward(req, resp);\n\t\t\n\t}", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\r\n HttpSession session = request.getSession(true);\r\n String id = (String) session.getAttribute(\"id\");//ici la valeur de la session va dans id\r\n if (id == null) {\r\n sc.getRequestDispatcher(\"/connexion.jsp\").forward(request, response); //si l'authentification n'a pas encore eu lieu, on renvoie sur la page connexion.html; dont l'action fait fonctionner le servlet sauthentifier\r\n return;\r\n }\r\n else{\r\n sc.getRequestDispatcher(\"/emprunter.jsp\").forward(request, response);\r\n }\r\n \r\n response.setContentType(\"text/html\"); // on pourra générer ca dans le code jsp en entête\r\n PrintWriter p = response.getWriter();\r\n p.println(\"<DOCTYPE html>\");\r\n p.println(\"<html>\");\r\n p.println(\"<head>\");\r\n p.println(\"</head>\");\r\n p.println(\"<body>\");\r\n p.println(\"<h1>Page pour Emprunter</h1>\");\r\n p.println(\"</body>\");\r\n p.println(\"</html>\");\r\n }", "@Override\n protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n req.getRequestDispatcher(\"/WEB-INF/views/login.jsp\").forward(req, resp);\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tString name = req.getParameter(\"uname\");\n\t\tString pass = req.getParameter(\"upass\");\n\t\tLoginService loginService = new LoginService();\n\t\tboolean result = loginService.authenticate(name, pass);\n\t\tif (result) {\n\t\t\tresp.sendRedirect(\"success.jsp\");\n\t\t\treturn;\n\t\t} else {\n\t\t\tresp.sendRedirect(\"login.jsp\");\n\t\t\treturn;\n\t\t}\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n RequestDispatcher dispatcher = this.getServletContext()\n \t\t.getRequestDispatcher(\"/WEB-INF/views/ClientProfile.jsp\");\n \n dispatcher.forward(request, response);\n \n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\treq.getRequestDispatcher(\"login.html\").forward(req, resp);\n\t}", "protected void doGet(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\r\n\t\t\r\n\t\treq.getRequestDispatcher(\"main.jsp\").include(req, resp);\r\n\t\r\n\t}", "public void doGet(HttpServletRequest request,\r\n HttpServletResponse response)\r\n throws IOException, ServletException\r\n {\r\n response.setContentType(\"text/html\");\r\n PrintWriter out = response.getWriter(); \r\n CookieUtil PkCookie = new CookieUtil();\r\n String vPID = PkCookie.getCookie(request,\"PID\");\r\n if(vPID==null)\r\n {\r\n out.println(WebUtil.IllegalEntry());\r\n return;\r\n }\r\n \r\n String Flag = request.getParameter(\"Flag\");\r\n out.println(\"<HTML>\");\r\n out.println(\"<HEAD>\");\r\n out.println(\"<SCRIPT LANGUAGE=\\\"JavaScript\\\">\");\r\n out.println(\" function GetBrowser() { \");\r\n out.println(\" if( navigator.appName == \\\"Netscape\\\") \"); \r\n out.println(\" this.location.href = \\\"/JOrder/servlets/CreDelTempl?Browser=1&Flag=\"+Flag+\"\\\" \");\r\n out.println(\" else \");\r\n out.println(\" this.location.href = \\\"/JOrder/servlets/CreDelTempl?Browser=0&Flag=\"+Flag+\"\\\" \");\r\n out.println(\" return \");\r\n out.println(\" } \");\r\n out.println(\" </SCRIPT> \");\r\n out.println(\" </HEAD> \");\r\n out.println(\" <BODY BACKGROUND=\\\"/ordimg/BACKGR2.GIF\\\" onLoad=\\\"GetBrowser()\\\"> \");\r\n out.println(\" </BODY> \");\r\n out.println(\" </HTML> \");\r\n }", "@Override\n protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n if (Authentication.isAdminInDbByCookies(req)) {\n // Authentication.log(req.getCookies()[0].getValue() + \" - redirect to /admin/registration/registration.html\");\n req.getRequestDispatcher(\"/admin/registration/registration.html\")\n .forward(req, resp);\n\n } else {\n // Authentication.log(req.getCookies()[0].getValue() + \" - redirect to / . Error Authorization.\");\n resp.sendRedirect(\"/\");\n }\n\n }", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\r\n\t\treq.setAttribute(\"message\", \"Bienvenue sur ce site en MVC\");\r\n\t\tRequestDispatcher rq = getServletContext().getRequestDispatcher(\"/WEB-INF/formulaire.jsp\");\r\n\t\trq.forward(req, resp);\r\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\tString forward_page = \"videos/index.jsp\"; // 경로 \n\t\tRequestDispatcher disp = request.getRequestDispatcher(forward_page);\n\t\tdisp.forward(request, response);\n\t}", "@Override\n public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {\n try {\n List<Entity> reviewees = Match.getNotMatchedUsers(\"Reviewee\");\n List<Entity> reviewers = Match.getNotMatchedUsers(\"Reviewer\");\n Match.match(reviewees, reviewers);\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n response.sendRedirect(\"/index.html\");\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String action = request.getParameter(\"action\");\n HttpSession session = request.getSession();\n // Test if there is a user signed in.\n User user = (User) session.getAttribute(\"user\");\n \n String url = \"/login.jsp\";\n \n // If no user go to login\n if (user == null){\n url = \"/login.jsp\";\n action = \"no_user\";\n } else if (action == null) {\n // If user but no action go home\n url = \"/home.jsp\";\n } else if(action.equals(\"get_users\")) { \n ArrayList<User> users;\n users = UserDB.selectUsers();\n session.setAttribute(\"users\", users);\n \n url = \"/home.jsp\";\n }\n \n getServletContext()\n .getRequestDispatcher(url)\n .forward(request, response);\n }", "void redirect();", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n //3.切換畫面(同步GET請求:redirect to /vgb/products_list.jsp | 非同步請求:forward to /cart_total_quantity.jsp)\n response.sendRedirect(\"products_list.jsp\");\n //request.getRequestDispatcher(\"/cart_total_quantity.jsp\").forward(request, response);\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tString string= request.getParameter(\"action\");\n\t\tif(string.equals(\"listingPage\")) {\n\t\t\tlistingPage(request, response);\n\t\t}\n\t\telse if(string.equals(\"viewImage\")) {\n\t\t\t\n\t\t\tviewImage(request, response);\n\t\t}\n\t\telse if(string.equals(\"deleteImage\")) {\n\t\t\tdeleteImage(request, response);\n\t\t}\n\t\telse {\n\t\t\trequest.getRequestDispatcher(\"index.jsp\").forward(request, response);\n\t\t}\n\t}", "public void doGet(HttpServletRequest request,HttpServletResponse response) throws IOException,ServletException{\n\n\t\tString nextPage = \"index.jsp\";\n\t\t\n\t\tString name = request.getParameter(\"name\");\n\t\tString contact = request.getParameter(\"contact\");\n\t\tString password = request.getParameter(\"password\");\n\n\t\t//form validation~~~\n\t\tCafe cafe = new Cafe();\n\n\t\tcafe.setName(name);\n\t\tcafe.setContact(contact);\n\t\tcafe.setPassword(password);\n\n\t\tif(cafe.registerCafe()){\n\t\t\tnextPage = \"login.jsp\";\n\t\t}\n\n\t\trequest.getRequestDispatcher(nextPage).forward(request,response);\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String acceso = \"\";\n String accion = request.getParameter(\"accion\");\n String codigo = request.getParameter(\"codigo\");\n String nombre = request.getParameter(\"nombre\");\n String piezas = request.getParameter(\"piezas\");\n String cantidad = request.getParameter(\"cantidad\");\n String precio = request.getParameter(\"precio\");\n if (accion.equalsIgnoreCase(\"VenderBicicleta\")) {\n request.setAttribute(\"codigo\", codigo);\n request.setAttribute(\"nombre\", nombre);\n request.setAttribute(\"piezas\", piezas);\n request.setAttribute(\"cantidad\", cantidad);\n request.setAttribute(\"precio\", precio);\n acceso = \"Vendedor_Vender.jsp\";\n }\n if(accion.equalsIgnoreCase(\"volver\"))\n {\n BicicletasDAO biciDAO = new BicicletasDAO();\n List<Bicicleta> lista = new ArrayList<>();\n lista = biciDAO.listar();\n request.setAttribute(\"listaBici\", lista);\n acceso = \"Vendedor.jsp\";\n }\n RequestDispatcher v = request.getRequestDispatcher(acceso);\n v.forward(request, response);\n }", "public void doGet(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\r\n\t\t\r\n\t\trequest.getRequestDispatcher(\"/WEB-INF/jsp/account/SignonForm.jsp\").forward(request, response);\r\n\t\t\r\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tfinal String URI = request.getRequestURI().replace(\"/HelloFrontController/\", \"\"); // this is the name of the root project folder\n\t\t\n\t\tswitch(URI) {\n\t\tcase \"login\":\n\t\t\t// call a method from a request helper......\t\n\t\t\tRequestHelper.processLogin(request, response);\n\t\t\tbreak;\n\t\tcase \"employees\":\n\t\t\t// call method show all employees -- this means we'll be querying our DB...\n\t\t\tRequestHelper.processEmployees(request, response);\n\t\t\tbreak;\n\t\tcase \"error\":\n\t\t\tRequestHelper.processError(request, response);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tRequestHelper.processError(request, response);\n\t\t\tbreak;\n\t\t}\n\t\t\n\t}", "@Override\n protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\n req.setAttribute(\"title\", \"Transaction\");\n\n String action = req.getParameter(\"action\");\n action = StringUtils.capitalize(action);\n req.setAttribute(\"action\", action);\n\n page.getPage(\"view/transaction/doTransaction.jsp\", req, resp);\n\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n\r\n //LEER INSTRUCCIÓN QUE LLEGA DESDE JSP \r\n String instruccion = request.getParameter(\"instruccion\");\r\n\r\n //EJECUTAR LOGIN SI LA INSTRUCCIÓN ADD ES NULL\r\n if (instruccion == null) {\r\n instruccion = \"cargalogin\";\r\n }\r\n\r\n System.out.println(\"INSTRUCCION : \" + instruccion);\r\n //SELECTOR DE EJECUCIÓN\r\n\r\n switch (instruccion) {\r\n case \"cargalogin\":\r\n cargaVistaLogin(request, response);\r\n break;\r\n case \"credenciales\":\r\n \r\n System.out.println(\"ENTRA EN INSTRUCCION LOGIN USER\");\r\n {\r\n try {\r\n login(request,response);\r\n } catch (SQLException ex) {\r\n Logger.getLogger(ControllerLogin.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }\r\n break;\r\n default:\r\n cargaVistaLogin(request, response);\r\n }\r\n\r\n if (instruccion == \"loginUser\") {\r\n try {\r\n login(request, response);\r\n } catch (SQLException ex) {\r\n Logger.getLogger(ControllerLogin.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }\r\n\r\n }", "@Override\n\tprotected void doGet( HttpServletRequest req, HttpServletResponse resp ) throws ServletException, IOException {\n\t\t\n this.getServletContext().getRequestDispatcher(linkApp).forward( req,resp);\n\n\t }", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tString s1=request.getParameter(\"email\");\n\t\tString s2=request.getParameter(\"pass\");\n\t\t\n\t\tString str=null;\n\t\t\n\t\tLogin l=new Login();\n\t//\tl.setRno(Integer.parseInt(s1));\n\t\tl.setEmail(s1);\n\t\tl.setPass(s2);\n\t\tDBApplication db=new DBApplication();\n\t\tboolean b=db.validateUser(l);\n\t\tif(b)\n\t\t{\n\t\t\tresponse.sendRedirect(\"welcome.jsp\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tresponse.sendRedirect(\"login.jsp\");\n\t\t}\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\n\t\t//This Attribute holds the Path of the referring page.\n\t\tString referer = request.getHeader(\"referer\");\n\t\t\n\t\t//This If statement uses the referring webpage to distinguish which subsequent action should be executed.\n\t\tif(referer.contains(\"index.jsp\")) {\n\t\t\t\n\t\t\t//referer: index.jsp\n\t\t\t\n\t\t\tif(request.getParameter(\"singleplayer\") != null) {\t\t\t\t\t\t\t\t//The player clicked on the button \"singleplayer\".\n\t\t\t\tresponse.sendRedirect(request.getContextPath() + \"/jsp/playerMenu.jsp\");\t//The player will be redirected to playerMenu.jsp.\n\t\t\t\t\n\t\t\t} else if(request.getParameter(\"multiplayer\") != null) {\t\t\t\t\t\t//The player clicked on the button \"multiplayer\".\n\t\t\t\tresponse.sendRedirect(request.getContextPath() + \"/jsp/Multiplayer.jsp\");\t//The player will be redirected to Multiplayer.jsp.\n\t\t\t\t\n\t\t\t} else if(request.getParameter(\"settings\") != null) {\t\t\t\t\t\t\t//The player clicked on the button \"settings\".\n\t\t\t\tresponse.sendRedirect(request.getContextPath() + \"/jsp/Settings.jsp\");\t\t//The player will be redirected to Settings.jsp.\n\t\t\t\t\n\t\t\t} else {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//This is the default case.\n\t\t\t\tresponse.sendRedirect(request.getContextPath() + \"/jsp/index.jsp\");\t\t\t//The player will be redirected to index.jsp.\n\t\t\t}\n\t\t\t\n\t\t} else if(referer.contains(\"playerMenu.jsp\")) {\n\t\t\t\n\t\t\t//referer: playerMenu.jsp\n\t\t\t\n\t\t\t//The attribute g is set to a new Instance of GameBean when accessing the playerMenu.jsp.\n\t\t\tg = (GameBean) request.getSession().getAttribute(\"g\");\n\t\t\t\n\t\t\t//Checking the request-parameter \"Username\" for the invalid value \"Com\".\n\t\t\tif(request.getParameter(\"Username\").equals(\"AI\")) {\n\t\t\t\tSystem.out.println(\"Your not allowed to name yourself 'AI'.\");\t\t\t\t//Showing the Error on console -------------------------------------------------------------------------------------------------------------------------------\n\t\t\t\tresponse.sendRedirect(request.getContextPath() + \"/jsp/playerMenu.jsp\");\t//if an invalid Username was given, the user will be redirected to the playerMenu.jsp.\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t//Setting the Players name-attribute in the GameBean g according to the chosen team.\n\t\t\t\tif(request.getParameter(\"PlayerColor\").equals(\"Weiß\")) {\n\t\t\t\t\tg.getWhite().setName(request.getParameter(\"Username\"));\n\t\t\t\t\tg.setBlack(new AI(TeamType.BLACK));\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tg.getBlack().setName(request.getParameter(\"Username\"));\n\t\t\t\t\tg.setWhite(new AI(TeamType.WHITE));\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Redirect to the board.jsp if all request-parameters are valid. \n\t\t\t\tresponse.sendRedirect(request.getContextPath() + \"/jsp/board.jsp\");\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\n\t\t} else if(referer.contains(\"board.jsp\")) {\n\t\t\t\n\t\t\t//referer: board.jsp\n\t\t\t\n\t\t\t//The variable player saves the Player-objcet which holds the non-computer-player.\n\t\t\tPlayer player = (g.getBlack().getName().equals(\"AI\")) ? g.getWhite() : g.getBlack();\n\t \n\t\t\t//Processing the request-parameters. This is the information of which turns were made.\n\t //This is the originating position of a figure on the gameboard or in the prison.\n\t\t\tVector2 hitter = new Vector2(letterToXOrdinate(request.getParameter(\"Xh\").charAt(0)), Integer.parseInt(request.getParameter(\"Yh\")));\n\t \n\t\t\t//This is the resulting position on the gameboard.\n\t\t\tVector2 target = new Vector2(letterToXOrdinate(request.getParameter(\"Xt\").charAt(0)), Integer.parseInt(request.getParameter(\"Yt\")));\n\t \n\t\t\t//This Vector shows which figure has to be upgraded or downgraded.\n\t\t\tString x = String.valueOf(request.getParameter(\"Xc\").charAt(0));\n\t\t\tString y = request.getParameter(\"Yc\");\n\t\t\tif((!x.equals(\"\") && !y.equals(\"\")) || (!x.equals(\"Z\") && !y.equals(\"-1\"))) {\n\t\t\t\t\n\t\t\t\tVector2 upgrade = new Vector2(letterToXOrdinate(x.charAt(0)), Integer.parseInt(y));\n\t\t\t\t\n\t\t\t\t//The player wants to upgrade a figure.\n\t\t\t\t//Proove if the figure is in the gameboard (-1 < x,y < 10) and than change type.\n\t\t\t\tif(upgrade.getX() >= 0 && upgrade.getY() >= 0 && upgrade.getX() < 10 && upgrade.getY() < 10) {\n\t\t\t\t\n\t\t\t\t\t//Proove if the figure that is moved belongs to the non-Com-player.\n\t\t\t\t\tif(g.getBoard().getBoard()[upgrade.getX()][upgrade.getY()].getTeam().equals(player.getTeam())) {\n\t\t \t\tg.getBoard().getBoard()[upgrade.getX()][upgrade.getY()].changeType();\n\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\t\n\t\t\t//The player wants to move a figure on the gameboard or from the prison into the gameboard. \n\t\t\t//Prooves if the originating position is in the board.\n\t\t\tif(hitter.getX() >= 0 && hitter.getY() >= 0 && hitter.getX() < 10 && hitter.getY() < 10) {\n\t\t\t\t\n\t\t\t\t//Prooves if there is a valid figure at the chosen position.\n\t\t\t\tif(g.getBoard().getBoard()[hitter.getX()][hitter.getY()] != null) {\n\t\t\t\t\t\n\t\t\t\t\t//Prooves if the hitter-figure belongs to the non-Com-player.\n\t\t\t\t\tif(g.getBoard().getBoard()[hitter.getX()][hitter.getY()].getTeam().equals(player.getTeam())) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Prooves if the targeting position is in the board.\n\t\t\t\t\t\tif(target.getX() >= 0 && target.getY() >= 0 && target.getX() < 10 && target.getY() < 10) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//Prooves if the target-figure doesn't belong to the non-Com-player.\n\t\t\t\t\t\t\tif(g.getBoard().getBoard()[target.getX()][target.getY()] == null || !g.getBoard().getBoard()[target.getX()][target.getY()].getTeam().equals(player.getTeam())) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//Prooves if the target is accessible for the figure on the hitter-position.\n\t\t\t\t\t\t\t//\tif(g.getBoard().getPossibleTurnsFor(hitter).contains(target)) {\n\t\t\t\t \t\t\t\n\t\t\t\t\t\t\t\t\t//Move the figure from target to hitter\n\t\t\t\t \t\t\tg.getBoard().moveOnBoard(hitter, target);\n\t\t\t\t \t\t\t\n\t\t\t\t \t\t\t//Checks if a Team is chackMate \n\t\t\t\t\t \t\tif(g.getBoard().isCheckMate(g.getBlack().getTeam())) {\n\t\t\t\t\t \t\t\t\n\t\t\t\t\t \t\t\t//Checks which player has won.\n\t\t\t\t\t \t\t\tif (g.getBlack().getName() == \"AI\") {\n\t\t\t\t\t\t\t\t\t\t\t//The non-Com-player has won. Redirect to Win.jsp.\n\t\t\t\t\t \t\t\t\tresponse.sendRedirect(request.getContextPath() + \"/jsp/Win.jsp\");\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t//The non-Com-player has lost. Redirect to Lost.jsp.\n\t\t\t\t\t\t\t\t\t\t\tresponse.sendRedirect(request.getContextPath() + \"/jsp/Lose.jsp\");\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t \t\t\t\n\t\t\t\t\t\t\t\t\t} else if(g.getBoard().isCheckMate(g.getWhite().getTeam())) {\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t//Checks which player has won.\n\t\t\t\t\t\t\t\t\t\tif (g.getWhite().getName() == \"AI\") {\n\t\t\t\t\t\t\t\t\t\t\t//The non-Com-player has won. Redirect to Win.jsp.\n\t\t\t\t\t\t\t\t\t\t\tresponse.sendRedirect(request.getContextPath() + \"/jsp/Win.jsp\");\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t//The non-Com-player has lost. Redirect to Lost.jsp.\n\t\t\t\t\t\t\t\t\t\t\tresponse.sendRedirect(request.getContextPath() + \"/jsp/Lose.jsp\");\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\t//If no team is chackMate:\n\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\t//Do a random Move for the Com-player after the non-Com-Player did one.\n\t\t\t\t\t\t\t\t\t\t//Get the Player-object of the Com-player.\n\t\t\t\t\t\t\t\t\t\tPlayer com = (g.getBlack().getName().equals(\"AI\")) ? g.getBlack() : g.getWhite();\n\n\t\t\t\t\t\t\t\t\t\t//Gets a random figure of the Com-players team\n\t\t\t\t\t\t\t\t\t\tArrayList<Vector2> hitters = FigureSelector.selectAliveEnemyTeam(g.getBoard().getBoard(), player.getTeam());\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\thitter = hitters.get(new Random().nextInt(hitters.size() - 1));\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t//Does a random move with the random figure. \n\t\t\t\t\t\t\t\t\t\tg.getBoard().moveOnBoard(hitter, com.getTurn(hitter, g.getBoard()));\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t//Increment the round-counter\n\t\t\t\t\t\t\t\t\t\tg.setRound(1);\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t \t\n\t\t\t\t\t \t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t//\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t//If the originating position is below 0, the absolute amount is the index of the figure in a prison.\t\n \t} else {\n \t\t\n \t\t//Get the given figure from the non-Com-players prison.\n \t\t\n\t\t\t\tint index = 0;\n \t\t\n\t\t\t\tif(hitter.getX() == -1) {\n\t\t\t\t\t\n\t\t\t\t\tif (target.getY() == -1){\n\t\t\t\t\t\tindex = (player.getTeam().equals(TeamType.BLACK)) ? g.getBoard().getBlackPrison().lastIndexOf(Figure.getBishop(TeamType.BLACK)) : g.getBoard().getWhitePrison().lastIndexOf(Figure.getBishop(TeamType.WHITE));\n\t\t\t \t} else if(target.getY() == -2){\n\t\t\t \t\tindex = (player.getTeam().equals(TeamType.BLACK)) ? g.getBoard().getBlackPrison().lastIndexOf(Figure.getTower(TeamType.BLACK)) : g.getBoard().getWhitePrison().lastIndexOf(Figure.getTower(TeamType.WHITE));\n\t\t\t \t} else if(target.getY() == -3){\n\t\t\t \t\tindex = (player.getTeam().equals(TeamType.BLACK)) ? g.getBoard().getBlackPrison().lastIndexOf(Figure.getGoldenGeneral(TeamType.BLACK)) : g.getBoard().getWhitePrison().lastIndexOf(Figure.getGoldenGeneral(TeamType.WHITE));\n\t\t\t \t} else if(target.getY() == -4){\n\t\t\t \t\tindex = (player.getTeam().equals(TeamType.BLACK)) ? g.getBoard().getBlackPrison().lastIndexOf(Figure.getSilverGeneral(TeamType.BLACK)) : g.getBoard().getWhitePrison().lastIndexOf(Figure.getSilverGeneral(TeamType.WHITE));\n\t\t\t \t} else if(target.getY() == -5){\n\t\t\t \t\tindex = (player.getTeam().equals(TeamType.BLACK)) ? g.getBoard().getBlackPrison().lastIndexOf(Figure.getKnight(TeamType.BLACK)) : g.getBoard().getWhitePrison().lastIndexOf(Figure.getKnight(TeamType.WHITE));\n\t\t\t \t} else if(target.getY() == -6){\n\t\t\t \t\tindex = (player.getTeam().equals(TeamType.BLACK)) ? g.getBoard().getBlackPrison().lastIndexOf(Figure.getPawn(TeamType.BLACK)) : g.getBoard().getWhitePrison().lastIndexOf(Figure.getPawn(TeamType.WHITE));\n\t\t\t \t} else if(target.getY() == -7){\n\t\t\t \t\tindex = (player.getTeam().equals(TeamType.BLACK)) ? g.getBoard().getBlackPrison().lastIndexOf(Figure.getLance(TeamType.BLACK)) : g.getBoard().getWhitePrison().lastIndexOf(Figure.getLance(TeamType.WHITE));\n\t\t\t \t} \n\n\t\t\t\t\tFigure f = null;\n\t\t\t\t\tif(player.getTeam().equals(TeamType.BLACK)) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(g.getBoard().getBlackPrison().size() > 0) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tf = g.getBoard().getBlackPrison().get(index);\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} else {\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(g.getBoard().getWhitePrison().size() > 0) {\n\t\t\t\t\t\n\t\t\t\t\t\t\tf = g.getBoard().getWhitePrison().get(index);\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}\n\t\t\t\t\t\n\t\t\t\t\tif(f != null) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Prooves if the given traget is on the gameboard.\n\t\t\t\t\t\tif(target.getX() >= 0 && target.getY() >= 0 && target.getX() < 10 && target.getY() < 10) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//Prooves if the given target has no figure on it.\n\t\t\t\t\t\t\tif(g.getBoard().getBoard()[target.getX()][target.getY()].getType().equals(FigureType.UNDEFINED)) {\n\t\t\t \t\t\t\n\t\t\t\t\t\t\t\t//Prooves if the move would directly check the Com-Player\n\t\t\t\t\t\t\t\tif(!g.getBoard().causesCheck(target, f)) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//Place the figure on the target.\n\t\t\t\t\t\t\t\t\tg.getBoard().getBoard()[target.getX()][target.getY()] = f;\n\t\t\t\t \t\t\t\n\t\t\t\t\t\t\t\t\t//Increment the round-counter\n\t\t\t\t \t\t\tg.setRound(1);\n\t\t\t\t \t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t \t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n \t}\n\t\t\t\n\t\t\t//Redirect to the board.jsp.\n\t\t\tresponse.sendRedirect(request.getContextPath() + \"/jsp/board.jsp\");\n\t\t\t\n\t\t} else if(referer.contains(\"Win.jsp\") | referer.contains(\"Lose.jsp\")) {\n\t\t\t\n\t\t\t//referer: Win.jsp or Lose.jsp\n\t\t\t\n\t\t\tif(request.getParameter(\"playAgain\") != null) {\t\t\t\t\t\t\t\t\t//The Player pressed the button \"playAgain\".\t\n\t\t\t\tresponse.sendRedirect(request.getContextPath() + \"/jsp/playerMenu.jsp\");\t//The player will be redirected to playerMenu.jsp.\n\t\t\t\t\n\t\t\t} if(request.getParameter(\"startPage\") != null) {\t\t\t\t\t\t\t\t//The Player pressed the button \"startpage\".\n\t\t\t\tresponse.sendRedirect(request.getContextPath() + \"/jsp/index.jsp\");\t\t\t//The player will be redirected to index.jsp.\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n String ua = request.getHeader(\"User-Agent\");\r\n\r\n // prepare the appropriate DOCTYPE for the view pages\r\n if (ua != null && ((ua.indexOf(\"Android\") != -1) || (ua.indexOf(\"iPhone\") != -1))) {\r\n /*\r\n * This is the latest XHTML Mobile doctype. To see the difference it\r\n * makes, comment it out so that a default desktop doctype is used\r\n * and view on an Android or iPhone.\r\n */\r\n request.setAttribute(\"doctype\", \"<!DOCTYPE html PUBLIC \\\"-//WAPFORUM//DTD XHTML Mobile 1.2//EN\\\" \\\"http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd\\\">\");\r\n } else {\r\n request.setAttribute(\"doctype\", \"<!DOCTYPE HTML PUBLIC \\\"-//W3C//DTD HTML 4.01 Transitional//EN\\\" \\\"http://www.w3.org/TR/html4/loose.dtd\\\">\");\r\n }\r\n\r\n System.out.println(\"Now running server\");\r\n String url = model.getRandomUrl();\r\n System.out.println(\"URL IS \" + url);\r\n request.setAttribute(\"surveyUrl\", url);\r\n RequestDispatcher view = request.getRequestDispatcher(\"survey.jsp\");\r\n view.forward(request, response);\r\n }", "void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException;", "@Override\r\n\tpublic void doGet(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n Map<String, String> messages = new HashMap<String, String>();\r\n req.setAttribute(\"messages\", messages);\r\n\r\n List<SingleFamilyHouse> singlefamilyhouses = new ArrayList<SingleFamilyHouse>();\r\n \r\n // Retrieve and validate name.\r\n // firstname is retrieved from the URL query string.\r\n String city = req.getParameter(\"city\");\r\n if (city == null || city.trim().isEmpty()) {\r\n messages.put(\"success\", \"Please enter a valid city.\");\r\n } else {\r\n \t// Retrieve BlogUsers, and store as a message.\r\n \ttry {\r\n \t\tsinglefamilyhouses = singleFamilyHouseDao.getSingleFamliyHouseFromCity(city);\r\n } catch (SQLException e) {\r\n \t\t\te.printStackTrace();\r\n \t\t\tthrow new IOException(e);\r\n }\r\n \tmessages.put(\"success\", \"Displaying results for \" + city);\r\n \t// Save the previous search term, so it can be used as the default\r\n \t// in the input box when rendering FindUsers.jsp.\r\n \tmessages.put(\"previousCity\", city);\r\n }\r\n req.setAttribute(\"singleFamilyHouses\", singlefamilyhouses);\r\n \r\n req.getRequestDispatcher(\"/FindSingleFamilyHouses.jsp\").forward(req, resp);\r\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n String pageTitle = \"News feed\";\n switch (request.getServletPath()) {\n case \"/archivenews\": {\n pageTitle = \"Archive news feed\";\n break;\n }\n case \"/login\": {\n pageTitle = \"Login\";\n break;\n }\n case \"/registration\": {\n pageTitle = \"Registration user\";\n break;\n }\n case \"/listuser\": {\n pageTitle = \"List of registered users\";\n break;\n }\n }\n\n request.setAttribute(\"pagetitle\", pageTitle);\n\n// if (request.getServletPath().isEmpty()) {\n // Make page with template\n RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(\"/WEB-INF/main.jsp\");\n dispatcher.forward(request,response);\n\n// response.sendRedirect(\"/news\");\n// }\n }", "public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tString search = req.getParameter(\"searchBook\");\n\t\tString output=search;\n\n\t\t//redirect output to view search.jsp\n\t\treq.setAttribute(\"output\", output);\n\t\tresp.setContentType(\"text/json\");\n\t\tRequestDispatcher view = req.getRequestDispatcher(\"search.jsp\");\n\t\tview.forward(req, resp);\n\t\t\t\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n request.setAttribute(\"p\", new CartViewModel(request));\n String userPath = \"/cart\";\n forwardToJsp(request, response, userPath);\n }", "public void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\t\tString username = request.getParameter(\"username\");\n\t\tString password = request.getParameter(\"password\");\n\t\tDatabaseManager dbm = new DatabaseManager();\n\t\tString admin = request.getParameter(\"admin?\");\n\t\tif (admin == null) {\n\t\t\tNormaluser user = dbm.normaluserLogin(username, password);\n\t\t\tif (user == null) {\n\t\t\t\tString url=\"index.jsp\";\n\t\t\t\turl=new String(url.getBytes(\"GBK\"),\"ISO8859_1\"); \n\t\t\t\tresponse.sendRedirect(url);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tCollection<OrderedDish> cart = new ArrayList<OrderedDish>();\n\t\t\t\trequest.getSession().setAttribute(\"cart\", cart);\n\t\t\t\trequest.getSession().setAttribute(\"user\", user);\n\t\t\t\trequest.getSession().setAttribute(\"type\", 1);\n\t\t\t\tString url=\"homePage.jsp\";\n\t\t\t\turl=new String(url.getBytes(\"GBK\"),\"ISO8859_1\"); \n\t\t\t\tresponse.sendRedirect(url); \n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tAdministrator administrator = dbm.adminLogin(username, password);\n\t\t\tif (administrator == null) {\n\t\t\t\tString url=\"index.jsp\";\n\t\t\t\turl=new String(url.getBytes(\"GBK\"),\"ISO8859_1\"); \n\t\t\t\tresponse.sendRedirect(url);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tCollection<OrderedDish> cart = new ArrayList<OrderedDish>();\n\t\t\t\trequest.getSession().setAttribute(\"admin\", administrator);\n\t\t\t\trequest.getSession().setAttribute(\"type\", 2);\n\t\t\t\tString url=\"homePage.jsp\";\n\t\t\t\turl=new String(url.getBytes(\"GBK\"),\"ISO8859_1\"); \n\t\t\t\tresponse.sendRedirect(url); \n\t\t\t}\n\t\t}\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n request.getRequestDispatcher(\"LoginForm.jsp\").forward(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n req.getRequestDispatcher(\"/WEB-INF/pages/updateCharacter.jsp\").forward(req, resp);\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tString go=\"\";//포워드할 파일명 저장할 변수\n\t\tString num=request.getParameter(\"num\");\n\t\tString pass=request.getParameter(\"pass\");\n\t\tString pageNum=request.getParameter(\"pageNum\");\n\t\t\n\t\t//비번이 맞으면 삭제하고 보던 페이지로 이동\n\t\t//틀리면 passfail로 포워드\n\t\tGuestDao dao=new GuestDao();\n\t\tint n=dao.isCheckPass(num, pass);\n\t\tif(n==1) {//비번이 맞는 경우\n\t\t\t//num에 해당하는 dto를 가져온다\n\t\t\tdao.deleteGuest(num);\n\n\t\t\tgo=\"list?pageNum=\"+pageNum;\n\t\t}else {\n\t\t\tgo=\"passfail.jsp\";\n\t\t\t\n\t\t}\n\t\t//포워드\n\t\tRequestDispatcher rd=request.getRequestDispatcher(go);\n\t\trd.forward(request, response);\n\t}", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n Short studentID = Short.parseShort(request.getParameter(\"studentID\"));\r\n String stduentName = request.getParameter(\"studentName\");\r\n Double scholarship = Double.parseDouble(request.getParameter(\"scholarship\"));\r\n \r\n if(P2T5WebAppWebServiceClientProjectModel.createStudent(studentID, stduentName, scholarship)){\r\n request.setAttribute(\"result\", \"Student record is created.\");\r\n } else {\r\n request.setAttribute(\"result\", \"Fail to create student record\");\r\n }\r\n \r\n RequestDispatcher view = request.getRequestDispatcher(\"index.jsp\");\r\n view.forward(request, response);\r\n }", "public void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\tHttpSession session = request.getSession();\n\t\tif(\"exit\".equals(request.getParameter(\"method\"))){\n\t\t\tsession.invalidate();\n\t\t\t //session.setAttribute(\"username\", null);\n\t\t\t //session.setAttribute(\"password\", null);\n\t\t\t response.sendRedirect(\"Home/HomePage.jsp\");\n\t\t}else if(\"jump\".equals(request.getParameter(\"method\"))){\n\t\t\tif(session.getAttribute(\"username\")==null){\n\t\t\t\tresponse.sendRedirect(\"jsp/Login.jsp\");\n\t\t\t}else{\n\t\t\t\tresponse.sendRedirect(\"jsp/DaoHangHome.jsp\");\n\t\t\t}\n\t\t\t\t\n\t\t}else if(\"drawpic\".equals(request.getParameter(\"method\"))){\n\t\t\tthis.randCode(request, response);\n\t\t}\n\t\t\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tresponse.getWriter().append(\"Served at: \").append(request.getContextPath());\r\n//\t\tgetServletContext().getRequestDispatcher(\".jsp\").forward(request, response);\r\n//\t\tresponse.sendRedirect(\"index.jsp\");\r\n//\t\tresponse.getOutputStream().write(\"<p>hello, world</p>\".getBytes());\r\n//\t\tresponse.\r\n\t\tresponse.getWriter().append(\"username:\" + request.getParameter(\"username\"));\r\n\t\tresponse.getWriter().append(\"password:\" + request.getParameter(\"password\"));\r\n\r\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\r\n\t}", "@RequestMapping(value = \"/*/landingPage.do\", method = RequestMethod.GET)\n public String landingPageView(HttpServletRequest request, Model model) {\n logger.debug(\"SMNLOG:Landing page controller\");\n\n\n return \"admin/landingPage\";\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n this.getServletContext().getRequestDispatcher(\"/WEB-INF/signup.jsp\").forward(request, response);\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\t\n\t\tString valor = req.getParameter(\"action\");\n\t\tString destino = \"index.jsp\";\n\t\t\n\t\tList<GrupoDTO> lgt = ControladorGrupos.getInstancia().getGrupos();\n\t\treq.setAttribute(\"listgrupo\", lgt);\n\t\tdestino = \"VerGrupos.jsp\";\n\t\t\n\t\tRequestDispatcher rd = req.getRequestDispatcher(destino);\n\t\trd.forward(req, resp);\t\t\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\n\t\trequest.setAttribute(\"landen\", landService.findAll());\r\n\r\n\t\t// zoek soortid in parameter\r\n\t\tif (request.getParameter(\"id\") != null) {\r\n\t\t\ttry {\r\n\t\t\t\t\r\n\t\t\t\t// lees Soort en Land uit DB\r\n\t\t\t\tlong soortId = Long.parseLong(request.getParameter(\"id\"));\r\n\t\t\t\tSoort soort = soortService.read(soortId);\r\n\t\t\t\tif (soort != null) {\r\n\t\t\t\t\tLand land = soort.getLand();\r\n\t\t\t\t\trequest.setAttribute(\"soort\", soort);\r\n\t\t\t\t\trequest.setAttribute(\"land\", land);\r\n\r\n\t\t\t\t\t// lees alle Soorten huidig Land uit DB\r\n\t\t\t\t\trequest.setAttribute(\"soorten\", soortService.findPerLand(land));\r\n\r\n\t\t\t\t\t// lees Wijnen per Soort uit DB\r\n\t\t\t\t\trequest.setAttribute(\"wijnen\", wijnService.findPerSoort(soort));\r\n\t\t\t\t}else{\r\n\t\t\t\t\trequest.setAttribute(\"fout\", \"Geen soort gevonden voor id \" + soortId);\r\n\t\t\t\t}\r\n\r\n\t\t\t} catch (NumberFormatException ex) {\r\n\t\t\t\trequest.setAttribute(\"fout\", \"Soort id bestaat uit cijfers\");\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\trequest.setAttribute(\"fout\", \"Geen soort geselecteerd\");\r\n\t\t}\r\n\r\n\t\t// -->\r\n\t\trequest.getRequestDispatcher(VIEW).forward(request, response);\r\n\t}", "@Override\n protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n CustomerBean websiteBean = new CustomerBean();\n req.getSession().setAttribute(WEBSITE_BEAN, websiteBean);\n req.getRequestDispatcher(\"WEB-INF/pages/FirstPage.jsp\").forward(req, resp);\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n request.getSession().invalidate(); // destroy session\n\n response.sendRedirect(request.getContextPath() + \"/index.jsp\");\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tString idString = req.getParameter(\"id\");\n\t\tint id = Integer.parseInt(idString);\n\t\t\n\t\t//RECUPERER LA LISTE DES CARTES (DU SCOPE APPLICATION)\n\t\tList<Carte> cartes = (List<Carte>)this.getServletContext().getAttribute(\"cartes\");\n\t\t\n\t\t//SUPPRIMER LA CARTE DONT L'ID ==\n\t\tcartes.removeIf(c -> c.getId() == id);\n\t\t\n\t\t//REDIRIGER VERS LA LISTE\n\t\tresp.sendRedirect(\"liste\");\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\treq.getRequestDispatcher(\"/views/form.jsp\").forward(req, resp);\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tint i = request.getRequestURI().lastIndexOf(\"/\") + 1;\n\t\tString action = request.getRequestURI().substring(i);\n\t\tSystem.out.println(action);\n\t\t\n\t\tString view = \"Error\";\n\t\tObject model = \"service Non disponible\";\n\t\t\n\t\tif (action.equals(\"ProductsList\")) {\n\t\t\tview = productAction.productsList();\n\t\t\tmodel = productAction.getProducts();\n\t\t}\n\t\t\n\t\trequest.setAttribute(\"model\", model);\n\t\trequest.getRequestDispatcher(prefix + view + suffix).forward(request, response); \n\t}", "private void back_home(HttpServletRequest request, HttpServletResponse response) throws IOException {\n\t\tresponse.sendRedirect(\"restaurant\");\n\t\treturn;\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n loadUsersIntoRequest(request);\n loadStoriesIntoRequest(request);\n RequestDispatcher dispatcher = request.getRequestDispatcher(\"/viewaddgame.jsp\");\n dispatcher.forward(request, response);\n }", "@Override\n public void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n String nome=request.getParameter(\"Nome\");\n String cognome=request.getParameter(\"Cognome\");\n try (PrintWriter out = response.getWriter()) {\n out.println(\"<body>\");\n out.println(\"<h1>Pagina creata da chiamata GET</h1>\");\n out.println(\"Il tuo nome è:\"+nome+\"<br/>\");\n out.println(\"Il tuo cognome è:\"+cognome+\"<br/>\");\n if(\"Nicola\".equals(nome) && \"Iacovelli\".equals(cognome)){\n out.println(\"<b>Sei il mio creatore</b><br/>\");\n out.println(\"<b>Grazie per avermi creato</b>\");\n }\n else{\n out.println(\"<b>Esci da questa pagina!</b><br/>Non sei il mio creatore\");\n }\n out.println(\"</body>\");\n out.println(\"</html>\");\n }\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t Person person=new Person();\r\n \t person.setName(\"Rohit\");\r\n\t person.setAge(24);\r\n\t Dog dog=new Dog();\r\n\t dog.setName(\"Tommy\"); \r\n\t person.setDog(dog);\r\n\t request.setAttribute(\"persondetail\",person);\r\n\t RequestDispatcher rd=request.getRequestDispatcher(\"index.jsp\");\r\n\t rd.forward(request,response);\r\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tRequestDispatcher requestDispatcher = request.getRequestDispatcher(\"video.jsp\");\n\t\t \n\t\trequestDispatcher.forward(request, response);\n\t}", "@Override\r\n protected void doGet(HttpServletRequest request,\r\n HttpServletResponse response) throws ServletException, IOException {\r\n\r\n String path = request.getPathInfo();\r\n Map<String, Object> data = getDefaultData();\r\n Writer writer = response.getWriter();\r\n\r\n if (path == null) {\r\n throw new IOException(\"The associated path information is null\");\r\n }\r\n\r\n if (path.equals(\"/\")) {\r\n processTemplate(MAIN_SITE, data, writer);\r\n } else if (path.equals(\"/login\")) {\r\n processTemplate(LOGIN_SITE, data, writer);\r\n } else if (path.startsWith(\"/login/error\")) {\r\n data.put(\"hasLoginFailed\", true);\r\n AppServlet.processTemplate(LOGIN_SITE, data, response.getWriter());\r\n } else if (path.equals(\"/logout\")) {\r\n request.getSession().invalidate();\r\n response.sendRedirect(\"/login\");\r\n } else if (path.equals(\"/signup\")) {\r\n processTemplate(SIGNUP_SITE, data, response.getWriter());\r\n } else {\r\n processTemplate(NOT_FOUND_SITE, data, writer);\r\n }\r\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String pageId = request.getParameter(\"pageid\");\n\n // return the pageId if number or return 0\n long id = pageId != null && Helper.isNumber(pageId) ? Long.parseLong(pageId) : 0;\n\n if (id != 0) {\n // get categoryItems with dessending order\n List<Item> categoryItems = new CategoryDaoImpl(getServletContext()).getCategoryItems(id, \"DESC\");\n\n // set categoryItems to request\n request.setAttribute(\"categoryItems\", categoryItems);\n\n // forword request to show category items page\n Helper.forwardRequest(request, response, ViewPath.show_category);\n } else {\n Helper.redriectToPrevPage(request, response, \"You Must Add Page ID\", true);\n }\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tint sId=Integer.parseInt(req.getParameter(\"sId\"));\n\t\tCandiDao dao=new CandiDao();\n\t\tCandiDto bean=dao.CandiDetail(sId);\n\t\treq.setAttribute(\"bean\", bean);\t\t\n\t\t\n\t\t\n\t\t\n\t\treq.getRequestDispatcher(\"candidetail.jsp\").forward(req, resp);\n\t\t\n\t\t\n\t}", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n TownServiceImpl townServ = new TownServiceImpl();\r\n request.setAttribute(\"townList\", townServ.getAll());\r\n Merchant actMerchant = (Merchant) request.getSession().getAttribute(\"merchant\");\r\n if (request.getAttribute(\"userinput\") == null) {\r\n request.setAttribute(\"userinput\", actMerchant);\r\n }\r\n getServletContext().getRequestDispatcher(\"/mreg.jsp\").include(request, response);\r\n }", "protected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tcontact.forward(req, resp);\n\n\t}", "public void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\tSucursalRepository repository = (SucursalRepository) context.getBean(\"sucursalRepository\");\n\t\ttry {\n\t\t\tString telefono = request.getParameter(\"telefono\");\n\t\t\tString ciudad = request.getParameter(\"ciudad\");\n\t\t\tString direccion = request.getParameter(\"direccion\");\n\t\t\tString encargado = request.getParameter(\"encargado\");\n\n\t\t\tRandom generator = new Random();\n\t\t\tint id = -1;\n\t\t\twhile (id <= 0) {\n\t\t\t\tid = generator.nextInt();\n\t\t\t}\n\t\t\tString codSucursal = id + \"\";\n\n\t\t\tSucursal obj = new Sucursal(codSucursal, telefono, ciudad, direccion, encargado);\n\t\t\trepository.insertSucursal(obj);\n\t\t\tresponse.sendRedirect(\"listaSucursales\");\n\t\t} catch (Exception e) {\n\t\t\trequest.setAttribute(\"mensaje\", e.getMessage());\n\t\t\tforward(\"/paginaError.jsp\", request, response);\n\t\t}\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n metGet(request, response);\n }", "protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tLong id = Long.parseLong(req.getParameter(\"making_friend_id\"));\n\t\tMakingFriend makingFriend = ObjectifyService.ofy().load().type(MakingFriend.class).id(id).now();\n\t\tmakingFriend.setStatus(\"1\");\n\t\tObjectifyService.ofy().save().entity(makingFriend);\n\t\tresp.sendRedirect(\"list_friend_sending_request.jsp\");\n\t}", "@Override\n public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {\n String referer = (String) request.getSession().getAttribute(\"Referer\");\n String redirectTo = referer != null ? referer : \"/\";\n\n LOGGER.info(\"Access token: {}. Redirecting to: {}\", context.getAccessToken(), referer);\n response.sendRedirect(redirectTo);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String pagina = \"\";\n \n if(request.getSession().getAttribute(\"usuario\") != null) {\n \n if(request.getParameter(\"pedido_id\") != null){\n int pedido_id = Integer.parseInt(request.getParameter(\"pedido_id\"));\n usuarioDAO i_s = new usuarioDAO();\n \n try {\n proveedores = i_s.obtenerProveedores();\n } catch (Exception ex) {}\n \n request.setAttribute(\"proveedores\", proveedores);\n request.getSession().setAttribute(\"pedido_id\", pedido_id);\n pagina=\"/cotizacion/crearCotizacion.jsp\";\n } else {\n cotizacionDAO i_s = new cotizacionDAO();\n ArrayList<cotizacionBean> cotizaciones = i_s.listado();\n request.setAttribute(\"cotizaciones\", cotizaciones);\n pagina=\"/cotizacion/listaCotizacion.jsp\";\n }\n \n } else {\n pagina=\"/login.jsp\";\n request.setAttribute(\"mensaje\",\"Necesitas iniciar sesión!\");\n }\n \n getServletContext().getRequestDispatcher(pagina).forward(request, response);\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n RequestDispatcher view = request.getRequestDispatcher(\"/board/boardLogin.jsp\");\n Cookie[] cookies = request.getCookies();\n String userId=null;\n for(int i = 0; i< cookies.length;i++){\n Cookie cookie = cookies[i];\n if(cookie.getName().equals(\"userId\")){\n userId = cookie.getValue();\n break;\n }\n }\n if(request.getServletContext().getAttribute(\"connect\")==null){\n request.getServletContext().setAttribute(\"connect\",new Integer(0));\n }\n\n// int a[]={1,2,3,4,7,8,11,12,16,19,20,22,24,34,40,41};\n//\n// for(int j=0 ; j< a.length;j++){\n// if(Math.random()*10+1>5){\n// System.out.println(a[j]);\n// }\n//\n// }\n\n int connect = (Integer)request.getServletContext().getAttribute(\"connect\");\n\n request.getServletContext().setAttribute(\"connect\",new Integer(connect));\n\n request.setAttribute(\"userId\",userId);\n\n request.setAttribute(\"connect\",new Integer(connect));\n view.forward(request, response);\n\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\tresponse.getWriter().append(\"Served at: \").append(request.getContextPath());\n\t\tString a = request.getParameter(\"a\");\n\t\tif (a.equals(\"1\")) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tresponse.getWriter().append(\"Served at: \").append(request.getContextPath());\n\t\t}\n\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n System.out.println(\"Console: doGET visited\");\n String result = \"\";\n //get the user choice from the client\n String choice = (request.getPathInfo()).substring(1);\n response.setContentType(\"text/plain;charset=UTF-8\");\n PrintWriter out = response.getWriter();\n //methods call appropriate to user calls\n if (Integer.valueOf(choice) == 3) {\n result = theBlockChain.toString();\n if (result != null) {\n out.println(result);\n response.setStatus(200);\n //set status if result output is not generated\n } else {\n response.setStatus(401);\n return;\n }\n }\n //verify chain method\n if (Integer.valueOf(choice) == 2) {\n response.setStatus(200);\n boolean validity = theBlockChain.isChainValid();\n out.print(\"verifying:\\nchain verification: \");\n out.println(validity);\n }\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException \n {\n String act = request.getParameter(\"act\");\n \n if (act!=null && act.equalsIgnoreCase(\"doAddTransaction\")){// show page with form to obtain client name\n doPost(request, response);\n }else{// put client name into a bean\n RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(\"/addtransaction.jsp\");\n dispatcher.forward(request, response);\n }\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n \r\n }", "public void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\t request.setCharacterEncoding(\"utf-8\");\n\t String id=request.getParameter(\"id\");\n\t String sql= \"delete from student where id = '\"+ id+\"'\";\n\t int i=DBUtil.update(sql);\n\t\t if(i==1){\n\t\t response.sendRedirect(\"student\");\n\t\t }\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\ttry {\n\t\tHttpSession session = req.getSession(false);\n\t\tif(session == null)\n\t\t{\n\t\t\tlogger.info(\"Session expired when user clicked on products link from admin page\");\n\t\t\tRequestDispatcher rd = req.getRequestDispatcher(\"adminlogout/sessionexp_logout.jsp\");\n\t\t\trd.include(req, resp);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tresp.setHeader(\"resultfor\", \"configure\");\n\t\t\tRequestDispatcher rd = req.getRequestDispatcher(\"jsps/products.jsp\");\n\t\t\trd.include(req, resp);\n\t\t}\n\t\t\n\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tlogger.error(\"Exception in ProductViewhandler\",e);\n\t\t}\n\t}", "@Override\n protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n resp.setContentType(\"text/html;charset=UTF-8\");\n req.getRequestDispatcher(\"/jsp/produtos/index.jsp\").include(req, resp);\n \n }" ]
[ "0.7293525", "0.7113184", "0.70022213", "0.6956663", "0.6901544", "0.68391484", "0.68377465", "0.682058", "0.67470783", "0.67349535", "0.6713103", "0.6711735", "0.6703569", "0.6693849", "0.6672759", "0.6656287", "0.6642871", "0.6596304", "0.6593717", "0.65925854", "0.6590691", "0.658986", "0.6581814", "0.6576563", "0.65616864", "0.65464985", "0.6540045", "0.65288585", "0.6506956", "0.6497989", "0.6484021", "0.64715916", "0.6467088", "0.6448446", "0.6433078", "0.64244336", "0.6407795", "0.6407217", "0.6404128", "0.6404127", "0.6386451", "0.6385798", "0.63707066", "0.6364705", "0.6354484", "0.634195", "0.6336868", "0.6333974", "0.6333445", "0.63282424", "0.630288", "0.62987053", "0.62923163", "0.6290661", "0.62680537", "0.6249404", "0.62487376", "0.6247244", "0.62421936", "0.623917", "0.6238962", "0.623721", "0.6227781", "0.62251055", "0.6216611", "0.6214464", "0.6214382", "0.62130475", "0.6211172", "0.6210644", "0.62051654", "0.6202243", "0.6192545", "0.6184074", "0.6181619", "0.6179096", "0.61787844", "0.61736923", "0.617281", "0.6172797", "0.6168096", "0.6167585", "0.61632705", "0.61612344", "0.6154839", "0.6145851", "0.61441183", "0.6143351", "0.6140524", "0.6133701", "0.61333853", "0.61295927", "0.6121152", "0.61206543", "0.6119777", "0.6118025", "0.6112634", "0.61113495", "0.61089253", "0.61082935" ]
0.6587136
22
To set up the animal class copied from gameLv1
@Before public void setUp() throws Exception { coordinateArea Area1 = new coordinateArea(0,150,600,413); waterArea waterDeath = new waterArea(Area1); coordinateArea Border = new coordinateArea(0,100,600,734); animal = new Animal("file:src/p4_group_8_repo/Assets/froggerUp.png",waterDeath,300,679.8,Border); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void constructor() {\n setEdibleAnimals();\n }", "public Animal(String name) {\r\n this.animalName = name;\r\n }", "AnimalSpecific(String category,String name,String type){\n\t\tsuper(category);\n\t\tanimalName = name;\n\t\tanimalType = type;\n\t}", "public static void main(String[] args) {\n Animal myAnimal = new Animal();\n myAnimal.animalSound();\n\n myAnimal = new Dog();\n myAnimal.animalSound();\n\n myAnimal = new Cat();\n myAnimal.animalSound();\n\n }", "public void createAnimals() {\n\t\tanimals = new Animal[noAnimals];\n\n\t\tfor (int i = 0; i < noAnimals; i++) {\n\t\t\tanimals[i] = new Animal(noAnimals);\n\t\t\tanimals[i].setDiffCo(diffCo[i]);\n\t\t\tanimals[i].setDiffusionRate(diffusionRate[i]);\n animals[i].initiateDensities(getIo().getNeighbours().length,getIo().getNeighbours()[0].length);\n\t\t}\n\t\n\t\t animals[0].setName(\"Hare\"); \n\t\t animals[1].setName(\"Puma\");\n\t}", "protected Animal() {\t\r\n\t}", "public Animal(){\n System.out.println(\"An animal has been created...\");\n }", "private void seeAnimal() {\n\r\n\t}", "public static void main(String[] args) {\n AnimalBp turtle = new AnimalBp(); \n AnimalBp dog = new AnimalBp();\n AnimalBp cat = new AnimalBp();\n \n \n \n turtle .setType(\"Reptile\");\n String turtleType = turtle.getType();\n \n \n System.out.println(turtleType);\n \n turtle.setnumberOfFeet(4);\n int turtlenumberOfFeet = turtle.getnumberOfFeet();\n \n System.out.println(turtlenumberOfFeet);\n \n turtle.setColor(\"Green\");\n String turtleColor = turtle.getColor();\n \n System.out.println(turtleColor);\n \n turtle.setlaysAnEgg(true);\n boolean turtlelaysAnEgg = turtle.getLaysAnEgg();\n \n System.out.println(turtlelaysAnEgg);\n \n \n dog .setType(\"Mammal\");\n String dogType = dog.getType();\n \n System.out.println(dogType);\n \n dog.setnumberOfFeet(4);\n int dognumberOfFeet = dog.getnumberOfFeet();\n \n System.out.println(dognumberOfFeet);\n \n dog.setColor(\"Brown and White\");\n String dogColor = dog.getColor();\n \n System.out.println(dogColor);\n \n dog.setlaysAnEgg(false);\n boolean doglaysAnEgg = dog.getLaysAnEgg();\n \n System.out.println(doglaysAnEgg);\n \n cat .setType(\"Mammal\");\n String catType = cat.getType();\n \n \n System.out.println(catType);\n \n cat.setnumberOfFeet(4);\n int catnumberOfFeet = cat.getnumberOfFeet();\n \n System.out.println(catnumberOfFeet);\n \n cat.setColor(\"gray\");\n String catColor = cat.getColor();\n \n System.out.println(catColor);\n \n cat.setlaysAnEgg(false);\n boolean catlaysAnEgg = cat.getLaysAnEgg();\n \n System.out.println(catlaysAnEgg);\n }", "public Animal()\n {\n MOVE_RIGHT = 0;\n MOVE_LEFT = 0;\n MOVE_UP = 0;\n MOVE_DOWN = 0;\n }", "public Dog(String Breed, String PrimaryColor, String Size, String name, int age){\r\n // setting the parent animal name\r\n super(name,age);\r\n // setting the parent animal age\r\n // System.out.println(\"Setting Breed...\");\r\n this.Breed = Breed ;\r\n // System.out.println(\"Setting PrimaryColor...\");\r\n this.PrimaryColor = PrimaryColor;\r\n //System.out.println(\"Setting Size...\");\r\n this.Size = Size;\r\n\r\n\r\n\r\n }", "public void addAnimals() throws IOException {\n\t\tint b = 0;\n\t\tint c = 0;\n\t\tint a = 0;\n\t\tArrayList<GameObjects> animals = new ArrayList<GameObjects>();\n\t\tRandom rand = new Random();\n\t\twhile(b<bigFish) {\n\t\t\tanimals.add(new BigFish(frameWidth, frameHeight, (int)(frameWidth/6 + rand.nextInt((int)(frameWidth/2))), (int)(frameHeight/4 + frameHeight/10 + rand.nextInt((int)(frameHeight - frameHeight/2)))));\n\t\t\tb+=1;\n\t\t}\n\t\twhile(c<crab) {\n\t\t\tanimals.add(new Crab(frameWidth, frameHeight, (int)(frameWidth/6 + rand.nextInt((int)(frameWidth - frameWidth/3))), (int)(frameHeight/4 + frameHeight/10 + rand.nextInt((int)(frameHeight - frameHeight/2)))));\n\t\t\tc+=1;\n\t\t}\n\t\twhile(a<algae) {\n\t\t\tanimals.add(new Algae(frameWidth, frameHeight, (int)(frameWidth/6 + rand.nextInt((int)(frameWidth - frameWidth/3))), (int)(frameHeight/4 + frameHeight/10 + rand.nextInt((int)(frameHeight - frameHeight/2)))));\n\t\t\ta+=1;\n\t\t}\n\n\t\tanimals.add(new BigFish(frameWidth, frameHeight));\n\t\tanimals.add(new Crab(frameWidth, frameHeight));\n\t\tanimals.add(new Algae(frameWidth, frameHeight));\n\n\t\tthis.objects = animals;\n\t}", "public void setAnimal(Animal animal) {\n\t\tthis.animal = animal;\r\n\t}", "public static void main(String[] args) {\n\t\tAnimals an = new Animals();\r\n\t\tan.eat();\r\n\t\tan.similar();\r\n\t\tan.sound();\r\n\t\t\r\n\t\t//creating object for Dog class based on Animals class\r\n\t\tAnimals d = new Dog();\r\n\t\td.sound();\r\n\t\td.eat();\r\n\t\t\r\n\t\t//creating object for CAT class based on Animals class.\r\n\t\tAnimals c = new Cat();\r\n\t\tc.sound();\r\n\t\tc.eat();\r\n\t\t\r\n\t\t\r\n\t}", "public void setAnimals(ArrayList<Animal> animals) { this.animals = animals; }", "public Animal(String hewan, int x, int y) {\n switch (hewan) {\n case \"Bekantan\": {\n name = \"Bekantan\";\n habitat = \"Land\";\n weight = 50;\n type = \"Herbivore\";\n tamed = true;\n diet = \"Fruit\";\n legs = 2;\n content = 'A';\n suara = \"Uuuuuuuu\";\n break;\n }\n case \"BurungHantu\": {\n name = \"Burung Hantu\";\n habitat = \"Air\";\n weight = 2;\n type = \"Carnivore\";\n tamed = true;\n diet = \"Meat\";\n legs = 2;\n content = 'B';\n suara = \"Kur kur kur\";\n break;\n }\n case \"Codot\": {\n name = \"Codot\";\n habitat = \"Air\";\n weight = (float) 0.5;\n type = \"Herbivore\";\n tamed = false;\n diet = \"Fruit\";\n legs = 2;\n content = 'C';\n suara = \"Cit cit cit\";\n break;\n }\n case \"Elang\": {\n name = \"Elang\";\n habitat = \"Air\";\n weight = 3;\n type = \"Carnivore\";\n tamed = false;\n diet = \"Meat\";\n legs = 2;\n content = 'D';\n suara = \"Koak koakk koakk\";\n break;\n }\n case \"Gajah\": {\n name = \"Gajah\";\n habitat = \"Land\";\n weight = 3500;\n type = \"Herbivore\";\n tamed = true;\n diet = \"Leaf\";\n legs = 4;\n content = 'E';\n suara = \"Ngoett\";\n break;\n }\n case \"Gorilla\": {\n name = \"Gorilla\";\n habitat = \"Land\";\n weight = 200;\n type = \"Herbivore\";\n tamed = false;\n diet = \"Fruit\";\n legs = 2;\n content = 'C';\n suara = \"Huhahuha\";\n break;\n }\n case \"Harimau\": {\n name = \"Harimau\";\n habitat = \"Land\";\n weight = 450;\n type = \"Carnivore\";\n tamed = false;\n diet = \"Meat\";\n legs = 4;\n content = 'G';\n suara = \"Roarrrr\";\n break;\n }\n case \"Hiu\": {\n name = \"Hiu\";\n habitat = \"Water\";\n weight = 100;\n type = \"Carnivore\";\n tamed = true;\n diet = \"Meat\";\n legs = 0;\n content = 'H';\n suara = \"Shush shush\";\n break;\n }\n case \"IkanTerbang\": {\n name = \"Ikan Terbang\";\n habitat = \"Water\";\n weight = 2;\n type = \"Carnivore\";\n tamed = true;\n diet = \"Insect\";\n legs = 0;\n content = 'I';\n suara = \"Cepok cepok cepok\";\n break;\n }\n case \"Jerapah\": {\n name = \"Jerapah\";\n habitat = \"Land\";\n weight = 500;\n type = \"Herbivore\";\n tamed = true;\n diet = \"Leaf\";\n legs = 4;\n content = 'J';\n suara = \"Ngoet ngoet\";\n break;\n }\n case \"Kancil\": {\n name = \"Kancil\";\n habitat = \"Land\";\n weight = 60;\n type = \"Herbivore\";\n tamed = true;\n diet = \"Leaf\";\n legs = 4;\n content = 'K';\n suara = \"Ngik ngik ngik\";\n break;\n }\n case \"Kepik\": {\n name = \"Kepik\";\n habitat = \"Air\";\n weight = (float) 0.01;\n type = \"Herbivore\";\n tamed = true;\n diet = \"Nectar\";\n legs = 6;\n content = 'L';\n suara = \"Krik krik krik\";\n break;\n }\n case \"Kepiting\": {\n name = \"Kepiting\";\n habitat = \"Water\";\n weight = 1;\n type = \"Omnivore\";\n tamed = true;\n diet = \"Plankton\";\n legs = 10;\n content = 'M';\n suara = \"Kuikk kuikk\";\n break;\n }\n case \"KumbangHutan\": {\n name = \"Kumbang Hutan\";\n habitat = \"Air\";\n weight = (float) 0.05;\n type = \"Herbivore\";\n tamed = true;\n diet = \"Nectar\";\n legs = 6;\n content = 'N';\n suara = \"Kruk kruk kruk\";\n break;\n }\n case \"KupuKupu\": {\n name = \"KupuKupu\";\n habitat = \"Air\";\n weight = (float) 0.03;\n type = \"Herbivore\";\n tamed = true;\n diet = \"Nectar\";\n legs = 6;\n content = 'O';\n suara = \"Wir wir\";\n break;\n }\n case \"Lobster\": {\n name = \"Lobster\";\n habitat = \"Water\";\n weight = (float) 0.5;\n type = \"Omnivore\";\n tamed = true;\n diet = \"Plankton\";\n legs = 10;\n content = 'P';\n suara = \"Crek crek crek\";\n break;\n }\n case \"LumbaLumba\": {\n name = \"Lumba lumba\";\n habitat = \"Water\";\n weight = 100;\n type = \"Omnivore\";\n tamed = true;\n diet = \"Plankton\";\n legs = 0;\n content = 'Q';\n suara = \"Cet cet cet\";\n break;\n }\n case \"MacanTutul\": {\n name = \"Macan Tutul\";\n habitat = \"Land\";\n weight = 350;\n type = \"Carnivore\";\n tamed = true;\n diet = \"Meat\";\n legs = 4;\n content = 'R';\n suara = \"Aummmm\";\n break;\n }\n case \"OwaOwa\": {\n name = \"OwaOwa\";\n habitat = \"Land\";\n weight = 70;\n type = \"Herbivore\";\n tamed = true;\n diet = \"Fruit\";\n legs = 2;\n content = 'S';\n suara = \"Huhuhuhu\";\n break;\n }\n case \"PausSperma\": {\n name = \"Paus Sperma\";\n habitat = \"Water\";\n weight = 7000;\n type = \"Omnivore\";\n tamed = true;\n diet = \"Plankton\";\n legs = 0;\n content = 'T';\n suara = \"Srosh srosh\";\n break;\n }\n case \"Piranha\": {\n name = \"Piranha\";\n habitat = \"Water\";\n weight = (float) 0.7;\n type = \"Carnivore\";\n tamed = false;\n diet = \"Meat\";\n legs = 0;\n content = 'U';\n suara = \"Kraus kraus\";\n break;\n }\n case \"Platypus\": {\n name = \"Platypus\";\n habitat = \"Land and Water\";\n weight = 5;\n type = \"Carnivore\";\n tamed = true;\n diet = \"Insect\";\n legs = 4;\n content = 'V';\n suara = \"Krr krr\";\n break;\n }\n case \"Singa\": {\n name = \"Singa\";\n habitat = \"Land\";\n weight = 400;\n type = \"Carnivore\";\n tamed = false;\n diet = \"Meat\";\n legs = 4;\n content = 'W';\n suara = \"Groarrr\";\n break;\n }\n case \"SingaLaut\": {\n name = \"Singa Laut\";\n habitat = \"Water\";\n weight = 70;\n type = \"Carnivore\";\n tamed = false;\n diet = \"Meat\";\n legs = 0;\n content = 'X';\n suara = \"Ou ou ou\";\n break;\n }\n default: {\n name = \"NULL\";\n habitat = \"NULL\";\n weight = 0;\n type = \"NULL\";\n tamed = false;\n diet = \"NULL\";\n legs = 0;\n content = '-';\n suara = \"NULL\";\n break;\n }\n }\n fodder = (float) 0.025 * weight;\n locX = x;\n locY = y;\n nAnimal++;\n consumerate += fodder;\n }", "public Animal(String tipo){\n\t\tthis.tipo = tipo;\n\t}", "public static void main(String[] args) {\n\t\tMainAnimal mainAnimal = new MainAnimal();\r\n\t\tmainAnimal.init();\r\n\t}", "public void createAnimalsCollection() {\n ArrayList<DataSetAnimal> animalsFetched = getDFO().getAnimalData(getFILE_NAME()).getAnimals();\n setAnimals(new ArrayList<>());\n for (DataSetAnimal animal: animalsFetched) {\n String tmpBreed = animal.getBreedOrType().substring(animal.getBreedOrType().lastIndexOf(\" \") + 1);\n switch (tmpBreed) {\n case \"dolphin\":\n getAnimals().add(new AnimalDolphin(animal.getBreedOrType(), animal.getName(), animal.getYearOfBirth()));\n break;\n case \"duck\":\n getAnimals().add(new AnimalDuck(animal.getBreedOrType(), animal.getName(), animal.getYearOfBirth()));\n break;\n case \"cat\":\n getAnimals().add(new AnimalCat(animal.getBreedOrType(), animal.getName(), animal.getYearOfBirth()));\n break;\n case \"chicken\":\n getAnimals().add(new AnimalChicken(animal.getBreedOrType(), animal.getName(), animal.getYearOfBirth()));\n break;\n case \"horse\":\n getAnimals().add(new AnimalHorse(animal.getBreedOrType(), animal.getName(), animal.getYearOfBirth()));\n break;\n case \"shark\":\n getAnimals().add(new AnimalShark(animal.getBreedOrType(), animal.getName(), animal.getYearOfBirth()));\n break;\n case \"parakeet\":\n getAnimals().add(new AnimalParakeet(animal.getBreedOrType(), animal.getName(), animal.getYearOfBirth()));\n break;\n default:\n getAnimals().add(new AnimalDog(animal.getBreedOrType(), animal.getName(), animal.getYearOfBirth()));\n break;\n }\n }\n }", "public Animal() {\n\t\tSystem.out.println(\"Animal constructor called\");\n\t}", "public static void main(String[] args) {\n\t\tAnimal1 d=new Dog1();\n\t\td.eat();\n\t\td.makeSound();\n\t\tAnimal1 c=new Cat();\n\t\tc.eat();\n\t\tc.makeSound();\n\t}", "public static void main(String[] args) {\n llama coolAnimal = new llama();\n llama.giveName();\n llama.giveGender();\n llama.name = \"joe the llama papa\";\n llama.gender = \"male\";\n llama.giveName();\n llama.giveGender();\n unicorn.giveName();\n unicorn.giveGender();\n\n }", "public static Animal getAnimal() {//object of type animal and calling this method in app.javsa\n return new Dog();\n}", "public Animal(int age){\n this.age = age;\n System.out.println(\"An animal has been created!\");\n }", "private void populateData() {\n animals.add(new Animal(\"Bear Arlan\", 10, true, \"Student\",\n \"Watch cartoons\", R.drawable.bear));\n animals.add(new Animal(\"Marten Chrisst\", 15, true, \"McDonald employee\",\n \"Play video games\", R.drawable.marten));\n animals.add(new Animal(\"Octopus Tenta\", 18, false, \"Ink producer\",\n \"Camouflage and attack jellyfish\", R.drawable.octopus));\n animals.add(new Animal(\"Ostrich Mellow\", 19, false, \"Zoo runner\",\n \"Peck other animals\", R.drawable.ostrich));\n animals.add(new Animal(\"Raccoon Garack\", 21, true, \"Office worker\",\n \"Build diagrams for statistics\", R.drawable.racoon));\n animals.add(new Animal(\"Rooster Billo\", 16, true, \"Early waker\",\n \"Fly and chirp in morning\", R.drawable.rooster));\n animals.add(new Animal(\"Seagull Ranch\", 23, false, \"Scout\",\n \"Practice carrying water in mouth\", R.drawable.seagull));\n animals.add(new Animal(\"Seal Arlan\", 25, true, \"Security\",\n \"Work on belly muscles\", R.drawable.seal));\n animals.add(new Animal(\"Tiger Stitch\", 30, false, \"Hunter\",\n \"Make soup\", R.drawable.tiger));\n animals.add(new Animal(\"Zebra Dillian\", 6, true, \"Student\",\n \"Watch movies about zebras\", R.drawable.zebra));\n }", "public static void main(String[] args) {\n Animal animal= new Animal(\"Animal\", 1,1,5,5);\n Dog dog= new Dog(\"Dingo\", 8,20,2,4,1,20, \"long silky\");\n \n }", "public static void main(String[] args) {\n Animal zebra=new Animal(\"Pol\", \"Male\", 11, \"Zebra\");\n zebra.sleep();\n zebra.walk();\n zebra.eat();\n \n Animal giraffe=new Animal(\"Necky\",\"Female\",23,\"Giraffe\");\n giraffe.sleep();\n giraffe.walk();\n giraffe.eat();\n \n \n}", "public void setAnimal(AnimalModel param) {\n localAnimalTracker = true;\n\n this.localAnimal = param;\n }", "public void setup()\n {\n // we use a separate ArrayList to keep track of each animal. \n // our room is 50 x 50.\n creatures = new ArrayList<Creature>();\n for (int i = 0; i < 55; i++) {\n if (i < 5) {\n creatures.add(new Fox((int)(Math.random()*48)+1, 1, (int)(Math.random()*48)+1)); \n } else {\n creatures.add(new Tux((int)(Math.random()*48)+1, 1, (int)(Math.random()*48)+1));\n }\n }\n \n env.setRoom(new Room());\n \n // Add all the animals into to the environment for display\n for (Creature c : creatures) {\n env.addObject(c);\n }\n \n // Sets up the camera\n env.setCameraXYZ(25, 50, 55);\n env.setCameraPitch(-63);\n \n // Turn off the default controls\n env.setDefaultControl(false);\n env.setShowController(false);\n \n }", "@Override\n\tString getName(){\n\t\treturn animalName;\n\t}", "public static void createArmy() {\n Unit unitOne = new Unit(\"Unit One\");\n Unit unitTwo = new Unit(\"Unit Two\");\n Unit unitThree = new Unit(\"Unit Three\");\n Unit unitFour = new Unit(\"Unit Four\");\n Unit unitFive = new Unit(\"Unit Five\");\n\n Knight knightOne = new Knight(\"Knight One\");\n Knight knightTwo = new Knight(\"Knight Two\");\n Knight knightThree = new Knight(\"Knight Three\");\n\n General general = new General(\"General\");\n Doctor doctor = new Doctor(\"Doctor\");\n }", "public GUIManutencaoAnimal() {\n initComponents();\n preencherTabela();\n }", "Animal(int age, String name, double weight){\n\t\tthis.age = age;\n\t\tthis.name = name;\n\t\tthis.weight = weight;\n\t\t\n\t\t//make objects:\n\t\tmyHeart = new Heart();\n\t\tmyLiver = new Liver();\n\t\tmyKidney = new Kidney();\n\t\tmyLungs = new Lungs();\n\t\t\n\t\tSystem.out.println(myHeart.bpm);\n\t\tSystem.out.println(myLiver.id);\n\t\tSystem.out.println(\"end of Animal constructor\");\n\t\t\n\t\tmyKidney.alive(); //accessing the alive method from the local Beghaviour interface that this implements.\n\t\tmyLungs.alive();\n\t\t\n\t}", "public static void main(String args[]){\n\n\t\tDog myDog = new Dog();\n\t\t//DomasticAnimal yourDog = new Dog();//valid\n\t\t//Animal herDog = new Dog();//valid\n\t\tmyDog.pet();\n\t\tmyDog.makeNoice();\n\t\tmyDog.sleep();\n\t\tmyDog.eat();\n\t\t\n\t\tLion girLion1 = new Lion();\n\t\t//WildAnimal girLion2 = new Lion();//valid\n\t\t//Animal girLion3 = new Lion();//valid\n\t\tgirLion1.hunt();\n\t\tgirLion1.makeNoice();\n\t\tgirLion1.sleep();\n\t\tgirLion1.eat();\n\t\t\n\t}", "public Animal(String name){\n\n this.name = name;\n //array2.add(new String(name2));\n }", "public static void show() {\n Animal.Petdog.sleep();\n\n // The dog is going to bark.\n Animal.Petdog.bark();\n\n // Creating a new chicken and a new pig.\n Animal c= new Chicken();\n Animal g= new Pig();\n\n // The animals are going to sleep.\n c.sleep();\n g.sleep();\n\n // The animals are going to fight with dog.\n c.fightWithDog();\n g.fightWithDog();\n\n // The animals are going to exercise.\n c.exe();\n g.exe();\n\n // Chicken can also run with your set.\n c.exewithset(\"Run\");\n\n // The animals are going to breed.\n c.breed();\n g.breed();\n\n // The animals are going to do shower.\n c.shower();\n g.shower();\n\n // Let's see how many product do we have before animals produce products.\n System.out.println(\"Chicken meat: \" +Chickenmeat.amount+\"\\nEggs: \"+ Eggs.amount) ;\n System.out.println(\"Pork: \" +Pork.amount) ;\n\n // The animals are going to produce external product.\n c.producewithoutdeath();\n g.producewithoutdeath();\n\n // The animals are going to produce internal product.\n c.producewithdeath();\n g.producewithdeath();\n\n // Let's see how many product do we have after animals produce products.\n System.out.println(\"Chicken meat: \" +Chickenmeat.amount+\"\\nEggs: \"+ Eggs.amount) ;\n System.out.println(\"Pork: \" +Pork.amount) ;\n\n // Get currnet states of the animals.\n c.getstate();\n g.getstate();\n\n // The dead animals regain life.\n c.setstate();\n g.setstate();\n c.getstate();\n g.getstate();\n\n\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tAnimal a1 = new Animal();\r\n\t\tDog d1 = (Dog)a1;\r\n\t\td1.eat();\r\n\t\td1.noise();\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tAnimal nadir = new Dog();\n\t\tAnimal birdy = new Bird();\n\n\t\tSystem.out.println(\"Nadir: \"+nadir.trytofly());\n\t\tnadir.SetAbilitytofly(new ItFlys());\n\t\tSystem.out.println(\"Nadir: \"+nadir.trytofly());\n\t\tSystem.out.println(\"Birdy: \"+birdy.trytofly());\n\t}", "public void AddAnimal(float xPos, float yPos)\n {\n Animal newAnimal = new Animal(xPos, yPos, birds.size());\n birds.add(newAnimal);\n }", "public Animal()\n\t{\t\n\t\tgender = rng.nextBoolean();\n\t\tstrength = rng.nextFloat() * 100;\n\t}", "public static void main(String[] args) {\n animals = new Animal[3];\n animals[0] = new PolarBear();\n animals[1] = new Elephant();\n animals[2] = new PolarBear();\n\n for (Animal animal: animals) {\n System.out.println(\"You see a \" + animal.toString()\n + \" that \" + animal.showOff());\n }\n }", "public static void main(String[] args) {\n Animal A1 = new Animal(5,\"Animal\",1,\"Carnivores\",1);\n Dog d1 = new Dog(2,\"Miller\",4,\"Herbivores\",1);\n\n d1.eat();\n A1.eat();\n\n }", "public Animal(String name, String type, String color, String date, String email, String location,\n String latitude, String longitude, String phone, String token, String description,\n String thumbUrl, String key, String status) {\n this.name = name;\n this.type = type;\n this.color = color;\n this.date = date;\n this.email = email;\n this.location = location;\n this.latitude = latitude;\n this.longitude = longitude;\n this.phone = phone;\n this.token = token;\n this.description = description;\n this.thumbUrl = thumbUrl;\n this.key = key;\n this.status = status;\n }", "public Fruit() {\n super(0, \"melon.png\",HEIGHT);\n\n reposition();\n isSinglePlayer = false;\n timeSinceSpeedUp = 0;\n difficulty = 1f;\n }", "Dog(){\n\t\t\n\t\t//I want to create a chemicals object. Inorder to do this, I have to first create a Cardiac obj, then a Cells obj, then a Chemicals object.\n\t\t//I have to create a Chemicals object, to get a chemicals constructor \n\t\tnew Cardiac().new Cells().new Chemicals();\n\t\t\n\t}", "@Override\n public Animal createAnimal() {\n return new Monkey();\n }", "public static void main(String... args) {\n Mammal mammal = new Mammal();\n mammal.getName();\n Bird bird = new Bird();\n bird.getName();\n\n System.out.println(\"showAnimal(AbstractAnimal abstractAnimal) \");\n showAnimal(mammal);\n showAnimal(bird);\n }", "public static void main(String[] args) {\n\t\tAnimal a = new Dog();\r\n\t\r\n\t\ta.move();\r\n\t\ta.eat(); \r\n\t\t\r\n\t\tAnimal b= new Cow();\r\n\t\tb.move();\r\n\t\tb.eat();\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\t Animal3 a = new Animal3();\n\t\t \n\t\t a.walk();\n\t\t a.swim();\n\t\t\n \n \n\t}", "public static void main(String[] args) {\n\t\t\n\t\tanimal dog= new animal();\n\t\t\n\t\tSystem.out.println(dog.noofeyes);\n\t\tSystem.out.println(dog.noofears);\n\t\tSystem.out.println(dog.nooflegs);\n\t\tdog.sleep();\n\t\tdog.walk();\n\t\t\n\t\tanimal cat=new animal();\n\t\tSystem.out.println(dog.noofeyes);\n\t\tSystem.out.println(dog.noofears);\n\t\tSystem.out.println(dog.nooflegs);\n\t\tcat.sleep();\n\t\tcat.walk();\n\t\t\n\t\t\n\t\t\n\n\t}", "void onAnimalSelected(Animal animal);", "@Override\n public void setEdibleAnimals() {\n addPrey(Rabbit.SPECIES);\n }", "public Levels()\r\n { \r\n super(1070, 570, 1);\r\n \r\n //Add the bottom platform in the menu screen\r\n platforms = new Platforms[7]; \r\n for (int i = 0; i < platforms.length; i++)\r\n {\r\n platforms[i] = new Platforms();\r\n }\r\n bottomPlatform();\r\n\r\n //Add the Potato (player)\r\n player = new Player();\r\n addObject (player, 100, 512); \r\n\r\n setBackground(\"menu.png\");\r\n }", "public void initCreature() {\n }", "public void setAnimalName(java.lang.String param) {\n localAnimalNameTracker = true;\n\n this.localAnimalName = param;\n }", "public static void main(String[] args) {\n Animal animal = new Animal(\"Tigger\", \"gruel\");\n animal.eat(\"meat\");\n animal.eat(\"kibble\");\n\n }", "public static void main(String[] args) {\n\n\t\t\n\t\t\n\t\tAnimal animal=new Animal();\n\t\tanimal.makeNoice();\n\t\t\n\t\tHorse horse= new Horse();\n\t\thorse.makeNoice();\n\t\t\n\t\tDog dog= new Dog();\n\t\tdog.makeNoice();\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "@Override\n\tvoid setId(int animalId) {\n\t\tid = animalId;\n\t}", "public static void main (String[] args) \n\t {\n\t Animal an1 = new Animal(\"Bobby\", \"ocean\",120,\"medium\", 12);\n\t System.out.println(an1.getName());\n\t \t an1.setName(\"Tom\");\n\t System.out.println(\" changed to: \"+ an1.getName());\n\t System.out.println(\" Energy level after sleep changed to: \" + an1.sleep());\n\t \n\t Animal an2 = new Animal(\"Bobby\", \"ocean\",120,\"medium\", 12);\n\n\t \t \n}", "public Dog(String name, int size, int weight, int eyes, int legs, int tail, int teeth, String coat) {\n //super means to call a constructor from the class we are extending\n //can set values or call in the above constructor, your choice\n super(name, 1, 1, size, weight);\n //these are for the strictly dog paramters\n this.eyes = eyes;\n this.legs = legs;\n this.tail = tail;\n this.teeth = teeth;\n this.coat = coat;\n }", "public Animal(int theAge) {\n\t\t// TODO Auto-generated constructor stub\n\t\tage = theAge;\n\t}", "public Dog ()\n {\n super (\"Dog\", \"Hi! My name is Snoop Dawg\");\n this.x = \"A bone\";\n /*\n * This dog has many features to it\n * Do not provoke it or else it will bite!\n * Otherwise, It's a nice dog so have fun!\n */\n \n \n }", "public static void main(String[] args) {\n\t\tAnimalTestOverriden animalTestOverriden=new AnimalTestOverriden();\n\t\tAnimalTestOverriden animalTestOverriden2=new horseTestOverriden();\n\t\t//animalTestOverriden2.buck(); we can't invoke buck() method because Animal class doesn't have that method \n\t\tanimalTestOverriden.eat();// invoke eat method of AnimalTestOverriden class\n\t\tanimalTestOverriden2.eat();//invoke eat method of horseTestOverriden class\n\t\t/*\n\t\t * Generic Animal Eating Generiaclly\n horse eating hay.....................\n\t\t */\n\t\t\n\t}", "private void populatepets(){\r\n\t\tpets.add(new Cat(\"UnNamed\"));\r\n\t\tpets.add(new Cow(\"UnNamed\"));\r\n\t\tpets.add(new Dog(\"UnNamed\"));\r\n\t\tpets.add(new Rabbit(\"UnNamed\"));\r\n\t\tpets.add(new Rat(\"UnNamed\"));\r\n\t\tpets.add(new Velociraptor(\"UnNamed\"));\r\n\t}", "public Weapon(){\n \n name = \"Claw\"; // will be treated as a sword\n type = 'R';\n advType = 'G';\n disType = 'B';\n mt = 4;\n hit = 85;\n crit = 0;\n wt = 1;\n isMagic = true;\n \n }", "public gameScene_Model(Stage primaryStage){\n this.primaryStage = primaryStage;\n background = new MyStage();\n this.scene = new Scene(background,600,800);\n animal = new Animal(\"file:src/FroggerApp/Images_File/froggerUp.png\");\n }", "public static void function(Animal a){\n a.eat();\n if (a instanceof Cat){//instanceof 判断指向类型\n Cat c =(Cat)a;\n c.catchMouse();\n }\n else if(a instanceof Dog){\n Dog d =(Dog) a;\n d.kanjia();\n }\n\n }", "public static void main(String[] args) {\n\t\tAnimal a = new Animal();\n\t\tDog d = new Dog();\n a.eat();\n d.eat();\n\t}", "@Before\n\tpublic final void setUp() {\n\t\tint numLegs = 4;\n\t\tanimal = new Animal(\"Possum\", \"Mammal\", \"male\", numLegs);\n\t\ttestForest = new Forest(\"Hamner Forest Park\", \"Alpine Forest\", \n\t\t\t\t\"Warm, Mountain-like\");\n\t}", "public static void main(String[] args) {\n\n // animal.weight = 25.3;\n // animal.age = 11;\n // System.out.println(\"animal -> \" + animal);\n\n Dog bobik = new Dog();\n bobik.setNick(\"Bobik\");\n bobik.setGender(\"male\");\n bobik.setWeight(10.0D);\n bobik.setBreed(\"Shpich\");\n bobik.age = 5;\n bobik.gender = \"netural\";\n\n // animal.say();\n bobik.say();\n\n Cat speedy = new Cat(5.25D);\n speedy.speed = \"very fast\"; // так писать нельзя\n\n bobik.walk();\n }", "public void eat(){\r\n System.out.println(this.animalName + \" eats\");\r\n }", "public Animal(boolean randomAge, Field field, Location location, int breeding_age, int max_age, double breeding_probability, int max_litter_size)\n {\n alive = true;\n age = 0;\n if(randomAge) {\n age = rand.nextInt(max_age);\n }\n this.field = field;\n setLocation(location);\n this.breeding_age = breeding_age;\n this.max_age = max_age;\n this.breeding_probability = breeding_probability;\n this.max_litter_size = max_litter_size;\n gender = Math.random() < 0.5;\n }", "public Animal getRandomAnimal() {\n //Randomize all characteristics of an animal\n int spc = (int) Math.round(rd.nextDouble() * (Animal.enumSpecies.values().length - 1));\n boolean isPet = rd.nextBoolean();\n\n //Construct an animal with random characteristic\n //Animal(int age, Gender g, BodyType b, enumSpecies espec, boolean ispet)\n A = new Animal(Animal.enumSpecies.values()[spc], isPet);\n return A;\n }", "public void addNewAnimalAction() {\n\t\tAnimalModel newAnimalModel = new AnimalModel(\"\", \"\");\n\n\t\teditAnimalDetail(newAnimalModel, AnimalDetailPanel.NEW_ANIMAL);\n\t}", "public void AddAnimal(int amount, float xPos, float yPos)\n {\n for (int i = 0; i < amount; i++)\n {\n Animal newAnimal = new Animal(xPos, yPos, birds.size());\n birds.add(newAnimal);\n }\n }", "public static void main(String agrs[]){\n\t\t\n\t\tAnimal m = new Cat(); \n\t\n\t\n\t\ttestVoice(m);\n\t\t//只写了Animal方法区,m猫对象只有这个方法的地址却找不到方法区中animal类的方法//\n\t\tAnimal n = new Dog();\n\t\tDog k = (Dog)n;\n\t\ttestVoice(n);\n\t\tk.seeDoor();\n\t}", "public static void main(String[] args) {\n Animal unAnimalRavioso = new Animal();\n System.out.println(unAnimalRavioso.informaEnergia());\n\n //Al objeto le digo que corra\n unAnimalRavioso.correr();\n\n //Imprimo la energia\n System.out.println(unAnimalRavioso.informaEnergia());\n\n Comida unPaty = new Comida();\n unPaty.setEnergia(120);\n System.out.println(unPaty.getEnergia());\n\n System.out.println(\"Energia antes de comer paty \" + unAnimalRavioso.informaEnergia());\n unAnimalRavioso.comer(unPaty);\n\n System.out.println(\"Energia despues de comer paty \" + unAnimalRavioso.informaEnergia());\n\n Perro perroCobarde = new Perro();\n perroCobarde.hacerRuido();\n\n Gato gatoCobarde = new Gato();\n ArrayList<Animal>animales = new ArrayList<>();\n\n animales.add(perroCobarde);\n animales.add(gatoCobarde);\n\n System.out.println(\"hacer ruido animales\");\n for (Animal unAnimal:animales) {\n unAnimal.hacerRuido();\n }\n\n\n\n }", "public static void main(String[] args) {\n\t\tAnimal cat = new Cat();\n\t\tcat.eat();\n\t\t\n\t\tSystem.out.println(\"----------\");\n\t\t\n\t\tCat c1 = new Cat(\"吾皇\", 4);\n\t\tSystem.out.println(c1.getName()+\" - \"+c1.getAge());\n\t\tc1.eat();\n\t\tc1.play();\n\t\t\n\t\tSystem.out.println(\"----------\");\n\t\t\n\t\tDog d1 = new Dog(\"巴匝黑\",3);\n\t\tSystem.out.println(d1.getName()+\" - \"+d1.getAge());\n\t\td1.eat();\n\t\td1.grant();\n\t}", "public static void main(String[] args) throws IOException {\n AnimalFactory df = new DogFactory();\n AnimalFactory cf = new CatFactory();\n AnimalFactory bf = new BirdFactory();\n \n ArrayList<Dog> dogs = new ArrayList<>();\n ArrayList<Cat> cats = new ArrayList<>();\n ArrayList<Bird> birds = new ArrayList<>();\n \n Scanner reader = new Scanner(System.in);\n String input;\n do {\n System.out.println(\"===== Animal Kennel =====\"); \n System.out.println(\"1. Add animal.\");\n System.out.println(\"2. Talk to animals.\");\n System.out.println(\"0. Exit.\");\n System.out.print(\"Select an option: \");\n input = reader.nextLine();\n \n switch (Integer.parseInt(input)) {\n case 1:\n System.out.println(\"Types of animals to add: \");\n System.out.println(\"1 Dogs\");\n System.out.println(\"2 Cats\");\n System.out.println(\"3 Birds\");\n \n System.out.print(\"Selection: \");\n input = reader.nextLine();\n switch (Integer.parseInt(input)) {\n case 1:\n System.out.println(\"You can add: \");\n System.out.println(\"Labrador\\tPomeranian\\tShepherd\");\n System.out.print(\"Select an option: \");\n input = reader.nextLine();\n Dog dog = df.createDog(input);\n if (dog != null) dogs.add(dog);\n break;\n case 2:\n System.out.println(\"You can add: \");\n System.out.println(\"Burmese\\tPersian\\tSiamese\");\n System.out.print(\"Select an option: \");\n input = reader.nextLine();\n Cat cat = cf.createCat(input);\n if (cat != null) cats.add(cat);\n break;\n case 3:\n System.out.println(\"You can add: \");\n System.out.println(\"Owl\\tParrot\\tStork\");\n System.out.print(\"Select an option: \");\n input = reader.nextLine();\n Bird bird = bf.createBird(input);\n if (bird != null) birds.add(bird);\n break;\n default:\n break;\n }\n break;\n case 2:\n System.out.println(\"And then each of the animals spoke: \");\n dogs.forEach((dog) -> {\n dog.speak();\n });\n cats.forEach((cat) -> {\n cat.speak();\n });\n birds.forEach((bird) -> {\n bird.speak();\n });\n break;\n case 0:\n System.out.println(\"Exiting...\");\n System.exit(0);\n break;\n default:\n System.out.println(\"Choose something from the menu.\");\n break; \n }\n } while (true);\n }", "public static void main(String[] args) {Dog dog1 = new Dog();\n//\t\tdog1.name=\"Bubbly\";\n//\t\tdog1.age=5;\n//\t\tdog1.breed=\"Poodle\";\n//\t\tdog1.color=\"White\";\n//\t\t\n//\t\tSystem.out.println(dog1.name + \":\" + dog1.age + \":\" + dog1.breed + \":\" + dog1.color);\n//\t\t\n//\t\tdog1.bark();\n//\t\tdog1.eat();\n//\t\tdog1.wagTail();\n//\t\t\n//\t\tSystem.out.println(\"--------------\");\n\t\t\n\t\t\n//\t\tDog2 dog = new Dog2();\n//\t\tSystem.out.println(dog.name + \":\" + dog.age + \":\" + dog.breed + \":\" + dog.color);\n//\t\t\n\t\tDog2 dog2=new Dog2();\n\t\tSystem.out.println(dog2.name + \":\" + dog2.age + \":\" + dog2.breed + \":\" + dog2.color);\n\t\t\n//\t\tDog2 dog3=new Dog2(\"Rusty\",20,\"Bulldog\",\"Black\");\n//\t\tSystem.out.println(dog3.name + \":\" + dog3.age + \":\" + dog3.breed + \":\" + dog3.color);\n\n\t\t\n\t\t\n\t}", "@Override\npublic void mating(Animal a) {\nSystem.out.println(a.getType()+ \" is mating.\");\n}", "public void init() {\n\t\tfor(int i = 0; i < roamingAliens; ++i) {\n\t\t\tAlien alien = new Alien(ColorUtil.MAGENTA, screenHeight, screenWidth, speed, speedMulti);\n\t\t\tgameObject.add((GameObject) alien); \n\t\t}\n\t\tfor(int i = 0; i < roamingAstronauts; ++i) {\n\t\t\tAstronaut astronaut = new Astronaut(ColorUtil.GREEN, screenHeight, screenWidth, speed, speedMulti);\n\t\t\tgameObject.add((GameObject) astronaut);\n\t\t}\n\t\tgameObject.add((Spaceship.getSpaceship()));\n\t\tthis.setChanged();\n\t\tthis.notifyObservers();\n\t\tthis.clearChanged();\n\t}", "void place(Animal animal);", "public static void main(String[] args) {\n\t\tString animalType = args[0];\n\t\t\n\t\t//Creating object of Animal Factory\n\t\tAnimalFactory animalFactory = new AnimalFactory();\n\t\t\n\t\t//Creating animal of type passed in command line\n\t\tAnimal animal = animalFactory.createAnimal(animalType);\n\t\tanimal.eat();\n\t}", "private void setupCustomAdapter() {\n AnimalAdapter adapter = new AnimalAdapter(this, animals);\n aListView.setAdapter(adapter);\n }", "public Animal(int row, int col, String sex, String type) {\n this.row = row;\n this.col = col;\n this.sex = sex;\n this.type = type;\n this.typeChar = type.charAt(0);\n }", "public void showAnimalInfo(Player p, Entity e){\r\n\tif(this.checkifHasOwner(e.getUniqueId().toString())){\r\n\t\tAnimals a = new Animals(plugin, e.getUniqueId().toString(), p.getUniqueId().toString());\r\n\t\tint hp = (int) a.getHeartPoints();\r\n\t\tp.sendMessage(ChatColor.YELLOW + \"+++++ Animal Info +++++\");\r\n\t\tp.sendMessage(ChatColor.YELLOW + \"Animal Name: \" + ChatColor.GREEN+ a.getAnimalName());\r\n\t\tp.sendMessage(ChatColor.YELLOW + \"Animal Owner: \" + ChatColor.GREEN+ a.getOwnerName());\r\n\t\tp.sendMessage(ChatColor.YELLOW + \"Heart Level: \" + ChatColor.GREEN + hp);\r\n\t\tp.sendMessage(ChatColor.YELLOW + \"Is Clean: \" + ChatColor.GREEN + a.getIsWashed());\r\n\t\tp.sendMessage(ChatColor.YELLOW + \"Is happy: \" + ChatColor.GREEN + a.isHappy());\r\n\t\tp.sendMessage(ChatColor.YELLOW + \"Is lonely: \" + ChatColor.GREEN + a.getIsPet());\r\n\t\tp.sendMessage(ChatColor.YELLOW + \"Is Hungry: \" + ChatColor.GREEN + a.getHunger());\r\n\t\tp.sendMessage(ChatColor.YELLOW + \"Is Healthy: \" + ChatColor.GREEN + a.isHealthy());\r\n\t\tp.sendMessage(ChatColor.YELLOW + \"Is Weight: \" + ChatColor.GREEN + a.getWeight());\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\t\tDog dog=new Dog(12,30);\r\n\t\tLion lion=new Lion(14,100);\r\n\t\tSystem.out.println(dog.height+\" \"+dog.weight);\r\n\t\tdog.talk();\r\n\t\tSystem.out.println(lion.height+\" \"+lion.weight);\r\n\t\tlion.talk();\r\n\t\t\r\n\r\n\t}", "public Bird(String name,int age, double weight,String sound, int noOfLegs,boolean canFly,AnimalType type) {\n\t\t\n\t\tsuper(name,age,weight,sound,noOfLegs,AnimalCategory.BIRD,type);\n\t\tthis.canFly=canFly;\n\t}", "public Perro() {\n// super(\"No define\", \"NN\", 0); en caso el constructor de animal tenga parametros\n this.pelaje = \"corto\";\n }", "public static void main(String[] args) {\n\t\tAnimal3 a = new Dog3();\n\t\ta.breath();\n\t}", "public Dog() {\r\n\r\n }", "public static void main(String[] args) {\n\n Animal dog = new Dog(\"Sunis\");\n Animal cat = new Cat(\"Kate\");\n\n showAnimalName(dog);\n showWalkingAction((IWalking) dog);\n showAnimalName(cat);\n showWalkingAction((IWalking) cat);\n\n }", "private void init() {\n display = new Display(title, getWidth(), getHeight());\n Assets.init();\n player = new Player(getWidth() / 2, getHeight() - 100, 1, 60, 40, this);\n for (int i = 0; i < 4; i++) {\n for (int j = 0; j < 6; j++) {\n aliens.add(new Alien(150 + 50 * j, 50 + 50 * i, 1, 40, 40, this));\n }\n }\n display.getJframe().addKeyListener(keyManager);\n }", "public MountainGoat(String owner, String age) {\n\t\t// TODO Auto-generated constructor stub \n\t\tsuper(owner, \"Mountain Goat\", age);\n\t \n\t}", "public void changeAnimal(Animal newAnimal){\n\t\tthis.myFlyweight = newAnimal;\n\t\tthis.maxAnimationFrame = this.myFlyweight.getMaxAnimationFrame();\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t\tDog dog1 = new Dog();\r\n//\t\tdog1.bark(); //we need to have created method bark().\r\n\t\tdog1.name = \"Tinito\";\r\n\t\t\r\n/*____________________________________________________________*/\t\t\r\n\t\t\r\n\t\t//Now make a Dog array.\r\n\t\t\r\n\t\tDog[] myDogs = new Dog[3];\r\n\t\tmyDogs[0] = new Dog(); //instantiates dog object referenced to by myDog[0]. \r\n\t\tmyDogs[1] = new Dog(); \r\n\t\tmyDogs[2] = dog1;\r\n/*____________________________________________________________*/\t\t\r\n\r\n\t\t//Now access the dogs using the array references\r\n\t\t\r\n\t\tmyDogs[0].name = \"Fred\";\r\n\t\tmyDogs[1].name = \"Merge\";\r\n\t\t//Note that you can't say dog1.name = \"Tinito.\"\r\n/*____________________________________________________________*/\t\t\r\n\t\t\r\n\t\t//Hmmmm....what myDogs[2] name?\r\n\t\tSystem.out.print(\"Last dog's name is \");\r\n\t\tSystem.out.println(myDogs[2].name);// Also accessed thru array ref.\r\n/*______________________________________________________________*/\t\t\r\n\t\r\n\t\t//Now loop through the array and tell all dogs to bark.\r\n\t\tint i = 0;\r\n\t\twhile(i < myDogs.length) {\r\n//\t\t\tmyDogs[i].bark;\r\n\t\t\ti = i +1;\r\n/*______________________________________________________________*/\t\t\t\r\n\t\t\t\r\n\t\t//Up to now the dogs don't know how to bark. We create method bark.\t\r\n\t\t\r\n//\t\t\tpublic void bark(){\t\t//Not sure why method rejected.\r\n\t\t\tSystem.out.println(name + \"says Ruff Ruff!\");\r\n\t\t}\r\n\t\t\r\n/*____________________________________________________________*/\r\n//\t //Similarly u can command the dogs to eat, chaseCat etc.\t\t\r\n//\t\t\tpublic void eat() { }\r\n//\t\t\tpublic void chaseCat() { }\r\n//\t\t\t\r\n//\t\t}\r\n\t}", "public Plan() {\n animals = new ArrayList<>();\n }", "public void bark(){// bark class only belongs to dog class\n System.out.println(name+\" is barking\");\n }", "private void createDefaultGalaxy(){\n milkyWay.setGalaxyColonies(37579321);\n milkyWay.setGalaxyPopulation(1967387132);\n milkyWay.setGalaxyFleets(237);\n milkyWay.setGalaxyStarships(34769);\n }" ]
[ "0.70858425", "0.70607996", "0.68264097", "0.67472905", "0.6702912", "0.66869295", "0.6628029", "0.6616061", "0.65462244", "0.6445115", "0.64345753", "0.6409171", "0.6375637", "0.63714266", "0.63605", "0.63230985", "0.6260645", "0.6253831", "0.6230066", "0.62140745", "0.62037706", "0.6198396", "0.61719173", "0.61604595", "0.61528814", "0.6108924", "0.6088387", "0.6075463", "0.6070061", "0.60278094", "0.6021862", "0.60143423", "0.60053664", "0.59923244", "0.5980604", "0.5979697", "0.5978739", "0.59534544", "0.59473795", "0.5937915", "0.59315515", "0.5916782", "0.59163713", "0.5876726", "0.5872605", "0.5871341", "0.58706516", "0.58679914", "0.5861914", "0.5861828", "0.58586884", "0.58454174", "0.5841682", "0.5835385", "0.5832729", "0.5828128", "0.58275956", "0.582438", "0.58120525", "0.58112615", "0.58019775", "0.58000106", "0.5795886", "0.57822543", "0.57602745", "0.5758707", "0.57420784", "0.57390076", "0.5724249", "0.57218885", "0.571987", "0.57189715", "0.5708251", "0.5706721", "0.569244", "0.56915", "0.56800324", "0.5678154", "0.56616944", "0.56484306", "0.56453305", "0.5642153", "0.56369", "0.56301445", "0.5623314", "0.561542", "0.5614134", "0.56114495", "0.56078285", "0.5593265", "0.5589237", "0.5589162", "0.55781096", "0.5576546", "0.55750847", "0.55690485", "0.5561298", "0.55587745", "0.55492085", "0.5548626" ]
0.56436205
81
To test if the game have ended. Which is the function getStop(). Will be false as all the end is not done and animal is new.
@Test public void getStopTest() { boolean expectedValue = animal.getStop(); Assert.assertEquals(expectedValue,false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean end() {\r\n\t\tif (this.gameOver == true)\r\n\t\t\treturn true;\r\n\t\treturn false;\r\n\t}", "boolean endOfGame() {\n return false;\n }", "boolean isStop();", "boolean shouldStop();", "public boolean gameEnd(){\r\n return !hasMovements(model.getCurrentPlayer().getColor());\r\n }", "protected abstract boolean isGameFinished();", "public abstract boolean isEnded();", "protected boolean isFinished() {\n long tEnd = System.currentTimeMillis();\n long tDelta = tEnd - tStart;\n double elapsedSeconds = tDelta / 1000.0;\n if (elapsedSeconds > 0.2) {\n \t System.out.println(\"End Fire\");\n \t return true;\n }\n else if(elapsedSeconds > 0.15) {\n \t System.out.println(\"end Fire\");\n Robot.m_Cannon.set(-1);\n }\n else if(elapsedSeconds > 0.05) {\n \t System.out.println(\"mid Fire\");\n Robot.m_Cannon.stop();\n }\n return false;\n }", "private boolean GameEnds(){\n \tif(endGameCounter!=0) {\n \t\treturn false;\n \t\t\n \t}\n \t\n \treturn true;\n }", "public boolean hasEnded(){\r\n\t\treturn state == GameState.FINISHED;\r\n\t}", "public boolean isEnded(){\n\t\treturn ended;\n\t}", "protected boolean isFinished() {\n //return !RobotMap.TOTE_SWITCH.get();\n \treturn false;\n }", "public boolean isStopped()\r\n\t{\r\n\t\treturn speed()==0;\r\n\t}", "protected boolean isFinished() {\n return (timeRunning>timeStarted+5 || RobotMap.inPosition.get()!=OI.shooterArmed);\n }", "public void finishGame(){\r\n\t\t\t\tgameStarted = false;\r\n\t\t\t}", "boolean endGame() throws Exception;", "protected boolean isFinished() {\r\n\t \treturn (timeSinceInitialized() > .25) && (Math.abs(RobotMap.armarm_talon.getClosedLoopError()) < ARM_END_COMMAND_DIFFERENCE_VALUE); //TODO:\r\n\t }", "public synchronized void setEndGame() {\n this.endGame = true;\n }", "@Override\n\tprotected boolean isFinished() {\n\t\treturn (System.currentTimeMillis() > Endtime);\n\t}", "@Override\n public boolean shouldStop() {\n return this.stop;\n }", "@Test\n public void testStop() {\n plugin.start(gameData, world);\n plugin.stop();\n\n boolean hasPlayer = false;\n for (Entity e : world.getEntities(EntityType.PLAYER)) {\n\n hasPlayer = true;\n\n }\n assertFalse(hasPlayer);\n }", "@Override\n public boolean isFinished() {\n return System.currentTimeMillis() >= endtime;\n }", "public boolean shouldStop() {\n return !this.running;\n }", "public abstract boolean shouldEnd();", "public boolean isStopped() {\n return m_runner == null;\n }", "@Test\n public void endGameDetectionTrue() {\n logic.setDirection(1);\n for (int i = 0; i < 100; i++) {\n logic.eatFoodForTesting();\n logic.gameLogic();\n }\n assertFalse(logic.gameLogic());\n }", "public void stop(){\n\t\tthis.timer.stop();\n\t\t//whenever we stop the entire game, also calculate the endTime\n\t\tthis.endTime = System.nanoTime();\n\t\tthis.time = this.startTime - this.endTime;\t//calculate the time difference\n\t\t\n\t\tthis.stop = true;\n\t}", "public boolean isGameFinished() {\n if (listaJogadores.size() - listaJogadoresFalidos.size() == 1) {\n return true;\n } else {\n return false;\n }\n\n }", "public boolean gameEnd(){\n\t\treturn(\tturn >= 50 || evaluateState()==true );\r\n\t}", "public boolean isFinished() {\n\t\tif (gameSituation == UNFINISHED) {\n\t\t\treturn false;\n\t\t} // Of if\n\n\t\treturn true;\n\t}", "boolean isFinished() {\n\t\tif (this.currentRoom.isExit() && this.currentRoom.getMonsters().isEmpty()) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public void endGame() {\n\r\n\t\tplaying = false;\r\n\t\tstopShip();\r\n\t\tstopUfo();\r\n\t\tstopMissle();\r\n\t}", "public boolean isStopped(){\n return (currentSpeed == 0);\n }", "public boolean shouldStop() {\r\n return this.stop;\r\n }", "public boolean shouldStop() {\r\n return this.stop;\r\n }", "protected boolean isFinished() {\n\t\treturn false;\n\t\t//return timeOnTarget >= finishTime;\n }", "public boolean getStop() {\n\t\treturn end == 5;\n\t}", "protected boolean isFinished() {\r\n \tif (manipulator.isHighSwitchPressed() && speed > 0 ||\r\n \t\tmanipulator.isLowSwitchPressed() && speed < 0)\r\n \t\treturn true;\r\n \t\r\n \treturn isTimedOut();\r\n \t\r\n// \tif (targetHeight > startHeight) {\r\n// \t\treturn manipulator.getAverageElevatorHeight() >= targetHeight;\r\n// \t} else {\r\n// \t\treturn manipulator.getAverageElevatorHeight() <= targetHeight;\r\n// \t}\r\n }", "protected boolean isFinished() {\n return (System.currentTimeMillis() - startTime) >= time;\n \t//return false;\n }", "protected boolean isFinished() {\n logger.info(\"Ending left drive\");\n \treturn timer.get()>howLongWeWantToMove;\n }", "boolean checkEndGame() throws RemoteException;", "@Override\n public boolean isFinished() {\n if (numBalls == -1) {\n return false;\n } else {\n return ballsShot >= numBalls;\n }\n }", "public boolean isGameFinished() {\r\n return gameFinished;\r\n }", "protected boolean isFinished() {\n \t//ends \n \treturn isTimedOut();\n }", "public boolean isStop() {\n\t\treturn stop;\n\t}", "public boolean hasEnded() {\n\t\treturn ended;\n\t}", "public boolean isStopped()\r\n\t{\r\n\t\treturn currentstate == TIMER_STOP;\r\n\t}", "protected boolean isFinished() {\n \t\n \tif(current_time >= goal) {\n \t\t\n \t\treturn true;\n \t}else {\n \t\t\n \t\treturn false;\n \t}\n }", "protected boolean isFinished() {\n\t\treturn Robot.gearIntake.getPegSwitch();\n\t}", "boolean isStopped();", "protected boolean isFinished() {\n return System.currentTimeMillis() - timeStarted >= timeToGo;\n }", "protected void end() {\n Robot.shooter.set(0);\n RobotMap.Armed=false;\n RobotMap.shootState=false;\n System.out.println(\"done shooting\");\n if (this.isTimedOut()==true) {\n System.out.println(\n \"shot timed out\");\n \n }\n if (RobotMap.inPosition.get()!=OI.shooterArmed){\n System.out.println(\"in position is different than shooter armed\");\n }\n}", "public boolean shouldStop() {\n return this.stop;\n }", "public boolean isFinished() {\n\t\t// the word is guessed out only when the unrevealedSlots is 0\n\t\tif (this.unrevealedSlots == 0) {\n\t\t\treturn true;\n\t\t}else {\n\t\t\treturn false;\n\t\t}\n\t}", "public boolean shouldStop() {\n return this.shouldstop;\n }", "@Test\n public void endGameDetectionFalse() {\n logic.setDirection(1);\n assertTrue(logic.gameLogic());\n }", "public void finishGame() {\r\n gameFinished = true;\r\n }", "protected boolean isFinished() {\n return Robot.m_elevator.onTarget();\n }", "protected boolean isFinished() {\n \tdouble changeInX = targetX - Robot.sensors.getXCoordinate();\n \tdouble changeInY = targetY - Robot.sensors.getYCoordinate();\n \tdouble distance = Math.sqrt(Math.pow(changeInX, 2) + Math.pow(changeInY, 2));\n return distance < 8 || System.currentTimeMillis() >= stopTime;\n }", "public Boolean isEnd() {\n\t\t// keep running\n\t\tif (currentNo == -1) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// car production for this production line is done\n\t\telse if (currentNo >= expectedNo) {\n//\t\t\tSystem.out.println(\"isEnd of car Production line is \");\n//\t\t\tSystem.out.print(currentNo >= expectedNo);\n\n\t\t\treturn true;\n\t\t} else {\n//\t\t\tSystem.out.println(\"isEnd of car Production line is \");\n//\t\t\tSystem.out.print(currentNo >= expectedNo);\n\t\t\treturn false;\n\t\t}\n\n\t}", "public boolean isEndGameDelay() {\n\t\treturn endGameDelay;\n\t}", "@Override\n public boolean isFinished() {\n \n boolean thereYet = false;\n\n double time = timer.get();\n\n \n if (Math.abs(targetDistance - distanceTraveled) <= 4){\n\n thereYet = true;\n\n // else if(Math.abs(targetDistance - distanceTraveled) <= 24){\n\n //shifter.shiftDown();\n \n //}\n\n \n\n } else if (stopTime <= time - startTime){\n\n thereYet = true;\n }\n SmartDashboard.putNumber(\"Distance Traveled\", distanceTraveled);\n\n return thereYet;\n\n }", "private void endGame() {\r\n\t\t// Change state (if not already done)\r\n\t\tstate = GameState.STOPPED;\r\n\t\t\r\n\t\t// End simulator\r\n\t\tsimulator.endGame();\r\n\t}", "boolean isGameComplete();", "protected boolean isFinished() {\r\n\t\t \tboolean ans = false;\r\n\t\t \treturn ans;\r\n\t\t }", "public void stop() {\n\t\t\n\t\tif(stop){\n\t\t\tGameError error=new GameError(\"The game already has been stopped\");\n\t\t\t\t\n\t\t\t\tnotifyObservers(new GameEvent<S, A>(EventType.Stop,null,currentState,\n\t\t\t\t\terror,\"The game already has been stopped\"));\n\t\t\t\n\t\t\tthrow error;\n\t\t}else{\n\t\t\tstop=true;\n\t\t\tnotifyObservers(new GameEvent<S, A>(EventType.Stop,null,currentState,null,\"The game has been stopped\"));\n\t\t}\n\t\t\n\t}", "public boolean isStopped();", "@Override\n public boolean isEnding() {\n return false;\n }", "public boolean ended() {\r\n\t\tif (System.nanoTime() >= timeKeyB) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "protected boolean isFinished() {\n \tif(Math.abs(Robot.driveTrain.getHeading() - targetDirection) < 2) {\n \t\treturn true;\n \t} else {\n \t\treturn false;\n \t}\n }", "public boolean verifyEndGame(Player gamer);", "public boolean shouldStop() {\n boolean isToStop = stop; // check if needs to stop\n stop = false; // update the flag for future use not to stop\n return isToStop;\n }", "protected boolean isFinished()\n {\n return timer.get() > driveDuration;\n }", "private void checkEndGame() {\n if (field.getStackSize() == (field.getPegCount() - 1)) {\n endGame = true;\n }\n }", "protected boolean isFinished() {\n \treturn Robot.lift.isMotionMagicNearTarget() || totalTimer.get() > 5.0;\n }", "protected boolean isFinished() {\n \tif(timer.get()>.7)\n \t\treturn true;\n \tif(Robot.gearX==0)\n \t\treturn true;\n return (Math.abs(173 - Robot.gearX) <= 5);\n }", "protected boolean isFinished() {\n \tif (moving) return Robot.armPiston.getMajor() != PistonPositions.Moving; /* && Robot.armPiston.getMinor() != PistonPositions.Moving; */\n \treturn true;\n }", "protected boolean isFinished() {\n \tif(Robot.oi.btnIdle.get()) {\n \t\treturn CommandUtils.stateChange(this, new Idle());\n \t}\n\n \tif( Robot.oi.btnShoot.get()) {\n \t\treturn CommandUtils.stateChange(this, new Shooting()); \n \t}\n \t\n \tif(Robot.oi.btnUnjam.get()){\n \t\treturn CommandUtils.stateChange(this, new Unjam());\n \t}\n return false;\n }", "protected boolean isFinished() {\n \tif (Robot.clawElevator.getContainerHeight() == 0) {\n \t\treturn Robot.clawElevator.getLowerSwitch();\n \t} else {\n \t\treturn Robot.clawElevator.getLowerSwitch() || Robot.clawElevator.isAtIntemediateStop(Math.abs(Robot.clawElevator.getContainerHeight() - 3), false);\n \t}\n }", "public void gameEnded() {}", "private void gameFinished() {\n\n\t\tisFinished = true;\n\t\touter: for (int x = 0; x < worldWidth; x++) {\n\t\t\tfor (int y = 0; y < worldHeight; y++) {\n\t\t\t\tif (!(tileArr[x][y].isOpened() || (tileArr[x][y].hasBomb() && tileArr[x][y]\n\t\t\t\t\t\t.hasFlag()))) {\n\t\t\t\t\tisFinished = false;\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected boolean isFinished() {\n \t//System.out.println(\"FINISHED\");\n \tif(sizeArray.length>0)\n \t\treturn sizeArray[0]>targetSize;\n else\n \treturn noBubbles;\n \t\n \t\n }", "protected synchronized boolean shouldStop() {\n\t\treturn shouldStop_;\n\t}", "public boolean stopped() {\n\t\tif (change != null) {\n\t\t\t//Check if the bot's current speed is very low, and it wasn't before\n\t\t\treturn (getVelocity() < 0.01 && change.getVelocity() > 0.01);\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n \t}", "@Override\n\tpublic void gameStopped() {\n\t}", "boolean hasStopped()\n {\n if (running && ! isAlive())\n {\n nextStartTime = System.currentTimeMillis() + minDurationInMillis;\n running = false;\n return true;\n }\n return false;\n }", "public final boolean isFinish() {\n return finish;\n }", "public boolean isFinished() { \n // Check how much time has passed\n int passedTime = millis()- savedTime;\n if (passedTime > totalTime) {\n return true;\n } else {\n return false;\n }\n }", "protected boolean isFinished()\n\t{\n\t\treturn false;\n\t}", "@Override\n protected boolean isFinished() {\n return timeSinceInitialized() > 0.5 && Robot.toteLifterSubsystem.isEjectorExtended();\n }", "public boolean hasEnded() {\n return mEnded;\n }", "@Test\n public void shouldFinishedGameBeFalseWhenStartingGame() {\n boolean expResult = true ;\n boolean result = scoreService.isEndGame() ;\n assertEquals(expResult, result) ;\n }", "protected boolean isFinished() {\n\t\tif(switchSide) {\n\t\t\treturn !launchCubeSwitch.isRunning() && state == 4;\n\t\t}\n\t\telse if(scaleSide) {\n\t\t\treturn !launchCubeScale.isRunning() && state == 4;\n\t\t}\n\t\telse {\n\t\t\treturn !crossLine.isRunning() && timer.get() > 1;\n\t\t}\n\t}", "public boolean stop();", "protected boolean isFinished() {\r\n \tif (i >= 1 || i <= 1){\r\n \treturn true;\r\n \t}\r\n\t\treturn false;\r\n }", "public boolean canEndTurn() {\n\t\tif (hasMoved || hasCaptured) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public final boolean isFinish() {\n return finish;\n }", "protected boolean isFinished() {\n\t\tif (_timesRumbled == 40) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "protected boolean isFinished() {\r\n return isTimedOut();\r\n }", "private void gameTimerOnFinish() {\n if (currentScreenGameState == GameState.PLAYING) {\n stopGame();\n }\n }", "protected boolean isFinished() {\n\t\treturn false;\r\n\t}" ]
[ "0.75873744", "0.7446319", "0.7410915", "0.74003005", "0.73301244", "0.7241401", "0.7233862", "0.7157569", "0.71485317", "0.70840675", "0.708018", "0.7056856", "0.70235896", "0.6976336", "0.6959214", "0.6944475", "0.6937469", "0.6925729", "0.6897346", "0.6896828", "0.687153", "0.68657094", "0.6848701", "0.6839315", "0.6824271", "0.68161863", "0.6815202", "0.6811109", "0.6807888", "0.6807866", "0.6805915", "0.6795442", "0.6790244", "0.67838216", "0.67838216", "0.6775833", "0.6766502", "0.675977", "0.67575854", "0.675166", "0.6750101", "0.67442846", "0.67363125", "0.6733622", "0.6726608", "0.6724966", "0.6723402", "0.6696498", "0.6693915", "0.6693415", "0.6691041", "0.66875464", "0.66861904", "0.6671577", "0.66620773", "0.66526246", "0.6652002", "0.66519046", "0.66312784", "0.66205794", "0.66184956", "0.6613696", "0.6610268", "0.66079515", "0.6607577", "0.6601012", "0.6592342", "0.65879923", "0.6582155", "0.6576307", "0.6573381", "0.6572791", "0.65656596", "0.6555796", "0.65532833", "0.6552975", "0.655183", "0.6549175", "0.65489614", "0.6537508", "0.65359956", "0.65331835", "0.6531358", "0.6526362", "0.6522796", "0.65206105", "0.6519862", "0.650326", "0.64951366", "0.64941263", "0.6491263", "0.6488759", "0.6488598", "0.64823616", "0.64770406", "0.64766884", "0.64765656", "0.647591", "0.6469356", "0.6469195", "0.6459286" ]
0.0
-1
To test the function to get amount of points Which is the function getPoints(). Will be zero as animal is newly generated and not played therefore the point is 0.
@Test public void getPointsTest() { int expextedValue = animal.getPoints(); Assert.assertEquals(expextedValue,0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getPoints();", "int getPoints();", "public abstract int getPoints();", "int getPointsCount();", "public int GetNPoints();", "public int getPoints() { return points; }", "int getNeedPoints();", "public int getPoints() {\n return points;\n }", "public int getPoints() {\n return points;\n }", "public int getPoints() {\n return points;\n }", "public int getPoints() {\n return points;\n }", "int getUsedPoints();", "int getUsedPoints();", "int getUsedPoints();", "public int getPoints(){\r\n\t\treturn this.points;\r\n\t}", "public int getPoints(){\r\n\t\treturn this.points;\r\n\t}", "public int getPointsHealthy()\n {\n return pointsHealthy;\n }", "public int getPoints()\n {\n return (10000 - this.points);\n }", "public int getPoints() {\n return this.points;\n }", "public int getPoints ( Player player );", "@Override\n public int getPoints(){\n\n }", "public int getPoints() {\r\n\t\treturn points;\r\n\t}", "public double pointsEarned();", "public int getPoints() {\r\n\t\treturn this.points;\r\n\r\n\t}", "public int getPoints() {\n\t\treturn points;\n\t}", "@Test\n public void testAddPoints() {\n System.out.println(\"addPoints\");\n int points = ScoreBoard.HARD_DROP_POINTS_PER_ROW * 4 + ScoreBoard.POINTS_PER_LINE;\n instance.addPoints(points);\n int result = instance.getPoints();\n int expResult = 108;\n assertEquals(result, expResult);\n }", "public int getPoints() {\n\t\treturn this.points;\n\t}", "int getRemainPoints();", "public int getNeedPoints() {\n return needPoints_;\n }", "public int getNbPoints() {\n return nbPoints;\n }", "final public int getPoints() {\r\n\t\tif (wildcard) {\r\n\t\t\treturn 20;\r\n\t\t}\r\n\t\t\r\n\t\tif (isJoker()) {\t\t\t\r\n\t\t\treturn 50;\r\n\t\t}\r\n\t\t\r\n\t\treturn face;\r\n\t}", "public int getNeedPoints() {\n return needPoints_;\n }", "@Test\r\n public void testAddAndGetPoints() {\r\n Player player = new Player();\r\n int expResult = 0;\r\n int result = player.getPoints();\r\n assertEquals(expResult, result);\r\n \r\n \r\n player.addPoints(10);\r\n int expResult2 = 10;\r\n int result2 = player.getPoints();\r\n assertEquals(expResult2, result2);\r\n\r\n }", "public Integer getPoints() {\r\n return points;\r\n }", "public int getUsedPoints() {\n return usedPoints_;\n }", "public int getUsedPoints() {\n return usedPoints_;\n }", "public int getUsedPoints() {\n return usedPoints_;\n }", "public int getPoints() {\r\n\t\treturn levelManager.getPoints();\r\n\t}", "public void countPoints() {\n points = 0;\n checkAnswerOne();\n checkAnswerTwo();\n checkAnswerThree();\n checkAnswerFour();\n checkAnswerFive();\n checkAnswerSix();\n checkAnswerSeven();\n checkAnswerEight();\n checkAnswerNine();\n checkAnswerTen();\n }", "public int returnPoints()\n {\n return score ;\n }", "public int getNPoints() {\n\t\treturn points.size();\n\t}", "public int points() {\n\t\treturn cards[0].points() + cards[1].points() + cards[2].points();\n\t}", "@Override\r\n\tpublic int getPoints() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\treturn this.points;\r\n\t}", "public int getEatPoints() {\n return localEatPoints;\n }", "public int getUsedPoints() {\n return usedPoints_;\n }", "public int getUsedPoints() {\n return usedPoints_;\n }", "public int getUsedPoints() {\n return usedPoints_;\n }", "public int getPointCount() {\n return(_pts.length);\n }", "public int getLifePoints(){\n return this.lifePoints;\n }", "public double getPoints()\r\n {\r\n return points;\r\n }", "Float getTotalPoints();", "@Test\r\n void testGetPointsZeroPoints() {\r\n AlwaysDefect testStrat = new AlwaysDefect();\r\n int points = testStrat.getPoints();\r\n assertEquals(points, 0, \"getPoints not returning correctly when 0 points\");\r\n }", "public int getPoints() {\n return this.difficulty;\n }", "public LiveData<Integer> getPoints() {\n Log.d(\"berttest\", \"getPoints works\");\n return points;\n }", "public int getTreasurePoints(){\n return treasurePoints;\n }", "private static int gainStatPoints(int statPoints){\r\n statPoints++;\r\n System.out.println(\"You have \" + statPoints + \" stat points available.\");\r\n return statPoints;\r\n }", "int calculatePoints(IYatzyHand hand, HandType type);", "@Override\n\tpublic void spendPoints(int points) {\n\n\t}", "@Test\r\n void testAddPoints() {\r\n AlwaysDefect testStrat = new AlwaysDefect();\r\n testStrat.addPoints(2);\r\n int points = testStrat.getPoints();\r\n assertEquals(points, 2, \"addPoints or getPoints not functioning correctly\");\r\n }", "public int getVictoryPoints() {\n \t\treturn getPublicVictoryPoints() + victory;\n \t}", "@JsonIgnore\r\n public int getPoints(){\r\n int lPoints = 0;\r\n for (CFantasyTeamByWeek lFantasyTeamByWeek : mFantasyTeamsByWeek){\r\n lPoints += lFantasyTeamByWeek.getPoints();\r\n }\r\n return lPoints;\r\n }", "public int getPoints(){\n\t\t//add the player socres(including monster killing, powerUp points and winning points\n\t\tint points = this.player.getScore() + 200*this.player.getHealth();\n\t\t\n\t\t//since the better the less time used, we use 600 seconds to minus the total seconds being used\n\t\t//and add it to the points\n\t\t//600 seconds is 10 minutes, which is definity long enough\n\t\t//if exceeds 10 minutes, we will subtract total score\n\t\tif(this.player.win()){\t//only if the player wins will we calculate the time\n\t\t\tpoints += (int)(3600 - (this.time / 1000000000));\n\t\t}\n\t\t\n\t\tthis.totalLabel.setText(String.valueOf(points));\t//set the value of the JLabel\n\t\t\n\t\treturn points;\n\t\t\n\t}", "public int getTotalPoint() {\n int totalPoint = 0;\n\n for (Card card : personHand) {\n totalPoint += card.getRank().getValue();\n\n if (card.getRank().equals(Rank.ACE) && totalPoint <= 11) {\n totalPoint += 10;\n }\n }\n\n return totalPoint;\n\n // TESTING ALL BLACKJACK\n// return 21;\n // TESTING ALL BUST\n// return 99;\n // TESTING ALL PUSH\n// return 10;\n }", "public int getPointsP() {\r\n\r\n pointsP = getPointsPlayer() + getPointsPlayer2();\r\n\r\n if (pointsP >= 10) {\r\n pointsP -= 10;\r\n }\r\n return pointsP;\r\n }", "public int numPoints() {\n\t\treturn divided ? -1 : points.size();\n\t}", "public int getPointsGainedLastRound(){return pointsGainedLastRound;}", "public int purchasePoints() {\n return purchasePoints;\n }", "private void getPoints()\n\t{\n\t\ttotalEntered = statsCollector.getTotalEnteredPoints();\n\t\taverageWait = statsCollector.getAverageWaitPoints();\n\t\tmaxWait = statsCollector.getMaxWaitPoints();\n\t\ttimeAlive = statsCollector.getTimeAlivePoints();\n\t}", "public int size()\n {\n return points.size();\n }", "@Override\n public int getPoints(final ShipEvent event) {\n return 0;\n }", "int getActionPoints(Unit unit);", "public int size() {\n return points.size();\n }", "public int getPlayPoints() {\n return localPlayPoints;\n }", "public int getPoint(){\n return point;\n }", "public int getP1Points() {\n return p1Points;\n }", "public int getVictoryPoints() {\n\t\treturn this.totalVictoryPoints;\n\t}", "public int getPoints() {\n\t\treturn oxygenPoints;\n\t}", "public void addPoint() {\n points += 1;\n }", "private static List<Point> genererPointsAlea(int nbPoints) {\n /*List<Point> points = new ArrayList<>();\n Random rand = new Random(0);\n for(int i=0; i<nbPoints; i++) {\n Point p = new Point(rand.nextDouble(), rand.nextDouble());\n points.add(p);\n }\n return points;*/\n return null;\n }", "public int size () {\n\t\treturn points.size();\n\t}", "public int size() {\n return this.points.size();\n }", "public int getHitPoints() {\n return hitPoints;\n }", "public int getPoints(String name) {\n int points = 0;\n ArrayList<IAgent> iAgentList = playersAgentsMap.get(name);\n for (Iterator<IAgent> iterator2 = iAgentList.iterator(); iterator2.hasNext();) {\n IAgent iAgent = iterator2.next();\n try {\n points = points + iAgent.getPoints();\n } catch (RemoteException e) {\n e.printStackTrace();\n }\n }\n return points;\n }", "public double getF_NumOfPoints() {\n return f_numOfPoints;\n }", "public int size() {\n\t\treturn points.size();\n\t}", "public final int size() {\n return points.size();\n }", "public void countAllPoints() {\n\t\tfor(ClientThread player: players) {\n\t\t\tplayer.points = PointCounter.countPoint(player.clientCards);\n\t\t\tview.writeLog(player.name+\" : \"+player.points);\n\t\t}\n\t}", "public int getPublicVictoryPoints() {\n \t\tint points = towns + 2 * cities;\n \n \t\tif (board.hasLongestRoad(this))\n \t\t\tpoints += 2;\n \n \t\tif (board.hasLargestArmy(this))\n \t\t\tpoints += 2;\n \n \t\treturn points;\n \t}", "public void setPoints(int points) {\n this.points = points;\n }", "public int getScorePoints() {\n/* 75 */ return this.scorePoints;\n/* */ }", "public String getPoints();", "public long getPointsTotal()\n {\n return pointsTotal;\n }", "public int getExperiencePoints() {\n return experiencePoints;\n }", "public abstract int getSpotsNeeded();", "public int getHitPoints() {\n return this.counter;\n }", "private int getPoints(final String name) {\n\t\treturn getValue(name, POINTS);\n\t}", "public int size() {\n return mPoints.size();\n }", "int getPointLength();", "public int getPointsFor() {\n int pointsFor = 0;\n for (Game g : gameList) {\n pointsFor += g.getTeamScore(this);\n }\n return pointsFor;\n }", "protected int getExperiencePoints(PlayerEntity player) {\n return super.getExperiencePoints(player);\n }" ]
[ "0.7914272", "0.7844073", "0.7808251", "0.7784872", "0.77010834", "0.7675735", "0.763699", "0.7423918", "0.7423918", "0.7423918", "0.7423918", "0.74164945", "0.74164945", "0.74164945", "0.74038464", "0.74038464", "0.7385608", "0.735103", "0.7348664", "0.734675", "0.7274592", "0.72551334", "0.7199141", "0.7176908", "0.71668386", "0.71406853", "0.71192205", "0.7077588", "0.7031362", "0.7005712", "0.6999569", "0.69789046", "0.69656515", "0.6929463", "0.68964136", "0.68964136", "0.68964136", "0.68911004", "0.6868547", "0.68634874", "0.68629485", "0.684713", "0.6842954", "0.683926", "0.68218607", "0.68218607", "0.68218607", "0.6819396", "0.6794534", "0.67908084", "0.6786418", "0.675593", "0.67008865", "0.670056", "0.6667967", "0.6648784", "0.66481245", "0.6598985", "0.6589235", "0.6588926", "0.6581538", "0.65774083", "0.6573381", "0.6561307", "0.65575266", "0.654722", "0.654671", "0.6527545", "0.6525076", "0.64717054", "0.644487", "0.64442223", "0.6444036", "0.64425266", "0.64368975", "0.6418009", "0.641397", "0.63966954", "0.63713574", "0.63701963", "0.63501346", "0.63436055", "0.6340647", "0.6334309", "0.632824", "0.632135", "0.63186306", "0.63142717", "0.63112634", "0.63057876", "0.630461", "0.629802", "0.629793", "0.62860006", "0.62838906", "0.6282091", "0.6275204", "0.627207", "0.62600255", "0.62592345" ]
0.836912
0
To test the function to check is the points has been changed. Which is the function changeScore(). Will be false as there won't be any change in score
@Test public void changeScoreTest() { //will be false as animal is not moving boolean expectedValue = animal.changeScore(); Assert.assertEquals(expectedValue,false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void checkScore() {\n\t\t\n\t}", "@Test\n public void addScoreTest() {\n assertTrue(enemyGameBoard.getScore() == 0); //Check if initial value of points = 0\n\n enemyGameBoard.addScore(false, false); //Did not hit a ship\n assertTrue(enemyGameBoard.getScore() == 0);\n\n enemyGameBoard.addScore(true, false); //Hit a ship, but the ship did not sink\n assertTrue(enemyGameBoard.getScore() == 1); \n\n enemyGameBoard.addScore(false, false); //Did not hit a ship, so points should stay 1\n assertTrue(enemyGameBoard.getScore() == 1); \n\n enemyGameBoard.addScore(true, true); //Hit a ship, and ship has been sunk\n assertTrue(enemyGameBoard.getScore() == 3);\n\n enemyGameBoard.addScore(false, false); //Did not hit a ship, so points should stay 3 after a ship has been sunk\n assertTrue(enemyGameBoard.getScore() == 3);\n\n enemyGameBoard.addScore(false, true); //Did not hit a ship, but did sunk the ship. This should not add any points to the score\n assertTrue(enemyGameBoard.getScore() == 3);\n }", "@Test\r\n\tpublic void incrementScoretest() \r\n\t{\r\n\t\tscoreBehavior.incrementScore();\r\n\t\tassertEquals(1, scoreBehavior.score());\r\n\t\t\r\n\t\tscoreBehavior.incrementScore();\r\n\t\tassertEquals(2, scoreBehavior.score());\r\n\t}", "public void score() {\n\t\tif (Integer.parseInt(px.getPosition()) != Integer.parseInt(getCurrentPositionX()))\n\t\t{\n\t\t\tpx.addObserver(Obsx);\n\t\t\tpx.setPosition(getCurrentPositionX());\n\t\t}\n\t\tif (Integer.parseInt(py.getPosition()) != Integer.parseInt(getCurrentPositionY()))\n\t\t{\n\t\t\tpy.addObserver(Obsy);\n\t\t\tpy.setPosition(getCurrentPositionY());\n\t\t}\n\t}", "@Test\n void updateScore() {\n ArrayList<Player> pl = new ArrayList<>();\n AlphaGame g = new AlphaGame(1, pl,false, 8);\n\n RealPlayer p = new RealPlayer('b', \"ciccia\");\n p.setTurn(true);\n p.updateScore(3);\n assertTrue(p.getScore()==3);\n\n p = new RealPlayer('b', \"ciccia\");\n p.updateScore(-1);\n assertTrue(p.getScore()==0);\n }", "private void pointsChecker(Points score) {\n boolean correct_Form=true;;\n try {\n Number = Integer.parseInt(scorefield.getText());\n\n } catch (Exception e) {\n reset(true);\n JOptionPane.showMessageDialog(frame, \"Not a correct input\");\n reset(false);\n correct_Form=false;\n\n\n }\n if (Number<0) {\n reset(false);\n JOptionPane.showMessageDialog(frame, \"Score can't be lower than 0\");\n }\n else if (Number>30) {\n reset(false);\n JOptionPane.showMessageDialog(frame, \"Score can't be greater than 30\");\n\n }\n else if (correct_Form){\n if(W.isSelected()) {\n\n score.increasePointsOfWe(Number,mee.isSelected(),tegen.isSelected());\n mee.setSelected(false);\n tegen.setSelected(false);\n }\n else if(Z.isSelected()) {\n score.increasePointsOfThem(Number,mee.isSelected(),tegen.isSelected());\n mee.setSelected(false);\n tegen.setSelected(false);\n }\n reset(true);\n JOptionPane.showMessageDialog(frame, score.toString());\n\n\n }\n }", "public void updatescore() {\n scorelabel.setText(\"\" + score + \" points\");\n if (100 - score <= 10) win();\n }", "@Override\r\n\tpublic boolean updateScore(int score) {\n\t\ttry {\r\n\t\t\tconn = DriverManager.getConnection(URL, USER, PASS);\r\n\t\t\tString sql = \"update member set score=score+\"+score+\" where id='\"+LoginServiceImpl.getCurrentUser().getID()+\"'\";\r\n\t\t\tps = conn.prepareStatement(sql);\r\n\t\t\t\r\n\t\t\tif(ps.executeUpdate()==0) {\r\n\t\t\t\treturn false;\r\n\t\t\t}else\r\n\t\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\r\n\t}", "void onScoresChanged(int scores);", "public static void reCalculateScore(Player player, int roundIn, boolean scoreChanged) {\r\n\t\t// TODO Auto-generated block\r\n\t}", "protected abstract boolean canGenerateScore();", "@Test\r\n\tpublic void hasScoreTest() \r\n\t{\r\n\t\tassertTrue(scoreBehavior.hasScore());\r\n\t}", "@Test\n void should_first_player_win_and_finish_the_game_when_second_player_has_score_5() {\n List<Integer> setPointOrderTab = Arrays.asList(2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 1); // 7-5\n\n //WHEN\n game.computePoint(setPointOrderTab, true);\n\n //THEN\n assertTrue(firstPlayer.isWinner());\n assertEquals(GameStatus.FINISHED, game.getGameStatus());\n }", "public static void reCalculateScore(Player player, Team team, int roundIn,\r\n\t\t\tboolean scoreChanged) {\r\n\t\t// TODO Auto-generated block\r\n\t}", "@Test\r\n public void calculateScore() {\r\n board3.swapTiles(0,0,1,1);\r\n board3.getSlidingScoreBoard().setTime(2);\r\n board3.getSlidingScoreBoard().calculateScore();\r\n assertEquals(496, board3.getSlidingScoreBoard().getScore());\r\n }", "public void setScore(int newScore){\n\t\tthis.score = newScore;\n\t}", "public void checkScore() {\n\n whatIsTurnScore();\n\n if (turn == 1) {\n\n if ((p1.getScore() - turnScore < 0) || (p1.getScore() - turnScore == 1)) {\n newScore.setText(null);\n\n displayScore();\n\n\n Toast.makeText(this, \"Bust\", Toast.LENGTH_SHORT).show();\n } else if (p1.getScore() - turnScore > 1) {\n if ((turnScore > 99) && (turnScore < 140)) {\n p1.setHundres(p1.getHundres() + 1);\n } else if ((turnScore > 139) && (turnScore < 180)) {\n p1.setOneforties(p1.getOneforties() + 1);\n } else if (turnScore == 180) {\n p1.setOneeighties(p1.getOneeighties() + 1);\n }\n calculateScore();\n\n\n displayScore();\n } else if (p1.getScore() - turnScore == 0) {\n p1.setScore(0);\n }\n }\n\n if (turn == 2) {\n if ((p2.getScore() - turnScore < 0) || (p2.getScore() - turnScore == 1)) {\n newScore.setText(null);\n teamBCheckout.setText(checkOut(p2.getScore()));\n displayScore();\n\n\n Toast.makeText(this, \"Bust\", Toast.LENGTH_SHORT).show();\n } else if (p2.getScore() - turnScore > 1) {\n\n if ((turnScore > 99) && (turnScore < 140)) {\n p2.setHundres(p2.getHundres() + 1);\n } else if ((turnScore > 139) && (turnScore < 180)) {\n p2.setOneforties(p2.getOneforties() + 1);\n } else if (turnScore == 180) {\n p2.setOneeighties(p2.getOneeighties() + 1);\n }\n calculateScore();\n\n displayScore();\n\n } else if (p2.getScore() - turnScore == 0) {\n p2.setScore(0);\n }\n\n }\n\n\n }", "@Override\n\tpublic void updateScoreAfterTest(Score score2) {\n\t\tscoreDao.updateScoreAfterTest(score2);\n\t}", "public void updateScore(){\n scoreChange++;\n if(scoreChange % 2 == 0){\n if(score_val < 999999999)\n score_val += 1;\n if(score_val > 999999999)\n score_val = 999999999;\n score.setText(\"Score:\" + String.format(\"%09d\", score_val));\n if(scoreChange == 10000)\n scoreChange = 0;\n }\n }", "@And(\"^score is updated$\")\n public void scoreIsUpdated() throws Throwable {\n throw new PendingException();\n }", "public void updateScore() {\n\t\tif (pellet.overlapsWith(avatar)) {\n\t\t\tavatar.addScore(1);\n\t\t\tpellet.removePellet(avatar.getLocation());\n\t\t\tSystem.out.println(\"collected pellet\");\n\t\t}\n\t}", "public void setScore (int newScore)\n {\n this.score = newScore;\n }", "public void updateScore(){\r\n if (this.isArtist || winners.contains(this)) {\r\n this.score += pointsGainedLastRound;\r\n }\r\n pointsGainedLastRound = 0;\r\n placeLastRound = 0;\r\n }", "@Override\npublic void update(int score) {\n\t\n}", "void setPointChange(Integer setPoint, Integer expectedValue);", "void increaseScore(){\n\t\t currentScore = currentScore + 10;\n\t\t com.triviagame.Trivia_Game.finalScore = currentScore;\n\t }", "@Test\r\n\tpublic final void testGetScore() {\r\n\t\tassertTrue(gameStatistics.getScore() == 18000);\r\n\t\tassertTrue(gameStatisticsLoss.getScore() == 9100);\r\n\t}", "boolean hasScoreUpdateResponse();", "public boolean addScoreTeamOne(int points) throws ByeMatchException\r\n\t{\r\n\t\tif (isByeMatch)\r\n\t\t{\r\n\t\t\tthrow new ByeMatchException();\r\n\t\t}\r\n\t\tscore1 = score1 + points;\r\n\t\treturn true;\r\n\t}", "@Override\n public void updateScore(String currentScore) {\n if (currentScore == null){\n this.notifyObservers(\"Error while fetching score\");\n }\n else {\n this.currentScore = currentScore;\n this.notifyObservers();\n }\n }", "void losePoints() {\n if (currentPoints >= POINTSGIVEN) {\n currentPoints -= POINTSGIVEN;\n feedback = \"Your current rating is: \" + currentPoints + \"%\";\n }\n }", "public void updateScore(int score){ bot.updateScore(score); }", "private void updateScore(int point) {\n SharedPreferences preferences = getSharedPreferences(SHARED_PREFERENCES, MODE_PRIVATE);\n SharedPreferences.Editor editor = preferences.edit();\n editor.putInt(SCORE_KEY, mScore);\n\n }", "public void increaseScore(final int score) {\n setChanged();\n notifyObservers(new Pair<>(\"increaseScore\", score));\n }", "public void calculateScore() {\n\n turnScore();\n\n if (turn == 1) {\n p1.setScore(p1.getScore() - turnScore);\n\n } else if (turn == 2) {\n p2.setScore(p2.getScore() - turnScore);\n\n }\n\n\n }", "public void setScore(double score) {\r\n this.score = score;\r\n }", "public boolean checkScore() {\r\n return !(this.scoreTable.getRank(this.score.getValue()) > this.scoreTable.size());\r\n }", "public void effacerScore() {\r\n\t\tthis.meilleursScores = new MeilleursScores();\r\n\t\tthis.notifyObservateur();\r\n\t}", "private void checkScore() {\n // Score is made\n if ((this.ball.getX() < 0) || (this.ball.getX() > getWidth())) {\n // Play R.raw.bleep\n soundPool.play(soundIds[1], 1, 1, 1, 0, 1);\n\n this.touchEnabled = false;\n this.pongThread = new GameThread(this, getHolder(), true);\n\n // Right scores\n if (this.ball.getX() < 0) {\n this.scoreR.update();\n // Left scores\n } else if (this.ball.getX() > getWidth()) {\n this.scoreL.update();\n }\n\n // Reset positions of sprites\n this.paddleL.setX(PADDLE_WALL_DIST);\n this.paddleL.setY(getHeight()/2 - PADDLE_HEIGHT);\n this.paddleR.setX(getWidth() - PADDLE_WALL_DIST - PADDLE_WIDTH);\n this.paddleR.setY(getHeight()/2 - PADDLE_HEIGHT);\n this.ball.setX(getWidth()/2 - 16 - BALL_DIAMETER/2);\n this.ball.setY(getHeight()/2 - BALL_DIAMETER /2);\n this.ball.setEnabled(false);\n this.fakeBall.setX(getWidth()/2 - 16 - BALL_DIAMETER/2);\n this.fakeBall.setY(getHeight()/2 - BALL_DIAMETER /2);\n this.fakeBall.setEnabled(false);\n\n checkWin();\n }\n }", "public void checkScore() {\n\t\tif (this.score != 0 && this.score % 5000 == 0\n\t\t\t\t&& this.life < this.MAX_LIFE) {\n\t\t\tthis.life++;\n\t\t}\n\t}", "public boolean setScoreTeamOne(int score)\r\n\t{\r\n\t\tif (!editableMatch)\r\n\t\t\treturn false;\r\n\t\tscore1 = score;\r\n\t\treturn true;\r\n\t}", "public static void incrementScore() {\n\t\tscore++;\n\t}", "@Test\n public void testScoreUpdate() {\n try {\n final BestEvalScore score = new BestEvalScore(\"thjtrfwaw\");\n double expected = 0;\n assertEquals(\"Incorrect score!\", expected , score.get(), 1e-10);\n final Evaluation eval = new Evaluation(2);\n eval.eval(0,1);\n eval.eval(1,1);\n\n expected = eval.accuracy();\n score.accept(eval);\n assertEquals(\"Incorrect score!\", expected , score.get(), 1e-10);\n\n eval.eval(0,1);\n score.accept(eval);\n assertEquals(\"Incorrect score!\", expected , score.get(), 1e-10);\n\n eval.eval(1,1);\n eval.eval(1,1);\n expected = eval.accuracy();\n score.accept(eval);\n assertEquals(\"Incorrect score!\", expected , score.get(), 1e-10);\n\n\n\n } catch (IOException e) {\n throw new IllegalStateException(\"Failed to create instance!\", e);\n }\n\n\n }", "@Override\n\tpublic void inputScore() {\n\n\t}", "public void changeScore(String score) {\n typeScore(score);\n saveChanges();\n }", "public void newScore()\n {\n score.clear();\n }", "public void setScore(int pointsToAdd) {\n\n\t\t//Add the additional points to the existing score\n\t\tthis.score = this.score + pointsToAdd;\n\t}", "public void setScore(int score) { this.score = score; }", "void addPointsToScore(int points) {\n score += points;\n }", "private void updateScore(int changeScore) {\n score += changeScore;\n scoreText = \"Score: \" + score + \"\\t\\tHigh Score: \" + highScore;\n scoreView.setText(scoreText);\n }", "@Test\r\n\tpublic void decrementScoreTest() \r\n\t{\r\n\t\tscoreBehavior.decrementScore();\r\n\t\tassertEquals(-1, scoreBehavior.score());\r\n\t\t\r\n\t\tscoreBehavior.incrementScore();\r\n\t\tassertEquals(0, scoreBehavior.score());\r\n\t\t\r\n\t\tscoreBehavior.incrementScore();\r\n\t\tassertEquals(1, scoreBehavior.score());\r\n\t\t\r\n\t\tscoreBehavior.incrementScore();\r\n\t\tassertEquals(2, scoreBehavior.score());\r\n\t\t\r\n\t\tscoreBehavior.decrementScore();\r\n\t\tassertEquals(1, scoreBehavior.score());\r\n\t}", "public void updateScore()\n {\n nextPipe = pipes.get(score);\n if(CHARACTER_X > nextPipe.getPipeCapX() + 35)\n {\n score++;\n }\n if(score > highScore)\n {\n highScore = score;\n }\n }", "public void addPoints(int earnedPoints) {score = score + earnedPoints;}", "private void updateScore(int point){\n sScore.setText(\"\" + mScore + \"/\" + mQuizLibrary.getLength());\n\n }", "protected void checkScore () {\n if (mCurrentIndex == questions.length-1) {\n NumberFormat pct = NumberFormat.getPercentInstance();\n double result = (double) correct/questions.length;\n Toast res = new Toast(getApplicationContext());\n res.makeText(QuizActivity.this, \"Your score: \" + pct.format(result), Toast.LENGTH_LONG).show();\n correct = 0; // resets the score when you go back to first question.\n }\n }", "public abstract boolean higherScoresAreBetter();", "private void checkPoints() {\n if (mPointsManager.getScore() < 20 && !SharedDataManager.isHuntReady(this)) {\n /* Before the 30 points 'reward', player must have no locked target in history */\n if (SharedDataManager.isLockedTargetInHistory(MainActivity.this)) {\n return;\n }\n mPointsManager.setScore(30);\n updateInfo();\n try {\n if (!requestingPoints) {\n requestingPoints = true;\n /* Update the value in the server database if possible */\n mPointsManager.updateInDatabase(MainActivity.this, new ResponseTask.OnResponseTaskCompleted() {\n @Override\n public void onResponseTaskCompleted(Request request, Response response, OHException ohex, Object data) {\n /* It's ok if the request was not successful, the update will be done later */\n requestingPoints = false;\n }\n });\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }", "public void setScore(int score) {this.score = score;}", "public void awardPoints(int points)\n {\n score += points ;\n }", "@Test\n public void scoreExample2() {\n MarbleSolitaireModel exampleBoard = new MarbleSolitaireModelImpl();\n exampleBoard.move(1, 3, 3, 3);\n assertEquals(31, exampleBoard.getScore());\n }", "public void notifyScoreChange(int score) {\n scoreLabel.setText(String.valueOf(score));\n }", "private boolean checkPoints() {\n\n for (Map.Entry pair : playersAgentsMap.entrySet()) {\n ArrayList<IAgent> iAgentList = (ArrayList<IAgent>) pair.getValue();\n\n int points = 0;\n try {\n points = iPlayerList.get(iAgentList.get(0).getName()).getPoints();\n } catch (RemoteException ex) {\n Logger.getLogger(ServerFrame.class.getName()).log(Level.SEVERE, null, ex);\n }\n try {\n for (Component comp : playerList.getComponents()) {\n if (comp instanceof PlayerPanel) {\n PlayerPanel panel = (PlayerPanel) comp;\n if (panel.getName().equals(iAgentList.get(0).getName())) {\n panel.setPlayerPoints(points);\n }\n }\n\n }\n } catch (RemoteException e1) {\n e1.printStackTrace();\n }\n if (points >= targetAmount) {\n try {\n System.out.println(iAgentList.get(0).getName() + \" has won with \" + points + \" points\");\n } catch (RemoteException e) {\n e.printStackTrace();\n }\n return false;\n }\n }\n\n return true;\n }", "public void setScore(Double score) {\n this.score = score;\n }", "@Test\r\n\tpublic void calculLostPointsByRulesTest() {\r\n\t\tAssert.assertEquals(UtilCalculGrade.calculLostPointsByRules(mapConf, mapIssues), new Float(3.5));\r\n\t}", "public void setScore(Float score) {\n this.score = score;\n }", "@Test\n public void scoreExample2() {\n MarbleSolitaireModel exampleBoard = new TriangleSolitaireModelImpl();\n exampleBoard.move(2, 0, 0, 0);\n assertEquals(13, exampleBoard.getScore());\n }", "@Test\r\n\tpublic void testChangeTheOriginalChooseIsBetterThanNotChange() {\r\n\t\tMontyHall monty = new MontyHall();\r\n\t\tmonty.setChanged(true);\r\n\t\tfloat rateOfChange = monty.rateOfWinThePrizeWithChangeTheOriginalChoose(10);\r\n\t\tmonty.setChanged(false);\r\n\t\tfloat rateOfNotChange = monty.rateOfWinThePrizeWithoutChangeTheOriginalChoose(10);\r\n\t\tassertTrue(rateOfChange > rateOfNotChange);\r\n\r\n\t\t/* count is 100 */\r\n\t\tmonty.setChanged(true);\r\n\t\trateOfChange = monty.rateOfWinThePrizeWithChangeTheOriginalChoose(100);\r\n\t\tmonty.setChanged(false);\r\n\t\trateOfNotChange = monty.rateOfWinThePrizeWithoutChangeTheOriginalChoose(100);\r\n\t\tassertTrue(rateOfChange > rateOfNotChange);\r\n\r\n\t\t/* count is 10000 */\r\n\t\tmonty.setChanged(true);\r\n\t\trateOfChange = monty.rateOfWinThePrizeWithChangeTheOriginalChoose(10000);\r\n\t\tmonty.setChanged(false);\r\n\t\trateOfNotChange = monty.rateOfWinThePrizeWithoutChangeTheOriginalChoose(10000);\r\n\t\tassertTrue(rateOfChange > rateOfNotChange);\r\n\r\n\t\t/* count is 1000000 */\r\n\t\tmonty.setChanged(true);\r\n\t\trateOfChange = monty.rateOfWinThePrizeWithChangeTheOriginalChoose(1000000);\r\n\t\tmonty.setChanged(false);\r\n\t\trateOfNotChange = monty.rateOfWinThePrizeWithoutChangeTheOriginalChoose(1000000);\r\n\t\tassertTrue(rateOfChange > rateOfNotChange);\r\n\t}", "private void updateScore(int point){\n mScoreView.setText(\"\" + mScore);\n }", "public Boolean gameIsOver(){\n\n if(playerShipDead || enemyShipDead){\n if(enemyShipDead && !(deathTriggered)){\n deathTriggered = true;\n playerScore += scoreToGain; //This will depend on the enemyShip's score amount. Only affects the display.\n playerGoldAmount += goldToGain;\n //playerShip.setPointsWorth(playerScore); // Doesn't work.\n }\n return true;\n } else {\n return false;\n }\n }", "public void setScore(int score)\n {\n this.score = score;\n }", "void awardPoints(){\n if (currentPoints <= 100 - POINTSGIVEN) {\n currentPoints += POINTSGIVEN;\n feedback = \"Your current rating is: \" + currentPoints + \"%\";\n }\n }", "boolean updateValue() {\n boolean ret;\n\n if (Math.abs(curUtilityValue - nextUtilityValue) < Math.abs(curUtilityValue) * MAX_ERR_PERCENT / 100)\n ret = true;\n else {\n ret = false;\n // System.out.println(\" no match cell: x: \"+x+\" y: \"+y);\n }\n curUtilityValue = nextUtilityValue;\n return ret;\n\n }", "public void setScore(float score) {\n this.score = score;\n }", "public void setScore(String score) {\n this.score = score;\n setChanged();\n notifyObservers();\n }", "public void resetScore();", "private void updateScoreRatios(IGame game, boolean addToTotal) {\n int player1Score = getScore(game, game.getPlayer1());\n int player2Score = getScore(game, game.getPlayer2());\n int difference = Math.abs(player1Score - player2Score);\n\n IPlayer player1 = game.getPlayer1();\n IPlayer player2 = game.getPlayer2();\n\n logger.info(player1 + \" has scored \" + player1Score + \" in total\");\n logger.info(player2 + \" has scored \" + player2Score + \" in total\");\n\n if (player1Score > player2Score) {\n\n if (addToTotal) {\n player1.setScoreRatio(player1.getScoreRatio() + difference);\n player2.setScoreRatio(player2.getScoreRatio() - difference);\n logger.info(player1 + \" +\" + difference + \" = \"\n + player1.getScoreRatio());\n logger.info(player2 + \" -\" + difference + \" = \"\n + player2.getScoreRatio());\n } else {\n logger.info(\"Resetting scores\");\n player2.setScoreRatio(player2.getScoreRatio() + difference);\n player1.setScoreRatio(player1.getScoreRatio() - difference);\n\n logger.info(player2 + \" +\" + difference + \" = \"\n + player2.getScoreRatio());\n logger.info(player1 + \" -\" + difference + \" = \"\n + player1.getScoreRatio());\n }\n\n } else if (player2Score > player1Score) {\n if (addToTotal) {\n player2.setScoreRatio(player2.getScoreRatio() + difference);\n player1.setScoreRatio(player1.getScoreRatio() - difference);\n\n logger.info(player2 + \" +\" + difference + \" = \"\n + player2.getScoreRatio());\n logger.info(player1 + \" -\" + difference + \" = \"\n + player1.getScoreRatio());\n } else {\n logger.info(\"Resetting scores\");\n player1.setScoreRatio(player1.getScoreRatio() + difference);\n player2.setScoreRatio(player2.getScoreRatio() - difference);\n\n logger.info(player1 + \" +\" + difference + \" = \"\n + player1.getScoreRatio());\n logger.info(player2 + \" -\" + difference + \" = \"\n + player2.getScoreRatio());\n }\n }\n }", "@Override\n\tpublic void saveScore() {\n\t\t\n\t}", "public void countPoints() {\n points = 0;\n checkAnswerOne();\n checkAnswerTwo();\n checkAnswerThree();\n checkAnswerFour();\n checkAnswerFive();\n checkAnswerSix();\n checkAnswerSeven();\n checkAnswerEight();\n checkAnswerNine();\n checkAnswerTen();\n }", "public void updatePlayerScore()\n\t{\n\t\tthis.score = (int)(getBalance() - 500) - (getNumberOfLoans()*500); \n\t}", "@Override\n\tpublic void saveScore() {\n\n\t}", "public void setScore(int score) {\r\n this.score = score;\r\n }", "public void setScore(int score) {\r\n this.score = score;\r\n }", "public void setScore(int paScore) {\n this.score = paScore;\n }", "public void setScore(int score) {\n this.score = score;\n }", "public void setScore(int score)\n\t{\n\t\tthis.score += score;\n\t}", "public void setScore(int score) {\n this.score = score;\n }", "public void setScore(int score) {\n this.score = score;\n }", "public void setScore(int score) {\n this.score = score;\n }", "public void setScore(int score) {\n this.score = score;\n }", "@Test\n void should_second_player_win_match_when_he_won_tie_break() {\n List<Integer> setPointOrderTab = Arrays.asList(1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2); // 6-6 and 1-3 for secondPlayer\n\n //WHEN\n game.computePoint(setPointOrderTab, true);\n\n //THEN\n assertEquals(GameStatus.FINISHED, game.getGameStatus());\n assertTrue(secondPlayer.isWinner());\n }", "@Test\n public void testAddPoints() {\n System.out.println(\"addPoints\");\n int points = ScoreBoard.HARD_DROP_POINTS_PER_ROW * 4 + ScoreBoard.POINTS_PER_LINE;\n instance.addPoints(points);\n int result = instance.getPoints();\n int expResult = 108;\n assertEquals(result, expResult);\n }", "public void setScore(int score)\n\t{\n\t\tthis.score=score;\n\t}", "public boolean addScoreTeamTwo(int points) throws ByeMatchException\r\n\t{\r\n\t\tif (isByeMatch)\r\n\t\t{\r\n\t\t\tthrow new ByeMatchException();\r\n\t\t}\r\n\t\tscore2 = score2 + points;\r\n\t\treturn true;\r\n\t}", "@Test\n public void scoreExample5() {\n MarbleSolitaireModel exampleBoard = new MarbleSolitaireModelImpl();\n exampleBoard.move(1, 3, 3, 3);\n exampleBoard.move(2, 1, 2, 3);\n exampleBoard.move(2, 4, 2, 2);\n exampleBoard.move(2, 6, 2, 4);\n exampleBoard.move(4, 6, 2, 6);\n exampleBoard.move(3, 4, 3, 6);\n exampleBoard.move(4, 4, 4, 6);\n exampleBoard.move(3, 2, 3, 4);\n exampleBoard.move(2, 4, 4, 4);\n exampleBoard.move(4, 3, 4, 5);\n exampleBoard.move(4, 6, 4, 4);\n exampleBoard.move(4, 1, 4, 3);\n exampleBoard.move(5, 3, 3, 3);\n exampleBoard.move(3, 0, 3, 2);\n exampleBoard.move(2, 2, 4, 2);\n exampleBoard.move(0, 2, 2, 2);\n exampleBoard.move(0, 4, 2, 4);\n exampleBoard.move(5, 2, 3, 2);\n exampleBoard.move(5, 4, 3, 4);\n exampleBoard.move(3, 2, 1, 2);\n exampleBoard.move(3, 4, 1, 4);\n exampleBoard.move(2, 6, 4, 6);\n\n assertEquals(true, exampleBoard.isGameOver());\n assertEquals(10, exampleBoard.getScore());\n }", "boolean isMismatch(double score);", "private void updateScore() {\n\t\tscoreString.updateString(Integer.toString(score));\n\t}", "public void updateScore() {\n\n Main.rw.readFile();\n setScore(Main.rw.getStackInfo());\n\n\n }", "@Test\n void should_first_player_win_and_finish_the_game() {\n List<Integer> setPointOrderTab = Arrays.asList(1, 1, 1, 2, 1, 1, 1); // 6-1\n\n //WHEN\n game.computePoint(setPointOrderTab, true);\n\n //THEN\n assertTrue(firstPlayer.isWinner());\n assertEquals(GameStatus.FINISHED, game.getGameStatus());\n }", "private void processScore(long time) {\r\n String oldScore = myDb.getSquirtleScore(user);\r\n if (oldScore.equals(\"-1\")) {\r\n myDb.setSquirtleScore(user, Integer.toString(score));\r\n String message = \"Oh no, you killed Squirtle! You set a personal record of \" +\r\n Integer.toString(score) + \" points. You survived for \" + String.valueOf(time) + \" seconds. Check the PERSONAL RECORDS to see your updated score!\";\r\n showMessage(\"Game Over!\", message, this);\r\n } else if (score < Integer.valueOf(oldScore)) {\r\n String message = \"Oh no, you killed Squirtle! Unfortunately your score of \" +\r\n Integer.toString(score) + \" did not beat your record of \" + myDb.getSquirtleScore(user) +\r\n \" points.\" + \" You survived for \" + String.valueOf(time) + \" seconds. \" + \"Better luck next time!\";\r\n showMessage(\"Game Over!\", message, this);\r\n } else {\r\n myDb.setSquirtleScore(user, Integer.toString(score));\r\n String message = \"Oh no, you killed Squirtle! You set a new personal record of \" +\r\n Integer.toString(score) + \" points, beating your previous record of \" + oldScore +\r\n \" points. You survived for \" + String.valueOf(time) + \" seconds. Check the PERSONAL RECORDS to see your updated score!\";\r\n showMessage(\"Game Over!\", message, this);\r\n }\r\n\r\n }", "public void scoring(){\n for (int i=0; i< players.size(); i++){\n Player p = players.get(i);\n p.setScore(10*p.getTricksWon());\n if(p.getTricksWon() < p.getBid() || p.getTricksWon() > p.getBid()){\n int diff = Math.abs(p.getTricksWon() - p.getBid());\n p.setScore(p.getScore() - (10*diff));\n }\n if(p.getTricksWon() == p.getBid()){\n p.setScore(p.getScore() + 20);\n }\n }\n }" ]
[ "0.7105843", "0.7011639", "0.6848622", "0.6762974", "0.6633215", "0.65741193", "0.65632045", "0.6523611", "0.64883286", "0.6467339", "0.6454287", "0.64352536", "0.6383888", "0.6381088", "0.6380092", "0.6366595", "0.63559926", "0.6350433", "0.6343407", "0.63038206", "0.6287348", "0.6261205", "0.6199744", "0.61677545", "0.61651266", "0.6155381", "0.61453736", "0.614386", "0.61342496", "0.6126175", "0.6125765", "0.6118148", "0.6111449", "0.61062336", "0.6095941", "0.6093395", "0.60910225", "0.6080199", "0.6061831", "0.6056163", "0.6055593", "0.6053133", "0.60492295", "0.6046215", "0.60350066", "0.60176504", "0.6008557", "0.6004895", "0.59997326", "0.5995152", "0.5994858", "0.5985525", "0.5984456", "0.59770656", "0.5976582", "0.5976358", "0.59716594", "0.59662336", "0.59607095", "0.59601545", "0.59564066", "0.5950855", "0.5947104", "0.5942737", "0.5940069", "0.59396553", "0.59309864", "0.5926028", "0.5915155", "0.59107625", "0.5909214", "0.59088403", "0.59073037", "0.5900959", "0.5890452", "0.5889676", "0.5884534", "0.58795077", "0.58777076", "0.5872181", "0.5866529", "0.5866529", "0.5860261", "0.5856874", "0.5852237", "0.58500296", "0.58500296", "0.58500296", "0.58500296", "0.5846925", "0.58435977", "0.5842392", "0.5840577", "0.5835903", "0.5830346", "0.5824694", "0.5820139", "0.58190954", "0.58177924", "0.58124775" ]
0.71703666
0
TODO Autogenerated method stub
@Override public void seCourse() { String coursename = ""; int teacherid = 0; String inputStr = ""; System.out.println("是否需要输入教师编号关键词(y/n):"); inputStr = input.next(); if(inputStr.equals("y")) { System.out.println("请输入教师编号关键词:"); teacherid = input.nextInt(); } System.out.println("是否需要输入课程名称关键词(y/n):"); inputStr = input.next(); if(inputStr.equalsIgnoreCase("y")) { System.out.println("请输入课程名称关键词:"); coursename = input.next(); } StudentDAO dao = new StudentDAOimpl(); List<Course> list = dao.seCourse(coursename, teacherid); System.out.println("课程编号\t课程名称\t教师编号\t课程课时"); for(Course c : list) { System.out.println(c.getCourseid()+"\t"+c.getCoursename()+"\t"+c.getTeacherid()+"\t"+c.getCoursetime()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void showlist() { int studentid = 0; System.out.println("请输入学生学号:"); studentid = input.nextInt(); StudentDAO dao = new StudentDAOimpl(); List<Course> list = dao.showlist(studentid); System.out.println("课程编号\t课程名称\t教师编号\t课程课时"); for(Course c : list) { System.out.println(c.getCourseid()+"\t"+c.getCoursename()+"\t"+c.getTeacherid()+"\t"+c.getCoursetime()); } }
{ "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 void saveCourse(int studentid) { int courseid =0; System.out.println("输入课程编号:"); courseid = input.nextInt(); StudentDAO dao = new StudentDAOimpl(); int a = dao.saveCourse(studentid,courseid); if (a!=0){ System.out.println("选课成功"); }else 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
Get id of Armor
public int getArmorId() { return super.getItemId(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Object getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "Identifier getId();", "java.lang.String getAoisId();", "Integer getId();", "Integer getId();", "Integer getId();", "java.lang.String getID();", "String getID();", "String getID();", "String getID();", "String getID();", "public Integer getId() {\n return aao.getId();\n }", "public String getId();", "public String getId();", "public String getId();", "public String getId();", "public String getId();", "public String getId();", "public String getId();", "public String getId();", "public String getId();", "public String getId();", "public String getId();", "public String id();", "Short getId();", "public int getId() {\n return oid ;\n }", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();" ]
[ "0.72846943", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7229035", "0.7204599", "0.7204599", "0.7204599", "0.7204599", "0.7204599", "0.7204599", "0.7204599", "0.7204599", "0.7204599", "0.7204599", "0.7204599", "0.7204599", "0.7204599", "0.7204599", "0.7204599", "0.7204599", "0.7204599", "0.7204599", "0.7204599", "0.71954536", "0.70218265", "0.69467986", "0.69467986", "0.69467986", "0.6924368", "0.68439615", "0.68439615", "0.68439615", "0.68439615", "0.6826081", "0.68200296", "0.68200296", "0.68200296", "0.68200296", "0.68200296", "0.68200296", "0.68200296", "0.68200296", "0.68200296", "0.68200296", "0.68200296", "0.6816246", "0.67888653", "0.6787652", "0.6783121", "0.6783121", "0.6783121", "0.6783121", "0.6783121", "0.6783121", "0.6783121", "0.6783121", "0.6783121", "0.6783121", "0.6783121", "0.6783121", "0.6783121" ]
0.0
-1
Set id of Armor
public void setArmorId(int armorId) { super.setItemId(armorId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setId(Object id) {\n this.id = id;\n }", "public void setId(Object id) {\n this.id = id;\n }", "private void setId(int value) {\n \n id_ = value;\n }", "void setId(String id);", "void setId(String id);", "void setId(String id);", "private void setId(int value) {\n \n id_ = value;\n }", "public void setId (String id);", "private void setId(Integer id) { this.id = id; }", "void setId(int id) {\n this.id = id;\n }", "void setId(java.lang.String id);", "void setId(final String id);", "void setId(int val);", "public void setId (String id)\n {\n _id = id;\n }", "public void setId(String id) {\n }", "void setId(int id);", "public void setId(final int id);", "public void setId(int id) { this.id = id; }", "public void setId(int id) { this.id = id; }", "@Override\n\tpublic void setId(int id) {\n\n\t}", "public void setId(int id){ this.id = id; }", "public void setId(int i) { id = i; }", "public void setId(int id){\r\n this.id = id;\r\n }", "void setId(final Integer id);", "@Override\r\n\tpublic void setId(final K id) {\n\t\tsuper.setId(id);\r\n\t}", "public abstract void setId(int id);", "public void setId(String id);", "public void setId(String id);", "@Override\n public void setId(int id) {\n this.id = id;\n }", "void setId(ID id);", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(ID id)\n {\n this.id = id;\n }", "public void setId(final String id);", "public void setId(final String id);", "public void setId(int id) {\n this.id = id;\n }", "public void setId(int id) {\n this.id = id;\n }", "public void setId(int id) {\n this.id = id;\n }", "public void setId(String id)\r\n/* 19: */ {\r\n/* 20:17 */ this.id = id;\r\n/* 21: */ }", "public void setId (String id) {\n this.id = id;\n }", "public void setId (String id) {\n this.id = id;\n }", "public void setId (String id) {\n this.id = id;\n }", "@Override\r\n\tpublic void setId(String id) {\n\t\t\r\n\t}", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\r\n this.id = id;\r\n }", "void setId(Integer id);", "public void setId(ID id){\r\n\t\tthis.id = id;\r\n\t}", "public void setId(int id) {\r\n this.id = id;\r\n }", "public void setId(int id) {\r\n this.id = id;\r\n }", "public void setId(int id) {\r\n this.id = id;\r\n }", "public void setId(int id) {\r\n this.id = id;\r\n }", "public void setId(String id)\n {\n this.id = id;\n }", "public void setId(String id) {\n _id = id;\n }", "public void setId(String id) {\r\n this.id = id;\r\n }", "public void setId(int id)\n {\n this.id = id;\n }", "public void setId(int id)\n {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id) {\n this.id = id;\n }", "public void setId(String id){\r\n\t\tthis.id = id;\r\n\t}", "public void setId(String id) {\n this.id = id;\n }", "@Override\n\t\tpublic void setId(final String identifier) {\n\t\t}", "public void setId(int id);", "public void setId(int id);", "private void setId(int value) {\n \n id_ = value;\n }", "private void setId(int value) {\n \n id_ = value;\n }" ]
[ "0.74517447", "0.74517447", "0.72582954", "0.72530323", "0.72530323", "0.72530323", "0.7234121", "0.7207583", "0.72036386", "0.7201939", "0.71834254", "0.71800816", "0.71692705", "0.7166139", "0.71652496", "0.7160132", "0.7158673", "0.71434355", "0.71434355", "0.7132283", "0.71311384", "0.7129853", "0.7124416", "0.7119381", "0.71131325", "0.7105166", "0.7101211", "0.7101211", "0.70949256", "0.7093548", "0.7086713", "0.7086713", "0.7086713", "0.7086713", "0.7086713", "0.7086713", "0.7079346", "0.70720935", "0.70720935", "0.707019", "0.707019", "0.707019", "0.7069206", "0.70606714", "0.70606714", "0.70600146", "0.70586747", "0.7058298", "0.7057097", "0.7046816", "0.7042871", "0.7042451", "0.7042451", "0.7042451", "0.7042451", "0.70422816", "0.7036514", "0.70358825", "0.70331734", "0.70331734", "0.7005323", "0.7005323", "0.7005323", "0.7005323", "0.7005323", "0.7005323", "0.7005323", "0.7005323", "0.7005323", "0.7005323", "0.7005323", "0.7005323", "0.7005323", "0.7005323", "0.7005323", "0.7005323", "0.7005323", "0.7005323", "0.7005323", "0.7005323", "0.7005323", "0.7005323", "0.7005323", "0.7005323", "0.7005323", "0.7005323", "0.7005323", "0.7005323", "0.7005323", "0.7005323", "0.7005323", "0.7005323", "0.7005323", "0.7005323", "0.6998637", "0.69975555", "0.69972616", "0.6996738", "0.6996738", "0.6996315", "0.6996315" ]
0.0
-1
Get price of Armor
public int getArmorPrice() { return super.getItemPrice(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "double getPrice();", "double getPrice();", "double getPrice();", "public double getPrice();", "public Double getPrice();", "public ArmCurrency getPrice() {\n return (getPrice(true));\n }", "@Override\n\tpublic double getPrice() {\n\t\treturn auto.getPrice() + AC_ADDITIONAL_CHARGE;\n\t}", "abstract public double getPrice();", "public double price() {\n return price;\n }", "String getPrice();", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price_;\n }", "public double getPrice() {\r\n return price;\r\n }", "public double getPrice() {\r\n return price;\r\n }", "public double getPrice() {\r\n return price;\r\n }", "public double getPrice() {\r\n return price;\r\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getOriPrice() {\n return oriPrice;\n }", "public double getPrice()\n {\n \treturn price;\n }", "public double getPrice()\r\n {\r\n return price;\r\n }", "public double getPrice(){\r\n\t\treturn price;\r\n\t}", "@Override\r\n\tpublic double getPrice() {\n\t\treturn price;\r\n\t}", "public Double getPrice() {\r\n return price;\r\n }", "public double getPrice(){\n\t\treturn price;\n\t}", "public double getPrice() {\n return price_;\n }", "public double getPrice()\n {\n return price;\n }", "public double getPrice(){\n\t\t\treturn price;\n\t\t}", "public double getPrice() {\n return this.price;\n }", "public Double getPrice() {\n return price;\n }", "public Double getPrice() {\n return price;\n }", "public double getPrice(){\n\t\treturn this.price;\n\t}", "@Override\r\n\tpublic double getPrice() {\n\t\treturn pizza.getPrice()+ 12.88;\r\n\t}", "public double getPrice()\n {\n return this.price;\n }", "Price getTradePrice();", "@Override\n\tpublic double getPrice() {\n\t\treturn constantPO.getPrice();\n\t}", "public double getPotatoesPrice();", "public double getPrice(){\n\t\t\n\t\treturn price;\n\t}", "int getPrice();", "long getPrice();", "public double getPrice() \n\t{\n\t\treturn price;\n\t}", "public double getPrice() \n\t{\n\t\treturn price;\n\t}", "public double getPrice()\r\n {\r\n return this.price;\r\n }", "public int getPrice ( ) {\n return price;\n }", "public BigDecimal\tgetPrice();", "public int getPrice();", "Price getPrice() throws Exception;", "public Double getPrice() {\r\n\t\treturn price;\r\n\t}", "@Override\n\tpublic double getPrice() {\n\t\treturn 10;\n\t}", "@Override\n\tpublic double getPrice() {\n\t\treturn 10;\n\t}", "public double getPrice() {\n\t\treturn price;\n\t}", "public double getPrice() {\n\t\treturn price;\n\t}", "public double getPrice() {\n\t\treturn price;\n\t}", "public double getPrice() {\n\t\treturn price;\n\t}", "public double getPrice() {\n\t\treturn price;\n\t}", "public java.lang.Integer getPrice()\n {\n return price;\n }", "public double getPrice()\n\t{\n\t\treturn this.price;\n\t}", "public double getPrice() {\r\n\t\treturn this.price;\r\n\t}", "public double getPrice() {\r\n\t\treturn this.price;\r\n\t}", "public double getPrice() {\r\n\t\treturn this.price;\r\n\t}", "public double getPrice() {\n\t\treturn this.price;\n\t\t\n\t}", "@Override\n public double getPrice()\n {\n return room.getPrice() + PRICE;\n }", "public int getPrice() {\n return price_;\n }", "public float getPrice() {\n return price;\n }", "public float getPrice() {\n return price;\n }", "public float getPrice() {\n return price;\n }", "public double getPrice(Movie movie, double time);", "public Double getPrice() {\n\t\treturn price;\n\t}", "public double getPrice(){return price;}", "@Override\n public double getPrice(){\n \n return currentPrice; \n }", "public double getPrice() {\n\t\treturn this.price;\n\t}", "public Money getPrice() {\n return price;\n }", "public Integer getPrice() {\n return price;\n }", "public Integer getPrice() {\n return price;\n }", "public Integer getPrice() {\n return price;\n }", "public Integer getPrice() {\n return price;\n }", "public int getPrice() {\r\n\t\tif (this.base.equals(\"tower\")) {\r\n\t\t\treturn price;\r\n\t\t}\r\n\t\treturn 0;\r\n\t}", "public Integer getPrice() {\r\n return price;\r\n }", "public Integer getPrice() {\r\n return price;\r\n }", "@Override\n public double getPrice() {\n return souvenir.getPrice() + 20;\n }", "protected float getPrice() {\n\t\t\treturn price;\n\t\t}", "TickerPrice getPrice(String symbol);", "public double getPrice() {\n\t\t\treturn price;\n\t\t}", "public Money getPrice() {\n\t\treturn price;\n\t}", "@Override\n\tpublic double getPrice() {\n\t\t\n\t\treturn 2000;\n\t}", "public int getPrice() {\n return price;\n }", "public double getCost() {\n return price;\n }", "BigDecimal getPrice();", "public double getTotalPrice(){\n return totalPrice;\n }", "public float getPrice() {\n return _price;\n }", "public long getPrice() {\n return price;\n }" ]
[ "0.7271011", "0.7271011", "0.7271011", "0.7220178", "0.71861845", "0.71626997", "0.70236", "0.6997254", "0.69970775", "0.6990683", "0.6931849", "0.69063294", "0.6893832", "0.6893832", "0.6893832", "0.6893832", "0.68929577", "0.68929577", "0.68929577", "0.68929577", "0.68929577", "0.68929577", "0.68929577", "0.68929577", "0.68929577", "0.68929577", "0.68929577", "0.68908197", "0.6872596", "0.68690854", "0.68638515", "0.68628776", "0.68492323", "0.6845088", "0.6835972", "0.6829821", "0.6826346", "0.6825224", "0.68248713", "0.68248713", "0.6819011", "0.6816434", "0.68134034", "0.67964715", "0.67942005", "0.67886305", "0.6787486", "0.67808443", "0.67799973", "0.6774855", "0.6774855", "0.6770577", "0.67408824", "0.6726452", "0.6704531", "0.67007345", "0.66960335", "0.66950583", "0.66950583", "0.6685348", "0.6685348", "0.6685348", "0.6685348", "0.6685348", "0.6681897", "0.66708213", "0.66654646", "0.66654646", "0.66654646", "0.66543764", "0.6648962", "0.6648189", "0.6640221", "0.6640221", "0.6640221", "0.6634017", "0.66321117", "0.66320676", "0.6628929", "0.66282684", "0.66203296", "0.6617953", "0.6617953", "0.6617953", "0.6617953", "0.66165674", "0.66160214", "0.66160214", "0.6613788", "0.6600915", "0.6590984", "0.6578944", "0.65678054", "0.65606415", "0.6556554", "0.6554267", "0.65529424", "0.6549724", "0.65466243", "0.65412813" ]
0.67841107
47
Set price of Armor
public void setArmorPrice(int armorPrice) { super.setItemPrice(armorPrice); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setPrice(Double price);", "public void setPrice(double price){this.price=price;}", "@Override\r\n\tpublic void setPrice(double p) {\n\t\tprice = p;\r\n\t}", "public void setPrice(double p)\r\n\t{\r\n\t\tprice = p;\r\n\t}", "public void setPotatoesPrice(double p);", "public void setPrice(double price)\n {\n this.price = price;\n }", "public void setPrice(double p){\n\t\t// store into the instance variable price the value of the parameter p\n\t\tprice = p;\n\t}", "public void setPrice(double price) \n\t{\n\t\tthis.price = price * quantity;\n\t}", "public void setPrice(double price)\n {\n this.price = price;\n }", "public void setPrice(double price) {\r\n this.price = price;\r\n }", "public void setPrice(double price) {\r\n this.price = price;\r\n }", "public void setPrice(double price) {\r\n this.price = price;\r\n }", "public void setPrice(double price) {\n this.price = price;\n }", "public void setPrice(double price) {\n this.price = price;\n }", "public void setPrice(double price) {\n this.price = price;\n }", "public void setPrice(double price) {\n this.price = price;\n }", "public void setPrice(double price) {\n this.price = price;\n }", "public void setPrice(double price) {\n this.price = price;\n }", "public void setPrice(double price) {\n this.price = price;\n }", "public void setPrice(double value) {\n this.price = value;\n }", "public void setPrice(double value) {\n this.price = value;\n }", "@Override\n\tpublic void setPrice(double price) {\n\t\tconstantPO.setPrice(price);\n\t}", "public void setPrice(Double price) {\r\n this.price = price;\r\n }", "public void setPrice(double p) {\n\t\tprice = p;\n\t}", "public void setPrice(Double price) {\n this.price = price;\n }", "public void setPrice(Double price) {\n this.price = price;\n }", "public void setPrice(int price) {\n this.price = (double)price;\n }", "public void setPrice(Money price) {\n this.price = price;\n }", "public void setPrice (double ticketPrice)\r\n {\r\n price = ticketPrice;\r\n }", "public void setPrice(float itemPrice) \n {\n price = itemPrice;\n }", "public void setPrice(double price) \n\t{\n\t\tthis.price = price;\n\t}", "public void setPrice(double newPrice) {\r\n price = newPrice;\r\n }", "public void setPrice(double price) {\r\n\t\tthis.price = price;\r\n\t}", "public void setPrice(double price) {\r\n\t\tthis.price = price;\r\n\t}", "public void setPrice(int price) {\r\n this.price = price;\r\n }", "public void setPrice(int price) {\n this.price = price;\n }", "@Override\n\tpublic void setPrice() {\n\t\tprice = 24.99;\n\n\t}", "public void setPrice(int value) {\n this.price = value;\n }", "public void setPrice(int price) {\n\tthis.price = price;\n}", "@Override\n\tpublic void setPrice(int price) {\n\t\t\n\t}", "public void setPrice(double price) {\n\t\tthis.price = price;\n\t}", "public void setPrice(double price) {\n\t\tthis.price = price;\n\t}", "public void setPrice(double price) {\n\t\tthis.price = price;\n\t}", "public void setPrice(float price) {\n this.price = price;\n }", "public void setPrice(float price) {\n this.price = price;\n }", "public void setPrice(Float price) {\r\n this.price = price;\r\n }", "public abstract void setTotalPrice();", "public void setPrice(double price) {\n this.price = price;\n if (this.price < 0) {\n this.price = 0;\n }\n }", "public void setPrice(Float price) {\n this.price = price;\n }", "public void setPrice(double x){\n\t\t\tprice = x;\t\n\t\t}", "public void setPrice(Integer price) {\r\n this.price = price;\r\n }", "public void setPrice(Integer price) {\r\n this.price = price;\r\n }", "public void setPrice(Integer price) {\n this.price = price;\n }", "public void setPrice(Integer price) {\n this.price = price;\n }", "public void setPrice(Integer price) {\n this.price = price;\n }", "public void setPrice(Integer price) {\n this.price = price;\n }", "public void setPrice(BigDecimal price) {\n this.price = price;\n }", "public void setPrice(BigDecimal price) {\n this.price = price;\n }", "public void setPrice(Double price) {\n\t\tthis.price = price;\n\t}", "public void setPrice(int newPrice){\n productRelation.setCost(newPrice);\n }", "protected void setPrice(float price) {\n\t\t\tthis.price = price;\n\t\t}", "public void setPrice(BigDecimal price) {\r\n this.price = price;\r\n }", "public void setPrice(BigDecimal price) {\r\n this.price = price;\r\n }", "public void setPrice(Date price) {\n this.price = price;\n }", "public void setPurchasePrice(double p)\n {\n this.purchasePrice = p;\n }", "public void setPrice(java.lang.Integer _price)\n {\n price = _price;\n }", "public void changePrice(Product p, int price){\r\n\t\tp.price = price;\r\n\t}", "protected void setPrice(DukatAmount price){\r\n\t\tif(canHaveAsPrice(price))\r\n\t\t\tthis.price = price;\r\n\t}", "public Builder setPrice(int value) {\n bitField0_ |= 0x00000020;\n price_ = value;\n \n return this;\n }", "public void changePrice(TripDTO trip, BigDecimal price);", "public void setPrice(java.math.BigDecimal price) {\n this.price = price;\n }", "public void setPrice(final BigDecimal price) {\n this.price = price;\n }", "public void setPrice(double price) {\n\t\tif(price > 0 )\n\t\t\tthis.price=price;\n\t}", "public void changePrice(Booking booking, float price);", "protected void setAppraisalPrice(double ap) {\n \tappraisalPrice = ap;\n }", "public void setPrice(Number value) {\n setAttributeInternal(PRICE, value);\n }", "public void putNewPrice(String symbol, double price);", "public void changePrice(String a) {\r\n getPrice().editAmount(a);\r\n }", "public void setPriceEntered (BigDecimal PriceEntered);", "public Builder setPrice(double value) {\n bitField0_ |= 0x00000010;\n price_ = value;\n onChanged();\n return this;\n }", "public void setPricePerSquareFoot(double newPricePerSquareFoot){\nif(newPricePerSquareFoot > 0){\npricePerSquareFoot = newPricePerSquareFoot;\n}\n}", "public void setPrice(int price)\n {\n if(checker.isString(Integer.toString(price)))\n this.price = price;\n else\n this.price = 0;\n }", "public void setPriceActual (BigDecimal PriceActual);", "public void setPrice(double price){\r\n\t\t\r\n\t\ttry{\r\n\t\t\tif(price>0)\r\n\t\t\tthis.price = price;\r\n\t\t\telse\r\n\t\t\t\tthrow new negativeNumberException();\r\n\t\t}catch (negativeNumberException ex){\r\n\t\t\tSystem.out.println(\"The price can not be negative, \"\r\n\t\t\t\t\t+ \"please reenter a positive value\");\r\n\t\t\tSystem.out.println(\"Enter a price:\");\r\n\t\t\tScanner input = new Scanner(System.in);\r\n\t\t\tdouble retry = input.nextDouble();\r\n\t\t\tsetPrice(retry);\r\n\t\t}\r\n\t\t\r\n\t}", "public void setPotatoesPrice(double p) {\n this.potatoesPrice = p;\n }", "public void setMprice(int value) {\r\n this.mprice = value;\r\n }", "public void setPrice(Long price) {\n this.price = price;\n }", "public static void setPrice() {\n double summe = 0.0;\n for (Object obj : dlm.getDisplayedArtikel()) {\n if (obj instanceof Article) {\n Article art = (Article) obj;\n if (!art.isIsAbfrage()) {\n if (((art.isJugendSchutz() && art.isJugendSchutzOk())) || !art.isJugendSchutz()) {\n if (art.isEloadingAmmountOk() && !art.isPriceZero()) {\n summe += ((Article) ((obj))).getPreis() * ((Article) ((obj))).getAmount();\n }\n }\n }\n } else if (obj instanceof Karte) {\n Karte card = (Karte) obj;\n summe += card.getAufladung() / 100;\n }\n }\n for (Object obj : dlm.getRemovedObjects()) {\n if (obj instanceof Article) {\n if (!((Article) ((obj))).isStorno_error()) {\n summe -= ((Article) ((obj))).getPreis() * ((Article) ((obj))).getAmount();\n }\n } else if (obj instanceof Karte) {\n Karte card = (Karte) obj;\n summe -= card.getAufladung() / 100;\n }\n }\n if (Math.round(summe) == 0) {\n summe = 0;\n }\n if (GUIOperations.isTraining()) {\n summe += 1000;\n }\n tfSumme.setText(String.format(\"%.2f\", summe));\n }", "public void setPrice(double price){\r\n Random chance = new Random();\r\n int crashChance = chance.nextInt(100);\r\n double droppedPrice = price * ThreadLocalRandom.current().nextDouble(0.6, 0.8);\r\n if (crashChance > 95) {\r\n setPlusMinus(\"Down\");\r\n System.out.println(\"This stock has crashed.\");\r\n super.setPrice(price - droppedPrice);\r\n } else if(crashChance < 5){\r\n setPlusMinus(\"Up\");\r\n System.out.println(\"This stock has surged.\");\r\n super.setPrice(price + droppedPrice);\r\n } else {\r\n super.setPrice(price);\r\n }\r\n }", "public void setPrice(int price) {\n\t\tthis.price = price;\n\t\tlbl.setText(price+\" C\");\n\t}", "public void setOriPrice(double oriPrice) {\n this.oriPrice = oriPrice;\n }", "public void setPrice(Money price) {\n\t\tif (price == null) {\n\t\t\tthis.price = new Money(0, 0);\n\t\t} else {\n\t\t\tthis.price = price;\n\t\t}\n\t}", "public void calcPrice() {\r\n\t\tsuper.price = 3 * super.height;\r\n\t}", "void setCost(double cost);", "public void setPromotionalPrice(double value) {\n this.promotionalPrice = value;\n }", "void setExpenses(double amount);", "public double setRandomPrice() {\n\t\tdouble price = dishPrices.get(roll.nextInt(dishPrices.size()));\n\t\treturn price;\n\t}", "public void setpPrice(double pPrice) {\n this.pPrice = pPrice;\n }", "public void setHightPrice(final float newHightPrice)\r\n{\r\n\tthis.hightPrice = newHightPrice;\r\n}", "protected void setItemPrice(Double itemPrice) {\n this.itemPrice = itemPrice;\n }" ]
[ "0.7444499", "0.72968787", "0.72816783", "0.7270771", "0.7217388", "0.7216903", "0.71988416", "0.7197428", "0.71906483", "0.71435505", "0.71435505", "0.71435505", "0.7131915", "0.7131915", "0.7131915", "0.7131915", "0.7131915", "0.7131915", "0.7131915", "0.71258074", "0.71258074", "0.70975745", "0.70772046", "0.7039079", "0.6994513", "0.6994513", "0.6985983", "0.69631696", "0.69271946", "0.6926124", "0.69121933", "0.69022995", "0.6882783", "0.6882783", "0.6862153", "0.6842398", "0.68209344", "0.6797302", "0.6781041", "0.6761958", "0.6755201", "0.6755201", "0.6755201", "0.6711969", "0.6711969", "0.66879654", "0.6679261", "0.6670929", "0.6669729", "0.6669489", "0.66398084", "0.66398084", "0.66381055", "0.66381055", "0.66381055", "0.66381055", "0.6599575", "0.6599575", "0.65994674", "0.6597806", "0.6590621", "0.65868723", "0.65868723", "0.6573589", "0.6568841", "0.65682703", "0.6552379", "0.65436864", "0.65431505", "0.652354", "0.65214217", "0.6520572", "0.65146935", "0.6493673", "0.6457498", "0.64558315", "0.642134", "0.6377794", "0.6362125", "0.63244814", "0.63035", "0.628497", "0.6280073", "0.6269243", "0.6264767", "0.62608975", "0.62595874", "0.62589705", "0.6257343", "0.62159497", "0.61755025", "0.61730456", "0.61724246", "0.61711854", "0.61574936", "0.61544776", "0.6120829", "0.6107476", "0.6102702", "0.6095296" ]
0.70664024
23
Get picture of Armor
public String getArmorPicture() { return super.getItemPicture(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getImage();", "String getImage();", "public String getStaticPicture();", "public String getImage() { return image; }", "public ImageIcon getCardPicture()\n {\n\t// Local constants\n\n\t// Local variables\n\n\t/************** Start getCardPicture Method *****************/\n\n // Return card picture\n return picture;\n\n }", "WorldImage getImage();", "public Image getImage() {\n if (tamagoStats.getAge() <= 0) {\n return images.get(\"oeuf\").get(\"noeuf\");\n } else if (tamagoStats.getAge() <= 3) {\n return images.get(\"bebe\").get(\"metamorph\");\n } else if (tamagoStats.getAge() <= 7) {\n return images.get(\"enfant\").get(\"evoli\");\n } else {\n return images.get(\"adulte\").get(\"noctali\");\n }\n }", "com.google.protobuf.ByteString getPicture();", "@Override\r\n\tpublic int getImage() {\n\t\treturn Parametre.BALLE;\r\n\t}", "public int getImage();", "String getItemImage();", "public String getImg(){\n switch(image){\n case 0: // Case 0: Ant looks up/north\n return \"imgs/ant_n.png\";\n case 1: // Case 1: Ant looks right/east\n return \"imgs/ant_e.png\";\n case 2: // Case 2: Ant looks down/south\n return \"imgs/ant_s.png\";\n case 3: // Case 3: Ant looks left/west\n return \"imgs/ant_w.png\";\n default: // Default: This shouldn't happen on a normal run. It returns an empty string and prints an error.\n System.err.println(\"Something went wrong while the ant was trying change direction\");\n return \"\";\n }\n }", "public String getImage()\n {\n return image;\n }", "String getImagePath();", "String getImagePath();", "public String getImage() {\n return image;\n }", "java.lang.String getImagePath();", "public String getPicture() {\r\n return picture;\r\n }", "Imagem getImagem();", "private AnimatedImage armorSprite() throws FileNotFoundException {\n\n\t\tString[] imageArray = new String[4];\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\timageArray[i] = \"sprites/BluePotion\" + i + \".png\";\n\t\t}\n\n\t\tAnimatedImage armor = new AnimatedImage(imageArray, 0.125, 70, 70);\n\n\t\treturn armor;\n\n\t}", "public String getRtPic() { return rtPic; }", "public Image getQuaverRest();", "public Image getCrotchetRest();", "static String getImage() {\n int rand = (int) (Math.random() * 13);\n return \"file:src/images/spaceships/\" + rand + \".png\";\n }", "public Image getImgMario() {return imgMario;}", "public Bitmap getShapesImage();", "public String getImage() {\n return image;\n }", "public String getImage() {\n return image;\n }", "public String getImage() {\n return image;\n }", "public String getImage() {\n return image;\n }", "public String getImage() {\n\t\treturn null;\n\t}", "public String getImage() {\n\t\treturn image;\n\t}", "public String getImage() {\n\t\treturn image;\n\t}", "public Image getFlat();", "public String getThumbnail();", "public BufferedImage image(){\n\t\treturn shotPic;\n\t}", "public abstract BufferedImage getSnapshot();", "private Image getCardImage(Card card) {\n return getImage(\"playing-cards/\" + card + \".png\");\n }", "java.lang.String getPictureUri();", "public Image getSemiquaverRest();", "java.lang.String getProfileImage();", "@Override\n public String GetImagePart() {\n return \"coal\";\n }", "public Image getImage() {\n return (isFacingRight) ? Images.get(\"rightTedhaun\") : Images.get(\"leftTedhaun\");\n }", "public Image getImagenI() {\n return animacion.getImagen().getImage();\n }", "public Image getBassClef();", "public xPIC getPic() {\r\n return pic_;\r\n }", "@Override\n\tpublic Image getImage() {\n\t\treturn img;\n\t}", "@Override\n\tpublic Image getImage() {\n\t\treturn image;\n\t}", "public String getPic() {\n return pic;\n }", "public String getPic() {\n return pic;\n }", "public ColorImage getImagem(){\n\t\treturn copiaFoto(this.fotografia);\n\t}", "public Image getImage(ImageManager imageManager) {\n String playerColor = isRedPlayer ? \"red_bot_\" : \"blue_bot_\";\n String directionName = moveToDirectionMap.get(lastMove);\n return imageManager.getScaledImage(playerColor + directionName);\n }", "public abstract Image getImage();", "public abstract Image getImage();", "public Picture picture() {\n return pic;\n }", "public ObjectImage getObjectImage ()\r\n {\r\n return recoverable_.getObjectImage ();\r\n }", "public Image getPic() {\n return pic;\n }", "public Image getOne();", "String getAvatar();", "public BufferedImage getCarteImage() {\n\t\treturn this.carteImage;\n\t}", "public String getImage() {\n return this.Image;\n }", "public BufferedImage getImage()\n \t{\n \t\ttry\n \t\t{\n \t\t\tif(bi==null)\n \t\t\t{\n \t\t\t\tint\n \t\t\t\t\tiWidth=(int)(getInteger(PROPERTY_WIDTH)*getQuestion().getZoom()),\n \t\t\t\t\tiHeight=(int)(getInteger(PROPERTY_HEIGHT)*getQuestion().getZoom());\n \n \t\t\t\t// Create image\n \t\t\t\tbi=new BufferedImage(iWidth,iHeight,BufferedImage.TYPE_INT_RGB);\n \n \t\t\t\t// Fill to background\n \t\t\t\tGraphics g=bi.getGraphics();\n \t\t\t\tg.setColor(getBackground());\n \t\t\t\tg.fillRect(0,0,iWidth,iHeight);\n \t\t\t}\n \t\t\treturn bi;\n \t\t}\n \t\tcatch(OmDeveloperException ode)\n \t\t{\n \t\t\tthrow new OmUnexpectedException(ode);\n \t\t}\n \t}", "public Bitmap getFinalShapesImage();", "public Rectangle getImage() {\n\t\treturn image;\n\t}", "@Override\n\tpublic BufferedImage getImage() {\n\t\tif (cimg == null)\n\t\t\ttry {\n\t\t\t\tcimg = ImageIO.read(WizardRpgXpVxLicenePage.class.getResource(\"licence.jpg\"));\n\t\t\t} catch (Throwable t) {\n\t\t\t\tYEx.info(\"Can not load Image \" + getImgName() + \" for wizard\", t);\n\t\t\t}\n\t\treturn cimg;\n\t}", "String avatarImage();", "public javax.activation.DataHandler getPicture() {\r\n return localPicture;\r\n }", "public ParseFile getPicture(){\n return getParseFile(KEY_PICTURE);\n }", "@Override\r\n\tpublic Image getImg() {\n\t\treturn img.getImage();\r\n\t}", "public String getImage() {\n\t\tString ans=\"Data/NF.png\";\n\t\tif(image!=null)\n\t\t\tans=\"Data/Users/Pics/\"+image;\n\t\treturn ans;\n\t}", "@Override\n\tpublic final Image getImage() {\n\t\treturn this.getSprite().getImage();\n\t}", "public Image getImage() {\r\n\t\tif (isShieldActivated()) {\r\n\t\t\treturn GameGUI.SPACESHIP_IMAGE_SHIELD;\r\n\t\t}\r\n\t\treturn GameGUI.SPACESHIP_IMAGE;\r\n\t}", "public java.lang.String getImage() {\n\t\treturn _imageCompanyAg.getImage();\n\t}", "public void getPictures(){\n\t\t\ttry{\n\t\t\t\timg = ImageIO.read(new File(\"background.jpg\"));\n\t\t\t\ttank = ImageIO.read(new File(\"Tank.png\"));\n\t\t\t\tbackground2 = ImageIO.read(new File(\"background2.png\"));\n\t\t\t\t\n\t\t\t\trtank = ImageIO.read(new File(\"RTank.png\"));\n\t\t\t\tboom = ImageIO.read(new File(\"Boom.png\"));\n\t\t\t\tboom2 = ImageIO.read(new File(\"Boom2.png\"));\n\t\t\t\tinstructions = ImageIO.read(new File(\"Instructions.png\"));\n\t\t\t\tshotman = ImageIO.read(new File(\"ShotMan.png\"));\n\t\t\t\tlshotman = ImageIO.read(newFile(\"LShotMan.png\"));\n\t\t\t\tboomshotman = ImageIO.read(new File(\"AfterShotMan\"));\n\t\t\t\tlboomshotman = ImageIO.read(new File(\"LAfterShotMan\"));\n\t\t\t\t\n\t\t\t}catch(IOException e){\n\t\t\t\tSystem.err.println(\"d\");\n\t\t\t}\n\t\t}", "public Image getFour();", "public Image getSharp();", "com.google.protobuf.ByteString getHeadpic();", "com.google.protobuf.ByteString getHeadpic();", "com.google.protobuf.ByteString getHeadpic();", "com.google.protobuf.ByteString getHeadpic();", "@GET\n\t@Produces(MediaType.TEXT_PLAIN)\n\tpublic byte[] returnPicture(){\n \t return ContainerPicture.picture;\n \t}", "byte[] getProfileImage();", "public Image getImage(String token) {\n\t\tImage image = spriteMap.get(token);\n\t\tif (image == null) {\n\t\t\tSystem.out.println(\"null image on input \" + token);\n\t\t}\n\t\treturn image;\n\t}", "public Image getlook(){\n \n return look; \n }", "public com.google.protobuf.ByteString getPicture() {\n return picture_;\n }", "public Picture pic() {\n return pic;\n }", "public ImageView loadTheMan()\n {\n try \n {\n Image theMan = new Image(new FileInputStream(\"theMan.jpg\"), 800, 800, true, true);\n ImageView theManView = new ImageView(theMan);\n theManView.setTranslateX(0);\n theManView.setTranslateY(-210);\n theManView.setScaleX(0.3);\n theManView.setScaleY(0.3);\n return theManView;\n } \n catch (FileNotFoundException ex) \n {\n Logger.getLogger(TycoonGUI.class.getName()).log(Level.SEVERE, null, ex);\n return null;\n }\n }", "public void displayImageToConsole();", "public Image getImage() {\r\n\t\treturn GDAssemblerUI.getImage(GDAssemblerUI.IMAGE_GD);\r\n\t}", "public ImageInfo getImage() {\n return image;\n }", "com.yahoo.xpathproto.TransformTestProtos.ContentImage getImageByHandler();", "public String getSnapImage()\r\n\t\t{\r\n\t\tif(this.snapImage != null && this.fximage != null) {\t\r\n\t\t\treturn this.snapImage;\r\n\t\t}\r\n\t\telse {\r\n\t\t\ttry {\r\n\t\t\t\tgetFXImage();\r\n \t\t\tBufferedImage bImage = SwingFXUtils.fromFXImage(this.fximage, null);\r\n \t\t\tByteArrayOutputStream s = new ByteArrayOutputStream();\r\n \t\t\ttry {\r\n\t\t\t\t\tImageIO.write(bImage, \"png\", s);\r\n\t\t\t\t\t} \r\n \t\t\tcatch (IOException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n \t\t\tthis.snapImage = Base64.encode(s.toByteArray());\r\n\t\t\t}\r\n\t\t\tcatch (NullPointerException n) {\r\n\t\t\t\tSystem.out.println(\"The asset for \" + iconId + \" was not found.\" );\r\n\t\t\t}\r\n\t\t\treturn this.snapImage;\t\r\n\t\t}\r\n\t}", "private PlanarImage getImage() {\n PlanarImage img = roiImage;\n if (img == null) {\n synchronized (this) {\n img = roiImage;\n if (img == null) {\n roiImage = img = roi.getAsImage();\n }\n }\n }\n return img;\n }", "public void filmAgeRestImage() {\n\t\tif (ageAll == ageFilm) {\n\t\t\ttry {\n\t\t\t\tURL url = new URL(\"https://upload.wikimedia.org/wikipedia/commons/6/68/Edad_TP.png\");\n\t\t\t\tageFilmIconResize(url);\n\t\t\t} catch (IOException e7) {\n\t\t\t}\n\t\t} else if (age7 == ageFilm) {\n\t\t\ttry {\n\t\t\t\tURL url = new URL(\"https://upload.wikimedia.org/wikipedia/commons/5/55/Edad_7.png\");\n\t\t\t\tageFilmIconResize(url);\n\t\t\t} catch (IOException e7) {\n\t\t\t}\n\n\t\t} else if (age13 == ageFilm) {\n\t\t\ttry {\n\t\t\t\tURL url = new URL(\"https://upload.wikimedia.org/wikipedia/commons/b/bd/Edad_13.png\");\n\t\t\t\tageFilmIconResize(url);\n\t\t\t} catch (IOException e7) {\n\t\t\t}\n\n\t\t} else if (age16 == ageFilm) {\n\t\t\ttry {\n\t\t\t\tURL url = new URL(\"https://upload.wikimedia.org/wikipedia/commons/4/4b/Edad_16.png\");\n\t\t\t\tageFilmIconResize(url);\n\t\t\t} catch (IOException e7) {\n\t\t\t}\n\n\t\t} else {\n\t\t\ttry {\n\t\t\t\tURL url = new URL(\"https://upload.wikimedia.org/wikipedia/commons/c/ca/Edad_18.png\");\n\t\t\t\tageFilmIconResize(url);\n\t\t\t} catch (IOException e7) {\n\t\t\t}\n\t\t}\n\t}", "public Image getTrebleClef();", "public Bitmap getImage(){\n return images[currentFrame];\n }", "public Image getAnalogTabContentAsImage() {\r\n\t\treturn this.analogTabItem.getContentAsImage();\r\n\t}", "public static ImageIcon[] getCardImage(){\n\t\treturn cardImage;\n\t}", "public String getImagen() {\n return imagen;\n }", "public Image getFive();" ]
[ "0.7006872", "0.69566274", "0.6437035", "0.64069575", "0.6403399", "0.6400267", "0.6349686", "0.6341669", "0.6295135", "0.62860686", "0.6262282", "0.6231559", "0.6162366", "0.6148702", "0.6148702", "0.61394715", "0.6134864", "0.6124783", "0.61076456", "0.6103971", "0.6098744", "0.6094849", "0.60366565", "0.60357445", "0.60321295", "0.60267556", "0.6018092", "0.6018092", "0.6018092", "0.6018092", "0.6003037", "0.6001537", "0.6001537", "0.59984344", "0.5996978", "0.59932077", "0.59906024", "0.5987903", "0.5976172", "0.5962247", "0.5949543", "0.59316975", "0.593102", "0.59242576", "0.5916235", "0.59156924", "0.5911865", "0.59079105", "0.59039056", "0.59039056", "0.5901396", "0.5886568", "0.58837914", "0.58837914", "0.5880901", "0.5877371", "0.58687586", "0.5864255", "0.58617413", "0.5850743", "0.58507067", "0.5835843", "0.582658", "0.58261335", "0.5824308", "0.5823992", "0.5811943", "0.58081937", "0.5803003", "0.5799872", "0.57826173", "0.57824296", "0.5776454", "0.57741666", "0.5751719", "0.5724725", "0.57233673", "0.57233673", "0.57233673", "0.57233673", "0.5709586", "0.5708609", "0.5707568", "0.57040614", "0.56974417", "0.5696732", "0.5695665", "0.5691188", "0.56870985", "0.5680946", "0.56801355", "0.5679568", "0.5678236", "0.5676196", "0.5673996", "0.567215", "0.5671724", "0.56714344", "0.5670074", "0.5664701" ]
0.63653845
6
Set picture of Armor
public void setArmorPicture(String armorPicture) { super.setItemPicture(armorPicture); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void setPic() {\n }", "public void changeImage() {\r\n this.image = ColourDoor.image2;\r\n }", "public Mario(){\n setImage(\"06.png\");\n \n }", "public void setImg(){\n if(PicSingleton.getInstance().getPicToShape() != null){\n\n mResultImg.setImageDrawable(PicSingleton.getInstance().getPicShaped());\n }\n }", "public void setImageView() {\n \timage = new Image(\"/Model/boss3.png\", true);\n \tboss = new ImageView(image); \n }", "private void setImage() {\r\n\t\ttry{\r\n\r\n\t\t\twinMessage = ImageIO.read(new File(\"obstacles/win.gif\"));\r\n\t\t\tcoin = ImageIO.read(new File(\"obstacles/Coin.gif\"));\r\n\t\t\toverMessage = ImageIO.read(new File(\"obstacles/over.gif\"));\r\n\r\n\t\t} catch (IOException ioe) {\r\n\t\t\tSystem.err.println(\"Image file not found\");\r\n\t\t}\r\n\r\n\t}", "public void setImg() {\n\t\tif (custom) {\n\t\t\tImage img1;\n\t\t\ttry {\n\t\t\t\timg1 = new Image(new FileInputStream(\"tmpImg.png\"));\n\t\t\t\tmainAvatar.setImage(img1); // Sets main user avatar as the custom image\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public void setIcon(Image i) {icon = i;}", "private void setImage(ActorType type) {\n switch (type) {\n case TREE: image = new Image(\"src/res/images/tree.png\"); break;\n case GOLDENTREE: image = new Image(\"src/res/images/gold-tree.png\"); break;\n case STOCKPILE: image = new Image(\"src/res/images/cherries.png\"); break;\n case HOARD: image = new Image(\"src/res/images/hoard.png\"); break;\n case PAD: image = new Image(\"src/res/images/pad.png\"); break;\n case FENCE: image = new Image(\"src/res/images/fence.png\"); break;\n case SIGNUP: image = new Image(\"src/res/images/up.png\"); break;\n case SIGNDOWN: image = new Image(\"src/res/images/down.png\"); break;\n case SIGNLEFT: image = new Image(\"src/res/images/left.png\"); break;\n case SIGNRIGHT: image = new Image(\"src/res/images/right.png\"); break;\n case POOL: image = new Image(\"src/res/images/pool.png\"); break;\n case GATHERER: image = new Image(\"src/res/images/gatherer.png\"); break;\n case THIEF: image = new Image(\"src/res/images/thief.png\"); break;\n default: System.err.println(\"error: no preset image for this actor type: \"+type.toString());\n }\n }", "public void setActiveImage() {\n\t\tsetGraphic(new ImageView(activePiece));\n\t\tisActiveImageOn = true;\t\t\n\t}", "void setImage(String image);", "private void setPhotoAttcher() {\n\n }", "void setImageProperty() {\n\t\t imgView.setImageResource(R.drawable.weathericon);\n\t\tMatrix matrix = new Matrix();\n\t\trotate += 30;\n\t\tif (rotate == 360) {\n\t\t\trotate = 0;\n\t\t}\n\t\tfloat centerX = imgView.getWidth() / 2;\n\t\tfloat centerY = imgView.getHeight() / 2;\n\t\tmatrix.setRotate(rotate, centerX, centerY);\n\t\t//matrix.setTranslate(10, 20);\n\t\timgView.setImageMatrix(matrix); \n\t\t//ScaleType type = ScaleType.\n\t\t\n\t\t//imgView.setScaleType(scaleType);\n\t \n\t}", "void setImage(Bitmap bitmap);", "public void setImage(Image img) {\r\n this.img = img;\r\n }", "private void setImageDynamic(){\n questionsClass.setQuestions(currentQuestionIndex);\n String movieName = questionsClass.getPhotoName();\n ImageView ReferenceToMovieImage = findViewById(R.id.Movie);\n int imageResource = getResources().getIdentifier(movieName, null, getPackageName());\n Drawable img = getResources().getDrawable(imageResource);\n ReferenceToMovieImage.setImageDrawable(img);\n }", "void lSetImage(Image img);", "private void setIcon() {\n setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource(\"croissant.png\")));\n }", "public void changeImageMule(){\n\t\tsetIcon(imgm);\n\t}", "public void setTurtleImage(Image turtleImage) {\n this.turtleImage = turtleImage;\n }", "public void setImage (Product product) {\n\t\t//TODO beh�ver hj�lp. hur s�tter jag mha referens till objektet bilden?\n\t\tpictureLbl.setText(\"\");\n\t\t//picLbl.setIcon(product.getImageName());\n\t\tpictureLbl.repaint();\n\t}", "private void setImage(Bitmap image) {\n }", "public void setStaticPicture(String path);", "public void setImage(Image itemImg) \n {\n img = itemImg;\n }", "void setImage(IViewModel image);", "private void setImageOnGUI() {\n\n // Capture position and set to the ImageView\n if (AppConstants.fullScreenBitmap != null) {\n fullScreenSnap.setImageBitmap(AppConstants.fullScreenBitmap);\n }\n\n }", "private void setUpImage() {\n Bitmap icon = BitmapFactory.decodeResource( this.getResources(), R.drawable.hotel_icon );\n map.addImage( MARKER_IMAGE_ID, icon );\n }", "public void act() {\n setImage(myGif.getCurrentImage());\n }", "public void Boom()\r\n {\r\n image1 = new GreenfootImage(\"Explosion1.png\");\r\n image2 = new GreenfootImage(\"Explosion2.png\");\r\n image3 = new GreenfootImage(\"Explosion3.png\");\r\n image4 = new GreenfootImage(\"Explosion4.png\");\r\n image5 = new GreenfootImage(\"Explosion5.png\");\r\n image6 = new GreenfootImage(\"Explosion6.png\");\r\n setImage(image1);\r\n\r\n }", "private void setIcon() {\n setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource(\"podologia32x32.png\")));\n }", "void setImage(BufferedImage i);", "public void setHangmanImage(int strikeNum, ArrayList<Images> picArray){\n gameStatus.setGraphic(makePic(picArray.get(strikeNum).getImage(),250));\n }", "public void setImage(Image newImage)\n {\n if (newImage == null)\n {\n setFill(null);\n }\n else\n {\n setFill(new ImageFill(newImage));\n }\n }", "private void setPic()\n {\n BitmapFactory.Options bmOptions = new BitmapFactory.Options();\n bmOptions.inJustDecodeBounds = true;\n BitmapFactory.decodeFile(currentPhotoPath, bmOptions);\n int photoW = bmOptions.outWidth;\n int photoH = bmOptions.outHeight;\n\n int scaleFactor = Math.min(photoW/384, photoH/512);\n\n bmOptions.inJustDecodeBounds = false;\n bmOptions.inSampleSize = scaleFactor;\n\n Bitmap bitmap = BitmapFactory.decodeFile(currentPhotoPath, bmOptions);\n imageCapture.setImageBitmap(bitmap);\n }", "public void setTeachingAvatar(){\n\t\tavatar.setIcon(new ImageIcon(\"img/Asking.png\"));\n\t}", "void setImagePath(String path);", "private void drawImage(){\n Integer resourceId = imageId.get(this.name);\n if (resourceId != null) {\n drawAbstract(resourceId);\n } else {\n drawNone();\n }\n }", "public void setImage(BufferedImage i) {\n // Paint image object\n paint = true;\n image = i;\n this.repaint();\n }", "private void createImage()\n {\n GreenfootImage image = new GreenfootImage(width, height);\n setImage(\"Player.png\");\n }", "private void setPic() {\n int targetW = 210;\n int targetH = 320;\n\n // Get the dimensions of the bitmap\n BitmapFactory.Options bmOptions = new BitmapFactory.Options();\n bmOptions.inJustDecodeBounds = true;\n BitmapFactory.decodeFile(previewPhotoPath, bmOptions);\n int photoW = bmOptions.outWidth;\n int photoH = bmOptions.outHeight;\n\n // Determine how much to scale down the image\n int scaleFactor = Math.min(photoW/targetW, photoH/targetH);\n\n // Decode the image file into a Bitmap sized to fill the View\n bmOptions.inJustDecodeBounds = false;\n bmOptions.inSampleSize = scaleFactor;\n bmOptions.inPurgeable = true;\n\n Bitmap bitmap = BitmapFactory.decodeFile(previewPhotoPath, bmOptions);\n bitmap = RotateBitmap(bitmap,270);\n preview.setImageBitmap(bitmap);\n }", "public void setImageView(double x, double y) {\n \timage = new Image(\"/Model/boss3.png\", true);\n \tboss = new ImageView(image);\n \tboss.setTranslateX(x);\n \tboss.setTranslateY(y);\n }", "void setImage(PImage img) {\n _img = img;\n }", "public void setImage(String path) {\n\t\tthis.path = path;\n\t\tgetImage().set(new Image(path));\n\t}", "private void setIcon() {\n setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource(\"radarlogoIcon.png\")));\n }", "public void cambiarEstadoImagen(){\n ImageIcon respuesta=new ImageIcon();\n if(oportunidades==0){\n respuesta=new ImageIcon(getClass().getResource(\"Ahorcado7.jpg\"));\n }\n if(oportunidades==1){\n respuesta=new ImageIcon(getClass().getResource(\"Ahorcado6.jpg\"));\n }\n if(oportunidades==2){\n respuesta=new ImageIcon(getClass().getResource(\"Ahorcado5.jpg\"));\n }\n if(oportunidades==3){\n respuesta=new ImageIcon(getClass().getResource(\"Ahorcado4.jpg\"));\n }\n if(oportunidades==4){\n respuesta=new ImageIcon(getClass().getResource(\"Ahorcado3.jpg\"));\n }\n if(oportunidades==5){\n respuesta=new ImageIcon(getClass().getResource(\"Ahorcado2.jpg\"));\n }\n if(oportunidades==6){\n respuesta=new ImageIcon(getClass().getResource(\"Ahorcado1.jpg\"));\n }\n if(oportunidades==7){\n respuesta=new ImageIcon(getClass().getResource(\"Ahorcado0.jpg\"));\n }\n this.imgAhorcado=respuesta; \n }", "void setImageFromFile(File imageFile);", "public void setImage(String ref){\n\t ImageIcon ii = new ImageIcon(this.getClass().getResource(ref));\n\t image = ii.getImage();\n\t}", "public void setImage(Image image) {\n this.image = image;\n }", "public void takePicture() {\n LightMeter lightMeter = new LightMeter(film.getSpeed());\n shutter.setSeconds(lightMeter.getRecommendedSpeed());\n aperture.setSize(lightMeter.getRecommendedAperture());\n shutter.trigger();\n }", "public void setImage(VolatileImage back, VolatileImage image, VolatileImage over){\n try{\n backVimImage = back;\n turnedVimImage = image;\n overVimImage = over;\n \n if(IS_TURNED) vimage = turnedVimImage;\n else vimage = backVimImage;\n }\n catch(Exception e){\n System.err.println(\"FUCK!!\");\n }\n this.repaint();\n }", "@Override\n\tpublic void carregar() {\n\t\tSystem.out.println(\"carregar imagem png\");\n\t\t\n\t}", "private void setImage() {\n\t\t\n\t\tfor(int i=0; i<user.getIsVisited().length; i++) {\n\t\t\tif(user.getIsVisited()[i])\n\t\t\t\tspots[i].setBackgroundResource(R.drawable.num1_certified + i*2);\n\t\t\telse\n\t\t\t\tspots[i].setBackgroundResource(R.drawable.num1 + i*2);\n\t\t}\n\t}", "public abstract void setImageFormat(String format);", "public Hazard() {\n super(\"img/hazard.png\");\n }", "public void findImage(String property) {\n\t\tif (property.equalsIgnoreCase(\"horizontal\")) {\r\n\t\t\tsetImage(new ImageView(\"starterHorizontal.PNG\"));\r\n\t\t} else if (property.equalsIgnoreCase(\"vertical\")) {\r\n\t\t\tsetImage(new ImageView(\"starterVertical.PNG\"));\r\n\t\t}\r\n\r\n\t}", "public void changePicture() {\n ImageView imgView = (ImageView)findViewById(R.id.poll_object_btn_image);\n Resources res = getContext().getResources();\n if(type == \"generic\") {\n //add the new picture for the generic type\n Bitmap bitmap = BitmapFactory.decodeResource(res,R.drawable.generic_view);\n imgView.setImageBitmap(bitmap);\n }\n else if(type == \"location\") {\n //add the new picture for the location type\n Bitmap bitmap = BitmapFactory.decodeResource(res,R.drawable.generic_view);\n imgView.setImageBitmap(bitmap);\n }\n else if(type == \"picture\"){\n //add the new picture for the picture type\n Bitmap bitmap = BitmapFactory.decodeResource(res,R.drawable.generic_view);\n imgView.setImageBitmap(bitmap);\n }\n }", "private void setPic() {\n int targetW = imageIV.getWidth();\n int targetH = imageIV.getHeight();\n\n // Get the dimensions of the bitmap\n BitmapFactory.Options bmOptions = new BitmapFactory.Options();\n bmOptions.inJustDecodeBounds = true;\n BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n int photoW = bmOptions.outWidth;\n int photoH = bmOptions.outHeight;\n\n // Determine how much to scale down the image\n int scaleFactor = Math.min(photoW/targetW, photoH/targetH);\n\n // Decode the image file into a Bitmap sized to fill the View\n bmOptions.inJustDecodeBounds = false;\n bmOptions.inSampleSize = scaleFactor;\n bmOptions.inPurgeable = true;\n\n Bitmap bitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n imageIV.setImageBitmap(bitmap);\n }", "private void change_im_tool4(int boo){\r\n if(boo == 0){ //IMAGEN SI EL USUARIO ESTA INHABILITADO\r\n im_tool4.setImage(new Image(getClass().getResourceAsStream(\"/Images/img07.png\")));\r\n }else{ //IMAGEN PARA HABILITAR AL USUARIO\r\n im_tool4.setImage(new Image(getClass().getResourceAsStream(\"/Images/img06.png\")));\r\n }\r\n }", "private void setIcon() {\n setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource(\"/Icons/logo musica.png\")));\n }", "public void testGetSetImageImage() {\n\t\tassertEquals(testNormal.getImage(), new ImageIcon(\"PACMAN/smallpill.png\").getImage());\n\t\t\n\t\t//SET NEW IMAGE\n\t\ttestNormal.setImage(testImage);\n\t\tassertEquals(testNormal.getImage(), testImage);\n\t}", "private void setPic() {\n int targetW = img_clip.getWidth();\n int targetH = img_clip.getHeight();\n\n // Get the dimensions of the bitmap\n BitmapFactory.Options bmOptions = new BitmapFactory.Options();\n bmOptions.inJustDecodeBounds = true;\n BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n int photoW = bmOptions.outWidth;\n int photoH = bmOptions.outHeight;\n\n // Determine how much to scale down the image\n int scaleFactor = Math.min(photoW/targetW, photoH/targetH);\n\n // Decode the image file into a Bitmap sized to fill the View\n bmOptions.inJustDecodeBounds = false;\n bmOptions.inSampleSize = scaleFactor;\n bmOptions.inPurgeable = true;\n\n Bitmap bitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n img_clip.setImageBitmap(bitmap);\n }", "private void setImage(){\n if(objects.size() <= 0)\n return;\n\n IImage img = objects.get(0).getImgClass();\n boolean different = false;\n \n //check for different images.\n for(IDataObject object : objects){\n IImage i = object.getImgClass();\n \n if((img == null && i != null) || \n (img != null && i == null)){\n different = true;\n break;\n }else if (img != null && i != null){ \n \n if(!i.getName().equals(img.getName()) ||\n !i.getDir().equals(img.getDir())){\n different = true;\n break;\n }\n } \n }\n \n if(!different){\n image.setText(BUNDLE.getString(\"NoImage\"));\n if(img != null){\n imgName = img.getName();\n imgDir = img.getDir();\n image.setImage(img.getImage());\n }else{\n image.setImage(null);\n }\n }else{\n image.setText(BUNDLE.getString(\"DifferentImages\"));\n }\n \n image.repaint();\n }", "@Override\n public void onLockDoorRaised() {\n BufferedImage myPicture = null;\n try {\n myPicture = ImageIO.read(new File(\"./picts/Stainless-Steel-Doors-2.jpg\"));\n } catch (IOException e) {\n e.printStackTrace();\n }\n currentPicture.setIcon(new ImageIcon(myPicture));\n takeCupButton.setVisible(false);\n }", "private void iconImage() {\n setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource(\"icon.jpg\")));\n }", "void setImageResource(String imageResource) throws IOException;", "void setImage(Layer layer, Image image);", "public void fillShipPictureLabel() {\n\t\tString shipsName = this.ship.getShipName();\n\t\tif (shipsName == \"Thousand Sunny\") {\n\t\t\tshipPictureLabel.setIcon(new ImageIcon(SetupAdventureScreen.class.getResource(\"/images/ThousandSunny.png\")));\n\t\t}\n\t\telse if (shipsName == \"Black Pearl\") {\n\t\t\tshipPictureLabel.setIcon(new ImageIcon(SetupAdventureScreen.class.getResource(\"/images/BlackPearl.png\")));\n\t\t}\n\t\telse if (shipsName == \"Victoria Hunter\") {\n\t\t\tshipPictureLabel.setIcon(new ImageIcon(SetupAdventureScreen.class.getResource(\"/images/VictoriaHunter.png\")));\n\t\t}\n\t\telse {\n\t\t\tshipPictureLabel.setIcon(new ImageIcon(SetupAdventureScreen.class.getResource(\"/images/StarOne.png\")));\n\t\t}\n\t}", "public void setProfileImg() {\n }", "private void setIcon() {\n \n setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource(\"iconabc.png\")));\n }", "public void draw(){\n\t\t/* Stamps a copy of the planet at the position. the file of the planet image is under folder of \"images\".\n\t\t * a mistake easily to be ignored here..*/\n\t\tString imageToDraw = \"images/\" + imgFileName;\n\t\tStdDraw.picture(xxPos, yyPos, imageToDraw);\n\n\t}", "public void set(RenderedImage im) {\n this.im = im;\n ic.set(im);\n }", "private void setImage() throws FileNotFoundException {\n\t\timage = new Image(new FileInputStream(path));\n\t}", "public void setImage(ButtonBase button, String fileName) {\n String imagePath = FILE_PROTOCOL + PATH_IMAGES + fileName;\n Image buttonImage = new Image(imagePath);\n\t\n\t// SET THE IMAGE IN THE BUTTON\n button.setGraphic(new ImageView(buttonImage));\t\n }", "public void createImageSet() {\n\t\t\n\t\t\n\t\tString image_folder = getLevelImagePatternFolder();\n \n String resource = \"0.png\";\n ImageIcon ii = new ImageIcon(this.getClass().getResource(image_folder + resource));\n images.put(\"navigable\", ii.getImage());\n\n\t}", "void setImage(BufferedImage valueImage, BufferedImage BackImage);", "private void setPic() {\n int targetW = imageView.getWidth();\n int targetH = imageView.getHeight();\n\n // Get the dimensions of the bitmap\n BitmapFactory.Options bmOptions = new BitmapFactory.Options();\n bmOptions.inJustDecodeBounds = true;\n BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n int photoW = bmOptions.outWidth;\n int photoH = bmOptions.outHeight;\n\n // Determine how much to scale down the image\n int scaleFactor = Math.min(photoW/targetW, photoH/targetH);\n\n // Decode the image file into a Bitmap sized to fill the View\n bmOptions.inJustDecodeBounds = false;\n bmOptions.inSampleSize = scaleFactor;\n bmOptions.inPurgeable = true;\n\n Bitmap bitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n imageView.setImageBitmap(bitmap);\n imageView.invalidate();\n }", "private void imageInitiation() {\n ImageIcon doggyImage = new ImageIcon(\"./data/dog1.jpg\");\n JLabel dogImage = new JLabel(doggyImage);\n dogImage.setSize(700,500);\n this.add(dogImage);\n }", "public void setImage(ImageIcon image){\n\t\tthis.image = image;\n\t}", "private void setIcon() {\n setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource(\"icon.png\")));\n }", "private void setArmorPoint (int arm)\r\n {\r\n if (arm < 1 || arm >25)\r\n {\r\n armorPoint = 1;\r\n }\r\n else\r\n {\r\n armorPoint = arm;\r\n }\r\n }", "private void setPic() {\n int targetW =20;// mImageView.getWidth();\n int targetH =20;// mImageView.getHeight();\n\n // Get the dimensions of the bitmap\n BitmapFactory.Options bmOptions = new BitmapFactory.Options();\n bmOptions.inJustDecodeBounds = true;//设置仅加载位图边界信息(相当于位图的信息,但没有加载位图)\n\n //返回为NULL,即不会返回bitmap,但可以返回bitmap的横像素和纵像素还有图片类型\n BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n\n int photoW = bmOptions.outWidth;\n int photoH = bmOptions.outHeight;\n\n // Determine how much to scale down the image\n int scaleFactor = Math.min(photoW/targetW, photoH/targetH);\n\n // Decode the image file into a Bitmap sized to fill the View\n bmOptions.inJustDecodeBounds = false;\n bmOptions.inSampleSize = scaleFactor;\n\n Bitmap bitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n mImageView.setImageBitmap(bitmap);\n }", "private void setPic() {\n\t\tint targetW = Constant.sRealWidth;\n\t\tint targetH = Constant.sRealHeight;\n\n\t\t/* Get the size of the image */\n\t\tBitmapFactory.Options bmOptions = new BitmapFactory.Options();\n\t\tbmOptions.inJustDecodeBounds = true;\n\t\tBitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n\t\tint photoW = bmOptions.outWidth;\n\t\tint photoH = bmOptions.outHeight;\n\t\t\n\t\t/* Figure out which way needs to be reduced less */\n\t\tint scaleFactor = 1;\n\t\tif ((targetW > 0) || (targetH > 0)) {\n\t\t\tscaleFactor = Math.min(photoW/targetW, photoH/targetH);\t\n\t\t}\n\n\t\t/* Set bitmap options to scale the image decode target */\n\t\tbmOptions.inJustDecodeBounds = false;\n\t\tbmOptions.inSampleSize = scaleFactor;\n\t\tbmOptions.inPurgeable = true;\n\n\t\t/* Decode the JPEG file into a Bitmap */\n\t\tBitmap bitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n\t\t\n\t\tint rotate = ViewUtils.handleRotateBitmap(mCurrentPhotoPath);\n\t\tif (rotate != 0) {\n\t\t\tbitmap = ViewUtils.rotaingBitmap(\n\t\t\t\t\trotate, bitmap);\n\t\t}\n\t\t/* Associate the Bitmap to the ImageView */\n\t\tmPictureView.setImageBitmap(bitmap);\n\t}", "public Image getImgMario() {return imgMario;}", "public void restaura(){ \n super.restauraE();\n setImage(\"FrtEA1.png\"); \n check = false; \n }", "public void setInvertedImage(double position, double height) {\n // set the X coordinate of the image center\n // X imageCenter = X of lensCenter + the distance between the lens and the image\n imageCenterX = lensCenterX + position;\n\n // remove the image from the pane if it's already existed\n removeFromPane(image);\n \n // create new image rectangle\n // x coordinate = Xcenter - half of the rectangle's width (since the width of the object is equal to the image)\n // y coordinate = Y coordinate of the ground line\n image = new Rectangle(objectWidth, height);\n image.setLayoutX(imageCenterX - objectWidth / 2);\n image.setLayoutY(groundLineY);\n\n // Check the comboBox to set the corresponding inverted image\n if (pickPicture.getValue().equals(\"Candle\")) {\n image.setFill(AssetManager.getInvertedCandleImage());\n } else if (pickPicture.getValue().equals(\"Can\")) {\n image.setFill(AssetManager.getInvertedCanImage());\n }\n else\n image.setFill(AssetManager.getInvertedPencilImage());\n \n // add the image rectangle to the pane\n addToPane(image);\n }", "private void setLeadPlayerImage() {\n Player leadPlayer = game.getLeadingPlayer();\n if (leadPlayer == null) {\n // no lead so set images to default\n playerLeadImage.setImage(null);\n computerLeadImage.setImage(null);\n return;\n }\n if (leadPlayer.getName().equals(\"Computer\")) {\n computerLeadImage.setImage(new Image(\"Images/trophy.png\"));\n playerLeadImage.setImage(null);\n return;\n }\n playerLeadImage.setImage(new Image(\"Images/trophy.png\"));\n computerLeadImage.setImage(null);\n }", "protected void setSprite(Image i){\n sprites = new HashMap<Facing,Image>();\n sprites.put(Facing.RIGHT, i);\n sprites.put(Facing.LEFT , i.getFlippedCopy(true, false));\n }", "private void drawAbstract(int resourceId){\n pokemonImage.setImageResource(resourceId);\n }", "void setImage(TokenEntry entry, @NonNull String newImage);", "public void setTempImage()\n {\n URL url = this.getClass().getResource(lastselection.getImage());\n\t\tImage image = Toolkit.getDefaultToolkit().getImage(url);\n\t\ttempImage = new PImage(image);\n\t\ttempImage.setBounds(0,0,65,170);\n\t\ttempImage.setTransparency(0);\n\t\tlayer.addChild(tempImage);\n\t}", "private void setPic() {\n int targetW = mainImageView.getWidth();\n int targetH = mainImageView.getHeight();\n\n // Get the dimensions of the bitmap\n BitmapFactory.Options bmOptions = new BitmapFactory.Options();\n bmOptions.inJustDecodeBounds = true;\n BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n int photoW = bmOptions.outWidth;\n int photoH = bmOptions.outHeight;\n\n // Determine how much to scale down the image\n int scaleFactor = Math.min(photoW/targetW, photoH/targetH);\n\n // Decode the image file into a Bitmap sized to fill the View\n bmOptions.inJustDecodeBounds = false;\n bmOptions.inSampleSize = scaleFactor;\n// bmOptions.inPurgeable = true;\n\n Bitmap bitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n mainImageView.setImageBitmap(bitmap);\n\n// bmOptions.inBitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n// mainImageView.setImageBitmap(bmOptions.inBitmap);\n }", "public void setImage(Drawable image){\n\t\tmImage = image;\n\t}", "private AnimatedImage armorSprite() throws FileNotFoundException {\n\n\t\tString[] imageArray = new String[4];\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\timageArray[i] = \"sprites/BluePotion\" + i + \".png\";\n\t\t}\n\n\t\tAnimatedImage armor = new AnimatedImage(imageArray, 0.125, 70, 70);\n\n\t\treturn armor;\n\n\t}", "private void setPic() {\n int targetW = mImageView.getWidth();\n int targetH = mImageView.getHeight();\n\n // Get the dimensions of the bitmap\n BitmapFactory.Options bmOptions = new BitmapFactory.Options();\n bmOptions.inJustDecodeBounds = true;\n BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n int photoW = bmOptions.outWidth;\n int photoH = bmOptions.outHeight;\n\n // Determine how much to scale down the image\n int scaleFactor = Math.min(photoW / targetW, photoH / targetH);\n\n // Decode the image file into a Bitmap sized to fill the View\n bmOptions.inJustDecodeBounds = false;\n bmOptions.inSampleSize = scaleFactor;\n bmOptions.inPurgeable = true;\n bitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n\n// Bitmap bitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n mImageView.setImageBitmap(bitmap);\n }", "void setImageFromSpec(ImageProvider spec);", "public void setFondoLeyenda() {\n URL url = getClass().getResource(\"/Imagenes/Leyenda.png\");\n\tthis.setOpaque(false);\n\tthis.image = new ImageIcon(url).getImage();\n\trepaint();\n }", "private void setIcon() {\n setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource(\"MainLogo.png\")));\n }", "public void move() {\r\n\t\tsetY(getY() + 134);\r\n\t\tmyImage = myImage.getScaledInstance(100, 300, 60);\r\n\r\n\t}", "public void setImage(ImageIcon image) {\n this.image = image;\n }", "private void setUpFlat() {\n Image flat = new Image(this.getClass().getResourceAsStream(\"Flat.png\"));\n _accidentalImage.setImage(flat);\n _accidentalImage.setFitHeight(25);\n _accidentalImage.setFitWidth(12.5);\n _accidentalImage.setX(_noteHead.getCenterX() + Constants.FLAT_X_OFFSET);\n _accidentalImage.setY(_noteHead.getCenterY() + Constants.ACCIDENTAL_Y_OFFSET);\n }" ]
[ "0.71342415", "0.69023246", "0.68683857", "0.6729306", "0.66954553", "0.6396671", "0.623866", "0.62164956", "0.62057424", "0.62050664", "0.6200871", "0.61795723", "0.61660445", "0.6161066", "0.614324", "0.61243474", "0.6123203", "0.6112965", "0.6092683", "0.60678107", "0.60593843", "0.6058766", "0.6018704", "0.6014681", "0.60085374", "0.6004245", "0.6003973", "0.59795445", "0.597217", "0.5970131", "0.5949804", "0.59439397", "0.5938557", "0.5917606", "0.5917339", "0.5886752", "0.586245", "0.5856545", "0.5850971", "0.5845284", "0.5817219", "0.5815721", "0.5806681", "0.58020025", "0.57956654", "0.5794569", "0.5787245", "0.5785739", "0.57791626", "0.5774861", "0.5761867", "0.5752397", "0.57522964", "0.5751708", "0.57507795", "0.5746967", "0.574506", "0.57449144", "0.5744796", "0.57395077", "0.5732323", "0.57319856", "0.5726101", "0.5723991", "0.5717837", "0.5709153", "0.5702421", "0.5702104", "0.56948036", "0.56893855", "0.56812614", "0.56750935", "0.5673066", "0.5660196", "0.56593657", "0.5655565", "0.564715", "0.5646081", "0.5643407", "0.56401217", "0.56258154", "0.5625266", "0.5621673", "0.5621527", "0.56212604", "0.5620594", "0.5619737", "0.56169254", "0.5608519", "0.56020796", "0.56009", "0.56005484", "0.5597563", "0.559254", "0.5590442", "0.5581921", "0.5577274", "0.5575647", "0.55751026", "0.55750996" ]
0.6342314
6
Created by anildeshpande on 8/9/17.
public interface IRepoListPresenter { public void loadCommits(String userName); }
{ "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 public void func_104112_b() {\n \n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "private stendhal() {\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\tprotected void interr() {\n\t}", "public final void mo51373a() {\n }", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "private void poetries() {\n\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "protected boolean func_70814_o() { return true; }", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "private void m50366E() {\n }", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n public int describeContents() { return 0; }", "@Override\n public void init() {\n }", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "public void gored() {\n\t\t\n\t}", "public void mo38117a() {\n }", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n void init() {\n }", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void init() {}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n public int retroceder() {\n return 0;\n }", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\n protected void initialize() {\n\n \n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void init() {\n }", "@Override\r\n\tpublic void init() {}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void getExras() {\n }", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "private void kk12() {\n\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\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}", "private void init() {\n\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 init() {\n\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\n\tpublic void einkaufen() {\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "private void strin() {\n\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "@Override\n\tpublic void init()\n\t{\n\n\t}", "public void method_4270() {}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n public int getSize() {\n return 1;\n }", "@Override public int describeContents() { return 0; }", "@Override\n public void initialize() { \n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\t\tpublic void init() {\n\t\t}", "private Rekenhulp()\n\t{\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "public abstract void mo70713b();", "public void m23075a() {\n }", "@Override\n public void init() {\n }", "@Override\n\tprotected void initialize() {\n\t}", "@Override\n\tprotected void initialize() {\n\t}", "@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\n\t}", "public void mo12628c() {\n }" ]
[ "0.60240567", "0.5850004", "0.579971", "0.57414746", "0.57261163", "0.56905013", "0.56905013", "0.5679446", "0.5674973", "0.56542426", "0.56146926", "0.5605606", "0.5575253", "0.5567581", "0.55675167", "0.55608046", "0.5551842", "0.5551842", "0.5551842", "0.5551842", "0.5551842", "0.55511886", "0.55445826", "0.55382854", "0.55309635", "0.5522555", "0.55030054", "0.5493623", "0.54730886", "0.5466049", "0.546191", "0.5456565", "0.54421586", "0.54393625", "0.5433266", "0.5433266", "0.54281336", "0.5421856", "0.54205936", "0.5414697", "0.5414405", "0.5412884", "0.5412609", "0.5412609", "0.5412609", "0.5412609", "0.5412609", "0.5412609", "0.5411179", "0.5399837", "0.5395968", "0.539504", "0.539504", "0.539504", "0.5391172", "0.538782", "0.53815883", "0.53815883", "0.5375618", "0.5363308", "0.5362546", "0.53531176", "0.53531176", "0.53531176", "0.5350183", "0.53467304", "0.53467304", "0.53467304", "0.5344464", "0.53443986", "0.5336035", "0.5336006", "0.53357744", "0.53319806", "0.5331848", "0.5327352", "0.53152394", "0.5311924", "0.52987736", "0.5277273", "0.5266305", "0.5262812", "0.52617884", "0.52577585", "0.52577585", "0.52577585", "0.52577585", "0.52577585", "0.52577585", "0.52577585", "0.52558947", "0.5244127", "0.524093", "0.523538", "0.52296275", "0.52255034", "0.5224494", "0.5224273", "0.5224273", "0.52224785", "0.5213775" ]
0.0
-1
/ gets the referee to start the game. sets opponents, display board, and gets xPlayer to start the game
public void runTheGame() { xPlayer.setOpponent(oPlayer); oPlayer.setOpponent(xPlayer); board.display(); xPlayer.play(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void startGame(){\n\n\t\tGame.updatePlayer(players.get(curr));\n\t\tGameBoard gb = new GameBoard();\n\t\tthis.registerObserver(gb);\n\t\tgb.update(this, board);\n\n\t}", "public void startGame() {\n\n // Initialize both players\n players[0] = new Player(\"Paras\", true);\n players[1] = new Player(\"Computer\", false);\n\n // Initialize ChessBoard\n board = new ChessBoard(8);\n movesPlayed = new ArrayList<>();\n\n // Keep playing game until GameStatus is BLACK_WIN or WHITE_WIN\n while (true) {\n\n processTurn(players[0]);\n if (this.status == GameStatus.WHITE_WIN) {\n System.out.println(\"P1 win!\");\n break;\n }\n\n processTurn(players[1]);\n if (this.status == GameStatus.BLACK_WIN) {\n System.out.println(\"P2 win!\");\n break;\n }\n }\n\n }", "public void startGame() {\n\t\tinitChips();\n\t\tassignAndStartInitialProjects();\n\t}", "private void startGame()\n {\n player_count = game_inter.getPlayerCount();\n if(player_count < 2 || player_count > 4)\n {\n game_inter.rejectGame(\"Illegal number of players to play: \" + player_count);\n System.exit(1);\n }\n // accept and get the order of player\n player_id = game_inter.getPlayerOrder();\n if(player_id == -1)\n {\n game_inter.rejectGame(\"Connection Error\");\n System.exit(1);\n }\n\n // organize user panels\n organizePanels();\n // if player is server, establish cards; else wait card order and adjust them\n if(player_id == 0)\n establishCards();\n else\n {\n String[] messages = game_inter.getRemoteMessage();\n placeCards(messages);\n }\n //then cycle the game\n\n Runnable r = new Runnable(){public void run(){ cycleGame(); }};\n Thread th = new Thread(r);\n th.start();\n //System.exit(0);\n }", "public TTT_GamePlay() {\r\n\t\tArrays.fill(p1, 0);\r\n\t\tArrays.fill(p2, 0);\r\n\t\tArrays.fill(selectedCells, false);\r\n\t\tthis.board = new int[9];\r\n\t\tthis.player = player1;\r\n\t\twin = false;\r\n\t}", "public void startGame() {\n\t\tfor(Chess.RowConfiguration rowConfiguration : Chess.getRowConfigurations()) {\n\t\t\tint row = rowConfiguration.row;\n\t\t\tClass[] pieceClasses = rowConfiguration.pieces;\n\t\t\tChess.Color sideColor = rowConfiguration.sideColor;\n\n\t\t\tfor(int col = 0; col < Chess.NUM_COLS; col++) {\n\t\t\t\taddPiece(pieceClasses[col], sideColor, board.getSpot(row, col));\n\t\t\t}\n\t\t}\n\t\t\n\t\tthis.inPlay = true;\n\t\t\n\t\tstartNewTurn();\n\t\t\n\t\tif(eventListener != null) {\n\t\t\teventListener.onGameStarted();\n\t\t}\n\t}", "@Override\n\tpublic void start() \n\t{\n\t\tServerPoller.getServerPoller().setObserver(this);\n\t\tList<Game> gamelist = Reference.GET_SINGLETON().proxy.getGameList();\n\t\tGameInfo[] games = new GameInfo[gamelist.size()];\n\t\tint counter = 0;\n\t\tfor(Game game: gamelist)\n\t\t{\n\t\t\tGameInfo thisgame = new GameInfo();\n\t\t\tthisgame.setId(game.getId());\n\t\t\tthisgame.setTitle(game.getTitle());\n\t\t\tfor(Player player : game.getPlayers())\n\t\t\t{\n\t\t\t\tPlayerInfo player_info = new PlayerInfo(player);\n\t\t\t\tplayer_info.setColor(player.getColor());\n\t\t\t\tif(!(player.color == null))thisgame.addPlayer(player_info);\n\t\t\t}\n\t\t\tgames[counter] = thisgame;\n\t\t\tcounter++;\n\t\t}\n\n\t\tif (Reference.GET_SINGLETON().getPlayer_color() != null) return;\n\t\tif (!hasChanged(games, oldGames)) return;\n\t\toldGames = games;\n\t\t\n\t\tReference ref = Reference.GET_SINGLETON();\n\t\t\n\t\tPlayerInfo ourguy = new PlayerInfo();\n\t\t\n\t\tourguy.setId(ref.player_id);\n\t\tourguy.setName(ref.name);\n\t\t\n\t\tgetJoinGameView().setGames(games, ourguy);\n\n\t\tif (getJoinGameView().isModalShowing()) getJoinGameView().closeModal();\n\t\tif(!getJoinGameView().isModalShowing())\n\t\t{\n\t\t\tgetJoinGameView().showModal();\n\t\t}\n\t}", "public void startGame(){\n\n AgentAddress coordinatorAddressPre = getAgentWithRole(\"investment_game\", \"tout_le_monde\", \"coordinator\");\n\n if (coordinatorAddressPre==null){\n Coordinator coordinator = new Coordinator();\n\n launchAgent(coordinator);\n\n pause(1000);\n }\n\n Set<Player> players = new HashSet<Player>();\n Player primaryPlayer = null;\n\n //now launch all human player avatar agents, each of them will be initialized as agent having a GUI frame\n Iterator<GameSpecification.PlayerSpecification> playerSpecs = gameSpecification.getPlayerSpecifications().iterator();\n\n int launchedHumanPlayers = 0;\n\n while (playerSpecs.hasNext()){\n GameSpecification.PlayerSpecification spec = playerSpecs.next();\n\n if (spec instanceof GameSpecification.HumanPlayerSpecification){\n\n HumanPlayerAvatar humanPlayerAvatar = new HumanPlayerAvatar(spec.getName());\n\n launchAgent(humanPlayerAvatar,true);\n\n players.add(humanPlayerAvatar);\n\n launchedHumanPlayers++;\n\n if (null == primaryPlayer){\n primaryPlayer=humanPlayerAvatar;\n }\n\n }\n }\n\n //launch computer player agents. If no human players have been launched, the first computer player will display a GUI frame.\n playerSpecs = gameSpecification.getPlayerSpecifications().iterator();\n\n boolean first = true;\n\n while (playerSpecs.hasNext()){\n GameSpecification.PlayerSpecification spec = playerSpecs.next();\n\n if (spec instanceof GameSpecification.ComputerPlayerSpecification){\n\n ChooseAmountStrategy chooseAmountStrategy = ((GameSpecification.ComputerPlayerSpecification) spec).getChooseAmountStrategy();\n\n SelectOpponentStrategy selectOpponentStrategy = ((GameSpecification.ComputerPlayerSpecification) spec).getSelectOpponentStrategy();\n \n ComputerPlayer computerPlayer = new ComputerPlayer(spec.getName(),spec.getPictureFileName(), chooseAmountStrategy, selectOpponentStrategy);\n\n chooseAmountStrategy.setPlayer(computerPlayer);\n\n selectOpponentStrategy.setPlayer(computerPlayer);\n\n launchAgent(computerPlayer, launchedHumanPlayers == 0 && first);\n\n players.add(computerPlayer);\n\n if (null == primaryPlayer){\n primaryPlayer=computerPlayer;\n }\n\n first = false;\n\n }\n }\n\n //request new game from coordinator\n AgentAddress coordinatorAddress;\n\n while((coordinatorAddress = getAgentWithRole(\"investment_game\",\"tout_le_monde\",\"coordinator\"))==null){\n pause(750);\n }\n\n String requestGameSpec = \"<new_game> <for> \"+gameSpecification.getPlayerSpecifications().size()+\" <players> <having> \"+gameSpecification.getRounds()+\" <rounds> <invite> 0 <computer_players>\";\n\n ActMessage reply = (ActMessage)sendMessageWithRoleAndWaitForReply(coordinatorAddress,new ActMessage(\"request_game\",requestGameSpec),\"jeromes_assistant\");\n\n if (reply.getAction().equals(\"game_initialized\")){\n\n final String gameId = reply.getContent();\n\n //let players join the game\n Iterator<Player> playerIterator = players.iterator();\n\n while (playerIterator.hasNext()){\n\n final Player player = playerIterator.next();\n final boolean isPrimaryPlayer = player.equals(primaryPlayer);\n\n new Thread(){\n @Override\n public void run() {\n player.joinGame(gameId,isPrimaryPlayer,player.getPicturePath());\n }\n }.start();\n\n }\n }else{\n //TODO throw Exception\n }\n\n }", "public void start() {\n clear();\n // Assigning chess pieces to players.\n whitePieces.add(new Piece(Owner.WHITE, Who.KING, Rank.R1, File.E));\n whitePieces.add(new Piece(Owner.WHITE, Who.QUEEN, Rank.R1, File.D));\n whitePieces.add(new Piece(Owner.WHITE, Who.ROOK, Rank.R1, File.A));\n whitePieces.add(new Piece(Owner.WHITE, Who.ROOK, Rank.R1, File.H));\n whitePieces.add(new Piece(Owner.WHITE, Who.BISHOP, Rank.R1, File.C));\n whitePieces.add(new Piece(Owner.WHITE, Who.BISHOP, Rank.R1, File.F));\n whitePieces.add(new Piece(Owner.WHITE, Who.KNIGHT, Rank.R1, File.B));\n whitePieces.add(new Piece(Owner.WHITE, Who.KNIGHT, Rank.R1, File.G));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.A));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.B));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.C));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.D));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.E));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.F));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.G));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.H));\n\n for (Piece p : whitePieces) {\n board[p.row.ordinal()][p.col.ordinal()] = p;\n }\n\n blackPieces.add(new Piece(Owner.BLACK, Who.KING, Rank.R8, File.E));\n blackPieces.add(new Piece(Owner.BLACK, Who.QUEEN, Rank.R8, File.D));\n blackPieces.add(new Piece(Owner.BLACK, Who.ROOK, Rank.R8, File.A));\n blackPieces.add(new Piece(Owner.BLACK, Who.ROOK, Rank.R8, File.H));\n blackPieces.add(new Piece(Owner.BLACK, Who.BISHOP, Rank.R8, File.C));\n blackPieces.add(new Piece(Owner.BLACK, Who.BISHOP, Rank.R8, File.F));\n blackPieces.add(new Piece(Owner.BLACK, Who.KNIGHT, Rank.R8, File.B));\n blackPieces.add(new Piece(Owner.BLACK, Who.KNIGHT, Rank.R8, File.G));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.A));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.B));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.C));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.D));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.E));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.F));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.G));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.H));\n\n for (Piece p : blackPieces) {\n board[p.row.ordinal()][p.col.ordinal()] = p;\n }\n\n whoseTurn = Owner.WHITE;\n canCastle = 15;\n passer = null;\n movesDone = lastEatMove = 0;\n }", "public synchronized void startGame() {\n PreGameState preGameState = new PreGameState();\n pickTeamState = preGameState.startGame(players);\n state = State.PICK_TEAM;\n teamSelection = new HashSet<>();\n }", "public void startGame() {\n\t\t\n\t\tPlayer p1;\n\t\tPlayer p2;\n\t\t\n\t\tif(player1.getSelectionModel().getSelectedItem().equals(_HUMAN)) {\n\t\t\tp1 = new Human(1, main);\n\t\t}\n\t\telse {\n\t\t\tString difficulty = player1Diff.getSelectionModel().getSelectedItem();\n\t\t\t\n\t\t\tint diff = difficulty.equals(_DIFFICULTY1) ? 1 : difficulty.equals(_DIFFICULTY2) ? 2 : 3;\n\t\t\t\n\t\t\tp1 = new AI(1, diff, main);\n\t\t}\n\t\t\n\t\t\n\t\tif(player2.getSelectionModel().getSelectedItem().equals(_HUMAN)) {\n\t\t\tp2 = new Human(2, main);\n\t\t}\n\t\telse {\n\t\t\tString difficulty = player2Diff.getSelectionModel().getSelectedItem();\n\t\t\t\n\t\t\tint diff = difficulty.equals(_DIFFICULTY1) ? 1 : difficulty.equals(_DIFFICULTY2) ? 2 : 3;\n\t\t\t\n\t\t\tp2 = new AI(2, diff, main);\n\t\t}\n\t\t\n\t\t\n\t\tmain.startGame(p1, p2);\n\t\t\n\t}", "public void startOpponent() {\n\t\tthis.opponent.start();\n\t\tthis.timer.start();\n\t}", "private void startGame(){\n try {\n String playersName = fromServer.readUTF();\n lbPl1.setText(playersName.split(POINTS_DELIMITER)[0]);\n lbPl2.setText(playersName.split(POINTS_DELIMITER)[1]);\n lbWhiteStone.setIcon(whiteIcon);\n// lbWhiteStone.setText(playersName.split(POINTS_DELIMITER)[1]);\n lbBlackStone.setIcon(blackIcon);\n// lbBlackStone.setText(playersName.split(POINTS_DELIMITER)[0]);\n\n boardComponent.initiate();\n boardComponent.repaint();\n setScoreText();\n if(this.color == 0) {\n setMsgText(\"\");\n colorLabel.setText(\"You are a viewer.\");\n setButtons(false);\n btnNewGame.setEnabled(false);\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void startGame() {\n \t\tcontroller = new GameController(gameConfig, players);\n \t\tcontroller.LOG = controller.LOG + \"#MPClient\";\n \n controller.setCurrentPlayer(firstTurnPid);\n \n \t\tsendStartGame();\n \t}", "private void gameStart(){\n\t\tRandom randomGenerator = new Random();\n\t\tint ranNum = randomGenerator.nextInt(teamNum);\n\t\tSystem.out.println(\"The team to go first will be \" + teams[ranNum].getName());\n\t\tgameHelper(ranNum); //process all 25 questions until it's over\n\t\tfinalRound();\n\t\tprintFinalWinner();\n\t\t\n\t\t\n\t}", "public static void start() {\r\n\t\t@SuppressWarnings(\"resource\")\r\n\t\tScanner kb = new Scanner(System.in);\r\n\t\tSystem.out.println(\"\\n (1) Player's Move\\n (2) Gideon's Move\\n \");\r\n\t\t\r\n\t\tString prompt = \"GAME: Chess Master\\r\\n\" + \r\n\t\t\t\t\" This is a chess-like game with a \\\"Karate\\\" theme. Each side starts with 3 samurai,\\r\\n\" + \r\n\t\t\t\t\" 3 ninjas, 3 mini-samurai, 3 mini-ninjas, and a King. It is played on a 7x8 board,\\r\\n\" + \r\n\t\t\t\t\" and players \\\"attack\\\" opposing pieces by moving one of their pieces in front of\\r\\n\" + \r\n\t\t\t\t\" an opponents piece. When a piece is attacked, it is \\\"demoted\\\". When a \\\"mini\\\"\\r\\n\" + \r\n\t\t\t\t\" piece is attacked, it is removed from the board. The king cannot move, and if it\\r\\n\" + \r\n\t\t\t\t\" is attacked, then that side loses. The initial position is:\";\r\n\t\t\r\n\t\tString userInput = kb.next(); \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Getting the user's preference for whose playing the first move\r\n\t\t\r\n\t\tif(userInput.equals(\"1\")) { \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Player will play the first move\r\n\t\t\tSystem.out.println(prompt);\r\n\t\t\tplayersMove(); \r\n\t\t}\r\n\t\t\r\n\t\telse if(userInput.equals(\"2\")) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Gideon will play the first move\r\n\t\t\tSystem.out.println(prompt);\r\n\t\t\tGideonsMove();\r\n\t\t}\r\n\t\t\r\n\t\telse \t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Invalid input, re-call method and attempt to get user's input again\r\n\t\t\tstart();\r\n\t\t\r\n\t}", "public Bot startGame(){\n\t\t\n\t\ttable.addObserver(this); //to keep scores.\n\t\ttable.addObserver(players.get(0)); //observer pattern to notify players via events.\n\t\ttable.addObserver(players.get(1));\n\t\ttable.addObserver(players.get(2));\n\t\ttable.addObserver(players.get(3));\n\t\t\n\t\ttable.putInitialCards(deck.getFourCards());\n\t\t\n\t\twhile(!deck.isEmpty()){\n\t\t\t//deal cards\n\t\t\tfor(Bot bot : players){\n\t\t\t\tbot.setHand(deck.getFourCards());\n\t\t\t}\n\t\t\t\n\t\t\t//start playing\n\t\t\tfor(int i = 0 ; i < 4 ; i++){\n\t\t\t\tfor(Bot bot : players){\n\t\t\t\t\tcurrentPlayer = bot;\n\t\t\t\t\tCard cardToThrow = currentPlayer.throwACard();\n//\t\t\t\t\tSystem.out.println(\"Bot \"+ currentPlayer.toString() + \" threw \" + cardToThrow.toString());\n\t\t\t\t\ttable.putOnPile(cardToThrow);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//award last pile winner\n\t\tplayers.get(lastWinnerId).addPoints(Table.calculatePoints(table.getCardsOnPile()));\n\t\tplayers.get(lastWinnerId).addWonCards(table.getCardsOnPile().size());\n//\t\tSystem.out.println(\"Last pile goes to [\"+players.get(lastWinnerId).toString()+\"]\");\n\t\ttable.clearPile();\n\t\t\n\t\t\n\t\t//award most card winner\n\t\tCollections.sort(players, new CompareByWonCardSize()); // sort players by most cards won.\n\t\tplayers.get(3).addPoints(3); // last one has most cards.\n//\t\tSystem.out.println(\"The bot [\"+players.get(3).toString()+\"] won the most cards so it gets bonus 3 points!\");\n\t\t\t\t\n//\t\tSystem.out.println(\"### SCORES ###\");\n\t\tCollections.sort(players, new CompareByPoints()); // sort by points\n\t\t\n\t\tBot winner = players.get(3);\n//\t\tSystem.out.println(\"WINNER IS: \"+ winner);\n\t\t\n\t\treturn winner;\n\t}", "private void startGame() {\n\t\tmain.next_module = new Game(main, inputs, gameSelectionData);\n\t}", "public static void startGame() {\r\n\t\tfor (MovingUnit mu : _players) {\r\n\t\t\t((WinningInterface) mu).startUnit();\r\n\t\t}\r\n\t}", "private void startMatch() {\n game = new Match(players.get(0), players.get(1), \"Nueva Partida\");\n showMatch();\n state = 1;\n }", "public void startGame() {\n loadPlayersIntoQueueOfTurns();\n nextPlayerInTurn();\n eventListener.addEventObject(new RoundEvent(EventNamesConstants.GameStarted));\n }", "public void startGame() {\n\t\tif (chordImpl.getPredecessorID().compareTo(chordImpl.getID()) > 0) {\n\t\t\tGUIMessageQueue.getInstance().addMessage(\"I Start!\");\n\t\t\tshoot();\n\t\t}\n\t}", "public void startGame() \n\t{\n\t\tgamePanel.startGame();\n\t}", "public static void main(String[] args) {\n Board b = new Board();\n Scanner in = new Scanner(System.in);\n\n Random r = new Random(System.currentTimeMillis());\n int start = Math.abs(r.nextInt()) % 2;\n int init = start;\n // Daca start este 1, incepe calculatorul, altfel jucatorul\n PLAYER perspective = PLAYER.PLAY_AS_X;\n // X mereu va avea prima mutare\n\n\n while (b.GetWinner() == WINNER.PLAYER_NONE) {\n Pair current_move;\n if (start == 1) {\n System.out.println(\"Computer is thinking...\");\n Board newBoard = new Board(b);\n current_move = PlayMove(newBoard, perspective);\n System.out.println(\"Computer chose move: (\" + current_move.first +\" \" + current_move.second + \")\");\n } else {\n int row, col;\n System.out.println(\"It's your turn, enter move:\");\n do {\n System.out.println(\"Row:\");\n row = in.nextInt();\n } while (row < 0 || row > 2);\n do {\n System.out.println(\"Column:\");\n col = in.nextInt();\n } while (col < 0 || col > 2);\n current_move = new Pair(row, col);\n }\n if (b.GetMark(current_move.first, current_move.second) != MARK.NONE) {\n System.out.println(\"Invalid move, exiting\");\n return;\n }\n if (perspective == PLAYER.PLAY_AS_X) {\n b.MarkX(current_move.first, current_move.second);\n } else {\n b.MarkZero(current_move.first, current_move.second);\n }\n start = 1 - start;\n perspective = (perspective == PLAYER.PLAY_AS_X) ? PLAYER.PLAY_AS_ZERO : PLAYER.PLAY_AS_X;\n System.out.println(\"Current board is:\\n\" + b);\n }\n\n System.out.println(\"Game is finished\");\n if (b.GetWinner() == WINNER.PLAYER_X) {\n if (init == 1) {\n System.out.println(\"Computer won\");\n return;\n }\n System.out.println(\"Player won, you should at most draw, keep working on the AI\");\n return;\n }\n if (b.GetWinner() == WINNER.PLAYER_ZERO) {\n if (init == 1) {\n System.out.println(\"Player won, you should at most draw, keep working on the AI\");\n return;\n }\n System.out.println(\"Computer won\");\n return;\n }\n System.out.println(\"Draw, Well Done!\");\n return;\n }", "private void consoleGameStart(){\n\t\tconsoleGetOptions();\n\t\t\n\t\t//diplay the board\n\t\tconsoleBoardDisplay();\n\t\tdo{\t\n\t\t\t//either player makes a move\t\t\n\t\t\tif (ttt.isPlayerTurn()) consoleBoardInput();\n\t\t\telse ttt.computeMove();\n\t\t\tconsoleBoardDisplay();\n\t\t\t\n\t\t\t//check for winning states and draw states\n\t\t\tif (ttt.checkWin()){\n\t\t\t\tif (ttt.isPlayerTurn()) System.out.println(\"Computer Wins\");\n\t\t\t\telse System.out.println(\"Player Wins\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (ttt.checkDraw()){\n\t\t\t\tSystem.out.println(\"Its a Draw Game\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}while (true);\n\t}", "public static void interactivePlay() {\r\n\t\tint[][] board = createBoard();\r\n\t\tshowBoard(board);\r\n\r\n\t\tSystem.out.println(\"Welcome to the interactive Checkers Game !\");\r\n\r\n\t\tint strategy = getStrategyChoice();\r\n\t\tSystem.out.println(\"You are the first player (RED discs)\");\r\n\r\n\t\tboolean oppGameOver = false;\r\n\t\twhile (!gameOver(board, RED) && !oppGameOver) {\r\n\t\t\tboard = getPlayerFullMove(board, RED);\r\n\r\n\t\t\toppGameOver = gameOver(board, BLUE);\r\n\t\t\tif (!oppGameOver) {\r\n\t\t\t\tEnglishCheckersGUI.sleep(200);\r\n\r\n\t\t\t\tboard = getStrategyFullMove(board, BLUE, strategy);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tint winner = 0;\r\n\t\tif (playerDiscs(board, RED).length == 0 | playerDiscs(board, BLUE).length == 0){\r\n\t\t\twinner = findTheLeader(board);\r\n\t\t}\r\n\r\n\t\tif (winner == RED) {\r\n\t\t\tSystem.out.println();\r\n\t\t\tSystem.out.println(\"\\t *************************\");\r\n\t\t\tSystem.out.println(\"\\t * You are the winner !! *\");\r\n\t\t\tSystem.out.println(\"\\t *************************\");\r\n\t\t}\r\n\t\telse if (winner == BLUE) {\r\n\t\t\tSystem.out.println(\"\\n======= You lost :( =======\");\r\n\t\t}\r\n\t\telse\r\n\t\t\tSystem.out.println(\"\\n======= DRAW =======\");\r\n\t}", "private void startGame(){\n\t\tnewGame.setVisible(false);\n\t\tcp1shipLabel.setVisible(true);\n\t\tcp2shipLabel.setVisible(true);\n\n\t\tcp1ShotCount = 0;\n\t\tcp2ShotCount = 0;\n\t\tcp1BoatsSunk = 0;\n\t\tcp2BoatsSunk = 0;\n\n\t\tcp1shipLabel.setText(\"Computer Player 1 ships sunk: \" + cp1BoatsSunk);\n\t\tcp2shipLabel.setText(\"Computer Player 2 ships sunk: \" + cp2BoatsSunk);\n\n\t\tships = new Ship[10];\n\n\t\tcp1PlaceShips();\n\t\tcp2PlaceShips();\n\n\t\tfor(int x = 0; x < cp1Attacks.length; x++){\n\t\t\tfor(int y = 0; y < cp1Attacks[x].length; y++){\n\t\t\t\tcp1Attacks[x][y] = false;\n\t\t\t\tcp2Attacks[x][y] = false;\n\t\t\t}\n\t\t}\n\t\tgameTimer.start();\n\t\trepaint();\n\t}", "private void startNewGame()\n {\n \n \t//this.mIsSinglePlayer = isSingle;\n \n \tmGame.clearBoard();\n \n \tfor (int i = 0; i < mBoardButtons.length; i++)\n \t{\n \t\tmBoardButtons[i].setText(\"\");\n \t\tmBoardButtons[i].setEnabled(true);\n \t\tmBoardButtons[i].setOnClickListener(new ButtonClickListener(i));\n \t\t//mBoardButtons[i].setBackgroundDrawable(getResources().getDrawable(R.drawable.blank));\n \t}\n \n \t\tmPlayerOneText.setText(\"Player One:\"); \n \t\tmPlayerTwoText.setText(\"Player Two:\"); \n \n \t\tif (mPlayerOneFirst) \n \t{\n \t\t\tmInfoTextView.setText(R.string.turn_player_one); \n \t\tmPlayerOneFirst = false;\n \t}\n \telse\n \t{\n \t\tmInfoTextView.setText(R.string.turn_player_two); \n \t\tmPlayerOneFirst = true;\n \t}\n \t\n \n \tmGameOver = false;\n }", "public void GameStart()\n\t\t{\n\t\t\tplayers_in_game++;\n\t\t}", "public void playGame() {\n \t\n \t//Starts up window for graphical display of game\n MainWindow window = new MainWindow();\n window.launchWindow();\n \n boolean playing = true;\n int attacker, defender;\n Attack attack;\n Response response;\n /*\n * Each iteration of this loop is one player's turn.\n */\n while (playing) {\n /*\n * For now we do debug output. Before going ot production we would want to change this,\n * and at least shop showing all secret Ship placement at every turn.\n */\n //printDebugState(0);\n // printDebugState(1);\n\n attacker = currentPlayer;\n defender = otherPlayer(currentPlayer);\n\n \n /*\n * First gather an Attack\n */\n if (isAI[attacker]) { // It is an AI's turn\n attack = players[attacker].makeAttack(playerShips[1]); //makeAttack takes the players Ship array to check and see if it gets a hit\n } else { // It is a human's turnids[1\n attack = consoleGetAttack(attacker);\n }\n\n System.out.println(\"Player \" + currentPlayer +\n \" attacks at (\" + attack.getRow() + \",\" + attack.getColumn() + \")\");\n \n /*\n * Deliver the attack and collect the Response\n */\n if (isAI[defender]) { // The defender is an AI\n response = players[defender].receiveAttack(attack);\n } else { // It is a human's turn\n response = consoleGetResponse(attack, defender);\n }\n\n switch (response.getResult()) {\n case Response.HIT:\n System.out.println(\"It's a HIT!\");\n break;\n case Response.MISS:\n System.out.println(\"It's a MISS!\");\n break;\n case Response.SUNK:\n System.out.println(\"Ship sunk: \" + response.getShipName());\n \n break;\n case Response.ALLSUNK:\n System.out.println(\"Ship sunk: \" + response.getShipName());\n System.out.println(\"Game over; player \" + currentPlayer + \" wins!\");\n playing = false;\n break;\n }\n \n \n /*\n * Return the Response to the Attacker\n */\n if (isAI[currentPlayer]) { // It is an AI's turn\n players[currentPlayer].receiveResponse(response);\n } else { // It is a human's turn\n }\n\n /*\n * Finally update the UI's instance variables\n */\n if (response.getResult() == Response.MISS) {\n grids[currentPlayer].set(attack.getRow(), attack.getColumn(), Grid.MISS);\n } else {\n grids[currentPlayer].set(attack.getRow(), attack.getColumn(), Grid.HIT);\n }\n changeCurrentPlayer();\n } // while (true) -- Continue playing turns until the game ends\n }", "public void startGame(){\n\t\tSystem.out.println(\"UNI: nas2180\\n\" +\n\t\t\t\t\"Hello, lets play Rock Paper Scissors Lizard Spock!\\n\");\n\t\tSystem.out.println(\"Rules:\\n Scissors cuts Paper\\n \" +\n\t\t\t\t\"Paper covers Rock\\n \" +\n\t\t\t\t\"Rock crushes Lizard\\n \" +\n\t\t\t\t\"Lizard poisons Spock\\n \" +\n\t\t\t\t\"Spock smashes Scissors\\n \" +\n\t\t\t\t\"Scissors decapitates Lizard\\n \" +\n\t\t\t\t\"Lizard eats Paper\\n \" +\n\t\t\t\t\"Paper disproves Spock\\n \" +\n\t\t\t\t\"Spock vaporizes Rock\\n \" +\n\t\t\t\t\"(and as it always has) Rock crushes Scissors\\n\");\n\t\tthisGame = new GameResult();\n\t\tplayRound();\n\t}", "public void play() {\n Player playerOne = preparePlayer(getUserName(scanner, validator, shipsGameText.getMessage(\"show.player.one\"), null));\n Player currentPlayer = playerOne;\n ShipsGameBoard playerOneGameBoard = new ShipsGameBoard(playerOne, playerOneFleet);\n ShipsGameBoard playerOneCheckBoard = new ShipsGameBoard(playerOne, playerOneFleetToCheck);\n playerOneCheckBoard.setup();\n\n TreeMap<Character, Integer> lettersAndDigits = lettersAndDigits(playerOneGameBoard.getLength());\n ShipCreator threeMastShipCreatorPlayerOne = new ShipCreator(THREE_MASTS_SHIP,\n null,\n playerOne,\n ShipGameBoardMark.THREE_MASTS,\n playerOneGameBoard,\n playerOneShipsGameLogic);\n\n playerOneGameBoard.print();\n shipsDeployment(playerOneGameBoard,\n lettersAndDigits,\n threeMastShipCreatorPlayerOne,\n playerOneShipsGameLogic,\n playerOneFleet,\n NUMBER_OF_SHIPS);\n\n// playerOneShipsGameLogic.clearConsole();\n\n Player playerTwo = preparePlayer(getUserName(scanner, validator, shipsGameText.getMessage(\"show.player.two\"), playerOne.getName()));\n ShipsGameBoard playerTwoGameBoard = new ShipsGameBoard(playerTwo, playerTwoFleet);\n ShipsGameBoard playerTwoCheckBoard = new ShipsGameBoard(playerTwo, playerTwoFleetToCheck);\n playerTwoCheckBoard.setup();\n\n ShipCreator threeMastShipCreatorPlayerTwo = new ShipCreator(THREE_MASTS_SHIP,\n null,\n playerTwo,\n ShipGameBoardMark.THREE_MASTS,\n playerTwoGameBoard,\n playerTwoShipsGameLogic);\n\n playerTwoGameBoard.print();\n shipsDeployment(playerTwoGameBoard,\n lettersAndDigits,\n threeMastShipCreatorPlayerTwo,\n playerTwoShipsGameLogic,\n playerTwoFleet,\n NUMBER_OF_SHIPS);\n\n\n boolean isAWinner = false;\n do {\n int userRow;\n int userCol;\n// playerOneGameBoard.clearConsole();\n showCurrentPlayerBoards(playerOne, currentPlayer, playerOneGameBoard, playerTwoGameBoard, playerOneCheckBoard,\n playerTwoCheckBoard, shipsGameText);\n System.out.println(shipsGameText.getMessage(\"show.witch.player.move\", currentPlayer.getName()));\n\n System.out.println(shipsGameText.getMessage(\"show.input.row\", Integer.toString(playerOneGameBoard.getLength())));\n userRow = getPlayerRowChoice(scanner, validator, playerOneGameBoard.getLength());\n\n System.out.println(shipsGameText.getMessage(\"show.input.col\",\n Character.toString(playerOneGameBoard.generateLastLetterOfColumn('A', playerOneGameBoard.getLength()))));\n userCol = convertLetterToDigit(lettersAndDigits, getPlayerColChoice(scanner, validator,\n lettersAndDigits));\n\n if (currentPlayer.equals(playerOne)) {\n if (playerTwoShipsGameLogic.checkForHit(userRow, userCol)) {\n playerOneShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n playerTwoShipsGameLogic.changeMastStatus(userRow, userCol, playerTwo, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n if (playerTwoShipsGameLogic.checkShipForStatusChange(userRow, userCol)) {\n playerTwoShipsGameLogic.changeShipStatusToSunk(userRow, userCol, playerTwo);\n playerOneShipsGameLogicToCheck.changeShipStatusToSinkOnCheckBoard(playerTwoFleet, playerOne);\n System.out.println(shipsGameText.getMessage(\"show.player.sunk.ship\"));\n System.out.println(shipsGameText.getMessage(\"show.player.checkboard\", currentPlayer.getName()));\n playerOneCheckBoard.print();\n System.out.println(shipsGameText.getMessage(\"show.player.gameboard\", playerTwo.getName()));\n playerTwoGameBoard.print();\n } else {\n System.out.println(shipsGameText.getMessage(\"show.player.hit.ship\", playerOne.getName()));\n }\n } else {\n System.out.println(shipsGameText.getMessage(\"show.player.miss\"));\n playerOneShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.MISS);\n playerTwoShipsGameLogic.changeMastStatus(userRow, userCol, playerTwo, ShipGameBoardMark.MISS);\n }\n\n// if (playerTwoShipsGameLogic.checkShipForStatusChange(userRow, userCol)) {\n// playerTwoShipsGameLogic.changeShipStatusToSunk(userRow, userCol, playerTwo);\n// playerOneShipsGameLogicToCheck.changeShipStatusToSinkOnCheckBoard(playerTwoFleet, playerOne);\n// System.out.println(shipsGameText.getMessage(\"show.player.sunk.ship\"));\n// System.out.println(shipsGameText.getMessage(\"show.player.checkboard\", currentPlayer.getName()));\n// playerOneCheckBoard.print();\n// System.out.println(shipsGameText.getMessage(\"show.player.gameboard\", playerTwo.getName()));\n// playerTwoGameBoard.print();\n// }\n\n\n if (playerTwoShipsGameLogic.isPlayerLoose()) {\n System.out.println(shipsGameText.getMessage(\"show.player.win\", playerOne.getName()));\n isAWinner = true;\n }\n\n } else {\n if (playerOneShipsGameLogic.checkForHit(userRow, userCol)) {\n playerTwoShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerTwo, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n playerOneShipsGameLogic.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n if (playerOneShipsGameLogic.checkShipForStatusChange(userRow, userCol)) {\n playerOneShipsGameLogic.changeShipStatusToSunk(userRow, userCol, playerOne);\n playerTwoShipsGameLogicToCheck.changeShipStatusToSinkOnCheckBoard(playerOneFleet, playerTwo);\n System.out.println(shipsGameText.getMessage(\"show.player.sunk.ship\"));\n System.out.println(shipsGameText.getMessage(\"show.player.checkboard\", currentPlayer.getName()));\n playerTwoCheckBoard.print();\n System.out.println(shipsGameText.getMessage(\"show.player.gameboard\", playerOne.getName()));\n playerOneGameBoard.print();\n }\n else {\n System.out.println(shipsGameText.getMessage(\"show.player.hit.ship\", playerOne.getName()));\n }\n } else {\n playerTwoShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerOne,\n ShipGameBoardMark.MISS);\n playerOneShipsGameLogic.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.MISS);\n System.out.println(shipsGameText.getMessage(\"show.player.miss\"));\n }\n if (playerOneShipsGameLogic.isPlayerLoose()) {\n System.out.println(shipsGameText.getMessage(\"show.player.win\", playerTwo.getName()));\n isAWinner = true;\n }\n }\n\n currentPlayer = swapPlayers(playerOne, currentPlayer, playerTwo);\n }\n while (!isAWinner);\n }", "private void startGame() {\n betOptionPane();\n this.computerPaquetView.setShowJustOneCard(true);\n blackjackController.startNewGame(this);\n }", "private void start() // Start the game\n\t{\n\t\tdouble startingPlayerDecider = 0; // Used in the process of deciding who goes first.\t\n\n\t\tif (needToReset == true) // If the game needs to be reset...\n\t\t{\n\t\t\treset(); // Then do so..\n\t\t}\n\n\t\tswitch (gameState) // Check the state of the game and change the messages as needed.\n\t\t{\n\t\tcase waitingForStart:\n\t\t\tlabelGameState.setText(\"Welcome to dig for diamonds.\");\t\n\t\t\tbuttonStart.setText(\"Next\"); // The start button now acts as the next button.\n\t\t\tgameState = GameState.gameWelcome;\n\t\t\tgameStateString = gameStateToString();\n\t\t\tbreak;\n\t\tcase gameWelcome:\n\t\t\tlabelGameState.setText(\"We shall now randomly decide who goes first.\");\t\n\t\t\tgameState = GameState.decideWhoGoesFirst;\n\t\t\tgameStateString = gameStateToString();\n\t\t\tbreak;\n\t\tcase decideWhoGoesFirst:\n\t\t\tswitch(totalPlayers) // Decide based on the number of players who goes first.\n\t\t\t{\n\t\t\tcase 2: // For two players...\n\t\t\t\tstartingPlayerDecider = control.randomNumber(100,0); // Generate a random number between 0 and 100\n\n\t\t\t\tif (startingPlayerDecider >= 50) // If it is greater then or equal to 50...\n\t\t\t\t{\n\t\t\t\t\tplayers.get(0).setIsPlayerTurn(true); // Player 1 goes first.\t\n\t\t\t\t\tlabelGameState.setText(\"Player 1 shall go first this time.\");\t\n\t\t\t\t\tgameState = GameState.twoPlayersPlayerOneGoesFirst;\n\t\t\t\t\tgameStateString = gameStateToString();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tplayers.get(1).setIsPlayerTurn(true); // Else player two goes first.\n\t\t\t\t\tlabelGameState.setText(\"Player 2 shall go first this time.\");\t\n\t\t\t\t\tgameState = GameState.twoPlayersPlayerTwoGoesFirst;\n\t\t\t\t\tgameStateString = gameStateToString();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase twoPlayersPlayerOneGoesFirst:\n\t\t\tgameState = GameState.twoPlayersNowPlayerOnesTurn;\n\t\t\tlabelGameState.setText(\"It is now \" + players.get(0).getPlayerName() + \"'s turn.\");\t\n\t\t\tgameStateString = gameStateToString();\n\t\t\tbreak;\n\t\tcase twoPlayersPlayerTwoGoesFirst:\n\t\t\tgameState = GameState.twoPlayersNowPlayerTwosTurn;\n\t\t\tlabelGameState.setText(\"It is now \" + players.get(1).getPlayerName() + \"'s turn.\");\t\n\t\t\tgameStateString = gameStateToString();\n\t\t\tbreak;\n\t\t}\t\t\n\t}", "public void startGame() {\r\n this.setupGame();\r\n }", "public void StartGame(){\n log(\"Game started\");\n\n myTile = 74;\n opponentTile = 14;\n bombs=3;\n hp=3;\n turnNumber = 1;\n lastTurnPowerup = 1;\n powerup_confusion = false;\n powerup_godmode = false;\n bombs_location = new ArrayList<>();\n powerup_location = new ArrayList<>();\n canPlaceBomb = true;\n invulnerable = false;\n confused = false;\n\n ImageView player2 = (ImageView) findViewById(R.id.square_14);\n ImageView player1 = (ImageView) findViewById(R.id.square_74);\n player1.setScaleType(ImageView.ScaleType.FIT_CENTER);\n player2.setScaleType(ImageView.ScaleType.FIT_CENTER);\n player1.setImageDrawable(getResources().getDrawable(R.drawable.tank_blue));\n player2.setImageDrawable(getResources().getDrawable(R.drawable.tank_red));\n String playerStarterId = getIntent().getStringExtra(getResources().getString(R.string.game_player_starter));\n\n /**\n * decides who gets to start according to the algorithm in MultiplayerManager.java\n */\n// if(playerStarterId.equals(mMyId)){\n// myTurn = true;\n// showTimedAlertDialog(\"Your turn!\", \"Click on spot you want to move your brick to\", 5);\n// }else{\n// myTurn = false;\n// showTimedAlertDialog(\"Your opponent's move\", \"Wait for your opponent to make a move\", 5);\n// }\n\n /**\n * fallback incase the previous method doesnt work\n */\n try{\n if(sharedPreferences.getString(\"brick\", null).contains(\"Arafat\")){\n myTurn = true;\n ShotsCaller = true;\n showTimedAlertDialog(\"Your turn!\", \"Click on spot you want to move your brick to\", 5);\n }else{\n myTurn = false;\n ShotsCaller = false;\n showTimedAlertDialog(\"Your opponent's move\", \"Wait for your opponent to make a move\", 5);\n }\n }catch (NullPointerException e){\n myTurn = false;\n ShotsCaller = false;\n }\n }", "@Override\n public void startNewGame() {\n reset();\n winnerDialogShown_ = false;\n sendGameChangedEvent(null); // get the info panel to refresh with 1st players name\n Player firstPlayer = controller.getPlayers().getFirstPlayer();\n\n if (firstPlayer.isSurrogate()) {\n doSurrogateMove((SurrogateMultiPlayer) firstPlayer);\n }\n else if (!firstPlayer.isHuman()) {\n controller.computerMovesFirst();\n }\n }", "public void initGame() {\n // clear the board contents\n board.init();\n // CROSS speelt eerst\n currentPlayer = Mark.CROSS;\n currentState = GameState.PLAYING;\n // ready for start\n }", "void startGame(TurnBasedMatch match) {\n\n\t\tLayoutHelper.hideResult(resultTextView);\n\n\t\tif (match.getData() == null) {\n\t\t\t// The game has not started so we set it up and decides who\n\t\t\t// should have the starting turn.\n\t\t\tstartNewGame(match);\n\t\t\treturn;\n\t\t}\n\n\t\tGameActivity.gameMachine.state = State.OPPONENT_TURN;\n\t\tturnUsed = false;\n\t\tif(!readGameState(match))\n\t\t{\n\t\t\treturn;// Loads the data from the bytes passed in\n\t\t}\n\t\t\t\t\t\t\t\t// the intent/match into our actual game\n\t\t\t\t\t\t\t\t// objects in game.\n\n\t\t// Find out if its our turn or opponents turn.\n\t\tif (match.getTurnStatus() == TurnBasedMatch.MATCH_TURN_STATUS_MY_TURN) {\n\t\t\t// Sort of a hack to correctly apply opponents actions before we\n\t\t\t// change to players turn.\n\t\t\tGameActivity.gameMachine.startGame();\n\n\t\t\tif (GameActivity.gameMachine.state != State.GAME_OVER) {\n\t\t\t\tGameActivity.gameMachine.state = State.PLAYER_TURN;\n\t\t\t}\n\t\t} else {\n\t\t\tGameActivity.gameMachine.setStateAndNotify(State.OPPONENT_TURN);\n\t\t}\n\n\t\tswitch (match.getStatus()) {\n\t\tcase TurnBasedMatch.MATCH_STATUS_ACTIVE:\n\t\t\tGameActivity.gameMachine.startGame();\n\t\t\tbreak;\n\t\tcase TurnBasedMatch.MATCH_STATUS_COMPLETE:\n\t\t\tif (GameActivity.gameMachine.state != GameMachine.State.GAME_OVER) {\n\t\t\t\tGameActivity.gameMachine.startGame();\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}", "public void start() {\n // set player number\n playerNumber = clientTUI.getInt(\"set player number (2-4):\");\n while (true) {\n try {\n game = new Game();\n game.setPlayerNumber(playerNumber - 1);\n host = this.clientTUI.getString(\"server IP address:\");\n port = this.clientTUI.getInt(\"server port number:\");\n clientName = this.clientTUI.getString(\"your name:\");\n player = clientTUI.getBoolean(\"are you human (or AI): (true/false)\") ?\n new HumanPlayer(clientName) : new ComputerPlayer(clientName);\n game.join(player);\n // initialize the game\n game.init();\n while (clientName.indexOf(' ') >= 0) {\n clientName = this.clientTUI.getString(\"re-input your name without space:\");\n }\n this.createConnection();\n this.sendJoin(clientName);\n this.handleJoin();\n if (handshake) {\n run();\n } else {\n if (!this.clientTUI.getBoolean(\"Do you want to open a new connection?\")) {\n shutdown();\n break;\n }\n }\n } catch (ServerUnavailableException e) {\n clientTUI.showMessage(\"A ServerUnavailableException error occurred: \" + e.getMessage());\n if (!clientTUI.getBoolean(\"Do you want to open a new connection?\")) {\n shutdown();\n break;\n }\n }\n }\n clientTUI.showMessage(\"Exiting...\");\n }", "private void startGame() {\r\n setGrid();\r\n setSnake();\r\n newPowerUp();\r\n timer.start();\r\n }", "public void startTurn(){\n if (hasWinner()){\n announceWinner();\n return;\n }\n\n gameDraft();\n gameAttack();\n if (hasWinner()) return; //Skipping fortify if the game is won\n gameFortify();\n displayMessage(\"End of \" + currentPlayer.getName() + \"'s turn!\");\n }", "public void restart()\n {\n //resets values \n x = 0; // stores current row of black piece when moving right or right + down\n x3 = 7; // stores current row of black piece when moving right + down\n y = 0; // stores current column of black piece\n x2 = 0; // stores current row of white piece when moving left or left + down\n x4 = 7; // stores current row of white piece when moving left + down\n y2 = 7; // stores current column of black piece\n gameSet = false; // decides if a player has won the game or not\n whiteCount = 0; // counts how many white pieces were taken\n blackCount = 0; // counts how many black pieces were taken\n \n \n //determines which players start first\n turn = Math.random() < 0.5; \n \n //if turn == 0/false \n if(turn == false)\n {\n player.setText(\"<html><strong><font color='red'>Player 1 starts first!</font></strong></html>\");\n }\n \n //if turn == 1/true\n if(turn == true)\n {\n player.setText(\"<html><strong><font color='blue'>Player 2 starts first!</font></strong></html>\");\n }\n \n \n \n //sets icons for the left 16 buttons to the icon black\n for( int rows = 0; rows< gridUnits.length; rows++)\n {\n \n for(int cols = 0;cols <2; cols++)\n {\n gridUnits[rows][cols].setIcon(black);\n }\n }\n \n \n //sets icons for the right 16 buttons to the icon white\n for(int rows = 0; rows< gridUnits.length; rows++)\n {\n \n for(int cols = 6;cols <8; cols++)\n {\n gridUnits[rows][cols].setIcon(white);\n \n }\n \n }\n \n //sets icons for the middle 32 buttons to the icon blank\n for(int rows = 0; rows< gridUnits.length; rows++)\n {\n \n for(int cols = 2;cols <6; cols++)\n {\n gridUnits[rows][cols].setIcon(blank);\n \n }\n \n } \n \n //adds actionListeners to all of the 64 buttons\n for (int rows = 0; rows < gridUnits.length; rows++)\n {\n \n for(int cols = 0; cols < gridUnits.length; cols++)\n {\n gridUnits[rows][cols].addActionListener(this);\n \n }\n \n }\n \n }", "private void startGame() {\r\n\t\tlog(mName + \": print an opening message (something useful, it is up to you)\");\r\n\t\tnew Thread(new Host(mRightPercent)).start();\r\n\r\n\t\tfor (Contestant c : Contestant.mGame.getContestants()) {\r\n\t\t\tlog(mName + \": Welcome \" + c.getName() + \" to the game.\");\r\n\t\t\tsynchronized (c.mConvey) {\r\n\t\t\t\tc.mConvey.notify();\r\n\t\t\t}\r\n\r\n\t\t\tsynchronized (intro) {\r\n\t\t\t\twaitForSignal(intro, null);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tsynchronized (Contestant.mGame) {\r\n\t\t\tContestant.mGame.setGameStarted(true);\r\n\t\t\tContestant.mGame.notify();\r\n\t\t}\r\n\t}", "public PlayerBoard() {\n super(\"Who wants to play darts???\");\n initComponents();\n setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\n setVisible(true);\n //dartsboard = new ScoardField();\n game=new Game();\n teamA = null;\n teamB = null;\n }", "public void start() {\n\t\tinstruct();\n\t\tint pad1 = (26-player1.getName().length())/2;\n\t\tint pad2 = (26-player2.getName().length())/2;\n\t\tString heading = \" \".repeat(pad1) +\n\t\t\t\tplayer1.getName() +\n\t\t\t\t\" \".repeat(26 - player1.getName().length() - pad1) +\n\t\t\t\t\" \".repeat(pad2) +\n\t\t\t\tplayer2.getName() +\n\t\t\t\t'\\n';\n\n\t\tfor (int i = 0; i < rounds; i++) {\n\t\t\tString round = \"Round \"+(i+1);\n\t\t\tSystem.out.println(\" \".repeat(26-round.length()/2) + round + '\\n');\n\t\t\tint choice1 = getChoice(), choice2 = random.nextInt(3);\n\n\t\t\tSystem.out.println(heading);\n\t\t\tdraw(choice1, choice2);\n\t\t\tSystem.out.println('\\n'+remarks(choice1, choice2));\n\t\t\tSystem.out.printf(\"%s - %d\\t\\t%s - %d\\n\\n\", player1.getName(), player1.getPoints(), player2.getName(), player2.getPoints());\n\t\t\tif (!vsComputer) {\n\t\t\t\tSystem.out.print(\"Press enter to continue \");\n\t\t\t\tsc.nextLine();\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "private void play() {\r\n\t\tfor (int i = 0; i < players.length; i++) {\r\n\t\t\tPlayer p = players[i];\r\n\t\t\tif (p instanceof ComputerPlayer) {\r\n\t\t\t\tfirstMove[i] = ((ComputerPlayer) p).makeFirstMove(board);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (firstMove[0] != null && firstMoveScores[0] > 0) {\r\n\t\t\tcalcBestFirstMove();\r\n\t\t}\r\n\r\n\t\twhile (!(board.gameOver())) {\r\n\t\t\t/* \tNIET LANGER NODIG GELOOF IK, DIT KAN DE SERVER (ICM EEN TIMER) DOEN\r\n\r\n\t\t\tplayers[(moveNr + startingPlayer) % players.length].makeMove(board);\r\n\t\t\tserver.updateHand(players[(moveNr + startingPlayer) % players.length],\r\n\t\t\t\t\tplayers[(moveNr + startingPlayer) % players.length].updateHand());\r\n\t\t\tmoveNr++;*/\r\n\t\t}\r\n\t}", "private void playGame (int numberOfSticks,\n String whoPlaysFirst) {\n System.out.println();\n if (whoPlaysFirst.equals(player1.name()))\n game = new Game (player1, player2,\n numberOfSticks);\n else\n game = new Game (player2, player1,\n numberOfSticks);\n initializePlayerController(player1);\n initializePlayerController(player2);\n while (!game.gameOver()) {\n game.play();\n reportPlay(game.previousPlayer());\n }\n reportWinner(game.winner());\n }", "public void setup() {\r\n\t\thumanCardsPanel.setHumanCards(players.get(0).getCards());\r\n\t\tfor ( Player p : players ) {\r\n\t\t\tp.setBoard(board);\r\n\t\t\tp.setGame(this);\r\n\t\t}\r\n\t\tboard.setGame(this);\r\n\t\tboard.repaint();\r\n\t\tJOptionPane popup = new JOptionPane();\r\n\t\tString message = \"You are Miss Scarlet. Press Next Player to begin.\\n Hint: Use File > Detective Notes to help you win!\";\r\n\t\tpopup.showMessageDialog(this, message, \"Welcome to Clue!\", JOptionPane.INFORMATION_MESSAGE);\r\n\t}", "public void startGame() {\n int numberOFPlayers = view.askForNumberOfPlayers();\n\n // adding dealer...\n players.add(dealer);\n //...and players to 'players' ArrayList\n for (int i = 1; i < numberOFPlayers; i++) {\n players.add(new RegularPlayer(i + 1));\n }\n\n // dealing cards to players\n dealer.dealCardsToPlayers(players);\n // Game\n while (!(players.size() == 1)) {\n\n for (int i = 0; i < players.size(); i++) {\n\n // printowanie ilości kart kazdego z graczy dla testów\n if (checkGameStatus()) {\n try {\n // display no of cards for each player\n for (Player player : players) {\n view.print(\"Player \" + player.getPlayerId() + \" no of cards: \" + player.getCardsCount());\n }\n\n round(players.get(i), players);\n } catch (IndexOutOfBoundsException e) {\n continue;\n }\n } else {\n break;\n }\n }\n }\n }", "public void start(Game game) {\r\n\r\n //Draw a card start the game\r\n UnoCard card = deck.drawCard();\r\n\r\n //Finds out what color can be play next\r\n validColor = card.getColor();\r\n\r\n //Finds out what value is\r\n validValue = card.getValue();\r\n\r\n if(card.getValue() == UnoCard.Value.Wild) {\r\n start(game);\r\n }\r\n\r\n if(card.getValue() == UnoCard.Value.Wild_Four || card.getValue() == UnoCard.Value.DrawTwo) {\r\n start(game);\r\n }\r\n\r\n if(card.getValue() == UnoCard.Value.Skip) {\r\n JLabel message = new JLabel(playerIds[currentPlayer] + \" was skipped!\");\r\n message.setFont(new Font(\"Arial\", Font.BOLD, 48));\r\n JOptionPane.showMessageDialog(null, message);\r\n\r\n if(gameDirection == false) {\r\n currentPlayer = (currentPlayer + 1) % playerIds.length;\r\n }\r\n else if (gameDirection == true) {\r\n currentPlayer = (currentPlayer - 1) % playerIds.length;\r\n if(currentPlayer == -1) {\r\n currentPlayer = playerIds.length - 1;\r\n }\r\n }\r\n }\r\n if(card.getValue() == UnoCard.Value.Reverse) {\r\n JLabel message = new JLabel(playerIds[currentPlayer] + \" The game direction changed!\");\r\n message.setFont(new Font(\"Arial\", Font.BOLD, 48));\r\n JOptionPane.showMessageDialog(null, message);\r\n\r\n //^= means XOR operand. Flips game direction to the opposite value. If true becomes false, if false becomes true. \r\n gameDirection ^= true;\r\n currentPlayer = playerIds.length - 1;\r\n }\r\n stockpile.add(card);\r\n }", "private void startUpConditions(){\n\t\t\tString strSize = JOptionPane.showInputDialog(null, \n\t\t\t\t\t\"Pick a Board Size between 3-30.\");\n\t\t\ttry{\n\t\t\t\tselectedSize = Integer.parseInt(strSize);\n\t\t\t\t\n\t\t\tif(selectedSize < 2||selectedSize > 30){\n\t\t\t\tselectedSize = 10;\n\t\t\t\tJOptionPane.showMessageDialog(null, \"The Game has\"\n\t\t\t\t+ \" defaulted to a Board Size of 10.\");\n\t\t\t\t}\n\t\t\t\n\t\t\t}catch(NumberFormatException exception){\n\n\t\t\t\tJOptionPane.showMessageDialog(null, \"The Game has\"\n\t\t\t\t+ \" defaulted to a Board Size of 10.\"+\n\t\t\t\t\" Because you input characters other than numbers.\");\n\t\t\t\tselectedSize = 10;\t\t\t\t\n\t\t\t}\n\n\t\n\t\t//selecting the number of players within the game\n\t\t//verifying a valid input for the Players\n\t\t//It's awfully boring to play by yourself after all.\n\t\t\tString strPlay = JOptionPane.showInputDialog(null, \n\t\t\t\t\t\"Pick number of players between 2-10\");\n\t\t\ttry{\n\t\t\t\tif(strPlay==null){\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"The game\"\n\t\t\t\t\t+\" has defaulted to 2 players.\");\n\t\t\t\t\tselectedPlayers = 2;\n\t\t\t\t}\n//\t\t\t\tif(input == JOptionPane.CANCEL_OPTION){\n//\t\t\t\t\tSystem.exit(1);\n//\t\t\t\t}\n\t\t\t\tif(strPlay!=null){\n\t\t\t\t\tselectedPlayers = Integer.parseInt(strPlay);\n\t\t\t\t\t\n\t\t\t\t\tif(selectedPlayers < 2||selectedPlayers > 10){\n\t\t\t\t\t\tselectedPlayers = 2;\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"The game\"\n\t\t\t\t\t\t\t+\" has defaulted to 2 players.\"\n\t\t\t\t\t\t\t+\" Because you input a number that \"\n\t\t\t\t\t\t\t+\"was out of bounds.\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}catch(NumberFormatException exception){\n\t\t\t\tJOptionPane.showMessageDialog(null,\"You input \"\n\t\t\t\t\t+ \"something that was not a number.\"\n\t\t\t\t\t+ \" The game has defaulted to 2 players.\");\n\t\t\t\tselectedPlayers = 2;\n\t\t\t}\n\t\t\t\n\t\t\tString goFirst = JOptionPane.showInputDialog(null, \"Pick\"\n\t\t\t+ \" who will go first.\");\n\t\t\t\n\t\t\ttry{\n\t\t\t\tif(goFirst==null){\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"The game\"\n\t\t\t\t\t+\" has defaulted to Player 1s turn.\");\n\t\t\t\t\tthis.firstTurn = 0;\n\t\t\t\t}\n\t\t\t\tif(goFirst!=null){\n\t\t\t\t\t this.firstTurn = Integer.parseInt(goFirst);\n\t\t\t\t}\n\t\t\t}catch(NumberFormatException exception){\n\t\t\t\tJOptionPane.showMessageDialog(null, \"You input \"\n\t\t\t\t+ \"something other than a number.\"\n\t\t\t\t+ \" The Game has defaulted to player 1s turn.\");\n\t\t\t\tthis.firstTurn = 0;\n\t\t\t}finally{\n\t\t\t\tJOptionPane.showMessageDialog(null, \"The game\"\n\t\t\t\t\t+\" will now begin.\");\n\t\t\t}\n\t\t\t\n\t\t}", "private void startGame()\n {\n if (heroPlayer != null && antagonistPlayer != null && location != null && currentPlayerName != \"null\")\n {\n gameStarted = true;\n }\n }", "@Override\n\tpublic void startGame(){\n\t\tsuper.currentPlayer = 1;\n\t}", "public int startGame() {\n\t\tint counter = 0;\n\t\twhile (true) {\n\t\t\t\n\t\t\tPlayer current = (counter % 2 == 0) ? getPlayer1() : getPlayer2();\n\t\t\tint column = current.play(getGameBoard());\n\t\t\t\n\t\t\t// Check input validity:\n\t\t\t\n\t\t\tif(column < 0) {\n\t\t\t\tSystem.out.println(current.getName()+\" tries to play a negative column number -> disqualification.\");\n\t\t\t\treturn (current == player1)? 2 : 1;\n\t\t\t}\n\t\t\t\n\t \tif(isColumnFull(column, current)) {\n\t \t\tSystem.out.println(current.getName()+\" tries to play an already full column -> disqualification.\");\n\t \t\treturn (current == player1)? 2 : 1;\n\t \t}\n\t\t\t\n\t\t\tplayColumn(column, current);\n\t\t\tcounter++;\n\t\t\t\n\t\t\tif (isGameDrawn()) {\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\t// For Player 1:\n\t\t\tif (hasWon(getPlayer1())) {\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\t// For Player 2:\n\t\t\tif (hasWon(getPlayer2())) {\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t\t\n\t\t\t// continue ...\n\t\t}\n\t}", "private void startMultiPlayerGame() {\n Intent intent = Games.RealTimeMultiplayer.getSelectOpponentsIntent(getApiClient(), 1, 1);\n startActivityForResult(intent, RC_SELECT_PLAYERS);\n }", "public static void setup(){\n\t\tfor(int i=0;i<9;i++){\r\n\t\t\tTicTac.place[i]='_';\r\n\t\t}\r\n\t\tdrawBoard();\r\n\t\twhile((TicTac.team != 'X') && (TicTac.team != 'O')){\r\n\t\t\tSystem.out.println(\"\\n\\nselect your team enter X or O below\");\r\n\t\t\tSystem.out.print(\"Enter your selection:\");\r\n\t\t\tScanner input=new Scanner(System.in);\r\n\t\t\tTicTac.usrStr=input.next();\r\n\t\t\tif(TicTac.usrStr.toUpperCase().equals(\"X\")){\r\n\t\t\t\tTicTac.team='X';\r\n\t\t\t\tTicTac.opp='O';\r\n\t\t\t}\r\n\t\t\telse if(TicTac.usrStr.toUpperCase().equals(\"O\")){\r\n\t\t\t\tTicTac.team='O';\r\n\t\t\t\tTicTac.opp='X';\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tSystem.out.println(\"You entered :\"+usrStr);{\r\n\t\t\t\t\tSystem.out.println(\"this is not a valid optiuon plase enter either X or O to continue\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tSystem.out.println(\"you are team\"+TicTac.team);\r\n\t\tgame();\r\n\t}", "static void startMatch()\n {\n // suggests that we should first use the pokedex menu\n if (Player.current.pokedex.isEmpty())\n {\n System.out.println(\"\\nYou have no pokemon to enter the match with kid. Use your pokedex and get some pokemon first.\");\n pause();\n return;\n }\n\n // print stuff\n clrscr();\n System.out.println(title());\n\n // print more stuff\n System.out.println(Player.opponent.name.toUpperCase() + \" IS PREPARING HIS POKEMON FOR BATTLE!\");\n \n // initialises the opponent logic - pokemon often enter evolved states\n Pokemon two = Opponent.init();\n\n System.out.println(\"\\n\"\n + Player.opponent.name.toUpperCase() + \" HAS CHOSEN \" + two +\"\\n\"\n + Player.current.name.toUpperCase() + \"! CHOOSE A POKEMON!!\");\n\n // displays the list of pokemon available for battle\n Player.current.showNamesPokedex();\n System.out.print(\"Gimme an index (Or type anything else to return)! \");\n int option = input.hasNextInt()? input.nextInt() - 1 : Player.current.pokedex.size();\n\n // sends back to mainMenu if option is out of bounds \n if (option >= Player.current.pokedex.size() || option < 0)\n {\n mainMenu();\n }\n\n // definitions, aliases for the two combatting pokemon\n Pokemon one = Player.current.pokedex.get(option);\n Pokemon.Move oneMove1 = one.listMoves.get(0);\n Pokemon.Move oneMove2 = one.listMoves.get(1);\n\n // if there's a bit of confusion regarding why two pokemon have the same nickname ...\n if (one.nickname.equals(two.nickname))\n System.out.println(one.nickname.toUpperCase() + \" vs ... \" + two.nickname.toUpperCase() + \"?? Okey-dokey, LET'S RUMBLE!!\");\n else // ... handle it\n System.out.println(one.nickname.toUpperCase() + \" vs \" + two.nickname.toUpperCase() + \"!! LET'S RUMBLE!!\");\n\n pause();\n clrscr();\n\n // Battle start!\n Pokemon winner = new Pokemon();\n // never give up!\n // unless it's addiction to narcotics \n boolean giveUp = false;\n while (one.getHp() > 0 && two.getHp() > 0 && !giveUp)\n {\n // returns stats of the pokemon\n System.out.println(\"\\nBATTLE STATS\\n\" + one + \"\\n\" + two);\n\n // 30% chance dictates whether the pokemon recover in a battle, but naturally so\n if (random.nextInt(101) + 1 < 30 && one.getHp() < one.maxHp)\n ++one.hp;\n\n if (random.nextInt(101) + 1 < 30 && two.getHp() < two.maxHp)\n ++two.hp;\n\n // the in-game selection menu\n System.out.print(\"\\n\"\n + Player.current.name.toUpperCase() + \"! WHAT WILL YOU HAVE \" + one.getFullName().toUpperCase() + \" DO?\\n\"\n + \"(a) Attack\\n\"\n + (oneMove1.isUsable? \"(1) Use \" + oneMove1.name.toUpperCase() + \"\\n\" : \"\")\n + (oneMove2.isUsable? \"(2) Use \" + oneMove2.name.toUpperCase() + \"\\n\" : \"\")\n + \"(f) Flee\\n\"\n + \"Enter the index from the brackets (E.g. (a) -> 'A' key): \");\n\n char choice = input.hasNext(\"[aAfF12]\")? input.next().charAt(0) : 'a';\n\n // a switch to handle the options supplied\n switch (choice)\n {\n case 'a': case 'A': default:\n one.attack(two);\n break;\n\n case 'f': case 'F':\n winner = two;\n giveUp = true;\n break;\n\n case '1':\n one.attack(two, oneMove1.name);\n break;\n\n case '2':\n one.attack(two, oneMove2.name);\n break;\n }\n\n // Opponent's turn, always second\n pause();\n clrscr();\n\n System.out.println(\"\\nBATTLE STATS\\n\" + one + \"\\n\" + two);\n Opponent.fight(one);\n pause();\n clrscr();\n }\n\n // find out the winner from combat or withdrawal\n winner = giveUp? two : one.getHp() > 0? one : two;\n System.out.println(\"\\nWINNER: \" + winner.getFullName() + \" of \" + winner.owner.name + \"!\\n\");\n\n if (winner == one)\n {\n // register the victory\n Player.current.gems += 100;\n System.out.println(\"You got 100 gems as a reward!\\n\");\n ++Player.current.wins;\n }\n else\n {\n // register the defeat\n ++Player.current.losses;\n System.out.println(\"Tough luck. Do not be worried! There's always a next time!\\n\");\n }\n\n pause();\n }", "public void startGame(GameMode gameMode, PlayerType startPlayer) {\n\t\tif (gameMode.equals(GameMode.SINGLEPLAYER)) {\n\t\t\tplayer1 = new Player(PlayerType.HUMAN, BLACK);\n\t\t\tplayer2 = new Player(PlayerType.AI, WHITE);\n\t\t\tplayer2.ai.setReversi(this);\n\n\t\t\tplayer1.setTurn(true);\n\t\t\tplayer1.setName(\"You\"); // Default name for single player\n\t\t} else { // The start player must be black\n\t\t\tif (startPlayer.equals(PlayerType.SERVER)) {\n\t\t\t\tplayer1 = new Player(PlayerType.AI, WHITE);\n\t\t\t\tplayer2 = new Player(PlayerType.SERVER, BLACK); // Start player\n\n\t\t\t\tplayer2.setTurn(true);\n\t\t\t} else {\n\t\t\t\tplayer1 = new Player(PlayerType.AI, BLACK); // Start player\n\t\t\t\tplayer2 = new Player(PlayerType.SERVER, WHITE);\n\n\t\t\t\tplayer1.setTurn(true);\n\t\t\t}\n\n\t\t\tplayer1.ai.setReversi(this);\n\t\t}\n\n\t\t// Set the scores\n\t\tplayer1.setScore(2);\n\t\tplayer2.setScore(2);\n\t}", "public void startSession() {\n\t\tSystem.out.println(\"Creating Board\");\n\t\tthis.board = new Board(schoolClass.getTeams(), schoolClass.getClassDeck());\n\t\tSystem.out.println(\"Setting Team Positions.\");\n\t\tinitializeTeamPositions();\n\t\tSystem.out.println(\"Clearing Up To Date Status.\");\n\t\tupToDateIds = new ArrayList<Integer>();\n\t\tteamChallengeOrder = new ArrayList<Integer>();\n\t\tchallengeChains = new HashMap<Integer, Chain>();\n\t\tchallengeSubmissionStatus = new HashMap<Integer, Boolean>();\n\t\tthis.setSessionState(SessionState.PlayerTurn);\n\t}", "public void play() {\r\n\r\n gamestate.startGame();\r\n\r\n while (!quit) {\r\n\r\n if (newGame) {\r\n gamestate.startGame();\r\n turn = 0;\r\n finished = true;\r\n newGame = false;\r\n }\r\n\r\n while (!gamestate.gameOver()) {\r\n\r\n if (newGame) {\r\n break;\r\n }\r\n\r\n turn++;\r\n display.displayBoard();\r\n\r\n if (turn % 2 == 1) {\r\n player1.makeMove(gamestate);\r\n } else {\r\n player2.makeMove(gamestate);\r\n }\r\n\r\n }\r\n\r\n if (finished) {\r\n\r\n display.displayBoard();\r\n\r\n switch (gamestate.getWinner()) {\r\n case Connect4GameState.RED:\r\n System.out.println(\"R wins\");\r\n break;\r\n case Connect4GameState.YELLOW:\r\n System.out.println(\"Y wins\");\r\n break;\r\n default:\r\n System.out.println(\"No one wins\");\r\n }\r\n\r\n finished = false;\r\n\r\n }\r\n\r\n if (display instanceof Connect4ConsoleDisplay) {\r\n quit = true;\r\n }\r\n\r\n }\r\n\r\n }", "void initializeGame() {\n // Initialize players\n // Put the pieces on the board\n }", "public void start(){\r\n\t\tcantStop.getGameBoard().startNewTurn();\r\n\t\tallowNewRoll();\r\n\t}", "public void startNewGame() {\n numOfTurnsLeft = NUMBER_OF_TURNS_ALLOWED;\n decodingBoard.clearBoard();\n }", "void startGame();", "void startGame();", "void startGame();", "public void startGame() {\r\n\t\t\r\n\t\tmultiplayerPanel.setVisible(false);\r\n\t\tif(waitingPanel != null) waitingPanel.setVisible(false);\r\n\t\tmultiplayerPanel.removeAll();\r\n\t\t\r\n\t\tgameSetupMultiplayer();\r\n\t\t\r\n\t\t\r\n\t}", "public void start(){\n getBoard();\n prepareBoard();\n renderBoard();\n }", "public void startGame() {\n\t\ttank1.create(20, 530, 0, 0);\n\t\ttank1.setDefaults();\n\t\ttank2.create(960, 530, 0, 0);\n\t\ttank2.setDefaults();\n\t\tobjects.add(tank1);\n\t\tobjects.add(tank2);\n\t\tground = new Groundmod2((int) (Math.random() * 4));\n\t\tturn = Turn.PLAYER1;\n\t\tgrabFocus();\n\t}", "private void startNewGame(){\n if (selectedPiece!=null)\n selectedPiece.setBackground(getDefaultColor(selectedPiece));\n selectedPiece = null;\n setAllToDefaultColor();\n setDefulatMessage();\n board = new ChessBoard(1, false);\n for(int row = 0 ; row < ROWS; row++){\n for(int col = 0; col < COLS ; col++){\n setButtonIcon(row,col);\n }\n }\n }", "public void start() {\n ArrayList<String> names = new ArrayList<>();\n game.initialize(names);\n //game.play(this.mainPkmn, this.attack);\n\n }", "public void initGame() {\n board.init(); // clear the board contents\n currentPlayer = Seed.CROSS; // CROSS plays first\n currentState = GameState.PLAYING; // ready to play\n }", "public void playTheGame() {\n\t\tint column;\n\t\ttry {\n\t\t\tboolean gameIsOver = false;\n\t\t\tfor (int count = 0; count < thePlayers.length; count++)\n\t\t\t\tthePlayers[count].getView().showOutput(\n\t\t\t\t\t\taConnect4Field.toString());\n\n\t\t\tdo {\n\t\t\t\tfor (int index = 0; index < thePlayers.length; index++) {\n\t\t\t\t\t// thePlayers[index].getView().showOutput(aConnect4Field.toString());\n\t\t\t\t\tif (aConnect4Field.isItaDraw()) {\n\t\t\t\t\t\tfor (int count = 0; count < thePlayers.length; count++)\n\t\t\t\t\t\t\tthePlayers[count].getView().showOutput(\"Draw\");\n\t\t\t\t\t\tgameIsOver = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthePlayers[index].getView().showOutput(\n\t\t\t\t\t\t\t\tthePlayers[index].getName()\n\t\t\t\t\t\t\t\t\t\t+ \" it's Your Turn! play your move\");\n\t\t\t\t\t\tcolumn = thePlayers[index].nextMove();\n\t\t\t\t\t\twhile (!aConnect4Field\n\t\t\t\t\t\t\t\t.checkIfPiecedCanBeDroppedIn(column)) {\n\t\t\t\t\t\t\tthePlayers[index].getView().showOutput(\n\t\t\t\t\t\t\t\t\t\"Invalid Turn Try again\");\n\t\t\t\t\t\t\tcolumn = thePlayers[index].nextMove();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\taConnect4Field.dropPieces(column,\n\t\t\t\t\t\t\t\tthePlayers[index].getGamePiece());\n\t\t\t\t\t\tfor (int count = 0; count < thePlayers.length; count++)\n\t\t\t\t\t\t\tthePlayers[count].getView().showOutput(\n\t\t\t\t\t\t\t\t\taConnect4Field.toString());\n\t\t\t\t\t\tif (aConnect4Field.error != \"\") {\n\n\t\t\t\t\t\t\tthePlayers[index].getView().showOutput(\n\t\t\t\t\t\t\t\t\taConnect4Field.error);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (aConnect4Field.didLastMoveWin()) {\n\t\t\t\t\t\t\t\tgameIsOver = true;\n\t\t\t\t\t\t\t\t// all player get to know\n\t\t\t\t\t\t\t\tfor (int count = 0; count < thePlayers.length; count++)\n\t\t\t\t\t\t\t\t\tthePlayers[count].getView().showOutput(\n\t\t\t\t\t\t\t\t\t\t\t\"The winner is: \"\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ thePlayers[index]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getName());\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} while (!gameIsOver);\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t}", "void askStartGame();", "public Game startGame(Game game);", "public void setUpGame() {\n\t\tGameID = sql.getTheCurrentGameID() + 1;\r\n\t\tSystem.err.println(GameID);\r\n\t\ttheModel.shuffleDeck();\r\n\t\ttheModel.createPlayers();\r\n\t\ttheModel.displayTopCard();\r\n\t\t// theModel.chooseFirstActivePlayer();\r\n\t}", "private void setPlayer()\t{\n\t\tgrid.setGameObject(spy, Spy.INITIAL_X, Spy.INITIAL_Y);\n\t}", "public void startGame() {\n bsg = new BattleshipGame();\n bsg.initBoard();\n bsg.printEnemy();\n\n while (true) {\n // Prompt for coordinate\n Scanner in = new Scanner(System.in);\n System.out.print(\"Select row: \");\n int j = in.nextInt();\n in.nextLine();\n System.out.print(\"Select column: \");\n int i = in.nextInt();\n in.nextLine();\n\n // Commence attack!\n int result = fire(i, j);\n if (result != BattleshipGame.RESULT_ILLEGAL) {\n bsg.setResultOfAttack(result, i, j);\n }\n bsg.printEnemy();\n\n printResult(result);\n\n int status = getGameStatus();\n\n if (status == BattleshipGame.GAME_CONTINUE) {\n String message = \"'M' indicates \\\"miss.\\\" 'H' indicates \\\"hit.\\\"\";\n message += \"Enter your Move (enter negative number to quit).\";\n System.out.println(message);\n }\n else {\n String message;\n switch (status) {\n case BattleshipGame.GAME_WIN_CLIENT:\n message = \"Congratulations, you win!\";\n break;\n case BattleshipGame.GAME_WIN_SERVER:\n message = \"You lose :(\";\n break;\n default:\n message = \"Exiting game.\";\n break;\n }\n System.out.println(message);\n return;\n }\n }\n }", "public void His_Turn(String opponent_coord){\r\n\r\n\t\t/*\r\n\t\t * will get xcoor and ycoor\r\n\t\t * NOTE: We don't need to validate, it should be already validate\r\n\t\t * we only need this function to parse the xcoor and ycoor\r\n\t\t */\r\n\t\tValidate_Input(opponent_coord);\r\n\t\t\r\n\t\t/*\r\n\t\t * update hit_history\r\n\t\t */\r\n\t\tmyBoard.hit_history[xcoor][ycoor]=1; \r\n\r\n\t\tboolean hit=false;\r\n\t\t\r\n\t\tdisplay.putStaticLine(\"\");\r\n\t\tif(myBoard.hit_or_miss(xcoor, ycoor)){\r\n\t\t\tSound.playSound(\"res/explosion.wav\");\r\n\t\t\thit=true;\r\n\t\t}\r\n\t\telse{\r\n\t\t\tSound.playSound(\"res/Missile_Incoming_FlyBy.wav\");\r\n\t\t}\r\n\r\n\t\t\r\n\t\t// Check if a ship was sunk and update the board accordingly\r\n\t\tString sunk=myBoard.check_sunk();\r\n\t\tif(sunk!=\"nothing\"){\r\n\t\t\tSound.playSound(\"res/bubbles.wav\");\r\n\t\t\tif(myBoard.check_all_sunk()){\r\n\t\t\t\topponent_victory=true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\t// Handle all the output/display after all the calculation...\r\n\t\tdisplay.clearScreen();\r\n\t\tthis.Display_Boards();\r\n\t\tdisplay.putStaticLine(\"\");\r\n\t\tif(hit)\r\n\t\t\tdisplay.putStaticLine(\"Opponent attacked \" + opponent_coord+\"... \" + \"Hit!\");\r\n\t\telse\r\n\t\t\tdisplay.putStaticLine(\"Opponent attacked \" + opponent_coord+\"... \" + \"Miss\");\r\n\t\tif(sunk!=\"nothing\"){\r\n\t\t\tdisplay.putStaticLine(\"\");\r\n\t\t\tdisplay.putStaticLine(\"He sunk your \" + sunk); \r\n\t\t}\r\n\t\tif(opponent_victory){\r\n\t\t\tdisplay.putStaticLine(\"\");\r\n\t\t\tdisplay.putStaticLine(\"You LOSE!!!!!!\");\r\n\t\t}\r\n\t\t\r\n\t\tdisplay.putStaticLine(\"\");\r\n\t\tdisplay.putStaticLine(\"Press Enter to continue with you turn...\");\r\n\t\tdisplay.printScreen();\r\n\t\tdisplay.printPrompt(\"user> \");\r\n\t\t\r\n\t\thit=false;\r\n\t\tturn_change=true;\r\n\t\t// now it's my turn again\r\n\t\tthis.isTurn=true;\r\n\t}", "public void startGame() {\n message.openingWarVariation(gameVariation, iterations);\n setHands(player1, player2, player3, deck);\n while (versus(player1, player2, player3)) {\n }\n determineOutcome(gameVariation);\n }", "private void startTurn() {\n \n handsOfCards.clear();\n shuffleAndGiveCards();\n \n Color trump= Color.ALL.get(trumpRng.nextInt(Color.COUNT));\n findFirstPlayer();\n\n for (Map.Entry<PlayerId, Player> pId: players.entrySet()) {\n pId.getValue().setTrump(trump);\n }\n \n if(isFirstTurn) {\n state = TurnState.initial(trump, Score.INITIAL, firstPlayer);\n }\n else {\n state = TurnState.initial(trump, state.score().nextTurn(), firstPlayer);\n }\n }", "@FXML\n public void btnStartGame(Event e)\n {\n\n LobbyPlayer lobbyPlayer = PlayerSingleton.getPlayer().getLobbyPlayer();\n try {\n List<LobbyPlayer> lobbyPlayerList = LobbyServerConnection.getInstance().getPlayerList(lobbyPlayer);\n\n List<Player> pl = new ArrayList<>();\n\n for (LobbyPlayer lp :lobbyPlayerList) {\n Player p = new Player(lp.getUniqueId(), lp.getName());\n pl.add(p);\n }\n\n //game gets starter on server\n GameServerConnection.getInstance().startGame(pl);\n sleep();\n //tartGamevanuit lobby\n LobbyServerConnection.getInstance().startGame(lobbyPlayer);\n\n } catch (RemoteException e1) {\n log.warning(e1.toString());\n log.warning(\"couldn't create a game\");\n }\n }", "void start () {\n System.out.println(\"Starting the game\");\n score = 0;\n updateScore();\n stepDelay = startingSpeed;\n isFalling = false;\n gameOver = false;\n board.clear();\n board.clearTemp();\n setNormalSpeed();\n spawnNewPiece();\n updateView();\n resetLoop();\n }", "void start() {\n myGameOver = false;\n myDisplay.setCurrent(this);\n repaint();\n }", "public void play() {\r\n _board = new Board();\r\n _command = new LoaGUI(\"Lines of Action\", this);\r\n\r\n while (true) {\r\n int playerInd = _board.turn().ordinal();\r\n if (_playing) {\r\n if (_board.gameOver()) {\r\n announceWinner();\r\n _playing = false;\r\n continue;\r\n }\r\n Move next = _players[playerInd].makeMove();\r\n System.out.println(\"The move is get\");\r\n if (next != null) {\r\n assert _board.isLegal(next);\r\n _board.makeMove(next);\r\n _command.repaint();\r\n System.out.println(\"Repaint\");\r\n if (_board.gameOver()) {\r\n announceWinner();\r\n _playing = false;\r\n }\r\n }\r\n } else {\r\n try {\r\n Thread.sleep(magic2);\r\n } catch (InterruptedException ex) {\r\n return;\r\n }\r\n }\r\n }\r\n }", "public static void initial()\n\t{\n\t\tscoreteam1 = 0; scoreteam2 = 0;\n\t\tdelayed = 0;\n\t\tplayers = new Player[5];\n\t\tfor (int i = 0; i < 5; i++) \n\t\t{\n\t\t\tplayers[i] = new Player();\n\t\t}\n\n\t\t// finding how many players there are (2, 3, or 4) and initializing status\n\t\tplayerNum = 0;\n\t\tfor (int i = 0; i < 5; i++)\n\t\t{\n\t\t\tif (Selection.exist[i])\n\t\t\t{\n\t\t\t\tplayerNum++;\n\t\t\t}\n\t\t\tplayers[i].exist = Selection.exist[i]; \n\t\t\tplayers[i].ai = Selection.ai[i];\n\t\t\tplayers[i].name = Selection.name[i];\t\t \n\t\t}\n\n\n\t\tplayers[3].keyDown = KeyEvent.VK_SEMICOLON;\n\t\tplayers[3].keyLeft = KeyEvent.VK_L;\n\t\tplayers[3].keyRight = KeyEvent.VK_QUOTE;\n\t\tplayers[3].keyUp = KeyEvent.VK_P;\n\t\tplayers[2].keyDown = KeyEvent.VK_H;\n\t\tplayers[2].keyLeft = KeyEvent.VK_G;\n\t\tplayers[2].keyRight = KeyEvent.VK_J;\n\t\tplayers[2].keyUp = KeyEvent.VK_Y;\n\t\tplayers[1].keyDown = KeyEvent.VK_S;\n\t\tplayers[1].keyLeft = KeyEvent.VK_A;\n\t\tplayers[1].keyRight = KeyEvent.VK_D;\n\t\tplayers[1].keyUp = KeyEvent.VK_W;\n\t\tplayers[4].keyDown = KeyEvent.VK_DOWN;\n\t\tplayers[4].keyLeft = KeyEvent.VK_LEFT;\n\t\tplayers[4].keyRight = KeyEvent.VK_RIGHT;\n\t\tplayers[4].keyUp = KeyEvent.VK_UP;\n\t\tplayers[1].color = Color.red;\n\t\tplayers[3].color = Color.green;\n\n\t\tif (Selection.team)\n\t\t{\n\t\t\tplayers[2].color = Color.red;\n\t\t\tplayers[4].color = Color.green;\n\t\t} \n\t\telse\n\t\t{\n\t\t\tplayers[2].color = Color.blue;\n\t\t\tplayers[4].color = Color.yellow;\n\t\t}\n\n\t}", "private void myTurn()\n\t{\n\t\t\n\t\tif (canPlay())\n\t\t{\n\t\t\tif (isTop())\n\t\t\t{\n\t\t\t\traise();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tequal();\n\t\t\t}\n\t\t}\n\t\ttable.nextPlayer();\n\t\t\n\t}", "public void startGameSession() {\n\t\tfor (GamePlayer player : listOfPlayers) {\n\t\t\tif (player != null) {\n\t\t\t\t// set to first lap\n\t\t\t\tplayer.currentLap = 1;\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void startGame() {\n //create new board instance\n board = new int[NUM_ROWS][NUM_COLS];\n //set all elements to EMPTY\n for (int c = 0; c < NUM_COLS; c++) {\n for (int r = 0; r < NUM_ROWS; r++) {\n board[r][c] = EMPTY;\n }\n }\n //set the turn to red\n turn = RED;\n }", "public void play() {\n HashSet<Board> positionsPlayed = new HashSet<Board>();\n _board = new Board();\n\n while (true) {\n int playerInd = _board.turn().ordinal();\n Move next;\n if (_playing) {\n if (_board.gameOver()) {\n announceWinner();\n _playing = false;\n continue;\n }\n if (_hasGUI) {\n if (_players[playerInd].type().equals(\"human\")) {\n if (_ready) {\n next = _nextMove;\n } else if (_readyCommand) {\n processCommand(_nextCommand);\n next = null;\n } else {\n continue;\n }\n } else {\n next = _players[playerInd].makeMove();\n }\n } else {\n next = _players[playerInd].makeMove();\n }\n assert !_playing || next != null;\n } else {\n if (_hasGUI) {\n System.out.print(\"\");\n if (_readyCommand) {\n processString(_nextCommand);\n }\n } else {\n getMove();\n }\n next = null;\n }\n if (next != null) {\n assert _board.isLegal(next);\n _board.makeMove(next);\n if (_players[playerInd].type().equals(\"machine\") && !_hasGUI) {\n System.out.println(_players[playerInd].side().abbrev().toUpperCase() + \"::\" + next.toString());\n if (_autoprint) {\n System.out.println(_board.toString2());\n }\n }\n if (_board.gameOver()) {\n announceWinner();\n _playing = false;\n }\n }\n _ready = false;\n }\n }", "private void startNewGame( ){\n\n mGame.clearBoard();\n mGameOver = false;\n\n // Reset all buttons\n for (int i = 0; i < mBoardButtons.length; i++) {\n mBoardButtons[i].setText(\"\");\n mBoardButtons[i].setEnabled(true);\n mBoardButtons[i].setOnClickListener(new ButtonClickListener(i));\n }\n // Human goes first\n mDiffTextView.setText(mGame.dificult);\n mInfoTextView.setText(\"You go first.\");\n\n }", "public void playGame()\r\n\t{\r\n\t\tSystem.out.println(\"Welcome to BlackJack! \\n\");\r\n\t\t\r\n\t\t// Boolean value to tell evaluateWin() method when the final win evaluation must be made\r\n\t\tboolean finalCheck = false;\r\n\t\t\r\n\t\tcardDeck.getDeck();\r\n\t\t\r\n\t\tSystem.out.println(\"Dealing cards...\");\r\n\t\t\r\n\t\t// Each player gets 2 cards to start\r\n\t\tplayer1.hit( cardDeck.draw() );\r\n\t\tplayer1.hit( cardDeck.draw() );\r\n\t\tdealer.hit( cardDeck.draw() );\r\n\t\tdealer.hit( cardDeck.draw() );\r\n\t\t\r\n\t\t// displays current cards\r\n\t\tdisplayPlayerCards(PLAYER1_ID);\r\n\t\tdisplayPlayerCards(DEALER_ID);\r\n\t\t\r\n\t\t// checks for win\r\n\t\tevaluateWin(finalCheck);\r\n\t\t\r\n\t\t// begins player1 turns\r\n\t\tplayerTurns();\r\n\t\t\r\n\t\t// begins dealer turns\r\n\t\tdealerTurns();\r\n\t\t\r\n\t\t// instructs evaluateWin to make final victory check\r\n\t\tfinalCheck = true;\r\n\t\tevaluateWin(finalCheck);\r\n\t\t\r\n\t\t// Cleans up objects\r\n\t\tcardDeck.newDeck();\r\n\t\tplayer1.resetHand();\r\n\t\tdealer.resetHand();\r\n\t}", "public void startGame()\n {\n while (true)\n {\n WebElement start = driver.findElement(By.cssSelector(\"#index > div.btns > button\"));\n if (start.isDisplayed())\n {\n start.click();\n return;\n }\n }\n }", "public TicTacToe() {\n\t\tinitialiazeBoard();\n\t\tthis.currentPlayer = Player.X;\n\t\tthis.winner = null;\n\t}", "public Othello() {\n\t\tmyBoard = new Board(8);\n\t\tplayerBlack = spawnPlayer(Color.BLACK);\n\t\tplayerWhite = spawnPlayer(Color.WHITE);\n\t\tpropertySupport = new PropertyChangeSupport(this);\n\t\tinitialisationBoard();\n\t\tcurrentPlayer = playerBlack;\n\t\tfoeHasPlay = true;\n\t\taiPlay = false;\n\t}", "public static void main(String[] args){\n //welcome message\n System.out.println(\" ☺ Welcome to Nora's Tic-Tac-Toe program! ☺ \");\n System.out.println(\" \");\n System.out.println(\"In this game, the player who succeeds in placing three of their marks in a horizontal, vertical, or diagonal row is the winner.\");\n System.out.println(\"You and your friends will enter numbers(1-9) as shown below, which refers to each empty sqaure.\");\n printGameBoard(gameBoard1to9);\n System.out.println(\" \");\n System.out.println(\"KEEP IN MIND:\");\n System.out.println(\"✰ Player 0 always owns mark 'O'\");\n System.out.println(\"✰ Player 1 always owns mark 'X'\");\n System.out.println(\"✰ If you want to continue playing, please don't switch players.\");\n System.out.println(\"\");\n System.out.println(\"Now, enjoy your game!\");\n System.out.println(\"\");\n System.out.println(\"━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\");\n System.out.println(\"\");\n \n activateGame(gameBoard);\n while(playAgain){ //re-activate the game as long as the userwants to play it agian.\n playAgain = false;\n activateGame(gameBoard);\n }\n System.out.println(\"\");\n \n //Game Summary\n System.out.println(\"------------------------------------------------------------------\");\n System.out.println(\"Check out your GAME RECORD!\");\n System.out.println(\"\");\n System.out.println(\"✱ Your guys has played for \"+countRound+\" round(s).\" );\n System.out.println(\"✱ Player 0 wins for \"+player0win+ \" round(s).\");\n System.out.println(\"✱ Player 1 wins for \"+player1win+ \" round(s).\");\n System.out.println(\"\");\n if (player0win > player1win){\n System.out.println(\"❀❀❀ Congratulations to our ultimate winner: player 0! ❀❀❀\");\n }else if (player1win > player0win){\n System.out.println(\"❀❀❀ Congratulations to our ultimate winner: player 1! ❀❀❀\");\n }else{\n System.out.println(\"Good news! You're all winners! ( • ̀ω•́ )✧\");\n }\n System.out.println(\"\");\n System.out.println(\"\");\n System.out.println(\"\");\n \n }", "public void start(){\n int numberOfPlayers = Integer.parseInt(JOptionPane.showInputDialog(\"How many players\"));\n player1 = new Player(JOptionPane.showInputDialog(\"What is your name?\"));\n if(numberOfPlayers == 1){\n player2 = new Player(\"Computer\");\n }\n else if(numberOfPlayers == 2){\n player2 = new Player(JOptionPane.showInputDialog(\"What is the second player name?\"));\n }\n\n }", "public static void StartGame(ArrayList<String> names) {\n for (String name : names) {\n Player player = new Player();\n player.Name = name;\n player.Color = new Color(0,0,0);\n players.add(player);\n }\n generateColor();\n // Read XML\n readXML();\n GameRunning = true;\n trackDices=false;\n dicesEqual=0;\n gameboard=new GameBoard();\n gameboard.initGame();\n }", "public abstract void openScoreboard(Scoreboard scoreboard, Player player);" ]
[ "0.70541966", "0.67065257", "0.6638259", "0.65983635", "0.652165", "0.6449101", "0.6445977", "0.6431626", "0.64254844", "0.6399133", "0.6393179", "0.63634974", "0.6362612", "0.63342184", "0.6329425", "0.63146263", "0.62718207", "0.6252586", "0.6250689", "0.6199203", "0.6196742", "0.61952686", "0.6187131", "0.6173665", "0.6170715", "0.61669385", "0.616258", "0.6148882", "0.61367273", "0.6131422", "0.6123403", "0.6122375", "0.6118525", "0.611567", "0.6113153", "0.6112812", "0.61089295", "0.6088132", "0.60849553", "0.6077978", "0.6054457", "0.605412", "0.6042694", "0.6037193", "0.6032584", "0.60266244", "0.6018167", "0.6012128", "0.59950644", "0.5992904", "0.5990289", "0.59801006", "0.5962333", "0.5960101", "0.59585017", "0.59576875", "0.5950301", "0.594945", "0.59416527", "0.5933049", "0.59282964", "0.5924049", "0.59206545", "0.5902268", "0.58941704", "0.58941704", "0.58941704", "0.58886874", "0.58880854", "0.587961", "0.58794415", "0.5872119", "0.5869686", "0.5869261", "0.5868764", "0.58665454", "0.58642006", "0.5856144", "0.5855941", "0.58557177", "0.5855124", "0.5854301", "0.584775", "0.58370763", "0.583602", "0.5832302", "0.5830781", "0.58254015", "0.5819849", "0.58128464", "0.580294", "0.58024675", "0.57986873", "0.5797911", "0.57967854", "0.5785895", "0.57753474", "0.5767268", "0.5766659", "0.57662725" ]
0.6559888
4
/ sets this.board to the board passed
public void setBoard(Board board) { this.board = board; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setBoard(Board board){this.board = board;}", "@Override\r\n\tpublic void setBoard(Board board) {\n\t\t\r\n\t}", "public void setBoard(Board board) {\n this.board = board;\n }", "public void setBoard(Board board) {\n this.board = board;\n }", "void setBoard(Board board);", "public void changeBoard(Board board){\n this.board = board;\n }", "public void setBoard(GUIBoard board) {\n this.board = board;\n }", "public void setBoard(int[][] board) {\n this.board = board;\n }", "public void setBoard(Board theBoard) {\n\t\tthis.board = theBoard;\n\t}", "public void setBoard(final Board the_board)\n {\n my_board = the_board;\n my_board.addObserver(this);\n }", "public void setBoard(Board theBoard) {\n\t\tthis.board = theBoard;\n\n\t}", "public void setBoard() {\n bestPieceToMove = null;\n bestPieceFound = false;\n bestMoveDirectionX = 0;\n bestMoveDirectionY = 0;\n bestMoveFound = false;\n killAvailable = false;\n lightCounter = 12;\n darkCounter = 12;\n for (int y = 0; y < boardSize; y++) {\n for (int x = 0; x < boardSize; x++) {\n board[y][x] = new Field(x, y);\n if (y < 3 && board[y][x].getPlaceable()) {\n board[y][x].setPiece(new Piece(PieceColor.DARK, PieceType.MEN));\n } else if (y > 4 && board[y][x].getPlaceable()) {\n board[y][x].setPiece(new Piece(PieceColor.LIGHT, PieceType.MEN));\n }\n }\n }\n }", "public static void setBoard(char[][] board) {\n\t\tBoard.board = board;\n\t}", "public void setBoard(BoardSpace[][] newBoard){\n boardSpaces = newBoard;\n maxScore = 0;\n }", "public void setBoard(GameToken[][] board) {\n\t\tif (board == null) {\n\t\t\tthrow new NullPointerException();\n\t\t}\n\t\t\n\t\t// get length of row\n\t\tint size = board.length;\n\t\t// check length of all columns\n\t\tfor (int row = 0; row < size; row++) {\n\t\t\tif (board[row] == null) {\n\t\t\t\tthrow new NullPointerException();\n\t\t\t}\n\t\t\t// does the column length match the row length?\n\t\t\tif (board[row].length != size) {\n\t\t\t\tthrow new IndexOutOfBoundsException();\n\t\t\t}\n\t\t}\n\t\t// all checks passed\n\t\tthis.size = size;\n\t\tthis.board = board;\n\t}", "public void setBoardLocation(int boardLocation) {this.boardLocation = boardLocation;}", "Board(Board board) {\n copyFrom(board);\n }", "public void resetBoard() {\n piece = 1;\n b = new Board(9);\n board = b.getBoard();\n\n board2d = new int[3][3];\n makeBoard2d();\n\n }", "public void setBoard() {\n for (int i = 0; i < 10 ; i++) {\n board[i] = coordinator.holes[i].getNumberOfMarbleBalls();\n }\n }", "public void setBoard(int row, int col, int value) {\n this.board[row][col] = value;\n }", "public void setBoardWithColor(BoardCell cell) {\r\n\t\tif(cell==null) throw new NullPointerException();\r\n\t\tfor(int row=0;row<getMaxRows();row++){\r\n\t\t\tfor(int col=0;col<getMaxCols();col++){\r\n\t\t\t\tboardcell[row][col]=cell;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public void setBoard(){\n \n\t m_Pieces[3][3]= WHITE_PIECE;\n m_Pieces[4][4]= WHITE_PIECE;\n m_Pieces[3][4]= BLACK_PIECE;\n m_Pieces[4][3]= BLACK_PIECE;\n for(int x=0;x<WIDTH;x++){\n for(int y=0;y<HEIGHT;y++){\n if(m_Pieces[x][y]==null){\n m_Pieces[x][y]=NONE_PIECE;\n }\n }\n }\n }", "private void initializeBoard() {\n\t\t\n\t}", "public Board(Piece[] board) {\n this.board = copyOf(board);\n }", "public void setBoard(JSpotBoard board) {\r\n\t\tremove(_initial);\r\n\t\tremove(_board);\r\n\t\t_board = board;\r\n\t\tadd(_board, BorderLayout.CENTER);\r\n\t\t_board.removeSpotListener(this);\r\n\t\t_board.addSpotListener(this);\r\n\t\trevalidate();\r\n\t\trepaint();\r\n\t}", "public void updateBoard() {\n notifyBoardUpdate(board);\n }", "Board(Board b) {\n internalCopy(b);\n }", "public void setBoard(GameBoard newBoard) {\n board = newBoard;\n Dimension dim = new Dimension();\n \n if (board != null) {\n dim.width = cellDistance(board.getWidth());\n dim.height = cellDistance(board.getHeight());\n } else {\n dim.width = 400;\n dim.height = 400;\n }\n \n setMinimumSize(dim);\n setPreferredSize(dim);\n \n repaint();\n }", "Board() {\n\t\tswitch (Board.boardType) {\n\t\tcase Tiny:\n\t\t\tthis.dimensions = TinyBoard; break;\n\t\tcase Giant:\n\t\t\tthis.dimensions = GiantBoard; break;\n\t\tdefault:\n\t\t\tthis.dimensions = StandardBoard; break;\n\t\t}\n\t\tboard = new Square[dimensions.x][dimensions.y];\n\t\tinit();\n\t}", "@Override\r\n\tpublic void init() \r\n\t{\r\n\t\tthis.board = new GameBoard();\r\n\t}", "@Override\n\tpublic void init(Board board) {\n\t\tthis.board = board;\n\t\tthis.currentPlayer = board.currentPlayer.charAt(0);\n\t}", "void copyFrom(Board board) {\n if (board == this) {\n return;\n }\n _moves.clear();\n _moves.addAll(board._moves);\n _turn = board._turn;\n this.initialize(board.boardArr, board._turn);\n }", "public Gameboard() {\n\n\t\tturn = 0;\n\n\t\tboard = new Cell[4][4][4];\n\n\t\tfor (int i = 0; i < board.length; i++) {\n\t\t\tfor (int j = 0; j < board.length; j++) {\n\t\t\t\tfor (int k = 0; k < board.length; k++) {\n\n\t\t\t\t\tboard[i][j][k] = Cell.E;\n\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void boardSetUp(){\n\t}", "public Board() {\n this.board = new byte[][] { new byte[3], new byte[3], new byte[3] };\n }", "Board(Board model) {\r\n copy(model);\r\n }", "public void initializeBoard() {\n\t\tfor (int i = 0; i < 9; i++) {\n\t\t\tthis.board[i] = \"-\";\n\n\t\t}\n\n\t}", "public void initializeBoard() {\n\n\t\t/*\n\t\t * How the array coordinates align with the actual chess board\n\t\t * (row,col) \n\t\t * (7,0) ... ... ... \n\t\t * (7,7) ... ... ... \n\t\t * ... ... ... \n\t\t * (2,0) ...\n\t\t * (1,0) ... \n\t\t * (0,0) ... ... ... (0,7)\n\t\t */\n\n\t\tboolean hasMoved = false;\n\t\tboolean white = true;\n\t\tboolean black = false;\n\n\t\t// Set white piece row\n\t\tboard[0][0] = new Piece('r', white, hasMoved, 0, 0, PieceArray.A_rookId);\n\t\tboard[0][1] = new Piece('n', white, hasMoved, 0, 1, PieceArray.B_knightId);\n\t\tboard[0][2] = new Piece('b', white, hasMoved, 0, 2, PieceArray.C_bishopId);\n\t\tboard[0][3] = new Piece('q', white, hasMoved, 0, 3, PieceArray.D_queenId);\n\t\tboard[0][4] = new Piece('k', white, hasMoved, 0, 4, PieceArray.E_kingId);\n\t\tboard[0][5] = new Piece('b', white, hasMoved, 0, 5, PieceArray.F_bishopId);\n\t\tboard[0][6] = new Piece('n', white, hasMoved, 0, 6, PieceArray.G_knightId);\n\t\tboard[0][7] = new Piece('r', white, hasMoved, 0, 7, PieceArray.H_rookId);\n\n\t\t// Set white pawns\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tboard[1][i] = new Piece('p', white, hasMoved, 1, i, i + 8);\n\t\t}\n\n\t\t// Set empty rows\n\t\tfor (int row = 2; row < 6; row++)\n\t\t\tfor (int col = 0; col < 8; col++)\n\t\t\t\tboard[row][col] = null;\n\n\t\t// Set black pawns\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tboard[6][i] = new Piece('p', black, hasMoved, 6, i, i+8);\n\t\t}\n\n\t\t// Set black piece row\n\t\tboard[7][0] = new Piece('r', black, hasMoved, 7, 0, PieceArray.A_rookId);\n\t\tboard[7][1] = new Piece('n', black, hasMoved, 7, 1, PieceArray.B_knightId);\n\t\tboard[7][2] = new Piece('b', black, hasMoved, 7, 2, PieceArray.C_bishopId);\n\t\tboard[7][3] = new Piece('q', black, hasMoved, 7, 3, PieceArray.D_queenId);\n\t\tboard[7][4] = new Piece('k', black, hasMoved, 7, 4, PieceArray.E_kingId);\n\t\tboard[7][5] = new Piece('b', black, hasMoved, 7, 5, PieceArray.F_bishopId);\n\t\tboard[7][6] = new Piece('n', black, hasMoved, 7, 6, PieceArray.G_knightId);\n\t\tboard[7][7] = new Piece('r', black, hasMoved, 7, 7, PieceArray.H_rookId);\n\t}", "public ThreeStonesBoard(Tile[][] board) {\r\n this.board = board;\r\n }", "public void resetBoard(){\n totalmoves = 0;\n this.board = new Cell[3][3];\n //fill the board with \"-\"\n for (int i = 0; i < 3; i++) {\n for (int j = 0; j < 3; j++) {\n this.board[i][j]=new Cell(new Coordinates(i,j), \"-\");\n }\n }\n }", "Board() {\n this(INITIAL_PIECES, BLACK);\n _countBlack = 12;\n _countWhite = 12;\n _moveHistory = new ArrayList<Move>();\n _movesMade = 0;\n }", "private void board() {\r\n\t\tfor (int n = 0; n < ROW; n++) {\r\n\t\t\tfor (int m = 0; m < COL; m++) {\r\n\t\t\t\tboard[n][m] = 'X';\r\n\t\t\t}\r\n\t\t}\r\n\t\tturnRemaining = 42;\r\n\t}", "Board() {\r\n init();\r\n }", "public Board()\r\n\t{\r\n\t\treset();\r\n\t}", "Board() {\n this.cardFactory = new CardFactory(this);\n }", "public void newBoard(LiteBoard board) {\n }", "public void resetBoard() {\n //sets current board to a new board\n currentBoard = new Board(7, 6);\n\n //sets all text fields back to white\n for (int i = 0; i < currentBoard.getSizeX(); i++) {\n for (int v = 0; v < currentBoard.getSizeY(); v++) {\n squares[i][v].setBackground(Color.white);\n }\n }\n //sets turn to true (first player)\n turn = true;\n }", "public Board() {\n\t\tboard = new char[9][9];\n\t}", "public AIPlayer(Board board) {\n cells = board.squares;\n }", "public void run() {\n GameBoard board = new GameBoard(nrows, ncols);\n\n\n }", "Board() {\n clear();\n }", "Board() {\n clear();\n }", "public BoardSetup() {\n\t\tthis.theBoard = Board.getInstance();\n\t}", "public void Makeboard() {\r\n\r\n Normalboard(new Point2(20, 300));\r\n Normalboard(new Point2(224, 391));\r\n Stingboard(new Point2(156, 209));\r\n Leftlboard(new Point2(88, 482));\r\n Rightboard(new Point2(292, 573));\r\n Regenerateboard(new Point2(360, 118));\r\n\r\n }", "@Override\r\n\tpublic void resetBoard() {\r\n\t\tcontroller.resetGame(player);\r\n\t\tclearBoardView();\r\n\t\tif (ready)\r\n\t\t\tcontroller.playerIsNotReady();\r\n\t}", "public void setPiece(int x, int y, Piece piece) {\n \tboard[y][x] = piece;\n }", "public void set (Piece p, int x, int y){\n\t\t\t\t\n\t\tboard[x][y] = p;\n\t}", "public void setOpBoardMove(int row, int col, int oppiece)\n\t{\n\t\tboard[row][col] = oppiece;\n\t}", "TetrisBoard() {\n\t\t// create new board \n\t\tblockMatrix = new boolean[NUM_ROWS][NUM_COLS];\n\t\t\n\t\t// fill in values for board\n\t\tinitBoard();\n\t\t\n\t\t// add new piece to fall\n\t\taddNewPiece();\n\t\t\n\t\t// start scores at 0\n\t\tnumLines = 0;\n\t\tnumTetrises = 0;\n\t}", "public TicTacToeBoard() {board = new int[rows][columns];}", "public Board() {\n this.x = 0;\n this.o = 0;\n }", "public Board() {\n\t\tboard = new int[8][8];\n\t\tbombs = 64 / 3;\n\t\tdifficulty = GlobalModel.BESTSCORE_EASY;\n\t\tfillBoard();\n\t\tsetDefaultScores();\n\t}", "public void setModel(Board b) { model = b; repaint(); }", "private void getBoard() {\n gameBoard = BoardFactory.makeBoard();\n }", "public void setBeginningBoard() {\n clearBooleanBoard();\n\n figBoard[0][0] = new Rook(\"white\", 00, white[0]);\n figBoard[0][1] = new Knight(\"white\", 01, white[1]);\n figBoard[0][2] = new Bishop(\"white\", 02, white[2]);\n figBoard[0][4] = new King(\"white\", 04, white[3]);\n figBoard[0][3] = new Queen(\"white\", 03, white[4]);\n figBoard[0][5] = new Bishop(\"white\", 05, white[2]);\n figBoard[0][6] = new Knight(\"white\", 06, white[1]);\n figBoard[0][7] = new Rook(\"white\", 07, white[0]);\n\n for (int i = 0; i < gA.getBoard().length; i++) {\n booleanBoard[0][i] = true;\n gA.getBoard()[0][i].setRotation(180);\n }\n\n for (int i = 0; i < gA.getBoard().length; i++) {\n booleanBoard[1][i] = true;\n gA.getBoard()[1][i].setRotation(180);\n figBoard[1][i] = new Pawn(\"white\", 10 + i, white[8]);\n }\n\n figBoard[7][0] = new Rook(\"black\", 70, black[0]);\n figBoard[7][1] = new Knight(\"black\", 71, black[1]);\n figBoard[7][2] = new Bishop(\"black\", 72, black[2]);\n figBoard[7][4] = new King(\"black\", 74, black[3]);\n figBoard[7][3] = new Queen(\"black\", 73, black[4]);\n figBoard[7][5] = new Bishop(\"black\", 75, black[2]);\n figBoard[7][6] = new Knight(\"black\", 76, black[1]);\n figBoard[7][7] = new Rook(\"black\", 77, black[0]);\n\n for (int i = 0; i < gA.getBoard().length; i++) {\n booleanBoard[7][i] = true;\n gA.getBoard()[7][i].setRotation(0);\n }\n\n for (int i = 0; i < gA.getBoard().length; i++) {\n booleanBoard[6][i] = true;\n gA.getBoard()[6][i].setRotation(0);\n figBoard[6][i] = new Pawn(\"black\", 60 + i, black[8]);\n }\n\n clearFallenFigures();\n clearBoardBackground();\n clearStringBoard();\n showBoard(); //shows the figures\n showScore();\n setBoardClickable();\n\n if (beginner % 2 == 0)\n this.turn = 0;\n else this.turn = 1;\n\n beginner++;\n\n numberOfBlackFallen = 0;\n numberOfWhiteFallen = 0;\n fallenFiguresWhite = new ArrayList<Figure>();\n fallenFiguresBlack = new ArrayList<Figure>();\n\n showCheck();\n showTurn();\n }", "public GameBoard() {\r\n boards = new ArrayList<GameBoard>();\r\n }", "public void setUp()\r\n {\r\n board = new MineSweeperBoard(4, 4, 1);\r\n }", "public ComputerPlayer(Board board) \n {\n this.board = board;\n }", "public void setBoard_id(int Board_id){\n this.Board_id=Board_id;\n }", "public GameBoard() {\n this.gameStarted = false;\n this.turn = 1; \n this.boardState = new char[3][3];\n this.winner = 0; \n this.isDraw = false; \n\n }", "public void setColor(Color boardColor) {\r\n this.BoardColor = boardColor;\r\n }", "public GameBoard(GameBoard b)\n\t{\n\t\tboard = new int[9][9];\n\t\tfor(int r = 0; r < board.length; r++)\n\t\t{\n\t\t\tfor(int c = 0; c < board[0].length; c++)\n\t\t\t{\n\t\t\t\tboard[r][c] = b.get(r,c);\n\t\t\t}\n\t\t}\n\t}", "public Sudoku(int[][] board){\n setBoard(board);\n }", "Board getBoard() {\r\n return _board;\r\n }", "public Board(char[][] board) {\n this.boardWidth = board.length;\n this.boardHeight = board[0].length;\n this.board = board;\n this.numShips = 0;\n boardInit();\n }", "private void fillBoard() {\n\n boardMapper.put(1, new int[]{0, 0});\n boardMapper.put(2, new int[]{0, 1});\n boardMapper.put(3, new int[]{0, 2});\n boardMapper.put(4, new int[]{1, 0});\n boardMapper.put(5, new int[]{1, 1});\n boardMapper.put(6, new int[]{1, 2});\n boardMapper.put(7, new int[]{2, 0});\n boardMapper.put(8, new int[]{2, 1});\n boardMapper.put(9, new int[]{2, 2});\n\n }", "private void prepareBoard(){\n gameBoard.arrangeShips();\n }", "@Before\r\n public void setUpBoard(){\r\n board3 = new Board(makeTiles(3*3), boardManager3, 3);\r\n board4 = new Board(makeTiles(4*4), boardManager4, 4);\r\n board5 = new Board(makeTiles(5*5), boardManager5, 5);\r\n boardManager3.setBoard(board3);\r\n boardManager4.setBoard(board4);\r\n boardManager5.setBoard(board5);\r\n board3.setSlidingScoreBoard(slidingScoreBoard3);\r\n board4.setSlidingScoreBoard(slidingScoreBoard4);\r\n board5.setSlidingScoreBoard(slidingScoreBoard5);\r\n }", "public void setState(int row, int col) throws ArrayIndexOutOfBoundsException {\r\n board[row][col] = currentPlayer;\r\n }", "public RefreshBoardCommand(Board board) {\n\t\tsuper();\n\t\tthis.board = board;\n\t}", "public Board(Character[][] matrix) {\n this.matrix = matrix;\n }", "public void resetBoard() {\n\t\tplayerTurn = 1;\n\t\tgameStart = true;\n\t\tdispose();\n\t\tplayerMoves.clear();\n\t\tnew GameBoard();\n\t}", "public void setPlayboard(Playboard playboard);", "public UIBoard()\r\n\t{\r\n\t\t//Creates a 10x10 \"Board\" object\r\n\t\tsuper(10,10);\r\n\t\tgrid = new int[getLength()][getWidth()];\r\n\t\t\r\n\t\t//Sets all coordinates to the value 0, which corresponds to \"not hit yet\"\r\n\t\tfor(int i=0; i<grid.length; i++)\r\n\t\t\tfor(int j=0; j<grid[i].length; j++)\r\n\t\t\t\tgrid[i][j] = 0;\t\t\r\n\t}", "public TicTacToe() {\n resetBoard();\n }", "public Board(Board original) {\n this();\n for (int i = 0; i <= 2; i++) {\n for (int j = 0; j <= 2; j++) {\n board[i][j] = original.board[i][j];\n }\n }\n }", "Board getBoard() {\n return _board;\n }", "@Override\n\tpublic int updateBoard(int num) {\n\t\treturn 0;\n\t}", "public void set(int x,int y) {\n\tif ( ! (board[x][y] == 9)) {\n\t board[x][y] = 1;\n\t}\n }", "public Board() {\n\t\tdimension = 9;\n\t\tpuzzle = new int[dimension][dimension];\n\t}", "public void changeToBoardView(){\n\t\tif (titlePage != null){\n\t\t\tgetContentPane().remove(titlePage); \t// remove the title page from the GUI\n\t\t\ttitlePage = null;\t\n\t\t}\n\t\tif (gameOverPage != null){\n\t\t\t// remove the page if it exists\n\t\t\tgetContentPane().remove(gameOverPage);\n\t\t\tgameOverPage = null;\t// set the page to null\n\t\t}\n\t\tscoreboard = new Scoreboard(this);\t\t// create a new scoreboard to track the game's score\n\t\tboard = new Board(this);\n\t\tvalidate(); \t// validate and repaint to reflect the removal of old panels\n\t\trepaint();\t\t// repaint the board\n\t\tthis.add(board, BorderLayout.EAST);\t\t// add board to the frame\n\t\tthis.add(scoreboard, BorderLayout.EAST);\t// add scoreboard to the frame\n\t}", "public static void makeBoardChess() {\r\n \r\n white = new AllPiece(\"White\");\r\n black = new AllPiece(\"Black\");\r\n \r\n }", "public Board() {\n\t\tboardState = new Field[DIMENSION][DIMENSION];\n\t\tfor(int i = 0; i < DIMENSION; i++) {\n\t\t\tfor(int j = 0; j < DIMENSION; j++) {\n\t\t\t\tboardState[i][j] = new Field();\n\t\t\t}\n\t\t}\n\t}", "public ChessBoard() {\n initComponents();\n createChessBoard();\n\n }", "public Board Board(Board board) {\n return new Board(board.size, board._board);\n }", "public Board()\r\n {\r\n board = new Piece[8][8];\r\n xLength = yLength = 8;\r\n }", "public Board getBoard() {\r\n return board;\r\n }", "private static void trans(Board board) {\n\t\tint[][] M = new int[board.size][board.size];\n\t\tfor (int i = 0; i < board.size; i++)\n\t\t\tfor (int j = 0; j < board.size; j++)\n\t\t\t\tM[i][j] = board.board[j][i];\n\t\tboard.board = M.clone();\n\t}", "public Board() {\n this.board = new Piece[16];\n }", "private void generateBoard(){\n\t}" ]
[ "0.83329797", "0.8301852", "0.8264161", "0.8264161", "0.8208187", "0.7892779", "0.7889198", "0.78577864", "0.77623796", "0.77619076", "0.77462757", "0.76521456", "0.7499788", "0.7282316", "0.7276258", "0.72711414", "0.7252888", "0.7134118", "0.713302", "0.70803344", "0.70736444", "0.7056209", "0.7049237", "0.7015694", "0.69102174", "0.68957037", "0.6893959", "0.6888558", "0.6882061", "0.688019", "0.68589014", "0.684043", "0.68363", "0.6835919", "0.68265873", "0.6789307", "0.6783139", "0.6782954", "0.67571336", "0.67430955", "0.674063", "0.673013", "0.6722211", "0.6707279", "0.6681066", "0.6671962", "0.6663818", "0.6634405", "0.66335154", "0.6627449", "0.66223264", "0.66223264", "0.6601782", "0.6585009", "0.6575512", "0.65725964", "0.6563502", "0.65597653", "0.65435314", "0.65426147", "0.6542349", "0.6536265", "0.65195566", "0.6517768", "0.65118605", "0.6505482", "0.6497742", "0.64865685", "0.64838165", "0.64827573", "0.64628786", "0.6460246", "0.64425576", "0.6431358", "0.64175165", "0.6413289", "0.63964933", "0.6396456", "0.63884157", "0.63852483", "0.6382723", "0.6373332", "0.6369552", "0.63678324", "0.6361906", "0.63435894", "0.63409746", "0.63374805", "0.6329036", "0.63275874", "0.6322927", "0.6319876", "0.6319373", "0.63125765", "0.63112575", "0.6302756", "0.6301602", "0.628818", "0.6284096", "0.6269337" ]
0.7999255
5
/ sets the xPlayer so the referee knows
public void setxPlayer(Player xPlayer) { this.xPlayer = xPlayer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void setPlayerXRelative(int x) {\n }", "private void setPlayer() {\n player = Player.getInstance();\n }", "private void setPlayer()\t{\n\t\tgrid.setGameObject(spy, Spy.INITIAL_X, Spy.INITIAL_Y);\n\t}", "@Override\n\tpublic void setPlayer(Player player) {\n\n\t}", "public void setPlayer(Player player) {\n this.currentPlayer = player;\n }", "public void setPlayer(Player myPlayer){\n battlePlayer=myPlayer;\n }", "public void setPlayer(Player player) {\r\n this.player = player;\r\n }", "public void setCurrentPlayer(Player P){\n this.currentPlayer = P;\n }", "public void setPlayer(Player _player) { // beallit egy ezredest az adott mapElementre, ha az rajta van\n player = _player;\n }", "public void setPlayer(Player player) {\n this.player = player;\n }", "public void setPlayer(Player player) {\n this.player = player;\n }", "public void setPlayer(Player player) {\n\t\tthis.player = player;\r\n\t}", "public void setAsPlayer(){\n\t\tthis.isPlayer = true;\n\t}", "public void setPlayer(ViewerManager2 player) {\n this.player = player;\n // the player is needed to be existent befor starting up the remote Server\n //startRemoteServer();\n\n }", "public void setActivePlayer()\n {\n activePlayer = !activePlayer;\n }", "public void setPlayer(Player p) {\n\t\tplayer = p;\n\t}", "public void setPlayer(Sprite player) {\n\t\tthis.player = player;\n\t}", "public void setPlayer(int play)\n {\n this.player=play;\n }", "public void updatePlayerXPos(){\n\t\tif(goRight&&Player.getxPlayerLoc()<=(screenWidth - (Player.getPlayerImage().getWidth()* Player.getPlayerScale() ) ) ){\n\t\t\tPlayer.updateXPos(true);\n\t\t\tPlayer.setPlayerImage(true);\n\t\t\t\n\t\t}\n\t\tif(goLeft&&Player.getxPlayerLoc() >=( (Player.getPlayerImage().getWidth() / 2) * Player.getPlayerScale() ) ){\n\t\t\tPlayer.updateXPos(false);\n\t\t\tPlayer.setPlayerImage(false);\n\t\t}\n\t}", "@Override\r\n\tpublic void set(final Player t) {\n\r\n\t}", "public void setCurrent(ServerPlayer p) {\n\t\tthis.current = p;\n\t}", "public void setPlayer(Player player) {\n\t\tthis.player = player;\n\t}", "public static void setPlayer(Player p) {\n\t\tUniverse.player = p;\n\t}", "public void setD_CurrentPlayer(Player p_CurrentPlayer) {\n d_CurrentPlayer = p_CurrentPlayer;\n }", "public void setoPlayer(Player oPlayer) {\n\t\tthis.oPlayer = oPlayer;\n\t}", "public static void changePlayer() {\n\t\tvariableReset();\n\t\tif (curPlayer == 1)\n\t\t\tcurPlayer = player2;\n\t\telse\n\t\t\tcurPlayer = player1;\n\t}", "public void resetPlayer() {\n\t\thealth = 3;\n\t\tplayerSpeed = 5f;\n\t\tmultiBulletIsActive = false;\n\t\tspeedBulletIsActive = false;\n\t\tquickFireBulletIsActive = false;\n\t\tinvincipleTimer = 0;\n\t\txPosition = 230;\n\t}", "public void setPlayer(Player player) {\n\t\t\tthis.player = player;\n\t\t}", "@Override\r\n\tpublic void setTheOwner(Player owner) {\n\t\t\r\n\t}", "public void setPlayer(String player) {\r\n this.player = player;\r\n }", "public void setSinglePlayer(){\n isSinglePlayer = true;\n }", "public void setOwner(Player player) {\n owner = player;\n }", "@Override\r\n public void updateMixer() {\n playerPosition = mixer.getGlobalCoordinates();\r\n }", "public void switchPlayer(){\n // Menukar giliran player dalam bermain\n Player temp = this.currentPlayer;\n this.currentPlayer = this.oppositePlayer;\n this.oppositePlayer = temp;\n }", "private void changeCurrentPlayer() {\n switch (currentPlayer) {\n case 0: currentPlayer = 1;\n return;\n default: currentPlayer = 0;\n return;\n }\n }", "public void setPlayer(Player player) {\n\n\t\tif (this.player != null) {\n\t\t\tthrow new IllegalStateException(\"The player for this PlayerGuiDisplay has already been set\");\n\t\t}\n\n\t\tthis.player = player;\n\t}", "public void use(Player player) {\n\n\t}", "void setX(int x) {\n position = position.setX(x);\n }", "public void setX(int x)\n\t{\n\t\tgetWorldPosition().setX(x);\n\t}", "void playerPositionChanged(Player player);", "public void setPlayer(final AbstractGameObject player) {\n this.player = player;\n this.cameraHelper.setTarget(this.player);\n }", "private void setWhitePlayer(Player player) {\r\n\t\tthis.whitePlayer = player;\r\n\t}", "@Override\n\tpublic void startGame(){\n\t\tsuper.currentPlayer = 1;\n\t}", "public void setAudioPlayer(AudioPlayer player) {\n\taudioPlayer = player;\n externalAudioPlayer = true;\n }", "public void setX() {\n m_frontLeft.setDesiredState(new SwerveModuleState(0, Rotation2d.fromDegrees(45)));\n m_frontRight.setDesiredState(new SwerveModuleState(0, Rotation2d.fromDegrees(-45)));\n m_rearLeft.setDesiredState(new SwerveModuleState(0, Rotation2d.fromDegrees(-45)));\n m_rearRight.setDesiredState(new SwerveModuleState(0, Rotation2d.fromDegrees(45)));\n }", "public void setActivePlayer(Piece.COLOR activePlayer) {\n this.activePlayer = activePlayer;\n }", "public void setCurrentPlayer(String currentPlayer) {\n\t\t_currentPlayer = currentPlayer;\n\t}", "public void initPlayer();", "public void setFrame(BufferedImage frame) {\r\n\t\tplayer = frame;\r\n\t}", "public void setPlayer(Player player) {\n\t\tthis.player = player;\n\t\tplayer.resetAllPlayerGuesses();\n\t}", "public void teleportPlayer(int x, int y){\n hero.setX(x);\n hero.setY(y);\n }", "@Override\n\tpublic void loadPlayer() {\n\t\t\n\t}", "public void setMageSpecial(int mouseX, int mouseY) {\r\n\t\tnew Sounds(\"teleport.wav\");\r\n\t\ttempMageX = x;\r\n\t\ttempMageY = y;\r\n\t\t\r\n\t\tif(mouseX > tempMageX) {\r\n\t\t\tx += 100;\r\n\t\t\tif(x > frameX - 32) {\r\n\t\t\t\tplayerLabel.setBounds(frameX - 32, tempMageY, 32, 32);\r\n\t\t\t} else {\r\n\t\t\t\tplayerLabel.setBounds(x, tempMageY, 32, 32);\r\n\t\t\t}\r\n\t\t\tplayerLabel.repaint();\r\n\t\t} else if(mouseX < tempMageX) {\r\n\t\t\tx -= 100;\r\n\t\t\tif(x < 0) {\r\n\t\t\t\tplayerLabel.setBounds(0, tempMageY, 32, 32);\r\n\t\t\t} else {\r\n\t\t\t\tplayerLabel.setBounds(x, tempMageY, 32, 32);\r\n\t\t\t}\r\n\t\t\tplayerLabel.repaint();\r\n\t\t}\r\n\t}", "public void attachPlayerView() {\n simpleExoPlayerView.setPlayer(player);\n }", "void setX(int newX) {\n this.xPos = newX;\n }", "public void setActivePlayer(int activePlayer)\n\t{\n\t\tthis.activePlayer = activePlayer;\n\t}", "public int getPlayerX() {\n return playerX;\n }", "private void initPlayers() {\n this.playerOne = new Player(1, 5, 6);\n this.playerTwo = new Player(2, 0, 1);\n this.currentPlayer = playerOne;\n\n }", "public void setX(int x){ xPosition = x; }", "public ComputerPlayer()\r\n {\r\n x = 0;\r\n }", "public void killPlayer(){\n setInPlay(false);\n setDx(0.0f);\n setDy(0.04f);\n }", "public void setOwnerPlayer( final PlayerModel ownerPlayer ) {\r\n\t\tthis.ownerPlayer = ownerPlayer;\r\n\t}", "public void changeActivePlayer() {\n\t\tif(this.getActivePlayer().equals(this.getPlayer1())) {\n\t\t\tthis.setActivePlayer(this.getPlayer2());\n\t\t} else {\n\t\t\tthis.setActivePlayer(this.getPlayer1());\n\t\t}\n\t}", "public void setControllable(Rowdy player) {\r\n\t\tthis.player = player;\r\n\t}", "Player() {\r\n setPlayerType(\"HUMAN\");\r\n\t}", "protected void setFirstPlayer(TennisPlayer tennisPlayer) {\r\n this.firstPlayer = tennisPlayer;\r\n }", "public void setCurrentPlayerIs(int currentPlayerInt){\n\t\tcurrentPlayerIs = currentPlayerInt;\n\t\trepaint();\n\t}", "private void setPlayer(BoardSquaresState player){\n\t\tif(player == BoardSquaresState.CROSS){\n\t\t\tselectedPlayer = BoardSquaresState.CROSS;\n\t\t\tplayerSelectionButton.setText(R.id.button_title, \"Cross\");\n\t\t\tplayerSelectionButton.setText(R.id.button_subtitle, \"You go first!\");\n\t\t\tplayerSelectionButton.setImageResource(R.id.selector_button_image, R.drawable.cross_1);\n\t\t\tplayerSelectionButton.setImageResource(R.id.item_set_image, R.drawable.btn_check_on_focused_holo_light);\n\t\t}\n\t\telse{\n\t\t\tselectedPlayer = BoardSquaresState.NOUGHT;\n\t\t\tplayerSelectionButton.setText(R.id.button_title, \"Nought\");\n\t\t\tplayerSelectionButton.setText(R.id.button_subtitle, \"Computer goes first!\");\n\t\t\tplayerSelectionButton.setImageResource(R.id.selector_button_image, R.drawable.nought_1);\n\t\t\tplayerSelectionButton.setImageResource(R.id.item_set_image, R.drawable.btn_check_on_focused_holo_light);\n\t\t}\n\n\t}", "private void ReplacePlayer()\n {\n String oldPlayer = GetPlayerString(mTeamsComboBox.getSelectedItem().toString(),\n mPositionComboBox.getSelectedItem().toString());\n if( oldPlayer == null )\n return;\n\n String newPlayer = GetPlayerString_UI();\n String team = mTeamsComboBox.getModel().getElementAt(mTeamsComboBox.getSelectedIndex()).toString();\n ReplacePlayer(team, oldPlayer, newPlayer);\n }", "@Override\r\n public void init(NexPlayer nexPlayer) {\r\n mNexPlayer = nexPlayer;\r\n initBinder();\r\n }", "public void setPlayerAtStart(Player player) {\n\t\tplayer.moveTo(start.getX()*10, start.getY()*10, start.getZ()*10);\n\t}", "@Override\n\tpublic void mouseDragged(MouseEvent e) {\n\t\tplayerx = e.getX();\n\t\tplayery = e.getY();\n\t}", "private void movePlayer() {\r\n\t\tshipImageView.setX(ship.getCurrentLocation().x * scalingFactor);\r\n\t\tshipImageView.setY(ship.getCurrentLocation().y * scalingFactor);\r\n\t\tship.notifyObservers();\r\n\t}", "private void SetCurrentPlayer() throws IOException\n {\n if( mTeamsComboBox.getSelectedItem() != null )\n {\n String team = mTeamsComboBox.getSelectedItem().toString();\n String position = mPositionComboBox.getSelectedItem().toString();\n String playerData = GetPlayerString(team, position);\n if( playerData != null )\n SetPlayerData(playerData);\n }\n }", "void setPlayerView(View v);", "public void setFirstPlayer() {\n notifySetFirstPlayer(this.getCurrentTurn().getCurrentPlayer().getNickname(), onlinePlayers);\n }", "public void pickUp(Player player) {\n player.setBox(this);\n }", "public void setXSpeed(int speed){\n xSpeed = speed;\n }", "protected void setPlayerStart( int idx, float x, float y ) {\n if(mPlayerStartList == null) {\n newPlayerList();\n }\n if(idx < 0 || idx >= mPlayerStartList.length) {\n return;\n }\n mPlayerStartList[idx].x = x;\n mPlayerStartList[idx].y = y;\n }", "public void setPlayerName(String name){\n\t\tplayerName = name;\n\t\trepaint();\n\t}", "public void setP1(Player p1) {\n this.p1 = p1;\n }", "@Override\n\tpublic void setX(int x) {\n\t\t\n\t}", "public void setP1(ServerPlayer p1) {\r\n\t\tthis.p1 = p1;\r\n\t}", "public void setNextActivePlayer() {\n this.activePlayer = getNextActivePlayer();\n // PLAYERLISTENER : Trigger playerEvent for player that is WAITING\n for (PlayerListener listener : playerListeners) {\n PlayerEvent event = new PlayerEvent(this, this.activePlayer, PlayerEvent.PLAYING);\n listener.playerStateChanged(event);\n }\n }", "public void setSpawnX(int x)\n {\n spawnX = x;\n }", "public void setX(PDAction x) {\n/* 116 */ this.actions.setItem(\"X\", (COSObjectable)x);\n/* */ }", "public void setX(float x){\n hitBox.offsetTo(x,hitBox.top);\n //this.x=x;\n }", "public void setMousePosition( final float x, final float y ) throws RemoteException {\r\n playerState.mousePosition.x = x;\r\n playerState.mousePosition.y = y;\r\n }", "private void setupPlayer() {\n player = MediaPlayer.create(MediaPlayerActivity.this, R.raw.byte_music);\n updateState(MediaPlayerState.STATE_PREPARED);\n }", "boolean setPlayer(String player);", "private void switchPlayer() {\n Player player;\n playerManager.switchPlayer();\n\n if(playerManager.getCurrentPlayer() == 1)\n player = playerManager.getPlayer(1);\n else if(playerManager.getCurrentPlayer() == 2)\n player = playerManager.getPlayer(2);\n else\n player = new Player(\"No Player exists\");\n\n updateLiveComment(\"Turn : \" + player.getName());\n }", "private void setBlackPlayer(Player player) {\r\n\t\tthis.blackPlayer = player;\r\n\t}", "public void setRedPlayer(Player redPlayer) {\n\t\tthis.redPlayer = redPlayer;\n\t}", "public void switchPlayer() {\r\n\t\tif (player == player1) {\r\n\t\t\tplayer = player2;\r\n\t\t} else {\r\n\t\t\tplayer = player1;\r\n\t\t}\r\n\t}", "public void setPlayer(Player player){\r\n\t\tif (!hasBeenAcquired()){\r\n\t\t\tthis.acquiredBy = player;\r\n\t\t}\r\n\t\telse{\r\n\t\t\tthrow new IllegalArgumentException(\"Cannot acquire a plot that has already been acquired!\");\r\n\t\t}\r\n\t}", "public void setPlayer(Player newPlayer) {\n roomPlayer = newPlayer;\n }", "@Override\n\tpublic void setX(int x) {\n\n\t}", "public void createOwnerPlayer(String name, double x, double y) {\n Player player = (Player) players.get(name);\r\n if (player == null) {\r\n// System.out.println(\"Create owner player \" + name);\r\n player = new Player(name, x, y);\r\n inPlayer = player;\r\n players.put(name, player);\r\n }\r\n }", "void setPlayerId(int playerId);", "void updatePlayer(Player player);" ]
[ "0.7429172", "0.7364329", "0.7174041", "0.6923559", "0.6856301", "0.67711174", "0.6761122", "0.6740994", "0.66882426", "0.6640956", "0.66041255", "0.6559757", "0.6556365", "0.6537967", "0.64887726", "0.6474641", "0.64668596", "0.63938993", "0.6391851", "0.6382503", "0.637582", "0.6357053", "0.63523626", "0.6341536", "0.6320472", "0.630669", "0.6302964", "0.62798434", "0.6264706", "0.6250983", "0.62437356", "0.62255025", "0.6208601", "0.6192084", "0.6180196", "0.6153656", "0.61233914", "0.61127806", "0.60778004", "0.6071456", "0.60635257", "0.60573745", "0.6052168", "0.6049564", "0.6011642", "0.5980965", "0.59805816", "0.59621006", "0.59516054", "0.5943481", "0.59397215", "0.5937154", "0.59315884", "0.59134895", "0.5908194", "0.5901421", "0.58985394", "0.5897058", "0.58881915", "0.5886302", "0.5879933", "0.58738893", "0.5851875", "0.5841818", "0.5837146", "0.58341277", "0.58324426", "0.5829247", "0.58246744", "0.58243024", "0.5821887", "0.5821037", "0.5820007", "0.5819005", "0.58189327", "0.58163995", "0.58003414", "0.5798352", "0.57911396", "0.5778539", "0.5776382", "0.5776373", "0.5776225", "0.5772777", "0.5758285", "0.57572526", "0.57566637", "0.57548004", "0.57458806", "0.57358074", "0.5735758", "0.5733635", "0.57325", "0.5720807", "0.5706424", "0.57023543", "0.5699309", "0.5698537", "0.56958956", "0.5694615" ]
0.8054472
0
/ sets the oPlayer so the referee knows
public void setoPlayer(Player oPlayer) { this.oPlayer = oPlayer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setPlayer() {\n player = Player.getInstance();\n }", "public void setPlayer(Player player) {\r\n this.player = player;\r\n }", "@Override\n\tpublic void setPlayer(Player player) {\n\n\t}", "public void setPlayer(Player myPlayer){\n battlePlayer=myPlayer;\n }", "public void setPlayer(Player player) {\n this.player = player;\n }", "public void setPlayer(Player p) {\n\t\tplayer = p;\n\t}", "public void setPlayer(Player player) {\n this.player = player;\n }", "public void setPlayer(Player _player) { // beallit egy ezredest az adott mapElementre, ha az rajta van\n player = _player;\n }", "public void setPlayer(Player player) {\n\t\tthis.player = player;\r\n\t}", "public void setPlayer(Player player) {\n this.currentPlayer = player;\n }", "public void setPlayer(ViewerManager2 player) {\n this.player = player;\n // the player is needed to be existent befor starting up the remote Server\n //startRemoteServer();\n\n }", "public void setPlayer(Player player) {\n\t\tthis.player = player;\n\t}", "public static void setPlayer(Player p) {\n\t\tUniverse.player = p;\n\t}", "public void setPlayer(Player player) {\n\t\t\tthis.player = player;\n\t\t}", "public void setOwner(Player player) {\n owner = player;\n }", "public void setCurrentPlayer(Player P){\n this.currentPlayer = P;\n }", "private void setPlayer()\t{\n\t\tgrid.setGameObject(spy, Spy.INITIAL_X, Spy.INITIAL_Y);\n\t}", "public void setPlayer(String player) {\r\n this.player = player;\r\n }", "public void setPlayer(final AbstractGameObject player) {\n this.player = player;\n this.cameraHelper.setTarget(this.player);\n }", "@Override\r\n\tpublic void set(final Player t) {\n\r\n\t}", "public void setPlayer(Sprite player) {\n\t\tthis.player = player;\n\t}", "public void use(Player player) {\n\n\t}", "public void setPlayer(int play)\n {\n this.player=play;\n }", "@Override\r\n\tpublic void setTheOwner(Player owner) {\n\t\t\r\n\t}", "public void setAsPlayer(){\n\t\tthis.isPlayer = true;\n\t}", "public void switchPlayer(){\n // Menukar giliran player dalam bermain\n Player temp = this.currentPlayer;\n this.currentPlayer = this.oppositePlayer;\n this.oppositePlayer = temp;\n }", "public void setOwnerPlayer( final PlayerModel ownerPlayer ) {\r\n\t\tthis.ownerPlayer = ownerPlayer;\r\n\t}", "public void setCurrent(ServerPlayer p) {\n\t\tthis.current = p;\n\t}", "public void setPlayer(Player newPlayer) {\n roomPlayer = newPlayer;\n }", "public void setAudioPlayer(AudioPlayer player) {\n\taudioPlayer = player;\n externalAudioPlayer = true;\n }", "public void setPlayer(Player player) {\n\t\tthis.player = player;\n\t\tplayer.resetAllPlayerGuesses();\n\t}", "public void setActivePlayer()\n {\n activePlayer = !activePlayer;\n }", "public void setPlayer(Player player) {\n\n\t\tif (this.player != null) {\n\t\t\tthrow new IllegalStateException(\"The player for this PlayerGuiDisplay has already been set\");\n\t\t}\n\n\t\tthis.player = player;\n\t}", "@Override\n\tpublic void loadPlayer() {\n\t\t\n\t}", "public static void changePlayer() {\n\t\tvariableReset();\n\t\tif (curPlayer == 1)\n\t\t\tcurPlayer = player2;\n\t\telse\n\t\t\tcurPlayer = player1;\n\t}", "public void initPlayer();", "public void setD_CurrentPlayer(Player p_CurrentPlayer) {\n d_CurrentPlayer = p_CurrentPlayer;\n }", "protected Player getPlayer() { return player; }", "public void setPlayer(Player player) {\n if(humanPlayer != null) {\n throw new IllegalArgumentException(\"The player has already been set to \"\n + humanPlayer.getName() + \" with the game piece \" + humanPlayer.getPiece());\n }\n if(player == null) {\n throw new IllegalArgumentException(\"Player cannot be null.\");\n }\n humanPlayer = player;\n }", "public void setOwner(Player owner) {\n\t\tthis.owner = owner;\n\t}", "private void setWhitePlayer(Player player) {\r\n\t\tthis.whitePlayer = player;\r\n\t}", "public void setxPlayer(Player xPlayer) {\n\t\tthis.xPlayer = xPlayer;\n\t}", "public void setAiPlayer(Player player) {\n if(aiPlayer != null) {\n throw new IllegalArgumentException(\"The player has already been set to \"\n + aiPlayer.getName() + \" with the game piece \" + aiPlayer.getPiece());\n }\n if(player == null) {\n throw new IllegalArgumentException(\"Player cannot be null.\");\n }\n aiPlayer = player;\n }", "void updatePlayer(Player player);", "Player() {\r\n setPlayerType(\"HUMAN\");\r\n\t}", "private void switchPlayer() {\n Player player;\n playerManager.switchPlayer();\n\n if(playerManager.getCurrentPlayer() == 1)\n player = playerManager.getPlayer(1);\n else if(playerManager.getCurrentPlayer() == 2)\n player = playerManager.getPlayer(2);\n else\n player = new Player(\"No Player exists\");\n\n updateLiveComment(\"Turn : \" + player.getName());\n }", "public void switchPlayer() {\r\n\t\tif (player == player1) {\r\n\t\t\tplayer = player2;\r\n\t\t} else {\r\n\t\t\tplayer = player1;\r\n\t\t}\r\n\t}", "public Player updatePlayer(Player player);", "private void setBlackPlayer(Player player) {\r\n\t\tthis.blackPlayer = player;\r\n\t}", "private void ReplacePlayer()\n {\n String oldPlayer = GetPlayerString(mTeamsComboBox.getSelectedItem().toString(),\n mPositionComboBox.getSelectedItem().toString());\n if( oldPlayer == null )\n return;\n\n String newPlayer = GetPlayerString_UI();\n String team = mTeamsComboBox.getModel().getElementAt(mTeamsComboBox.getSelectedIndex()).toString();\n ReplacePlayer(team, oldPlayer, newPlayer);\n }", "boolean setPlayer(String player);", "public boolean setPlayer(Player aNewPlayer)\r\n {\r\n boolean wasSet = false;\r\n player = aNewPlayer;\r\n wasSet = true;\r\n return wasSet;\r\n }", "@Override\n\tpublic void updatePlayer(Joueur joueur) {\n\t\t\n\t}", "public void turnToPlay(Player opponent) {\n\n }", "public abstract void changePlayerAt(ShortPoint2D pos, Player player);", "void playerPositionChanged(Player player);", "public void setSinglePlayer(){\n isSinglePlayer = true;\n }", "public void setRedPlayer(Player redPlayer) {\n\t\tthis.redPlayer = redPlayer;\n\t}", "public Player getPlayer() { return player;}", "public void setOpponent(Player p) {\n\t\tthis.opponent = p;\n\t}", "public Player getPlayer()\r\n {\r\n return player;\r\n }", "public Player getPlayer(){\r\n return player;\r\n }", "private void changeCurrentPlayer() {\n switch (currentPlayer) {\n case 0: currentPlayer = 1;\n return;\n default: currentPlayer = 0;\n return;\n }\n }", "public void setBluePlayer(Player bluePlayer) {\n\t\tthis.bluePlayer = bluePlayer;\n\t}", "void initializePlayer();", "public Player getPlayer() { return player; }", "public void setFrame(BufferedImage frame) {\r\n\t\tplayer = frame;\r\n\t}", "Player getCurrentPlayer();", "Player getCurrentPlayer();", "public void setCurrentPlayer(String currentPlayer) {\n\t\t_currentPlayer = currentPlayer;\n\t}", "private void SetCurrentPlayer() throws IOException\n {\n if( mTeamsComboBox.getSelectedItem() != null )\n {\n String team = mTeamsComboBox.getSelectedItem().toString();\n String position = mPositionComboBox.getSelectedItem().toString();\n String playerData = GetPlayerString(team, position);\n if( playerData != null )\n SetPlayerData(playerData);\n }\n }", "private void setPlayerRoom(){\n player.setRoom(currentRoom);\n }", "@Override\n\tpublic void setBukkitPlayer(final Player bukkitPlayer) {\n\t\tthis.bukkitPlayer = bukkitPlayer;\n\t}", "public Player getPlayer() {\r\n return player;\r\n }", "public EpicPlayer getEpicPlayer(){ return epicPlayer; }", "void setPlayerId(int playerId);", "@Override\n public void landedOn(Player player) {}", "private void initPlayers() {\n this.playerOne = new Player(1, 5, 6);\n this.playerTwo = new Player(2, 0, 1);\n this.currentPlayer = playerOne;\n\n }", "public void setActivePlayer(Piece.COLOR activePlayer) {\n this.activePlayer = activePlayer;\n }", "@Override\r\n public void updateMixer() {\n playerPosition = mixer.getGlobalCoordinates();\r\n }", "Player getPlayer();", "public void setP2(ServerPlayer p2) {\r\n\t\tthis.p2 = p2;\r\n\t}", "private void switchPlayer(Player opponentPlayer, Match match) {\r\n if(opponentPlayer.getPlayerId().equals(match.getPlayer1().getPlayerId())){\r\n setCurrentPlayer(match, 1);\r\n } else if (opponentPlayer.getPlayerId().equals(match.getPlayer2().getPlayerId())){\r\n setCurrentPlayer(match, 2);\r\n } else {\r\n LOGGER.error(\"Player not found\");\r\n }\r\n }", "@Override\n\t\tpublic void onLoaded(String arg0) {\n\t\t\t\tplayer.play();\n\t\t}", "public void changeActivePlayer() {\n\t\tif(this.getActivePlayer().equals(this.getPlayer1())) {\n\t\t\tthis.setActivePlayer(this.getPlayer2());\n\t\t} else {\n\t\t\tthis.setActivePlayer(this.getPlayer1());\n\t\t}\n\t}", "public void setControllable(Rowdy player) {\r\n\t\tthis.player = player;\r\n\t}", "public Player getPlayer() {\n return player;\n }", "public void setP1(ServerPlayer p1) {\r\n\t\tthis.p1 = p1;\r\n\t}", "protected void setFirstPlayer(TennisPlayer tennisPlayer) {\r\n this.firstPlayer = tennisPlayer;\r\n }", "@Override\n\tpublic void attiva(Player player) {\n\n\t}", "public RemotePlayerServer(Player p) {\n this.localPlayer = p;\n }", "public void setOpponent(Player opponent) {\n\t\tthis.opponent = opponent;\n\t}", "public void play() { player.resume();}", "public void nextPlayer() {\n\t\tif (currentPlayer.equals(vServerThread.get(0))){\n\t\t\tcurrentPlayer=vServerThread.get(1);\n\t\t} else if (currentPlayer.equals(vServerThread.get(1))){\n\t\t\tcurrentPlayer=vServerThread.get(0);\n\t\t}\n\t}", "public Player getPlayer() {\n return player;\n }", "public Player getPlayer() {\n return player;\n }", "public Player getPlayer() {\n return player;\n }", "public Player getPlayer() {\n return player;\n }", "public Player getPlayer() {\n return player;\n }", "public void setP2(Player p2) {\n this.p2 = p2;\n }" ]
[ "0.8078604", "0.79195124", "0.79052585", "0.78363377", "0.7817086", "0.7784036", "0.77835226", "0.7762867", "0.7711522", "0.7701585", "0.75794023", "0.75446737", "0.7496453", "0.7452831", "0.745147", "0.7439983", "0.7399991", "0.73577785", "0.73288256", "0.72985923", "0.72477573", "0.7238638", "0.7237841", "0.7197915", "0.7108506", "0.7039709", "0.70282036", "0.7020476", "0.7009497", "0.6918988", "0.6869351", "0.6847707", "0.6831862", "0.6830041", "0.6812008", "0.6802599", "0.67803663", "0.6708678", "0.66621006", "0.66575587", "0.6651306", "0.66432023", "0.6638868", "0.66358715", "0.6634954", "0.66234446", "0.6621775", "0.6620786", "0.6616083", "0.65886784", "0.65732676", "0.6560509", "0.65516216", "0.65469813", "0.65413487", "0.65198797", "0.6515942", "0.6506471", "0.65050066", "0.6501984", "0.6469507", "0.64601386", "0.6452171", "0.64503", "0.6436752", "0.64126015", "0.64122105", "0.6401666", "0.6401666", "0.6396959", "0.6390349", "0.638926", "0.6373989", "0.637301", "0.6371511", "0.6368842", "0.6368399", "0.6353022", "0.6342989", "0.63423556", "0.63340044", "0.6323551", "0.63122576", "0.63063127", "0.6294158", "0.62834716", "0.6281431", "0.62776524", "0.62723017", "0.6271185", "0.62659997", "0.6259802", "0.62566465", "0.62525356", "0.6244785", "0.6244785", "0.6244785", "0.6244785", "0.6244785", "0.62425333" ]
0.8131266
0
/ Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution.
public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int k = in.nextInt(); ArrayList<Integer> list = new ArrayList<>(); for(int arr_i=0; arr_i < n; arr_i++){ int integer = in.nextInt(); list.add(new Integer(integer)); } in.close(); if(k == 1){ System.out.println(k); return; } for(int i = 0;i < list.size();i ++){ int x = list.get(i) % k; list.set(i, x); } int[] kx = new int[k]; for(int i = 0;i < k;i ++){ kx[i] = 0; } for(int i = 0;i < list.size();i ++){ int x = list.get(i); kx[x] ++; } int num = 0; int A = 0; if(k % 2 == 0){ A = k / 2 - 1; }else{ A = k / 2; } if(kx[0] != 0){ num += 2; } for(int i = 1; i <= A;i ++){ if(kx[i] >= kx[k - i]){ num += kx[i]; }else { num += kx[k - i]; } } System.out.println(num); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tSolution s = new Solution();\r\n\t}", "public static void main(String[] args) throws IOException {\n\t\t//Scanner in = new Scanner(System.in);\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tPrintWriter out = new PrintWriter(System.out);\n\t\tsolve(in, out);\n\t\tout.close();\n\t\tin.close();\t\n\t}", "public static void main(String[] args) {\n\t\tInputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n\t\tProblemSolver problemSolver = new ProblemSolver();\n\t\tproblemSolver.solveTheProblem(in, out);\t\t\n\t\tout.close();\t\t\n\t}", "public void solution() {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(solution());\r\n\t}", "public static void main(String[] args) {\n\n Solution2.solution();\n }", "private Solution() { }", "private Solution() { }", "private Solution() {\n\n }", "public static void main(String []args) throws IOException {\n\tFastScanner in = new FastScanner(System.in);\n\tPrintWriter out = \n\t\tnew PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)), false); \n\tsolve(in, out);\n\tin.close();\n\tout.close();\n }", "private Solution() {\n }", "public static void main(String[] args) throws IOException{\n BufferedReader f = new BufferedReader(new InputStreamReader(System.in));\r\n\r\n \tint n = Integer.parseInt(f.readLine());\r\n \t\r\n \tint[] a = new int[n];\r\n \tStringTokenizer st = new StringTokenizer(f.readLine());\r\n \tfor(int i = 0; i < n; i++) a[i] = Integer.parseInt(st.nextToken());\r\n \t\r\n \tSystem.out.println(solution(a));\r\n \r\n //out.close();\r\n }", "public static void main(String[] args) throws IOException {\n\t\tin = new Scanner(new File(\"square.in\"));\n\t\tout = new PrintWriter(new File(\"square.out\"));\n\t\t\n\t\tinit();\n\t\tsolve();\n\t\t\n\t\tin.close();\n\t\tout.close();\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(solution(0));\n\n\t}", "public static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\twhile (scanner.hasNextLine()) {\n\t\t\tString input = scanner.nextLine();\n\t\t\tSystem.out.println(solve(input));\n\t\t\t\n\t\t}\n\t\t\n\t}", "public static void main(String[] args) {\n String problem = \"Herman\";\n\n // Assign string type variable to solution string\n String result = solution(problem);\n\n //Print solution result\n System.out.println(result);\n }", "public static void main(String[] args) {\r\n\t\tSolver m = new Solver();\r\n\t\t\r\n\r\n\r\n\t\ttry {\r\n\t\t\tm.readData(\"data/Test_case_1.in\");\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\r\n\t\tint answer = m.solve(\"data/Test_case_1.in\");\r\n\r\n\t\tSystem.out.println(answer);\r\n\t\t\r\n\r\n\r\n\t}", "public static void main(String[] args) {\n\t\tSolution s = new Solution();\n\t\ts.solution(2, 4, 2, 1);\n\t}", "public static void main(String[] args) \r\n {\r\n // TODO: Read the input from the user and call produceAnswer with an equation\r\n \tScanner in = new Scanner(System.in);\r\n \tString problem = in.nextLine();\r\n \tin.close();\r\n \tSystem.out.printf(\"Result: %s\" , produceAnswer(problem));\r\n }", "public static void main(String[] args) {\n\t\t\tSystem.out.println(Solution(5, 83));\n\t\t\t\n\t\t}", "public static void main(String[] args) {\n Scanner ob = new Scanner(System.in);\n Solution solution = null;\n int testcases = ob.nextInt();\n ob.nextLine();\n for (int i = 0; i < testcases; i++) {\n String numsLine = ob.nextLine();\n String[] numsLineParts = numsLine.trim().split(\" \");\n int dimensions = Integer.valueOf(numsLineParts[0]);\n int numOperations = Integer.valueOf(numsLineParts[1]);\n solution = new Solution(dimensions);\n for (int j = 0; j < numOperations; j++) {\n String line = ob.nextLine();\n String[] lineParts = line.split(\" \");\n if (lineParts[0].equals(\"UPDATE\")) {\n solution.update(Integer.valueOf(lineParts[1])-1, Integer.valueOf(lineParts[2])-1, Integer.valueOf(lineParts[3])-1, Integer.valueOf(lineParts[4]));\n }\n if (lineParts[0].equals(\"QUERY\")) {\n solution.query(Integer.valueOf(lineParts[1])-1, Integer.valueOf(lineParts[2])-1, Integer.valueOf(lineParts[3])-1, Integer.valueOf(lineParts[4])-1, Integer.valueOf(lineParts[5])-1, Integer.valueOf(lineParts[6])-1);\n }\n }\n }\n }", "public static void main(String[] args) {\n\r\n\t\tnew Main().sol();\r\n\t}", "public static void main(String[] args) throws IOException {\n\t\tSalesmanTour ss = new SalesmanTour();\n\t\tss.input();\n\t\tSystem.out.println(ss.solve());\n\t}", "private Solution() {\n //constructor\n }", "public static void main(String[] args) throws IOException {\n\t\tString task = \"palsquare\"; //XXX change this\n\t\tString path = !TESTING ? task + \".in\"\n\t\t\t\t: System.getProperty(\"user.dir\") + File.separator + \"src\" + File.separator + \"test.in\";\n\t\tInputReader in = new InputReader(new FileInputStream(path));\n\t\tPrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(task + \".out\")));\n\t\tsolve(in, out);\n\t\tout.close();\n\t}", "private void generateSolution() {\n\t\t// TODO\n\n\t}", "public static void main(String[] args) {\r\n\t\t\r\n\t\ttry{\r\n\t\t\tScanner sc= new Scanner(new File(inpPath));\t//new File(inpPath)\r\n\t\t\tPrintWriter out = new PrintWriter(new File(outPath));\r\n\t\t\tint cases = sc.nextInt();\r\n\t\t\tfor(int t=1;t<=cases;t++){\r\n\t\t\t\tsolve(t,sc,out);\r\n\t\t\t}\r\n\t\t\tout.flush();\r\n\t\t\tout.close();\r\n\t\t}catch(Exception ex){ex.printStackTrace();}\r\n\t\t\r\n\t}", "public static void main(String[] args)\n\t{\n\t\tScanner in = new Scanner(System.in);\n\t\tStringBuilder answers = new StringBuilder();\n\n\t\tanswers.append(\"PERFECTION OUTPUT\\n\");\n\t\ttry\n\t\t{\n\t\t\tint value;\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tvalue = in.nextInt();\n\t\t\t\tif (value == 0) break;\n\n\t\t\t\tanswers.append(solve(value));\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(e);\n\t\t\tSystem.exit(1);\n\t\t}\n\t\tanswers.append(\"END OF OUTPUT\");\n\n\t\tSystem.out.println(answers);\n\t}", "public static void main(String[] args) throws IOException {\n\t\tin = new BufferedReader(new FileReader(\"cowdance.in\"));\n\t\tout = new PrintWriter(new File(\"cowdance.out\"));\n\t\t\n\t\tinit();\n\t\tsolve();\n\t\t\n\t\tin.close();\n\t\tout.close();\n\t}", "public static void main(String[] args) throws IOException {\n\n String path = \"D:\\\\GitHub\\\\Competetions\\\\CodeJam\\\\Code\\\\src\\\\B12016\\\\\";\n String input = \"bsmall.in\", output = \"bsmall.out\";\n FileInputStream fip = new FileInputStream(path + input);\n FileOutputStream fop = new FileOutputStream(path + output);\n in = fip;\n out = new PrintWriter(fop);\n B a = new B();\n a.solve();\n out.close();\n }", "public static void main(String[] args) {\n\t\tSolution sol = new Solution();\n\t\tsol.test();\n\t}", "public static void main (String args []) throws IOException\r\n\t{\n\t\tScanner in = new Scanner(new File(\"moo.in\"));\r\n\t\tPrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(\"moo.out\")));\r\n\t\tint n = in.nextInt();\r\n//\t\tSystem.out.println(solve(n,0));\r\n\t\tout.println(solve(n,0));\r\n\t\tout.flush();\r\n\t}", "public static void main(String[] args) {\n System.out.println(Arrays.toString(solution(\"\")));\n System.out.println(Arrays.toString(solution(\"abcdef\")));\n System.out.println(Arrays.toString(solution(\"HelloWorld\")));\n System.out.println(Arrays.toString(solution(\"abcde\")));\n System.out.println(Arrays.toString(solution(\"LovePizza\")));\n\n }", "public static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tBufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n\t\tint t = Integer.parseInt(br.readLine());\n\t\tint a = 0, b = 0;\n\t\tfor (int i = 0; i < t; i++) {\n\t\t\tStringTokenizer st = new StringTokenizer(br.readLine());\n\t\t\ta = Integer.parseInt(st.nextToken());\n\t\t\tb = Integer.parseInt(st.nextToken());\n\t\t\tbw.write(solution(a, b) + \"\\n\");\n\t\t}\n\t\tbw.flush();\n\t\tbw.close();\n\t}", "public static void main(String[] args) {\n Last_coding_exercises.task17();\n\n\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(Arrays.toString(solution(8, 1)));\r\n\t}", "public static void main(String[] args) throws Exception\n\t{\n\t\tBufferedReader br = new BufferedReader(new FileReader(\"input6.txt\"));\n\t\tSystem.setOut(new PrintStream(new File(\"output.txt\")));\n\n\t\tsolve(br);\n\t}", "@Test\n public void test() {\n Solution solution = new Solution();\n\n }", "@Test\n public void test() {\n Solution solution = new Solution();\n\n }", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int[] arr = new int[4];\n for (int i = 0; i < 4; i++)\n arr[i] = sc.nextInt();\n \n Q1 q1 = new Q1();\n int[] answer = q1.solution(arr);\n \n for (int i = 0; i < answer.length; i++) {\n System.out.println(answer[i]);\n }\n }", "public static void main(String[] args) throws Exception {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t//BufferedReader br = new BufferedReader(new FileReader(\"input/vol2/Problem127.in\"));\n\t\tString line = \"\";\n\t\t\n\t\twhile(true) {\n\t\t\tLinkedList<String> strings = new LinkedList<String>();\n\t\t\tLinkedList<Card> deck = new LinkedList<Card>();\n\t\t\tline = br.readLine().trim();\n\t\t\tif(line.equals(\"#\"))\n\t\t\t\tbreak;\n\t\t\tCollections.addAll(strings, line.split(\" \"));\n\t\t\tline = br.readLine().trim();\n\t\t\tCollections.addAll(strings, line.split(\" \"));\n\t\t\tfor(String str : strings) {\n\t\t\t\tdeck.add(new Card(str));\n\t\t\t}\n\t\t\tTableau solution = new Tableau();\n\t\t\tfor(Card c : deck) {\n\t\t\t\t//System.out.print(\"Adding: \" + c + \" \");\n\t\t\t\tsolution.add(c);\n\t\t\t\t//System.out.println(solution);\n\t\t\t\t//solution.debug();\n\t\t\t}\n\t\t\tSystem.out.println(solution);\n\t\t}\n\t\t//System.out.println(\"Runtime: \" + (System.currentTimeMillis() - startTime) + \"ms\");\n\t}", "public void findSolution() {\n\n\t\t// TODO\n\t}", "public void Main(){\n }", "public static void main(String[] args) {\n\n // create initial board from file\n In in = new In(args[0]);\n int N = in.readInt();\n int[][] tiles = new int[N][N];\n for (int i = 0; i < N; i++)\n for (int j = 0; j < N; j++)\n tiles[i][j] = in.readInt();\n Board initial = new Board(tiles);\n\n // check if puzzle is solvable; if so, solve it and output solution\n if (initial.isSolvable()) {\n Solver solver = new Solver(initial);\n StdOut.println(\"Minimum number of moves = \" + solver.moves());\n for (Board board : solver.solution())\n StdOut.println(board);\n }\n\n // if not, report unsolvable\n else {\n StdOut.println(\"Unsolvable puzzle\");\n }\n}", "public static void main(String[] args) throws IOException {\n\t\t// TODO Auto-generated method stub\n\t\tNumberGame ng = new NumberGame();\n\t\tng.solve();\n\t\t//ng.test();\n\t}", "public static void main(String[] args) {\n\r\n\t\t\r\n\t\tTest01 t = new Test01();\r\n\t\t\r\n\t\t//String st = \"1927\";\r\n\t\t//int in\t= 2;\t// n 개 제거\r\n\r\n\t\tString st = \"1231234\";\r\n\t\tint in\t= 3;\t\r\n\t\t\r\n\t\tString an = t.solution(st, in);\r\n\t\t\r\n\t\tSystem.out.println(an);\r\n\t}", "private void testSolution(String input, String output) {\n runs++;\n\n // Load the problem & solution\n ProblemSpec problemSpec = Solution.loadProblem(input);\n Solution solution = new Solution(problemSpec);\n\n // Solve and time the solution\n long startTime = System.currentTimeMillis();\n List<State> states = solution.solve();\n long endTime = System.currentTimeMillis();\n durations.put(input, endTime - startTime);\n\n // Output the solution\n Solution.writeSolution(Formatter.format(states), output);\n\n problemSpec = Solution.loadProblem(input, output);\n if (solutionPasses(problemSpec)) {\n passes++;\n }\n\n successes++;\n }", "public static void main(String[] args) throws IOException {\n// new Homework01();\n new Homework02();\n }", "void run() throws IOException {\n\r\n\t\treader = new BufferedReader(new FileReader(\"input.txt\"));\r\n\r\n\t\tout = new PrintWriter(new FileWriter(\"output.txt\"));\r\n\t\ttokenizer = null;\r\n\t\tsolve();\r\n\t\treader.close();\r\n\t\tout.flush();\r\n\r\n\t}", "public static void main(String[] args) {\n InputData inputData = new InputData();\n FindNumberOfSteps findNumberOfSteps = new FindNumberOfSteps();\n PrintResult printResult = new PrintResult();\n printResult.print(findNumberOfSteps.find(inputData.input()));\n }", "public static void main(String[] args) throws IOException {\n\r\n \r\n \r\n }", "public static void main(String[] args) throws IOException {\n\t\t\t\r\n\t\t\tint [] numReps= {3,1,2,2,2};\r\n\t\t\tMathModelClass.solveMe(85, 5, 2,numReps, 1);\r\n\t\r\n\t\t}", "public static void main(String[] args) {\n\t\tString filename = \"src/y20161B/B-small-practice\";\n\t\t//String filename = \"src/y20161B/B-large-practice\";\n\n\t\tFileInputStream file;\n\t\tint T;\n\n\t\ttry {\n\t\t\tfile = new FileInputStream(filename+\".in\");\n\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(file));\n\n\t\t\tT = Integer.parseInt(in.readLine());\n\n\t\t\tBufferedWriter bw = new BufferedWriter(new FileWriter(filename+\".out\"));\n\n\t\t\tfor (int i=0; i<T; i++) {\n\t\t\t\tint ind = i+1;\n\t\t\t\t// parser\n\t\t\t\tString buff[] = in.readLine().split(\" \");\n\t\t\t\tString C = buff[0];\n\t\t\t\tString J = buff[1];\n\t\t\t\t\n\t\t\t\t// calcul\n\t\t\t\tString res = solve(C, J);\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"Result \"+i+\": \"+res);\n\t\t\t\tbw.write(\"Case #\"+ind+\": \"+res+\"\\n\");\n\t\t\t}\n\t\t\tbw.close();\n\n\t\t\tin.close();\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tint [] arr = {4,2,3,5};\r\n\t\tint [] answer = solution(arr);\r\n\t\tfor(int i=0;i<answer.length;i++)\r\n\t\t\tSystem.out.print(answer[i]+\" \");\r\n\t}", "public static void main(String[] args) throws FileNotFoundException, IOException{\n InputStream inputStream = new FileInputStream(new File(\"./src/B-large.in\"));\n OutputStream outputStream = new FileOutputStream(new File(\"./src/B-large.out\"));\n InputReaderRevengePancakes in = new InputReaderRevengePancakes(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n TaskRevengePancakes solver = new TaskRevengePancakes();\n solver.solve(1, in, out);\n out.close();\n }", "public static void main(String[] args) throws IOException {\n br = new BufferedReader(new FileReader(\"input.txt\"));\r\n\r\n int T = nextInt();\r\n for (int t = 1; t <= T; t++) {\r\n nextInt();\r\n int X = nextInt();\r\n String lString = nextToken();\r\n\r\n StringBuilder s = new StringBuilder();\r\n for (; X > 0; X--) s.append(lString);\r\n char[] arr = s.toString().toCharArray();\r\n String soln = solve(arr) ? \"YES\" : \"NO\";\r\n\r\n System.out.printf(\"Case #%d: %s%n\", t, soln);\r\n }\r\n }", "public static void main(String[] args) throws Exception\n\t{\n\t\tBufferedReader br = new BufferedReader(new FileReader(\"input6.txt\"));\tSystem.setOut(new PrintStream(new File(\"output.txt\")));\n\t\t\n\t\tint t = Integer.parseInt(br.readLine());\n\t\tfor(int i = 1; i <= t; i++)\n\t\t\tSystem.out.println(\"Case #\"+i+\": \"+solve(br));\n\t}", "public static void main(String[] args) {\r\n\t\tint N=1;\r\n\t\tint[][] trust = {};\r\n\t\tSolution sol = new Solution();\r\n\t\tSystem.out.println(sol.findJudge(N, trust));\r\n\t}", "public static void main(String[] args) \n\t{\n\t\tinitialize(\"\");\n\t\t\n\t\t//making instance from file name\n\n\t\tString str = \"A-n32-k5.vrp\";\n\t\tString fileName = \"input//\" + str;\n\t\t\n\t\t\n\t\tInstance problem = new VRPInstance(fileName);\n\t\tSystem.out.println(problem.comment);\n\t\t//solve problem\n\n\t\t//Solver solver2 = new SimpleGreedySolver(problem);\n\t\t//Solver solver2 = new NearestNeighborGreedySolver(problem);\n\t\t//Solver solver = new ClarkeWrightGreedySolver(problem);\n\t\t//Solver solver = new EHSBASolver(problem);\n\t\t//solver2.solve();\n\t\t//solver2.printResult();\n\t\t\n\t\t//solver = new ClarkeWrightGreedySolver(problem);\n\t\tSolver solver3 = new EHSBASolver(problem);\n\t\tsolver3.solve();\n\t\tsolver3.printResult();\n\t\t\n\t\tSystem.out.println(\"finished.\");\n\t\t\n\t\t\n\t\t/*File folder = new File(\"input\");\n\t\tFile[] listOfFiles = folder.listFiles();\n\t\t\n\t\tfor(int i = 0; i < listOfFiles.length; i++)\n\t\t{\n\t\t\n\t\t\tString str = listOfFiles[i].getName();\n\t\t\tSystem.out.println(str);\n\t\t\tif(listOfFiles[i].isFile() && str.substring(0, 1).equalsIgnoreCase(\"A\"))\n\t\t\t\tfileName = \"input\\\\\" + str;\n\t\t\telse\n\t\t\t\tcontinue;\n\n\t\t\t//fileName = \"input\\\\\" + fileName;\n\t\t\tInstance problem = new VRPInstance(fileName);\n\t\t\tSystem.out.println(problem.comment);\n\t\t\t//solve problem\n\t\n\t\t\t//Solver solver = new SimpleGreedySolver(problem);\n\t\t\t//Solver solver = new NearestNeighborGreedySolver(problem);\n\t\t\tSolver solver = new ClarkeWrightGreedySolver(problem);\n\t\t\t//Solver solver = new EHSBASolver(problem);\n\t\t\tsolver.solve();\n\t\t\tsolver.printResult();\t\n\n\t\t}*/\n\n\t\t\n\t}", "public static void main(String[] args) {\n In in = new In(args[0]);\n int n = in.readInt();\n int[][] blocks = new int[n][n];\n for (int i = 0; i < n; i++)\n for (int j = 0; j < n; j++)\n blocks[i][j] = in.readInt();\n\n Board initial = new Board(blocks);\n\n // solve the puzzle\n Solver solver = new Solver(initial);\n\n // print solution to standard output\n if (!solver.isSolvable())\n StdOut.println(\"No solution possible\");\n else {\n StdOut.println(\"Minimum number of moves = \" + solver.moves());\n for (Board board : solver.solution())\n StdOut.println(board);\n }\n }", "public static void main(String[] args) {\n In in = new In(args[0]);\n int n = in.readInt();\n int[][] blocks = new int[n][n];\n for (int i = 0; i < n; i++)\n for (int j = 0; j < n; j++)\n blocks[i][j] = in.readInt();\n Board initial = new Board(blocks);\n\n // solve the puzzle\n Solver solver = new Solver(initial);\n\n // print solution to standard output\n if (!solver.isSolvable())\n StdOut.println(\"No solution possible\");\n else {\n StdOut.println(\"Minimum number of moves = \" + solver.moves());\n for (Board board : solver.solution())\n StdOut.println(board);\n }\n }", "public static void main(String[] args) {\n int[] arr = {10, 2, 5, 1, 8, 12};\n System.out.println(solution(arr));\n }", "public static void main(String[] args) {\n /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */\n Scanner sc = new Scanner(System.in);\n int cases = sc.nextInt();\n for(int i=0;i<cases;i++){\n \tString[] strArray = sc.next().split(\"\");\n\n \tString odd = \"\";\n \tString even = \"\";\n \t\n \tfor(int j=1;j<strArray.length;j++){\n \t\tif(j%2==0){\n\t\t\t\t\teven += strArray[j];\n \t\t}else{\n \t\t\todd += strArray[j];\n \t\t}\n \t\t\n \t}\n \t\n \tSystem.out.println(odd + \" \" + even);\n }\n }", "public void main(){\n }", "public static void main(String[] args) {\n\n\t\tsolution();\n\n\t\t// int maxDivisor = Divided.getMaxDivisor(1, 3);\n\t\t// System.out.println(\"maxDivisor:\" + maxDivisor);\n\n\t}", "public static void main() {\n \n }", "public static void main(String[] args){\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n }", "public static void main(String[] args) {\n\r\n\t\tSystem.out.println(solution(\"ACACACA\"));\r\n\t}", "public static void main(String[] args) {\n\t\tint A[]={2,1,0,0,0};\r\n\t\tSystem.out.println(solution(A));\r\n\r\n\t}", "public static void main(String[] args) {\n\t\tint A[] = new int[5];\n\t\tA[0]=3;\n\t\tA[1]=1;\n\t\tA[2]=2;\n\t\tA[3]=4;\n\t\tA[4]=3;\n\t\tSolution s = new Solution();\n\t\tSystem.out.println(s.solution(A));\n\t}", "public static void main(String args[]) {\n\n\t\tFlowers example = new Flowers();\n\t\t\n\t\texample.model();\n\n\t\tif (example.search())\n\t\t\tSystem.out.println(\"Solution(s) found\");\n\t\t\n\t}", "public static void main(String[] args) {\n String str = \"The one-hour drama series Westworld is a dark odyssey about the dawn of artificial consciousness and the evolution of sin. Set at the intersection of the near future and the reimagined past, it explores a world in which every human appetite, no matter how noble or depraved, can be indulged.\";\n\n System.out.println(solution1(str));\n }", "public static void main(String[] args) {\n\t\tint[] number = new int[] {1, 1, 1, 1, 1};\n\t\tint target = 3;\n\t\t\n\t\tSolution s = new Solution();\n\t\tint result = s.solution(number, target);\n\t\tSystem.out.println(result);\n\t}", "@Test\n public void testSolution() {\n assertSolution(\"425\", \"input-day01-2018.txt\");\n }", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tArrayList<Integer> arr = new ArrayList<>();\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tarr.add(sc.nextInt());\n\t\t}\n\t\tint k = sc.nextInt();\n\t\tSolution sol = new Solution();\n\t\tSystem.out.println(sol.solve(arr, k));\n\t\tsc.close();\n\t}", "public static void main(String[] args) {\n\t\tint arr[] = {9,3,9,3,9,7,9};\n\t\tSolution(arr);\n\t}", "public Main() {\n }", "public Main() {\n }", "public static void main(String[] args) { \n \n //read in filename from user\n String filenameInput = args[0];\n \n //create new maze/graph\n Maze newMaze = new Maze(filenameInput);\n \n //call toString\n //String stringMaze = newMaze.toString();\n \n //print the string maze\n //System.out.println(stringMaze);\n \n //call findPath\n //System.out.println(newMaze.findPath());\n \n for (Vertex v : newMaze.findPath()) System.out.print(v.getName());\n \n //print solution?\n //System.out.println(newMaze.solution);\n \n \n }", "public static void main(String[] args) {\n String name = \"ABAAABB\";\n\n System.out.println(solution(name));\n }", "public static void main(String[] args) {\n\t\tint[] A = {51,31,43};\n\t\tSystem.out.println(solution(A));\n\n\t}", "public static void main (String[] args) {\n Scanner s = new Scanner(System.in);\r\n System.out.print(BinaryReversalMethod(s.nextLine()));\r\n s.close();\r\n }", "public static void main(String[] args) // solve a slider puzzle (given below)\n {\n In in = new In(args[0]);\n int N = in.readInt();\n int[][] blocks = new int[N][N];\n for (int i = 0; i < N; i++)\n for (int j = 0; j < N; j++)\n blocks[i][j] = in.readInt();\n Board initial = new Board(blocks);\n\n // solve the puzzle\n Solver solver = new Solver(initial);\n\n // print solution to standard output\n if (!solver.isSolvable())\n StdOut.println(\"No solution possible\");\n else {\n StdOut.println(\"Minimum number of moves = \" + solver.moves());\n for (Board board : solver.solution())\n StdOut.println(board);\n \n \t\n }\n}", "public Main() {\n \n \n }", "public Main() {\n }", "public static void main()\n\t{\n\t}", "public static void main(String[] args) throws IOException {\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tStringTokenizer st = new StringTokenizer(br.readLine().trim());\n\t\tint tc = Integer.parseInt(st.nextToken());\n\t\tfor (int i = 0; i < tc; i++) {\n\t\t\tst = new StringTokenizer(br.readLine().trim());\n\t\t\tint x = Integer.parseInt(st.nextToken());\n\t\t\tint y = Integer.parseInt(st.nextToken());\n\t\t\tsolve(y - x);\n\t\t}\n\t}", "public static void main(String[] args) throws FileNotFoundException {\n Scanner scanner = new Scanner(new FileInputStream(\"/Users/guoziren/IdeaProjects/剑指offer for Java/src/main/java/com/ustc/leetcode/algorithmidea/dynamicprogramming/input.txt\"));\n }", "public interface SASolution extends Solution {\r\n\r\n /**\r\n * Generates a neighbor solution using this solution\r\n *\r\n * @return\r\n */\r\n public SASolution getNeighborSolution();\r\n\r\n /**\r\n * Prints this solution\r\n *\r\n * @return\r\n */\r\n public String getAsString();\r\n\r\n}", "public static void main(String[] args) throws IOException {\n\r\n }", "public Main() {\r\n }", "public Main() {\r\n }", "public static void main(String[] args) {\n int lineSize = Integer.parseInt(args[0]);\n String[] input = getInput(args);\n\n WordWrap ww = new WordWrap(lineSize, input);\n Long start = System.currentTimeMillis();\n Integer[] lines = ww.solve();\n Long end = System.currentTimeMillis();\n\n System.out.println(\"solved in \"+((end-start)/1000.0) +\" seconds\");\n printResult(lines, input);\n }", "public static void main(String[] args) {\n System.out.println(solution(new int[]{3,1,2,4,3}));\n }", "public static void main(String[] args) {\n\t\tnew Challenge09();\r\n\t}", "public static void main(String[] args){\n Solution solution = new Solution();\n System.out.println(solution.convertToTitle(27));\n }", "public static void main(String[] args) {\n In in = new In(args[0]);\n int n = in.readInt();\n int[][] tiles = new int[n][n];\n for (int i = 0; i < n; i++)\n for (int j = 0; j < n; j++)\n tiles[i][j] = in.readInt();\n Board initial = new Board(tiles);\n\n // Solve the puzzle\n Solver solver = new Solver(initial);\n\n // Print solution to standard output\n if (!solver.isSolvable())\n StdOut.println(\" No solution possible \");\n else {\n StdOut.println(\" Minimum number of moves = \" + solver.moves());\n for (Board solutionboard : solver.solution())\n StdOut.println(solutionboard);\n }\n\n }", "public static void main(String[] args) {\n\t\tSolution s = new Solution();\n\t\tint[] nums = {4,5,6,7,0,1,2};\n\t\tSystem.out.println(s.search(nums, 0));\n\t}", "public Main() {}", "public static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tArrayList<String> problems = new ArrayList<>();\n\t\t\n\t\t\n\t\tint noOfInputs = Integer.parseInt(in.nextLine());\n\t\t\n\t\tfor(int x=0; x<noOfInputs; x++) {\n\t\t\tproblems.add(in.nextLine());\n\t\t}\n\t\tin.close();\n\t\t\n\t\tfor(String p : problems) {\n\t\t\tint no = getFibonacciIndex(p);\n\t\t\t//System.out.print( no + \"\\n\\t\" + p + \"\\n\\t\" + getFib(no) + \"\\n\" );\n\t\t\tSystem.out.print(no + \" \");\n\t\t}\n\t\tSystem.out.println(\"\");\n\n\t}", "public static void main(String[] args) {\n\t\tMain m=new Main();\n\t\tSystem.out.println(m.solve(\"abcd\"));\n\t}" ]
[ "0.75280106", "0.7303422", "0.72608393", "0.72363067", "0.7178064", "0.71745384", "0.7022264", "0.7022264", "0.68939406", "0.68699366", "0.6857948", "0.68238825", "0.68213546", "0.6809923", "0.6807801", "0.6805596", "0.6782698", "0.6770123", "0.6755418", "0.6753114", "0.6750817", "0.67347395", "0.6717301", "0.6706645", "0.6694287", "0.6651606", "0.66501707", "0.66278076", "0.66235226", "0.6621958", "0.6615442", "0.66057396", "0.6602287", "0.6585006", "0.6520085", "0.65010077", "0.64946944", "0.64697295", "0.64697295", "0.64609826", "0.64557177", "0.64406085", "0.6415948", "0.639306", "0.63843274", "0.6365387", "0.63447833", "0.6341386", "0.63392", "0.63311493", "0.6330592", "0.6325357", "0.6314658", "0.6309571", "0.6297083", "0.6268973", "0.626577", "0.6256522", "0.62489575", "0.6241918", "0.6230459", "0.62300694", "0.6229653", "0.62219816", "0.6215901", "0.6212836", "0.6203505", "0.62006277", "0.61977464", "0.6193003", "0.6185834", "0.6180364", "0.6169907", "0.6166941", "0.61659384", "0.61613095", "0.616109", "0.616109", "0.61588854", "0.61587274", "0.6158015", "0.6150775", "0.6149509", "0.61487585", "0.6148447", "0.6145762", "0.6139585", "0.6137239", "0.61351067", "0.6133941", "0.6132761", "0.6132761", "0.61272985", "0.61250347", "0.6116417", "0.61012554", "0.60979575", "0.6090302", "0.6087521", "0.6086861", "0.6086469" ]
0.0
-1
The method that loads json from a file and creates an object with books
public static Books readJSON(){ Gson gson = new GsonBuilder().create(); Books books = new Books(); try { books = gson.fromJson(new JsonReader(new FileReader("books.json")), Books.class); } catch (IOException e){ e.printStackTrace(); } return books; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 }", "private ArrayList<Book> loadBooks(InputStream is) throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(is));\r\n\t\tStringBuilder jsonFileContent = new StringBuilder();\r\n\t\t//read line by line from file\r\n\t\tString nextLine = null;\r\n\t\twhile ((nextLine = br.readLine()) != null){\r\n\t\t\tjsonFileContent.append(nextLine);\r\n\t\t}\r\n\r\n\t\tGson gson = new Gson();\r\n\t\t//this is a require type definition by the Gson utility so Gson will \r\n\t\t//understand what kind of object representation should the json file match\r\n\t\tType type = new TypeToken<ArrayList<Book>>(){}.getType();\r\n\t\tArrayList<Book> books = gson.fromJson(jsonFileContent.toString(), type);\r\n\t\t//close\r\n\t\tbr.close();\t\r\n\t\treturn books;\r\n\t}", "public static void takeBook(Book book){\r\n try {\r\n jsonWriter(removeObject(objectToArray(fileReader(\"libreria.json\")),book));\r\n } catch (Exception e) {\r\n System.out.println(\"Error, no fue posible sobreescribir el archivo\");\r\n }\r\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 }", "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 }", "public static void putBook(Book book){\r\n try {\r\n jsonWriter(addObject(objectToArray(fileReader(\"libreria.json\")),book));\r\n } catch (Exception e) {\r\n System.out.println(\"Error, no fue posible sobreescribir el archivo\");\r\n }\r\n }", "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 }", "private ArrayList<BookOfUser> loadBooksOfUser(InputStream is) throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(is));\r\n\t\tStringBuilder jsonFileContent = new StringBuilder();\r\n\t\t//read line by line from file\r\n\t\tString nextLine = null;\r\n\t\twhile ((nextLine = br.readLine()) != null){\r\n\t\t\tjsonFileContent.append(nextLine);\r\n\t\t}\r\n\r\n\t\tGson gson = new Gson();\r\n\t\t//this is a require type definition by the Gson utility so Gson will \r\n\t\t//understand what kind of object representation should the json file match\r\n\t\tType type = new TypeToken<ArrayList<BookOfUser>>(){}.getType();\r\n\t\tArrayList<BookOfUser> bookOfUser = gson.fromJson(jsonFileContent.toString(), type);\r\n\t\t//close\r\n\t\tbr.close();\t\r\n\t\treturn bookOfUser;\r\n\t}", "public void load(){\n // Recover docIDs\n try(Reader reader = new FileReader(\"postings/docIDs.json\")){\n this.docIDs = (new Gson()).fromJson(reader,\n new TypeToken<Map<String, String>>(){}.getType());\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n try(Reader reader = new FileReader(\"postings/docLengths.json\")){\n this.docLengths = (new Gson()).fromJson(reader,\n new TypeToken<Map<String, Integer>>(){}.getType());\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n try(Reader reader = new FileReader(\"postings/titleToNumber.json\")){\n this.titleToNumber = (new Gson()).fromJson(reader,\n new TypeToken<Map<String, Integer>>(){}.getType());\n } catch (IOException e) {\n e.printStackTrace();\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 }", "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 }", "public void loadBooks() {\n\t\ttry {\n\t\t\tScanner load = new Scanner(new File(FILEPATH));\n\t\t\tSystem.out.println(\"Worked\");\n\n\t\t\twhile (load.hasNext()) {\n\t\t\t\tString[] entry = load.nextLine().split(\";\");\n\n\t\t\t\t// checks the type of book\n\t\t\t\tint type = bookType(entry[0]);\n\n\t\t\t\t// creates the appropriate book\n\t\t\t\tswitch (type) {\n\t\t\t\tcase 0:\n\t\t\t\t\tcreateChildrensBook(entry); // creates a Childrensbook and adds it to the array\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tcreateCookBook(entry);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tcreatePaperbackBook(entry);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tcreatePeriodical(entry);\n\t\t\t\t\tbreak;\n\t\t\t\tcase -1:\n\t\t\t\t\tSystem.out.println(\"No book created\");\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tSystem.out.println(\"Error\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tload.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"Did not read in file properly, restart the program, and check filepath of books.txt.\");\n\t\t}\n\t}", "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 }", "protected Book load(JSONObject from) throws JSONException {\n return null;\n }", "private void inflateFromFile() {\n\t\t\n\t\tFile file = null;\t\t\n\t\ttry {\n\t\t\tfile = new File(FILE_PATH);\n\t\t} catch (NullPointerException e) {\n\t\t\tSystem.exit(1);\n\t\t}\n\t\t\n\t\tFileReader reader = null;\t\t\n\t\ttry {\n\t\t\treader = new FileReader(file);\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"Can't find source (json file)\");\n\t\t\tSystem.err.println(e.getMessage());\n\t\t\tSystem.exit(1);\n\t\t\t\n\t\t}\n\t\t\n\t\tJSONObject jsonObject = new JSONObject(\n\t\t\t\tnew JSONTokener(reader)\n\t\t\t\t);\n\t\t\n\t\tJSONArray array = jsonObject.getJSONArray(\"students\");\n\t\t\n\t\tfor (int i = 0; i < array.length(); i++) {\t\t\t\n\t\t\tJSONObject student = array.getJSONObject(i);\t\t\t\n\t\t\tString name = student.getString(\"name\");\n\t\t\tString secondName = student.getString(\"secondName\");\n\t\t\tString surname = student.getString(\"surname\");\n\t\t\tString birthday = student.getString(\"birthday\");\n\t\t\tString facultet = student.getString(\"facultet\");\n\t\t\tint groupNumber = student.getInt(\"groupNumber\");\n\t\t\t\n\t\t\tDate dateBirthday = null; \n\t\t\t//делаем Date из строки\t\t\t\n\t\t\ttry {\n\t\t\t\tdateBirthday = new SimpleDateFormat(\"dd.MM.yyyy\").parse(birthday);\n\t\t\t} catch(ParseException e) {\n\t\t\t\tSystem.err.println(\"Can't understand the date format from source.\");\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\tstudents.add(\n\t\t\t\t\tStudent.get(name, secondName, surname, dateBirthday, facultet, groupNumber)\n\t\t\t\t\t);\t\t\t\n\t\t}\t\t\t\n\t}", "public void loadBook() {\n List<Book> books = new ArrayList<>();\n for (int i = 0; i < 5; i++) {\n Book book = new Book(\"Book-\" + i, \"Test book \" + i);\n books.add(book);\n }\n this.setBooks(books);\n }", "public Book readBookFile()\n {\n\n String name=\"\";\n String author ;\n ArrayList<String> genre = new ArrayList<String>();\n float price=0;\n String bookId;\n String fields2[];\n String line;\n\n line = bookFile.getNextLine();\n if(line==null)\n {\n return null;\n }\n String fields[] = line.split(\" by \");\n if(fields.length>2)\n {\n int i=0;\n while (i<fields.length-1)\n {\n name+=fields[i];\n if(i<fields.length-2)\n {\n name+= \" by \";\n }\n i++;\n }\n fields2 = fields[fields.length-1].split(\"%\");\n }\n else\n {\n name = fields[0];\n fields2 = fields[1].split(\"%\");\n }\n\n author = fields2[0];\n price=Float.parseFloat(fields2[1]);\n bookId=fields2[2];\n genre.add(fields2[3]);\n genre.add(fields2[4]);\n return new Book(name,genre,author,price,bookId);\n\n\n }", "private void readFromJSON(String filename) {\n JSONParser parser = new JSONParser();\n\n try\n {\n Object obj = parser.parse(new FileReader(filename));\n JSONObject jsonObject = (JSONObject) obj;\n Menu drinks = getMenu(jsonObject, \"Drink\");\n Menu types = getMenu(jsonObject, \"Type\");\n Menu toppings = getMenu(jsonObject, \"Toppings\");\n Menu sizes = getMenu(jsonObject, \"Size\");\n menuMap.put(\"Drink\", drinks);\n menuMap.put(\"Size\", sizes);\n menuMap.put(\"Toppings\", toppings);\n menuMap.put(\"Type\", types);\n\n } catch (FileNotFoundException e) {\n System.out.println(\"Not found menu.json, exit now.\");\n System.exit(1);\n } catch (IOException e) {\n e.printStackTrace();\n } catch (ParseException e) {\n e.printStackTrace();\n }\n\n }", "public BookList(String filename) throws IOException {\r\n bookList = new ArrayList<Book>();\r\n //use Chapter 5 in the book to create a File object and then a Scanner object with the File object.\r\n //Check if the file exists, if not, post a message to the console output.\r\n //Loop through the lines in the file and use a StringTokenizer (chapter 8) to tokenize the string on the comma.\r\n //Create a Book object with the title and price as parameters and add that Book object to the bookList attribute\r\n //in this class\r\n File file = new File(filename);\r\n if (file.exists()){\r\n Scanner fileScan = new Scanner(file);\r\n while(fileScan.hasNext()){\r\n StringTokenizer strTok = new StringTokenizer(fileScan.nextLine(), \",\");\r\n Book book = new Book(strTok.nextToken().trim(), Double.parseDouble(strTok.nextToken().trim()));\r\n bookList.add(book);\r\n }\r\n }else{\r\n System.out.println(\"File not found: \" + filename);\r\n }\r\n\r\n\r\n }", "public static void initialize() {\r\n\t\tjson = new JSONFile(filePath);\t\r\n\t}", "public void init() {\n\n mJokes = new ArrayList<>();\n\n StringBuilder sBuilder = new StringBuilder();\n\n try {\n\n InputStream in = getClass().getResourceAsStream(\"/jokes.json\");\n BufferedReader reader = new BufferedReader(new InputStreamReader(in));\n\n String mLine = reader.readLine();\n while (mLine != null) {\n //process line\n sBuilder.append(mLine);\n mLine = reader.readLine();\n }\n\n reader.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n\n String jsonString = sBuilder.toString();\n\n if( jsonString != null ){\n\n JsonParser parser = new JsonParser();\n JsonObject jsonObject = parser.parse(jsonString).getAsJsonObject();\n\n JsonArray jokesArray = jsonObject.getAsJsonArray(\"jokes\");\n\n for (JsonElement element : jokesArray) {\n String joke = element.getAsJsonObject().get(\"joke\").getAsString();\n mJokes.add(joke);\n }\n }\n\n }", "public Book serializeToBook (JSONObject jsonObject, int ID) {\n try{\n if(ID >= 0){\n String title = jsonObject.getString(\"Title\");\n String genre = jsonObject.getString(\"Genre\");\n String format = jsonObject.getString(\"Format\");\n int year = Integer.parseInt(jsonObject.getString(\"Year\"));\n String authorsLine = jsonObject.getString(\"Authors\");\n String[] authors = authorsLine.split(\",\");\n String publisher = jsonObject.getString(\"Publisher\");\n String isbn = jsonObject.getString(\"ISBN\");\n return new Book(ID, title, genre, format, year, authors, publisher, isbn);\n } else {\n throw new IllegalArgumentException(\"ID must be positive.\");\n }\n } catch(JSONException e){\n throw new JSONException(\"JSON is incorrect\");\n }\n }", "private static boolean loadBooks() throws IOException{\n\t\tBufferedReader reader = new BufferedReader(new FileReader(BOOKS_FILE));\n\t\tboolean error_loading = false; //stores whether there was an error loading a book\n\t\t\n\t\tString line = reader.readLine(); //read the properties of a book in the books.txt file\n\t\t/*read books.txt file, set the input for each BookDetails object and add each BookDetails object to the ALL_BOOKS Hashtable*/\n\t\twhile(line != null){\n\t\t\tBookDetails book = new BookDetails();\n\t\t\tString[] details = line.split(\"\\t\"); //the properties of each BookDetails object are separated by tab spaces in the books.txt file\n\t\t\tfor(int i = 0; i < details.length; i ++){\n\t\t\t\tif(!setBookInput(i, details[i], book)){ //checks if there was an error in setting the BookDetails object's properties with the values in the books.txt file\n\t\t\t\t\tSystem.out.println(\"ERROR Loading Books\");\n\t\t\t\t\terror_loading = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(error_loading) //if there was an error loading a book then stop the process of loading books\n\t\t\t\tbreak;\n\t\t\tALL_BOOKS.put(book.getBookId(), book); //add BookDetails object to ALL_BOOKS\n\t\t\taddToPublisherTable(book.getPublisher(), book.getBookTitle()); //add book's title to the ALL_PUBLISHERS Hashtable\n\t\t\taddToGenreTable(book, book.getBookTitle()); //add book's title to the ALL_GENRES ArrayList\n\t\t\taddToAuthorTable(book.getAuthor().toString(), book.getBookTitle()); //add book's title to the ALL_AUTHORS Hashtable\n\t\t\tline = reader.readLine(); \n\t\t}\n\t\treader.close();\n\t\t\n\t\tif(!error_loading){\n\t\t\tSystem.out.println(\"Loading Books - Complete!\");\n\t\t\treturn true;\n\t\t}\n\t\treturn false; //error encountered while loading books\n\t}", "private ArrayList<BookLikedByUser> loadBooksLikedByUser(InputStream is) throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(is));\r\n\t\tStringBuilder jsonFileContent = new StringBuilder();\r\n\t\t//read line by line from file\r\n\t\tString nextLine = null;\r\n\t\twhile ((nextLine = br.readLine()) != null){\r\n\t\t\tjsonFileContent.append(nextLine);\r\n\t\t}\r\n\r\n\t\tGson gson = new Gson();\r\n\t\t//this is a require type definition by the Gson utility so Gson will \r\n\t\t//understand what kind of object representation should the json file match\r\n\t\tType type = new TypeToken<ArrayList<BookLikedByUser>>(){}.getType();\r\n\t\tArrayList<BookLikedByUser> bookLikedByUser = gson.fromJson(jsonFileContent.toString(), type);\r\n\t\t//close\r\n\t\tbr.close();\t\r\n\t\treturn bookLikedByUser;\r\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 void initiateStore() {\r\n\t\tURLConnection urlConnection = null;\r\n\t\tBufferedReader in = null;\r\n\t\tURL dataUrl = null;\r\n\t\ttry {\r\n\t\t\tdataUrl = new URL(URL_STRING);\r\n\t\t\turlConnection = dataUrl.openConnection();\r\n\t\t\tin = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));\r\n\t\t\tString inputLine;\r\n\t\t\twhile ((inputLine = in.readLine()) != null) {\r\n\t\t\t\tString[] splittedLine = inputLine.split(\";\");\r\n\t\t\t\t// an array of 4 elements, the fourth element\r\n\t\t\t\t// the first three elements are the properties of the book.\r\n\t\t\t\t// last element is the quantity.\r\n\t\t\t\tBook book = new Book();\r\n\t\t\t\tbook.setTitle(splittedLine[0]);\r\n\t\t\t\tbook.setAuthor(splittedLine[1]);\r\n\t\t\t\tBigDecimal decimalPrice = new BigDecimal(splittedLine[2].replaceAll(\",\", \"\"));\r\n\t\t\t\tbook.setPrice(decimalPrice);\r\n\t\t\t\tfor(int i=0; i<Integer.parseInt(splittedLine[3]); i++)\r\n\t\t\t\t\tthis.addBook(book);\r\n\t\t\t}\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tif(!in.equals(null)) in.close();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public 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 void loadBooks(){\n\t\tSystem.out.println(\"\\n\\tLoading books from CSV file\");\n\t\ttry{\n\t\t\tint iD=0, x;\n\t\t\tString current = null;\n\t\t\tRandom r = new Random();\n\t\t\tBufferedReader br = new BufferedReader(new FileReader(\"../bin/books.csv\"));\n\t\t\twhile((current = br.readLine()) != null){\n\t\t\t\tString[] data = current.split(\",\");\n\t\t\t\tx = r.nextInt(6) + 15;\n\t\t\t\tfor(int i =0;i<x;i++){\n\t\t\t\t\tBook b= new Book(Integer.toHexString(iD), data[0], data[1], data[2], data[3]);\n\t\t\t\t\tif(bookMap.containsKey(data[0]) != true){\n\t\t\t\t\t\tbookMap.put(data[0], new ArrayList<Book>());\n\t\t\t\t\t}\t\n\t\t\t\t\t\t\n\t\t\t\t\tbookMap.get(data[0]).add(b);\n\t\t\t\t\tiD += 1;\n\t\t\t\t}\t\n\t\t\t}\t\t\t\n\t\t\tbr.close();\n\t\t\tSystem.out.println(\"\\tBooks Added!\");\n\t\t}catch(FileNotFoundException e){\n\t\t\tSystem.out.println(\"\\tFile not found\");\n\t\t}catch(IOException e){\n System.out.println(e.toString());\n }\n\t}", "public static Quote[] readFromJson(String filename) throws IOException {\n File file = new File(filename);\n file.createNewFile();\n Gson read = new Gson();\n InputStream inStream = new FileInputStream(filename);\n BufferedReader buffer = new BufferedReader(new InputStreamReader(inStream));\n Quote[] quotes = read.fromJson(buffer, Quote[].class);\n buffer.close();\n return quotes;\n }", "public JsonReader(String file) {\n this.file = file;\n }", "@Override\n public void fromFile(final String file) {\n // Model会关心文件路径,所以这里需要这个操作\n this.jsonFile = file;\n final JsonObject data = Ut.ioJObject(this.jsonFile);\n this.fromJson(data);\n }", "void loadFromFile() {\n\t\ttry {\n\t\t\tFile directory = GameApplication.getInstance().getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS);\n\t\t\tFile source = new File(directory, FILE_NAME);\n\t\t\tMap<String, Scoreboard> scoreboards = new HashMap<String, Scoreboard>();\n\t\t\tif (source.exists()) {\n\t\t\t\tJsonReader reader = new JsonReader(new FileReader(source));\n\t\t\t\treader.beginArray();\n\t\t\t\twhile (reader.hasNext()) {\n\t\t\t\t\tScoreboard scoreboard = readScoreboard(reader);\n\t\t\t\t\tscoreboards.put(scoreboard.getName(), scoreboard);\n\t\t\t\t}\n\t\t\t\treader.endArray();\n\t\t\t\treader.close();\n\t\t\t} else {\n\t\t\t\tsource.createNewFile();\n\t\t\t}\n\t\t\tthis.scoreboards = scoreboards;\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private 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 }", "public static void load(){\n StringBuilder maleNamesString = new StringBuilder();\n try (Scanner maleNamesFile = new Scanner(mnames)){\n while (maleNamesFile.hasNext()) {\n maleNamesString.append(maleNamesFile.next());\n }\n }\n catch(FileNotFoundException e){\n e.printStackTrace();\n return;\n }\n\n //Create a string from the fnames.json file\n StringBuilder femaleNamesString = new StringBuilder();\n try (Scanner femaleNamesFile = new Scanner(fnames)){\n while (femaleNamesFile.hasNext()) {\n femaleNamesString.append(femaleNamesFile.next());\n }\n }\n catch(FileNotFoundException e){\n e.printStackTrace();\n return;\n }\n\n //Create a string from the snames.json file\n StringBuilder surNamesString = new StringBuilder();\n try (Scanner surNamesFile = new Scanner(snames)){\n while (surNamesFile.hasNext()) {\n surNamesString.append(surNamesFile.next());\n }\n\n }\n catch(FileNotFoundException e){\n e.printStackTrace();\n return;\n }\n\n //Create a string from the locations.json file\n StringBuilder locationsString = new StringBuilder();\n try (Scanner locationsFile = new Scanner(locationsJson)){\n while (locationsFile.hasNext()) {\n locationsString.append(locationsFile.next());\n }\n\n }\n catch(FileNotFoundException e){\n e.printStackTrace();\n return;\n }\n\n maleNames = (Names)convertJsonToObject(maleNamesString.toString(), new Names());\n\n femaleNames = (Names)convertJsonToObject(femaleNamesString.toString(), new Names());\n\n surNames = (Names)convertJsonToObject(surNamesString.toString(), new Names());\n\n locations = (Locations)convertJsonToObject(locationsString.toString(), new Locations());\n }", "public Integer loadJSONFile()\n {\n JSONParser parser = new JSONParser();\n try{\n\n Object obj = parser.parse(new FileReader(\"/Users/rnuka/Desktop/sample.json\"));\n JSONObject jsonObj = (JSONObject)obj;\n\n Long age = (Long)jsonObj.get(\"age\");\n System.out.println(\"age:\"+age);\n\n String name = (String)jsonObj.get(\"name\");\n System.out.println(\"name:\" + name);\n\n JSONArray address = (JSONArray)jsonObj.get(\"address\");\n\n for(Object str : address){\n System.out.println(str);\n }\n\n\n\n }catch(Exception e){\n e.printStackTrace();\n }\n return 1;\n }", "@Override\n public void seedBooks() throws IOException {\n if (this.bookRepository.count() > 0) {\n return;\n }\n\n String[] lines = this.readFileUtil.read(BOOKS_FILE_RELATIVE_PATH);\n for (int i = 0; i < lines.length; i++) {\n /* Get args */\n String[] args = lines[i].split(\"\\\\s+\");\n\n /* Get edition type */\n EditionType editionType = EditionType.values()[Integer.parseInt(args[0])];\n\n /* Get release date */\n LocalDate releaseDate = localDateUtil.parseByPattern(\"d/M/yyyy\", args[1]);\n\n /* Get copies */\n long copies = Long.parseLong(args[2]);\n\n /* Get price */\n BigDecimal price = new BigDecimal(args[3]);\n\n /* Get age restriction */\n AgeRestriction ageRestriction = AgeRestriction.values()[Integer.parseInt(args[4])];\n\n /* Get title */\n String title = Arrays.stream(args).skip(5).collect(Collectors.joining(\" \"));\n\n /* Get author */\n Author randomAuthor = this.randomAuthorUtil.getRandom();\n\n /* Get categories */\n Set<Category> randomCategories = this.randomCategoriesUtil.getRandom();\n\n /* Create book */\n Book book = new Book(ageRestriction, copies, editionType, price, releaseDate, title, randomAuthor);\n book.setCategories(randomCategories);\n\n /* Save the book */\n this.bookRepository.saveAndFlush(book);\n }\n }", "private ArrayList<Review> loadReviews(InputStream is) throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(is));\r\n\t\tStringBuilder jsonFileContent = new StringBuilder();\r\n\t\t//read line by line from file\r\n\t\tString nextLine = null;\r\n\t\twhile ((nextLine = br.readLine()) != null){\r\n\t\t\tjsonFileContent.append(nextLine);\r\n\t\t}\r\n\r\n\t\tGson gson = new Gson();\r\n\t\t//this is a require type definition by the Gson utility so Gson will \r\n\t\t//understand what kind of object representation should the json file match\r\n\t\tType type = new TypeToken<ArrayList<Review>>(){}.getType();\r\n\t\tArrayList<Review> reviews = gson.fromJson(jsonFileContent.toString(), type);\r\n\t\t//close\r\n\t\tbr.close();\t\r\n\t\treturn reviews;\r\n\t}", "public void parseLibrary(String jsonData) throws JSONException {\r\n JSONArray library = new JSONArray(jsonData);\r\n\r\n for (int index = 0; index < library.length(); index++) {\r\n JSONObject book = library.getJSONObject(index);\r\n parseBook(book);\r\n }\r\n }", "private JsonObject loadJSONFile(String jsonFilePath) throws IOException {\r\n\tInputStream is = new FileInputStream(jsonFilePath);\r\n\tJsonReader jsonReader = Json.createReader(is);\r\n\tJsonObject json = jsonReader.readObject();\r\n\tjsonReader.close();\r\n\tis.close();\r\n\treturn json;\r\n }", "private void setBasketRepository() {\n ObjectMapper mapper = new ObjectMapper();\n TypeReference<List<Basket>> typeReference = new TypeReference<>() {\n };\n InputStream inputStream = TypeReference.class.getResourceAsStream(\"/json/data_demo.json\");\n try {\n List<Basket> invoices = mapper.readValue(inputStream, typeReference);\n basketRepository.saveAll(invoices);\n log.info(\"Saved in database successfully!\");\n } catch (IOException e) {\n log.error(\"Unable to save in database: {}\", e.getMessage());\n }\n }", "private static void jsonWriter(JSONObject bookList) throws Exception{\r\n FileWriter file = new FileWriter(\"libreria.json\");\r\n file.write(bookList.toJSONString());\r\n file.flush();\r\n }", "public static OMDBJsonResponse getMoviesFromJSON(File jsonFile)\n {\n Gson gson = new Gson();\n OMDBJsonResponse searchResult = null;\n\n //using try \"with resources\"\n try(\n FileReader fileReader = new FileReader(jsonFile);\n JsonReader jsonReader = new JsonReader(fileReader);\n )\n {\n searchResult = gson.fromJson(jsonReader, OMDBJsonResponse.class);\n } catch (Exception e)\n {\n e.printStackTrace();\n }\n return searchResult;\n }", "private static JSONObject fileReader(String path) throws Exception{\r\n return (JSONObject) jsonParser.parse(new String(Files.readAllBytes(Paths.get(path))));\r\n }", "List<BookStoreElement> load(Reader reader);", "private void loadFromFile() {\n try {\n FileInputStream fis = openFileInput(FILENAME);\n BufferedReader in = new BufferedReader(new InputStreamReader(fis));\n\n Gson gson = new Gson();\n Type listType = new TypeToken<ArrayList<Sub>>(){}.getType();\n subList = gson.fromJson(in, listType);\n\n } catch (FileNotFoundException e) {\n subList = new ArrayList<Sub>();\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 }", "private static StoryModel getStory(File file) {\n StoryModel story = null;\n try {\n story = new StoryModel();\n\n if (!file.exists()) {\n throw new FileNotFoundException();\n }\n else{\n FileInputStream fis = new FileInputStream(file);\n ObjectInputStream ois = new ObjectInputStream(fis);\n story = (StoryModel) ois.readObject();\n ois.close();\n }\n } catch (IOException | ClassNotFoundException e) {\n e.printStackTrace();\n }\n\n return story;\n }", "Book createBook();", "public void open(String fileName){\r\n \tString inStr = \"\";\r\n \tString[] parts;\r\n \tString title = \"\";\r\n \tString author = \"\";\r\n \tString year = \"\";\r\n \tString availability = \"\";\r\n \tString type = \"\";\r\n \tString temp = \"\";\r\n \t\r\n \titems.clear();\r\n \t\r\n \ttry{\r\n \t BufferedReader ir = new BufferedReader(new FileReader(fileName + \".txt\"));\r\n \t while((inStr = ir.readLine()) != null){\r\n \t \t\t//First we have to split the string\r\n \t \t\t//at every comma, since the file \r\n \t \t\t//contains a comma seperated list.\r\n\t\tparts = inStr.split(\", \");\r\n\t\tif(parts.length == 1)\r\n\t\t\tcontinue;\r\n\r\n\t\t \r\n\t\tfor(int i = 0; i < parts.length; i++){\r\n\t\t\tString[] pts = parts[i].split(\": \");\r\n\t\t\t\r\n\t\t\t //A switch statement makes it a little\r\n\t\t\t //easier and cleaner when splitting up\r\n\t\t\t //the elements for the second time,\r\n\t\t\t //by the :\r\n\t\t\tswitch(i) {\r\n \t\t\t\tcase 0:\r\n \t\t\t\t\ttitle = pts[1];\r\n\t \t\t\tbreak;\r\n \t\t\t\tcase 1:\r\n \t\t\t\t\ttemp = pts[1];\r\n \t\t\t\tbreak;\r\n\t \t\t\tcase 2:\r\n \t\t\t\t\tavailability = pts[1];\r\n \t\t\t\tbreak;\r\n \t\t\t\tcase 3:\r\n \t\t\t\t\ttype = pts[1];\r\n\t \t\t\tbreak;\r\n \t\t\t}\r\n \t \t}\t\r\n \t \t\r\n \t \t\t//Type and Title are common to all items,\r\n \t \t\t//so we dont have to check the itemType\r\n \t \t\t//before printing this part.\r\n\t\tSystem.out.println(\"Type: \" + type);\t\r\n\t\tSystem.out.println(\"Title: \" + title);\r\n\t\t\r\n\t\t\t//Now we have to check if the type is a book\r\n\t\t\t//or a magazine, since the two will have\r\n\t\t\t//different information attached to them.\r\n \t\tif(type.equalsIgnoreCase(\"BOOK\")) {\r\n\t\t\tSystem.out.println(\"Author: \" + temp);\r\n\t\t\tBook b = new Book(title, temp);\r\n\t\t\tif(availability.equalsIgnoreCase(\"true\"))\r\n\t\t\t\tb.setAvailability(true);\r\n\t\t\telse\r\n\t\t\t\tb.setAvailability(false);\r\n\t\t\titems.add(b);\r\n \t\t} else {\r\n\t\t\tSystem.out.println(\"Year: \" + temp);\r\n\t\t\tMagazine b = new Magazine(title, Integer.parseInt(temp));\r\n\t\t\tSystem.out.println(\"Control: \" + availability);\r\n\t\t\tif(availability.equalsIgnoreCase(\"true\"))\r\n\t\t\t\tb.setAvailability(true);\r\n\t\t\telse\r\n\t\t\t\tb.setAvailability(false);\r\n\t\t\titems.add(b);\r\n \t\t}\r\n \t\t\r\n \t\t\t//Since Availability is also common to all items,\r\n \t\t\t//it can be printed here without testing the\r\n \t\t\t//itemType. \r\n\t\tSystem.out.println(\"Availability: \" + availability);\r\n\t\tSystem.out.println(\"\");\r\n\t }\r\n\r\n ir.close();\t//Close file when done.\r\n \t } catch (FileNotFoundException e) {\r\n System.out.println(\"ERROR: file not found\");\r\n } catch (IOException e) {\r\n System.out.println(\"ERROR: file I/O problem\");\r\n } catch (NullPointerException e){\r\n \tSystem.out.println(\"ERROR: Null Pointer.\");\r\n }\r\n }", "@Test\n\tpublic void readJSONFromFile() {\n\t\t\n\t\tJsonPath jsonFile = new JsonPath(new File (\"C:\\\\Users\\\\cmlzd\\\\Desktop\\\\employees.json\"));\n\t\t\n\t\tSystem.out.println(jsonFile.getString(\"items.email\"));\n\t\t\n\t\t\n\t}", "public static List<DataItem> importFromJSON(Context context){\n FileReader reader = null;\n File file = new File(Environment.getExternalStorageDirectory(), FILE_NAME);\n\n try {\n //Instantiate FileReader with file\n reader = new FileReader(file);\n //Populate DataItems class and return result\n Gson gson = new Gson();\n DataItems dataItems = gson.fromJson(reader, DataItems.class);\n return dataItems.getDataItems();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }finally {\n if (reader != null) {\n try {\n reader.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n return null;\n }", "@Override\n public Object loadFromJson(Context context) {\n Gson gson = new Gson();\n String json = FileManager.getInstance().loadFromFile(getFileName(), context);\n if(json.equals(\"\")) {\n return null;\n }\n\n return gson.fromJson(json, MatchStorage.class);\n\n }", "static JsonResource forFile( File file ) {\n return new JsonResource() {\n @Override\n public <T> T readFrom( ReadMethod<T> consumer ) throws IOException {\n try ( FileInputStream stream = new FileInputStream(file) ) {\n return consumer.read(stream);\n }\n }\n };\n }", "private void loadJSON() throws FileNotFoundException\n\t{\n\n\t\tGsonBuilder builder= new GsonBuilder();\n\t\tGson gson = builder.create();\n\t\t\t\t\n\t\t//get a list of folders in the data directory\n\t\t\n\t\tFile[] directories = new File(\"data\").listFiles();\n\n\t\t//Loop through folders in data directory\n\t\tfor(File folder : directories)\n\t\t\t{\n\t\t\t\t//get a list of files inside the folder\n\t\t\t\tFile[] jsonItems = new File(folder.toString()).listFiles();\n\t\t\t\t\n\t\t\t\t//Loop through files inside the folder \n\t\t\t\tfor(File file : jsonItems)\n\t\t\t\t{\n\t\t\t\t\t//Store in directory map... substring to remove the \"data/\" portion... placed by filename to foldername\n\t\t\t\t\tString dir = file.toString().substring(5);\n\t\t\t\t\t\n\t\t\t\t\t//Generate player data from gson\n\t\t\t\t\tJsonReader reader = new JsonReader(new FileReader(file));\n\t\t\t\t\tPlayer player = gson.fromJson(reader, Player.class);\n\t\t\t\t\t\n\t\t\t\t\t//Store it in the map tied to it's directory\n\t\t\t\t\tplayerData.put(dir, player);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public JSONLoader() {}", "private Presentation getPresentationFromJson(File presentationJson) throws FileNotFoundException {\n Presentation presentation = new Presentation();\n StringBuilder fileContents = new StringBuilder((int)presentationJson.length());\n Scanner scanner = new Scanner(presentationJson);\n while(scanner.hasNextLine())\n fileContents.append(scanner.nextLine());\n\n JSONObject jsonPresentation;\n try {\n jsonPresentation = new JSONObject(fileContents.toString());\n presentation.setId(jsonPresentation.getString(\"id\"));\n presentation.setTitle(jsonPresentation.getString(\"title\"));\n presentation.setDescription(jsonPresentation.getString(\"description\"));\n\n JSONArray slideArray = jsonPresentation.getJSONArray(\"slides\");\n\n for(int i=0; i<slideArray.length(); i++){\n JSONObject slide = slideArray.getJSONObject(i);\n SlideRecord slideRecord = new SlideRecord(slide.getInt(\"slidePage\"),slide.getLong(\"time\"));\n presentation.addRecord(slideRecord);\n }\n\n } catch (JSONException e) {}\n\n return presentation;\n }", "public TranscriptEntry(String filename) {\n JSONParser jsonParser = new JSONParser();\n try (FileReader reader = new FileReader(filename)){\n Object obj = jsonParser.parse(reader);\n\n JSONObject entry = (JSONObject) obj;\n JSONObject myCourse = (JSONObject) entry.get(\"course\");\n course = parseCourse(myCourse);\n grade = (String) entry.get(\"grade\");\n inProgress = (boolean) entry.get(\"inProgress\");\n courseComplete = (boolean) entry.get(\"courseComplete\");\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "private static void initJSONData(String filename, List<JSONObject> list) {\n\n\t\ttry {\n\t\t\t// init transactions list\n\t\t\tString transactionsContent = FileUtils.readFileToString(new File(filename), \"UTF-8\");\n\n\t\t\tJSONArray jArray = (JSONArray) new JSONTokener(transactionsContent).nextValue();\n\t\t\tfor (int i = 0; i < jArray.length(); i++) {\n\t\t\t\tlist.add((JSONObject) jArray.get(i));\n\t\t\t}\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public Book() {\n this.bookName = \"Five Point Someone\";\n this.bookAuthorName = \"Chetan Bhagat\";\n this.bookIsbnNumber = \"9788129104595\";\n\n }", "@Test\r\n public void testRevision() {\r\n InputStream inputstream = getClass().getClassLoader().getResourceAsStream(\"sample.json\");\r\n assert inputstream != null;\r\n Reader reader = new InputStreamReader(inputstream);\r\n JsonParser parser = new JsonParser();\r\n JsonElement rootElement = parser.parse(reader);\r\n\r\n RevisionParser revisionParser = new RevisionParser();\r\n List<Revision> revisionList = revisionParser.parse(rootElement);\r\n\r\n for (Revision r: revisionList) {\r\n System.out.println(r);\r\n }\r\n Assert.assertEquals(revisionList.get(0).toString(), \"Name: Monkbot\tTimeStamp: Fri Sep 13 11:10:41 EDT 2019\");\r\n }", "public Book(String stringRepr) {\n // TODO implement this\n JSONObject book = new JSONObject(stringRepr);\n title = book.getString(\"title\");\n\n JSONArray arr = book.getJSONArray(\"authors\");\n List<String> list = new ArrayList<>();\n\n for (Object s : arr) {\n list.add((String) s);\n }\n authors = list;\n\n this.setParentCollection(null);\n }", "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 }", "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 }", "Book read(Book book);", "public static ArrayList<Course> loadJsonByFileName(String jsonFileName) throws NullPointerException{\n if (jsonFileName == null){\n throw new NullPointerException(ErrorMessage.NULL_JSON_FILE_NAME);\n }\n String jsonFile = Data.getFileContentsAsString(jsonFileName);\n return loadJson(jsonFile);\n }", "private void loadData() {\n FileInputStream fis;\n\n try {\n fis = openFileInput(DATA_FILE);\n user = (User) new JsonReader(fis).readObject();\n fis.close();\n } catch(Exception e) {\n Log.i(\"Exception :\", e.toString());\n }\n }", "private static void readBooksInfo() {\n List<eGenre> arrBook = new ArrayList<>();\n\n // 1 //\n arrBook.add(eGenre.FANTASY);\n arrBook.add(eGenre.ADVENTURE);\n book.add(new Book(1200, arrBook, \"Верн Жюль\", \"Таинственный остров\", 1875));\n arrBook.clear();\n // 2 //\n arrBook.add(eGenre.FANTASY);\n arrBook.add(eGenre.MYSTIC);\n book.add(new Book(425, arrBook, \"Григоренко Виталий\", \"Иван-душитель\", 1953));\n arrBook.clear();\n // 3 //\n arrBook.add(eGenre.DETECTIVE);\n arrBook.add(eGenre.MYSTIC);\n book.add(new Book(360, arrBook, \"Сейгер Райли\", \"Последние Девушки\", 1992));\n arrBook.clear();\n // 4 //\n arrBook.add(eGenre.DETECTIVE);\n book.add(new Book(385, arrBook, \"Ольга Володарская\", \"То ли ангел, то ли бес\", 1995));\n arrBook.clear();\n // 5 //\n arrBook.add(eGenre.NOVEL);\n arrBook.add(eGenre.ACTION);\n book.add(new Book(180, arrBook, \"Лихэйн Деннис\", \"Закон ночи\", 1944));\n arrBook.clear();\n // 6 //\n arrBook.add(eGenre.NOVEL);\n book.add(new Book(224, arrBook, \"Мураками Харуки\", \"Страна Чудес без тормозов и Конец Света\", 1985));\n arrBook.clear();\n // 7 //\n arrBook.add(eGenre.STORY);\n book.add(new Book(1200, arrBook, \"Джон Хейвуд\", \"Люди Севера: История викингов, 793–1241\", 2017));\n arrBook.clear();\n // 8 //\n arrBook.add(eGenre.ACTION);\n arrBook.add(eGenre.MYSTIC);\n arrBook.add(eGenre.DETECTIVE);\n book.add(new Book(415, arrBook, \"Линдквист Юн\", \"Впусти меня\", 2017));\n arrBook.clear();\n // 9 //\n arrBook.add(eGenre.ACTION);\n book.add(new Book(202, arrBook, \"Сухов Евгений\", \"Таежная месть\", 2016));\n arrBook.clear();\n // 10 //\n arrBook.add(eGenre.DETECTIVE);\n arrBook.add(eGenre.MYSTIC);\n book.add(new Book(231, arrBook, \"Винд Кристиан\", \"Призраки глубин\", 2019));\n arrBook.clear();\n }", "private static JsonReader readJSONFromAsset(Context context) throws IOException {\n AssetManager assetManager = context.getAssets();\n JsonReader reader;\n try {\n reader = new JsonReader(new InputStreamReader(assetManager.open(\"questionlist.json\")));\n } finally {\n\n }\n return reader;\n }", "public List<Page> readFromJsonFile(String path) throws FileNotFoundException {\n\t\tScanner testScanner = new Scanner(new BufferedReader(new FileReader(path)));\n\t\tGson g = new Gson();\n\t\tList<Page> pageList = new ArrayList<>();\n\t\twhile (testScanner.hasNext()) {\n\t\t\tpageList.add(g.fromJson(testScanner.nextLine(), Page.class));\n\t\t}\n\t\tg = null;\n\t\ttestScanner.close();\n\t\tpath = null;\n\t\treturn pageList;\n\t}", "private static void loadBooks() {\n\tbookmarks[2][0]=BookmarkManager.getInstance().createBook(4000,\"Walden\",\"\",1854,\"Wilder Publications\",new String[] {\"Henry David Thoreau\"},\"Philosophy\",4.3);\n\tbookmarks[2][1]=BookmarkManager.getInstance().createBook(4001,\"Self-Reliance and Other Essays\",\"\",1900,\"Dover Publications\",new String[] {\"Henry David Thoreau\"},\"Philosophy\",4.3);\n\tbookmarks[2][2]=BookmarkManager.getInstance().createBook(4002,\"Light From Many Lamps\",\"\",1960,\"Wilder Publications\",new String[] {\"Henry David Thoreau\"},\"Philosophy\",4.3);\n\tbookmarks[2][3]=BookmarkManager.getInstance().createBook(4003,\"Head First Design Patterns\",\"\",1944,\"Wilder Publications\",new String[] {\"Henry David Thoreau\"},\"Philosophy\",4.3);\n\tbookmarks[2][4]=BookmarkManager.getInstance().createBook(4004,\"Effective Java Programming Language Guide\",\"\",1990,\"Wilder Publications\",new String[] {\"Eric Freeman\",\"Bert Bates\",\"Kathy Sierra\",\"Elisabeth Robson\"},\"Philosophy\",4.3);\n}", "public static void create(File collectionsFile) throws IOException\n\t{\t\t\n\t\tHashMap books = null;\n\t\t\n\t\t// If updateOnly is true then we are only updating the existing\n\t\t// JAD/JAR files and won't be parsing the source text\n\t\tif (!updateOnly)\n\t\t{\n\t\t\t// Extract xml file from the collectionsFile property: Source-Text\n\t\t\tString sourceTextPath = extractSourceTextPath(collectionsFile);\n\n // Extract the source file type from the collectionsFile property: SourceFormat\n sourceFormatType = extractSourceFormatType(collectionsFile);\n if (sourceFormatType.equals(SourceFormatType.unknown))\n {\n //do extra testing on the file to see if the format can be determined\n //this is for backward compatibility for GBC 2.2.6 version and prior\n //which did not specify the Source-Format property\n sourceFormatType = SourceFormatTypeRetry(baseSourceDirectory, sourceTextPath);\n }\n\n\t\t\t// Base source directory can be overridden with the -d argument\n\t\t\tUpdateBaseSourceDirectory(collectionsFile);\n\t\t\t/*if (baseSourceDirectory == null)\n\t\t\t{\n\t\t\t\t// By default the sourceTextPath is relative to the collectionsFile\n\t\t\t\t//baseSourceDirectory = \"\" + collectionsFile.getParent();\n baseSourceDirectory = collectionsFile.getAbsolutePath();\n baseSourceDirectory = baseSourceDirectory.substring(0, baseSourceDirectory.length() - collectionsFile.getName().length());\n\t\t\t}*/\n\t\t\tif (sourceFormatType == SourceFormatType.osis\n || sourceFormatType == SourceFormatType.thml)\n {\n File xmlFile = new File(baseSourceDirectory, sourceTextPath);\n books = parseXml(xmlFile);\n }\n else if (sourceFormatType == SourceFormatType.usfm)\n {\n extractCommonFields(collectionsFile);\n //make sure that the file extension is retrieved\n extractUSFMfields(collectionsFile);\n books = parseUSFM(collectionsFile, baseSourceDirectory, sourceTextPath, sTitleTag);\n }\n else\n {\n //dump out message saying that it cannot determine the file format type\n System.out.println(\"Error: Could not determine Bible format type, \" + sourceFormatType + \". Please use the 'Source-Format'\");\n System.out.println(\"property in your collections file.\");\n return;\n }\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Allow the relative path in the collections file to work for updateing\n\t\t\t// the icon as well.\n\t\t\tUpdateBaseSourceDirectory(collectionsFile);\n\t\t}\n\t\t\n\t\tif (books != null || updateOnly)\n\t\t{\n\t\t\tparseUiProperties();\n\t\t\t\n\t\t\t// Parse the collections file\n\t\t\tVector collections = parseCollectionsFile(collectionsFile, books);\n\t\t\t\n\t\t\tif (customFontString != null)\n\t\t\t{\n\t\t\t\tgenerateCustomFont(customFontString, collectionsFile, books);\n\t\t\t}\n\t\t\t\n\t\t\t// Open GoBibleCore based on MIDP version \n\t\t\tString goBibleJarFileName = \"GoBibleCore/GoBibleCore2.jar\";\n\t\t\t\n\t\t\t// Set some fields based on the MIDP version\n\t\t\t// Version 2.4.0 has removed MIDP-1.0 as an option\n//\t\t\tif (midpVersion.equals(\"MIDP-1.0\"))\n//\t\t\t{\n//\t\t\t\tversionString = \"1.\" + SUB_VERSION;\n//\t\t\t\tgoBibleJarFileName = \"GoBibleCore/GoBibleCore1.jar\";\n//\t\t\t}\n\t\t\t\n\t\t\t// Work out the current directory of the GoBibleCreator.jar\n\t\t\tFile jarDirectory = getJarDirectory();\n\t\t\tFile jarFile = new File(jarDirectory, goBibleJarFileName);\n\t\t\t\n\t\t\tJarFile goBibleJar = new JarFile(jarFile);\n\t\t\t\n\t\t\t// Write out the Go Bible data files into the same directory as the collections file\n\t\t\twriteCollections(collectionsFile.getParentFile(), collections, books, goBibleJar);\n\t\t}\n\t}", "private static void readWineListFromFile() {\n\t\tJSONParser parser = new JSONParser();\n\n\t\ttry (Reader reader = new FileReader(\"wines.json\")) {\n\n\t\t\tJSONArray wineListJSON = (JSONArray) parser.parse(reader);\n\n\t\t\tfor (int i = 0 ; i < wineListJSON.size(); i++) {\n\t\t\t\tJSONObject wine = (JSONObject) wineListJSON.get(i);\n\t\t\t\tString name = (String) wine.get(\"name\");\n\t\t\t\tint year = Integer.valueOf(wine.get(\"year\").toString());\n\t\t\t\tString description = (String) wine.get(\"description\");\n\t\t\t\tString vine = (String) wine.get(\"vine\");\n\t\t\t\tint quantity = Integer.valueOf(wine.get(\"quantity\").toString());\n\t\t\t\tdouble price = (double) wine.get(\"price\");\n\n\t\t\t\t// Add the JSON object to the wine list\n\t\t\t\tMain.wineList.add(new Wine(name, year, description, vine, quantity, price));\n\n\t\t\t}\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (ParseException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "@Override\n\tpublic void init(String file_name) { deserialize(file_name); }", "public static ResponseUserObj parseGSON() throws FileNotFoundException {\n\n Gson gson = new Gson();\n\n ResponseUserObj data = gson.fromJson(new JsonReader(new FileReader(\"classwork/json/example.json\")), ResponseUserObj.class);\n\n return data;\n }", "public Book addBook(){\n Book book = new Book();\r\n String t = title.getText().toString();\r\n book.setTitle(t);\r\n String[] str = author.getText().toString().split(\",\");\r\n Author[] authors = new Author[str.length];\r\n int index = 0;\r\n for(String s : str){\r\n Author a = null;\r\n String[] fml = s.split(\"\\\\s+\");\r\n if(fml.length == 1){\r\n a = new Author(fml[0]);\r\n }else if(fml.length == 2){\r\n a = new Author(fml[0], fml[1]);\r\n }else if(fml.length == 3){\r\n a = new Author(fml[0], fml[1], fml[2]);\r\n }else{\r\n Toast.makeText(this, \"Invalid Author Name\", Toast.LENGTH_LONG).show();\r\n }\r\n authors[index] = a;\r\n index++;\r\n }\r\n book.setAuthors(authors);\r\n String isb = isbn.getText().toString();\r\n book.setIsbn(isb);\r\n\r\n\t\treturn book;\r\n\t}", "public void readInventoryMainJsonFile() throws IOException, ParseException {\n\n\t\t// Providing read-only access to JSON data.\n\t\tJSONParser parser = new JSONParser();\n\n\t\t// Reading the external JSON file.\n\t\tFileReader reader = new FileReader(\".\\\\resources\\\\InventoryMain.json\");\n\n\t\t// Creating main object to store JSONParser, JSONObject and JSONArray.\n\t\tObject inventoryMain = parser.parse(reader);\n\n\t\t// Parsing object to JSONObject from InventoryMain.json file.\n\t\tJSONObject inventoryObj = (JSONObject) inventoryMain;\n\n\t\t// Getting the arrays of JSON file.\n\t\tJSONArray riceArray = (JSONArray) inventoryObj.get(\"Rice\");\n\t\tJSONArray pulseArray = (JSONArray) inventoryObj.get(\"Pulses\");\n\t\tJSONArray wheatArray = (JSONArray) inventoryObj.get(\"Wheat\");\n\n\t\t// Getting details of rice.\n\t\tSystem.out.println(\"Details of Rice are: \");\n\t\tfor (int i = 0; i < riceArray.size(); i++) {\n\t\t\tJSONObject riceDetails = (JSONObject) riceArray.get(i);\n\n\t\t\tString name = (String) riceDetails.get(\"name\");\n\t\t\tlong weight = (long) riceDetails.get(\"weight\");\n\t\t\tlong price = (long) riceDetails.get(\"price\");\n\n\t\t\tSystem.out.println(\"\\nName: \" + name);\n\t\t\tSystem.out.println(\"Weight: \" + weight);\n\t\t\tSystem.out.println(\"Price per KG is: \" + price);\n\n\t\t\t// Calculating price of different types of rice.\n\t\t\tlong ricePrice = weight * price;\n\t\t\tSystem.out.println(\"\\nTotal price of \" + riceDetails.get(\"name\") + \" is \" + ricePrice);\n\n\t\t}\n\n\t\t// Getting details of Pulse.\n\t\tSystem.out.println(\"\\nDetails of Pulse are: \");\n\t\tfor (int j = 0; j < pulseArray.size(); j++) {\n\t\t\tJSONObject pulseDetails = (JSONObject) pulseArray.get(j);\n\n\t\t\tString name = (String) pulseDetails.get(\"name\");\n\t\t\tlong weight = (long) pulseDetails.get(\"weight\");\n\t\t\tlong price = (long) pulseDetails.get(\"price\");\n\n\t\t\tSystem.out.println(\"\\nName: \" + name);\n\t\t\tSystem.out.println(\"Weight: \" + weight);\n\t\t\tSystem.out.println(\"Price per KG is: \" + price);\n\n\t\t\t// Calculating price of different types of Pulses.\n\t\t\tlong pulsePrice = weight * price;\n\t\t\tSystem.out.println(\"\\nTotal price of \" + pulseDetails.get(\"name\") + \" is \" + pulsePrice);\n\n\t\t}\n\t\t// Getting details of Wheat.\n\t\tSystem.out.println(\"\\nDetails of Wheat are: \");\n\t\tfor (int i = 0; i < wheatArray.size(); i++) {\n\t\t\tJSONObject wheatDetails = (JSONObject) wheatArray.get(i);\n\n\t\t\tString name = (String) wheatDetails.get(\"name\");\n\t\t\tlong weight = (long) wheatDetails.get(\"weight\");\n\t\t\tlong price = (long) wheatDetails.get(\"price\");\n\n\t\t\tSystem.out.println(\"\\nName: \" + name);\n\t\t\tSystem.out.println(\"Weight: \" + weight);\n\t\t\tSystem.out.println(\"Price per KG is: \" + price);\n\t\t\t// Calculating price of different types of Wheat.\n\t\t\tlong wheatPrice = weight * price;\n\t\t\tSystem.out.println(\"\\nTotal price of \" + wheatDetails.get(\"name\") + \" is \" + wheatPrice);\n\n\t\t}\n\n\t}", "public static Object objectLoader(String filename) throws IOException, ClassNotFoundException {\r\n\t\t// Creat file input stream\r\n\t\tFileInputStream fileInStr = new FileInputStream(filename);\r\n\t\t// Create object input steam\r\n\t\tObjectInputStream objInStr = new ObjectInputStream(fileInStr);\r\n\t\tObject obj = (Object) objInStr.readObject();\r\n\t\t// Closing all streams\r\n\t\tobjInStr.close();\r\n\t\tfileInStr.close();\r\n\t\tSystem.out.printf(\"Deserialized data - \" + filename); // Printing message plus file name that was saved\r\n\t\treturn obj;\r\n\t}", "public void initializeBookStore() throws IOException{\r\n //creates new file called \"Book.txt\". \r\n file = new File(\"Book.txt\");\r\n //adds/writes into the file created. \r\n in = new FileWriter(\"Book.txt\", true);\r\n write = new BufferedWriter(in);\r\n \r\n if(file.length() == 0){\r\n write.write(data);\r\n write.newLine();\r\n write.close();\r\n }\r\n }", "public ObjReader(String filename){\n file = filename;\n }", "private void read() {\n\n\t\t\t\tString road=getActivity().getFilesDir().getAbsolutePath()+\"product\"+\".txt\";\n\n\t\t\t\ttry {\n\t\t\t\t\tFile file = new File(road); \n\t\t\t\t\tFileInputStream fis = new FileInputStream(file); \n\t\t\t\t\tint length = fis.available(); \n\t\t\t\t\tbyte [] buffer = new byte[length]; \n\t\t\t\t\tfis.read(buffer); \n\t\t\t\t\tString res1 = EncodingUtils.getString(buffer, \"UTF-8\"); \n\t\t\t\t\tfis.close(); \n\t\t\t\t\tjson(res1.toString());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} \n\t\t\t}", "public 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 }", "public GradeBook readIpGradeBook() throws IOException, ParseException {\n\t\tList<String> cList = new ArrayList<>(); \n Map<String, String> gradeItem = new HashMap<>();\n JSONParser parser = new JSONParser();\t\n Object obj = parser.parse(new FileReader(\"src/inputandOutput/input.json\"));\n JSONArray jsonArray;\n JSONObject jsonObject = null;\n if (obj instanceof JSONArray) {\n \tjsonArray = (JSONArray) obj; \n \tjsonObject=(JSONObject) jsonArray.get(0);\n } else if (obj instanceof JSONObject) {\n jsonObject = (JSONObject)obj;\n }\n JSONArray grdBookArray;\n JSONObject grdBookObject = null;\n if(jsonObject.get(\"GradeBook\") instanceof JSONArray){\n \tgrdBookArray = (JSONArray) jsonObject.get(\"GradeBook\");\n grdBookObject=(JSONObject) grdBookArray.get(0);\n } else if(jsonObject.get(\"GradeBook\") instanceof JSONObject){\n \tgrdBookObject=(JSONObject) jsonObject.get(\"GradeBook\");\n }\n \n\n JSONArray gradingSchemaArray;\n JSONObject gradingSchemaObject = null;\n if(grdBookObject.get(\"GradingSchema\") instanceof JSONArray){\n \tgradingSchemaArray = (JSONArray) grdBookObject.get(\"GradingSchema\");\n \tgradingSchemaObject=(JSONObject) gradingSchemaArray.get(0);\n } else if(grdBookObject.get(\"GradingSchema\") instanceof JSONObject){\n \tgradingSchemaObject=(JSONObject) grdBookObject.get(\"GradingSchema\");\n }\n\n JSONArray grdItemArray;\n JSONObject grdItemObject = null;\n if(gradingSchemaObject.get(\"GradeItem\") instanceof JSONArray){\n \tgrdItemArray = (JSONArray) gradingSchemaObject.get(\"GradeItem\");\n \tfor(int i=0; i<grdItemArray.size();i++){\n \t grdItemObject=(JSONObject) grdItemArray.get(i);\n \t String category = (String) grdItemObject.get(\"Category\");\n \t String percentage = (String) grdItemObject.get(\"Percentage\");\n \t cList.add(category);\n \t gradeItem.put(category, percentage);\n } \n } else if(gradingSchemaObject.get(\"GradeItem\") instanceof JSONObject){\n \tgrdItemObject = (JSONObject) gradingSchemaObject.get(\"GradeItem\");\n \tString category = (String) grdItemObject.get(\"Category\");\n\t String percentage = (String) grdItemObject.get(\"Percentage\");\n\t cList.add(category);\n\t gradeItem.put(category, percentage);\n }\n \n grdBook.setGradeItem(gradeItem);\n \tgrdBook.setCategory(cList);\n return grdBook;\n\t}", "public static ReaderBookmarks deserializeFromJSON(\n final ObjectMapper jom,\n final JsonNode node)\n throws JSONParseException {\n\n NullCheck.notNull(jom, \"Object mapper\");\n NullCheck.notNull(node, \"JSON\");\n\n final ObjectNode obj =\n JSONParserUtilities.checkObject(null, node);\n\n final HashMap<BookID, ReaderBookLocation> bookmarks_builder = new HashMap<>();\n final ObjectNode by_id = JSONParserUtilities.getObject(obj, \"locations-by-book-id\");\n\n final Iterator<String> field_iter = by_id.fieldNames();\n while (field_iter.hasNext()) {\n final String field =\n field_iter.next();\n final BookID book_id =\n BookID.create(field);\n final ReaderBookLocation location =\n ReaderBookLocationJSON.deserializeFromJSON(jom, JSONParserUtilities.getNode(by_id, field));\n bookmarks_builder.put(book_id, location);\n }\n\n return ReaderBookmarks.create(ImmutableMap.copyOf(bookmarks_builder));\n }", "private void initialiseFromJson(){\n try {\n\t\t\t// The type adapter is only needed if you have a CharSequence in your model. If you're just using strings\n \t// you can just use Gson gson = new Gson();\n Gson gson = new GsonBuilder().registerTypeAdapter(CharSequence.class, new CharSequenceDeserializer()).create();\n Reader reader = new InputStreamReader(getAssets().open(VARIANTS_FILE));\n BaseVariants baseVariants = gson.fromJson(reader, BaseVariants.class);\n Neanderthal.initialise(this, baseVariants.variants, baseVariants.defaultVariant);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private static void init() throws IOException, BusinessException {\n\t\tMap<String, String> books = new HashMap<String, String>();\n\t\tbooks.put(\"tranc1-in\", Entry.class.getClassLoader().getResource(\"TRANC1-IN.book\").getPath());\n\t\tbooks.put(\"tranc1-out\", Entry.class.getClassLoader().getResource(\"TRANC1-OUT.book\").getPath());\n\t\tBookStore.loadBooks(books);\n\t}", "public JSONLoader( LoadingManager manager ) {}", "private void librarian()throws IOException\n {\n //File Handling starts here with reading into each of the different files to obtain set of books along with relevant data.\n FileReader fauthor = new FileReader(\"BookAuthorList.txt\"); \n BufferedReader bufferAuthor = new BufferedReader(fauthor);\n\n FileReader fgenre = new FileReader(\"BookGenreList.txt\"); \n BufferedReader bufferGenre = new BufferedReader(fgenre);\n\n FileReader fname = new FileReader(\"BookNameList.txt\"); \n BufferedReader bufferName = new BufferedReader(fname);\n\n FileReader fnumber = new FileReader(\"BookNumberList.txt\"); \n BufferedReader bufferNumber = new BufferedReader(fnumber);\n\n for(int i=0; i<linecount; i++) //instance variable linecount\n {\n book[i] = new Book(\"1000\", \"Book Name\", \"Author of Book\", \"Genre of Book\"); //instantiating array element to avoid NullPointerException\n book[i].code = bufferNumber.readLine();\n book[i].author = bufferAuthor.readLine();\n book[i].genre = bufferGenre.readLine();\n book[i].name = bufferName.readLine();\n }\n /*\n * The following for loop trims each of the lines obtained from the file, to remove spaces and help maintain equal number of characters.\n */\n for(int i=0; i<linecount; i++) //trimming\n {\n book[i].code = book[i].code.trim();\n book[i].author = book[i].author.trim();\n book[i].genre = book[i].genre.trim();\n book[i].name = book[i].name.trim();\n }\n\n for(int i=0; i<linecount; i++) //add set number of lines. this helps in making tabular forms\n {\n /*\n * Utilising concatenation from Library classes here. \n * Function spaces is called.\n */\n book[i].code = book[i].code.concat(Spacebar.spaces(5 - book[i].code.length()));\n book[i].author = book[i].author.concat(Spacebar.spaces(25 - book[i].author.length()));\n book[i].genre = book[i].genre.concat(Spacebar.spaces(15 - book[i].genre.length()));\n book[i].name = book[i].name.concat(Spacebar.spaces(70 - book[i].name.length()));\n }\n }", "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 }", "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 }", "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 HashMap<String, Item> loadItems() {\n HashMap<String, Item> items = null;\n Gson gson = new Gson();\n try {\n BufferedReader reader = new BufferedReader(new FileReader(DEPOSITED_PATH));\n Type type = new TypeToken<HashMap<String, Item>>() {\n }.getType();\n items = gson.fromJson(reader, type);\n } catch (FileNotFoundException fnfe) {\n System.out.println(fnfe);\n }\n return items;\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 }});}", "private void loadBookInformation(String rawPage, Document doc, Book book) {\n BookDetailParser parser = new BookDetailParser();\n SwBook swBook = parser.parseDetailPage(rawPage);\n book.setContributors(swBook.getContributors());\n book.setCover_url(coverUrlParser.parse(doc));\n book.setShort_description(descriptionShortParser.parse(doc));\n book.addPrice(swBook.getPrice().getPrices().get(0));\n book.setTitle(titleParser.parse(doc));\n }", "private static Book createFirstBookTest() {\n var book = new Book();\n book.setOriginalPriceNumber(1760);\n book.setDescription(\"52ヘルツのクジラとは―他の鯨が聞き取れない高い周波数で鳴く\");\n book.setCategory(\"トップページ > 本・コミック > 文芸 > 文芸(日本) > 現代小説 \");\n return book;\n }", "public void parseBook(JSONObject book) throws JSONException {\r\n String city = book.getString(\"name\");\r\n String base = book.getString(\"base\");\r\n int visi = book.getInt(\"visibility\");\r\n Integer.toString(visi);\r\n\r\n System.out.println(\"Today's weather:\");\r\n System.out.println(\"City: \" + city);\r\n System.out.println(\"Base: \" + base);\r\n System.out.println(\"Visibility: \" + visi);\r\n System.out.println();\r\n }", "private void loadFromFile() {\n try {\n /* Load in the data from the file */\n FileInputStream fIn = openFileInput(FILENAME);\n BufferedReader inRead = new BufferedReader(new InputStreamReader(fIn));\n\n /*\n * access from the GSON file\n * Taken from lonelyTwitter lab code\n */\n Gson gson = new Gson();\n Type listType = new TypeToken<ArrayList<Counter>>() {}.getType();\n counters = gson.fromJson(inRead, listType);\n\n } catch (FileNotFoundException e) {\n counters = new ArrayList<Counter>();\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }", "public void retrieveTodo() {\r\n File file = new File(\"C:\\\\Users\\\\Dalia\\\\Desktop\\\\CPSC 210\\\\Project\\\\project_b2h3b\\\\data\");\r\n JFileChooser chooser = new JFileChooser(file);\r\n int userSelection = chooser.showOpenDialog(null);\r\n File f = chooser.getSelectedFile();\r\n if (userSelection == JFileChooser.APPROVE_OPTION) {\r\n fileName = f.getAbsolutePath();\r\n reader = new MyTodoJsonReader(fileName);\r\n try {\r\n myTodo = reader.readMyToDoList();\r\n todoListGui();\r\n } catch (IOException ioException) {\r\n JOptionPane.showMessageDialog(null, \"File doesn't exist!\");\r\n }\r\n }\r\n }", "private static JsonObject readJSON(String path) {\n\n\t\tString fileContents = \"\";\n\t\tBufferedReader reader = null;\n\n\t\ttry {\n\t\t\treader = new BufferedReader(new FileReader(path));\n\t\t} catch (FileNotFoundException e) {\n\t\t\tfail(ErrorMessage.inputFileNotFoundError);\n\t\t}\n\n\t\tString line;\n\n\t\ttry {\n\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\tfileContents += line;\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tfail(ErrorMessage.readFileError);\n\t\t}\n\n\t\ttry {\n\t\t\treader.close();\n\t\t} catch (IOException e) {\n\t\t\tfail(ErrorMessage.closeFileError);\n\t\t}\n\n\t\tJsonObject jsonLicense = Json.createReader(new StringReader(fileContents)).readObject();\n\n\t\treturn jsonLicense;\n\t}", "public void load(String filename) {\n\t\tsetup();\n\t\tparseOBJ(getBufferedReader(filename));\n\t}", "private void load(){\n SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());\n Gson gson = new Gson();\n\n String json = preferences.getString(LISTS_DOWNLOADED,null);\n Type type =new TypeToken<ArrayList<String>>() {}.getType();\n downloadedBooks = gson.fromJson(json,type);\n\n json = preferences.getString(LISTS_PROGRESS,null);\n type =new TypeToken<ArrayList<Integer>>() {}.getType();\n progress=gson.fromJson(json,type);\n\n if(downloadedBooks == null){\n downloadedBooks = new ArrayList<>();\n }\n if(progress == null){\n progress = new ArrayList<>();\n }\n\n }" ]
[ "0.73931795", "0.7242825", "0.6720335", "0.67080516", "0.667377", "0.6661529", "0.6586225", "0.6530576", "0.6440868", "0.64240795", "0.6414183", "0.63343", "0.62378854", "0.6209467", "0.61370146", "0.6102912", "0.6085585", "0.6038501", "0.5963284", "0.5887172", "0.5873986", "0.57913357", "0.5753681", "0.5746515", "0.5740704", "0.57331", "0.5706736", "0.57045025", "0.5702827", "0.5691069", "0.56735796", "0.5648739", "0.5640858", "0.5624758", "0.561742", "0.5608741", "0.5586469", "0.5585315", "0.5576772", "0.556883", "0.5555271", "0.5511796", "0.55105215", "0.55042493", "0.5497775", "0.5490477", "0.5486894", "0.5472126", "0.54711854", "0.54634947", "0.54512054", "0.5451153", "0.54504067", "0.5427424", "0.5413924", "0.54079896", "0.5397386", "0.5370393", "0.53580415", "0.53564036", "0.53547466", "0.53508407", "0.53157073", "0.53107363", "0.53052187", "0.5295672", "0.52913517", "0.52894574", "0.5283734", "0.52721363", "0.5269115", "0.5267511", "0.5258047", "0.52497786", "0.52370864", "0.5232946", "0.52279913", "0.52214533", "0.52188903", "0.52176297", "0.52153057", "0.519648", "0.5192623", "0.5191433", "0.5189471", "0.5185771", "0.5181536", "0.5179274", "0.51751906", "0.5173718", "0.51625174", "0.5162281", "0.5154725", "0.5152257", "0.5151713", "0.5145729", "0.5130312", "0.5129216", "0.51287097", "0.5128036" ]
0.81212467
0
/ onCreate method for activity
@Override protected void onCreate(Bundle savedInstanceState) { SharedPreferences prefs = getSharedPreferences("textMeSP", MODE_PRIVATE); String isDark = prefs.getString("isDark", null); if (isDark != null) { setTheme (R.style.ActivityTheme_Primary_Base_Dark); }else{ setTheme (R.style.ActivityTheme_Primary_Base_Light); } super.onCreate(savedInstanceState); setContentView(R.layout.activity_search); // setup data from firebase mAuth = FirebaseAuth.getInstance(); DBref = FirebaseDatabase.getInstance().getReference("Users"); // find predefined views in XML listView = (RecyclerView) findViewById(R.id.searched_friends); searchIput = (EditText) findViewById(R.id.search_input); adapter = new FriendAdapter(this, R.layout.friends_list_item, friends); listView.setHasFixedSize(true); listView.setAdapter(adapter); RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this); listView.setLayoutManager(layoutManager); // listen for text changing searchIput.addTextChangedListener( new TextWatcher() { // watch the text /* method watches before text changes * @param s - text * @param start - starting value * @param count - amount of chars * @param after - overall value * */ @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) {} /* method watches when text changes * @param s - text * @param start - starting value * @param count - amount of chars * @param after - overall value * */ @Override public void onTextChanged(CharSequence s, int start, int before, int count) { search(searchIput.getText().toString()); // search user } /* method watches after text changes * @param s - text * @param start - starting value * @param count - amount of chars * @param after - overall value * */ @Override public void afterTextChanged(Editable s) { if (s.length() != 0) { search(searchIput.getText().toString()); // search user } // if input is not empty } }); // DBref.child().child("friends").orderByValue().addValueEventListener(userEventListener); // back button setup FloatingActionButton backBtn = (FloatingActionButton) findViewById(R.id.backBtn); backBtn.setOnClickListener(new View.OnClickListener() { // listen for clicking button public void onClick(View v) { // launch when button is clicked finish(); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void onCreate() {\n }", "public void onCreate();", "public void onCreate();", "public void onCreate() {\n }", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t\tinit();\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n init();\n }", "@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\r\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tinit();\r\n\t}", "@Override\n public void onCreate(@Nullable Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n initArguments();\n }", "@Override\n public void onCreate()\n {\n\n super.onCreate();\n }", "@Override \n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetParams();\n\t}", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\t\n\t\t_activity = this;\n\t\tLog.d(\"onCreateJava\" , \"++++++++++++++++++++++++++++++++++++++++++++++++++++++\");\n\t}", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\t\n\t}", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\t\n\t}", "@Override\n public void onCreate() {\n }", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\n\t}", "@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tAnnotationProcessor.processActivity(this);\r\n\t}", "@Override\n\tpublic void onActivityCreated(Activity activity, Bundle savedInstanceState)\n\t{\n\t}", "@Override\n public void onCreate() {\n super.onCreate();\n }", "@Override\n public void onCreate() {\n super.onCreate();\n }", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t}", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t}", "@Override\n\tpublic void onCreate() {\n\n\t}", "@Override\n public void onCreate() {\n super.onCreate();\n initData();\n }", "@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tsetContentView(R.layout.activity_antilost);\r\n\t\tinitView();\r\n\t\tinitData();\r\n\t\taddListener();\r\n\t}", "@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) {\r\n\t\tsuper.onCreate(savedInstanceState);\r\n\r\n\t\thandleIntent(getIntent());\r\n\t}", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t}", "@Override\n public void onCreate() {\n L.d(\"onCreate is called\");\n super.onCreate();\n }", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.activity_appmanager);\n\t\tinitView();\n\t\tinitData();\n\t}", "@Override\n public void onCreate(Bundle savedInstanceState) \n {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tm_Activity = this;\n\t\tm_Handler = new Handler();\n }", "@Override\n\tprotected void onCreate() {\n\t}", "@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\r\n\t}", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.act_myinfo);\n\t\tinitView();\n\t\tinitEvents();\n\n\t}", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\t\r\n\t\tinitViewPager();\r\n\t\t\r\n\t\tinitView();\r\n\r\n\t\tinitCursor();\r\n\t\t\r\n\t\tinithuanxin(savedInstanceState);\r\n\t\r\n \r\n\t}", "@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tmActivityManager = (ActivityManager) (getSystemService(Context.ACTIVITY_SERVICE));\r\n\t\tsuper.onCreate(savedInstanceState);\r\n\t}", "@Override\n public void onCreate() {\n\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\t\n\t\t\n\t}", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(AppConfig.resourceId(this, \"jguserinfo\", \"layout\"));\n\t\tmurl = getIntent().getStringExtra(\"url\");\n\t\tintView();\n\t}", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsetContentView(R.layout.caifushi_record);\n\t\tsuper.onCreate(savedInstanceState);\n\t\tinitview();\n\t\tMyApplication.getInstance().addActivity(this);\n\t\t\n\t}", "@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\t\r\n\t}", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\t\n\t}", "@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tsetContentView(R.layout.activity_addjiaojie);\r\n\t\tExitManager.getInstance().addActivity(this);\r\n\t\tMyUntils.getUersInfo(this);\r\n\t\tinit();\r\n\t\tinitData();\r\n\t\tStatics.ADDAVTIVITY=Statics.AddjiaoyvActivity;\r\n\t}", "@Override\n public void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n\n }", "@Override\n public void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n\n }", "@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\r\n\t}", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\tLog.e(TAG, \"onActivityCreated-------\");\r\n\t}", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\tLog.e(TAG, \"onActivityCreated-------\");\r\n\t}", "@Override\n public void onCreate()\n {\n\n\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\t\t\n\t\tappManager = AppManager.getAppManager();\n\t\tappManager.addActivity(this);\n\t}", "@Override\n public void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n }", "@Override\n public void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n }", "@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\t\r\n\t}", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.listexcursionscreen);\n\n ActionsDelegator.getInstance().synchronizeActionsWithServer(this);\n runId = PropertiesAdapter.getInstance(this).getCurrentRunId();\n\n RunDelegator.getInstance().loadRun(this, runId);\n ResponseDelegator.getInstance().synchronizeResponsesWithServer(this, runId);\n\n }", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\t\r\n\t\tinitView();\r\n\t}", "@Override\n public void onCreate(Bundle savedInstanceState) {\n\tsuper.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n \tsuper.onCreate(savedInstanceState);\n }", "@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\t\n\t}", "@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\t\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) {\r\n\t\tsuper.onCreate(savedInstanceState);\r\n\r\n\t}", "@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\t}", "@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\t}", "@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\t}", "@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\t}", "@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\t}", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tinitMain();\n\n\t}", "@Override\n public void onCreate(Bundle savedInstanceState)\n {\n super.onCreate( savedInstanceState );\n }", "@Override\n public void onCreate() {\n initData();\n }", "@Override\n protected void onCreate(@Nullable Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n BusProvider.register(this);\n findViews();\n init();\n getData();\n //customizeActionBar();\n\n loadContact();\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState)\n\t{\n\t\tsuper.onCreate(savedInstanceState);\n\t}", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t}", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t}", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t}", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t}", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.main);\n\n init();\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_chetielist);\n init();\n }", "@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\n\t\tsetContentView(R.layout.user_main_activity);\n\t\tinitSlidingMenu(R.layout.menu_settings_layout);\n\t\tinit();\n\t\tinitControl();\n\t\tensureUi();\n\t\tUmengUpdateAgent.update(this);\n\t\t\n\t}", "void onCreate(Intent intent);", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n Utility.setStatusBarColor(this);\n setContentView(R.layout.activity_get_user_info);\n initViews();\n\n\n // handleClickEvent();\n\n }", "@Override\n protected void onCreate(@Nullable Bundle savedInstanceState) {\n\n super.onCreate(savedInstanceState);\n }", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\tcontext = getApplicationContext();\n\t\t\n\t\tApplicationContextUtils.init(context);\n\t}", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.sendgift_activity);\n\t\tinit();\n\t}", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tif (YangHeZiApplication.tppe==0) return;\n\t\trequestWindowFeature(Window.FEATURE_NO_TITLE);\n\t\tinitContentView(R.layout.base_activity);\n\t\tinfoView();\n//\t\tcheckLogin();\n\t\taddNotifyUpdate();\n\t\tLog.e(\"Activity:\",getClass().getName());\n\t}" ]
[ "0.8242845", "0.8023422", "0.8023422", "0.80023026", "0.7953033", "0.7864056", "0.781293", "0.7798698", "0.779142", "0.7789302", "0.77598083", "0.77587634", "0.77587634", "0.77523327", "0.7748646", "0.7742212", "0.77288413", "0.7727844", "0.7727844", "0.76985157", "0.76985157", "0.76982045", "0.7690907", "0.7682515", "0.76773125", "0.7676829", "0.76652193", "0.76642954", "0.76642954", "0.76642954", "0.76642954", "0.76642954", "0.76642954", "0.7663751", "0.7660656", "0.7659663", "0.7657288", "0.76501346", "0.76499087", "0.76471573", "0.764144", "0.7638758", "0.7630593", "0.7630008", "0.7623965", "0.76203245", "0.7619974", "0.7614156", "0.7614156", "0.7612794", "0.7608054", "0.7608054", "0.75988525", "0.7596958", "0.75888246", "0.75888246", "0.75887555", "0.7588188", "0.7587498", "0.75813395", "0.7570762", "0.7569539", "0.7569539", "0.75687504", "0.75672644", "0.7564559", "0.7564559", "0.7564559", "0.7564559", "0.7564559", "0.7558319", "0.75562114", "0.7550683", "0.7546145", "0.75415754", "0.75415754", "0.75415754", "0.75415754", "0.75415754", "0.75415754", "0.75415754", "0.75415754", "0.75415754", "0.75415754", "0.75415754", "0.75415754", "0.75415754", "0.7540257", "0.7536425", "0.7536425", "0.7536425", "0.7536425", "0.75362486", "0.7534349", "0.7534111", "0.75297314", "0.75297046", "0.75224483", "0.7521365", "0.7512235", "0.75091696" ]
0.0
-1
watch the text / method watches before text changes
@Override public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n public void ensureTextChangesWork() {\n onView(withId(R.id.inputField))\r\n .perform(typeText(\"HELLO\"), closeSoftKeyboard());\r\n reportHelper.label(\"myTestStepLabel_1_1\");\r\n onView(withId(R.id.changeText)).perform(click());\r\n\r\n // Check that the text was changed.\r\n onView(withId(R.id.inputField)).check(matches(withText(\"Lalala\")));\r\n reportHelper.label(\"myTestStepLabel_1_2\");\r\n }", "@Override\n public void statusChanged(String text) {\n fireStatusChanged(text);\n }", "private void notifyAfterTextChanged() {\n removeMessages(ON_TEXT_CHANGED);\n sendEmptyMessageDelayed(ON_TEXT_CHANGED, DELAY_IN_MILLISECOND);\n }", "@Override\r\n\t\t\tpublic boolean onQueryTextChange(String newText) {\n\t\t\t\tdebugMemory(\"onQueryTextChange\");\r\n\t\t\t\treturn false;\r\n\t\t\t}", "void textChanged() {\n\t\ttextAreaChanged = true;\n\t\tfinder.clear();\n\t\tfindIndex = 0;\n\t\ttextEditor.getHighlighter().removeAllHighlights();\n\t\terrorTextArea.setText(\"\");\n\t}", "protected void updateTextChange() {\n \t\t\tfText= fDocumentUndoManager.fTextBuffer.toString();\n \t\t\tfDocumentUndoManager.fTextBuffer.setLength(0);\n \t\t\tfPreservedText= fDocumentUndoManager.fPreservedTextBuffer.toString();\n \t\t\tfDocumentUndoManager.fPreservedTextBuffer.setLength(0);\n \t\t}", "@Override\n public boolean onQueryTextChange(String newText) {\n filter(newText);\n return true;\n }", "public void updateText( String text ) {\n\t\tthis.text = text;\n\t}", "private void listenToTextChanges(boolean listen) {\n \t\tif (listen) {\n \t\t\tif (fDocumentListener == null && fDocument != null) {\n \t\t\t\tfDocumentListener= new DocumentListener();\n \t\t\t\tfDocument.addDocumentListener(fDocumentListener);\n \t\t\t}\n \t\t} else if (!listen) {\n \t\t\tif (fDocumentListener != null && fDocument != null) {\n \t\t\t\tfDocument.removeDocumentListener(fDocumentListener);\n \t\t\t\tfDocumentListener= null;\n \t\t\t}\n \t\t}\n \t}", "public boolean onQueryTextChange (String newText) {\n return true;\n }", "@Override\n public boolean onQueryTextChange(String newText) {\n if(newText.length() > 0) {\n filterRunner(newText);\n } else {\n mRunnersAdapter.setRunners(mRunners);\n mRunnersAdapter.notifyDataSetChanged();\n }\n\n return false;\n }", "@Override\n\t\tpublic boolean onQueryTextChange(String newText) {\n\t\t\treturn false;\n\t\t}", "public boolean onQueryTextChange(String newText) {\n return true;\n }", "public boolean onQueryTextChange(String newText) {\n return true;\n }", "@Test\n public void ensureTextChangesWork(){\n onView(withId(R.id.placeEditText)).perform(typeText(\"London\"));\n\n // Check that the language text was changed.\n onView(withId(R.id.languageEditText)).perform(typeText(\"It\"));\n\n // Check that the language text was changed.\n onView(withId(R.id.maxrowsEditText)).perform(typeText(\"3\"));\n\n // check button click\n onView(withId(R.id.button)).perform(click());\n\n // check returned list view\n onView(withId(R.id.listViewResult)).check(matches(isDisplayed()));\n }", "private void notifyOnTextReceived(String message) {\n synchronized (globalLock) {\n if (isRunning) {\n onTextReceived(message);\n }\n }\n }", "public interface OnTextChange {\n void addTextChangedListener(TextWatcher watcher);\n boolean isEmpty();\n Editable getText();\n int getVisibility();\n}", "@Override\n\tpublic boolean onQueryTextChange(String newText) {\n\t\tLog.v(\"query\",\"onQueryTextChange\");\n\t\tmTextView.setText(\"Searching for \" + newText);\n\t\treturn false;\n\t}", "@Override\n public void onTextChanged(CharSequence text) {\n }", "private void update(String text, TextView view) {\r\n handler.post(new TextUpdater(text, view));\r\n }", "public void setText(String text) {\n this.text = text;\n setChanged();\n notifyObservers();\n }", "@Override\n public void afterTextChanged(Editable theWatchedText) {\n unitIdChanged = theWatchedText.toString();\n // deal2.getBranchName();\n SessionData.getInstance().setBname(unitIdChanged);\n\n// if (session == 0) {\n//\n// new AsyncDealerBranchFiltter().execute();\n// } else if (session == 1) {\n// new AsyncDealerBranchFiltter().execute();\n//\n// }\n\n }", "private void refreshSuggestions() {\n \t\tString text = textBox.getText();\n \t\tif (text.equals(currentText)) {\n \t\t\treturn;\n \t\t} else {\n \t\t\tcurrentText = text;\n \t\t}\n \t\tfindSuggestions(text);\n \t}", "public void updateText() throws JUIGLELangException {\n SwingUtilities.invokeLater(new Runnable() {\n\n\n public void run() {\n fireTableStructureChanged();\n }\n });\n\n }", "public boolean realtimeTextEnabled();", "public void textChanged(TextChangedEvent e) {\n System.out.println(\"Received TextChangeEvent!\");\n TestCase.assertEquals(\"Old text mismatched.\", \"old text\", e.getOldText());\n TestCase.assertEquals(\"New text mismatched.\", \"new text\", e.getNewText());\n }", "public void onTextCopy()\n\t{\n\t}", "@Override\n\tpublic boolean onQueryTextChange(String newText) {\n\t\treturn false;\n\t}", "@Override\n public boolean onQueryTextChange(String newText) {\n return false;\n }", "@Override\n public boolean onQueryTextChange(String newText)\n {\n return false;\n }", "private void monitorTextChange() {\n List<TextInputEditText> textInputEditTextList = new ArrayList<>();\n textInputEditTextList.add(tin_perLitrePrice); // first line is selected automatically\n textInputEditTextList.add(tin_fuelQuantityLitres);\n textInputEditTextList.add(tin_totalFuelPrice);\n textInputEditTextList.add(tin_currentKm);\n textInputEditTextList.add(tin_startingKm);\n textInputEditTextList.add(tin_distanceCovered);\n\n for (TextInputEditText item : textInputEditTextList) {\n\n\n item.addTextChangedListener(new TextWatcher() {\n @Override\n public void beforeTextChanged(CharSequence s, int start, int count, int after) {\n\n }\n\n @Override\n public void onTextChanged(CharSequence s, int start, int before, int count) {\n }\n\n @Override\n public void afterTextChanged(Editable s) {\n Log.d(TAG, \"afterTextChanged: \");\n fabSaveFuelData.hide(); // hide save button\n tv_calculatedAverage_addEdit.setText(\"--km/l\");\n }\n });\n }\n\n // tv_input_fuel_date is a TextView so we need to add this separately\n tv_input_fuel_date.addTextChangedListener(new TextWatcher() {\n @Override\n public void beforeTextChanged(CharSequence s, int start, int count, int after) {\n\n }\n\n @Override\n public void onTextChanged(CharSequence s, int start, int before, int count) {\n\n }\n\n @Override\n public void afterTextChanged(Editable s) {\n }\n });\n }", "public void updateTextView(final String text)\n\t{\n\t\tmHandler.post(new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\tt.setText(text);\n\t\t\t}\n\t\t});\n\t}", "@Override\n\tpublic void textValueChanged(TextEvent e) {\n\t\t\n\t}", "@Override\r\n\t\t\t\tpublic void documentAboutToBeChanged(DocumentEvent event) {\n\t\t\t\t\tif (event.fText.indexOf('\\r') != -1 || event.fText.indexOf('\\n') != -1) {\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tITypedRegion partition = event.fDocument.getPartition(event.fOffset);\r\n\t\t\t\t\t\t\tif (partition instanceof IOConsolePartition) {\r\n\t\t\t\t\t\t\t\tIOConsolePartition p = (IOConsolePartition) partition;\r\n\t\t\t\t\t\t\t\t// check if that is user input\r\n\t\t\t\t\t\t\t\tif (p.getType().equals(IOConsolePartition.INPUT_PARTITION_TYPE)) {\r\n\t\t\t\t\t\t\t\t\tif (event.fText.length() <= 2) {\r\n\t\t\t\t\t\t\t\t\t\tfinal String inputFound = p.getString();\r\n\t\t\t\t\t\t\t\t\t\tfConsoleInterpreter.postRIDECommand(inputFound);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} catch (BadLocationException e) {\r\n\t\t\t\t\t\t\tLog.log(IStatus.ERROR, \"Error in RIDE console Listener.\", e);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "private synchronized void notifyUpdatedOutput(Section section, String outputName, int start, int end, String text) {\n Observer[] observers = observersTable.get(this);\n if (observers != null) {\n for (Observer observer : observers) {\n observer.updatedOutput(this, section, outputName, start, end, text);\n }\n }\n }", "public void startWatching(){\n this.listWatcher.start();\n }", "@Override\n public boolean onQueryTextChange(String newText) {\n return false;\n }", "@Override\n public boolean onQueryTextChange(String newText) {\n return false;\n }", "@Override\n public boolean onQueryTextChange(String newText) {\n return false;\n }", "@Override\n public boolean onQueryTextChange(String newText) {\n return false;\n }", "@Override\n\t\t\t\tpublic void afterTextChanged(Editable s) {\n\t\t\t\t\teqChanged=true;\n\t\t\t\t}", "@Override\r\n\t\tpublic void changedUpdate(DocumentEvent e) {\n\t\t\tMessage = t.getText();\r\n\t\t\tcanvas.repaint();\r\n\t\t\t\r\n\t\t}", "@Override\n public boolean onQueryTextChange(String newText) {\n\n return false;\n }", "protected void initListeners() {\n\t\tfinal StyledText textWidget = fSourceViewer.getTextWidget();\n\t\ttextWidget.addVerifyListener(new VerifyListener() {\n\t\t\t@Override\n\t\t\tpublic void verifyText(VerifyEvent e) {\n\t\t\t\tint start = getExt5().widgetOffset2ModelOffset(e.start);\n\t\t\t\tint end = getExt5().widgetOffset2ModelOffset(e.end);\n\t\t\t\tContainer atStart = fContainerManager\n\t\t\t\t\t\t.getContainerHavingOffset(start);\n\t\t\t\tContainer atEnd = fContainerManager\n\t\t\t\t\t\t.getContainerHavingOffset(end);\n\n\t\t\t\t/* Text replaced */\n\t\t\t\tif ((atStart != null && start != atStart.getPosition()\n\t\t\t\t\t\t.getOffset())\n\t\t\t\t\t\t|| (atEnd != null && e.end != atEnd.getPosition()\n\t\t\t\t\t\t\t\t.getOffset())) {\n\t\t\t\t\te.doit = false;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t/* XXX Visibility */\n\t\t\t\t// fContainerManager.updateContainerVisibility(false);\n\t\t\t}\n\t\t});\n\n\t\ttextWidget.addVerifyKeyListener(new VerifyKeyListener () {\n\n\t\t\t@Override\n\t\t\tpublic void verifyKey(VerifyEvent e) {\n\t\t\t\tOptional<IEditorLocation> position = fContainerManager.getCursonPosition();\n\t\t\t\tint action = getAction(e);\n\t\t\t\tif (position.isPresent()) {\n\t\t\t\t\tif (!position.get().getEditor().handleKey(e)) {\n\t\t\t\t\t\tif (action == SWT.NULL && e.character != 0) {\n\t\t\t\t\t\t\tIEditorLocation replace = fContainerManager.getSelectionModel().replace(String.valueOf(e.character));\n\t\t\t\t\t\t\tfContainerManager.setCursorPosition(replace);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdoAction(action);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\te.doit = false;\n\t\t\t\t} else {\n\t\t\t\t\tif (action == SWT.NULL) {\n\t\t\t\t\t\tif (e.character == SWT.DEL) {\n\t\t\t\t\t\t\taction = ST.DELETE_NEXT;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (action != SWT.NULL) {\n\t\t\t\t\t\tint caretOffset = getExt5().widgetOffset2ModelOffset(textWidget.getCaretOffset());\n\t\t\t\t\t\tswitch (action) {\n\t\t\t\t\t\tcase ST.COLUMN_PREVIOUS:\n\t\t\t\t\t\tcase ST.SELECT_COLUMN_PREVIOUS:\n\t\t\t\t\t\t\te.doit = caretPositionChange(caretOffset, false);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase ST.COLUMN_NEXT:\n\t\t\t\t\t\tcase ST.SELECT_COLUMN_NEXT:\t\n\t\t\t\t\t\t\te.doit = caretPositionChange(caretOffset, true);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase ST.DELETE_NEXT:\n\t\t\t\t\t\t\tContainer container = fContainerManager\n\t\t\t\t\t\t\t\t\t.getContainerHavingOffset(caretOffset);\n\t\t\t\t\t\t\tif (container != null) {\n\t\t\t\t\t\t\t\tcontainer.destroy();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tcase ST.DELETE_PREVIOUS:\n\t\t\t\t\t\t\tContainer prevContainer = fContainerManager\n\t\t\t\t\t\t\t\t\t.getContainerHavingOffset(caretOffset - 1);\n\t\t\t\t\t\t\tif (prevContainer != null) {\n\t\t\t\t\t\t\t\tprevContainer.destroy();\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\t/*\n\t\t * If caret is inside Container's text region, moving it to the end of\n\t\t * line\n\t\t */\n\t\ttextWidget.addCaretListener(new CaretListener() {\n\t\t\t@Override\n\t\t\tpublic void caretMoved(CaretEvent e) {\n\t\t\t\tPoint selection = fSourceViewer.getSelectedRange();\n\t\t\t\tif (selection.y == 0) {\n\t\t\t\t\tint caretOffset = getExt5().widgetOffset2ModelOffset(e.caretOffset);\n\t\t\t\t\tContainer container = fContainerManager\n\t\t\t\t\t\t\t.getContainerHavingOffset(caretOffset);\n\t\t\t\t\tif (container != null) {\n\t\t\t\t\t\tPosition position = container.getPosition();\n\t\t\t\t\t\tif (caretOffset != position.getOffset()) {\n\t\t\t\t\t\t\t/* Move caret to the Pad's border */\n\t\t\t\t\t\t\ttextWidget.setCaretOffset(getExt5().modelOffset2WidgetOffset(position.getOffset()\n\t\t\t\t\t\t\t\t\t+ position.getLength()));\n\t\t\t\t\t\t\tfContainerManager.selectEditor(null);\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\ttextWidget.addMenuDetectListener(new MenuDetectListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void menuDetected(MenuDetectEvent e) {\n\t\t\t\tPoint control = textWidget.toControl(e.x, e.y);\n\t\t\t\tOptional<ITextEditor<?>> editor = fContainerManager.getEditorAt(control.x, control.y);\n\t\t\t\twhile (editor.isPresent() && !(editor.get() instanceof IMenuContributor)) {\n\t\t\t\t\teditor = editor.get().getParent();\n\t\t\t\t}\n\t\t\t\tif (editor.isPresent()) {\n\t\t\t\t\tMenuManager menuManager = new MenuManager();\n\t\t\t\t\tMenu menu = menuManager.createContextMenu(textWidget);\n\t\t\t\t\t((IMenuContributor) editor.get()).contribute(menuManager);\n\t\t\t\t\tmenuManager.update(false);\n\t\t\t\t\tmenu.setLocation(e.x, e.y);\n\t\t\t\t\tmenu.setVisible(true);\n\t\t\t\t\te.doit = false;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\ttextWidget.addFocusListener(new FocusListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void focusLost(FocusEvent e) {\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void focusGained(FocusEvent e) {\n\t\t\t\tfContainerManager.activateEditor(null);\n\t\t\t}\n\t\t});\n\n\t}", "@Override\n public boolean onQueryTextChange(String newText) {\n return false;\n }", "@Override\n\tpublic void beforeGetText(WebElement arg0, WebDriver arg1) {\n\n\t}", "public InputMethodTextRun(@NamedArg(\"text\") String text,\n @NamedArg(\"highlight\") InputMethodHighlight highlight) {\n this.text = text;\n this.highlight = highlight;\n }", "@Override\n public void userStartedTyping(){\n }", "private void setTextWatcherListener() {\n\n TextWatcher textWatcher = new TextWatcher() {\n @Override\n public void onTextChanged(CharSequence s, int start, int before,int count) { }\n @Override\n public void beforeTextChanged(CharSequence s, int start, int count,int after) {}\n @Override\n public void afterTextChanged(Editable s) {\n //Due To Pakistan Phone number start with 3\n if (s.toString().length() == 1 && !s.toString().startsWith(\"3\")) {\n s.clear();\n }\n }\n };\n\n //Set Listener\n etPhoneNumber.addTextChangedListener(textWatcher);\n\n }", "void addTextListener(TextListener l);", "protected void firePropertyChange(String propertyName, Object oldValue, Object newValue)\n/* */ {\n/* 291 */ if (\"text\".equals(propertyName)) {\n/* 292 */ super.firePropertyChange(propertyName, oldValue, newValue);\n/* */ }\n/* */ }", "@Override\n public boolean onQueryTextChange(String newText) {\n adapteer.getFilter().filter(newText);\n return false;\n }", "@Override\n public boolean onQueryTextChange(String newText) {\n return false;\n }", "@Override\n public boolean onQueryTextChange(String newText) {\n\n devicesFragment.getDevicesAdapter().getFilter().filter(newText);\n actionsFragment.getActionsAdapter().getFilter().filter(newText);\n return true;\n }", "@Override\n public void onSearchTermChanged(String term) {\n }", "public void update() {\r\n if (parseStyle == ParseStyle.CHARACTER) {\r\n wrapText();\r\n int begin = getPosition();\r\n int end = getPosition() + 1;\r\n setCurrentItem(new TextItem(begin, end, getText().substring(begin,\r\n end)));\r\n setPosition(end);\r\n } else if (parseStyle == ParseStyle.WORD) {\r\n if (matcher == null) {\r\n return;\r\n }\r\n wrapText();\r\n boolean matchFound = findNextToken();\r\n if (matchFound) {\r\n selectCurrentToken();\r\n } else {\r\n // No match found. Go back to the beginning of the text area\r\n // and select the first token found\r\n setPosition(0);\r\n updateMatcher();\r\n // Having wrapped to the beginning select the next token, if\r\n // there is one.\r\n if (findNextToken()) {\r\n selectCurrentToken();\r\n }\r\n }\r\n }\r\n\r\n }", "private void updateAndAlertListener() {\n\n\t\teditText.setText(getRoundedValue(value));\n\n\t\tif (changeListener != null) {\n\t\t\tchangeListener.onValueChange(this, value);\n\t\t}\n\t}", "@Override\n\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\ttextView.setText(text);\n\t\t\t\t\t\t\t}", "@Override\n public void afterTextChanged(Editable s) {\n outputBasedOnText(s);\n }", "void onNewTextSet(CodeEditor editor);", "private void setText(Text text) {\n \t\tthis.text = text;\n \t}", "void updateTextArea(final String text) {\r\n\t\tSwingUtilities.invokeLater(new Runnable() {\r\n\t\t\tpublic void run() {\r\n\t\t\t\tJCoresConsole.this.textArea.append(text);\r\n\t\t\t}\r\n\t\t});\r\n\t}", "void notifyTextProcessStatusUpdate(TextProcessStatusEvent evt) {\n\n\t\tfor (TextProcessStatusListener l : listeners\n\t\t\t\t.getListeners(TextProcessStatusListener.class)) {\n\n\t\t\tl.update(evt);\n\t\t}\n\t}", "@Override\r\npublic void beforeChangeValueOf(WebElement arg0, WebDriver arg1, CharSequence[] arg2) {\n\tSystem.out.println(\"as\");\r\n}", "public void setText(CharSequence text){\n if(text == null){\n text = \"\";\n }\n\n if(mText != null){\n mText.removeContentListener(this);\n }\n mText = new Content(text);\n mCursor = mText.getCursor();\n mCursor.setAutoIndent(mAutoIndent);\n mCursor.setLanguage(mLanguage);\n mEventHandler.reset();\n mText.addContentListener(this);\n mText.setUndoEnabled(mUndoEnabled);\n\n if(mSpanner != null){\n mSpanner.setCallback(null);\n }\n mSpanner = new TextColorProvider(mLanguage.createAnalyzer());\n mSpanner.setCallback(this);\n\n TextColorProvider.TextColors colors = mSpanner.getColors();\n colors.getSpans().clear();\n mSpanner.analyze(getText());\n\n mMaxPaintX = 0;\n mMinModifiedLine = -1;\n //requestLayout();\n\n if(mInputMethodManager != null) {\n mInputMethodManager.restartInput(this);\n }\n invalidate();\n }", "@Override\n public void onSearchTermChanged() {\n }", "public interface TextModel\n{\n /**\n * Returns the line at the specified line number.\n * @param line the specified line number.\n * @return a line at the specified line number.\n */\n String getLine (int line);\n\n /**\n * Sets the specified text data. As rule the method should perform parsing process.\n * The process decides how the text data have to be divided into lines.\n * @param text the specified text data.\n */\n void setText (String text);\n\n /**\n * Returns the original text data that have been set with <code>setText</code> method.\n * @return an original text data.\n */\n String getText ();\n\n /**\n * Returns the number of lines for the text model.\n * @return a number of lines.\n */\n int getSize ();\n\n /**\n * Inserts the specified text at the given offset. The offset has to be less than the text\n * length. Actually the method performs re-parsing of the text.\n * @param s the text to be inserted.\n * @param offset the offset where the text will be inserted.\n */\n void write (String s, int offset);\n\n /**\n * Inserts the specified character at the given offset. The offset has to be less than the text\n * length. Actually the method performs re-parsing of the text.\n * @param ch the character to be inserted.\n * @param offset the offset where the character will be inserted.\n */\n void write (char ch, int offset);\n\n /**\n * Removes a text at the specified offset with the size. The offset and the offset plus the\n * size have to be less than the text length.\n * @param offset the offset where the text will be removed.\n * @param size the size of the part that is going to be removed.\n */\n void remove (int offset, int size);\n\n /**\n * Returns the text length (number of the text characters).\n * @return a text length.\n */\n int getTextLength();\n\n /**\n * Adds the specified text listener to receive text events.\n * @param l the text listener.\n * @see org.zaval.data.event.TextListener\n * @see org.zaval.data.event.TextEvent\n */\n void addTextListener(TextListener l);\n\n /**\n * Removes the specified text listener.\n * @param l the text listener.\n * @see org.zaval.data.event.TextListener\n * @see org.zaval.data.event.TextEvent\n */\n void removeTextListener(TextListener l);\n\n\n /**\n * Gets special extra char that is used to store extra information by the specified index.\n * The method is deprecated to be used, because it will be probably re-designed in the future.\n * @param i the specified extra char index.\n * @return an extra char value.\n */\n int getExtraChar (int i);\n\n /**\n * Sets special extra char that is used to store extra information by the specified index.\n * The method is deprecated, since probably it will be re-designed in the future.\n * @param i the specified extra char index.\n * @param val the specified extra char value.\n */\n void setExtraChar (int i, int val);\n}", "private void txt() {\n\n\t}", "public interface EdittextListener {\n void onQuery(String s);\n\n void onClear();\n\n void onContentChange(String s);\n}", "@Override\r\n\t\t\tpublic void documentAboutToBeChanged(DocumentEvent event) {\n\t\t\t\tif (event.fText.indexOf('\\r') != -1 || event.fText.indexOf('\\n') != -1) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tITypedRegion partition = event.fDocument.getPartition(event.fOffset);\r\n\t\t\t\t\t\tif (partition instanceof IOConsolePartition) {\r\n\t\t\t\t\t\t\tIOConsolePartition p = (IOConsolePartition) partition;\r\n\t\t\t\t\t\t\t// check if that is user input\r\n\t\t\t\t\t\t\tif (p.getType().equals(IOConsolePartition.INPUT_PARTITION_TYPE)) {\r\n\t\t\t\t\t\t\t\tif (event.fText.length() <= 2) {\r\n\t\t\t\t\t\t\t\t\tfinal String inputFound = p.getString();\r\n\t\t\t\t\t\t\t\t\tif (inputFound.length() > 0)\r\n\t\t\t\t\t\t\t\t\t\tfConsoleInterpreter.postSessionPrompt(inputFound);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} catch (BadLocationException e) {\r\n\t\t\t\t\t\tLog.log(IStatus.ERROR, \"Error in RIDE console Listener.\", e);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}", "private void updateDisplayText(double change) { updateDisplayText(change, null); }", "public void markChanged()\n \t{\n \t\tbChanged=true;\n \t}", "@Override\n\tpublic void characters(String text) {\n\t\t\n\t}", "public void run () {\n\t\t\t\t//This is the method that gets called everytime the GUI needs to be updated.\n\t\t\t\t\n\t\tuserText.setEditable(tof);\n\t\t\t}", "public abstract void onTextReceived(String message);", "public void MonitorTextView()\n {\n TextView textview = (TextView) findViewById(R.id.textViewDelayLength);\n textview.setOnClickListener(new View.OnClickListener()\n {\n @Override\n public void onClick(View v) {\n EditText editText = (EditText) findViewById(R.id.editTextMessageDelay);\n SeekBar seek = (SeekBar) findViewById(R.id.seekBarMessageDelay);\n if (editText.getVisibility() == View.GONE)\n {\n editText.setVisibility(View.VISIBLE);\n seek.setVisibility(View.GONE);\n }\n else if (editText.getVisibility() == View.VISIBLE)\n {\n editText.setVisibility(View.GONE);\n seek.setVisibility(View.VISIBLE);\n }\n }\n });\n }", "@Override\n public void afterTextChanged(Editable p1) {\n }", "@Override\n public void afterTextChanged(Editable p1) {\n }", "@Override\n public void onChanged(Measurement measurement) {\n updateTextViews(measurement.getTimeStamp(),\n measurement.isGi(), measurement.getAmount(),\n measurement.getStress(), measurement.getTired(), measurement.isPhysicallyActivity(),\n measurement.isAlcoholConsumed(), measurement.isIll(), measurement.isMedication(),\n measurement.isPeriod(), measurement.getGlucoseStart(), measurement.getGlucose15(),\n measurement.getGlucose30(), measurement.getGlucose45(), measurement.getGlucose60(),\n measurement.getGlucose75(), measurement.getGlucose90(), measurement.getGlucose105(),\n measurement.getGlucose120()\n );\n }", "@Override\n public void afterTextChanged(Editable s) {\n filter(s.toString());\n //you can use runnable postDelayed like 500 ms to delay search text\n }", "@Override\n \t\t\tpublic void beforeTextChanged(CharSequence s, int start, int count, int after) {\n \t\t }", "public void setText(String text)\n\t{\n\t Change.push(new BufferNote(this));\n\t\tthis.text = text;\n\t\tChange.push(new BufferNote(this));\n\n\t\trepaint();\n\t}", "@Override\n public void run() {\n\t\t\t\t\ttable.getDisplay().timerExec(100, new Runnable() {\n\t\t\t\t\t\t@Override\n public void run() {\n//\t\t\t\t\t\t\tfindText.setBackground(PropertyChangeListener.getColor(found == null && matchCount == 0 ? new RGB(255, 0, 0) : new RGB(255, 255, 255)));\n\t\t\t\t\t\t\tif (!wrapped)\n\t\t\t\t\t\t\t\thexEditor.getEditorSite().getActionBars().getStatusLineManager().setMessage(found == null && matchCount == 0 ? Messages.HexEditorControl_7 : matchCount > 0 ? Messages.HexEditorControl_8 + matchCount + Messages.HexEditorControl_9 : null);\n\t\t\t\t\t\t\tupdateStatusPanel();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}", "@Override\n public void afterTextChanged(Editable s) {}", "@Override\n public boolean onQueryTextChange(String newText) {\n // store the search query being entered in a global object that will be used to persist data\n // note: intentionally we use another string instead of @searchQueryToRestore, as SearchView\n // query is at first set to null (at the time SearchView is initialised), before setQuery()\n // method is called\n searchQueryToListen = newText;\n return false;\n }", "@Override\n public void afterTextChanged(Editable s) {\n\n }", "private void update_text() {\n\n if(i < text_data.length) {\n i++;\n // text_data.setText(String.valueOf(i)); = avoid the RunTime error\n myHandler.post(myRunnable); // relate this to a Runnable\n } else {\n myTimer.cancel(); // stop the timer\n return;\n }\n }", "void setText(String text);", "public void afterTextChanged(Editable s) {\n\t \tLog.d(\"LiveMeshEventControllerActivity displayEditText.addTextChangedListener\", \"Text changed: \" + s.toString());\n\t \tString newText = s.toString();\n\t \tif (TextUtils.isEmpty(newText)) {\n\t \t\tnewText = \"%20\";\n\t \t}\n\t \tLog.d(\"LiveMeshEventControllerActivity displayEditText.addTextChangedListener\", \"newText: \" + s.toString());\n\t \tsetTextTask = new SetTextForDeviceTask();\n\t \tif (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {\n\t \t\tsetTextTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, clientToDisplay.id, newText);\n\t \t} else {\n\t \t\tsetTextTask.execute(clientToDisplay.id, newText);\n\t \t}\n\n\t }", "@Override\n\t\t\tpublic void onTextChanged(CharSequence arg0, int arg1, int arg2,\n\t\t\t\t\tint arg3) {\n\t\t\t\tupdateList();\n\t\t\t}", "@Override\n public void afterTextChanged(Editable s) {\n }", "@Override\n public void afterTextChanged(Editable s) {\n }", "@Override\n public void afterTextChanged(Editable s)\n {\n \n }", "public void afterTextChanged(Editable s) {\n }", "public void afterTextChanged(Editable s) {\n }", "public void afterTextChanged(Editable s) {\n }", "public void afterTextChanged(Editable s) {\n }", "public void afterTextChanged(Editable s) {\n }", "public void afterTextChanged(Editable s) {\n }", "public void afterTextChanged(Editable s) {\n }", "public void afterTextChanged(Editable s) {\n }" ]
[ "0.63222873", "0.6265376", "0.625701", "0.61361176", "0.61357427", "0.60480505", "0.6037841", "0.6010572", "0.60068154", "0.59348", "0.5934284", "0.5918711", "0.5900948", "0.5900948", "0.5876832", "0.58589494", "0.584464", "0.5830397", "0.58179283", "0.58083314", "0.579062", "0.5722187", "0.5704843", "0.5702024", "0.56809604", "0.5664195", "0.5652977", "0.5650261", "0.5647881", "0.5616433", "0.56143415", "0.5606536", "0.5596092", "0.5547023", "0.55456245", "0.5541403", "0.55388224", "0.55388224", "0.55388224", "0.55388224", "0.55295944", "0.5504533", "0.54975516", "0.5488801", "0.54771245", "0.5476076", "0.5455317", "0.5449016", "0.54458505", "0.5425855", "0.54247934", "0.5419383", "0.54158115", "0.5414026", "0.540959", "0.54000425", "0.5396935", "0.5396141", "0.5392542", "0.53897285", "0.53875154", "0.5380591", "0.53747076", "0.5370906", "0.5368748", "0.5360737", "0.5359608", "0.53589225", "0.53355014", "0.5334481", "0.5329847", "0.5327237", "0.5309981", "0.53071445", "0.53038836", "0.5300478", "0.52978784", "0.52978784", "0.52957904", "0.5295229", "0.5293806", "0.52903396", "0.5273565", "0.5272112", "0.5271392", "0.52695847", "0.5264125", "0.52610075", "0.5260726", "0.52604306", "0.5256463", "0.5256463", "0.5252687", "0.5246517", "0.5246517", "0.5246517", "0.5246517", "0.5246517", "0.5246517", "0.5246517", "0.5246517" ]
0.0
-1
/ method watches when text changes
@Override public void onTextChanged(CharSequence s, int start, int before, int count) { search(searchIput.getText().toString()); // search user }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void notifyAfterTextChanged() {\n removeMessages(ON_TEXT_CHANGED);\n sendEmptyMessageDelayed(ON_TEXT_CHANGED, DELAY_IN_MILLISECOND);\n }", "void textChanged() {\n\t\ttextAreaChanged = true;\n\t\tfinder.clear();\n\t\tfindIndex = 0;\n\t\ttextEditor.getHighlighter().removeAllHighlights();\n\t\terrorTextArea.setText(\"\");\n\t}", "@Override\n public boolean onQueryTextChange(String newText) {\n filter(newText);\n return true;\n }", "@Override\r\n\t\t\tpublic boolean onQueryTextChange(String newText) {\n\t\t\t\tdebugMemory(\"onQueryTextChange\");\r\n\t\t\t\treturn false;\r\n\t\t\t}", "@Override\n\tpublic void textValueChanged(TextEvent e) {\n\t\t\n\t}", "protected void updateTextChange() {\n \t\t\tfText= fDocumentUndoManager.fTextBuffer.toString();\n \t\t\tfDocumentUndoManager.fTextBuffer.setLength(0);\n \t\t\tfPreservedText= fDocumentUndoManager.fPreservedTextBuffer.toString();\n \t\t\tfDocumentUndoManager.fPreservedTextBuffer.setLength(0);\n \t\t}", "public boolean onQueryTextChange (String newText) {\n return true;\n }", "public interface OnTextChange {\n void addTextChangedListener(TextWatcher watcher);\n boolean isEmpty();\n Editable getText();\n int getVisibility();\n}", "private void monitorTextChange() {\n List<TextInputEditText> textInputEditTextList = new ArrayList<>();\n textInputEditTextList.add(tin_perLitrePrice); // first line is selected automatically\n textInputEditTextList.add(tin_fuelQuantityLitres);\n textInputEditTextList.add(tin_totalFuelPrice);\n textInputEditTextList.add(tin_currentKm);\n textInputEditTextList.add(tin_startingKm);\n textInputEditTextList.add(tin_distanceCovered);\n\n for (TextInputEditText item : textInputEditTextList) {\n\n\n item.addTextChangedListener(new TextWatcher() {\n @Override\n public void beforeTextChanged(CharSequence s, int start, int count, int after) {\n\n }\n\n @Override\n public void onTextChanged(CharSequence s, int start, int before, int count) {\n }\n\n @Override\n public void afterTextChanged(Editable s) {\n Log.d(TAG, \"afterTextChanged: \");\n fabSaveFuelData.hide(); // hide save button\n tv_calculatedAverage_addEdit.setText(\"--km/l\");\n }\n });\n }\n\n // tv_input_fuel_date is a TextView so we need to add this separately\n tv_input_fuel_date.addTextChangedListener(new TextWatcher() {\n @Override\n public void beforeTextChanged(CharSequence s, int start, int count, int after) {\n\n }\n\n @Override\n public void onTextChanged(CharSequence s, int start, int before, int count) {\n\n }\n\n @Override\n public void afterTextChanged(Editable s) {\n }\n });\n }", "public boolean onQueryTextChange(String newText) {\n return true;\n }", "public boolean onQueryTextChange(String newText) {\n return true;\n }", "public void textChanged(TextChangedEvent e) {\n System.out.println(\"Received TextChangeEvent!\");\n TestCase.assertEquals(\"Old text mismatched.\", \"old text\", e.getOldText());\n TestCase.assertEquals(\"New text mismatched.\", \"new text\", e.getNewText());\n }", "@Override\n\t\tpublic boolean onQueryTextChange(String newText) {\n\t\t\treturn false;\n\t\t}", "@Test\r\n public void ensureTextChangesWork() {\n onView(withId(R.id.inputField))\r\n .perform(typeText(\"HELLO\"), closeSoftKeyboard());\r\n reportHelper.label(\"myTestStepLabel_1_1\");\r\n onView(withId(R.id.changeText)).perform(click());\r\n\r\n // Check that the text was changed.\r\n onView(withId(R.id.inputField)).check(matches(withText(\"Lalala\")));\r\n reportHelper.label(\"myTestStepLabel_1_2\");\r\n }", "@Override\n public void onTextChanged(CharSequence text) {\n }", "@Override\n public void statusChanged(String text) {\n fireStatusChanged(text);\n }", "@Override\r\n\t\tpublic void changedUpdate(DocumentEvent e) {\n\t\t\tMessage = t.getText();\r\n\t\t\tcanvas.repaint();\r\n\t\t\t\r\n\t\t}", "@Override\n public void afterTextChanged(Editable theWatchedText) {\n unitIdChanged = theWatchedText.toString();\n // deal2.getBranchName();\n SessionData.getInstance().setBname(unitIdChanged);\n\n// if (session == 0) {\n//\n// new AsyncDealerBranchFiltter().execute();\n// } else if (session == 1) {\n// new AsyncDealerBranchFiltter().execute();\n//\n// }\n\n }", "@Override\n public boolean onQueryTextChange(String newText)\n {\n return false;\n }", "@Override\n public boolean onQueryTextChange(String newText) {\n return false;\n }", "@Override\n\t\t\t\tpublic void afterTextChanged(Editable s) {\n\t\t\t\t\teqChanged=true;\n\t\t\t\t}", "@Override\n public boolean onQueryTextChange(String newText) {\n if(newText.length() > 0) {\n filterRunner(newText);\n } else {\n mRunnersAdapter.setRunners(mRunners);\n mRunnersAdapter.notifyDataSetChanged();\n }\n\n return false;\n }", "@Override\n\tpublic boolean onQueryTextChange(String newText) {\n\t\treturn false;\n\t}", "private void listenToTextChanges(boolean listen) {\n \t\tif (listen) {\n \t\t\tif (fDocumentListener == null && fDocument != null) {\n \t\t\t\tfDocumentListener= new DocumentListener();\n \t\t\t\tfDocument.addDocumentListener(fDocumentListener);\n \t\t\t}\n \t\t} else if (!listen) {\n \t\t\tif (fDocumentListener != null && fDocument != null) {\n \t\t\t\tfDocument.removeDocumentListener(fDocumentListener);\n \t\t\t\tfDocumentListener= null;\n \t\t\t}\n \t\t}\n \t}", "private void refreshSuggestions() {\n \t\tString text = textBox.getText();\n \t\tif (text.equals(currentText)) {\n \t\t\treturn;\n \t\t} else {\n \t\t\tcurrentText = text;\n \t\t}\n \t\tfindSuggestions(text);\n \t}", "@Override\n\tpublic boolean onQueryTextChange(String newText) {\n\t\tLog.v(\"query\",\"onQueryTextChange\");\n\t\tmTextView.setText(\"Searching for \" + newText);\n\t\treturn false;\n\t}", "@Override\n public boolean onQueryTextChange(String newText) {\n return false;\n }", "@Override\n public boolean onQueryTextChange(String newText) {\n return false;\n }", "@Override\n public boolean onQueryTextChange(String newText) {\n return false;\n }", "@Override\n public boolean onQueryTextChange(String newText) {\n return false;\n }", "@Override\n public boolean onQueryTextChange(String newText) {\n\n return false;\n }", "@Override\n public void afterTextChanged(Editable s) {\n outputBasedOnText(s);\n }", "@Override\r\n\t\t\t\tpublic void documentAboutToBeChanged(DocumentEvent event) {\n\t\t\t\t\tif (event.fText.indexOf('\\r') != -1 || event.fText.indexOf('\\n') != -1) {\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tITypedRegion partition = event.fDocument.getPartition(event.fOffset);\r\n\t\t\t\t\t\t\tif (partition instanceof IOConsolePartition) {\r\n\t\t\t\t\t\t\t\tIOConsolePartition p = (IOConsolePartition) partition;\r\n\t\t\t\t\t\t\t\t// check if that is user input\r\n\t\t\t\t\t\t\t\tif (p.getType().equals(IOConsolePartition.INPUT_PARTITION_TYPE)) {\r\n\t\t\t\t\t\t\t\t\tif (event.fText.length() <= 2) {\r\n\t\t\t\t\t\t\t\t\t\tfinal String inputFound = p.getString();\r\n\t\t\t\t\t\t\t\t\t\tfConsoleInterpreter.postRIDECommand(inputFound);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} catch (BadLocationException e) {\r\n\t\t\t\t\t\t\tLog.log(IStatus.ERROR, \"Error in RIDE console Listener.\", e);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "public void onTextCopy()\n\t{\n\t}", "@Override\n public void afterTextChanged(Editable s) {}", "@Override\n public boolean onQueryTextChange(String newText) {\n return false;\n }", "@Test\n public void ensureTextChangesWork(){\n onView(withId(R.id.placeEditText)).perform(typeText(\"London\"));\n\n // Check that the language text was changed.\n onView(withId(R.id.languageEditText)).perform(typeText(\"It\"));\n\n // Check that the language text was changed.\n onView(withId(R.id.maxrowsEditText)).perform(typeText(\"3\"));\n\n // check button click\n onView(withId(R.id.button)).perform(click());\n\n // check returned list view\n onView(withId(R.id.listViewResult)).check(matches(isDisplayed()));\n }", "private void updateAndAlertListener() {\n\n\t\teditText.setText(getRoundedValue(value));\n\n\t\tif (changeListener != null) {\n\t\t\tchangeListener.onValueChange(this, value);\n\t\t}\n\t}", "@Override\n public void afterTextChanged(Editable s) {\n\n }", "@Override\n public boolean onQueryTextChange(String newText) {\n return false;\n }", "@Override\n public void afterTextChanged(Editable s)\n {\n \n }", "@Override\n public void afterTextChanged(Editable s) {\n }", "@Override\n public void afterTextChanged(Editable s) {\n }", "@Override\r\n\t\t\tpublic void documentAboutToBeChanged(DocumentEvent event) {\n\t\t\t\tif (event.fText.indexOf('\\r') != -1 || event.fText.indexOf('\\n') != -1) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tITypedRegion partition = event.fDocument.getPartition(event.fOffset);\r\n\t\t\t\t\t\tif (partition instanceof IOConsolePartition) {\r\n\t\t\t\t\t\t\tIOConsolePartition p = (IOConsolePartition) partition;\r\n\t\t\t\t\t\t\t// check if that is user input\r\n\t\t\t\t\t\t\tif (p.getType().equals(IOConsolePartition.INPUT_PARTITION_TYPE)) {\r\n\t\t\t\t\t\t\t\tif (event.fText.length() <= 2) {\r\n\t\t\t\t\t\t\t\t\tfinal String inputFound = p.getString();\r\n\t\t\t\t\t\t\t\t\tif (inputFound.length() > 0)\r\n\t\t\t\t\t\t\t\t\t\tfConsoleInterpreter.postSessionPrompt(inputFound);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} catch (BadLocationException e) {\r\n\t\t\t\t\t\tLog.log(IStatus.ERROR, \"Error in RIDE console Listener.\", e);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}", "public void afterTextChanged(Editable s) {\n\t \tLog.d(\"LiveMeshEventControllerActivity displayEditText.addTextChangedListener\", \"Text changed: \" + s.toString());\n\t \tString newText = s.toString();\n\t \tif (TextUtils.isEmpty(newText)) {\n\t \t\tnewText = \"%20\";\n\t \t}\n\t \tLog.d(\"LiveMeshEventControllerActivity displayEditText.addTextChangedListener\", \"newText: \" + s.toString());\n\t \tsetTextTask = new SetTextForDeviceTask();\n\t \tif (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {\n\t \t\tsetTextTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, clientToDisplay.id, newText);\n\t \t} else {\n\t \t\tsetTextTask.execute(clientToDisplay.id, newText);\n\t \t}\n\n\t }", "public interface EdittextListener {\n void onQuery(String s);\n\n void onClear();\n\n void onContentChange(String s);\n}", "@Override\n\t\t\t\tpublic void afterTextChanged(Editable s) {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n\t\t\t\tpublic void afterTextChanged(Editable s) {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n public boolean onQueryTextChange(String newText) {\n adapteer.getFilter().filter(newText);\n return false;\n }", "public void textChanged(ObservableValue observable, String oldValue,\r\n String newValue){\r\n if(txtFName.getLength() == 256){\r\n LOGGER.log(Level.INFO, \"Name too long\");\r\n txtFName.setText(txtFName.getText().substring(0, 255));\r\n new Alert(AlertType.INFORMATION, \"Name too long\", ButtonType.OK).showAndWait();\r\n }\r\n\r\n if(txtFEmail.getLength() == 256){\r\n LOGGER.log(Level.INFO, \"Email too long\");\r\n txtFEmail.setText(txtFName.getText().substring(0, 255));\r\n new Alert(AlertType.INFORMATION, \"Email too long\", ButtonType.OK).showAndWait();\r\n }\r\n\r\n if(txtFPhone.getLength() == 13){\r\n LOGGER.log(Level.INFO, \"Phone too long\");\r\n txtFPhone.setText(txtFPhone.getText().substring(0, 12));\r\n new Alert(AlertType.INFORMATION, \"Phone too long\", ButtonType.OK).showAndWait();\r\n }\r\n \r\n }", "@Override\n public void afterTextChanged(Editable p1) {\n }", "@Override\n public void afterTextChanged(Editable p1) {\n }", "@Override\n\t\t\t\tpublic void afterTextChanged(Editable s) {\n\t\t\t\t\tbqChanged=true;\n\t\t\t\t}", "@Override\n\t\t\t\t\t\t\t\tpublic void afterTextChanged(Editable s) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}", "@Override\n public void afterTextChanged(Editable s) {\n }", "private void setTextWatcherListener() {\n\n TextWatcher textWatcher = new TextWatcher() {\n @Override\n public void onTextChanged(CharSequence s, int start, int before,int count) { }\n @Override\n public void beforeTextChanged(CharSequence s, int start, int count,int after) {}\n @Override\n public void afterTextChanged(Editable s) {\n //Due To Pakistan Phone number start with 3\n if (s.toString().length() == 1 && !s.toString().startsWith(\"3\")) {\n s.clear();\n }\n }\n };\n\n //Set Listener\n etPhoneNumber.addTextChangedListener(textWatcher);\n\n }", "private void onContentsChanged(IChangeEvent event) {\n IPosition fromPos = event.getFrom();\n int fromOffset = mapper.getOffset(fromPos.getLine(), fromPos.getChar());\n IPosition toPos = event.getTo();\n int toOffset = mapper.getOffset(toPos.getLine(), toPos.getChar());\n // Create a transformation that corresponds to the change.\n TransformBuilder builder = new TransformBuilder();\n builder.skip(fromOffset);\n if (fromOffset != toOffset)\n builder.delete(mapper.substring(fromOffset, toOffset));\n for (int i = 0; i < event.getTextLineCount(); i++) {\n if (i > 0)\n builder.insert(\"\\n\");\n builder.insert(event.getTextLine(i));\n }\n builder.skip(mapper.getLength() - toOffset);\n Transform transform = builder.flush();\n Assert.equals(mapper.getLength(), transform.getInputLength());\n for (IListener listener : listeners)\n listener.onChange(transform);\n doc.apply(transform);\n mapper.apply(transform);\n }", "@Override\n \t \t public void afterTextChanged(Editable s) {\n\n \t \t }", "@Override\n public void afterTextChanged(Editable s) {}", "@Override\n public void afterTextChanged(Editable s) {\n\n }", "@Override\n public void afterTextChanged(Editable s) {\n\n }", "@Override\n public void afterTextChanged(Editable s) {\n\n }", "@Override\n public void afterTextChanged(Editable s) {\n\n }", "@Override\n public void afterTextChanged(Editable s) {\n\n }", "@Override\n public void afterTextChanged(Editable s) {\n\n }", "@Override\n public void afterTextChanged(Editable s) {\n\n }", "@Override\n public void afterTextChanged(Editable s) {\n\n }", "@Override\n\t\tpublic void afterTextChanged(Editable s) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void afterTextChanged(Editable s) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void afterTextChanged(Editable s) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void afterTextChanged(Editable s) {\n\t\t\t\n\t\t}", "@Override\n\t\t\tpublic void afterTextChanged(Editable arg0) {\n\t\t\t}", "@Override\n\t\t\tpublic void afterTextChanged(Editable arg0) {\n\t\t\t}", "@Override\n\t\t\tpublic void afterTextChanged(Editable arg0) {\n\t\t\t}", "@Override\n\t\t\tpublic void afterTextChanged(Editable arg0) {\n\t\t\t}", "@Override\n public void afterTextChanged(Editable editable) {\n filter(editable.toString());\n }", "@Override\n public void afterTextChanged(Editable s) {\n\n }", "@Override\n public void afterTextChanged(Editable s) {\n\n }", "@Override\n public void afterTextChanged(Editable arg0) {\n\n }", "@Override\n public void afterTextChanged(Editable s) {\n\n\n }", "@Override\n\t\t\tpublic void afterTextChanged(Editable s) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void afterTextChanged(Editable s) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void afterTextChanged(Editable s) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void afterTextChanged(Editable s) {\n\t\t\t\t\n\t\t\t}", "@Override\n public void afterTextChanged(Editable editable) {\n filter(editable.toString());\n\n }", "@Override\n\t\t\tpublic void afterTextChanged(Editable arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void afterTextChanged(Editable arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void afterTextChanged(Editable arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\n public void afterTextChanged(Editable s) {\n }", "@Override\n public boolean onQueryTextChange(String newText) {\n // store the search query being entered in a global object that will be used to persist data\n // note: intentionally we use another string instead of @searchQueryToRestore, as SearchView\n // query is at first set to null (at the time SearchView is initialised), before setQuery()\n // method is called\n searchQueryToListen = newText;\n return false;\n }", "@Override\n\t\t\tpublic void onTextChanged(CharSequence arg0, int arg1, int arg2,\n\t\t\t\t\tint arg3) {\n\t\t\t\tupdateList();\n\t\t\t}", "public void updateText( String text ) {\n\t\tthis.text = text;\n\t}", "@Override\n public void afterTextChanged(Editable charSequence) {\n }", "@Override\n\tpublic void changedUpdate(DocumentEvent e) {\n\t\tif(!listenChange) return;\n\t\tdisplaySelf = false;\n\t\tint offset = e.getOffset();\n\t\tint length = e.getLength();\n\t\tString document = \"NULL\";\n\t\ttry {\n\t\t\tdocument = e.getDocument().getText(offset, length);\n\t\t} catch (BadLocationException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\tSystem.out.println(\"Event: \" + offset + \", \" + length + \", \" + document);\n\t}", "@Override\r\n public void afterTextChanged(Editable s) {\n }", "@Override\r\n public void afterTextChanged(Editable s) {\n }", "@Override\n public void afterTextChanged(Editable s) {\n }", "@Override\n public void afterTextChanged(Editable s) {\n }", "@Override\n public void afterTextChanged(Editable s) {\n }", "@Override\n public void afterTextChanged(Editable s) {\n }", "@Override\n public void afterTextChanged(Editable s) {\n }" ]
[ "0.6877372", "0.68362296", "0.6746279", "0.67042524", "0.6695143", "0.6670408", "0.6663861", "0.6648871", "0.6638966", "0.66090673", "0.66090673", "0.65933925", "0.65512323", "0.6550163", "0.65143025", "0.6456257", "0.64529926", "0.6413548", "0.63652813", "0.6363735", "0.6354877", "0.6308906", "0.6308757", "0.63052386", "0.6292164", "0.6286651", "0.6277057", "0.6277057", "0.6277057", "0.6277057", "0.62341744", "0.6221138", "0.62181187", "0.6214884", "0.6212652", "0.6208888", "0.62052554", "0.620432", "0.6174952", "0.6162138", "0.613909", "0.6133159", "0.6133159", "0.61272347", "0.612701", "0.6121455", "0.61148626", "0.61148626", "0.6114748", "0.61105573", "0.6110035", "0.6110035", "0.6099776", "0.60917854", "0.60784173", "0.60782623", "0.6075887", "0.60755926", "0.60597897", "0.6058892", "0.6058892", "0.6058892", "0.6058892", "0.6058892", "0.6058892", "0.6058892", "0.6058892", "0.6058217", "0.6058217", "0.6058217", "0.6058217", "0.60506994", "0.60506994", "0.60506994", "0.60506994", "0.60482556", "0.6046237", "0.6046237", "0.60457265", "0.60444224", "0.6042391", "0.6042391", "0.6042391", "0.6042391", "0.60421604", "0.6037959", "0.6037959", "0.6037959", "0.6031833", "0.6031703", "0.60263896", "0.6016635", "0.6015893", "0.60140234", "0.6012839", "0.6012839", "0.6007533", "0.6007533", "0.6007533", "0.6007533", "0.6007533" ]
0.0
-1
/ method watches after text changes
@Override public void afterTextChanged(Editable s) { if (s.length() != 0) { search(searchIput.getText().toString()); // search user } // if input is not empty }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void notifyAfterTextChanged() {\n removeMessages(ON_TEXT_CHANGED);\n sendEmptyMessageDelayed(ON_TEXT_CHANGED, DELAY_IN_MILLISECOND);\n }", "void textChanged() {\n\t\ttextAreaChanged = true;\n\t\tfinder.clear();\n\t\tfindIndex = 0;\n\t\ttextEditor.getHighlighter().removeAllHighlights();\n\t\terrorTextArea.setText(\"\");\n\t}", "protected void updateTextChange() {\n \t\t\tfText= fDocumentUndoManager.fTextBuffer.toString();\n \t\t\tfDocumentUndoManager.fTextBuffer.setLength(0);\n \t\t\tfPreservedText= fDocumentUndoManager.fPreservedTextBuffer.toString();\n \t\t\tfDocumentUndoManager.fPreservedTextBuffer.setLength(0);\n \t\t}", "@Override\n public boolean onQueryTextChange(String newText) {\n filter(newText);\n return true;\n }", "@Test\r\n public void ensureTextChangesWork() {\n onView(withId(R.id.inputField))\r\n .perform(typeText(\"HELLO\"), closeSoftKeyboard());\r\n reportHelper.label(\"myTestStepLabel_1_1\");\r\n onView(withId(R.id.changeText)).perform(click());\r\n\r\n // Check that the text was changed.\r\n onView(withId(R.id.inputField)).check(matches(withText(\"Lalala\")));\r\n reportHelper.label(\"myTestStepLabel_1_2\");\r\n }", "@Override\r\n\t\t\tpublic boolean onQueryTextChange(String newText) {\n\t\t\t\tdebugMemory(\"onQueryTextChange\");\r\n\t\t\t\treturn false;\r\n\t\t\t}", "private void monitorTextChange() {\n List<TextInputEditText> textInputEditTextList = new ArrayList<>();\n textInputEditTextList.add(tin_perLitrePrice); // first line is selected automatically\n textInputEditTextList.add(tin_fuelQuantityLitres);\n textInputEditTextList.add(tin_totalFuelPrice);\n textInputEditTextList.add(tin_currentKm);\n textInputEditTextList.add(tin_startingKm);\n textInputEditTextList.add(tin_distanceCovered);\n\n for (TextInputEditText item : textInputEditTextList) {\n\n\n item.addTextChangedListener(new TextWatcher() {\n @Override\n public void beforeTextChanged(CharSequence s, int start, int count, int after) {\n\n }\n\n @Override\n public void onTextChanged(CharSequence s, int start, int before, int count) {\n }\n\n @Override\n public void afterTextChanged(Editable s) {\n Log.d(TAG, \"afterTextChanged: \");\n fabSaveFuelData.hide(); // hide save button\n tv_calculatedAverage_addEdit.setText(\"--km/l\");\n }\n });\n }\n\n // tv_input_fuel_date is a TextView so we need to add this separately\n tv_input_fuel_date.addTextChangedListener(new TextWatcher() {\n @Override\n public void beforeTextChanged(CharSequence s, int start, int count, int after) {\n\n }\n\n @Override\n public void onTextChanged(CharSequence s, int start, int before, int count) {\n\n }\n\n @Override\n public void afterTextChanged(Editable s) {\n }\n });\n }", "@Override\n public void afterTextChanged(Editable theWatchedText) {\n unitIdChanged = theWatchedText.toString();\n // deal2.getBranchName();\n SessionData.getInstance().setBname(unitIdChanged);\n\n// if (session == 0) {\n//\n// new AsyncDealerBranchFiltter().execute();\n// } else if (session == 1) {\n// new AsyncDealerBranchFiltter().execute();\n//\n// }\n\n }", "public boolean onQueryTextChange (String newText) {\n return true;\n }", "private void refreshSuggestions() {\n \t\tString text = textBox.getText();\n \t\tif (text.equals(currentText)) {\n \t\t\treturn;\n \t\t} else {\n \t\t\tcurrentText = text;\n \t\t}\n \t\tfindSuggestions(text);\n \t}", "public boolean onQueryTextChange(String newText) {\n return true;\n }", "public boolean onQueryTextChange(String newText) {\n return true;\n }", "@Override\n\t\tpublic boolean onQueryTextChange(String newText) {\n\t\t\treturn false;\n\t\t}", "@Override\n\t\t\t\tpublic void afterTextChanged(Editable s) {\n\t\t\t\t\teqChanged=true;\n\t\t\t\t}", "@Override\r\n\t\tpublic void changedUpdate(DocumentEvent e) {\n\t\t\tMessage = t.getText();\r\n\t\t\tcanvas.repaint();\r\n\t\t\t\r\n\t\t}", "@Override\n public boolean onQueryTextChange(String newText) {\n if(newText.length() > 0) {\n filterRunner(newText);\n } else {\n mRunnersAdapter.setRunners(mRunners);\n mRunnersAdapter.notifyDataSetChanged();\n }\n\n return false;\n }", "private void listenToTextChanges(boolean listen) {\n \t\tif (listen) {\n \t\t\tif (fDocumentListener == null && fDocument != null) {\n \t\t\t\tfDocumentListener= new DocumentListener();\n \t\t\t\tfDocument.addDocumentListener(fDocumentListener);\n \t\t\t}\n \t\t} else if (!listen) {\n \t\t\tif (fDocumentListener != null && fDocument != null) {\n \t\t\t\tfDocument.removeDocumentListener(fDocumentListener);\n \t\t\t\tfDocumentListener= null;\n \t\t\t}\n \t\t}\n \t}", "@Override\n\tpublic void textValueChanged(TextEvent e) {\n\t\t\n\t}", "@Override\n public void statusChanged(String text) {\n fireStatusChanged(text);\n }", "@Test\n public void ensureTextChangesWork(){\n onView(withId(R.id.placeEditText)).perform(typeText(\"London\"));\n\n // Check that the language text was changed.\n onView(withId(R.id.languageEditText)).perform(typeText(\"It\"));\n\n // Check that the language text was changed.\n onView(withId(R.id.maxrowsEditText)).perform(typeText(\"3\"));\n\n // check button click\n onView(withId(R.id.button)).perform(click());\n\n // check returned list view\n onView(withId(R.id.listViewResult)).check(matches(isDisplayed()));\n }", "public void textChanged(TextChangedEvent e) {\n System.out.println(\"Received TextChangeEvent!\");\n TestCase.assertEquals(\"Old text mismatched.\", \"old text\", e.getOldText());\n TestCase.assertEquals(\"New text mismatched.\", \"new text\", e.getNewText());\n }", "@Override\n\t\t\t\tpublic void afterTextChanged(Editable s) {\n\t\t\t\t\tbqChanged=true;\n\t\t\t\t}", "@Override\n\tpublic boolean onQueryTextChange(String newText) {\n\t\tLog.v(\"query\",\"onQueryTextChange\");\n\t\tmTextView.setText(\"Searching for \" + newText);\n\t\treturn false;\n\t}", "@Override\n public boolean onQueryTextChange(String newText) {\n return false;\n }", "@Override\n public boolean onQueryTextChange(String newText)\n {\n return false;\n }", "@Override\n public void afterTextChanged(Editable s) {\n outputBasedOnText(s);\n }", "private void updateAndAlertListener() {\n\n\t\teditText.setText(getRoundedValue(value));\n\n\t\tif (changeListener != null) {\n\t\t\tchangeListener.onValueChange(this, value);\n\t\t}\n\t}", "@Override\n public void onTextChanged(CharSequence text) {\n }", "public interface OnTextChange {\n void addTextChangedListener(TextWatcher watcher);\n boolean isEmpty();\n Editable getText();\n int getVisibility();\n}", "public void afterTextChanged(Editable s) {\n\t \tLog.d(\"LiveMeshEventControllerActivity displayEditText.addTextChangedListener\", \"Text changed: \" + s.toString());\n\t \tString newText = s.toString();\n\t \tif (TextUtils.isEmpty(newText)) {\n\t \t\tnewText = \"%20\";\n\t \t}\n\t \tLog.d(\"LiveMeshEventControllerActivity displayEditText.addTextChangedListener\", \"newText: \" + s.toString());\n\t \tsetTextTask = new SetTextForDeviceTask();\n\t \tif (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {\n\t \t\tsetTextTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, clientToDisplay.id, newText);\n\t \t} else {\n\t \t\tsetTextTask.execute(clientToDisplay.id, newText);\n\t \t}\n\n\t }", "@Override\n\tpublic boolean onQueryTextChange(String newText) {\n\t\treturn false;\n\t}", "@Override\r\n\t\t\t\tpublic void documentAboutToBeChanged(DocumentEvent event) {\n\t\t\t\t\tif (event.fText.indexOf('\\r') != -1 || event.fText.indexOf('\\n') != -1) {\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tITypedRegion partition = event.fDocument.getPartition(event.fOffset);\r\n\t\t\t\t\t\t\tif (partition instanceof IOConsolePartition) {\r\n\t\t\t\t\t\t\t\tIOConsolePartition p = (IOConsolePartition) partition;\r\n\t\t\t\t\t\t\t\t// check if that is user input\r\n\t\t\t\t\t\t\t\tif (p.getType().equals(IOConsolePartition.INPUT_PARTITION_TYPE)) {\r\n\t\t\t\t\t\t\t\t\tif (event.fText.length() <= 2) {\r\n\t\t\t\t\t\t\t\t\t\tfinal String inputFound = p.getString();\r\n\t\t\t\t\t\t\t\t\t\tfConsoleInterpreter.postRIDECommand(inputFound);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} catch (BadLocationException e) {\r\n\t\t\t\t\t\t\tLog.log(IStatus.ERROR, \"Error in RIDE console Listener.\", e);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "@Override\n public void afterTextChanged(Editable s) {}", "@Override\n public void afterTextChanged(Editable s) {\n\n }", "@Override\n public boolean onQueryTextChange(String newText) {\n return false;\n }", "@Override\n public boolean onQueryTextChange(String newText) {\n return false;\n }", "@Override\n public boolean onQueryTextChange(String newText) {\n return false;\n }", "@Override\n public boolean onQueryTextChange(String newText) {\n return false;\n }", "@Override\n\t\t\t\tpublic void afterTextChanged(Editable s) {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n\t\t\t\tpublic void afterTextChanged(Editable s) {\n\t\t\t\t\t\n\t\t\t\t}", "public void onTextCopy()\n\t{\n\t}", "@Override\n public void afterTextChanged(Editable p1) {\n }", "@Override\n public void afterTextChanged(Editable p1) {\n }", "@Override\n public void afterTextChanged(Editable s) {\n }", "@Override\n public void afterTextChanged(Editable s) {\n }", "@Override\n public void afterTextChanged(Editable s)\n {\n \n }", "@Override\n\t\t\t\t\t\t\t\tpublic void afterTextChanged(Editable s) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}", "@Override\n\t\t\tpublic void afterTextChanged(Editable arg0) {\n\t\t\t}", "@Override\n\t\t\tpublic void afterTextChanged(Editable arg0) {\n\t\t\t}", "@Override\n\t\t\tpublic void afterTextChanged(Editable arg0) {\n\t\t\t}", "@Override\n\t\t\tpublic void afterTextChanged(Editable arg0) {\n\t\t\t}", "@Override\n public boolean onQueryTextChange(String newText) {\n\n return false;\n }", "public void updateText() throws JUIGLELangException {\n SwingUtilities.invokeLater(new Runnable() {\n\n\n public void run() {\n fireTableStructureChanged();\n }\n });\n\n }", "@Override\n\t\t\tpublic void afterTextChanged(Editable arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void afterTextChanged(Editable arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void afterTextChanged(Editable arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\tpublic void afterTextChanged(Editable s) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void afterTextChanged(Editable s) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void afterTextChanged(Editable s) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void afterTextChanged(Editable s) {\n\t\t\t\n\t\t}", "@Override\n \t \t public void afterTextChanged(Editable s) {\n\n \t \t }", "@Override\n public boolean onQueryTextChange(String newText) {\n return false;\n }", "@Override\n\t\t\tpublic void afterTextChanged(Editable s) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void afterTextChanged(Editable s) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void afterTextChanged(Editable s) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void afterTextChanged(Editable s) {\n\t\t\t\t\n\t\t\t}", "private void onContentsChanged(IChangeEvent event) {\n IPosition fromPos = event.getFrom();\n int fromOffset = mapper.getOffset(fromPos.getLine(), fromPos.getChar());\n IPosition toPos = event.getTo();\n int toOffset = mapper.getOffset(toPos.getLine(), toPos.getChar());\n // Create a transformation that corresponds to the change.\n TransformBuilder builder = new TransformBuilder();\n builder.skip(fromOffset);\n if (fromOffset != toOffset)\n builder.delete(mapper.substring(fromOffset, toOffset));\n for (int i = 0; i < event.getTextLineCount(); i++) {\n if (i > 0)\n builder.insert(\"\\n\");\n builder.insert(event.getTextLine(i));\n }\n builder.skip(mapper.getLength() - toOffset);\n Transform transform = builder.flush();\n Assert.equals(mapper.getLength(), transform.getInputLength());\n for (IListener listener : listeners)\n listener.onChange(transform);\n doc.apply(transform);\n mapper.apply(transform);\n }", "public void afterTextChanged(Editable s) {\n }", "public void afterTextChanged(Editable s) {\n }", "public void afterTextChanged(Editable s) {\n }", "public void afterTextChanged(Editable s) {\n }", "public void afterTextChanged(Editable s) {\n }", "public void afterTextChanged(Editable s) {\n }", "public void afterTextChanged(Editable s) {\n }", "public void afterTextChanged(Editable s) {\n }", "public void afterTextChanged(Editable s) {\n }", "public void afterTextChanged(Editable s) {\n }", "public void afterTextChanged(Editable s) {\n }", "public void afterTextChanged(Editable s) {\n }", "public void afterTextChanged(Editable s) {\n }", "public void afterTextChanged(Editable s) {\n }", "public void afterTextChanged(Editable s) {\n }", "public void afterTextChanged(Editable s) {\n }", "public void afterTextChanged(Editable s) {\n }", "@Override\n public void afterTextChanged(Editable s) {\n }", "@Override\n\t\t\tpublic void afterTextChanged(Editable arg0) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void afterTextChanged(Editable arg0) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void afterTextChanged(Editable arg0) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void afterTextChanged(Editable arg0) {\n\n\t\t\t}", "@Override\n public void afterTextChanged(Editable arg0) {\n\n }", "@Override\n public void afterTextChanged(Editable s) {}", "@Override\n public void afterTextChanged(Editable s) {\n\n }", "@Override\n public void afterTextChanged(Editable s) {\n\n }", "@Override\n public void afterTextChanged(Editable s) {\n\n }", "@Override\n public void afterTextChanged(Editable s) {\n\n }", "@Override\n public void afterTextChanged(Editable s) {\n\n }", "@Override\n public void afterTextChanged(Editable s) {\n\n }", "@Override\n public void afterTextChanged(Editable s) {\n\n }", "@Override\n public void afterTextChanged(Editable s) {\n\n }", "@Override\r\n\t\t\tpublic void documentAboutToBeChanged(DocumentEvent event) {\n\t\t\t\tif (event.fText.indexOf('\\r') != -1 || event.fText.indexOf('\\n') != -1) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tITypedRegion partition = event.fDocument.getPartition(event.fOffset);\r\n\t\t\t\t\t\tif (partition instanceof IOConsolePartition) {\r\n\t\t\t\t\t\t\tIOConsolePartition p = (IOConsolePartition) partition;\r\n\t\t\t\t\t\t\t// check if that is user input\r\n\t\t\t\t\t\t\tif (p.getType().equals(IOConsolePartition.INPUT_PARTITION_TYPE)) {\r\n\t\t\t\t\t\t\t\tif (event.fText.length() <= 2) {\r\n\t\t\t\t\t\t\t\t\tfinal String inputFound = p.getString();\r\n\t\t\t\t\t\t\t\t\tif (inputFound.length() > 0)\r\n\t\t\t\t\t\t\t\t\t\tfConsoleInterpreter.postSessionPrompt(inputFound);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} catch (BadLocationException e) {\r\n\t\t\t\t\t\tLog.log(IStatus.ERROR, \"Error in RIDE console Listener.\", e);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}", "@Override\n\t\t\tpublic void afterTextChanged(Editable s) {\n\t\t\t}" ]
[ "0.7174849", "0.69972026", "0.68251014", "0.66488194", "0.6633872", "0.6632813", "0.66125697", "0.6582014", "0.6552378", "0.6538328", "0.6493693", "0.6493693", "0.6440871", "0.6419171", "0.64089185", "0.63771564", "0.63690233", "0.6354065", "0.6353269", "0.6318045", "0.62944376", "0.628389", "0.6258482", "0.62568486", "0.6252393", "0.6232595", "0.62311476", "0.6201402", "0.62002766", "0.6199168", "0.61937106", "0.61911935", "0.61752427", "0.6174524", "0.61667645", "0.61667645", "0.61667645", "0.61667645", "0.61658216", "0.61658216", "0.6153376", "0.6152513", "0.6152513", "0.61391425", "0.61391425", "0.6133193", "0.6132225", "0.6109444", "0.6109444", "0.6109444", "0.6109444", "0.61078864", "0.61035407", "0.6100088", "0.6100088", "0.6100088", "0.60999167", "0.60999167", "0.60999167", "0.60999167", "0.60962224", "0.6088234", "0.6082822", "0.6082822", "0.6082822", "0.6082822", "0.6076109", "0.606499", "0.606499", "0.606499", "0.606499", "0.606499", "0.606499", "0.606499", "0.606499", "0.606499", "0.606499", "0.606499", "0.606499", "0.606499", "0.606499", "0.606499", "0.606499", "0.606499", "0.60631", "0.60576594", "0.60576594", "0.60576594", "0.60576594", "0.60554785", "0.6052802", "0.60506636", "0.60506636", "0.60506636", "0.60506636", "0.60506636", "0.60506636", "0.60506636", "0.60506636", "0.6045982", "0.6044922" ]
0.0
-1
listen for clicking button
public void onClick(View v) { // launch when button is clicked finish(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void buttonClicked();", "public void click() {\n\t\tif(this.buttonListener != null) {\n\t\t\tthis.buttonListener.onClicked();\n\t\t}\n\t}", "private void button1MouseClicked(MouseEvent e) {\n\t}", "public void buttonClicked() {\n mSanitizorGame.buttonClicked();\n }", "private void button1MouseClicked(MouseEvent e) {\n }", "void enablButtonListener();", "@Override\n\tprotected void on_button_pressed(String button_name) {\n\n\t}", "@Override\n public void onClick() {\n System.out.println(\"Button has been JUST clicked\");\n }", "@Override\n\tprotected void OnClick() {\n\t\t\n\t}", "public void onClicked();", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tmButtonListener.onButtonListener();\n\t\t\t}", "public void onButtonAPressed();", "void onClick();", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tllistenBtnset();\n\t\t\t}", "public void clickButton()\n {\n fieldChangeNotify( 0 );\n }", "public void button_clicked(View v) {\n mCallback.onButtonClicked(v);\n }", "private void button1MousePressed(MouseEvent e) {\n }", "public void buttonClickHandler (ActionEvent evt) {\n\t\tButton clickedButton = (Button) evt.getTarget();\n\t\tString buttonLabel = clickedButton.getText();\n\t\t\n\t\tswitch(buttonLabel) {\n\t\t\tcase(\"Instructions\"): openInstructionsWindow(); break;\n\t\t\tcase(\"About\"): openAboutWindow(); break;\n\t\t\tcase(\"Quit\"): GameScreenController.quitWindow(); break;\n\t\t}\t\n\t}", "@Override\r\n public void onClick(ClickEvent event) {\n }", "void configureButtonListener();", "@Override\n\t\t\tpublic void onClick(ClickEvent event) {\n\t\t\t}", "@Override\n\tpublic void buttonClick(ClickEvent event) {\n\t\tif (event.getButton() == btnNext) {\n\t\t\t((ExpressZipWindow) getApplication().getMainWindow()).advanceToNext();\n\t\t\t// do event for Back being processed\n\t\t} else if (event.getButton() == btnBack) {\n\t\t\t((ExpressZipWindow) getApplication().getMainWindow()).regressToPrev();\n\t\t} else if (event.getButton() == btnRemoveShapeFile) {\n\t\t\tfor (SetupMapViewListener listener : listeners) {\n\t\t\t\tlistener.shapeFileRemovedEvent();\n\t\t\t}\n\t\t}\n\t}", "public void mouseClicked(int ex, int ey, int button) {\r\n\t}", "void buttonPressed(ButtonType type);", "@Override\n public void mouseClicked(MouseEvent e){\n String boton = W.detClick( e.getButton() );\n \n System.out.println(\" Mouse: Click \" + boton ); \n }", "private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {\n }", "@Override\n public void onClick(View v) {\n mOnButtonClickListener.onButtonClicked(v);\n }", "public void mouseClicked(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n public void onClick(View v) {\n buttonAddClicked();\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n if(e.getSource().equals(btnQuayLai)){\n btnquaylaiclick();}\n }", "public void mouseClicked(MouseEvent e) {\n\n }", "@FXML\r\n\tvoid main_btn_clicked(MouseEvent event) {\r\n\r\n\t}", "@Override\n public void mousePressed(MouseEvent e){\n String boton = W.detClick( e.getButton() );\n \n //System.out.println(\"->Mouse: Presionando Click \" + boton );\n }", "public void clickedButton(View view) {\n\n switch (view.getId()) {\n case R.id.contactBook:\n intent = new Intent(this, ContactBookActivity.class);\n startActivity(intent);\n break;\n case R.id.message:\n intent = new Intent(this, SMS_Activity.class);\n startActivity(intent);\n break;\n case R.id.fav_contacts:\n intent = new Intent(this, ContactGridActivity.class);\n startActivity(intent);\n break;\n case R.id.lastCall:\n intent = new Intent(this, LatestCallsActivity.class);\n startActivity(intent);\n break;\n case R.id.microphone:\n SpeechRecognitionHelper.run(this);\n break;\n }\n }", "@Override\n\t\tpublic void onClick(Widget sender) {\n\t\t\t\n\t\t}", "private void clickOn() {\n\t\tll_returnbtn.setOnClickListener(new OnClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tfinish();\n\t\t\t}\n\t\t});\n\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "public void mouseClicked(MouseEvent e) {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\r\n public void mouseClicked(MouseEvent e) {\n System.out.println(e.getButton());\r\n\r\n // MouseEvent.BUTTON3 es el boton derecho\r\n }", "@Override\n\tpublic void onClick(ClickEvent arg0) {\n\t\t\n\t}", "private void btn_stockMouseClicked(java.awt.event.MouseEvent evt) {\n \n }", "public void mouseClicked(MouseEvent e) {\n\t\t\t\t\t\t\n\t\t\t\t\t}", "public void mouseClicked(MouseEvent e) {\n\t\t\t\t\t\t\n\t\t\t\t\t}", "public void mouseClicked(MouseEvent e) {\n\t\t\t\t\t\t\n\t\t\t\t\t}", "@Override\r\n\tpublic void onButtonEvent(GlassUpEvent event, int contentId) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\t\r\n\t}", "public void mouseClicked(MouseEvent e) {\n\n\t\t\t}", "public void mouseClicked(MouseEvent e) {\n\n\t\t\t}", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tstart_click(e);\r\n\t\t\t}", "@Override\n\t\t\tpublic void buttonClick(ClickEvent event) {\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tUI.getCurrent().getNavigator().navigateTo(\"CliPantallaBusquedaExpedientes\");\t \n\t\t\t}", "public void mouseClicked(MouseEvent e) \t{\n\t\t\t\t\r\n\t\t\t}", "public void click() {\n\t\tSystem.out.println(\"LinuxButton Click\");\r\n\t}", "@Override\r\n\t\t\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\t\t\r\n\t\t\t\t\t}", "@Override\n\t\t\tpublic void buttonClick(ClickEvent event) {\n\t\t\t\tbindingSource.setItemId(this, true, bindingSource.getItemId());\n\t\t\t\t\n\t\t\t\t// fire the app event if it's implemented\n\t\t\t\tif (listenerDownButton != null)\n\t\t\t\t\tlistenerDownButton.downButtonClick(new ClickNavigationEvent(event.getButton(), event.getComponent() , null, register, 0));\n\t\t\t\t\n\t\t\t}", "public void mouseClicked(MouseEvent e) {\n\t\t\r\n\t}", "private void addClick() {\n\t\tfindViewById(R.id.top_return).setOnClickListener(this);\n\t\tfm1_jhtx.setOnClickListener(this);\n\t\tfm1_sx.setOnClickListener(this);\n\t}", "@Override\n public void onClick(View v) {\n switch (v.getId()) {\n case R.id.btn_scan:\n btnSignalScan();\n break;\n default:\n break;\n }\n }", "@Override\r\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\r\n\t\t\t}", "private void jButton4MouseClicked(java.awt.event.MouseEvent evt) {\n }", "private void jButton4MouseClicked(java.awt.event.MouseEvent evt) {\n }", "@Override\r\n\t\t\t\tpublic void mouseClicked(MouseEvent e) {\r\n\t\t\t\t\t\r\n\t\t\t\t}", "public void onClick(ClickEvent event) {\r\n System.out.println(\"Submit Button geklickt\");\r\n handleEvent();\r\n }", "@Override\n\tpublic void onClick() {\n\t\t\n\t}", "private void onClick() {\n\t\tbtnTocash.setOnClickListener(this);\n\t}", "@Override\n\t\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n\t\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\t\n\t\t\t\t}", "public void mouseClicked(MouseEvent e) {\n\t\t\t\n\t\t}", "public void mouseClicked(MouseEvent e) {\n\t\t\t\n\t\t}", "@Override\r\n\t\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\t\r\n\t\t\t\t}", "@Override\n\t\t\t\tpublic void mouseClicked(MouseEvent e) {\n\n\t\t\t\t}", "@Override\n\t\t\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\t}", "private void btnModificarMouseClicked(java.awt.event.MouseEvent evt) {\n }", "@Override\n\t\tpublic void mouseClicked(MouseEvent event) {\n\n\t\t}", "@Override\r\n public void mouseClicked(MouseEvent event) {\r\n System.out.println(\"clicked\");\r\n\r\n }", "@Override\r\n\t\t\t\tpublic void onClick() {\n\r\n\t\t\t\t}", "@Override\r\n\t\t\t\tpublic void onClick() {\n\r\n\t\t\t\t}", "public void mouseClicked(MouseEvent e) {}", "public void mouseClicked(MouseEvent e) {}", "public void mouseClicked(MouseEvent e) {}", "public void mouseClicked(MouseEvent e) {}", "void mainButtonPressed();", "public void buttonClick(ClickEvent event) {\n\t\t\t\t\t\t \tclose();\n\t\t\t\t\t\t }", "@Override\n public void onClick() {\n }", "public void mouseClicked(MouseEvent e) { \r\n }", "@FXML\n private void mouseClicked(MouseEvent event) {\n checkClick(event);\n }", "@Override\r\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\r\n\t}" ]
[ "0.8089818", "0.7755734", "0.75644445", "0.75306475", "0.7485124", "0.733052", "0.7317084", "0.7232442", "0.7209304", "0.72030187", "0.71855944", "0.71286297", "0.7107479", "0.7052848", "0.7043173", "0.70397115", "0.7022944", "0.70166105", "0.7015354", "0.7014152", "0.699632", "0.69670916", "0.69663334", "0.69568855", "0.6943977", "0.6914993", "0.69145596", "0.69135267", "0.69099814", "0.6905691", "0.6895252", "0.6893926", "0.689243", "0.6890416", "0.6880742", "0.6879111", "0.68502474", "0.68502474", "0.68502474", "0.68502474", "0.68502474", "0.68502474", "0.68502474", "0.68502474", "0.68502474", "0.68502474", "0.68502474", "0.6849025", "0.6848959", "0.6848013", "0.684333", "0.6840888", "0.6840888", "0.6840888", "0.6832503", "0.6829589", "0.6829589", "0.68253976", "0.6825187", "0.6824865", "0.6819022", "0.68187153", "0.6818127", "0.68166035", "0.6810937", "0.68065387", "0.6803111", "0.6803111", "0.6803111", "0.6802275", "0.6802275", "0.6792809", "0.67919874", "0.67872006", "0.6785691", "0.6785484", "0.6785484", "0.6784685", "0.6784685", "0.6784331", "0.6780851", "0.6779866", "0.6776393", "0.67759526", "0.6775414", "0.6774913", "0.6774913", "0.67731583", "0.67731583", "0.67731583", "0.67731583", "0.6772047", "0.6771838", "0.67710084", "0.6767906", "0.6766972", "0.6760652", "0.6760652", "0.6760652", "0.6760652", "0.6760652" ]
0.0
-1
/ method to search user
public void search(String searchQuery) { if (!searchQuery.trim().equals("")) { DBref.orderByChild("username").startAt(searchQuery).endAt(searchQuery + "\uf8ff").addValueEventListener(userEventListener); } // if searching input is not empty }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<User> searchUser(String searchValue);", "public User search_userinfo(String user_name);", "public List<User> listSearch(String search);", "public int search_userid(String user_name);", "Data<User> getUserSearch(String user);", "public static void search() {\n int userSelected = selectFromList(crudParamOptions);\n switch (userSelected){\n case 1:\n searchFirstName();\n break;\n case 2:\n searchLastName();\n break;\n case 3:\n searchPhone();\n break;\n case 4:\n searchEmail();\n break;\n default:\n break;\n }\n }", "List<User> searchUsersByUsername(String username);", "@Override\r\n\tpublic List<User> search(String name) {\n\t\treturn null;\r\n\t}", "List<User> searchUsers(String searchTerm) {\n return null;\n }", "Customer search(String login);", "List<UserRepresentation> searchUserAccount(final String username);", "String searchBoxUserRecord();", "@Override\n\tpublic List<User> searchByUser(String userName) {\n\t\tlog.info(\"Search by username!\");\n\t\treturn userRepository.findByFirstNameRegex(userName+\".*\");\n\t}", "List<ResultDTO> searchUser(String query);", "@SuppressWarnings(\"unused\")\n\t@Override\n\tpublic ArrayList<Object> searchUserByName(String search) {\n\t\t\n\t\tSystem.out.println(\"i am in service search looking for users\" + search.length());\n\t\t\n\t\tif(search == null){\n\t\t\t\n\t\t\tSystem.out.println(\"nothing can be find\");\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"its not 0000000000\");\n\t\t\n\t\tArrayList<Object> list = userRepository.findUserByName(search);\n\t\t\n\t\t//System.out.println(Arrays.toString(list));\n\t\treturn list;\n\t}", "public void research() throws Exception\r\n\t{\r\n\t\tresult = ((CLibraryManager)AUser.getInstance()).searchUser(jTextField_UserName.getText(),jTextField_UserID.getText(),jTextField_FirstName.getText(),jTextField_LastName.getText());\r\n\t}", "Data<User> getUserSearch(String user, String fields);", "private String searchForUser() {\n String userId = \"\";\n String response = given().\n get(\"/users\").then().extract().asString();\n List usernameId = from(response).getList(\"findAll { it.username.equals(\\\"Samantha\\\") }.id\");\n if (!usernameId.isEmpty()) {\n userId = usernameId.get(0).toString();\n }\n return userId;\n }", "List<Card> search(String searchString, long userId) throws PersistenceCoreException;", "@PreAuthorize(\"hasAnyAuthority(T(rs.acs.uns.sw.sct.util.AuthorityRoles).ADMIN, T(rs.acs.uns.sw.sct.util.AuthorityRoles).ADVERTISER, T(rs.acs.uns.sw.sct.util.AuthorityRoles).VERIFIER)\")\n @GetMapping(\"/users/search\")\n public ResponseEntity<List<UserDTO>> search(@RequestParam(value = \"username\", required = false) String username,\n @RequestParam(value = \"email\", required = false) String email,\n @RequestParam(value = \"firstName\", required = false) String firstName,\n @RequestParam(value = \"lastName\", required = false) String lastName,\n @RequestParam(value = \"phoneNumber\", required = false) String phoneNumber,\n @RequestParam(value = \"companyName\", required = false) String companyName,\n Pageable pageable) {\n\n List<UserDTO> list = userService.findBySearchTerm(username, email, firstName, lastName, phoneNumber, companyName, pageable)\n .stream().map(user -> user.convertToDTO()).collect(Collectors.toList());\n\n return new ResponseEntity<>(list, HttpStatus.OK);\n }", "void loadSearch(UserSearch search);", "public String searchUserWithKeyword(){\r\n\t\tlog.info(\"Starting to search user(s) with keyword = \"+ searchkeyword);\r\n\t\tthis.clearErrorsAndMessages();\r\n\t\tusersList = new ArrayList<Users>();\r\n\t\tusersList.clear();\t\t\r\n\t\ttry {\t\t\r\n\t\t\tusersList = userService.findUsersWithNameLike(searchkeyword);\r\n\t\t\tmessage = usersList.size() + \" users found .\";\t\r\n\t\t\tlog.info(message);\t\r\n\t\t} catch (Exception e) {\r\n\t\t\tmessage = \"Error in finding users for keyword [\" +searchkeyword+\"]. \"+ e.getMessage();\r\n\t\t\tthis.addActionError(message);\r\n\t\t\tlog.error(message, e);\r\n\t\t}\t\r\n\t\t// reset the keyword\r\n\t\tsearchkeyword = \"\";\r\n\t\treturn SUCCESS;\r\n\t}", "@Override\n public void onClick(View view){\n String username = search.getText().toString();\n String userid = \"\";\n if (users != null) {\n for (String id : users.keySet()) {\n if (users.get(id).getUserName().equals(username)){\n userid = id;\n break;\n }\n }\n if (userid.equals(\"\")){\n Toast.makeText(getContext(), \"No Such User\", Toast.LENGTH_LONG).show();\n } else {\n readUserInfo(userid, username);\n Toast.makeText(getContext(), \"Loading User\", Toast.LENGTH_SHORT).show();\n }\n } else {\n Toast.makeText(getContext(), \"Loading User List\", Toast.LENGTH_SHORT).show();\n }\n }", "SearchUser.Req getSearchUserReq();", "public List<User> searchUsers(String arg) {\n\n\t\tMUser mu = new MUser();\n\t\tList<User> searchUsers = mu.searchUsers(arg);\n\t\tif (searchUsers == null) {\n\t\t\terrorMsg = mu.errorMsg;\n\t\t\treturn null;\n\t\t}\n\t\treturn searchUsers;\n\n\t}", "public void search() {\r\n \t\r\n }", "public void search() {\n try {\n String searchKey = txt_SearchKey.getText();\n Search s = new Search();\n con = dc.connect();\n stmt1 = con.createStatement();\n\n\n String sql = s.getSQLQuery(\"tblUsers\", searchKey);\n\n vtdata_user = new Vector();\n ResultSet rsUser = stmt1.executeQuery(sql);\n while (rsUser.next()) {\n\n Vector temp = new Vector();\n\n temp.add(rsUser.getString(\"UserName\"));\n temp.add(rsUser.getString(\"U_Name\"));\n temp.add(rsUser.getString(\"Email\"));\n // temp.add(rsUser.getDate(\"BirthDate\"));\n\n temp.add(formatDate.format(rsUser.getDate(\"BirthDate\")));\n boolean gender = rsUser.getBoolean(\"Gender\");\n\n\n if (gender == true) {\n temp.add(\"Male\");\n }\n\n if (gender == false) {\n temp.add(\"Female\");\n }\n temp.add(rsUser.getString(\"Phone\"));\n vtdata_user.add(temp);\n }\n\n user_model = new DefaultTableModel(vtdata_user, vtcolumn_user) {\n\n @Override\n public boolean isCellEditable(int row, int column) {\n return false;\n }\n };\n\n tb_User.setModel(user_model);\n if (vtdata_user.size() == 0) {\n\n JOptionPane.showMessageDialog(this, \"No Search User! \");\n }\n dc.disconnect(rsUser);\n dc.disconnect(stmt1);\n dc.disconnect(con);\n } catch (SQLException ex) {\n Logger.getLogger(UserManagement.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public ArrayList<Users> ListUsers(String ValToSearch) {\n ArrayList<Users> usersList = new ArrayList<Users>();\n\n Statement st;\n ResultSet rs;\n\n try {\n Connection con = getConnection();\n st = con.createStatement();\n String searchQuery = \"SELECT * FROM `tbl_registered` WHERE CONCAT(`user_id`,'username', `firstname`,`middlename`, `lastname`, `email`)LIKE '%\" + ValToSearch + \"%'\";\n rs = st.executeQuery(searchQuery);\n\n Users user;\n\n while (rs.next()) {\n user = new Users(\n rs.getString(\"username\"),\n rs.getString(\"firstname\"),\n rs.getString(\"middlename\"),\n rs.getString(\"lastname\"),\n rs.getString(\"email\"),\n rs.getInt(\"user_id\"));\n\n usersList.add(user);\n }\n\n } catch (Exception ex) {\n JOptionPane.showMessageDialog(null, ex.getMessage());\n }\n\n return usersList;\n }", "private List<IUser> userSearch(IChannel root, String str) {\n List<IUser> list = new LinkedList<IUser>();\n userSearch(root, str, list);\n return list;\n }", "void addUserSearch(UserSearch userSearch);", "@Override\n\tpublic ArrayList<User> searchUsers() {\n\t\treturn userDao.searchUsers();\n\t}", "public void onSearch(){\n usernames = getNames();\n ArrayAdapter<String> adapter = new ArrayAdapter<>(getContext(),\n android.R.layout.simple_list_item_1, usernames);\n tvAuto.setAdapter(adapter);\n\n users.clear();\n profileAdapter.notifyDataSetChanged();\n rvResults.setAdapter(profileAdapter);\n rvResults.setLayoutManager(new LinearLayoutManager(getContext()));\n\n btnSearch.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n userName = tvAuto.getText().toString();\n if(userName.equals(ParseUser.getCurrentUser().getUsername())){\n Toast.makeText(getContext(),\"Search for another user!\",Toast.LENGTH_SHORT).show();\n return;\n }else{\n Log.i(TAG,\"search for user!\");\n ParseQuery<ParseUser> query = ParseUser.getQuery();\n //want to get the user's info\n query.include(User.USERNAME_KEY);\n query.whereEqualTo(User.USERNAME_KEY,userName);\n query.findInBackground(new FindCallback<ParseUser>() {\n @Override\n public void done(List<ParseUser> objects, ParseException e) {\n ParseUser user = objects.get(0);\n Log.i(TAG,\"User: \" + user.getUsername());\n Log.i(TAG,\"objects size: \" + objects.size());\n users.add(user);\n profileAdapter.notifyDataSetChanged();\n }\n });\n }\n }\n });\n }", "@RequestMapping(\"findUser\")\r\n public String getSearch(ModelMap model) {\r\n\r\n List<User> userList = null;\r\n\r\n model.addAttribute(\"users\", userList);\r\n\r\n return \"search\";\r\n }", "@GetMapping(\"/search\")\n\tpublic String searchUsers(@RequestParam(\"theSearchName\") String theSearchName, Model theModel) {\n\t\tList<User> theUsers = userService.searchUsers(theSearchName);\n\n\t\t// add the customers to the model\n\t\ttheModel.addAttribute(\"users\", theUsers);\n\t\treturn \"list-users\";\n\t}", "@Override\n public List<User> searchUserByParams(Map<String, String> parametersSearch) throws ServiceException {\n List<User> users;\n String searchType = parametersSearch.get(USER_SEARCH_TYPE_PARAMETER_NAME);\n if (searchType == null) {\n return Collections.emptyList();\n }\n try {\n manager.beginTransaction(userDao);\n users = searchUsers(searchType, parametersSearch);\n manager.endTransaction();\n } catch (DaoException exception) {\n try {\n manager.rollback();\n } catch (DaoException rollbackException) {\n logger.error(rollbackException);\n }\n throw new ServiceException(exception);\n }\n return users;\n }", "public void findUsers() {\n if (txtSearch.getText().isEmpty()) {\n JOptionPane.showMessageDialog(null, \"Enter then name of the person you want to Search\");\n } else {\n ArrayList<Users> users = ListUsers(txtSearch.getText());\n DefaultTableModel model = new DefaultTableModel();\n model.setColumnIdentifiers(new Object[]{\"User id\", \"Username\", \"Name\", \"Email\"});\n Object[] row = new Object[4];\n\n for (int i = 0; i < users.size(); i++) {\n row[0] = users.get(i).user_id;\n row[1] = users.get(i).username;\n row[2] = ((users.get(i).firstname) + \" \" + (users.get(i).middlename) + \" \" + (users.get(i).lastname));\n row[3] = users.get(i).email;\n\n model.addRow(row);\n }\n tblUser.setModel(model);\n jScrollPane1.setViewportView(tblUser);\n tblUser.setEnabled(false);\n }\n }", "@In String search();", "void search();", "void search();", "String searchBoxUserRecordSelected();", "public UserRow[] searchUsers(UserRow userModel, boolean isAnd)\n throws AdminPersistenceException {\n boolean concatAndOr = false;\n String andOr;\n StringBuffer theQuery = new StringBuffer(SELECT_SEARCH_USERS);\n Vector<Integer> ids = new Vector<Integer>();\n Vector<String> params = new Vector<String>();\n \n if (isAnd) {\n andOr = \") AND (\";\n } else {\n andOr = \") OR (\";\n }\n concatAndOr = addIdToQuery(ids, theQuery, userModel.id, \"id\", concatAndOr,\n andOr);\n concatAndOr = addIdToQuery(ids, theQuery, userModel.domainId, \"domainId\",\n concatAndOr, andOr);\n concatAndOr = addParamToQuery(params, theQuery, userModel.specificId,\n \"specificId\", concatAndOr, andOr);\n concatAndOr = addParamToQuery(params, theQuery, userModel.login, \"login\",\n concatAndOr, andOr);\n concatAndOr = addParamToQuery(params, theQuery, userModel.firstName,\n \"firstName\", concatAndOr, andOr);\n concatAndOr = addParamToQuery(params, theQuery, userModel.lastName,\n \"lastName\", concatAndOr, andOr);\n concatAndOr = addParamToQuery(params, theQuery, userModel.eMail, \"email\",\n concatAndOr, andOr);\n concatAndOr = addParamToQuery(params, theQuery, userModel.accessLevel,\n \"accessLevel\", concatAndOr, andOr);\n concatAndOr =\n addParamToQuery(params, theQuery, userModel.loginQuestion, \"loginQuestion\", concatAndOr,\n andOr);\n concatAndOr =\n addParamToQuery(params, theQuery, userModel.loginAnswer, \"loginAnswer\", concatAndOr, andOr);\n if (concatAndOr) {\n theQuery.append(\") AND (accessLevel <> 'R')\");\n } else {\n theQuery.append(\" WHERE (accessLevel <> 'R')\");\n }\n theQuery.append(\" order by UPPER(lastName)\");\n \n int[] idsArray = new int[ids.size()];\n for (int i = 0; i < ids.size(); i++) {\n idsArray[i] = ids.get(i).intValue();\n }\n \n return getRows(theQuery.toString(), idsArray, params.toArray(new String[0])).toArray(\n new UserRow[0]);\n }", "public List<User> searchUser() {\n String idUserQuery = (id == null) ? \"'%'\" : Integer.toString(id);\n String firstNameQuery = (\"\".equals(firstName) || \" \".equals(firstName)) ? \"'%'\" : \"'%\" + firstName + \"%'\";\n String lastNameQuery = (\"\".equals(lastName) || \" \".equals(lastName)) ? \"'%'\" : \"'%\" + lastName + \"%'\";\n String emailQuery = (\"\".equals(email) || \" \".equals(email)) ? \"'%'\" : \"'%\" + email + \"%'\";\n String idCityQuery = Integer.toString(idCity);\n Connection conn = null;\n try {\n conn = DriverManager.getConnection(db.DB.connectionString, db.DB.user, db.DB.password);\n Statement stmt = conn.createStatement();\n String query = \"select * from users where id_user like \" + idUserQuery;\n query += \" and first_name like \" + firstNameQuery;\n query += \" and last_name like \" + lastNameQuery;\n query += \" and email like \" + emailQuery;\n query += \" and id_city=\" + idCityQuery;\n ResultSet rs = stmt.executeQuery(query);\n allUsers = new ArrayList<User>();\n while (rs.next()) {\n User user = new User();\n user.setId(rs.getInt(\"id_user\"));\n user.setFirstName(rs.getString(\"first_name\"));\n user.setLastName(rs.getString(\"last_name\"));\n user.setPhoneNumber(rs.getString(\"phone_number\"));\n user.setEmail(rs.getString(\"email\"));\n user.setAddress(rs.getString(\"address\"));\n user.setIdCity(rs.getInt(\"id_city\"));\n allUsers.add(user);\n renderUserTable = true;\n }\n if (allUsers.size() == 0) {\n FacesContext context = FacesContext.getCurrentInstance();\n context.getExternalContext().getFlash().setKeepMessages(true);\n FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_INFO, \"User not found\", null);\n FacesContext.getCurrentInstance().addMessage(null, msg);\n }\n } catch (SQLException ex) {\n Logger.getLogger(UserController.class.getName()).log(Level.SEVERE, null, ex);\n } finally {\n clear();\n try {\n conn.close();\n } catch (Exception e) {\n /* ignored */ }\n }\n return null;\n }", "public void searchUser(int keyCode, String filter, String user, JTable tblUser) {\n \n\n if(keyCode == KeyEvent.VK_ENTER) {\n tableModel = (DefaultTableModel) tblUser.getModel();\n \n int i;\n for(i = 0; i < tableModel.getColumnCount(); i++)\n {\n if(filter.compareTo(tableModel.getColumnName(i)) == 0) { break; }\n }\n\n for(int k = 0; k < tableModel.getRowCount(); k++)\n {\n if(user.compareToIgnoreCase(tableModel.getValueAt(k, i).toString()) == 0) {\n tblUser.setRowSelectionInterval(k, k);\n break;\n \n } else { tblUser.clearSelection(); }\n }\n } \n }", "private void searchFunction() {\n\t\t\r\n\t}", "@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 }", "private void queryUsers(final String searchTerm) {\n allUsers.clear();\n ParseQuery<ParseUser> query = ParseUser.getQuery();\n query.findInBackground(new FindCallback<ParseUser>() {\n public void done(List<ParseUser> users, ParseException e) {\n if (e != null) {\n Log.e(TAG, \"issue loading users from parse\" + e.getMessage());\n return;\n }\n\n allUsers.addAll(filterUsers(users, searchTerm));\n adapter.notifyDataSetChanged();\n }\n });\n }", "public void search() {\n String q = this.query.getText();\n String cat = this.category.getValue();\n if(cat.equals(\"Book\")) {\n searchBook(q);\n } else {\n searchCharacter(q);\n }\n }", "List<User> findByfnameContaining(String search);", "@Override\r\n\tpublic User searchUser(Integer id) {\n\t\treturn userReposotory.getById(id);\r\n\t}", "public List<User> findAutoCompleteUser(String key) {\n\t\tTypedQuery<User> query = em.createQuery(\"select distinct a from User a\" + \" where UPPER(a.name) like :name\",\n\t\t\t\tUser.class);\n\t\tquery.setParameter(\"name\", \"%\" + key.toUpperCase() + \"%\");\n\t\tList<User> userLst = query.setFirstResult(0).setMaxResults(10).getResultList();\n\n\t\treturn userLst;\n\t}", "abstract public void search();", "private void firebaseUserSearch(String searchText) {\n AllClubsList.clear();\n Query firebaseSearchQuery = mUserDatabase2.orderByChild(\"item_name\").startAt(searchText).endAt(searchText + \"\\uf8ff\");\n firebaseSearchQuery.addListenerForSingleValueEvent(valueEventListener);\n }", "@Action\r\n public String search() {\n ServiceFunctions.clearCache();\r\n\r\n if (isAdmin()) {\r\n return adminSearch();\r\n }\r\n\r\n return publicSearch();\r\n }", "SearchUser.Res getSearchUserRes();", "Page<ParaUserDTO> search(String query, Pageable pageable);", "public void search() {\n }", "public List<User> getSpecificUsers(String searchQuery) {\n logger.info(\"Currently in method 'getSpecificUsers()'.\");\n Database database = Database.getInstance();\n Connection connection = null;\n List<User> specificUsers = new ArrayList<User>();\n String sql = \"SELECT * FROM users WHERE id LIKE '%\" + searchQuery +\n \"%' OR first_name LIKE '%\" + searchQuery +\n \"%' or last_name LIKE '%\" + searchQuery +\n \"%' or date_of_birth LIKE '%\" + searchQuery + \"%'\";\n\n try {\n database.connect();\n connection = database.getConnection();\n Statement selectStatement = connection.createStatement();\n ResultSet results = selectStatement.executeQuery(sql);\n while (results.next()) {\n User employee = createUserFromResults(results);\n specificUsers.add(employee);\n }\n database.disconnect();\n } catch (SQLException e) {\n logger.error(\"Encountered an SQLException: \", e);\n } catch (Exception e) {\n logger.error(\"Encountered an Exception: \", e);\n }\n return specificUsers;\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}", "public void searchFunction() {\n textField_Search.textProperty().addListener(new ChangeListener<String>() {\n @Override\n public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {\n tableView.setPredicate(new Predicate<TreeItem<EntryProperty>>() {\n @Override\n public boolean test(TreeItem<EntryProperty> entryTreeItem) {\n Boolean flag = entryTreeItem.getValue().titleProperty().getValue().toLowerCase().contains(newValue.toLowerCase()) ||\n entryTreeItem.getValue().usernameProperty().getValue().toLowerCase().contains(newValue.toLowerCase());\n return flag;\n }\n });\n }\n });\n }", "public void searchFor(View view) {\n // Get a handle for the editable text view holding the user's search text\n EditText userInput = findViewById(R.id.user_input_edit_text);\n // Get the characters from the {@link EditText} view and convert it to string value\n String input = userInput.getText().toString();\n\n // Search filter for search text matching book titles\n RadioButton mTitleChecked = findViewById(R.id.title_radio);\n // Search filter for search text matching authors\n RadioButton mAuthorChecked = findViewById(R.id.author_radio);\n // Search filter for search text matching ISBN numbers\n RadioButton mIsbnChecked = findViewById(R.id.isbn_radio);\n\n if (!input.isEmpty()) {\n // On click display list of books matching search criteria\n // Build intent to go to the {@link QueryResultsActivity} activity\n Intent results = new Intent(MainActivity.this, QueryListOfBookActivity.class);\n\n // Get the user search text to {@link QueryResultsActivity}\n // to be used while creating the url\n results.putExtra(\"topic\", mUserSearch.getText().toString().toLowerCase());\n\n // Pass search filter, if any\n if (mTitleChecked.isChecked()) {\n // User is searching for book titles that match the search text\n results.putExtra(\"title\", \"intitle=\");\n } else if (mAuthorChecked.isChecked()) {\n // User is searching for authors that match the search text\n results.putExtra(\"author\", \"inauthor=\");\n } else if (mIsbnChecked.isChecked()) {\n // User is specifically looking for the book with the provided isbn number\n results.putExtra(\"isbn\", \"isbn=\");\n }\n\n // Pass on the control to the new activity and start the activity\n startActivity(results);\n\n } else {\n // User has not entered any search text\n // Notify user to enter text via toast\n\n Toast.makeText(\n MainActivity.this,\n getString(R.string.enter_text),\n Toast.LENGTH_SHORT)\n .show();\n }\n }", "@Override\n public IntraUserSearch searchIntraUser() {\n return new IntraUserModuleSearch(this.intraUserNertwokServiceManager,this.intraWalletUserIdentityManager, this.intraWalletUserManager);\n }", "Search getSearch();", "@RequestMapping(value = \"search\", method = RequestMethod.POST)\n public String search(TbUser tbUser, Model model) {\n List<TbUser> tbUsers = tbUserService.search(tbUser);\n model.addAttribute(\"tbUsers\", tbUsers);\n return \"user_list\";\n }", "private void filter(String text) {\n List<UserModel> filterdNames = new ArrayList<>();\n\n //looping through existing elements\n for (UserModel item : userModels) {\n //if the existing elements contains the search input\n if (item.getFirstName().toLowerCase().contains(text.toLowerCase())||item.getId().toLowerCase().contains(text.toLowerCase())||item.getEmail().toLowerCase().contains(text.toLowerCase())){\n //adding the element to filtered list\n filterdNames.add(item);\n }\n }\n userAdapter.filterList(filterdNames);\n }", "private static void searchStaffByName(){\n\t\tshowMessage(\"type the name you are looking for: \\n\");\n\t\tString name = getUserTextTyped();\n\t\tToScreen.listEmployee(EmployeeSearch.employee(employee.getAllEmployee(),name), true);\n\t\t\n\t\t//condition to do another search by name or go back to the main menu\n //if the user decide for doing another search the method is called again, otherwise it will go back to the main menu\n\t\tint tryAgain = askForGoMainMenu(\"Would you like to search for another name or go back to main menu?\\n Type 1 to search someone else \\n Type 0 to go to menu. \\n Choice: \");\n\t\tif(tryAgain == 1){\n\t\t\tsearchStaffByName();\n\t\t} else {\n\t\t\tmain();\n\t\t}\n\t}", "@Test\n public void testUserSearch() {\n try {\n //Navigate to users search page (faster this way)\n driver.get(\"http://stackoverflow.com/users\");\n \n wait(3);\n \n //Get user-search box; auto-polling by javascript; no submit() needed\n driver.findElement(By.id(\"userfilter\")).sendKeys(\"fojallupigi-4562\");\n \n wait(4);\n \n //determine if my username is the only result\n String username = driver.findElement(By.cssSelector(\".user-details > a:nth-child(1)\")).getText();\n assertEquals(\"fojallupigi-4562\", username);\n }\n catch(NoSuchElementException nsee) {\n fail();\n }\n }", "public void searchForUser(String userName) {\r\n\t\telement(addUserButton).waitUntilVisible();\r\n\t\taddUserButton.click();\r\n\r\n\t\telement(addUserSearchInput).waitUntilVisible();\r\n\t\taddUserSearchInput.sendKeys(userName);\r\n\r\n\t\telement(addUserSearchButton).waitUntilVisible();\r\n\t\taddUserSearchButton.click();\r\n\r\n\t\twaitABit(Constants.WAIT_TIME_SHORT);\r\n\t\taddUserFromSearchResults2(userName);\r\n\t}", "public void searchUserAccount( )\r\n throws TwitterException, URISyntaxException, IOException{\r\n\r\n // looks at all tweets since this page\r\n // the count is the limit\r\n\r\n int count = 0;\r\n String text = \"\";\r\n Paging paging = new Paging(pageInt, 10);\r\n List<Status> statuses = twitter.getUserTimeline(user, paging);\r\n\r\n for (Status s : statuses) {\r\n String url = \"https://twitter.com/\" + s.getUser().getScreenName() + \"/status/\" + s.getId();\r\n if (s.getRetweetedStatus() == null) {\r\n content = url;\r\n //send the links to text\r\n HandleFile(override, active);\r\n\r\n //regular expressions\r\n String regex = \"https://t.co/.*\";\r\n text = s.getText().replaceAll(regex,\"\");\r\n\r\n System.out.println(s.getUser().getName() + \": \" + text);\r\n System.out.println(url); //prints the url of the tweet\r\n System.out.println(s.getCreatedAt()+\"\\n\");\r\n\r\n //sets the tweets to variables to be exported\r\n tweets = tweets + \" \" +text + \"\\n\"+ url + \"\\n\" + s.getCreatedAt() + \"\\n\\n\";\r\n\r\n\r\n active = false;\r\n\r\n //search for nudes\r\n getTwitterImage(s);\r\n }\r\n count++;\r\n\r\n if(count == 5 && limitInt > 0){\r\n limitInt--;\r\n pageInt++;\r\n searchUserAccount();\r\n }\r\n }\r\n }", "@Override\n protected Collection<User> doInBackground(Void... params) {\n if(name.equals(\"\"))\n return new ArrayList<User>();\n return client.searchUsers(name, isPro, -1);\n }", "private List<ParseUser> filterUsers(List<ParseUser> pUsers, String searchTerm) {\n List<ParseUser> filteredUsers = new ArrayList<>();\n for (ParseUser pU : pUsers) {\n User u = new User(pU);\n if (u.getName().toLowerCase().contains(searchTerm.toLowerCase())) {\n filteredUsers.add(pU);\n }\n }\n return filteredUsers;\n }", "List<SearchResult> search(SearchQuery searchQuery);", "private List<User> searchUsers(String searchType, Map<String, String> parametersSearch) throws DaoException, ServiceException {\n List<User> result;\n switch (searchType) {\n case USER_ID_PARAMETER_NAME:\n result = new ArrayList<>();\n String parameterId = parametersSearch.get(USER_ID_PARAMETER_NAME);\n long userId = (parameterId != null) ? Long.parseLong(parameterId) : 0;\n Optional<User> optionalUser = userDao.findEntity(userId);\n optionalUser.ifPresent(result::add);\n break;\n case USERNAME_PARAMETER_NAME:\n result = userDao.findByPartOfUsername(parametersSearch.get(USERNAME_PARAMETER_NAME));\n break;\n case INIT_DATE_PARAMETER_NAME:\n String date = parametersSearch.get(INIT_DATE_PARAMETER_NAME);\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(DATE_TIME_FORMAT);\n LocalDate initDate = date != null ? LocalDate.parse(date, formatter) : LocalDate.now();\n result = userDao.findByInitDate(initDate);\n break;\n default:\n throw new ServiceException(\"Impossible state - unsupported command when search User\");\n }\n return result;\n }", "Page<ServiceUserDTO> search(String query, Pageable pageable);", "@Test\n public void testSearchUsersByName() {\n token.setGroupId(findMemberGroup(token).getGroupId());\n\n // Setting a partial name to search for. The search will look at both\n // first and last names which contain this as part of their name. In\n // this case, we're searching for \"man\", which will yield the following:\n // - Germany\n // - Oman\n // - Romania\n final SearchUserRequest request = new SearchUserRequest();\n request.setName(\"man\");\n\n // Now, invoke the search for users with a partial name given\n final SearchUserResponse response = administration.searchUsers(token, request);\n\n // And verify the result\n assertThat(response.isOk(), is(true));\n assertThat(response.getUsers().size(), is(3));\n }", "@Override\n\tpublic JCRPageList searchUserProfile(String userSearch) throws Exception {\n\t\treturn null;\n\t}", "public ArrayList<User> searchUsers(String fragment){\n \t\t\t// execute query\n\t\t\tString query = \"SELECT * FROM users WHERE id LIKE '%\" + fragment + \"%'\";\n \t\t\tSystem.out.println(query);\n \t\t\tResultSet rs = getResult(query);\n \t\t\t\n \t\t\tArrayList<User> matches = new ArrayList<User>();\n \t\t\ttry {\n \t\t\t\twhile(rs.next()){\n \t\t\t\t\t// add user to list\n \t\t\t\t\tString id = null;\t\t\t\t\t\n \t\t\t\t\ttry {\n \t\t\t\t\t\tid = rs.getString(\"id\");\n \t\t\t\t\t} catch (SQLException e) {e.printStackTrace();}\n \t\t\t\t\t\n \t\t\t\t\tString hash = null;\t\t\t\t\t\n \t\t\t\t\ttry {\n \t\t\t\t\t\thash = rs.getString(\"hash\");\n \t\t\t\t\t} catch (SQLException e) {e.printStackTrace();}\n \t\t\t\t\t\n \t\t\t\t\tboolean isAdmin = false;\n \t\t\t\t\ttry {\n \t\t\t\t\t\tisAdmin = rs.getBoolean(\"isAdmin\");\n \t\t\t\t\t} catch (SQLException e) {e.printStackTrace();}\n \t\t\t\t\t\n \t\t\t\t\tString image = null;\n \t\t\t\t\ttry {\n \t\t\t\t\t\timage = rs.getString(\"image_url\");\n \t\t\t\t\t} catch (SQLException e) {e.printStackTrace();}\n \t\t\t\t\t\n \t\t\t\t\tmatches.add(new User(id, hash, isAdmin, this, image));\n \t\t\t\t}\n \t\t\t}catch (SQLException e) {e.printStackTrace();}\t\t\t\n \t\t\t\n \t\t\treturn matches;\t\t\n \t\t}", "public String searchName(String username) {\n\n db = this.getReadableDatabase();\n String query = \"select username, name from \"+ TABLE_NAME;\n Cursor cursor = db.rawQuery(query, null);\n\n String uname, name;\n name = \"not found\";\n\n if (cursor.moveToFirst()) {\n\n do {\n uname = cursor.getString(0);\n if (uname.equals(username)) {\n name = cursor.getString(1);\n break;\n }\n } while (cursor.moveToNext());\n }\n\n return name;\n }", "@Override\n public boolean onQueryTextChange(String s) {\n if(!TextUtils.isEmpty(s.trim()))\n {\n //search text contains text, search it\n searchUsers(s);\n } else {\n // search text empty, get all users\n getAllUsers();\n }\n return false;\n }", "public List<UserVO> searchUserDetails(UserVO searchUser) throws UserException {\n List<UserVO> userList = null;\n try {\n userList = userDAO.searchUserDetails(searchUser);\n } catch (UserException e) {\n log.error(\" Exception type in service impl \" + e.getExceptionType());\n throw new UserException(e.getExceptionType());\n } catch (Exception e1) {\n e1.printStackTrace();\n }\n return userList;\n }", "@Override\n public void onTextChanged(CharSequence s, int start, int before, int count) {\n search(searchIput.getText().toString()); // search user\n }", "List<UserRole> searchUserRole(UserRole userRole);", "@Test\n public void userSearchUsersTest() {\n String q = null;\n InlineResponse2003 response = api.userSearchUsers(q);\n\n // TODO: test validations\n }", "@Override\n public boolean onQueryTextSubmit(String s) {\n if(!TextUtils.isEmpty(s.trim()))\n {\n //search text contains text, search it\n searchUsers(s);\n } else {\n // search text empty, get all users\n getAllUsers();\n }\n\n return false;\n }", "private List<User> simulateSearchResult(String firstName)\n\t{\n\n\t\tArrayList<User> user=(ArrayList<User>) userService.getAllUsers();\n\t\tArrayList<User> result = new ArrayList<User>();\n\t\tfor (User u : user) {\n\t\t\tif (u.getFirstName().contains(firstName)) {\n\t\t\t\tresult.add(u);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}", "public String searchEmail(String username) {\n\n db = this.getReadableDatabase();\n String query = \"select username, email from \" + TABLE_NAME;\n Cursor cursor = db.rawQuery(query,null);\n\n String uname, email;\n email = \"not found\";\n\n if (cursor.moveToFirst()) {\n\n do {\n uname = cursor.getString(0);\n if (uname.equals(username)) {\n email = cursor.getString(1);\n break;\n }\n } while (cursor.moveToNext());\n }\n return email;\n }", "Page<User> getAll(Pageable pageable, String search);", "@RequestMapping(value = \"/searchuser.json\", method = RequestMethod.GET)\n\t@ResponseBody\n\tpublic ResultDto searchUser(String keyword,Integer pageIndex ,Integer pageSize,Integer clientId,\n\t\t\tHttpServletRequest request, HttpServletResponse reponse) {\n\t\ttry {\n\t\t\tMap<String, Object> map = new HashMap<String,Object>();\n\t\t\tmap.put(\"keyword\", keyword);\n\t\t\tmap.put(\"rows\", pageSize);\n\t\t\tmap.put(\"clientid\", clientId);\n\t\t\tmap.put(\"page\", (pageIndex-1)*pageSize);\n\t\t\tMap<String, Object> templates = this.userService.getUserForPage(map);\n\t\t\treponse.setStatus(Constant.HTTP_OK);\n\t\t\treturn new ResultDto(Constant.ACK, Constant.SUCCEED, templates);\n\t\t} catch (SQLException e) {\n\t\t\treponse.setStatus(Constant.SERVER_ERROR);\n\t\t\tlogger.error(e.toString());\n\t\t\treturn new ResultDto(Constant.NACK, \"get detailed fail\", null);\n\t\t}\n\t}", "@Override\r\n\tpublic Userinfo findbyname(String name) {\n\t\treturn userDAO.searchUserByName(name);\r\n\t}", "List<User> findAllByUsernameContains(String username);", "@Override\n\tpublic void searchByMobile() {\n\t\tcount = 0;\n\t\tif (UtilityClinic.patFile == null) {\n\t\t\ttry {\n\t\t\t\tutil.accessExistingPatJson();\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\tSystem.out.println(\"File not found\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tutil.readFromPatJson(UtilityClinic.patFile);\n\t\tSystem.out.println(\"Enter search.....\");\n\t\tString search = UtilityClinic.readString();\n\t\tSystem.out.println(\"Showing search result(s).......\");\n\t\tfor (int i = 0; i < UtilityClinic.patJson.size(); i++) {\n\t\t\tJSONObject jsnobj = (JSONObject) UtilityClinic.patJson.get(i);\n\t\t\tif (jsnobj.get(\"Mobile\").toString().equals(search)) {\n\t\t\t\tpMob = jsnobj.get(\"Mobile\").toString();\n\t\t\t\tpName = jsnobj.get(\"Patient's name\").toString();\n\t\t\t\tpId = jsnobj.get(\"Patient's ID\").toString();\n\t\t\t\tSystem.out.print(++count + \" Name:\" + pName + \" ID:\" + pId + \" Mobile:\" + pMob + \" Age:\"\n\t\t\t\t\t\t+ jsnobj.get(\"Age\") + \"\\n\\n\");\n\t\t\t}\n\t\t}\n\t\tif (count == 0) {\n\t\t\tSystem.out.println(\"No results found.....\");\n\t\t}\n\t\tSystem.out.println();\n\t}", "public void searchFunction1() {\n textField_Search.textProperty().addListener(new ChangeListener<String>() {\n @Override\n public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {\n tableView_recylce.setPredicate(new Predicate<TreeItem<EntryProperty>>() {\n @Override\n public boolean test(TreeItem<EntryProperty> entryTreeItem) {\n Boolean flag = entryTreeItem.getValue().titleProperty().getValue().toLowerCase().contains(newValue.toLowerCase()) ||\n entryTreeItem.getValue().usernameProperty().getValue().toLowerCase().contains(newValue.toLowerCase());\n return flag;\n }\n });\n }\n });\n }", "void searchDatabase(String userInput)\n {\n List<Recipe> result = this.database.getRecipes(userInput);\n\n recipeListAdapter.updateRecipeList(result);\n }", "@Override\n\tpublic List<User> showUserList(Search search) {\n\t\treturn userDao.showUserList(search);\n\t}", "private void searchBooks(final String userQuery){\n mTTS = new TextToSpeech(this, this);\n\n //When the search Button is pressed, a query is run\n searchButton = findViewById(R.id.searchButton);\n searchButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n getSupportFragmentManager().beginTransaction()\n .replace(R.id.listLayout, LoadingFragment.newInstance()).commit();\n// query = searchEditText.getText().toString();\n new FetchData(MainActivity.this).execute(userQuery);\n speakText(userQuery);\n }\n });\n }", "@Override\n\tpublic void searchByName() {\n\t\tcount = 0;\n\t\tif (UtilityClinic.patFile == null) {\n\t\t\ttry {\n\t\t\t\tutil.accessExistingPatJson();\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\tSystem.out.println(\"File not found\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tutil.readFromPatJson(UtilityClinic.patFile);\n\t\tSystem.out.println(\"Enter search.....\");\n\t\tString search = UtilityClinic.readString();\n\t\tSystem.out.println(\"Showing search result(s).......\");\n\t\tfor (int i = 0; i < UtilityClinic.patJson.size(); i++) {\n\t\t\tJSONObject jsnobj = (JSONObject) UtilityClinic.patJson.get(i);\n\t\t\tif (jsnobj.get(\"Patient's name\").toString().equals(search))\n\t\t\t\tSystem.out.print(\n\t\t\t\t\t\t++count + \" Name:\" + jsnobj.get(\"Patient's name\") + \" ID:\" + jsnobj.get(\"Patient's ID\")\n\t\t\t\t\t\t\t\t+ \" Mobile:\" + jsnobj.get(\"Mobile\") + \" Age:\" + jsnobj.get(\"Age\"));\n\t\t}\n\t\tif (count == 0) {\n\t\t\tSystem.out.println(\"No results found.....\");\n\t\t}\n\t}", "void addUserSearchEntry(UserSearchEntry searchCriteria);", "@Query(\"select a from UserSpace a where a.title =?1\")\n\tpublic List<UserSpace> userSpacesearch(String text);", "@Override\r\n\tpublic void search() {\n\r\n\t}", "public static UserEntity search(String email) {\n\t\tDatastoreService datastore = DatastoreServiceFactory\n\t\t\t\t.getDatastoreService();\n\n\t\tQuery gaeQuery = new Query(\"users\");\n\t\tPreparedQuery pq = datastore.prepare(gaeQuery);\n\t\t\n\t\tfor (Entity entity : pq.asIterable()) {\n\t\t\t \n\t\t\tif (entity.getProperty(\"email\").toString().equals(email)) {\n\t\t\t\tUserEntity returnedUser = new UserEntity(entity.getProperty(\n\t\t\t\t\t\t\"name\").toString(), entity.getProperty(\"email\")\n\t\t\t\t\t\t.toString());\n\t\t\t\treturnedUser.setId(entity.getKey().getId());\n\t\t\t\treturn returnedUser;\n\t\t\t }\nelse{\n\t\t\t\t\n }\n\t\t}\n\n\t\treturn null;\n\t}", "@Repository(\"userRepository\")\npublic interface UserRepository extends JpaRepository<User, UUID> {\n\n User findByEmail(String email);\n\n List<User> findByFirstNameIgnoreCaseContaining(String firstName);\n\n List<User> findByLastNameIgnoreCaseContaining(String lastName);\n\n List<User> findByEmailIgnoreCaseContaining(String email);\n\n @Query(\"SELECT t FROM User t WHERE \" +\n \"LOWER(t.lastName) LIKE LOWER(CONCAT('%',:searchTerm, '%')) OR \" +\n \"LOWER(t.firstName) LIKE LOWER(CONCAT('%',:searchTerm, '%'))\")\n Page<User> searchByTerm(@Param(\"searchTerm\") String searchTerm, Pageable pageable);\n}" ]
[ "0.83429396", "0.80791587", "0.7853299", "0.784969", "0.76258653", "0.76056075", "0.7555751", "0.7405068", "0.737043", "0.7354143", "0.73303556", "0.7330094", "0.73290247", "0.7295815", "0.7275104", "0.7250783", "0.72438407", "0.7208224", "0.71374124", "0.71204555", "0.7060246", "0.70114547", "0.69917387", "0.6954935", "0.6951508", "0.6924352", "0.68743044", "0.68506944", "0.6848539", "0.6799452", "0.6797877", "0.6776753", "0.6757116", "0.6754158", "0.6751899", "0.67450935", "0.6739146", "0.67358726", "0.67358726", "0.67233425", "0.6697954", "0.66866165", "0.6681158", "0.6672276", "0.66550994", "0.665212", "0.66422164", "0.66336995", "0.6625037", "0.6620439", "0.6601117", "0.65990305", "0.6590393", "0.6558847", "0.6548466", "0.65418065", "0.6540557", "0.65367246", "0.65348", "0.65335166", "0.65231246", "0.6510069", "0.6507544", "0.64767957", "0.6475369", "0.6469582", "0.6462037", "0.6427216", "0.6407498", "0.6403236", "0.64018196", "0.6379073", "0.6374133", "0.6373979", "0.636801", "0.63610184", "0.6356444", "0.63560385", "0.63474303", "0.6324283", "0.63240993", "0.6323079", "0.6310433", "0.6292808", "0.6234018", "0.62313527", "0.6229451", "0.62033236", "0.6196145", "0.6192921", "0.61774695", "0.61741126", "0.6173494", "0.61671996", "0.6160124", "0.6154021", "0.614532", "0.6145076", "0.61427575", "0.6130774" ]
0.6513466
61
listen for clicking users prompted after search / method launches when item is clicked
@Override public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) { // add friend's data into intent Intent Message = new Intent(getBaseContext(), MessagingPage.class); Message.putExtra("friend_name", friends.get(i).getUsername()); Message.putExtra("friend_id", friends.get(i).getId()); Message.putExtra("friend_image", friends.get(i).getImagePath ()); startActivity(Message); finish(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void issuedClick(String item);", "private void addSearchBtnClickHandler() {\n view.getSearchBtn().addClickHandler(new ClickHandler() {\n @Override\n public void onClick(ClickEvent event) {\n executeSearch();\n }\n });\n }", "@Override\r\n\tpublic void searchObjectListener(ActionEvent e) {\n\t\t\r\n\t}", "private void findClubEvent () {\n \n findClubEvent (\n findButton.getText(), \n findText.getText().trim(), \n true);\n \n if (findText.getText().trim().length() == 0) {\n findText.grabFocus();\n statusBar.setStatus(\"Enter a search string\");\n }\n }", "public void handleSearch(ActionEvent actionEvent) {\n\t\tRadioButton radio = (RadioButton) toogleSearch.getSelectedToggle();\n\t\tString searchString = txtSearch.getText();\n\t\tObservableList<Item> itemList;\n\t\tif(radio == radioID){\n\t\t\ttry {\n\t\t\t\titemList = ItemDAO.searchItemById(searchString);\n\t\t\t\tpopulateItems(itemList);\n\t\t\t} catch (SQLException e) {\n\t\t\t\tExp.displayException(e);\n\t\t\t} catch (ClassNotFoundException e) {\n\t\t\t\tExp.displayException(e);\n\t\t\t}\n\t\t} else if(radio == radioName){\n\t\t\ttry {\n\t\t\t\titemList = ItemDAO.searchItemByName(searchString);\n\t\t\t\tpopulateItems(itemList);\n\t\t\t} catch (SQLException e) {\n\t\t\t\tExp.displayException(e);\n\t\t\t} catch (ClassNotFoundException e) {\n\t\t\t\tExp.displayException(e);\n\t\t\t}\n\t\t} else {\n\t\t\ttry {\n\t\t\t\titemList = ItemDAO.searchItemByLocation(searchString);\n\t\t\t\tpopulateItems(itemList);\n\t\t\t} catch (SQLException e) {\n\t\t\t\tExp.displayException(e);\n\t\t\t} catch (ClassNotFoundException e) {\n\t\t\t\tExp.displayException(e);\n\t\t\t}\n\t\t}\n\n\n\n\t}", "public void mouseClicked(MouseEvent me){\r\n if (me.getClickCount() == 2) {\r\n /*set issponsorSearchRequired to true to avoid firing in\r\n *focusLost event\r\n */\r\n txtSponsorCode.setCursor(new Cursor(Cursor.WAIT_CURSOR) );\r\n isSponsorSearchRequired =true;\r\n showSponsorInfo();\r\n txtSponsorCode.setCursor(new Cursor(Cursor.DEFAULT_CURSOR) );\r\n }\r\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t\n\t\t\t\tConstants.searchText = txtSearchBox.getText().toString();\n\t\t\t\tseachExhibitions();\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\tnew Search();\n\t\t\t\tdispose(); // 해당 프레임만 사라짐\n\t\t\t}", "@Listen(\"onClick=#findEntryButton\")\n public void findEntryButtonOnClick(){\n String stringToFind = findFieldTextbox.getValue();\n List<Entry> entries;\n if (stringToFind.isEmpty()){\n entries = DAO.getAllEntryEntities();\n } else {\n entries = DAO.findEntities(stringToFind);\n }\n\n Listbox listbox = (Listbox) phonePageWindow.getFellow(\"entriesListbox\", true);\n ListboxComposer composer = (ListboxComposer) listbox.getAttribute(\"$composer\");\n composer.refreshModel(entries);\n }", "private void showSearch() {\n\t\tonSearchRequested();\n\t}", "void clickItem(int uid);", "private void searchMenu(){\n\t\t\n\t}", "public void actionPerformed(ActionEvent InputEvent)\r\n {\r\n performSearch();\r\n }", "@Override\n\t\t\tpublic void onClick(View arg0)\n\t\t\t{\n\t\t\t\tintent.setClass(SearchView.this.getActivity(),\n\t\t\t\t\t\tSearchResultActivity.class);\n\t\t\t\tintent.putExtra(\"selection\", search_info.getText().toString());\n\t\t\t\tSearchView.this.startActivity(intent);\n\n\t\t\t}", "public void actionPerformed(ActionEvent e)\n\t{\n\t\tWindowController.searchFor();\n\t}", "@Override\n\t\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\t\tLog.i(TAG, \"onItemSelected()\");\n\n\t\t\tswitch (item.getItemId()) { \n\t\t\tcase R.id.idSearchNew:\n\t\t\t\t// start a new search \n\t\t\t\tMakeToast.makeToast(this, \"start a new search\",\n\t\t\t\t\t\t\t\t\tMakeToast.LEVEL_DEBUG);\n\t\t\t\tbreak;\n\n\t\t\tcase R.id.idSearchAgain:\n\t\t\t\t// search again in current results \n\t\t\t\tMakeToast.makeToast(this, \"start search in current result\",\n\t\t\t\t\t\t\t\t\tMakeToast.LEVEL_DEBUG);\n\t\t\t\tbreak;\n\n\t\t\tcase R.id.idEndSearch:\n\t\t\t\t// done searching\n\t\t\t\tfinish();\t\t// end this task\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn true;\n\t\t}", "void searchUI();", "@Override\n\tpublic boolean onSearchRequested()\n\t{\n \tstartSearch(getCurSearch(), true, null, false);\n \treturn true;\n\t}", "@Override\r\n public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n int id_To_Search = arg2 + 1;\r\n String name = (String) arg0.getItemAtPosition(arg2);\r\n\r\n Bundle dataBundle = new Bundle();\r\n dataBundle.putString(\"name\", name);\r\n dataBundle.putInt(\"id\", id_To_Search);\r\n\r\n Intent intent = new Intent(getApplicationContext(),DisplayCreatedRecipes.class);\r\n intent.putExtras(dataBundle);\r\n startActivity(intent);\r\n }", "public void actionPerformed(ActionEvent e) {\r\n\r\n if (identifier.intValue() == KeyEvent.VK_F3 || identifier.intValue() == KeyEvent.VK_ENTER) {\r\n btnSearch.doClick();\r\n }\r\n else if (identifier.intValue() == KeyEvent.VK_F12 || identifier.intValue() == KeyEvent.VK_ESCAPE) {\r\n btnCancel.doClick();\r\n }\r\n }", "@Override\n public boolean onQueryTextChange(String newText) {\n currentSearchData = new ArrayList<String>();\n getCurrentSearchData(newText);\n RelativeLayout searchDataRelativeView = (RelativeLayout) findViewById(R.id.search_relative_view);\n searchDataRelativeView.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n\n\n }\n });\n showCurrentData();\n System.out.println(\"\");\n return false;\n }", "private void addSearchContentBoxClickHandler() {\n view.getSearchContent().addKeyUpHandler(new KeyUpHandler() {\n @Override\n public void onKeyUp(KeyUpEvent event) {\n if (event.getNativeKeyCode() == Constants.ENTER_KEY_CODE) {\n executeSearch();\n }\n }\n });\n }", "public void friendSearchClick(ActionEvent event) throws Exception{\r\n displayAddFriendresults();\r\n }", "@OptionsItem(R.id.search_multi)\n\tvoid searchMultiMenuClicked() {\n\t\tstartActivity(new Intent(this, MultiCriteriaSearchActivity_.class));\n\t}", "public void onSearchButtonClick(View view){\r\n\t\t\r\n\t\tfor (ListingItem item : ListingContent.ITEMS) {\r\n\t\t\tif (item.content.toUpperCase(Locale.getDefault()).contains(searchField.getText().toString().toUpperCase(Locale.getDefault()))) {\r\n\t\t\t\tresults.add(item);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tsetListAdapter(new ArrayAdapter<ListingContent.ListingItem>(this,\r\n\t\t\t\tandroid.R.layout.simple_list_item_1,\r\n\t\t\t\tandroid.R.id.text1, results));\r\n\t}", "private void addAdvanceSearchBtnClickHandler() {\n view.getAdvSearchBtn().addClickHandler(new ClickHandler() {\n\n @Override\n public void onClick(ClickEvent event) {\n eventBus.goToAdvancedSearch();\n }\n });\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n //if (id == R.id.search) {\n //onSearchRequested();\n// return true;\n // }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public void onResultClick(SearchResult result) {\n }", "@Override \r\n public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n if(!isSendingQuestion){\r\n List<String> topicList = mAdpater.getHotTopicArray();\r\n String question = topicList.get(arg2);\r\n mSearch.setText(question);\t\r\n mSearch.requestFocus();\r\n InputMethodManager inputManager =(InputMethodManager)mContext.getSystemService(Context.INPUT_METHOD_SERVICE); \r\n inputManager.showSoftInput(mSearch, 0);\r\n }\r\n \r\n }", "@Override\n public void onClick(View view) {\n activity.searchAgain();\n }", "@Override\n\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\tIntent startSearch=new Intent(Launcher.this, SearchActivity.class);\n\t\t\t\t\tstartActivity(startSearch);\n\t\t\t\t}", "private void executeSearch() {\n if (!view.getSearchContent().getText().isEmpty()) {\n SearchModuleDataHolder filter = SearchModuleDataHolder.getSearchModuleDataHolder();\n //set search content text for full text search\n filter.setSearchText(view.getSearchContent().getText());\n forwardToCurrentView(filter);\n } else {\n eventBus.showPopupNoSearchCriteria();\n }\n }", "public void clickSearch() {\n\t\twaitForDocumentReady(5);\n\t\tlog.debug(\"Clicking on search button\");\n\t\tclickOn(search_button, 20);\n\t\tlog.info(\"Clicked on search button\");\n\t\tlogger.log(Status.INFO, \"Search for cruise completed\");\n\t\t\n\t}", "public void onGoToAdvancedSearch() {\n eventBus.showAdvanceSearchPopup(newAttributeSearchWidget);\n }", "HasClickHandlers getSearchButton();", "@FXML\n public void onButtonClick(ActionEvent e){\n if(e.getSource().equals(exit)){\n System.exit(0);\n }\n else if(e.getSource().equals(search)){\n performSearch();\n }\n }", "@FXML\n\tprivate void searchButtonAction(ActionEvent clickEvent) {\n\t\t\n\t\tString searchParameter = partsSearchTextField.getText().trim();\n\t\tScanner scanner = new Scanner(searchParameter);\n\t\t\n\t\tif (scanner.hasNextInt()) {\n\t\t\t\n\t\t\tPart part = Inventory.lookupPart(Integer.parseInt(searchParameter));\n\t\t\t\n\t\t\tif (part != null) {\n\t\t\t\t\n\t\t\t\tpartSearchProductTable.setItems(\n\t\t\t\t\tInventory.lookupPart(part.getName().trim().toLowerCase()));\n\t\t\t}\n\t\t} else {\n\t\t\t\n\t\t\tpartSearchProductTable.setItems(\n\t\t\t\t\tInventory.lookupPart(searchParameter.trim().toLowerCase()));\n\t\t}\n\t}", "@Test(dependsOnMethods = {\"login\"})\n\tpublic void searchItem() {\n\t\thome.searchItem(data.readData(\"searchItem\"));\n\t\t// generating random number from total search result display using random number generator\n\t\tint index=data.randomeNum(getElementsCount(By.id(home.selectItem)));\n\t\t// storing title and price of searched item from search screen to verify later\n\t\ttitle= home.getTitle(index);\n\t\tprice=home.getPrice(index);\n\t\telementByIndex(By.id(home.selectItem), index).click();\n\t\twaitForElement(By.xpath(item.review));\n\t\t//Scrolling till we see addtocart button\n\t\tscrollPage();\n\t\tboolean actual = elementDisplay(By.xpath(item.addToCar));\n\t\tAssert.assertEquals(actual, true,\"Add to cart button not display\");\n\t}", "@Override\n public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n long id_To_Search = arg3;\n Bundle dataBundle = new Bundle();\n dataBundle.putLong(\"id\", id_To_Search);\n Intent intent = new Intent(getApplicationContext(), DisplayContactActivity.class);\n intent.putExtras(dataBundle);\n startActivity(intent);\n }", "@Override\n\t\t\tpublic void handle(ActionEvent arg0) {\n\t\t\t\tusers.setFirstName(txsearch.getText());\n\t\t\t\tif (user != null) {\n\t\t\t\t\ttable.setItems(FXCollections.observableArrayList(ep.search(users)));\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tAlert alert = new Alert(AlertType.INFORMATION);\n\t\t\t\t\talert.setHeaderText(null);\n\t\t\t\t\talert.setTitle(\"Search\");\n\t\t\t\t\talert.setContentText(\"Please Type the name that you want to search\");\n\t\t\t\t\talert.showAndWait();\n\t\t\t\t\t\n\n\t\t\t\t}\n\t\t\t}", "public void clickHandler(View v) {\n\t\tIntent intent;\n\t\tswitch(v.getId()) {\n\t\tcase R.id.bHomeSReturn:\n\t\t\tfinish();\n\t\t\tbreak;\n\t\tcase R.id.bHomeSPantry:\n\t\t\tGlobalApplication app = (GlobalApplication) getApplication();\n\t\t\tuserRecipes = app.getCurrentUser().getUserPantry();\n\t\t\t\n\t\t\tSystem.err.println(\"Ingreds: \" + userRecipes.toSearchString());\n\t\t\t\n\t\t\tNetworkHandler nh = new NetworkHandler();\n\t\t\ttry {\n\t\t\t\trecipes = nh.searchRecipes(userRecipes.toSearchString());\n\t\t\t} catch (ClientProtocolException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tListView listView = (ListView) findViewById(R.id.searchResults);\n\n\t\t\t// Convert them to a string list\n\t\t\tArrayList<String> content = new ArrayList<String>();\n\t\t\tfor(int i = 0; i < recipes.size(); i++) {\n\t \t\tcontent.add(recipes.get(i).toString());\n\t \t}\n\t\t\t\n\t\t\tArrayAdapter<String> adapter = new ArrayAdapter<String>(this,\n\t\t\t\t\tandroid.R.layout.simple_list_item_1, content);\n\t\t\tlistView.setAdapter(adapter);\n\n\t\t\t// Set the onclick action\n\t\t\tlistView.setOnItemClickListener(new OnItemClickListener() {\n\n\t\t\t\t@Override\n\t\t\t\tpublic void onItemClick(AdapterView<?> adapterView, View view,\n\t\t\t\t\t\tint position, long id) {\n\t\t\t\t\t// Get and set the current recipes based on position\n\t\t\t\t\tGlobalApplication app = (GlobalApplication) getApplication();\n\t\t\t\t\tRecipe currentRecipe = recipes.get(position);\n\t\t\t\t\tapp.setCurrentRecipe(currentRecipe);\n\t\t\t\t\t//set up test to check user for the recipe\n\t\t\t\t\tif (currentRecipe.getOwner() != null) {\n\t\t\t\t\t\tif (currentRecipe.getOwner() == app.getCurrentUser().getUserName()){\n\t\t\t\t\t\t\tIntent intent = new Intent(\n\t\t\t\t\t\t\t\t\tapp,\n\t\t\t\t\t\t\t\t\tca.ualberta.cs.oneclick_cookbook.ViewFullRecipeActivity.class);\n\t\t\t\t\t\t\tintent.putExtra(\"position\", position);\n\t\t\t\t\t\t\tstartActivity(intent);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tIntent intent = new Intent(\n\t\t\t\t\t\t\t\t\tapp,\n\t\t\t\t\t\t\t\t\tca.ualberta.cs.oneclick_cookbook.CreateRecipeActivity.class);\n\t\t\t\t\t\t\tintent.putExtra(\"position\", position);\n\t\t\t\t\t\t\tstartActivity(intent);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//no current user allow for edit in the recipe\n\t\t\t\t\telse {\n\t\t\t\t\t\tIntent intent = new Intent(\n\t\t\t\t\t\t\t\tapp,\n\t\t\t\t\t\t\t\tca.ualberta.cs.oneclick_cookbook.CreateRecipeActivity.class);\n\t\t\t\t\t\tintent.putExtra(\"position\", position);\n\t\t\t\t\t\tstartActivity(intent);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t});\n\n\t\t\t// Set what happens when a user clicks on an item\n\t\t\tlistView.setOnItemLongClickListener(new OnItemLongClickListener() {\n\n\t\t\t\t@Override\n\t\t\t\tpublic boolean onItemLongClick(AdapterView<?> arg0, View v,\n\t\t\t\t\t\tfinal int position, long arg3) {\n\t\t\t\t\t// Builds the alert dialog box\n\t\t\t\t\tAlertDialog.Builder prompt = new AlertDialog.Builder(v\n\t\t\t\t\t\t\t.getContext());\n\t\t\t\t\tprompt.setTitle(\"Delete Recipe\");\n\t\t\t\t\tprompt.setMessage(\"Are you sure you want to delete this recipe? It \"\n\t\t\t\t\t\t\t+ \"will be gone... forever.\");\n\n\t\t\t\t\tprompt.setNegativeButton(\"No\",\n\t\t\t\t\t\t\tnew DialogInterface.OnClickListener() {\n\n\t\t\t\t\t\t\t\t// User has changed their mind\n\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\tpublic void onClick(DialogInterface dialog,\n\t\t\t\t\t\t\t\t\t\tint which) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\tprompt.setPositiveButton(\"Yes\",\n\t\t\t\t\t\t\tnew DialogInterface.OnClickListener() {\n\n\t\t\t\t\t\t\t\t// User does want to delete the recipe they are long\n\t\t\t\t\t\t\t\t// pressing\n\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\tpublic void onClick(DialogInterface dialog,\n\t\t\t\t\t\t\t\t\t\tint which) {\n\t\t\t\t\t\t\t\t\t// Get the global state\n\t\t\t\t\t\t\t\t\tGlobalApplication app = (GlobalApplication) getApplication();\n\n\t\t\t\t\t\t\t\t\t// Remove from ES\n\t\t\t\t\t\t\t\t\tNetworkHandler nh = new NetworkHandler();\n\t\t\t\t\t\t\t\t\tString id = recipes.get(position).getID();\n\n\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\tnh.deleteRecipe(id);\n\t\t\t\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Delete from the user\n\t\t\t\t\t\t\t\t\tapp.getCurrentUser().deleteRecipe(position);\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\tprompt.show();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t});\n\t\t\tbreak;\n\t\tcase R.id.bHomeSSearch:\n\t\t\tintent = new Intent(this.getApplicationContext(),\n\t\t\t\t\tKeywordSearchActivity.class);\n\t\t\tstartActivity(intent);\n\t\t\tbreak;\n\t\t}\n\t}", "public void clickOnSearchButton() {\n elementControl.clickElement(searchButton);\n }", "public void ClickSearch() {\r\n\t\tsearch.click();\r\n\t\t\tLog(\"Clicked the \\\"Search\\\" button on the GIS Locator page\");\r\n\t}", "public void clickSearchButton() {\n\t\tsearchButton.click();\n\t}", "public void run() {\n //txtReferredBy.requestFocus(); (commented because the lookup should always be through btnLookup\n btnLookup.requestFocus();\n }", "@Override\n public void onClick(View view) {\n Editable mNameViewText = mNameView.getText();\n Object mGenderViewSelectedItem = mGenderView.getSelectedItem();\n Object mAgeViewSelectedItem = mAgeView.getSelectedItem();\n SearchProvider.search(Shelter.getShelterList(),\n mNameViewText.toString(),\n mGenderViewSelectedItem.toString(),\n mAgeViewSelectedItem.toString());\n startActivity(new Intent(ShelterSearchActivity.this, ShelterResultsActivity.class));\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n\n getMenuInflater().inflate(R.menu.menu_main, menu);\n\n // Associate searchable configuration with the SearchView\n SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);\n SearchView searchView = (SearchView) menu.findItem(R.id.menuSearch).getActionView();\n searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));\n\n searchView.setIconifiedByDefault(false);\n searchView.setFocusable(true);\n searchView.setIconified(false);\n\n\n\n if( Intent.ACTION_VIEW.equals(getIntent().getAction())){\n Intent i = new Intent(SearchActivity.this, SearchActivity.class);\n query = getIntent().getStringExtra(SearchManager.QUERY);\n i.setAction(Intent.ACTION_SEARCH);\n i.putExtra(\"query\", query);\n startActivity(i);\n\n Toast.makeText(SearchActivity.this, query, Toast.LENGTH_SHORT).show();\n }\n\n searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {\n @Override\n public boolean onQueryTextSubmit(String query) {\n // INPUT CODE HERE\n Toast.makeText(SearchActivity.this, query, Toast.LENGTH_SHORT).show();\n return false;\n }\n\n @Override\n public boolean onQueryTextChange(String newText) {\n // INPUT CODE HERE\n// String[] q = {\"promotion_name\"};\n// String[] t = {newText};\n// MySuggestionProvider suggestion = new MySuggestionProvider();\n// suggestion.query(Uri.parse(\"database.it.kmitl.ac.th/it_35\"), q, \"promotion_name LIKE %?%\", t, null);\n return false;\n }\n });\n return true;\n }", "@Override\n public void onClick(View arg0) {\n\n\n String searchString = search_text.getText().toString();\n search_spinner.setOnItemSelectedListener(new CustomOnItemSelectedListener());\n String searchCategory = search_spinner.getSelectedItem().toString();\n System.out.println(\"I am here 1\");\n\n ListItem newsData = new ListItem();\n newsData.setType(searchCategory);\n newsData.setValue(searchString);\n gridMockData.add(newsData);\n System.out.println(\"here 2\");\n System.out.println(\"This is search:: \" + gridMockData + \" ::: \" + searchCategory + \" \" + searchString);\n\n //intent in fragment\n Fragment frag = new SearchResultFragment();\n android.support.v4.app.FragmentManager fragManager = getFragmentManager();\n fragManager.beginTransaction().replace(R.id.search_frag, frag).commit();\n\n }", "public void mmAddFriendSearchClick(ActionEvent event) throws Exception{\r\n displayAddFriendSearch();\r\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n Intent intent = new Intent(SearchResultActivity.this, UrbanWordActivity.class);\n intent.putExtra(\"position\", position);\n startActivity(intent);\n }", "private void handleIntent() {\n\t\tif (getIntent() != null && getIntent().getAction() != null) {\n\t\t\tif (getIntent().getAction().equals(Intent.ACTION_SEARCH)) {\n\t\t\t\tLog.d(\"MainActivityantivirus\", \"Action search!\");\n\t\t\t\tif (mCurrentFragmentType == NavigationElement.TYPE_APPS) {\n\t\t\t\t\tfinal String query = getIntent().getStringExtra(SearchManager.QUERY);\n\t\t\t\t\tif (query != null) {\n\t\t\t\t\t\t((AppsFragment) mCurrentFragment).onSearch(query);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3)\n\t\t\t{\n\t\t\t\tString str = ((TextView) arg1\n\t\t\t\t\t\t.findViewById(R.id.search_item_name)).getText()\n\t\t\t\t\t\t.toString();\n\t\t\t\tintent.putExtra(\"name\", str);\n\t\t\t\tintent.setClass(SearchView.this.getActivity(),\n\t\t\t\t\t\tDetailInfoActivity.class);\n\t\t\t\tSearchView.this.startActivity(intent);\n\t\t\t}", "@Override\n public void onSearchOpened() {\n }", "@Override\n public void onSearchOpened() {\n }", "@Override\n public void onSearchOpened() {\n }", "@When(\"user clicks on find details\")\r\n\t\tpublic void user_clicks_on_find_details() {\n\t\t}", "@Override\n\tpublic void filterClick() {\n\t\t\n\t}", "@Override\n public void onClick(View v) {\n sharedViewModel.sendSearch(book.getVolumeInfo().getTitle(), book.getVolumeInfo().getAuthors(), book.getVolumeInfo().getWebLink());\n }", "@Override\n public void onSearchOpened() {\n Log.v(\"SearchBox\", \"onSearchOpened()\");\n }", "public void actionPerformed(ActionEvent ae) {\r\n\t\tObject source = ae.getSource();\r\n\t\tif(source == jButton_back)\r\n\t\t{\r\n\t\t\tthis.setlastChoice(SUDecision.BACK);\r\n\t\t\tthis.setVisible(false);\r\n\t\t}\r\n\t\tif(source == jButton_SearchUser)\r\n\t\t{\r\n\t\t\ttry {\r\n\t\t\t\tresult = ((CLibraryManager)AUser.getInstance()).searchUser(jTextField_UserName.getText(),jTextField_UserID.getText(),jTextField_FirstName.getText(),jTextField_LastName.getText());\r\n\t\t\t\tthis.setlastChoice(SUDecision.SEARCHUSER);\r\n\t\t\t\tthis.setVisible(false);\r\n\t\t\t } catch (Exception e) {\r\n\t\t\t\t JOptionPane.showMessageDialog(null, e.getMessage() ,\"Error\",JOptionPane.ERROR_MESSAGE);\r\n\t\t\t }\r\n\t\t}\r\n\t\t\r\n\t}", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tIntent int_search = new Intent(getApplicationContext(),Search.class);\n\t\t \tstartActivity(int_search);\t\t\t\n\t\t\t}", "public void onClick(View v) {\n\t\t\t\tString searchInput = searchField.getText().toString();\n\t\t\t\tsavedString = searchInput;\n\t\t\t\tlist.setFilterText(searchInput);\n\t\t\t}", "public void clickOnfirstSearchItem(){\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- first item link should be clicked\");\r\n\t\ttry{\r\n\r\n\t\t\tclick(locator_split(\"ByeleSearchItems1\"));\r\n\t\t\twaitForPageToLoad(20);\r\n\t\t\tsleep(6000);\r\n\t\t\tSystem.out.println(\"first item link clicked\");\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- first item link is clicked\");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- first item link is not clicked\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"ByeleSearchItems1\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\r\n\t}", "public void onClickSubmitViewItem(View view)\n {\n EditText itemToSearchView = (EditText) findViewById(R.id.itemToViewEditTextId);\n String itemToSearch = itemToSearchView.getText().toString();\n if (!itemToSearch.equals (\"\"))\n invokeViewItem(itemToSearch);\n else Toast.makeText(getApplicationContext(), \"No item has been entered\", Toast.LENGTH_LONG).show();\n }", "public boolean action(Event e,Object o)\r\n {\r\n String text; // Search text entered by the user.\r\n\tString searchText; // Lower case version of above.\r\n\tURL newURL=null;\r\n\r\n\t// Chech to see if the option menu has been selected.\r\n\r\n\tif(e.target instanceof Choice)\r\n\t{\r\n\t Choice c=(Choice)e.target;\r\n\t try\r\n\t {\r\n\t maxSearch=Integer.parseInt(c.getSelectedItem(),10);\r\n\t }\r\n\t catch(NumberFormatException ne)\r\n\t {\r\n\t maxSearch=MAX_NUMBER_PAGES;\r\n\t }\r\n\t}\r\n\r\n\t// Check to see if a check box has been pressed.\r\n\tif(e.target instanceof Checkbox)\r\n\t{\r\n\t if(caseSensitive.getState() == true)\r\n\t matchCase=true;\r\n else matchCase=false;\r\n\t if(matchWholeWord.getState() ==true)\r\n\t matchWord=true;\r\n else matchWord=false;\r\n\t}\r\n\r\n // A Button has been pressed - which determine.\r\n\tif(e.target instanceof Button)\r\n\t{\r\n\t if(e.target == search)\r\n\t {\r\n\t // Search button pressed - read in search text entered \r\n\t\ttext=inputArea.getText();\r\n\t\t// Make sure there's something to search for\r\n\t\tif(text.length()==0)\r\n\t\t return(false);\r\n\t\t// New Search so clear the GUI out\r\n\t\tif(resultsArea.countItems()>0)\r\n\t\t resultsArea.clear();\r\n disableButtons();\r\n\t\tabort.enable();\r\n\t\tstatusArea.setText(\"\");\r\n\t\t// Clear out previous search data\r\n\t\tpageNames.removeAllElements();\r\n\t\tpageMatch.removeAllElements();\r\n\t\t// We're off start the search thread\r\n\t\tcp=new SearchPages(this,hostName,text,maxSearch);\r\n\t\tcp.start();\r\n\t }\r\n\t else if(e.target == abort)\r\n\t {\r\n\t // Abort button Pressed - stop the thread.\r\n\t\tif(cp != null)\r\n\t\t cp.stop();\r\n\t\tcp=null;\r\n\t\t// Enable Button for another search.\r\n\t\tenableButtons();\r\n\t\tabort.disable();\r\n\t }\r\n\t else\r\n\t {\r\n\t // Clear Button Pressed - clear all the fields and return.\r\n\t\tinputArea.setText(\"\");\r\n\t\tstatusArea.setText(\"\");\r\n\r\n\t\t// Clear radio Buttons.\r\n\t\tcaseSensitive.setState(false);\r\n\t\tcaseInsensitive.setState(true);\r\n\t\tmatchWholeWord.setState(false);\r\n\r\n\t\t// Clear option menu.\r\n\t\tnumPagesChoice.select(0);\r\n\t\ttry\r\n\t\t{\r\n\t\t maxSearch=Integer.parseInt(numPagesChoice.getSelectedItem(),10);\r\n\t\t}\r\n\t\tcatch(NumberFormatException ex)\r\n\t\t{\r\n\t\t maxSearch=MAX_NUMBER_PAGES;\r\n\t\t}\r\n\t\t\r\n\t\tif(resultsArea.countItems()>0)\r\n\t\t resultsArea.clear();\r\n cp=null;\r\n\t }\r\n\t}\r\n\r\n\t// Selection made from the list of matches.\r\n\tif(e.target instanceof java.awt.List)\r\n\t{\r\n\t java.awt.List list=(java.awt.List)e.target;\r\n\t int index=list.getSelectedIndex();\r\n\r\n\t // Extract the page name from the list.\r\n\t if(index<pageMatch.size())\r\n\t {\r\n\t String URLSelected=(String)pageMatch.elementAt(index);\r\n\t\ttry\r\n\t\t{\r\n\t\t // If URL store then use it.\r\n\t\t if(URLSelected.startsWith(\"http:\") || URLSelected.startsWith(\"file:\"))\r\n\t\t newURL=new URL(URLSelected);\r\n else if(server==null)\r\n\t\t newURL=new URL(\"http://www.\"+hostName+\"/\"+URLSelected);\r\n else newURL=new URL(server+URLSelected);\r\n\t\t}\r\n\t\tcatch(MalformedURLException except){}\r\n\t\tgetAppletContext().showDocument(newURL,\"_self\");\r\n\t }\r\n\t}\r\n\treturn true; // We are done.\r\n }", "@Override\n public void onClick(Author clickedItem) {\n Intent intent = new Intent(SearchUserActivity.this, UserActivity.class);\n intent.putExtra(AUTHOR_KEY, clickedItem.firebaseId);\n\n startActivity(intent);\n }", "@Override\n public void onClick(View view) {\n EditText searchField = (EditText) v.findViewById(R.id.searchField);\n // Setting inputedString to the current text in searchField\n String inputedString = searchField.getText().toString();\n\n // Calling the *searchGoogle* method with passed in text from the EditText\n // This method allows for users to Short-hand type in a phrase to search google, rather then go to google and then type it in and then hit search.\n listener.searchGoogle(\"https://www.google.com/?q=\" + inputedString + \"#q=\" + inputedString);\n \n // Utilizing public method dismiss(); to dismiss the search fragment dialog.\n dismiss();\n }", "private void search(){\n solo.waitForView(R.id.search_action_button);\n solo.clickOnView(solo.getView(R.id.search_action_button));\n\n //Click on search bar\n SearchView searchBar = (SearchView) solo.getView(R.id.search_experiment_query);\n solo.clickOnView(searchBar);\n solo.sleep(500);\n\n //Type in a word from the description\n solo.clearEditText(0);\n solo.typeText(0, searchTerm);\n }", "@Override\r\n public boolean onCreateOptionsMenu(Menu icon){\n\r\n MenuInflater expand = getMenuInflater();\r\n\r\n expand.inflate(R.menu.top_menu, icon); //Referencing to the specific menu\r\n\r\n MenuItem search = icon.findItem(R.id.search_bar);\r\n\r\n SearchView searchView = (SearchView) search.getActionView(); //Displays the search view button\r\n\r\n searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {\r\n\r\n\r\n @Override\r\n public boolean onQueryTextSubmit(String s) {//Begins filtering here\r\n\r\n adapterDevices.getFilter().filter(s);\r\n\r\n return false;\r\n }\r\n //Sends typed string in search bar to trigger search\r\n\r\n\r\n //Method is triggered if there is text change\r\n @Override\r\n public boolean onQueryTextChange(String s) {\r\n\r\n if(s.equals(\"\")){ //When search bar is empty again the page is reloaded\r\n\r\n Intent refresh = new Intent(getApplicationContext(), MyDevicesActivity.class);\r\n\r\n startActivity(refresh);\r\n\r\n finish();\r\n\r\n }\r\n return false;\r\n }\r\n });\r\n\r\n\r\n return true;\r\n\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_search) {\n Intent searchIntent = new Intent(this, SearchActivity.class);\n //pass current dat as extra\n startActivity(searchIntent);\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if (myDrawerToggle.onOptionsItemSelected(item)) {\n return true;\n }\n // Handle action buttons\n switch(item.getItemId()) {\n case R.string.action_websearch:\n // create intent to perform web search for this planet\n Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);\n intent.putExtra(SearchManager.QUERY, getSupportActionBar().getTitle());\n // catch event that there's no activity to handle intent\n if (intent.resolveActivity(getPackageManager()) != null) {\n startActivity(intent);\n } else {\n Toast.makeText(this, R.string.app_not_available, Toast.LENGTH_LONG).show();\n }\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "public void onSearchStarted();", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu_item, menu);\n MenuItem searchItem = menu.findItem(R.id.action_search);\n SearchView searchView = (SearchView) searchItem.getActionView();\n searchView.setImeOptions(EditorInfo.IME_ACTION_DONE);\n try{ searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {\n @Override\n public boolean onQueryTextSubmit(String query) {\n return false;\n }\n\n @Override\n public boolean onQueryTextChange(String newText) {\n DeliveryReturnBySupervisorAdapter.getFilter().filter(newText);\n return false;\n }\n });\n }\n catch (Exception e)\n {\n e.printStackTrace();\n Intent intent_stay = new Intent(DeliveryReturnBySupervisor.this, DeliveryWithoutStatus.class);\n Toast.makeText(this, \"Page Loading...\", Toast.LENGTH_SHORT).show();\n startActivity(intent_stay);\n }\n return true;\n }", "public void clickonFilter() {\n\t\t\n\t}", "@FXML\n private void btnSearchClick() {\n\n // Check if search field isn't empty\n if (!txtSearch.getText().equals(\"\")) {\n\n // Display the progress indicator\n resultsProgressIndicator.setVisible(true);\n\n // Get query results\n MovieAPIImpl movieAPIImpl = new MovieAPIImpl();\n movieAPIImpl.getMovieList(Constants.SERVICE_API_KEY, txtSearch.getText(), this);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n\t case R.id.menu_call_search_dialpad:\n\t\t mHaptic.vibrate();\n if (mListener != null) {\n mListener.onSearchButtonPressed();\n }\n\t\t return true ;\n case R.id.menu_2s_pause:\n updateDialString(\",\");\n return true;\n case R.id.menu_add_wait:\n updateDialString(\";\");\n return true;\n default:\n return false;\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Take appropriate action for each action item click\n switch (item.getItemId()) {\n case R.id.action_search:\n // search action\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "private void clickEnter(){\n\t\tString commandInput = textInput.getText();\n\t\tString feedback;\n\n\t\tif (commandIsClear(commandInput)) {\n\t\t\tusedCommands.addFirst(commandInput);\n\t\t\tclearLinkedDisplay();\n\n\t\t} else {\n\t\t\tif (commandInput.trim().isEmpty()) {\n\t\t\t\tfeedback = \"Empty command\";\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\tusedCommands.addFirst(commandInput);\n\t\t\t\t\tParser parser = new Parser(commandInput);\n\t\t\t\t\tTask currentTask = parser.parseInput();\n\t\t\t\t\t\n\t\t\t\t\tif (currentTask.getOpCode() == OPCODE.EXIT) {\n\t\t\t\t\t\tWindow frame = findWindow(widgetPanel);\n\t\t\t\t\t\tframe.dispatchEvent(new WindowEvent(frame, WindowEvent.WINDOW_CLOSING));\n\t\t\t\t\t\tframe.dispose();\n\t\t\t\t\t}\n\t\t\t\t\tif (currentTask.getOpCode() == OPCODE.HELP) {\n\t\t\t\t\t\tfeedback = currentTask.getHelpMessage();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfeedback = GUIAbstract.getLogic().executeTask(currentTask);\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tfeedback = e.getMessage();\n\t\t\t\t}\n\t\t\t}\n\t\t\tlinkedDisplay.displayFeedback(feedback);\n\t\t\tfor (TasksWidget widget : linkedOptionalDisplays) {\n\t\t\t\twidget.doActionOnClick();\n\t\t\t}\n\t\t}\n\t\tclearTextInput();\n\t}", "private void clickcallback() {\n final ListView listView = findViewById(R.id.listViewCollections);\n\n listView.setOnItemClickListener(ClickListener());\n\n if (friendID == null) {\n listView.setOnItemLongClickListener(LongClickListener());\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n Intent i;\n switch (id) {\n case R.id.action_search:\n break;\n case R.id.overflow1:\n i = new Intent(Intent.ACTION_VIEW);\n i.setData(Uri.parse(\"http://advanced.shifoo.in/site/appterms-and-conditions\"));\n startActivity(i);\n break;\n case R.id.overflow2:\n i = new Intent(Intent.ACTION_VIEW);\n i.setData(Uri.parse(\"http://www.shifoo.in/site/privacy-policy\"));\n startActivity(i);\n break;\n default:\n return super.onOptionsItemSelected(item);\n }\n return true;\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tIntent suggestionsActivity = new Intent(HomeActivity.this,SearchActivity.class);\n\t\t\t\tstartActivity(suggestionsActivity);\n\t\t\t\t//Toast.makeText(getApplicationContext(), \"Search\",Toast.LENGTH_SHORT).show();\n\t\t\t}", "@FXML\r\n private void searchBtnAction(ActionEvent event) throws IOException {\r\n \r\n if (event.getSource() == partSearchBtn) {\r\n lookupPart();\r\n }\r\n else {\r\n if (event.getSource() == productSearchBtn) {\r\n lookupProduct();\r\n }\r\n }\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.search_item) {\n startActivity(new Intent(MainActivity.this,SearchActivity.class));\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "public void mouseClicked(MouseEvent e)\n {\n displaySelectedQuestion();\n }", "public void actionPerformed(ActionEvent ae) {\n theAppMgr.fireButtonEvent(\"CUST_LOOKUP\");\n }", "@Override\r\n\t\tpublic void onItemClick(AdapterView<?> adapter, View view, int postion,\r\n\t\t\t\tlong id) {\n\t\t\tif(search_contact_for_name == true){\r\n\t\t\t\tIntent intent = new Intent(search_contact.this,add_birthday.class);\r\n\t\t\t\tintent.putExtra(\"search_contact_for_name\", listItems.get(postion).getName());\r\n\t\t\t\tsetResult(add_birthday.SEARCH_CONTACT_FOR_NAME, intent);\r\n\t\t\t\tsearch_contact.this.finish();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif(search_contact_for_phone == true){\r\n\t\t\t\tIntent intent = new Intent(search_contact.this,add_birthday.class);\r\n\t\t\t\tintent.putExtra(\"search_contact_for_phone\", listItems.get(postion).getPhone());\r\n\t\t\t\tsetResult(add_birthday.SEARCH_CONTACT_FOR_PHONE, intent);\r\n\t\t\t\tsearch_contact.this.finish();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif(send_sms_search_contact_for_phone == true){\r\n\t\t\t\tIntent intent = new Intent(search_contact.this,send_sms.class);\r\n\t\t\t\tintent.putExtra(\"send_sms_search_contact_for_phone\", listItems.get(postion).getPhone());\r\n\t\t\t\tsetResult(send_sms.SEARCH_CONTACT_FOR_PHONE, intent);\r\n\t\t\t\tsearch_contact.this.finish();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if (mDrawerToggle.onOptionsItemSelected(item)) {\n return true;\n }\n // Handle action buttons\n switch (item.getItemId()) {\n case R.id.action_websearch:\n // create intent to perform web search for this planet\n Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);\n intent.putExtra(SearchManager.QUERY, getActionBar().getTitle());\n // catch event that there's no activity to handle intent\n if (intent.resolveActivity(getPackageManager()) != null) {\n startActivity(intent);\n } else {\n Toast.makeText(this, R.string.app_not_available, Toast.LENGTH_LONG).show();\n }\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "private void viewPageClicked(ActionEvent event) {\n\n Item tempItem = new Item();\n String itemURL = tempItem.itemURL;\n Desktop dk = Desktop.getDesktop();\n try{\n dk.browse(new java.net.URI(itemURL));\n }catch(IOException | URISyntaxException e){\n System.out.println(\"The URL on file is invalid.\");\n }\n\n showMessage(\"Visiting Item Web Page\");\n\n }", "abstract public void onSingleItemClick(View view);", "private void hookSingleClickAction() {\n\t\tthis.addSelectionChangedListener(new ISelectionChangedListener() {\n\t\t\tpublic void selectionChanged(SelectionChangedEvent event) {\n\t\t\t\tsingleClickAction.run();\n\t\t\t}\n\t\t});\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == R.id.search_item) {\n startActivity(new Intent(MainActivity.this, SearchActivity.class));\n //startActivity(new Intent(MainActivity.this,test.class));\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "private void displaySearch() throws JSONException, InterruptedException {\r\n logger.log(Level.INFO, \"\\nPlease enter the name of the club you would \" +\r\n \"like to search for or 'back' to return to initial prompt:\");\r\n \r\n // club name that user searches for\r\n String club = in.nextLine();\r\n \r\n // exit if user chooses to do so, otherwise search database\r\n if (\"back\".equalsIgnoreCase(club))\r\n displayOpen();\r\n else\r\n searchClub(club);\r\n }", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n adaptee.btnIDSearch_actionPerformed(e);\r\n\t}", "@FXML\n\tvoid search(ActionEvent event) {\n\n\t\ttry {\n\n\t\t\tif(idEditText.getText().equals(\"\")) {\n\n\t\t\t\tthrow new InsufficientInformationException();\n\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\tPlanetarySystem ps = ns.search(Integer.parseInt(idEditText.getText()));\n\n\t\t\t\tif(ps != null) {\n\t\t\t\t\t\n\t\t\t\t\tloadInformation(ps);\t\t\t\t\t\n\t\t\t\t\teditSelectionAlerts();\n\t\t\t\t\tupdateValidationsAvailability(true);\n\t\t\t\t\tupdateButtonsAvailability(true, true, true);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tsystemNotFoundAlert();\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\t\tcatch(InsufficientInformationException e) {\n\t\t\tinsufficientDataAlert();\n\t\t}\n\t\tcatch(Exception ex) {\n\t\t\tsystemNotFoundAlert();\n\t\t}\n\n\t}", "@Override\n public void onClick(View v) {\n popup.setOnMenuItemClickListener (new PopupMenu.OnMenuItemClickListener () {\n public boolean onMenuItemClick(MenuItem item) {\n GlobalVariables.indexCityChosen = GlobalVariables.popUpIDToCityIndex.get (item.getItemId ());\n GlobalVariables.CURRENT_CITY_NAME = item.getTitle ().toString ();\n if (GlobalVariables.CITY_GPS != null &&\n item.getTitle ().equals (GlobalVariables.CITY_GPS) &&\n GPSMethods.getCityIndexFromName (GlobalVariables.CITY_GPS) >= 0) {\n currentCityButton.setText (item.getTitle () + \"(GPS)\");\n } else {\n currentCityButton.setText (item.getTitle ());\n }\n ArrayList<EventInfo> tempEventsList =\n FilterMethods.filterByCityAndFilterName (\n GlobalVariables.namesCity[GlobalVariables.indexCityChosen],\n GlobalVariables.CURRENT_FILTER_NAME,\n GlobalVariables.CURRENT_SUB_FILTER,\n GlobalVariables.CURRENT_DATE_FILTER,\n GlobalVariables.CURRENT_PRICE_FILTER,\n GlobalVariables.ALL_EVENTS_DATA);\n filtered_events_data.clear ();\n filtered_events_data.addAll (tempEventsList);\n eventsListAdapter.notifyDataSetChanged ();\n GlobalVariables.USER_CHOSEN_CITY_MANUALLY = true;\n return true;\n }\n });\n popup.show ();//showing popup menu\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 shareTextUrl();\n return true;\n }\n if (id == R.id.search) {\n SearchView search = (SearchView) item.getActionView();\n\n search.setOnQueryTextListener(new SearchView.OnQueryTextListener() {\n @Override\n public boolean onQueryTextSubmit(String query) {\n ApiInterface apiService =\n ApiClient.getClient().create(ApiInterface.class);\n\n Call<ProductResponse> call = apiService.getProducts(query, API_KEY);\n call.enqueue(new Callback<ProductResponse>() {\n @Override\n public void onResponse(Call<ProductResponse> call, Response<ProductResponse> response) {\n List<Product> products = response.body().getResults();\n if (products.size() > 0) {\n binding.setProduct(products.get(0));\n productUrl = products.get(0).getProductUrl();\n productId = products.get(0).getProductId();\n fab.setImageResource(R.drawable.plus);\n }\n }\n\n\n @Override\n public void onFailure(Call<ProductResponse> call, Throwable t) {\n Log.e(TAG, t.toString());\n createDialog(t);\n }\n });\n return false;\n }\n\n @Override\n public boolean onQueryTextChange(String newText) {\n ApiInterface apiService =\n ApiClient.getClient().create(ApiInterface.class);\n\n Call<ProductResponse> call = apiService.getProducts(newText, API_KEY);\n call.enqueue(new Callback<ProductResponse>() {\n @Override\n public void onResponse(Call<ProductResponse> call, Response<ProductResponse> response) {\n List<Product> products = response.body().getResults();\n if (products.size() > 0) {\n binding.setProduct(products.get(0));\n productUrl = products.get(0).getProductUrl();\n productId = products.get(0).getProductId();\n fab.setImageResource(R.drawable.plus);\n }\n }\n\n @Override\n public void onFailure(Call<ProductResponse> call, Throwable t) {\n Log.e(TAG, t.toString());\n createDialog(t);\n }\n });\n return true;\n }\n });\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tfinal String query = etSearch.getText().toString();\n\n\t\t\t\t// creating new array list to hold data\n\t\t\t\tlistContacts = new ArrayList<Contact>();\n\n\t\t\t\tif (query.length() == 0) {\n\t\t\t\t\tlistContacts = new ArrayList<Contact>(contacts);\n\t\t\t\t} else {\n\t\t\t\t\t// filtering contacts\n\t\t\t\t\tfor (int i = 0; i < contacts.size(); i++) {\n\t\t\t\t\t\tContact contact = contacts.get(i);\n\n\t\t\t\t\t\tif (contact.name.toLowerCase().contains(\n\t\t\t\t\t\t\t\tquery.toLowerCase()))\n\t\t\t\t\t\t\tlistContacts.add(contact);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// setting new adapter\n\t\t\t\tContactsAdapter adapterContacts = new ContactsAdapter(\n\t\t\t\t\t\tgetActivity(), listContacts);\n\n\t\t\t\t// Sets the adapter for the ListView\n\t\t\t\tlvContacts.setAdapter(adapterContacts);\n\n\t\t\t\tlvContacts\n\t\t\t\t\t\t.setOnCreateContextMenuListener(ContactsFragment.this);\n\n\t\t\t\tLog.e(\"WeMeet_Test : Contact Search\", query);\n\t\t\t}", "public void handleResultShow(){\n\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(\"Make a selection\");\n\n //create the String[] to display the search result to user\n final CharSequence[] sArray = new CharSequence[searchResult.size()];\n for (int i = 0; i < searchResult.size(); i++){\n sArray[i] = searchResult.get(i).getSymbolwithName();\n }\n builder.setItems(sArray, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n //add the selection stock to main page\n validateAdd(searchResult.get(which));\n updatePrice();\n }\n });\n\n builder.setNegativeButton(\"Nevermind\", null);\n AlertDialog dialog = builder.create();\n dialog.show();\n\n }", "@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\tif(arg0.getActionCommand() == \"Submit selection\"){\n\t\t\tuserChoices.add(fpList.getFlightPlansList(modeLocal).get((int) flightPlanSpinner.getValue() - 1));\n\t\t\t// enter confirmation page if no return flight, otherwise call self?\n\t\t\tif(!isReturn && hasReturn){\n\t\t\t\tuserParams.SetReturnParams(userParams); // convert to return params\n\t\t\t\tnew SearchResultsGui(fpListArr, userChoices, true, 0, userParams);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tnew ConfirmationGui(userChoices);\n\t\t\t}\n\t\t\tdispose();\n\t\t}\n\t\telse if(arg0.getActionCommand() == \"Sort by Price\"){\n\t\t\tdispose();\n\t\t\tif(modeLocal == SORT_BY_PRICE_DESCENDING){\n\t\t\t\tmodeLocal = SORT_BY_PRICE_ASCENDING;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tmodeLocal = SORT_BY_PRICE_DESCENDING;\n\t\t\t}\n\t\t\tnew SearchResultsGui(fpListArr, userChoices, isReturn, modeLocal, userParams);\n\t\t}\n\t\telse if(arg0.getActionCommand() == \"Sort by Time\"){\n\t\t\tif(modeLocal == SORT_BY_TIME_DESCENDING){\n\t\t\t\tmodeLocal = SORT_BY_TIME_ASCENDING;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tmodeLocal = SORT_BY_TIME_DESCENDING;\n\t\t\t}\n\t\t\tnew SearchResultsGui(fpListArr, userChoices, isReturn, modeLocal, userParams);\n\t\t\tdispose();\n\t\t}\n\t}", "private void gotoCheckInListView() {\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) \n {\n if (mDrawerToggle.onOptionsItemSelected(item)) \n {\n return true;\n }\n // Handle action buttons\n switch(item.getItemId()) \n {\n case R.id.action_websearch:\n // create intent to perform web search for this planet\n Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);\n intent.putExtra(SearchManager.QUERY, getActionBar().getTitle());\n // catch event that there's no activity to handle intent\n if (intent.resolveActivity(getPackageManager()) != null) \n {\n startActivity(intent);\n } \n else\n {\n Toast.makeText(this, R.string.app_not_available, Toast.LENGTH_LONG).show();\n }\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }" ]
[ "0.67765105", "0.6584482", "0.65479803", "0.6518026", "0.64773947", "0.6438289", "0.6412657", "0.6388065", "0.63738406", "0.63725495", "0.6371411", "0.63591605", "0.6351913", "0.63248473", "0.6294312", "0.6289946", "0.628855", "0.6286381", "0.6282801", "0.6276742", "0.62695444", "0.6267593", "0.62652767", "0.6257029", "0.62169605", "0.6213187", "0.61992234", "0.61805254", "0.61619824", "0.61234736", "0.6109892", "0.61072546", "0.6102796", "0.6092359", "0.6090993", "0.60886157", "0.6083646", "0.60666394", "0.6057849", "0.6045538", "0.6040448", "0.6037709", "0.6034261", "0.6032369", "0.602836", "0.6017239", "0.60139775", "0.60104555", "0.6001927", "0.59998107", "0.59946287", "0.59937674", "0.59912056", "0.59912056", "0.59912056", "0.59856963", "0.59710944", "0.59654844", "0.59628904", "0.59575063", "0.59524196", "0.5949962", "0.5943551", "0.59390515", "0.5936492", "0.5935853", "0.5934048", "0.5929556", "0.5927188", "0.5922841", "0.59203345", "0.59183186", "0.59167403", "0.5911259", "0.59103054", "0.59063196", "0.5903562", "0.58997303", "0.5897899", "0.58969045", "0.589268", "0.58878064", "0.5875655", "0.5874755", "0.5874305", "0.5873786", "0.5870039", "0.5867951", "0.58679265", "0.58649117", "0.58635724", "0.586227", "0.58605236", "0.5860001", "0.5856214", "0.5853502", "0.58405656", "0.5838582", "0.583829", "0.5834765", "0.5828361" ]
0.0
-1
listen for value changing / method launches when data changes
@Override public void onDataChange(DataSnapshot dataSnapshot) { ArrayList<User> users = new ArrayList<User>(); for (DataSnapshot postSnapshot : dataSnapshot.getChildren()) { User user = postSnapshot.getValue(User.class); user.setId(postSnapshot.getKey()); if(!user.getId().equalsIgnoreCase(mAuth.getCurrentUser().getUid())){ users.add(user); adapter.addFriend(user , true); adapter.notifyDataSetChanged(); } // if user id matches in firebase } // loop through children of data snapshot }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void onDataChanged();", "public void onDataChanged(){}", "public void onDataChanged();", "void valueChanged(CalcModel model);", "void valueChanged(CalcModel model);", "@Override\n\tpublic void valueChange(ValueChangeEvent event) {\n\t\t\n\t}", "void valueChanged(T oldValue, T newValue);", "public void dataChanged() {\n\t\tif (wijzigInfo)\n\t\t\twijzigInfo();\n\n\t\tsetChanged();\n\t\tnotifyObservers(\"dataChanged\");\n\t}", "@Override\r\n\tpublic void valuesChanged() {\r\n\t}", "@Override\n public void onDataChanged() {\n }", "@Override\n public void onDataChanged() {\n }", "@Override\n public void onDataChanged() {\n\n }", "public void valueChanged(IntegerStorageChange change);", "public void observe(int val) {\n observe(val, 1);\n }", "@Override\n protected void onDataChanged() {\n }", "public void dataChanged(DataChangeEvent e) {\n\t\t\t}", "void onChangeEvent(CarPropertyValue value);", "public void valueChanged(ConfigurationIdentifier configurationIdentifier, Serializable value);", "public void allActualValuesUpdated ();", "private void fireValueChange(boolean b) {\n \t\n\t\t\n\t}", "public void changed(ObservableValue ov, Number value, Number new_value)\n\t {\n\n\t String dsConexao = optionsConexao.get(new_value.intValue());\n\t conexao = dao.consultar(dsConexao);\n\t carregarEmpresas(consultas.listar(conexao));\n\t carregarConfigSuprii(conexao);\n\t }", "public interface CalcValueListener {\n\n\t/**\n\t * Method notifies the implementing class that a value has changed.\n\t * \n\t * @param model\n\t * implementation of the CalcModel\n\t */\n\tvoid valueChanged(CalcModel model);\n}", "public void dataUpdateEvent();", "public void valueChanged(IntegerStorageChange istoragech);", "public void onDataChanged(IData data) {\r\n setData(data);\r\n }", "private void updateAndAlertListener() {\n\n\t\teditText.setText(getRoundedValue(value));\n\n\t\tif (changeListener != null) {\n\t\t\tchangeListener.onValueChange(this, value);\n\t\t}\n\t}", "public void onValueChange(final ChangeListener listener) {\n\t\tchangeListener = listener;\n\t\treturn;\n\t}", "protected void valueChanged() {\r\n \t\tint newValue = slider.getSelection();\r\n \t\tint oldValue = this.intValue;\r\n \t\tintValue = newValue;\r\n \t\tjava.beans.PropertyChangeEvent event = new java.beans.PropertyChangeEvent(\r\n \t\t\t\tthis, IPropertyEditor.VALUE, oldValue, newValue);\r\n \t\tvalueChangeListener.valueChange(event);\r\n \t}", "public interface OnValueChangeListener {\n void onChanged(String fieldName, Object oldValue, Object newValue);\n}", "private void change() {\n\t\tsetChanged();\n\t\t//NotifyObservers calls on the update-method in the GUI\n\t\tnotifyObservers();\n\t}", "public void dataChanged() {\n // get latest data\n runs = getLatestRuns();\n wickets = getLatestWickets();\n overs = getLatestOvers();\n\n currentScoreDisplay.update(runs, wickets, overs);\n averageScoreDisplay.update(runs, wickets, overs);\n }", "public void valueChanged(IntegerStorage istorage);", "public void onDataChanged(IData data) {\r\n\t this.data = data;\r\n\t repaint();\r\n\t}", "@Override\n\tpublic void onDataChanged()\n\t{\n\t\tfor (DataChangedCallbacks listener : this.dataChangedListeners)\n\t\t{\n\t\t\tlistener.onDataChanged();\n\t\t}\n\t}", "public void gxlValueChanged(GXLValueModificationEvent e) {\n\t}", "@Override\n public void onChange() {\n java.lang.String callbackArg_0 = android.databinding.adapters.TextViewBindingAdapter.getTextString(mboundView5);\n // localize variables for thread safety\n // viewModel.obServiceVipPrice != null\n boolean viewModelObServiceVipPriceJavaLangObjectNull = false;\n // viewModel.obServiceVipPrice\n android.databinding.ObservableField<java.lang.String> viewModelObServiceVipPrice = null;\n // viewModel.obServiceVipPrice.get()\n java.lang.String viewModelObServiceVipPriceGet = null;\n // viewModel\n ys.app.pad.viewmodel.ModifyServiceDetailViewModel viewModel = mViewModel;\n // viewModel != null\n boolean viewModelJavaLangObjectNull = false;\n\n\n\n viewModelJavaLangObjectNull = (viewModel) != (null);\n if (viewModelJavaLangObjectNull) {\n\n\n viewModelObServiceVipPrice = viewModel.obServiceVipPrice;\n\n viewModelObServiceVipPriceJavaLangObjectNull = (viewModelObServiceVipPrice) != (null);\n if (viewModelObServiceVipPriceJavaLangObjectNull) {\n\n\n\n\n viewModelObServiceVipPrice.set(((java.lang.String) (callbackArg_0)));\n }\n }\n }", "public void dropDown1_processValueChange(ValueChangeEvent event) {\n \n }", "@Override\n public void onChanged() {\n }", "public interface OnValueSelectedListener {\n public void start();\n\n public void data(long open, long close, long high, long low);\n\n public void end();\n}", "void addCalcValueListener(CalcValueListener l);", "protected void onDataChanged(V item) {\n\n }", "@Override\n public void addChangeListener(ChangeListener l) {}", "@Override\n\tpublic boolean valueChanged() {\n\t\treturn false;\n\t}", "@Override\n\t\tpublic void onChange(boolean selfChange) {\n\t\t\tmHandler.sendEmptyMessage(1);\n\t\t\tLog.i(\"message\", \"dataChange\");\n\t\t\tsuper.onChange(selfChange);\n\t\t}", "@Override\n\t\tpublic void monitorChanged(MonitorEvent arg0) {\n\t\t\tDBR dbr = arg0.getDBR();\n\t\t\tif (dbr.isDOUBLE()) {\n\t\t\t\t// update the latest value\n\t\t\t\tdouble lastValue = latestValue;\n\t\t\t\tlatestValue = ((DBR_Double) dbr).getDoubleValue()[0];\n\n\t\t\t\t// if the percentage change has been great enough, then inform\n\t\t\t\t// IObservers\n\t\t\t\tif (Math.abs((lastValue - latestValue) / lastValue) * 100.0 >= sensitivity) {\n\t\t\t\t\tnotifyIObservers(this, latestValue);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public void listen(int UPDATE_VALUE){\n \tif(this.filterType.filter(UPDATE_VALUE)) {\n \t\tthis.setBNumber(this.getBNumber() + UPDATE_VALUE);\n \t}\n }", "public interface ChangeListener {\n\t\tpublic void onValueChange(FloatPicker fpw, float value);\n\t}", "public void setChangeListener();", "@Override\n public void onValueAccessed(int value) {\n }", "public interface OnSensorValueChangeListener {\n public void onSensorValueChanged(int newVal);\n}", "public void fireChange() {\n fireChange(new ChangeEvent(source));\n }", "public void valueChanged(ListSelectionEvent e)\n\t\t\t{\n\t\t\t}", "public void valueChanged(ListSelectionEvent arg0) {\n\t\t\r\n\t}", "protected void fireValueChangedEvent(ValueChangedEvent event) {\n\t\tif (listeners != null) {\n\t\t\tfor (int i = 0; i < listeners.length; i++) { \n\t\t\t\tlisteners[i].valueChanged(event);\n\t\t\t}\n\t\t}\n\t}", "public void valueChanged(TreeSelectionEvent e) {\n\t}", "@Override\n public void onChange() {\n java.lang.String callbackArg_0 = android.databinding.adapters.TextViewBindingAdapter.getTextString(mboundView4);\n // localize variables for thread safety\n // viewModel.obRealAmt\n android.databinding.ObservableField<java.lang.String> viewModelObRealAmt = null;\n // viewModel.obRealAmt != null\n boolean viewModelObRealAmtJavaLangObjectNull = false;\n // viewModel\n ys.app.pad.viewmodel.ModifyServiceDetailViewModel viewModel = mViewModel;\n // viewModel != null\n boolean viewModelJavaLangObjectNull = false;\n // viewModel.obRealAmt.get()\n java.lang.String viewModelObRealAmtGet = null;\n\n\n\n viewModelJavaLangObjectNull = (viewModel) != (null);\n if (viewModelJavaLangObjectNull) {\n\n\n viewModelObRealAmt = viewModel.obRealAmt;\n\n viewModelObRealAmtJavaLangObjectNull = (viewModelObRealAmt) != (null);\n if (viewModelObRealAmtJavaLangObjectNull) {\n\n\n\n\n viewModelObRealAmt.set(((java.lang.String) (callbackArg_0)));\n }\n }\n }", "public interface ValueChangeListener {\n public void onValueChange(CustomComponent view, String value);\n}", "protected boolean isDataChanged() {\n\n\t\treturn true;\n\t}", "@Override\n\tpublic void addValueChangeListener(final ValueChangeListener<T> listener) {\n\t\t\n\t}", "public interface IntegerStorageObserver {\r\n\t\r\n\t/**\r\n\t * The method called every time the subject's\r\n\t * value is being changed.\r\n\t *\r\n\t * @param change the reference that holds all the changes that were made\r\n\t */\r\n\tpublic void valueChanged(IntegerStorageChange change);\r\n}", "protected void fireChangeEvent() {\n\t\tfireEvent(new DebugEvent(this, DebugEvent.CHANGE));\n\t}", "public void notifyChange()\r\n {\r\n setChanged();\r\n notifyObservers();\r\n }", "@Override\n\tpublic abstract void valueChanged(ListSelectionEvent arg0);", "public void valueChanged(ListSelectionEvent e) {\n\t\t\n\t}", "@DISPID(-2147412072)\n @PropGet\n java.lang.Object ondatasetchanged();", "void onPropertyChange(String name, String newValue);", "@Override\n public void setValue(Object val) {\n synchronized (this) {\n attachDataListener();\n }\n try {\n dataModel.setValue(val);\n } catch (DataInputException ex) {\n onInputError(val, ex);\n }\n }", "private static void usePropertyChangeListener() {\n SimpleStringProperty stringProperty = new SimpleStringProperty(\"xyz\");\n // Prints property's value\n System.out.println(stringProperty.getValue());\n // Adds a listener - action that will be run if property's value changes.\n stringProperty.addListener((observable, oldValue, newValue) -> {\n System.out.println(\"New value is set: \" + newValue);\n });\n // Sets new value\n stringProperty.setValue(\"Some new value\");\n }", "public void dataWasSet();", "public interface OnModelDataChangeListener {\n public void onChange();\n}", "void onChange( T newValue );", "public void changed(ObservableValue ov, Number value, Number new_value)\n {\n\n String dsMultiEmpresa = optionsEmpresa.get(new_value.intValue());\n String[] cdMultiEmpresa = dsMultiEmpresa.split(\"-\");\n carregarEstoques(consultas.listarEstoques(conexao,cdMultiEmpresa[0]));\n }", "public void updateData() {}", "public void isChanged()\n\t{\n\t\tchange = true;\n\t}", "@Override\n public void update(Observable observable, Object data) {\n Toast.makeText(this, \"I am notified\" + myBase.getObserver().getValue(), 0).show();\n btn.setText(\"value: \" + myBase.getObserver().getValue());\n\n }", "public void onUpdate(T oldValue, T newValue);", "@Override\n\t\t\t\t\tpublic void changed(ObservableValue arg0, Object arg1,\n\t\t\t\t\t\t\tObject arg2) {\n\t\t\t\t\t\tif (arg2.toString() == \"报溢单\") {// 报溢单\n\t\t\t\t\t\t\tOverflow de = new Overflow();\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tde.display(Job, name, id);\n\t\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\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} else if (arg2.toString() == \"报损单\") {// 报损单\n\t\t\t\t\t\t\tloss l = new loss();\n\t\t\t\t\t\t\tl.display(Job, name, id);\n\t\t\t\t\t\t} else if (arg2.toString() == \"报警单\") {// 报警单\n\t\t\t\t\t\t\tAlarm a = new Alarm();\n\t\t\t\t\t\t\ta.display(Job, name, id);\n\t\t\t\t\t\t} else if (arg2.toString() == \"赠送单\") {// 赠送单\n\t\t\t\t\t\t\tGift g = new Gift();\n\t\t\t\t\t\t\tg.display(Job, name, id);\n\t\t\t\t\t\t} else if (arg2.toString() == \"草稿箱\") {// 草稿箱\n\t\t\t\t\t\t\tdrafts d = new drafts();\n\t\t\t\t\t\t\td.display(Job, name, id);\n\t\t\t\t\t\t} else if (arg2.toString() == \"查看单据\") {// 查看单据\n\t\t\t\t\t\t\tGetReceipt g = new GetReceipt();\n\t\t\t\t\t\t\tg.display(Job, name, id);\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "void stockPriceChanged(Stock stock, double oldValue, double newValue);", "@Override\n public void addChangeListener(ChangeListener l) {\n }", "@Override\n public void addChangeListener(ChangeListener l) {\n }", "@Override\n public void actionPerformed (ActionEvent e) {\n fireChanged();\n }", "public void notifyState() {\n\t\tList<T> alldata = new ArrayList<T>(this.dataMap.values());\t\r\n\t\t// call them with the current data\r\n\t\t// for each observer call them\r\n\t\tfor( ModelEvents<T> observer : this.ObserverList){\r\n\t\t\tobserver.dataState(alldata);\r\n\t\t}\r\n\r\n\t}", "public void valueChanged(ListSelectionEvent e){\n\t\tif(e.getValueIsAdjusting()) return;\n\t\t\n\t\t//\tget selected DataObjects\n\t\tclear();\n\t\taddAll(list != null ? JBNDUtil.castArray(list.getSelectedValues(), DataObject.class) : \n\t\t\tJBNDSwingUtil.selectedRecords(table));\n\t}", "private void fireStructureChanged() {\n\n tableModel.fireTableStructureChanged();\n paramsTable.getColumnModel().getColumn(COL_SAMPLING).setCellEditor(\n new SamplingEditor());\n }", "void instanceChanged();", "void eventChanged();", "public void valueChanged(ListSelectionEvent e) {\r\n\t\tObject source = e.getSource();\r\n\t\tif (source == this.gragraNames) {\r\n\t\t\tswitch (this.stepPanel.getStep()) {\r\n\t\t\tcase StepPanel.STEP_HOST_GRAPH:\r\n\t\t\t\tsetGraph(StepPanel.STEP_HOST_GRAPH);\r\n\t\t\t\tbreak;\r\n\t\t\tcase StepPanel.STEP_STOP_GRAPH:\r\n\t\t\t\tsetGraph(StepPanel.STEP_STOP_GRAPH);\r\n\t\t\t\tbreak;\r\n\t\t\tcase StepPanel.STEP_CRITICAL_PAIRS:\r\n\t\t\t\tsetPairs();\r\n\t\t\t\tbreak;\r\n\t\t\tcase StepPanel.STEP_FINISH:\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void addChangeListeners() {\n\t\troom.textProperty().addListener((observable, oldValue, newValue) -> {\n\t\t\tif (!hotel.getText().isEmpty() && !quality.getText().isEmpty()) {\n\t\t\t\tcalculatePrice();\n\t\t\t}\n\t\t});\n\t\thotel.textProperty().addListener((observable, oldValue, newValue) -> {\n\t\t\tif (!hotel.getText().isEmpty() && !quality.getText().isEmpty()) {\n\t\t\t\tcalculatePrice();\n\t\t\t}\n\t\t});\n\t\tquality.textProperty().addListener((observable, oldValue, newValue) -> {\n\t\t\tif (!hotel.getText().isEmpty() && !quality.getText().isEmpty()) {\n\t\t\t\tcalculatePrice();\n\t\t\t}\n\t\t});\n\t}", "@DISPID(-2147412072)\n @PropPut\n void ondatasetchanged(\n java.lang.Object rhs);", "@Override\n public void valueChanged(final ListSelectionEvent e) {\n if (e.getValueIsAdjusting()) {\n return;\n }\n showObject();\n }", "public void changed(ObservableValue ov, Number value, Number new_value)\n {\n\n String dsEstoque = optionsEstoques.get(new_value.intValue());\n String[] campoEstoque = dsEstoque.split(\"-\");\n estoque = new Estoque();\n estoque.setCdEstoque(campoEstoque[0]);\n estoque.setDsEstoque(campoEstoque[1]);\n }", "void onVariableChanged(Object... newValue);", "public void onStockpriceChanged();", "public void onDataChanged(IData data) {\r\n\tthis.canvas.onDataChanged(data);\r\n }", "public void notifyAlgoUpdateCurrentValue() {\n this.mHwGradualBrightnessAlgo.updateTargetAndRate(this.mTargetValue, this.mRate);\n this.mHwGradualBrightnessAlgo.updateCurrentBrightnessValue((float) this.mCurrentValue);\n }", "@Override\r\n public void valueChanged(TreeSelectionEvent e) {\n }", "public void onValueChange(ValueChangeEvent event) {\n rating.setReadOnly(true);\n getMessagePanel().clear();\n saveVote(voteForId);\n }", "@Override\r\n\t\tpublic void valueChanged(ListSelectionEvent e) {\r\n\t\t\t\r\n\t\t}", "public void willbeUpdated() {\n\t\t\n\t}", "interface DataListener\n{\n\tpublic void DataChanged(MDSplus.Data data);\n}", "@Override\n public void cellChanged(String newCellValue) {\n\t \n }" ]
[ "0.74673027", "0.7459996", "0.74246395", "0.733503", "0.733503", "0.72071445", "0.70482266", "0.70075184", "0.6986905", "0.6929627", "0.6929627", "0.6904236", "0.69030344", "0.6764711", "0.676122", "0.67387515", "0.67212784", "0.66950107", "0.6682322", "0.66163427", "0.6600623", "0.65904427", "0.6584575", "0.65791357", "0.65737224", "0.6559424", "0.6546798", "0.65467495", "0.6530114", "0.64822006", "0.6472295", "0.6445798", "0.6434165", "0.6431901", "0.6424765", "0.63679457", "0.63647074", "0.6335302", "0.6312613", "0.62987286", "0.6288416", "0.62837577", "0.62832314", "0.62642455", "0.62602144", "0.6259558", "0.62587893", "0.6254451", "0.62407804", "0.62302613", "0.622462", "0.6221585", "0.6218783", "0.6216252", "0.6210792", "0.6208668", "0.62075055", "0.6205074", "0.6199879", "0.61831677", "0.61830795", "0.61725223", "0.6165464", "0.61603546", "0.6138942", "0.61276776", "0.6123885", "0.61234695", "0.61174244", "0.6113417", "0.6104534", "0.60866916", "0.6048273", "0.60350317", "0.6025275", "0.60156775", "0.6015016", "0.6010531", "0.5998738", "0.5998738", "0.59980834", "0.59951997", "0.59950906", "0.59928715", "0.5990358", "0.5977125", "0.5974851", "0.5967627", "0.59633857", "0.59629333", "0.595901", "0.5957023", "0.5955688", "0.5934876", "0.5926027", "0.59200865", "0.5919262", "0.5913991", "0.5912293", "0.59087425", "0.5902685" ]
0.0
-1
/ method lauches when event cancelled
@Override public void onCancelled(DatabaseError error) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void eventCancelled() {\n\t\tstatus=EventCancelled;\n\t}", "protected abstract void onCancel();", "void onCancel();", "public void onCancel();", "public void onCancelled();", "@Override\n public void cancel() {\n }", "@Override\n\t\t\t\t\t\t\t\t\tpublic void cancel() {\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}", "private void onCancel() {\n System.exit(0);\r\n dispose();\r\n }", "public void cancel(){\n cancelled = true;\n }", "@Override\n public void cancel() {\n\n }", "void onCancelled();", "private void onCancel()\n\t{\n\t\tdispose();\n\t}", "@Override\n public void cancel() {\n\n }", "@Override\n public void cancel() {\n\n }", "@Override\n public void cancel() {\n\n }", "private void onCancel() {\n cancelDisposalProcess();\n }", "private void onCancel() {\n\t\tdispose();\n\t}", "@Override\r\n\tpublic void cancel() {\n\t\t\r\n\t}", "public void onCancel() {\n\t\t\t\t\t}", "@Override\n public void cancel() {\n }", "@Override\n public void cancel() {\n\n }", "@Override\n\tpublic void cancel() {\n\t\t\n\t}", "@Override\n\tpublic void canceled() {\n\t\t\n\t}", "@Override\n\tpublic void canceled() {\n\t\t\n\t}", "@Override\n\t\t\t\t\t\tpublic void cancel() {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}", "public void onCancel() {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}", "@Override\n\t\tpublic void cancel() {\n\t\t\t\n\t\t}", "public void cancel() {\n\t\tcancelled = true;\n\t}", "@Override\r\n\tprotected void onCancelled() {\n\t\tsuper.onCancelled();\r\n\t}", "protected void onPdCancel(){\r\r\t}", "private void onCancel()\r\n {\n dispose();\r\n }", "public void onCancelled() {\n this.cancelled = true;\n }", "private void onCancel() {\n dispose();\r\n }", "@Override\n\tprotected void onCancelled()\n\t{\n\t\tsuper.onCancelled();\n\t}", "public synchronized void cancel() {\n }", "@Override\n public void onCancel() {\n }", "private void onCancel() {\n data.put(\"cerrado\",true);\n dispose();\n }", "@Override\r\n\t\t\t\t\tpublic void onCancel() {\n\t\t\t\t\t\t\r\n\t\t\t\t\t}", "public void cancel();", "public void cancel();", "public void cancel();", "public void cancel();", "public void cancel();", "public void cancel();", "@Override\n\t\tprotected void onCancelled() {\n\t\t\tsuper.onCancelled();\n\t\t\t\n\t\t}", "@Override\r\n\t\tpublic void onCancel() {\n\t\t}", "public void cancel() {\r\n\t\tthis.cancel = true;\r\n\t}", "@Override\n\tpublic void cancel() {\n\n\t}", "@Override\n\tpublic void cancel() {\n\n\t}", "@Override\n\tpublic void cancel() {\n\n\t}", "public void cancel()\n\t{\n\t}", "void onCanceled();", "public void cancel() {\n\t}", "void cancel();", "void cancel();", "void cancel();", "void cancel();", "void cancel();", "private void onCancel() {\n dispose();\n }", "private void onCancel() {\n dispose();\n }", "private void onCancel() {\n dispose();\n }", "private void onCancel() {\n dispose();\n }", "private void onCancel() {\n dispose();\n }", "private void onCancel() {\n dispose();\n }", "private void onCancel() {\n dispose();\n }", "private void onCancel() {\n dispose();\n }", "private void onCancel() {\n dispose();\n }", "private void onCancel() {\n dispose();\n }", "private void onCancel() {\n dispose();\n }", "private void onCancel() {\n dispose();\n }", "private void onCancel() {\n dispose();\n }", "private void onCancel() {\n dispose();\n }", "private void onCancel() {\n dispose();\n }", "public void onCancelled() {\n }", "public void onCancelled() {\n }", "@Override\n protected void onCancel() {\n }", "@Override\n\t\tpublic void onCancel() {\n \n \t}", "@Override\n\t\t\tpublic void onCancel() {\n\t\t\t\t\n\t\t\t}", "@Override\n public void onCancel() {\n }", "@Override\n\t\t\tpublic void onCancelled() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void onCancelled() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\tprotected void onCancelled() {\n\t\t\tsuper.onCancelled();\n\t\t}", "@Override\n\t\tprotected void onCancelled() {\n\t\t\tsuper.onCancelled();\n\t\t}", "@Override\n\t\tprotected void onCancelled() {\n\t\t\tsuper.onCancelled();\n\t\t}", "@Override\n public void onCancel() {\n\n }", "@Override\n public void onCancel() {\n\n }", "protected abstract void handleCancel();", "public void onCancel() {\n }", "public void cancel();", "public void cancel() {\n btCancel().push();\n }", "@Override\n public void onCancel() {\n\n }", "@Override\n public void onCancel() {\n\n }", "public abstract boolean cancel();", "void onCancel(int key);", "public boolean cancel();", "public void cancel() {\n\t\tcancel(false);\n\t}", "@Override\n public boolean isCancelled() {\n return false;\n }", "@Override\n public void onCancel() {\n\n }", "public void cancel()\n\t{\n\t\t_buttonHit = true;\n\t}", "public void onCancel() {\n\n }", "public void cancel() {\n\t\tinterrupt();\n\t}" ]
[ "0.79746974", "0.78611505", "0.7755085", "0.7711213", "0.76130253", "0.7602512", "0.75833213", "0.7568093", "0.7556781", "0.7552049", "0.75356436", "0.75333756", "0.7523885", "0.7523885", "0.7523885", "0.7523128", "0.7522515", "0.752079", "0.75010455", "0.7499075", "0.74808383", "0.7470763", "0.74669725", "0.74669725", "0.74649644", "0.74458224", "0.7441828", "0.7422194", "0.7409202", "0.740341", "0.73984045", "0.73884046", "0.7387324", "0.7386058", "0.7381345", "0.73734677", "0.7371346", "0.736621", "0.73662025", "0.73662025", "0.73662025", "0.73662025", "0.73662025", "0.73662025", "0.73654044", "0.73520035", "0.7346722", "0.7346066", "0.7346066", "0.7346066", "0.73426783", "0.7339413", "0.73272413", "0.7324262", "0.7324262", "0.7324262", "0.7324262", "0.7324262", "0.73235524", "0.73235524", "0.73235524", "0.73235524", "0.73235524", "0.73235524", "0.73235524", "0.73235524", "0.73235524", "0.73235524", "0.73235524", "0.73235524", "0.73235524", "0.73235524", "0.73235524", "0.731147", "0.731147", "0.7302902", "0.7301702", "0.72882086", "0.7283647", "0.72811556", "0.72811556", "0.72768855", "0.72768855", "0.72768855", "0.7227012", "0.7227012", "0.7226028", "0.7223038", "0.71821696", "0.717812", "0.7176288", "0.7175673", "0.7169014", "0.7154937", "0.71340704", "0.7114598", "0.71048945", "0.70693433", "0.70639575", "0.70496875", "0.70322156" ]
0.0
-1
Method finds Sort dropdown, expands it and clicks item identified by value passed in as parameter
public void selectSortOrder(String optionValue) { System.out.println("Method 'selectSortOrder' running"); wait = new WebDriverWait(driver,5); sortMenu = driver.findElement(By.xpath(sortMenuXpath)); sortMenu.click(); wait.until(ExpectedConditions.visibilityOfElementLocated(By.id(optionValue))); sortListItem = driver.findElement(By.id(optionValue)); sortListItem.click(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void ClickonSortByFilter(String Text){\r\n\t\tString Data = getValue(Text); \r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Sort By dropdown should be clicked\");\r\n\t\ttry{ \r\n\t\t\tclickSpecificElementContains(locator_split(\"lnkSortBy\"), Data); \r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Sort By dropdown is clicked\");\r\n\t\t\t//System.out.println(\"Search catogory\"+Data);\r\n\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Sort By dropdown is not clicked or Not Available\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"lnkSortBy\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\r\n\t}", "public synchronized void clkSortByDropdown() {\n\t\ttry {\n\t\t\tWebActionUtil.waitForElement(btnSortBy, \"Sort By\", 30);\n\t\t\tWebActionUtil.clickOnWebElement(btnSortBy, \"sort by\", \"Unable to click sort by drop down \");\n\t\t}\n\t\t catch (Exception e) \n\t\t{\n\t\t\t WebActionUtil.error(e.getMessage());\n\t\t\tWebActionUtil.error(\"Unable to click sort by\");\n\t\t\tAssert.fail(\"Unable to click sort by\");\n\t\t}\n\t}", "@When(\"^Sort By dropdown box appeared and selected option$\")\n\tpublic void sort_By_dropdown_box_appeared_and_selected_option() throws Throwable {\n\t\tSelect product = new Select(driver.findElement(By.xpath(\"//*[@id=\\\"selectProductSort\\\"]\")));\n\t\tproduct.selectByVisibleText(\"Product Name: A to Z\");\n\t}", "public SortContentDialog clickOnTabMenu()\n {\n sortMenuButton.click();\n sleep( 500 );\n return this;\n }", "@Override\n\t\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\t\tupdateSortingProperty(property);\n\t\t\t\t}", "public static WebElement drpdwn_selectSortFilterList(String selectVal) throws Exception{\r\n \ttry{\r\n \t\tWebElement dropdown = driver.findElement(By.name(\"SortFiltList\")); \r\n \t\tList<WebElement> allOptions = dropdown.findElements(By.tagName(\"option\")); \r\n \t\tfor(WebElement option : allOptions){ \r\n \r\n \t\t\tif(option.getText().equals(selectVal)){ \r\n \t\t\t\toption.click(); \r\n \t\t\t} \r\n \t\t}\r\n \t}catch(Exception e){\r\n \t\tthrow(e);\r\n \t}\r\n \treturn element;\r\n }", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tif(\"balance\".equals(e.getActionCommand())){\n\t\t\tsortType = 1;\n\t\t}else if(\"sold\".equals(e.getActionCommand())){\n\t\t\tsortType = 2;\n\t\t}else if(\"spoiled\".equals(e.getActionCommand())){\n\t\t\tsortType = 3;\n\t\t}\n\t\trefresh();\n\t}", "@Override\r\n\tpublic void editSort() {\n\t\t\r\n\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\topenSortDialog(SessionListActivity.this);\n\t\t\t}", "public void clickOnGroupNameDropdownButton() {\r\n\t\tsafeClick(vehicleLinkPath.replace(\"ant-card-head-title\", \"ant-select ant-select-enabled\"), MEDIUMWAIT);\r\n\t}", "public SortPanel() {\n\t\t\t fs = new Font [3];\n\t\t\t fs[0] = new Font(\"Lato\", Font.BOLD, 36);\n\t\t\t fs[1] = new Font(\"Open Sans\", 0 , 20);\n\t\t\t fs[2] = new Font(\"Open Sans\", 0 , 12);\n\t\t\t enterCondB = new JButton(\"Sort Cities\");\n\t\t\t enterCityB = new JButton(\"Sort Conditions\");\n\t\t\t backB = new JButton(\"Return\");\n\t\t\t menuL = new JLabel (\"Sort Feature\");\n\t\t\t String [] cond = new String [8];\n\t\t\t dropDownCond = new JComboBox<String> (mainGui.getCond());\n\t\t\t dropDownCity = new JComboBox<String> (mainGui.getCities());\n\t\t\t tA = new JTextArea ();\n\t\t\t enterCondB.setFont(fs[1]);\n\t\t\t enterCityB.setFont(fs[1]);\n\t\t\t backB.setFont(fs[2]);\n\t\t\t menuL.setFont(fs[0]);\n\t\t\t dropDownCond.setPreferredSize(new Dimension( 200, 24 ));\n\t\t\t dropDownCity.setPreferredSize(new Dimension( 200, 24 ));\n\t\t\t tA.setEditable(false);\n\t\t\t \n\t\t\t // loads UI elements in view\n\t\t\t add(menuL, BorderLayout.PAGE_START);\n\t\t\t add(dropDownCond, BorderLayout.LINE_START);\n\t\t\t add(enterCondB, BorderLayout.CENTER);\n\t\t\t add(dropDownCity, BorderLayout.LINE_START);\n\t\t\t add(enterCityB, BorderLayout.CENTER);\t \n\t\t\t add(tA, BorderLayout.LINE_END);\n\t\t\t add(backB, BorderLayout.PAGE_END);\n\t\t\t //listens to sort by cond button to be pressed\n\t\t\t enterCondB.addActionListener( new ActionListener()\n\t\t\t {\n\t\t\t @Override\n\t\t\t public void actionPerformed(ActionEvent e)\n\t\t\t {\n\t\t\t \t City[] c = mainGui.cities;\n\t\t\t \t int n = dropDownCond.getSelectedIndex();\n\t\t\t \t Heapsort.sortHeap(c, c.length, n);\n\t\t\t \t for(int i = 0; i < c.length / 2; i++)\n\t\t\t \t {\n\t\t\t \t City temp = c[i];\n\t\t\t \t c[i] = c[c.length - i - 1];\n\t\t\t \t c[c.length - i - 1] = temp;\n\t\t\t \t }\n\t\t\t \t tA.setText(\"Cities sorted by occurence of \"+dropDownCond.getSelectedItem().toString()+\":\");\n\t\t\t \t for (int i = 0; i < c.length; i++)\n\t\t\t \t\t tA.append(\"\\n\"+c[i].getCity()+ \", \"+c[i].getCond(n));\n\t\t\t }\n\t\t\t });\n\t\t\t //listens to sort by city button to be pressed\n\t\t\t enterCityB.addActionListener( new ActionListener()\n\t\t\t {\n\t\t\t @Override\n\t\t\t public void actionPerformed(ActionEvent e)\n\t\t\t {\n\t\t\t \t String [] s = mainGui.getCond();\n\t\t\t \t int [] cond = mainGui.cities[dropDownCity.getSelectedIndex()].getCond();\n\t\t\t \t\t System.out.println(s.length+\", \"+cond.length);\n\t\t\t \t Heapsort2.sortHeap(s, cond, cond.length);\n\t\t\t \t for(int i = 0; i < s.length / 2; i++)\n\t\t\t \t {\n\t\t\t \t String temp = s[i];\n\t\t\t \t s[i] = s[s.length - i - 1];\n\t\t\t \t s[s.length - i - 1] = temp;\n\t\t\t \t int t = cond[i];\n\t\t\t \t cond[i] = cond[cond.length - i - 1];\n\t\t\t \t cond[cond.length - i - 1] = t;\n\t\t\t \t }\n\t\t\t \t tA.setText(\"Conditions sorted by occurence in \"+dropDownCity.getSelectedItem().toString()+\":\");\n\t\t\t \t for (int i = 0; i < s.length; i++)\n\t\t\t \t\t tA.append(\"\\n\"+s[i]+ \", \" +cond[i]);\n\t\t\t }\n\t\t\t });\n\t\t\t //listens to back button to be pressed\n\t\t\t backB.addActionListener( new ActionListener()\n\t\t\t {\n\t\t\t @Override\n\t\t\t public void actionPerformed(ActionEvent e)\n\t\t\t {\n\t\t\t //System.out.println(\"backB clicked\");\n\t\t\t mainGui.paneSwitch(0);\n\t\t\t }\n\t\t\t });\n\t\t }", "public void changeSortOrder();", "@FXML\n private void updateNameOrder(ActionEvent event) {\n\n if (sortOrder == Order.NAME_ASC) {\n\n sortOrder = Order.NAME_DESC;\n\n } else if (sortOrder == Order.NAME_DESC) {\n\n sortOrder = Order.DEFAULT;\n\n } else {\n\n sortOrder = Order.NAME_ASC;\n\n }\n\n updateOrderButtons();\n\n }", "@Override\r\n\t\tpublic void onClick(View view) {\n\t\t\tswitch (view.getId()) {\r\n\t\t\tcase R.id.rl_sort_price:\r\n\t\t\t\tif (sortPosition != 0) {\r\n//\t\t\t\t\tsetDisable();\r\n\t\t\t\t\tint[] location = new int[2];\r\n\t\t\t\t\tsortSelected.getLocationOnScreen(location);\r\n//\t\t\t\t\tscrollLayout.startSrcoll(-location[0], 0, (sortPosition)*space, 0);\r\n\t\t\t\t\ttvs[0].setTextColor(getContext().getResources().getColor(TV_SELECTED_COLOR));\r\n\t\t\t\t\ttvs[sortPosition].setTextColor(getContext().getResources().getColor(TV_NONE_COLOR));\r\n\t\t\t\t\tsortPosition = 0;\r\n\t\t\t\t}\r\n\t\t\t\tif (pricePosition == 0 || pricePosition == 1) {\r\n\t\t\t\t\tpriceSelected.setImageResource(IV_PRICE_UP);\r\n\t\t\t\t\tpricePosition = 2;\r\n\t\t\t\t\tsortSelectedListener.SortByPriceUp();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tpriceSelected.setImageResource(IV_PRICE_DOWN);\r\n\t\t\t\t\tpricePosition = 1;\r\n\t\t\t\t\tsortSelectedListener.SortByPriceDown();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tbreak;\r\n\t\t\tcase R.id.rl_sort_sales:\r\n\t\t\t\tif (sortPosition != 1) {\r\n//\t\t\t\t\tsetDisable();\r\n\t\t\t\t\tint[] location = new int[2];\r\n\t\t\t\t\tsortSelected.getLocationOnScreen(location);\r\n//\t\t\t\t\tscrollLayout.startSrcoll(-location[0], 0, (sortPosition - 1)*space, 0);\r\n\t\t\t\t\ttvs[1].setTextColor(getContext().getResources().getColor(TV_SELECTED_COLOR));\r\n\t\t\t\t\ttvs[sortPosition].setTextColor(getContext().getResources().getColor(TV_NONE_COLOR));\r\n\t\t\t\t\tif (pricePosition != 0) {\r\n\t\t\t\t\t\tpriceSelected.setImageResource(IV_PRICE_NONE);\r\n\t\t\t\t\t\tpricePosition = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tsortPosition = 1;\r\n\t\t\t\t\tsortSelectedListener.SortBySales();\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase R.id.rl_sort_focus:\r\n\t\t\t\tif (sortPosition != 2) {\r\n//\t\t\t\t\tsetDisable();\r\n\t\t\t\t\tint[] location = new int[2];\r\n\t\t\t\t\tsortSelected.getLocationOnScreen(location);\r\n//\t\t\t\t\tscrollLayout.startSrcoll(-location[0], 0, (sortPosition - 2)*space, 0);\r\n\t\t\t\t\ttvs[2].setTextColor(getContext().getResources().getColor(TV_SELECTED_COLOR));\r\n\t\t\t\t\ttvs[sortPosition].setTextColor(getContext().getResources().getColor(TV_NONE_COLOR));\r\n\t\t\t\t\tif (pricePosition != 0) {\r\n\t\t\t\t\t\tpriceSelected.setImageResource(IV_PRICE_NONE);\r\n\t\t\t\t\t\tpricePosition = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tsortPosition = 2;\r\n\t\t\t\t\tsortSelectedListener.SortByFocus();\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase R.id.rl_sort_putime:\r\n//\t\t\t\tif (sortPosition != 3) {\r\n//\t\t\t\t\tsetDisable();\r\n\t\t\t\t\tint[] location = new int[2];\r\n\t\t\t\t\tsortSelected.getLocationOnScreen(location);\r\n//\t\t\t\t\tscrollLayout.startSrcoll(-location[0], 0, (sortPosition - 3)*space, 0);\r\n\t\t\t\t\ttvs[3].setTextColor(getContext().getResources().getColor(TV_SELECTED_COLOR));\r\n\t\t\t\t\tif(sortPosition!=3){\r\n\t\t\t\t\t\ttvs[sortPosition].setTextColor(getContext().getResources().getColor(TV_NONE_COLOR));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (pricePosition != 0) {\r\n\t\t\t\t\t\tpriceSelected.setImageResource(IV_PRICE_NONE);\r\n\t\t\t\t\t\tpricePosition = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tsortPosition = 3;\r\n\t\t\t\t\tsortSelectedListener.SortByPutime();\r\n//\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}", "void sortUI();", "@FXML\n private void updateOrganOrder(ActionEvent event) {\n\n if (sortOrder == Order.ORGAN_ASC) {\n\n sortOrder = Order.ORGAN_DESC;\n\n } else if (sortOrder == Order.ORGAN_DESC) {\n\n sortOrder = Order.DEFAULT;\n\n } else {\n\n sortOrder = Order.ORGAN_ASC;\n\n }\n\n updateOrderButtons();\n\n }", "@Override\n\tpublic void widgetSelected(SelectionEvent event) {\n\t\tif (event.widget instanceof TreeColumn) {\n\t\t\tint columnIndex = this.tree.indexOf((TreeColumn) event.widget);\n\t\t\tthis.sort(columnIndex);\n\t\t}\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\tprivate DynamicForm createSortDropDown() {\r\n\t\tsortForm = new DynamicForm();\r\n\t\t//styling\r\n\t\tsortForm.setNumCols(4); //2 labels + two inputs\r\n\t\tsortForm.setAutoFocus(false);\r\n\t\tsortForm.setWrapItemTitles(false);\r\n\t\tsortForm.setWidth(\"80%\");\r\n\r\n\t\tSelectItem sortItem = new SelectItem(\"sortBy\", \"Sort By\");\r\n\r\n\t\tLinkedHashMap valueMap = new LinkedHashMap();\r\n\t\tvalueMap.put(\"name\", \"Name\");\r\n\t\tvalueMap.put(\"company\", \"Company\");\r\n\t\tvalueMap.put(\"averageRating\", \"Avg Rating\");\r\n\t\tvalueMap.put(\"ownerNickName\", \"Owner\");\r\n\t\tvalueMap.put(\"lastUpdated\", \"Last Updated\");\r\n\r\n\t\tsortItem.setValueMap(valueMap);\r\n\t\tsortItem.setValue(\"lastUpdated\"); //default TODO make sure it sort this way to start!\r\n\r\n\t\tfinal CheckboxItem ascendingItem = new CheckboxItem(\"chkSortDir\");\r\n\t\tascendingItem.setTitle(\"Ascending\");\r\n\r\n\t\tsortForm.setFields(sortItem, ascendingItem);\r\n\r\n\t\tsortForm.addItemChangedHandler(new ItemChangedHandler() {\r\n\t\t\tpublic void onItemChanged(ItemChangedEvent event) {\r\n\t\t\t\tdoSort();\r\n\t\t\t}\r\n\t\t});\r\n\t\treturn sortForm;\r\n\t}", "private void updateSortOrderCheckBox(){\n MenuItem alphabeticalSortItem = sortMenu.findItem(R.id.menuSortAlphabetically);\n MenuItem dateSortItem = sortMenu.findItem(R.id.menuSortDate);\n MenuItem fileTypeSortItem = sortMenu.findItem(R.id.menuSortFileType);\n MenuItem fileSizeSortItem = sortMenu.findItem(R.id.menuSortFileSize);\n if(sortOrder == SortOrder.ALPHABETICAL){\n alphabeticalSortItem.setChecked(true);\n dateSortItem.setChecked(false);\n fileTypeSortItem.setChecked(false);\n fileSizeSortItem.setChecked(false);\n } else if (sortOrder == SortOrder.DATE){\n alphabeticalSortItem.setChecked(false);\n dateSortItem.setChecked(true);\n fileTypeSortItem.setChecked(false);\n fileSizeSortItem.setChecked(false);\n } else if (sortOrder == SortOrder.FILE_TYPE){\n alphabeticalSortItem.setChecked(false);\n dateSortItem.setChecked(false);\n fileTypeSortItem.setChecked(true);\n fileSizeSortItem.setChecked(false);\n } else if(sortOrder == SortOrder.FILE_SIZE){\n alphabeticalSortItem.setChecked(false);\n dateSortItem.setChecked(false);\n fileTypeSortItem.setChecked(false);\n fileSizeSortItem.setChecked(true);\n }\n }", "@Override\n public void onClick(DialogInterface dialogInterface, int sortingBy) {\n if(sortingBy == 2){\n dialogInterface.cancel();\n Collections.sort(mReviews);\n mReviewsListAdapter.notifyDataSetChanged();\n }\n }", "public void sortPriceAscending() throws Exception {\n\n WebDriverWait wait=new WebDriverWait(driver, 20);\n WebElement dropdownList = wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(\"//option[. = 'Price (lowest first)']\")));\n dropdownList.click();\n\n JavascriptExecutor javascriptExecutor = (JavascriptExecutor) driver;\n javascriptExecutor.executeScript(\"window.scrollBy(0,250)\");\n\n Thread.sleep(5000);\n\n List<WebElement> price = driver.findElements(By.xpath(\"//span[@class='price ']\"));\n\n String priceListString;\n List<String> priceArrayList =new ArrayList<>();\n\n for (int i = 0; i < price.size(); i = i + 1) {\n\n priceListString = price.get(i).getText();\n\n String trimPriceListString = priceListString.replaceAll(\"Rs. \",\"\");\n String commaRemovedPriceList= trimPriceListString.replaceAll(\",\",\"\");\n priceArrayList.add(commaRemovedPriceList);\n\n }\n ArrayList<Float> priceList = new ArrayList<>();\n for (String stringValue : priceArrayList) {\n priceList.add(Float.parseFloat(stringValue));\n }\n if (!ascendingCheck(priceList)) {\n Assert.fail(\"Item price not in ascending order\");\n Reports.extentTest.log(Status.FAIL, \"Verified Items not displayed as Lowest to highest Price \", MediaEntityBuilder.createScreenCaptureFromPath(takeScreenshot()).build());\n\n }\n else{\n Reports.extentTest.log(Status.PASS, \"Verified Items displayed as Lowest Price first \", MediaEntityBuilder.createScreenCaptureFromPath(takeScreenshot()).build());\n\n }\n\n }", "private void changeSortOrder(int sortField, String value,int sortId) {\r\n Equals levelFilter = new Equals(fieldName[sortField], value);\r\n CoeusVector cvFilteredData = (CoeusVector)cvHierarchyData.filter(levelFilter);\r\n for (int index=0; index < cvFilteredData.size(); index++) {\r\n sponsorHierarchyBean = (SponsorHierarchyBean)cvFilteredData.get(index);\r\n //Modified Case #1830 Begin\r\n if(sponsorHierarchyBean.getAcType() == null)\r\n sponsorHierarchyBean.setAcType(TypeConstants.UPDATE_RECORD);\r\n //Modified Case #1830 End\r\n switch(sortField) {\r\n case 1:\r\n sponsorHierarchyBean.setLevelOneSortId(sortId);\r\n break;\r\n case 2:\r\n sponsorHierarchyBean.setLevelTwoSortId(sortId);\r\n break;\r\n case 3:\r\n sponsorHierarchyBean.setLevelThreeSortId(sortId);\r\n break;\r\n case 4:\r\n sponsorHierarchyBean.setLevelFourSortId(sortId);\r\n break;\r\n case 5:\r\n sponsorHierarchyBean.setLevelFiveSortId(sortId);\r\n break;\r\n case 6:\r\n sponsorHierarchyBean.setLevelSixSortId(sortId);\r\n break;\r\n case 7:\r\n sponsorHierarchyBean.setLevelSevenSortId(sortId);\r\n break;\r\n case 8:\r\n sponsorHierarchyBean.setLevelEightSortId(sortId);\r\n break;\r\n case 9:\r\n sponsorHierarchyBean.setLevelNineSortId(sortId);\r\n break;\r\n case 10:\r\n sponsorHierarchyBean.setLevelTenSortId(sortId);\r\n break;\r\n }\r\n }\r\n }", "public void clickOnVehicleNameDropdownButton() {\r\n\t\tsafeClick(vehicleLinkPath.replace(\"ant-card-head-title\", \"ant-select ant-select-enabled\"), MEDIUMWAIT);\r\n\t}", "@Override\r\n\tpublic void onButtonClicked() {\n\t\tclientFactory.getPlaceController().goTo(\r\n\t\t\t\tnew CellTableSortingPlace(\"sortingtable\"));\r\n\t}", "@Override\n\t\t\t\t\t\t\tpublic void onClick(View v) {\n\n\t\t\t\t\t\t\t\tLog.e(\"TAG\", \"clicked on\");\n\n\t\t\t\t\t\t\t\tfinal Dialog dialog = new Dialog(ViewSiteActivity.this, R.style.TopToBottomDialog);\n\t\t\t\t\t\t\t\tdialog.requestWindowFeature(Window.FEATURE_NO_TITLE);\n\t\t\t\t\t\t\t\tdialog.setContentView(R.layout.dropdown_working_order);\n\n\t\t\t\t\t\t\t\tListView commonListsView = (ListView) dialog.findViewById(R.id.work_order_list);\n\t\t\t\t\t\t\t\tString[] workArray = getResources().getStringArray(R.array.working_order);\n\t\t\t\t\t\t\t\tcommonList.clear();\n\n\t\t\t\t\t\t\t\tfor (int i = 0; i < workArray.length; i++) {\n\t\t\t\t\t\t\t\t\tcommonList.add(workArray[i]);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tAddCommonListAdapter addCommonListAdapter = new AddCommonListAdapter(\n\t\t\t\t\t\t\t\t\t\tViewSiteActivity.this, commonList);\n\t\t\t\t\t\t\t\tcommonListsView.setAdapter(addCommonListAdapter);\n\t\t\t\t\t\t\t\taddCommonListAdapter.notifyDataSetChanged();\n\n\t\t\t\t\t\t\t\tcommonListsView.setOnItemClickListener(new OnItemClickListener() {\n\n\t\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\t\tpublic void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\t\t\t\t\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\t\t\t\t\tString workOrder = commonList.get(position);\n\t\t\t\t\t\t\t\t\t\tLog.e(\"TAG\", \"Value for workOrder:\" + workOrder);\n\t\t\t\t\t\t\t\t\t\tdropWorkingOrder.setText(workOrder);\n\t\t\t\t\t\t\t\t\t\tdialog.dismiss();\n\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\ttry {\n\t\t\t\t\t\t\t\t\tdialog.show();\n\t\t\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}", "@Override\n public void onClick(View v) {\n int lastSortId = idList.get(idList.size() - 1);\n int newSortId = lastSortId + 1;\n\n // Get the viewgroup of the last item\n RelativeLayout parentLayout = findViewById(R.id.sort_top_rl);\n\n LayoutInflater layoutInflator = LayoutInflater.from(getBaseContext());\n RelativeLayout rlNew = (RelativeLayout) layoutInflator.inflate(R.layout.sort_item, parentLayout, false);\n\n rlNew.setId(newSortId);\n idList.add(newSortId);\n\n // Add the view\n RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(\n ViewGroup.LayoutParams.MATCH_PARENT,\n ViewGroup.LayoutParams.WRAP_CONTENT);\n layoutParams.addRule(RelativeLayout.BELOW, lastSortId);\n parentLayout.addView(rlNew, layoutParams);\n\n //region Set the first remove button to be enabled\n Button firstRemoveButton = getButton(idList.get(0));\n firstRemoveButton.setEnabled(true);\n\n // Set the tag and onClick value for the ImageView\n ImageView orderView = getImageView(newSortId);\n orderView.setTag(true);\n orderView.setOnClickListener(clickToggle);\n\n //Set the tag and onClick value for the remove button\n Button removeButton = getButton(newSortId);\n removeButton.setTag(newSortId);\n removeButton.setOnClickListener(clickRemoveListener);\n //endregion\n }", "public void sortPriceDescending() throws Exception {\n\n WebDriverWait wait=new WebDriverWait(driver, 20);\n WebElement dropdownList = wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(\"//option[@value='prce-desc']\")));\n dropdownList.click();\n\n Thread.sleep(5000);\n\n JavascriptExecutor javascriptExecutor = (JavascriptExecutor) driver;\n javascriptExecutor.executeScript(\"window.scrollBy(0,300)\");\n List<WebElement> price = driver.findElements(By.xpath(\"//span[@class='price ']\"));\n\n String priceListString;\n List<String> priceArrayList =new ArrayList<>();\n\n for (int i = 0; i < price.size(); i = i + 1) {\n\n priceListString = price.get(i).getText();\n\n String trimPriceListString = priceListString.replaceAll(\"Rs. \",\"\");\n String commaRemovedPriceList= trimPriceListString.replaceAll(\",\",\"\");\n priceArrayList.add(commaRemovedPriceList);\n\n }\n ArrayList<Float> priceList = new ArrayList<Float>();\n for (String stringValue : priceArrayList) {\n priceList.add(Float.parseFloat(stringValue));\n }\n if (descendingCheck(priceList)) {\n Reports.extentTest.log(Status.PASS, \"Verified Items displayed as Highest Price first \", MediaEntityBuilder.createScreenCaptureFromPath(takeScreenshot()).build());\n\n }\n else{\n Assert.fail(\"Item price not in descending order\");\n Reports.extentTest.log(Status.FAIL, \"Verified Items not displayed as Highest Price first \", MediaEntityBuilder.createScreenCaptureFromPath(takeScreenshot()).build());\n\n }\n\n }", "public void ClickOrderByItemLink(){\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- OrderByItem Link should be clicked\");\r\n\t\ttry{\r\n\t\t\tsleep(1000);\r\n\t\t\twaitforElementVisible(returnByValue(getValue(\"OrderbyItemLinkText\")));\r\n\t\t\tclick(returnByValue(getValue(\"OrderbyItemLinkText\")));\r\n\t\t\twaitForPageToLoad(100);\r\n\t\t\tSystem.out.println(\"OrderByItem Link is clicked\");\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- OrderByItem is clicked\");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- OrderByItem Link is not clicked\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(getValue(\"OrderbyItemLinkText\")).toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\r\n\t}", "private void displaySortBox() {\n if (playlistIsRunning) {\n if (currentPlaylistPanel.getPlayListSongs().size() >= 2)\n sortPart.showSortBox();\n else\n sortPart.removeSortBox();\n } else\n sortPart.removeSortBox();\n GUIFrame.reload();\n }", "public abstract void toggleSortOrder(int column);", "@Override\n public void execute() {\n itemList.sort_names();\n }", "@Override\r\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int nItem,\r\n\t\t\t\t\tlong arg3) {\n\t\t\t\tPullDownListInfo pli = m_PDLI.get(nItem);\r\n\t\t\t\tif (!pli.getIsChoose()) {\r\n\t\t\t\t\tm_tvSortName.setText(pli.getText());\r\n\t\t\t\t\t//\r\n\t\t\t\t\tresetPullDownListView();\r\n\t\t\t\t\tpli.setIsChoose(true);\r\n\t\t\t\t\tm_PullDownLA.notifyDataSetChanged();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tm_tvSortName\r\n\t\t\t\t\t\t.setBackgroundResource(R.drawable.common_tv_bg_pulldown_normal);\r\n\t\t\t\tm_PDLV.setVisibility(View.GONE);\r\n\r\n\t\t\t\tint nRequestType = HeadhunterPublic.REWARD_REQUESTTYPE_NEW;\r\n\t\t\t\tswitch (nItem) {\r\n\t\t\t\tcase 1: {\r\n//\t\t\t\t\tnRequestType = HeadhunterPublic.REWARD_REQUESTTYPE_LIKE;\r\n//\t\t\t\t\tm_filters = getSearchHistory();\r\n\t//\r\n//\t\t\t\t\t// 友盟统计--任务--排序--猜你喜欢\r\n//\t\t\t\t\tUmShare.UmStatistics(m_Context, \"Reward_Requesttype_Like\");\r\n//\t\t\t\t}\r\n//\t\t\t\t\tbreak;\r\n//\t\t\t\tcase 2: {\r\n//\t\t\t\t\tnRequestType = HeadhunterPublic.REWARD_REQUESTTYPE_PERIPHERY;\r\n//\t\t\t\t\tm_filters = new RewardFilterCondition();\r\n//\t\t\t\t\tm_bIsSearch = false;\r\n\t//\r\n//\t\t\t\t\t// 友盟统计--任务--排序--周边职位\r\n//\t\t\t\t\tUmShare.UmStatistics(m_Context, \"Reward_Requesttype_Reriphery\");\r\n//\t\t\t\t}\r\n//\t\t\t\t\tbreak;\r\n//\t\t\t\tcase 3: {\r\n\t\t\t\t\tnRequestType = HeadhunterPublic.REWARD_REQUESTTYPE_SORT;\r\n\t\t\t\t\tm_filters = new RewardFilterCondition();\r\n\t\t\t\t\tm_bIsSearch = false;\r\n\r\n\t\t\t\t\t// 友盟统计--任务--排序--悬赏排名\r\n\t\t\t\t\tUmShare.UmStatistics(m_Context, \"Reward_Requesttype_Sort\");\r\n\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 0:\r\n\t\t\t\tdefault: {\r\n\t\t\t\t\tnRequestType = HeadhunterPublic.REWARD_REQUESTTYPE_NEW;\r\n\t\t\t\t\tm_filters = new RewardFilterCondition();\r\n\t\t\t\t\tm_bIsSearch = false;\r\n\r\n\t\t\t\t\t// 友盟统计--任务--排序--最新发布\r\n\t\t\t\t\tUmShare.UmStatistics(m_Context, \"Reward_Requesttype_New\");\r\n\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tm_nListStatus = LISTVIEW_STATUS_ONREFRESH;\r\n\t\t\t\tm_lvReward.setLoading();\r\n\t\t\t\t// 获取悬赏任务列表\r\n\t\t\t\tstartGetData(HeadhunterPublic.REWARD_DIRECTIONTYPE_NEW, \"\",\r\n\t\t\t\t\t\tnRequestType);\r\n\t\t\t}", "@FXML\n private void sorteerAction(ActionEvent event) {\n \n taOutput.setText(woordenMethods.calcsort(DEFAULT_TEXT));\n //throw new UnsupportedOperationException(\"Not supported yet.\"); \n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == R.id.action_sort) {\n //display alert to choose sort type\n showSortDialog();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "public static void dropDownAction(WebDriver driver, String locatorType, String locatorValue, String testdata) throws Exception\r\n{\r\n\tif(locatorType.equalsIgnoreCase(\"xpath\"))\r\n\t{\r\n\t\tint value = Integer.parseInt(testdata);\r\n\t\tWebElement element = driver.findElement(By.xpath(locatorValue));\r\n\t\tSelect select = new Select(element);\r\n\t\tselect.selectByIndex(value);\r\n\t\t\r\n\t}\r\n\tif(locatorType.equalsIgnoreCase(\"id\"))\r\n\t{\r\n\t\tint value = Integer.parseInt(testdata);\r\n\t\tWebElement element = driver.findElement(By.xpath(locatorValue));\r\n\t\tSelect select = new Select(element);\r\n\t\tselect.selectByIndex(value);\r\n\t\t\r\n\t}\r\n}", "@Override\n public void onDialogPositiveClick(int item) {\n ((ListFragment)getSupportFragmentManager().findFragmentById(R.id.fragmentItemsList)).Sort(item);\n }", "public void selectItemInEdittableDropdown(By parentBy, By childBy, String expectedTextItem) {\n\t\tdriver.findElement(parentBy).clear();\n\t\tdriver.findElement(parentBy).sendKeys(expectedTextItem);\n\t\tsleepInSecond(1);\n\n\t\t// Store all elements\n\t\tList<WebElement> allItems = driver.findElements(childBy);\n\n\t\tfor (WebElement item : allItems) {\n\t\t\tif (item.getText().trim().equals(expectedTextItem)) {\n\t\t\t\tif (item.isDisplayed()) { // 3 - If item need to select in view ( can see) => click\n\t\t\t\t\titem.click();\n\t\t\t\t} else { // 4 - If item need to select (can't see) => scroll down => click\n\t\t\t\t\tjsExecutor.executeScript(\"arguments[0].scrollIntoView(true)\", item);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\t}", "public void clickNavigatorDropDown() {\r\n\t\ttry {\r\n\t\t\t(new WebDriverWait(driver, 120)).until(ExpectedConditions\r\n\t\t\t\t\t.elementToBeClickable(By\r\n\t\t\t\t\t\t\t.xpath(\"(//input[@name='Bala_Test']\")));\r\n\t\t} catch (Exception e) {\r\n\t\t\t// Do nothing\r\n\t\t}\r\n\t\twait.until(ExpectedConditions.elementToBeClickable(By\r\n\t\t\t\t.xpath(\"(//span/span[@class='k-select'])[1]\")));\r\n\t\tWebElement navigatorDropDown = driver.findElement(By\r\n\t\t\t\t.xpath(\"(//span/span[@class='k-select'])[1]\"));\r\n\t\tsleep(5000);\r\n\t\tnavigatorDropDown.click();\r\n\t\tReporter.log(\"Navigator Drop Down Clicked<br/>\");\r\n\t}", "@Test\n public void booksArrangedInAscendingOrderAtoZ() throws InterruptedException {\n\n //WebElement Books Link\n clickOnElement(By.xpath(\"//ul[@class='top-menu notmobile']//li[5]/a\"));\n\n //WebElement Position dropdown box\n selectByIndexFromDropDown(By.cssSelector(\"select#products-orderby\"),1);\n sleepMethod(2000);\n\n //Scroll down page\n windowScrollUpOrDown(0,500);\n sleepMethod(2000);\n\n arrayListForEachLoopAssertEqualsForString(By.xpath(\"//div[@class='product-grid']//h2/a\"));\n\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n switch (position) {\n case 0:\n setSortBy = POPULARITY_DESC;\n break;\n case 1:\n setSortBy = POPULARITY_ASC;\n break;\n case 2:\n setSortBy = RATING_DESC;\n break;\n case 3:\n setSortBy = RATING_ASC;\n break;\n case 4:\n setSortBy = TITLE_ASC;\n break;\n case 5:\n setSortBy = TITLE_DESC;\n break;\n case 6:\n setSortBy = RELEASE_DATE_DESC;\n break;\n case 7:\n setSortBy = RELEASE_DATE_ASC;\n break;\n default:\n setSortBy = POPULARITY_DESC;\n break;\n }\n\n // Sorting option has not been changed.\n // This is to prevent creating a new activity non-stop even with no change\n // in option.\n if (setSortBy.equals(currentSort)) {\n return;\n }\n\n // Start a new MovieListActivity to clear movies already loaded and start loading\n // again based on the sorting option.\n Intent intent = new Intent(MovieListActivity.this, MovieListActivity.class);\n intent.putExtra(SELECTION_KEY, setSortBy);\n intent.putExtra(INDEX_KEY, position);\n startActivity(intent);\n finish();\n overridePendingTransition(0, 0);\n }", "@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tlan = 1;\r\n\t\t\t\tCalendar dar = Calendar.getInstance();\r\n\t\t\t\tngayChonDatePicker = dar.getTime();\r\n\t\t\t\t\r\n\t\t\t\tint index = expandableList.getFirstVisiblePosition();\r\n\t\t\t\tView viewLV = expandableList.getChildAt(0);\r\n\t\t\t\tint top = (viewLV == null) ? 0 : (viewLV.getTop() - expandableList.getPaddingTop());\r\n\t\t\t\t\r\n\t\t\t\tsetinItialize(view, l, c);\r\n\t\t\t\t\r\n\t\t\t\texpandableList.setSelectionFromTop(index, top);\r\n\t\t\t}", "public void clickBulkActionsDropdown() {\n waitForVisibleElement(eleEngagementOverViewStatusText, \"Engagement overview status\");\n engagementOverViewStatusBefore = eleEngagementOverViewStatusText.getText().trim();\n\n waitForVisibleElement(eleEngagementOverViewToDoText, \"Engagement overview todo\");\n engagementOverViewToDoBefore = eleEngagementOverViewToDoText.getText().trim();\n\n clickElement(bulkActionsDropdownEle, \"Bulk Actions Dropdown List\");\n }", "private int getSortValue() {\n\t\tint sortBy = DisplaySpecServices.ORDERDATESORT; // default sort option -\n\t\t// ORDERDATE\n\t\tif (this.searchNotSort == false) {\n\t\t\ttry {\n\t\t\t\tsortBy = Integer.parseInt(this.sortOption);\n\t\t\t} catch (NumberFormatException nfe) {\n\t\t\t\tsortBy = DisplaySpecServices.ORDERDATESORT; // default sort\n\t\t\t\t// option\n\t\t\t}\n\t\t} else {\n\t\t\tString searchOption = this.getSearchOption();\n\n\t\t\ttry {\n\t\t\t\tint searchOptValue = Integer.parseInt(searchOption);\n\t\t\t\tswitch (searchOptValue) {\n\t\t\t\tcase DisplaySpecServices.ORDERDATEFILTER:\n\t\t\t\t\tsortBy = DisplaySpecServices.ORDERDATESORT;\n\t\t\t\t\tthis.sortOption = String.valueOf(sortBy);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DisplaySpecServices.REPUBLICATIONDATEFILTER:\n\t\t\t\t\tsortBy = DisplaySpecServices.REPUBLICATIONDATESORT;\n\t\t\t\t\tthis.sortOption = String.valueOf(sortBy);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DisplaySpecServices.PUBLICATIONTITLEFILTER:\n\t\t\t\t\tsortBy = DisplaySpecServices.PUBLICATIONTITLESORT;\n\t\t\t\t\tthis.sortOption = String.valueOf(sortBy);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DisplaySpecServices.ORDERDETAILIDFILTER:\n\t\t\t\t\tsortBy = DisplaySpecServices.ORDERDETAILIDSORT;\n\t\t\t\t\tthis.sortOption = String.valueOf(sortBy);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DisplaySpecServices.PERMISSIONTYPEFILTER:\n\t\t\t\t\tsortBy = DisplaySpecServices.PERMISSIONTYPESORT; // 2ndary\n\t\t\t\t\t// sort\n\t\t\t\t\t// Order\n\t\t\t\t\t// Date\n\t\t\t\t\tthis.sortOption = String.valueOf(sortBy);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DisplaySpecServices.PERMISSIONSTATUSFILTER:\n\t\t\t\t\tsortBy = DisplaySpecServices.PERMISSIONSTATUSSORT; // 2ndary\n\t\t\t\t\t// sort\n\t\t\t\t\t// Order\n\t\t\t\t\t// Date\n\t\t\t\t\tthis.sortOption = String.valueOf(sortBy);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DisplaySpecServices.BILLINGSTATUSFILTER:\n\t\t\t\t\tsortBy = DisplaySpecServices.ORDERDATESORT;\n\t\t\t\t\tthis.sortOption = String.valueOf(sortBy);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DisplaySpecServices.YOURREFERENCEFILTER:\n\t\t\t\t\tsortBy = DisplaySpecServices.YOURREFERENCESORT;\n\t\t\t\t\tthis.sortOption = String.valueOf(sortBy);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DisplaySpecServices.INVOICENUMBERFILTER:\n\t\t\t\t\tsortBy = DisplaySpecServices.INVOICENUMBERSORT;\n\t\t\t\t\tthis.sortOption = String.valueOf(sortBy);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DisplaySpecServices.REPUBLICATIONTITLEFILTER:\n\t\t\t\t\tsortBy = DisplaySpecServices.REPUBLICATIONTITLESORT;\n\t\t\t\t\tthis.sortOption = String.valueOf(sortBy);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DisplaySpecServices.REPUBLICATIONPUBLISHERFILTER:\n\t\t\t\t\tsortBy = DisplaySpecServices.REPUBLICATIONPUBLISHERSORT;\n\t\t\t\t\tthis.sortOption = String.valueOf(sortBy);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DisplaySpecServices.LASTUPDATEDATESORT:\n\t\t\t\t\tsortBy = DisplaySpecServices.LASTUPDATEDATESORT;\n\t\t\t\t\tthis.sortOption = String.valueOf(sortBy);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tsortBy = DisplaySpecServices.ORDERDATESORT; // default\n\t\t\t\t\tthis.sortOption = String.valueOf(sortBy);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} catch (NumberFormatException nfe) {\n\t\t\t\tsortBy = DisplaySpecServices.ORDERDATESORT; // default\n\t\t\t\tthis.sortOption = String.valueOf(sortBy);\n\t\t\t}\n\t\t}\n\t\treturn sortBy;\n\t}", "private void resortAndReselectTreeGrid(final KzTreeAware itemToSelect) {\n\n// inMemoryKzTreeProvider = new TreeDataProvider<>(treeData);\n// kzTreeGrid.getDataCommunicator().getKeyMapper().removeAll();\n// inMemoryKzTreeProvider.setFilter(kz -> kz.getArch());\n// inMemoryKzTreeProvider.refreshAll();\n List<GridSortOrder<KzTreeAware>> sortOrder = kzTreeGrid.getSortOrder();\n// kzTreeGrid.setDataProvider(inMemoryKzTreeProvider);\n\n if (CollectionUtils.isEmpty(sortOrder)) {\n kzTreeGrid.sort(initialSortOrder);\n } else {\n kzTreeGrid.sort(sortOrder);\n }\n\n selectItem(itemToSelect);\n }", "@Override\n\tpublic void onToggleSort(String header) {\n\t\tsynapseClient.toggleSortOnTableQuery(this.startingQuery.getSql(), header, new AsyncCallback<String>(){\n\t\t\t@Override\n\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\tshowError(caught);\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onSuccess(String sql) {\n\t\t\t\trunSql(sql);\n\t\t\t}});\n\t}", "public void searchFilter(){\n\t\t\n\t\tdriver.findElement(By.xpath(\"//div[@class='_3uDYxP']//select[@class='_2YxCDZ']\")).click();\n\t\tSystem.out.println(\"drop-downselected\");\n\t}", "@Override\r\n public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {\r\n if (_sorts == null)\r\n return;\r\n\r\n _sortSelectedIndex = checkedId;\r\n\r\n _adapter.clear();\r\n _adapter.add(_sorts[_sortSelectedIndex].getAscName());\r\n _adapter.add(_sorts[_sortSelectedIndex].getDescName());\r\n }", "public boolean onOptionsItemSelected(MenuItem item){\n switch(item.getItemId()){\n case(android.R.id.home): //if home (back) button is pressed\n Intent myIntent = new Intent(getApplicationContext(), MainActivity.class);\n startActivityForResult(myIntent, 0);\n break;\n case(R.id.menuSortDate): //if sort by date selected\n Toast.makeText(this,\"Sorted by date created\", Toast.LENGTH_LONG).show();\n fileListAdapter.sortDateCreated(); //sort files by date created\n fileListAdapter.notifyDataSetChanged();\n sortOrder = SortOrder.DATE; //update sort order\n break;\n case(R.id.menuSortAlphabetically): //if sort alphabetically selected\n Toast.makeText(this,\"Sorted alphabetically\", Toast.LENGTH_LONG).show();\n fileListAdapter.sortAlphabetically(); //sort files by alphabetical order\n fileListAdapter.notifyDataSetChanged();\n sortOrder = SortOrder.ALPHABETICAL; //update sort order\n break;\n case(R.id.menuSortFileType): //if sort by file type selected\n Toast.makeText(this,\"Sorted by file type\", Toast.LENGTH_LONG).show();\n fileListAdapter.sortFileType();\n fileListAdapter.notifyDataSetChanged();\n sortOrder = SortOrder.FILE_TYPE; //update sort order\n break;\n case(R.id.menuSortFileSize):\n Toast.makeText(this,\"Sorted by file size\", Toast.LENGTH_LONG).show();\n fileListAdapter.sortFileSize();\n fileListAdapter.notifyDataSetChanged();\n sortOrder = SortOrder.FILE_SIZE;\n break;\n// MenuItem fileSizeSortItem = sortMenu.findItem(R.id.menuSortFileSize);\n// fileSizeSortItem.setChecked(true);\n default:\n return super.onOptionsItemSelected(item);\n }\n updateSortOrderCheckBox(); //update checkboxes of sort order dropdown\n return true;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == R.id.action_sort) {\n Dialogs.showSortDialog(this);\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "public void Click_selectmenu(String val, WebElement eleToClick, ExtentTest extentedReport) throws Exception {\n\t\ttry {\n\t\t\tSelect cotentsdropdown = new Select(eleToClick);\n\t\t\tcotentsdropdown.selectByValue(val);\n\t\t\tLog.message(\"Selected menu option: \" + val, extentedReport);\n\t\t} catch (Exception e) {\n\t\t\tthrow new Exception(\"Selected menu option\" + e);\n\t\t}\n\t}", "public void showSortDialog() {\n AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this);\n LayoutInflater inflater = this.getLayoutInflater();\n View dialogView = inflater.inflate(R.layout.dialog_sort, null);\n dialogBuilder.setView(dialogView);\n\n// final Spinner spinner2 = (Spinner) dialogView.findViewById(R.id.spinner_sort_secondary);\n\n // Set initial spinner selection\n final Spinner spinner1 = (Spinner) dialogView.findViewById(R.id.spinner_sort_primary);\n String[] sortFields = getResources().getStringArray(R.array.pref_sort_field_values);\n int sortFieldIndex = -1;\n for (int i = 0; i < sortFields.length; i++) {\n if (sortFields[i].equalsIgnoreCase(prefs.getString(KEY_SORT_FIELD, \"name\"))) {\n sortFieldIndex = i;\n break;\n }\n }\n\n if (sortFieldIndex >= 0) {\n spinner1.setSelection(sortFieldIndex);\n } else {\n spinner1.setSelection(0); // Default to event name\n }\n\n // Set initial sort order image from preferences\n final ImageButton ib1 = (ImageButton) dialogView.findViewById(R.id.image_button_1);\n if (prefs.getBoolean(KEY_SORT_ORDER_ASCENDING, true)) {\n ib1.setImageDrawable(getDrawable(R.drawable.ic_action_sort_ascending));\n } else {\n ib1.setImageDrawable(getDrawable(R.drawable.ic_action_sort_descending));\n }\n\n // Switch order on click\n ib1.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n if (prefs.getBoolean(KEY_SORT_ORDER_ASCENDING, true)) {\n // Currently set as ascending, so switch to descending\n setBooleanPreference(KEY_SORT_ORDER_ASCENDING, false);\n ib1.setImageDrawable(getDrawable(R.drawable.ic_action_sort_descending));\n } else {\n // Currently set as descending, so switch to ascending\n setBooleanPreference(KEY_SORT_ORDER_ASCENDING, true);\n ib1.setImageDrawable(getDrawable(R.drawable.ic_action_sort_ascending));\n }\n }\n });\n\n // Sort order - button 2\n// final ImageButton ib2 = (ImageButton) dialogView.findViewById(R.id.image_button_2);\n//\n// if (prefs.getBoolean(SORT_SECONDARY_KEY, true)) {\n// ib2.setImageDrawable(getDrawable(R.drawable.ic_action_sort_ascending));\n// } else {\n// ib2.setImageDrawable(getDrawable(R.drawable.ic_action_sort_descending));\n// }\n//\n// ib2.setOnClickListener(new View.OnClickListener() {\n// @Override\n// public void onClick(View view) {\n// if (prefs.getBoolean(SORT_SECONDARY_KEY, true)) {\n// // Currently set as ascending, so switch to descending\n// setBooleanPreference(SORT_SECONDARY_KEY, false);\n// ib2.setImageDrawable(getDrawable(R.drawable.ic_action_sort_descending));\n// } else {\n// // Currently set as descending, so switch to ascending\n// setBooleanPreference(SORT_SECONDARY_KEY, true);\n// ib2.setImageDrawable(getDrawable(R.drawable.ic_action_sort_ascending));\n// }\n// }\n// });\n\n dialogBuilder.setTitle(getResources().getString(R.string.pref_title_sort_field));\n dialogBuilder.setPositiveButton(\"Sort\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int whichButton) {\n // Get spinner position and set sort preference to corresponding value\n int spinnerPosition = spinner1.getSelectedItemPosition();\n setStringPreference(KEY_SORT_FIELD, getResources()\n .getStringArray(R.array.pref_sort_field_values)[spinnerPosition]);\n\n // Update data\n prepareData();\n }\n });\n dialogBuilder.setNegativeButton(\"Cancel\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int whichButton) {\n // Pass\n }\n });\n AlertDialog b = dialogBuilder.create();\n b.show();\n }", "public void setClickSort(boolean b) {\r\n\t\t_clickSort = b;\r\n\t}", "private void processSortButton() {\n try {\n dataOutputArea.setText(\"\");\n\n //Stop a user from sorting before a World exists to search\n if(this.world == null) {\n JOptionPane.showMessageDialog(null, \"You must read a data file first!\", \"Error\", JOptionPane.ERROR_MESSAGE);\n return;\n }\n //First if stops a user from attempting to sort any type of thing other than a Ship by any attribute other than Name\n if (!sortCriteriaThingBox.getSelectedItem().toString().toLowerCase().equals(\"ship\") && !sortAttributeBox.getSelectedItem().toString().toLowerCase().equals(\"name\")) {\n JOptionPane.showMessageDialog(null, \"You can only sort Ships by an attribute other than 'Name'!\", \"Error\", JOptionPane.WARNING_MESSAGE);\n //This if will sort whatever Thing is selected by calling sortMyThingByName in the World class\n } else if (sortAttributeBox.getSelectedItem().toString().toLowerCase().equals(\"name\")) {\n String sortThing = sortCriteriaThingBox.getSelectedItem().toString();\n String sortResultByName = world.sortMyThingByName(sortThing);\n dataOutputArea.setText(sortResultByName);\n } else {\n String sortAttribute = sortAttributeBox.getSelectedItem().toString();\n String sortResultByAttribute = world.sortShipByAttribute(sortAttribute);\n dataOutputArea.setText(sortResultByAttribute);\n }\n } catch(Exception e7) {\n JOptionPane.showMessageDialog(null, \"Something went wrong while sorting!\\n\\n\" + e7.getMessage(), \"Error\", JOptionPane.ERROR_MESSAGE);\n } //end of catch()\n }", "void onPositiveResult(@Nullable Sort sort, boolean isSortAsc, @Nullable ArrayList<String> selectedFilters);", "public static void doSort ( RunData data)\n\t{\n\t\tSessionState state = ((JetspeedRunData)data).getPortletSessionState (((JetspeedRunData)data).getJs_peid ());\n\n\t\t//get the ParameterParser from RunData\n\t\tParameterParser params = data.getParameters ();\n\n\t\t// save the current selections\n\t\tSet selectedSet = new TreeSet();\n\t\tString[] selectedItems = data.getParameters ().getStrings (\"selectedMembers\");\n\t\tif(selectedItems != null)\n\t\t{\n\t\t\tselectedSet.addAll(Arrays.asList(selectedItems));\n\t\t}\n\t\tstate.setAttribute(STATE_LIST_SELECTIONS, selectedSet);\n\n\t\tString criteria = params.getString (\"criteria\");\n\n\t\tif (criteria.equals (\"title\"))\n\t\t{\n\t\t\tcriteria = ResourceProperties.PROP_DISPLAY_NAME;\n\t\t}\n\t\telse if (criteria.equals (\"size\"))\n\t\t{\n\t\t\tcriteria = ResourceProperties.PROP_CONTENT_LENGTH;\n\t\t}\n\t\telse if (criteria.equals (\"created by\"))\n\t\t{\n\t\t\tcriteria = ResourceProperties.PROP_CREATOR;\n\t\t}\n\t\telse if (criteria.equals (\"last modified\"))\n\t\t{\n\t\t\tcriteria = ResourceProperties.PROP_MODIFIED_DATE;\n\t\t}\n\t\telse if (criteria.equals(\"priority\") && ContentHostingService.isSortByPriorityEnabled())\n\t\t{\n\t\t\t// if error, use title sort\n\t\t\tcriteria = ResourceProperties.PROP_CONTENT_PRIORITY;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tcriteria = ResourceProperties.PROP_DISPLAY_NAME;\n\t\t}\n\n\t\tString sortBy_attribute = STATE_SORT_BY;\n\t\tString sortAsc_attribute = STATE_SORT_ASC;\n\t\tString comparator_attribute = STATE_LIST_VIEW_SORT;\n\t\t\n\t\tif(state.getAttribute(STATE_MODE).equals(MODE_REORDER))\n\t\t{\n\t\t\tsortBy_attribute = STATE_REORDER_SORT_BY;\n\t\t\tsortAsc_attribute = STATE_REORDER_SORT_ASC;\n\t\t\tcomparator_attribute = STATE_REORDER_SORT;\n\t\t}\n\t\t// current sorting sequence\n\t\tString asc = NULL_STRING;\n\t\tif (!criteria.equals (state.getAttribute (sortBy_attribute)))\n\t\t{\n\t\t\tstate.setAttribute (sortBy_attribute, criteria);\n\t\t\tasc = Boolean.TRUE.toString();\n\t\t\tstate.setAttribute (sortAsc_attribute, asc);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// current sorting sequence\n\t\t\tasc = (String) state.getAttribute (sortAsc_attribute);\n\n\t\t\t//toggle between the ascending and descending sequence\n\t\t\tif (asc.equals (Boolean.TRUE.toString()))\n\t\t\t{\n\t\t\t\tasc = Boolean.FALSE.toString();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tasc = Boolean.TRUE.toString();\n\t\t\t}\n\t\t\tstate.setAttribute (sortAsc_attribute, asc);\n\t\t}\n\n\t\tif (state.getAttribute(STATE_MESSAGE) == null)\n\t\t{\n\t\t\tComparator comparator = ContentHostingService.newContentHostingComparator(criteria, Boolean.getBoolean(asc));\n\t\t\tstate.setAttribute(comparator_attribute, comparator);\n\t\t\t\n\t\t\t// sort sucessful\n\t\t\t// state.setAttribute (STATE_MODE, MODE_LIST);\n\n\t\t}\t// if-else\n\n\t}", "@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tif (!isEdit) {\r\n\t\t\t\t\txb_popup.showAsDropDown(xbet, 0, 1, xbet.getWidth(),\r\n\t\t\t\t\t\t\tLayoutParams.WRAP_CONTENT);\r\n\t\t\t\t}\r\n\t\t\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == R.id.menu_action_sort) {\n Toast.makeText(MainActivity.this,\"Sort Button\",Toast.LENGTH_SHORT).show();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "private void openPriceFormatOptionsList() {\n driver.findElement(By.xpath(\"//a[contains(@href, 'odds-format')]\")).click();\n TestHelper.waitForAjax();\n //could be replaced by better WaitFor method\n testHelper.sleep(1);\n }", "public void setSortOrder(int value) {\r\n this.sortOrder = value;\r\n }", "public void run()\n { // checking for appropriate sorting algorithm\n \n if(comboAlgorithm.equals(\"Shell Sort\"))\n {\n this.shellSort(randInt);\n }\n \n if(comboAlgorithm.equals(\"Selection Sort\"))\n {\n this.selectionSort(randInt);\n }\n \n if(comboAlgorithm.equals(\"Insertion Sort\"))\n {\n this.insertionSort(randInt);\n }\n if(comboAlgorithm.equals(\"Bubble Sort\"))\n {\n this.bubbleSort(randInt);\n }\n \n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\n\t\t\t\tif(state.equalsIgnoreCase(\"nameAsc\"))\n\t\t\t\t{\n\t\t\t\t\tpopulateTable(\"nameDsc\");\n\t\t\t\t}\n\t\t\t\telse if(state.equalsIgnoreCase(\"nameDsc\"))\n\t\t\t\t{\n\t\t\t\t\tpopulateTable(\"nameAsc\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tpopulateTable(\"nameAsc\");\n\t\t\t\t}\n\n\n\t\t\t}", "@When(\"User clicks on Sortable a list of items should appear\")\n public void user_clicks_on_Sortable_a_list_of_items_should_appear() {\n homePage.user_clicks_on_Sortable_a_list_of_items_should_appear_Test();\n }", "public void Dropdownselection(WebElement ele) {\t\t\n\t\t\n\t Select dropdown = new Select(ele);\n\t//Get all options\n\tList<WebElement> dd = dropdown.getOptions();\n\t int iCnt = dd.size();\n Random num = new Random();\n int iSelect = num.nextInt(iCnt);\n dropdown.selectByIndex(iSelect);\n System.out.println(\"Element Name 1 : \" +ele.getAttribute(\"value\"));\n\t}", "public SortByNameCommand(ItemList itemList){\n this.itemList = itemList;\n }", "@FXML\n private void updateDateOrder(ActionEvent event) {\n\n if (sortOrder == Order.DATE_ASC) {\n\n sortOrder = Order.DATE_DESC;\n\n } else if (sortOrder == Order.DATE_DESC) {\n\n sortOrder = Order.DEFAULT;\n\n } else {\n\n sortOrder = Order.DATE_ASC;\n\n }\n\n updateOrderButtons();\n\n }", "public void setSort(Short sort) {\n this.sort = sort;\n }", "Sort asc(QueryParameter parameter);", "public static void main(String[] args) {\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"C:\\\\Users\\\\Divakar\\\\Downloads\\\\chromedriver\\\\chromedriver.exe\");\r\n\t\tWebDriver driver=new ChromeDriver();\r\n\t\tdriver.get(\"http://leafground.com/pages/sortable.html\");\r\n\t\t\r\n\t\t\r\n\t\tList<WebElement> sort1=driver.findElements(By.xpath(\"//*[@id=\\\"sortable\\\"]/li\"));\r\n\t\tWebElement firstelement=sort1.get(6);\r\n\t\tWebElement firstelement2=sort1.get(0);\r\n\t\t\r\n\t\t\r\n\t\tActions Act=new Actions(driver);\r\n\t\tAct.clickAndHold(firstelement);\r\n\t\tAct.moveToElement(firstelement2);\r\n\t\tAct.release(firstelement2);\r\n\t\tAct.build().perform();\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t}", "private void initSortByClick() {\n\t\tRadioGroup rgSortBy = (RadioGroup) findViewById(R.id.radioGroup1);\n\t\trgSortBy.setOnCheckedChangeListener(new OnCheckedChangeListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onCheckedChanged(RadioGroup arg0, int arg1) {\n\t\t\t\tRadioButton rbName = (RadioButton) findViewById(R.id.radioName);\n\t\t\t\tRadioButton rbCity = (RadioButton) findViewById(R.id.radioCity);\n//\t\t\t\tRadioButton rbBirthDay = (RadioButton) findViewById(R.id.radioBirthdate);\n\t\t\t\tif (rbName.isChecked()) {\n\t\t\t\t\tgetSharedPreferences(\"MyContactListPreferences\", Context.MODE_PRIVATE).edit().putString(\"sortfield\", \"contactname\").commit();\n\t\t\t\t}\n\t\t\t\telse if (rbCity.isChecked()) {\n\t\t\t\t\tgetSharedPreferences(\"MyContactListPreferences\", Context.MODE_PRIVATE).edit().putString(\"sortfield\", \"city\").commit();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tgetSharedPreferences(\"MyContactListPreferences\", Context.MODE_PRIVATE).edit().putString(\"sortfield\", \"birthday\").commit();\n\t\t\t\t}\t\t\t\n\t\t\t}\t\t\n\t\t});\n\t}", "@Test (priority = 1, dataProvider=\"sortbyname\")\n public void sort_By_Name(String sortByname) {\n\t Menu_Products_obj = new Menu_Products(driver);\n\t String actual=Menu_Products_obj.open_menu1(sortByname);\n \tAssert.assertTrue(actual.contains(sortByname));\n Allure.step(\"Product is displayed As Expected\"); \t\n \t \n\t homepage_obj.sort_Byname_ASC();\n\t homepage_obj.sort_Byname_DESC();\n\t \n }", "private void Sort(int[] list)\r\n {\r\n switch (SortField.getText())\r\n {\r\n case \"Insertion Sort\":\r\n {\r\n InsertionSort insertionSort = new InsertionSort();\r\n\r\n long startTime = System.currentTimeMillis();\r\n\r\n insertionSort.insertionSort(list);\r\n\r\n long endTime = System.currentTimeMillis();\r\n\r\n CompareField.setText(String.valueOf(insertionSort.getComparisons()));\r\n MovementField.setText(String.valueOf(insertionSort.getMovements()));\r\n TimeField.setText((endTime - startTime + \" milliseconds\"));\r\n TimeComField.setText(\"O(n*2)\");\r\n\r\n break;\r\n }\r\n case \"Selection Sort\":\r\n {\r\n SelectionSort selectionSort = new SelectionSort();\r\n\r\n long startTime = System.currentTimeMillis();\r\n\r\n selectionSort.selectionSort(list);\r\n\r\n long endTime = System.currentTimeMillis();\r\n\r\n CompareField.setText(String.valueOf(selectionSort.getComparisons()));\r\n MovementField.setText(String.valueOf(selectionSort.getMovements()));\r\n TimeField.setText((endTime - startTime + \" milliseconds\"));\r\n TimeComField.setText(\"O(n2)\");\r\n\r\n break;\r\n }\r\n case \"Quick Sort\":\r\n {\r\n QuickSort quickSort = new QuickSort();\r\n\r\n long startTime = System.currentTimeMillis();\r\n\r\n quickSort.quickSort(list);\r\n\r\n long endTime = System.currentTimeMillis();\r\n\r\n CompareField.setText(String.valueOf(quickSort.getComparisons()));\r\n MovementField.setText(String.valueOf(quickSort.getMovements()));\r\n TimeField.setText((endTime - startTime + \" milliseconds\"));\r\n TimeComField.setText(\"O(n log n)\");\r\n\r\n break;\r\n }\r\n case \"Merge Sort\":\r\n {\r\n MergeSort mergeSort = new MergeSort();\r\n\r\n long startTime = System.currentTimeMillis();\r\n\r\n mergeSort.mergeSort(list);\r\n\r\n long endTime = System.currentTimeMillis();\r\n\r\n CompareField.setText(String.valueOf(mergeSort.getComparisons()));\r\n MovementField.setText(String.valueOf(mergeSort.getMovements()));\r\n TimeField.setText((endTime - startTime + \" milliseconds\"));\r\n TimeComField.setText(\"T(n) = 2T(n/2) + θ(n)\");\r\n\r\n break;\r\n }\r\n case \"Heap Sort\":\r\n {\r\n HeapSort heapSort = new HeapSort();\r\n\r\n long startTime = System.currentTimeMillis();\r\n\r\n heapSort.heapSort(list);\r\n\r\n long endTime = System.currentTimeMillis();\r\n\r\n CompareField.setText(String.valueOf(heapSort.getComparisons()));\r\n MovementField.setText(String.valueOf(heapSort.getMovements()));\r\n TimeField.setText((endTime - startTime + \" milliseconds\"));\r\n TimeComField.setText(\"O(nLogn)\");\r\n\r\n break;\r\n }\r\n case \"Radix Sort\":\r\n {\r\n RadixSort radixSort = new RadixSort();\r\n\r\n long startTime = System.currentTimeMillis();\r\n\r\n radixSort.radixSort(list, Integer.parseInt(SizeField.getText()));\r\n\r\n long endTime = System.currentTimeMillis();\r\n\r\n CompareField.setText(\"Radix Sort has 0 comparisons\");\r\n MovementField.setText(String.valueOf(radixSort.getMovements()));\r\n TimeField.setText((endTime - startTime + \" milliseconds\"));\r\n TimeComField.setText(\"O(kn)\");\r\n\r\n break;\r\n }\r\n\r\n case \"Bubble Sort\":\r\n {\r\n BubbleSort bubbleSort = new BubbleSort();\r\n\r\n long startTime = System.currentTimeMillis();\r\n\r\n bubbleSort.bubbleSort(list);\r\n\r\n long endTime = System.currentTimeMillis();\r\n\r\n CompareField.setText(String.valueOf(bubbleSort.getComparisons()));\r\n MovementField.setText(String.valueOf(bubbleSort.getMovements()));\r\n TimeField.setText((endTime - startTime + \" milliseconds\"));\r\n TimeComField.setText(\"O(n*n)\");\r\n\r\n break;\r\n }\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_sort_name) {\n if(sortStateName == SortStateName.ASCENDING){\n Toast.makeText(this, \"Sorting by Name Ascending\", Toast.LENGTH_SHORT).show();\n Collections.sort(teams,TeamData.reverseTeamName);\n mAdapter.notifyDataSetChanged();\n sortStateName = SortStateName.DESCENDING;\n }else{\n Toast.makeText(this, \"Sorting by Name Descending\", Toast.LENGTH_SHORT).show();\n Collections.sort(teams,TeamData.teamName);\n mAdapter.notifyDataSetChanged();\n sortStateName = SortStateName.ASCENDING;\n }\n return true;\n }\n if (id == R.id.action_sort_by_players) {\n Toast.makeText(this, \"Sorting by Players Ascending\", Toast.LENGTH_SHORT).show();\n if(sortStatePlayers == SortStatePlayers.ASCENDING){\n Collections.sort(teams,TeamData.teamPlayers);\n mAdapter.notifyDataSetChanged();\n sortStatePlayers = SortStatePlayers.DESCENDING;\n }else{\n Toast.makeText(this, \"Sorting by Players Descending\", Toast.LENGTH_SHORT).show();\n Collections.sort(teams,TeamData.reverseTeamPlayers);\n mAdapter.notifyDataSetChanged();\n sortStatePlayers = SortStatePlayers.ASCENDING;\n }\n return true;\n }\n if (id == R.id.action_sort_salary) {\n if(sortStateSalary == SortStateSalary.ASCENDING){\n Toast.makeText(this, \"Sorting by Salary Ascending\", Toast.LENGTH_SHORT).show();\n Collections.sort(teams,TeamData.reverseTeamSalary);\n mAdapter.notifyDataSetChanged();\n sortStateSalary = SortStateSalary.DESCENDING;\n }else{\n Toast.makeText(this, \"Sorting by Salary Descending\", Toast.LENGTH_SHORT).show();\n Collections.sort(teams,TeamData.teamSalary);\n mAdapter.notifyDataSetChanged();\n sortStateSalary = sortStateSalary.ASCENDING;\n }\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "public void selectItemInEditableDropdown(String parentLocator,String allItemsLocator, String expectedElement) throws InterruptedException {\n\t\tWebElement parentDropdown=driver.findElement(By.xpath(parentLocator));\r\n\t\tjsExecutor.executeScript(\"arguments[0].scrollIntoView(true);\",parentDropdown);\r\n\t\t//parentDropdown.click();\r\n\t\tjsExecutor.executeScript(\"arguments[0].click();\", parentDropdown);\r\n\t\tThread.sleep(3000);\r\n\t\tparentDropdown.sendKeys(expectedElement);\r\n\t\tThread.sleep(3000);\r\n\t\t\r\n\t\t//wait cho cac element load successfully\r\n\t waitExplicit.until(ExpectedConditions.presenceOfAllElementsLocatedBy(By.xpath(allItemsLocator)));\r\n\t \r\n\t\t//define ra 1 list element de store lai all items duoc load ra\t\t\r\n\t\tList<WebElement> allItems=driver.findElements(By.xpath(allItemsLocator));\r\n\t\t\r\n\t\tfor(WebElement item:allItems) {\r\n\t\t\tif(item.getText().equals(expectedElement)) {\r\n\t\t\t\tjsExecutor.executeScript(\"arguments[0].scrollIntoView(true);\", item);\r\n\t\t\t\titem.click();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "public void selectItemInDropdown(By parentBy, By childBy, String expectedTextItem) {\n\t\texplicitWait.until(ExpectedConditions.elementToBeClickable(parentBy)).click();\n\n\t\t// 2 - Wait all elements which loading(in HTML page/DOM)\n\t\t// presence\n\t\texplicitWait.until(ExpectedConditions.presenceOfAllElementsLocatedBy(childBy));\n\n\t\t// Store all elements\n\t\tList<WebElement> allItems = driver.findElements(childBy);\n\n\t\tfor (WebElement item : allItems) {\n\t\t\tif (item.getText().trim().equals(expectedTextItem)) {\n\t\t\t\tif (item.isDisplayed()) { // 3 - If item need to select in view ( can see) => click\n\t\t\t\t\titem.click();\n\t\t\t\t} else { // 4 - If item need to select (can't see) => scroll down => click\n\t\t\t\t\tjsExecutor.executeScript(\"arguments[0].scrollIntoView(true)\", item);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\t}", "public String verifyDropDownListElementsInSorted(String object, String data) {\n\t\ttry {\n\n\t\t\tWebElement select = wait.until(explicitWaitForElement(By.xpath(OR.getProperty(object))));\n\t\t\tselect.click();\n\t\t\tboolean flag = false;\n\t\t\tList<WebElement> options = driver.findElements(By.xpath(OR.getProperty(object) + OR.getProperty(\"OPTION_TAG_DISPLAY\"))); // Modified By Karan\n\t\t\tList<String> actual_list = new ArrayList<String>();\n\t\t\tList<String> sortedlist = new ArrayList<String>();\n\t\t\tfor (int i = 0; i < options.size(); i++) {\n\t\t\t\tString name = options.get(i).getText();\n\t\t\t\tactual_list.add(name);\n\t\t\t\tsortedlist.add(name);\n\t\t\t}\n\t\t\tCollections.sort(sortedlist, String.CASE_INSENSITIVE_ORDER);\n\t\t\tlogger.debug(\"Actual List = \" + actual_list ); // Modified By Karan\n\t\t\tlogger.debug(\"Sorted List = \" + sortedlist );\t// Modified By Karan\n\t\t\tfor (int i = 0; i < sortedlist.size(); i++) {\n\t\t\t\tif (sortedlist.get(i).equals(actual_list.get(i))) {\n\t\t\t\t\tflag = true;\n\t\t\t\t} else {\n\t\t\t\t\tflag = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (flag)\n\t\t\t\treturn Constants.KEYWORD_PASS + \"--elements in drop down are in sorted order\";\n\t\t\telse\n\t\t\t\treturn Constants.KEYWORD_FAIL + \"--elements are not in sorted order\";\n\t\t} \n\t\tcatch(TimeoutException ex)\n\t\t\n\t\t{\n\t\t\treturn Constants.KEYWORD_FAIL +\"Cause: \"+ ex.getCause();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\n\t\t\treturn Constants.KEYWORD_FAIL + e.getLocalizedMessage();\n\t\t}\n\t}", "@FXML\n private void updateRegionOrder(ActionEvent event) {\n\n if (sortOrder == Order.REGION_ASC) {\n\n sortOrder = Order.REGION_DESC;\n\n } else if (sortOrder == Order.REGION_DESC) {\n\n sortOrder = Order.DEFAULT;\n\n } else {\n\n sortOrder = Order.REGION_ASC;\n\n }\n\n updateOrderButtons();\n\n }", "public void clickOnVehicleListSideBar() {\r\n\t\tsafeClick(groupListSideBar.replace(\"Group List\", \"Vehicle List\"), SHORTWAIT);\r\n\r\n\t}", "public void searchProduct(String product){\n driver.findElement(By.id(\"search_query_top\")).sendKeys(product);\n List<WebElement> options = driver.findElements(By.className(\"ac_results\"));\n for(WebElement option:options){\n if(option.getText().equalsIgnoreCase(\"printed dress\")){\n option.click();\n break;\n }\n }\n driver.findElement(By.name(\"submit_search\")).click();\n }", "public void selectDropdownValueFromDropdownHeaderTopupMenu(String strDropdownValue) {\r\n\t\tBy locator = By.xpath(\"//ul[@class='dropdown-menu']/li/a[text()='\" + strDropdownValue + \"']\");\r\n\t\tdriver.findElement(locator).click();\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()){\n case R.id.sort_by_popular:\n gridData = new ArrayList<>();\n requestMoviesBy(\"popular\");\n return true;\n case R.id.sort_by_average:\n gridData = new ArrayList<>();\n requestMoviesBy(\"top_rated\");\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Test (priority = 1)\n public void sortAlphabetical(){\n\n for (int i = 0; i < allDepartments.getOptions().size()-1; i++) {\n String current = allDepartments.getOptions().get(i).getText();\n String next = allDepartments.getOptions().get(i+1).getText();\n\n System.out.println(\"comparing: \" + current + \" with \"+ next);\n\n Assert.assertTrue(current.compareTo(next)<=0);\n\n }\n }", "public static void main(String[] args) {\n WebDriverManager.chromedriver().setup();\n WebDriver driver = new ChromeDriver();\n\n //2. go to https://amazon.com\n driver.get(\"http:amazon.com\");\n // driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);\n\n\n //3. Verify the All departments is selected by default\n\n String expectedText=\"All Departments\";\n WebElement selected=driver.findElement(By.id(\"searchDropdownBox\"));\n String selectedText=selected.findElements(By.xpath(\"//option[@selected='selected']\")).get(0).getText();\n\n if (expectedText.equals(selectedText)){\n System.out.println(\"PASS\");\n }else{\n System.out.println(\"FAIL\");\n System.out.println(\"Expected: \"+expectedText);\n System.out.println(\"Actual: \"+selectedText);\n }\n\n\n //4. verify that all options are sorted alphabetically\n\n\n //allOptions.add(driver.findElement(By.xpath(\"//select/[*]\")));\n WebElement dropdown = driver.findElement(By.id(\"searchDropdownBox\"));\n List<WebElement> allOptions= dropdown.findElements(By.tagName(\"option\"));\n String [] links=new String [allOptions.size()];\n\n for (int i=1, a=0; i<=allOptions.size()&& a<allOptions.size(); i++, a++){\n\n\n links [a]=((driver.findElement(By.xpath(\"//select/*[\"+i+\"]\")).getText()));\n\n }\n\n for (int i=0; i<links.length;i++){\n for (int j=0; j<links[i].length(); j++) {\n if (links[i].charAt(j) == ' ') {\n links[i]= links[i].replace(\" \", \"\");\n }\n }\n }\n\n\n\n char z=' ';\n for (int i=0; i<links.length-1; i++) {\n if((!(links[i].toLowerCase().equals(\"women\") ||links[i].toLowerCase().equals(\"men\")||links[i].toLowerCase().equals(\"girls\") ||links[i].toLowerCase().equals(\"boys\")||links[i].toLowerCase().equals(\"baby\") )))\n {\n if (links[i].toLowerCase().charAt(0) <= links[i + 1].toLowerCase().charAt(0))\n {\n continue;\n }\n else\n {\n System.out.println(\"Dropdown menu is not sorted\");\n z ='n';\n break;\n }\n }\n else\n {\n continue;\n }\n }\n\n if (z!='n'){\n System.out.println(\"Dropdown menu is sorted\");\n }\n\n\n //5.Click on the menu icon on the left\n\n WebElement menu=driver.findElement(By.id(\"nav-hamburger-menu\"));\n menu.click();\n\n //6.click on Full Store directory\n driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);\n WebElement fullStore0=driver.findElement(By.partialLinkText(\"Full Store\"));\n fullStore0.click();\n\n\n\n\n\n\n }", "public void category1() {\r\n\t\tmySelect1.click();\r\n\t}", "@Override\n\tpublic void eventSelectOrder() {\n\t\t\n\t}", "@Override\n public void onClick(View v) {\n int adapterPosition = getAdapterPosition();\n // String weatherForDay = dir.getTitle();\n mClickHandler.onClick(dirItems.get(adapterPosition));\n }", "@Override\r\n public boolean onOptionsItemSelected(@NonNull MenuItem item) {\r\n if (permissionHelper.hasStoragePermission()) {\r\n int itemId = item.getItemId();\r\n\r\n switch (itemId) {\r\n case R.id.visits_desc:\r\n case R.id.visits_asc:\r\n switchSortMode(itemId);\r\n break;\r\n }\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tplays.removeAll(plays);\n\t\t\t\tOperation.sort(sortBox.getSelectedIndex(), halls, plays);\n\t\t\t\tfilmTable.updateUI();\n\t\t\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tlistener.clickDisplaylistMethod(position, item.getCategory()\n\t\t\t\t\t\t.getArrCookMethods());\n\t\t\t}", "public void onClick(DialogInterface dialog, int whichButton) {\n int spinnerPosition = spinner1.getSelectedItemPosition();\n setStringPreference(KEY_SORT_FIELD, getResources()\n .getStringArray(R.array.pref_sort_field_values)[spinnerPosition]);\n\n // Update data\n prepareData();\n }", "public static void dropdownIndex(WebElement element, String value) {\n\t\ts = new Select(element);\n\t\tInteger index = Integer.valueOf(value);\n\t\ts.selectByIndex(index);\n\t}", "public static void selectDropDown(final String selectionType,\n\t\t\tfinal String objLocator, final String value, boolean trimFlg) {\n\t\tlogger.debug(\"Executing Test Step::\" + new Object() {\n\t\t}.getClass().getEnclosingMethod().getName());\n\n\t\tSelect select = new Select(getElementAfterLoaded(objLocator));\n\t\tList<WebElement> list = select.getOptions();\n\t\tboolean notFoundFlg = true;\n\t\tint index = 0;\n\t\tboolean condition;\n\t\tfor (int i = 0; i < list.size(); i++) {\n\t\t\tif (trimFlg) {\n\t\t\t\tcondition = list.get(i).getText().trim()\n\t\t\t\t\t\t.equalsIgnoreCase(value.trim());\n\t\t\t} else {\n\t\t\t\tcondition = list.get(i).getText().equalsIgnoreCase(value);\n\t\t\t}\n\t\t\tif (condition) {\n\t\t\t\tlogger.debug(list.get(i).getText() + \"=\" + value);\n\t\t\t\tnotFoundFlg = false;\n\t\t\t\tindex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (notFoundFlg) {\n\t\t\tAssert.fail(\"Given value [\" + value\n\t\t\t\t\t+ \"] is not available in the dropdown\");\n\t\t}\n\t\tif (selectionType.equals(GridpointConstants.DROPDOWN_BYINDEX)) {\n\t\t\tselect.selectByIndex(index);\n\t\t} else if (selectionType.equals(GridpointConstants.DROPDOWN_BYVALUE)) {\n\t\t\tselect.selectByValue(value);\n\t\t} else if (selectionType\n\t\t\t\t.equals(GridpointConstants.DROPDOWN_BYVISIBLETEXT)) {\n\t\t\tselect.selectByVisibleText(value);\n\t\t} else {\n\t\t\tlist.get(index).click();\n\t\t}\n\t}", "public void productSortView(String activeId) {\n try {\n do {\n System.out.println(EOL + \" ---------------------------------------------------\");\n System.out.println(\"| Product lists - Type one of the options below: |\");\n System.out.println(\"|---------------------------------------------------|\");\n System.out.println(\"| 1. View games - Sorted by Title (A-Z) |\");\n System.out.println(\"| 2. View games - Sorted by Rating (5-0) |\");\n System.out.println(\"|---------------------------------------------------|\");\n System.out.println(\"| 3. View albums - Sorted by Title (A-Z) |\");\n System.out.println(\"| 4. View albums - Sorted by Rating (5-0) |\");\n System.out.println(\"| 5. View albums - Sorted by Year (Latest first) |\");\n System.out.println(\"|---------------------------------------------------|\");\n System.out.println(\"| 6. Return to Previous Menu |\");\n System.out.println(\" ---------------------------------------------------\");\n\n String[]menuAcceptSet = new String[]{\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\",}; // Accepted responses for menu options\n String userInput = getInput.getMenuInput(\"menuOptionPrompt\", menuAcceptSet); // Calling Helper method\n switch (userInput.toLowerCase()) {\n case \"1\" -> dartController.productViews(\"game\", \"title\");\n case \"2\" -> dartController.productViews(\"game\", \"rating\");\n case \"3\" -> dartController.productViews(\"album\", \"title\");\n case \"4\" -> dartController.productViews(\"album\", \"rating\");\n case \"5\" -> dartController.productViews(\"album\", \"year\");\n case \"6\" -> {\n System.out.println(EOL);\n String userType = userController.getUserType(activeId);\n if (userType.equals(\"Employee\"))\n employeeMenu(activeId);\n else if (userType.equals(\"Customer\"))\n customerMenu(activeId);\n else {\n mainMenu();\n }\n }\n default -> printlnInterfaceLabels(\"menuOptionNoMatch\");\n }\n } while (session);\n } catch (Exception e) {\n printlnInterfaceLabels(\"errorExceptionMenu\", String.valueOf(e));\n }\n }", "void openMenuOptions(Gadget gadget, final Element referenceElement);", "private void sort()\n {\n pd = new ProgressDialog(this);\n pd.setMessage(\"Sorting movies...\");\n pd.setCancelable(false);\n pd.show();\n\n movieList.clear();\n if(show.equals(\"notWatched\"))\n watched(false);\n else if(show.equals(\"watched\"))\n watched(true);\n else movieList.addAll(baseMovieList);\n\n if(orderBy.equals(\"alphabet\"))\n sortAlphabet();\n else if(orderBy.equals(\"date\"))\n sortDate();\n else sortRating();\n\n if(orderType)\n Collections.reverse(movieList);\n\n recyclerView.setAdapter(movieAdapter);\n pd.dismiss();\n }", "public MazdaSpecialRestrictedPartsOrdering clickOnSpecialRestrictedPartsOrderingLink() {\n\t\tSpecialRestrictedPartsOrdering.click();\n\t\treturn this;\n\t\t}", "public void setSortNo(int sortNo) {\n this.sortNo = sortNo;\n }", "public static void main(String[] args) {\n\t\n\t\tChromeDriver driver = new ChromeDriver();\n\t\t//System.setProperty(\"webdriver.chrome.driver\", ./drivers/chromedriver.exe)\n\t\tdriver.get(\"http://jqueryui.com/sortable\");\n\t\tdriver.manage().window().maximize();\n\t\tdriver.switchTo().frame(0);\n\t\tWebElement item1 = driver.findElementByXPath(\"//li[text()='Item 1']\");\n\t\tWebElement item5 = driver.findElementByXPath(\"//li[text()='Item 4']\");\n\t\tint locationY = item5.getLocation().getY();\n\t\tSystem.out.println(locationY);\n\t\tActions builder = new Actions(driver);\n\t\tbuilder.dragAndDropBy(item1, 0, locationY).perform();\n\t\t\n\t\t\n\t}", "public void setSort(Integer sort) {\r\n this.sort = sort;\r\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tpulllist();\n\t\t\t}", "abstract void listSeleccionadas_mouseClicked(MouseEvent e);" ]
[ "0.6665057", "0.6496782", "0.6222668", "0.606957", "0.5813791", "0.58117664", "0.5809524", "0.5802735", "0.57497513", "0.5618689", "0.56020004", "0.55854744", "0.55177015", "0.5500331", "0.549265", "0.5480037", "0.5478687", "0.5459515", "0.5445628", "0.5427914", "0.54099846", "0.5395784", "0.5371936", "0.5368765", "0.5367961", "0.53605735", "0.53384805", "0.5317477", "0.5297696", "0.5295663", "0.5292471", "0.5283714", "0.5263759", "0.52421147", "0.5242007", "0.5239989", "0.5236363", "0.5226518", "0.52209926", "0.5210918", "0.52082175", "0.51762635", "0.5172859", "0.51602286", "0.5130839", "0.5129422", "0.5122968", "0.51186794", "0.5112579", "0.5090466", "0.50828654", "0.50795245", "0.5078802", "0.50732815", "0.50719446", "0.50709516", "0.50675666", "0.506366", "0.5060501", "0.5050534", "0.5040316", "0.5035317", "0.5030895", "0.50254834", "0.50209665", "0.5010405", "0.50095266", "0.50072414", "0.5004704", "0.500185", "0.5000474", "0.49973145", "0.4992726", "0.498364", "0.49726155", "0.4960988", "0.49595672", "0.49583182", "0.495355", "0.4940384", "0.49354425", "0.49254188", "0.49232915", "0.4911905", "0.49030033", "0.49024668", "0.48829827", "0.4870554", "0.48639497", "0.48638627", "0.48625663", "0.4859578", "0.48572597", "0.48569763", "0.4851933", "0.48514712", "0.4843981", "0.48387265", "0.48302066", "0.48171473" ]
0.6707382
0
/ Method puts listings elements into a collection. It then iterates through the collection and adds the property name to a collection of strings. Once the string collection is compiled a copy is made of it and the copy is sorted. The two collections are then compared and if they are the same the list is in alphabetical order.
public boolean sortByName() { listings = driver.findElements(By.xpath(listingsXpath)); listingsIterator = listings.iterator(); propertyNames = new ArrayList<String>(); listsEqual = false; WebElement propertyNameElement; String propertyName; while(listingsIterator.hasNext()) { listingElement = listingsIterator.next(); propertyNameElement = listingElement.findElement(By.cssSelector("h2")); propertyName = propertyNameElement.getText(); propertyNames.add(propertyName); } sortedPropertyNames = propertyNames; Collections.sort(sortedPropertyNames); if(propertyNames.equals(sortedPropertyNames)) { listsEqual = true; } return listsEqual; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void triCollection(){\r\n Collections.sort(collection);\r\n }", "public void sortElements(Comparator<TLProperty> comparator);", "public static void main(String[] args) {\n\n List<String> animals = new ArrayList <String>();\n\n animals.add(\"Elephatn\");\n animals.add(\"snake\");\n animals.add(\"Lion\");\n animals.add(\"Mongoose\");\n animals.add(\"Cat\");\n\n\n\n// Collections.sort(animals, new StringLengthComparator());\n// Collections.sort(animals, new AlphabeticalComparator());\n Collections.sort(animals, new ReverseAlphabeticalComparator());\n for(String animal:animals){\n System.out.println(animal);\n }\n\n//////////////Sorting Numbers ///////////\n List<Integer> numbers = new ArrayList <Integer>();\n\n numbers.add(54);\n numbers.add(1);\n numbers.add(36);\n numbers.add(73);\n numbers.add(9);\n\n Collections.sort(numbers, new Comparator <Integer>() {\n @Override\n public int compare(Integer num1, Integer num2) {\n return num1.compareTo(num2);\n }\n });\n\n for(Integer number: numbers){\n System.out.println(number);\n }\n\n\n///////////////Sorting Arbitrary objects////////\n\n\n List<Person> people = new ArrayList <Person>();\n\n people.add(new Person(1,\"Joe\"));\n people.add(new Person(5,\"Harry\"));\n people.add(new Person(2,\"Hermoine\"));\n people.add(new Person(4,\"Muffet\"));\n\n// Sort in order of ID\n Collections.sort(people, new Comparator <Person>() {\n @Override\n public int compare(Person p1, Person p2) {\n\n if(p1.getId()>p2.getId()){\n return 1;\n }else if(p1.getId()<p2.getId()){\n return -1;\n }\n return 0;\n\n }\n });\n\n\n // Sort in order of Name\n Collections.sort(people, new Comparator <Person>() {\n @Override\n public int compare(Person p1, Person p2) {\n\n return p1.getName().compareTo(p2.getName());\n\n\n }\n });\n\n for(Person person: people){\n System.out.println(person);\n\n }\n\n }", "public StringList createSorted() {\n StringList list = this.duplicate();\n list.sort();\n return list;\n }", "public void step1(){\n\n Collections.sort(names, new Comparator<String>() {\n @Override\n public int compare(String a, String b) {\n return b.compareTo(a);\n }\n });\n }", "public static List<String> sortStringList(List<String> toSort) {\n int elements = toSort.size();\n for (int i = (elements - 1); i > 0; i--) {\n for (int j = 0; j < i; j++) {\n if (toSort.get(j).compareTo(toSort.get(j + 1)) > 0) {\n String inter = toSort.get(j);\n toSort.set(j, toSort.get(j + 1));\n toSort.set(j + 1,inter);\n }\n }\n }\n return toSort;\n }", "ArrayList<String> orderedList(ArrayList<String> unOrderedList);", "public void listSortedByName(ArrayList<Pet> petList){\n System.out.println(\"Pets sorted by Name: \");\n for (Pet each: mySort.sortByName(petList)){\n System.out.println(each.getName());\n }\n System.out.println();\n }", "public static void main(String[] args) {\n List<String> list = new ArrayList<String>();\n list.add(\"sss\");\n list.add(\"uuu\");\n list.add(\"ccc\");\n // Collections.sort(list);\n System.out.println(list);\n }", "private ArrayList<String> getMotifsNamesSortedByMotifLength(MotifCollection collection) {\n ArrayList<String> list=collection.getAllMotifNames();\n MotifLengthComparator comparator=new MotifLengthComparator();\n Collections.sort(list, comparator);\n return list;\n }", "public void step4(){\n\n Collections.sort(names,(a,b)->b.compareTo(a));\n\n\n System.out.println(\"names sorted are :\"+names);\n }", "public void listSort() {\n\t\tCollections.sort(cd);\n\t}", "protected List buildSearchResultList(Collection searchResultsCollection, Long actualSize) {\n CollectionIncomplete results = new CollectionIncomplete(searchResultsCollection, actualSize);\n\n // Sort list if default sort column given\n List searchResults = results;\n List defaultSortColumns = getDefaultSortColumns();\n if (defaultSortColumns.size() > 0) {\n Collections.sort(results, new BeanPropertyComparator(defaultSortColumns, true));\n }\n return searchResults;\n }", "public void step3(){\n\n Collections.sort(names,(String a, String b) -> a.compareTo(b));\n }", "public static void main(String[] args) {\n ArrayList<String> aList = new ArrayList();\n ArrayList<Integer> numList = new ArrayList();\n aList.add(\"Ram\");//0\n aList.add(\"Shyam\");//1\n aList.add(\"hari\");//2\n aList.add(\"Sita\");//3\n aList.add(\"Ram\");//4\n //System.out.println(aList); //[Ram, Shyam, hari, Sita, Ram]\n// System.out.println(aList.get(1)); //Shyam\n // for(ClassType/VariableType variableName : objectName)\n System.out.println(\"before adding\"); \n System.out.println(aList);\n aList.add(3,\"Ravi\");\n System.out.println(\"after adding\"); \n System.out.println(aList);\n aList.remove(3);\n System.out.println(\"after removing\"); \n System.out.println(aList);\n Collections.sort(aList);\n System.out.println(\"after sorting\");\n System.out.println(aList);\n \n }", "public static void main(String[] args) {\n\r\n\t\tList<Library> list=new ArrayList<Library>();\r\n\t\tlist.add(new Library(100, \"bhagyesh\"));\r\n\t\tlist.add(new Library(4, \"patel\"));\r\n\t\tlist.add(new Library(5, \"sid\"));\r\n\t\tlist.add(new Library(78, \"naitik\"));\r\n\t\tlist.add(new Library(39, \"amit\"));\r\n\t\t\r\n \tlist.stream().forEach(p -> System.out.println(p.getName()));\r\n \tlist.sort(Comparator.comparing(Library::getName));\r\n \tlist.stream().forEach(p -> System.out.println(p.getName()));\r\n \r\n \t\r\n \t\r\n \t\r\n\t}", "public static String joinSorted(Collection elements)\n {\n if (elements == null || elements.isEmpty())\n return \"(none)\";\n \n List<String> list = CollectionFactory.newList();\n \n for (Object o : elements)\n list.add(String.valueOf(o));\n \n Collections.sort(list);\n \n return join(list);\n }", "public ArrayList<String> sortTags(Collection<String> tags) {\n // Transform set to list so can sort.\n ArrayList<String> list = new ArrayList<>(tags);\n\n // Sort alphabetically.\n Collections.sort(list);\n\n // Sort by length.\n Collections.sort(list, new Comparator<String>() {\n\n @Override\n public int compare(String x, String y) {\n\n int diff = x.length() - y.length();\n if (diff < 0) {\n return -1;\n } else if (diff == 0) {\n return 0;\n } else {\n return 1;\n }\n }\n });\n return list;\n }", "public static void main(String[] args) \r\n {\n ArrayList<String> al = new ArrayList<String>(); \r\n al.add(\"Geeks For Geeks\"); \r\n al.add(\"Friends\"); \r\n al.add(\"Dear\"); \r\n al.add(\"Is\"); \r\n al.add(\"Superb\"); \r\n \r\n /* Collections.sort method is sorting the \r\n elements of ArrayList in ascending order. */\r\n Collections.sort(al); \r\n \r\n // Let us print the sorted list \r\n System.out.println(\"List after the use of\"\r\n + \" Collection.sort() :\\n\" + al); \r\n }", "public static <T extends Comparable<T>> List<T> createSortedList(Collection<T> collection) {\n\t\tList<T> list = createList(collection);\n\t\tCollections.sort(list);\n\t\treturn list;\n\t}", "public static void main(String[] args) {\n\t\tList<String> animal = new ArrayList<String>();\n\n\t\tanimal.add(\"Cat\");\n\t\tanimal.add(\"Mouse\");\n\t\tanimal.add(\"Lion\");\n\t\tanimal.add(\"Zeebra\");\n\t\tanimal.add(\"Bear\");\n\t\tanimal.add(\"Deer\");\n\n\t\t// Collections.sort(animal,new StringLengthComparator());\n\n\t\tCollections.sort(animal, new ReverseAlphabeticalComparator());\n\t\tfor (String animal1 : animal) {\n\n\t\t\tSystem.out.println(animal1);\n\t\t}\n\n\t\t/////////////////////////////// Sorting Numbers ////////////////////////////////\n\t\tList<Integer> numbers = new ArrayList<Integer>();\n\n\t\tnumbers.add(5);\n\t\tnumbers.add(31);\n\t\tnumbers.add(16);\n\t\tnumbers.add(605);\n\t\tnumbers.add(15);\n\n\t\tCollections.sort(numbers, new Comparator<Integer>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(Integer num1, Integer num2) {\n\n\t\t\t\treturn -num1.compareTo(num2);\n\t\t\t}\n\n\t\t});\n\n\t\tfor (Integer num1 : numbers) {\n\n\t\t\tSystem.out.println(num1);\n\t\t}\n\t\t///////////////////////////// Sorting Arbitrary Objects ////////////////////////////\n\n\t\tList<Person> people = new ArrayList<Person>();\n\n\t\tpeople.add(new Person(3, \"Ajeer\"));\n\t\tpeople.add(new Person(1, \"Sudeer\"));\n\t\tpeople.add(new Person(2, \"Sureash\"));\n\t\tpeople.add(new Person(4, \"Sam\"));\n\t\t\n\t\t// Sort in Order of ID\n\t\tCollections.sort(people, new Comparator<Person>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(Person p1, Person p2) {\n\t\t\t\tif (p1.getId() > p2.getId()) {\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\telse if (p1.getId()< p2.getId()) {\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t});\n\t\tfor (Person person1 : people) {\n\n\t\t\tSystem.out.println(person1);\n\t\t}\n\t\tSystem.out.println(\"\\n\");\n\t\t// Sort In Order of NAME....\n\t\tCollections.sort(people, new Comparator<Person>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(Person p1, Person p2) {\n\t\t\t\n\t\t\t\treturn p1.getName().compareTo(p2.getName());\n\t\t\t}\n\t\t});\n\t\tfor (Person person1 : people) {\n\n\t\t\tSystem.out.println(person1);\n\t\t}\n\t}", "public ArrayList<String> combineLists(Set<String> hs){\t\n\t\tArrayList<String> newList = new ArrayList<String>(hs);\n\t\tString[] tempString = newList.toArray(new String[newList.size()]);\n\t\tint[] tempInt = new int[tempString.length];\n\t\tfor(int i = 0; i < tempInt.length; i++){\n\t\t\ttempInt[i] = Integer.parseInt(tempString[i]);\n\t\t}\n\t\tArrays.sort(tempInt);\n\t\tnewList.clear();\n\t\tfor(int i = 0; i < tempInt.length; i++){\n\t\t\tnewList.add(String.valueOf(tempInt[i]));\n\t\t}\n\t\treturn newList;\n\t}", "public static ArrayList<Member> sortByName(ArrayList<Member> s){\r\n\t\tArrayList<Member> output = new ArrayList<Member>();\r\n\t\twhile(s.size()>0) {\r\n\t\t\tint minNo=0;\r\n\t\t\tString min=s.get(0).getName();\r\n\t\t\tfor(int i=0;i<s.size();i++) {\r\n\t\t\t\tif(Member.nameSmaller(s.get(i).getName(), min)) {\t\t\t\t\t\r\n\t\t\t\t\tmin=s.get(i).getName();\r\n\t\t\t\t\tminNo=i;\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t\toutput.add(s.get(minNo));\r\n\t\t\ts.remove(s.get(minNo));\r\n\t\t}\r\n\t\treturn output;\r\n\t}", "static List<AccessibleObject> orderFieldsAndMethodsByDependency(List<AccessibleObject> unorderedList, Map<String, AccessibleObject> propertiesMap) {\n Stack<AccessibleObject> stack = new Stack<AccessibleObject>();\n // the result list \n List<AccessibleObject> orderedList = new LinkedList<AccessibleObject>();\n // add the elements from the unordered list to the ordered list \n // any dependencies will be checked and added first, in recursive manner \n for (int i = 0; i < unorderedList.size(); i++) {\n AccessibleObject obj = unorderedList.get(i);\n addPropertyToDependencyList(orderedList, propertiesMap, stack, obj);\n }\n return orderedList;\n}", "public void insertionStringSort()\n {\n\t for(int j=1; j<AL.size(); j++)\n\t {\n\t\t Generics temp = AL.get(j);\n\t\t int possibleIndex = j;\n\t\t \n\t\t while(possibleIndex>0 && AL.get(possibleIndex - 1).toString().compareTo(temp.toString())>0)\n\t\t {\n\t\t\t AL.set(possibleIndex, AL.get(possibleIndex -1));\n\t\t\t possibleIndex--;\n\t\t\t \n\t\t }\n\t\t \n\t\t AL.set(possibleIndex, temp);\n\t }\n \n }", "public static void init(){\n java.util.Collection<String> collection = new ArrayList<>();\n\n // List Implementation\n // use for ordered collection with duplicates\n // Items can be retrieved and inserted at specific positions (like array)\n //\n // ArrayList:\n // Grows automatically, lookup constant time, add/remove slower\n //\n // LinkedList:\n // Implements List and Queue, add/remove/access at start/end constant time\n // arbitrary index linear time, good if used like queue\n //\n // Vector:\n // Old class before ArrayList, same as ArrayList just slower but thread-safe, not really used\n //\n // Stack:\n // Add/remove from top of stack, extends Vector, not really used, instead ArrayDeque is used\n \n // Common List Methods\n // boolean add(E) | void add(int, E) | E get(int) | void remove(int) | E set(int, E)\n // int indexOf(Object) | int lastIndexOf(Object) - both return -1 if not found\n List<String> list = (List<String>) collection;\n\n // Loop through Collections\n // Old way without generic -> needs casting\n Iterator<String> iter = collection.iterator();\n while(iter.hasNext()){\n System.out.println(iter.next());\n }\n\n // Set Implementation\n // Stores in hash table using hashCode(), add/check constant time\n //\n // HashSet:\n // Groups elements inside buckets if same hashCode\n //\n // TreeSet:\n // In sorted tree structure, always in sorted order, add/check O(log n), implements NavigableSet\n // Looping through will print out in natural order\n\n // No new set methods but collection methods is different for sets (add() can return false)\n //\n // NavigableSet Interface:\n // E lower(E) - return greatest element < e, or null if no such element\n // E floor(E) - return greatest element <= e, ...\n // E ceiling(E) - return smallest element >= e, ...\n // E higher(E) - return smallest element > e, ...\n\n // Queue Implementation\n // Elements added/removed in specific order\n //\n // LinkedList:\n // Double-ended queue, implements List and Queue, not as efficient, has indexes\n //\n // ArrayDeque:\n // ‘pure’ double-ended queue, resizable array, more efficient\n\n // Common Queue Methods\n // Examine and Remove always head of queue\n // Insert always at end of queue\n //\n // Throws exception on failure\n // boolean add(E) | E element() | E remove()\n //\n // Returns special value (null) on failure\n // boolean offer(E) | E peek() | E poll();\n\n // Common ArrayDeque Methods\n // void push(E) | E pop() - throws exception when Empty\n\t\t//\t\tpop() and poll() return same values\n\t\t//\t\tpush() + pop/poll() = stack\n\t\t//\t\toffer() + pop/poll() = queue\n //\n // LinkedList like ArrayDeque\n\n // Map Implementation: (not implementing Collection)\n // Identify values by key\n //\n // HashMap:\n // Keys in hash table using hashCode(), add/retrieve constant time\n //\n // LinkedHashMap:\n // same as HashMap only with an order\n //\n // TreeMap:\n // Keys in sorted tree structure, always sorted, add/check O(log n)\n //\n // Hashtable:\n // Like Vector, old and thread-safe, newer version: HashMap\n\n // Common Map Methods, does not have Collection methods\n // void clear() | boolean isEmpty() | int size()\n //\n // V get(Object) return value mapped by key or null if none\n // V put(K, V) add or replace key/value pair, return previous value or null if none\n // V remove(Object) removes and return value mapped by key, null if none\n //\n // boolean containsKey(Object) | boolean containsValue(Object)\n // Set<K> keySet() | Collection<V> values()\n //\n // V merge(K, V, BiFunction<? super V, ? super V, ? extends V>) - BiFunction decides which value saved to key\n // If key does not exists or value == null -> new value will always be used, BiFunction not called\n // If BiFunction return null -> key will be removed from map\n\n // Sorted Type cannot contain null.\n // TreeMap no null keys, TreeSet no null values\n //\n // ArrayDeque no null values. Null values has special meaning\n // Hashtable no null values and keys. Just because. Too old.\n //\n // Else throws NullPointerException\n\n /* Searching and Sorting */\n List<Comparing> cList = new ArrayList<>();\n\n // If no Comparator specified, List type has to implement Comparable\n // else compiler error\n Collections.sort(cList);\n Collections.sort(cList, new Comparator<Comparing>() {\n public int compare(Comparing t1, Comparing t2){ return 0; }\n });\n\n // Same as sorting\n // Warning: unsorted list results in undefined values\n Collections.binarySearch(cList, new Comparing());\n Collections.binarySearch(cList, new Comparing(), new Comparator<Comparing>() {\n public int compare(Comparing t1, Comparing t2){ return 0; }\n });\n\n // Same applies to sorted collections like: TreeSet, TreeMap\n // Comparator can be passed to constructor\n Set<Comparing> tSet = new TreeSet<>(new Comparator<Comparing>() {\n public int compare(Comparing t1, Comparing t2){ return 0; }\n });\n\n // Throw ClassCastException when adding class that is not implementing Comparable\n tSet.add(new Comparing());\n }", "public void step2(){\n\n Collections.sort(names,(String a,String b) -> {\n return a.compareTo(b);\n });\n }", "private static ArrayList<String> sortArrayList(ArrayList<String> strings) {\n\n Collections.sort(strings, new StringLengthComparator());\n return strings;\n\n }", "public void sortManlist(){\r\n\t\tCollections.sort(Manlist, new MySort());\r\n\t}", "@Override\n public LinkedList<String> orderAlphabetically(){\n LinkedList<String> stringLL = super.orderAlphabetically();\n stringLL.add(\"Years Until Tenure: \" + m_yearsUntilTenure);\n Collections.sort(stringLL);\n return stringLL;\n }", "private Collection<Object> getOrderedTestNamesByOrderingFacility(String labCLIAid)\n{\n ArrayList<Object> dtList = null;\n if(cachedFacilityList != null)\n dtList = (ArrayList<Object> )cachedFacilityList.get(labCLIAid);\n return dtList;\n\n }", "void sortName()\r\n\t{\r\n\t\tCollections.sort(this, this.ContactNameComparator);\r\n\t}", "void comparatorSort() {\n Collections.sort(vendor, Vendor.sizeVendor); // calling collection sort method and passing list and comparator variables\r\n for (HDTV item : vendor) { //looping arraylist\r\n System.out.println(\"Brand: \" + item.brandname + \" Size: \" + item.size);\r\n }\r\n }", "@Test\n public void testAddAll_int_Collection_Order() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(3);\n instance.add(2);\n\n Collection c = Arrays.asList(1, 2, 3);\n instance.addAll(1, c);\n\n List expResult = Arrays.asList(3, 1, 2, 3, 2);\n\n for (int i = 0; i < expResult.size(); i++) {\n assertEquals(expResult.get(i), instance.get(i));\n }\n }", "public static void main(String[] args) {\n Set<String> list = new TreeSet<>();\n list.add(\"Song\");\n list.add(\"Album\");\n list.add(\"Artist\");\n list.add(\"Year\");\n list.add(\"Genre\");\n list.add(\"Song\");\n list.add(\"Song\");\n\n System.out.println();\n for(String x : list){\n System.out.println(x);\n }\n\n //NO REPITTED VALUES AND ASCENDED ORDER WHIT COMPARABLE, HASHCODE AND EQUALS\n Set<Persona> list2 = new TreeSet<>();\n list2.add(new Persona(1, \"Rayman\"));\n list2.add(new Persona(2, \"Castlevania\"));\n list2.add(new Persona(3, \"Silent Hill\"));\n list2.add(new Persona(4, \"Silent Hill\"));\n list2.add(new Persona(1, \"Rayman\"));\n\n System.out.println();\n for(Persona x : list2){\n System.out.println(x.getId() + \" - \" + x.getName());\n }\n }", "public void sortStringArray() {\n\t\tSystem.out.println(\"PROPERY BELONGS TO ONLY CHILD CLASS!!\");\n\t}", "private ArrayList<String> postOrder()\n\t{\n\t\tArrayList<String> rlist = new ArrayList<String>();\n\t\tpostOrder(this,rlist);\n\t\treturn rlist;\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 }", "private void sortResults(List<String> results) {\r\n\t\tif (comparator == null) {\r\n\t\t\tCollections.sort(results);\r\n\t\t} else {\r\n\t\t\tCollections.sort(results, comparator);\r\n\t\t}\r\n\t}", "public void sort(){\n Collections.sort(list, new SortBySpecies());\n }", "public abstract List toNameValueList();", "private Collection<Object> getOrderedTestNamesByOrderingFacilityAndTest(String\n orderingFacility, String orderedTest) {\n\n ArrayList<Object> dtList = null;\n ArrayList<Object> returnList = null;\n if(cachedFacilityList != null)\n {\n dtList = (ArrayList<Object> ) cachedFacilityList.get(orderingFacility);\n if(dtList != null)\n {\n Iterator<Object> it = dtList.iterator();\n SRTLabTestDT srtLabTestDT = null;\n\n while (it.hasNext()) {\n srtLabTestDT = (SRTLabTestDT) it.next();\n if ( (srtLabTestDT.getLabTestCd()).equalsIgnoreCase(orderedTest)) {\n returnList = new ArrayList<Object> ();\n returnList.add(srtLabTestDT);\n break;\n }\n }\n }\n }\n return returnList;\n }", "public ArrayList<String> sort (ArrayList<String> names) {\n Collections.sort(names);\n // return Arraylist\n return names;\n }", "public static void oldTest1()\r\n\t{\n\t\tArrayList personlist = new ArrayList();\r\n\t\tpersonlist.add(new Person(\"one\"));\r\n\t\tpersonlist.add(new Person(\"two\"));\r\n\t\tpersonlist.add(new Person(\"three\"));\r\n\t\tpersonlist.add(new Worker(\"oneA\", \"job1\"));\r\n\t\tpersonlist.add(new Worker(\"oneA\", \"job2\"));\r\n\t\tPrintCollection1(personlist);\r\n\t\tPrintCollection(personlist);\r\n\t}", "public static void main(String[] args) {\n\n Person person1 = new Person(\"Tom Brady\");\n Person person2 = new Person(\"David Letterman\");\n\n List<Person> personList = new ArrayList<Person>();\n personList.add(person1);\n personList.add(person2);\n\n // Sorting\n // Collections.sort(personList, new PersonComparer());\n // Collections.sort(personList, (o1, o2) -> o1.getName().compareTo(o2.getName()));\n personList.sort((o1, o2) -> o1.getName().compareTo(o2.getName()));\n\n // Print out the people!\n for (Person p : personList)\n {\n System.out.println(p.getName());\n }\n\n }", "private void sortTravelContactsByName() {\n Collections.sort(this.contacts, new Comparator<User>(){\n public int compare(User obj1, User obj2) {\n // ## Ascending order\n return obj1.getSortingStringName().compareToIgnoreCase(obj2.getSortingStringName());\n }\n });\n }", "public static void main(String[] args) {\n\t\tList<String> alist = new ArrayList<>();\n\t\talist.add(\"Virat\");\n\t\talist.add(\"ganesh\");\n\t\talist.add(\"Amol\");\n\t\talist.add(\"Ritesh\");\n\t\talist.add(\"deva\");\n\t\talist.add(\"sachin\");\n\t\talist.add(\"Xavier\");\n\t\t\n\t\tSystem.out.println(\"Arraylist before sorting: \");\n\t\tSystem.out.println(alist);\n\t\t\n\t\t//Collections.sort(alist);\n\t\tCollections.sort(alist,String.CASE_INSENSITIVE_ORDER);\n\t\t\n\t\tSystem.out.println(\"Arraylist after sorting: \");\n\t\tSystem.out.println(alist);\n\t\t\n\t\t\t\t\n\n\t}", "public static void main(String[] args) {\n\n\n\n\n ArrayList<String> names = new ArrayList<>();\n names.add(\"Tima\");\n names.add(\"Eldiar\");\n names.add(\"Beksultan\");\n names.add(\"Ilias\");\n names.add(\"Nurkan\");\n names.add(\"Alisher\");\n names.add(\"Tima\");\n String name = \"Tima\";\n int count = 0;\n\n for (String firstName : names) {\n if (firstName.equals(name)) {\n count++;\n }\n }\n System.out.println(count);\n\n String[] ar=names.toArray(new String[0]);\n\n\n\n System.out.println(names.get(0));\n System.out.println(\"============\");\n\n ArrayList<String> copy = (ArrayList) names.clone();\n\n Collections.sort(copy);\n for (String copies : copy) {\n System.out.println(copies);\n\n }\n System.out.println(\"=============\");\n System.out.println(\"removing all the duplicates from the Arraylist\");\n Set<String> unique = new HashSet<>();\n for (String removingDuplicates : copy) {\n unique.add(removingDuplicates);\n\n }\n\n for (String uniq:unique){\n System.out.println(uniq);\n }\n\n Set<String> sorted=new TreeSet<>();\n for (String sorting:unique){\n sorted.add(sorting);\n }\n System.out.println(\"=============\");\n for (String alreadySorted:sorted){\n System.out.println(alreadySorted);\n }\n\n }", "public void sortProperties (ArrayList<Property> properties, String branchName) {\r\n\t\tsoldProperties.clear();\r\n\t\tnotSoldProperties.clear();\r\n\t\totherProperties.clear();\r\n \tint size = properties.size();\r\n \tfor (int i = 0; i < size; i++) {\r\n \t\tif (properties.get(i).getBranchName().equals(branchName)) {\r\n \t\t\tif (!properties.get(i).getSoldPrice().equals(\"\")) {\r\n \t\t\t\tsoldProperties.add(properties.get(i));\r\n \t\t\t}\r\n \t\t\telse {\r\n \t\t\t\tnotSoldProperties.add(properties.get(i));\r\n \t\t\t}\r\n \t\t}\r\n \t\telse {\r\n\t\t\t\totherProperties.add(properties.get(i));\r\n\t\t\t}\r\n \t}\r\n\t}", "public void sort() {\r\n\t\tCollections.sort(parts);\r\n\t}", "public void sort() {\r\n Collections.sort(this.list, this);\r\n }", "public static void main(String args[]) {\n Order ord1 = new Order(101, 203.34f, \"11/19/2017\", \"11/20/2017\", \"Sony\");\n Order ord2 = new Order(102, 439.49f, \"11/19/2017\", \"11/20/2017\",\"Hitachi\");\n Order ord3 = new Order(103, 611.31f,\"11/19/2017\", \"11/20/2017\", \"Philips\");\n\n //putting Objects into Collection to sort\n List<Order> orders = new ArrayList<Order>();\n orders.add(ord3);\n orders.add(ord1);\n orders.add(ord2);\n orders.add(ord3);\n orders.add(ord1);\n\n //printing unsorted collection\n System.out.println(\"Unsorted Collection : \" + orders);\n\n UniqueList( orders );\n //Sorting Order Object on natural order - ascending\n Collections.sort(orders);\n\n //printing sorted collection\n System.out.println(\"List of UNIQUE Order object sorted in natural order : \" + orders);\n\n // Sorting object in descending order in Java\n Collections.sort(orders, Collections.reverseOrder());\n System.out.println(\"List of object sorted in descending order : \" + orders);\n\n //Sorting object using Comparator in Java\n Collections.sort(orders, new Order.OrderByAmount());\n System.out.println(\"List of Order object sorted using Comparator - amount : \" + orders);\n\n // Comparator sorting Example - Sorting based on customer\n Collections.sort(orders, new Order.OrderByVendor());\n System.out.println(\"Collection of Orders sorted using Comparator - by vendor : \" + orders);\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 }", "private void sortAlphabet()\n {\n for(int i = 0; i < movieList.size(); i++){\n for(int j = 1; j < movieList.size() - i; j++)\n {\n Movie a = movieList.get(j-1);\n Movie b = movieList.get(j);\n int result = a.getTitle().compareTo(b.getTitle());\n if(result > 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n }\n }\n }", "@Test\n public void putAll() throws Exception {\n SortedSet<String> sortedNames = new TreeSet<>();\n sortedNames.add(\"Java\");\n sortedNames.add(\"SQL\");\n sortedNames.add(\"HTML\");\n sortedNames.add(\"CSS\");\n int counter = underTest.putAll(sortedNames);\n assert (counter == 4);\n }", "public static ArrayList<Pets> sortArrayList(ArrayList<Pets> input){\n\t\t// destination ArrayList\n\t\tArrayList<Pets> sortedPets = new ArrayList<Pets>();\n\t\t\n\t\t// for each element read from the input list, compare it to the values in the destination list\n\t\t// and insert it.\n\t\tfor (int inputIndex = 0; inputIndex < input.size(); inputIndex++){\n\t\t\tint addIndex = 0;\n\t\t\tfor (int spIndex = 0; spIndex < sortedPets.size(); spIndex++) {\n\t\t\t\tif (input.get(inputIndex).getId() > sortedPets.get(spIndex).getId()) {\n\t\t\t\t\taddIndex++;\n\t\t\t\t} \n\t\t\t}\n\t\t\tsortedPets.add(addIndex, input.get(inputIndex));\n\t\t}\n\t\treturn sortedPets;\n\t}", "public void sortToDo(){\n\t\tCollections.sort(allToDoLists);\n\t}", "public static Map<String, List<CommonName>> sortCommonNameSources(List<CommonName> names){\n \tString pattern = \"[^a-zA-Z0-9]\";\n \tCommonName prevName = null;\n \tMap<String, List<CommonName>> map = new Hashtable<String, List<CommonName>>();\n \tList<CommonName> list = new ArrayList<CommonName>();\n \t\n \t//made a copy of names, so sorting doesn't effect original list order ....\n \tList<CommonName> newArrayList = (List<CommonName>)((ArrayList<CommonName>)names).clone();\n \tCollections.sort(newArrayList, new Comparator<CommonName>(){\n \t@Override\n public int compare(CommonName o1, CommonName o2) {\n \t\tint i = -1;\n \t\ttry{\n \t\t\ti = o1.getNameString().trim().compareToIgnoreCase(o2.getNameString().trim());\n \t\t}\n \t\tcatch(Exception e){\n \t\t\tlogger.error(e);\n \t\t}\n \t\treturn i;\n \t}\n \t});\n \tIterator<CommonName> it = newArrayList.iterator();\n \tif(it.hasNext()){\n \t\tprevName = it.next();\n \t\tlist.add(prevName);\n \t}\n \t\n \t// group the name with infosource, compare the name with alphabet & number only.\n \twhile(it.hasNext()){\n \t\tCommonName curName = it.next();\n \t\tif(prevName.getNameString().trim().replaceAll(pattern, \"\").equalsIgnoreCase(\n \t\t\t\tcurName.getNameString().trim().replaceAll(pattern, \"\"))){\n \t\t\tlist.add(curName);\n \t\t}\n \t\telse{\n \t\t\tmap.put(prevName.getNameString().trim(), list);\n \t\t\t\n \t\t\tlist = new ArrayList<CommonName>();\n \t\t\tlist.add(curName);\n \t\t\tprevName = curName;\n \t\t}\n \t}\n \tif(prevName != null){\n \t\tmap.put(prevName.getNameString().trim(), list);\n \t}\n \treturn map;\n }", "public static void sortBeans(List<?> beanList, String propertyToSortWith) {\n\t\t// null check against the given bean List\n\t\tif (beanList != null)\n\t\t{\n\t\t\t// create a comparator\n\t\t\tComparator<Object> propertyToCompareComparator = new BeanComparator<Object>(propertyToSortWith);\n\t\t\t// sort the beans according to the given properties value\n\t\t\tCollections.sort(beanList, propertyToCompareComparator);\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tList<Integer> numbers = List.of(10,1, 2, 3, 3, 4, 4, 5, 6, 7, 8, 9);\n\t\tList<String> courses = List.of(\"Spring\", \"Spring Boot\", \"API\" , \"Microservices\",\"AWS\", \"PCF\",\"Azure\", \"Docker\", \"Kubernetes\");\n\n//01 distinct numbers in stream\t\t\n\t\tnumbers.stream().distinct()\n\t\t .forEach(System.out::println);\n\t\t System.out.println(\"---------------------------------------\");\n\n//02 sorted\n\t\tnumbers.stream().sorted()\n .forEach(System.out::println);\n\t\t System.out.println(\"---------------------------------------\");\n\t\t\n//03 sort Strings-- by default is natural order\t\t\n\t\tcourses.stream().sorted()\n .forEach(System.out::println);\n\t\t System.out.println(\"---------------------------------------\");\n\n//04 sort Strings- user Comparator--- sort(Comparator)\n\t/*Comparators can be passed to a sort method (such as Collections.\n\t * sort or Arrays.sort) to allow precise control over the sort order. \n\t */\t\n\t \tcourses.stream().sorted(Comparator.naturalOrder())\n\t .forEach(System.out::println);\n\t \t System.out.println(\"---------------------------------------\");\n\t \t\n//05 Comparator calss -Sort string reverse order \n\t \tcourses.stream().sorted(Comparator.reverseOrder())\n .forEach(System.out::println);\n\t \t System.out.println(\"---------------------------------------\");\n\t \t\n//06 Comparator(lambda)-Sort String- based on string length\n\t \t//05 Sort string reverse order \n\t \tcourses.stream().sorted(Comparator.comparing(x->x.length())).forEach(System.out::println);\n\t \t System.out.println(\"---------------------------------------\");\n\n//07 sort string - based on last char\t \t\n\t\tcourses.stream().\n\t\tsorted((str1, str2) -> \n\t\tCharacter.compare(str1.charAt(str1.length() - 1),str2.charAt(str2.length() - 1)))\n . forEach(System.out::println);\n\t\t System.out.println(\"---------------------------------------\");\n\t\n//08 sort Book list based on year of release\n\t\tBook book=new Book();\n\t\t Book.bookList.stream()\n\t\t\t\t .sorted(Comparator.comparingLong(Book::getReleaseYear)).forEach(System.out::println);\n\t\t \n\t\t // .sorted((o1, o2) -> (o1 - o2.getSalary())).collect(Collectors.toList());\n\t\t //.out.println(bookSortedList1);\n\t\t System.out.println(\"---------------------------------------\");\n\t\t \n\t\t \n //08 sort Book list based on year of release\n\t\t \n\t\t Book.bookList.stream()\n\t\t\t\t .sorted((o1, o2) -> (o1.getReleaseYear() - o2.getReleaseYear())).forEach(System.out::println); \n\n\t\t \n//Reversed order\n\t\t\t Comparator<Book> comparator_reversed_order = Comparator.comparingLong(Book::getReleaseYear).reversed();\n\t\t\tBook.bookList.stream()\n\t\t\t\t\t .sorted(comparator_reversed_order).forEach(System.out::println); \n//\t\tBook book=new Book();\n\t\t\t Book.bookList.stream()\n\t\t\t\t .sorted(Comparator.comparingLong(Book::getReleaseYear)).forEach(System.out::println);\n\t\n//\tIf this Comparator considers two elements equal, i.e. compare(a, b) == 0, other is used to determine the order. \n//comparator1.thenComparing(comparator2)\n\t\t\t \n\t}", "public CaseInsensitiveElementList(Collection<Element<String, V>> collection) {\n this(collection, null);\n }", "private static void sortingArrayList() {\n Collections.sort(allMapData, new Comparator<MapDataModel>() {\n public int compare(MapDataModel d1, MapDataModel d2) {\n return valueOf(d1.getDateTime().compareTo(d2.getDateTime()));\n }\n });\n }", "static void AddCollections()\n\t{\n\t\tSet<String> oSet1 = null;\n\t\tSet<String> oSet2 = null;\n\t\ttry {\n\t\t\toSet1 = new TreeSet<String>();\n\t\t\toSet1.add(\"Apple\");\n\t\t\toSet1.add(\"Boy\");\n\t\t\toSet1.add(\"Cat\");\n\t\t\tSystem.out.println(oSet1);\n\t\t\t\n\t\t\toSet2 = new TreeSet<String>();\n\t\t\toSet2.add(\"Dog\");\n\t\t\toSet2.add(\"Arrow\");\n\t\t\toSet2.add(\"Frog\");\n\t\t\tSystem.out.println(oSet2);\n\t\t\t\n\t\t\toSet1.addAll(oSet2);\n\t\t\tSystem.out.println(oSet1);\n\t\t}catch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\tfinally {\n\t\t\toSet1 = null;\n\t\t\toSet2 = null;\n\t\t}\n\t}", "public ArrayList<String> getMusicName_ () {\n\n /*\n ArrayList<String> musicList = new ArrayList<>();\n Collections.sort(musicName);\n\n for (String item : musicName) {\n musicList.add(item);\n }\n return musicList;\n * */\n\n return musicName;\n\n }", "private ArrayList<String> sort(HashMap<String, Double> input){\n\n //initiate new array list from existing keys\n ArrayList<String> sortedCats = new ArrayList<>(input.keySet());\n\n //size of array list\n int n = sortedCats.size();\n\n //placeholder to replace category\n String temp;\n\n //bubble sort algorithm\n for(int i = 0; i < n; i++){\n for(int j = 1; j < (n-i); j++){\n if(input.get(sortedCats.get(j-1)) < input.get(sortedCats.get(j))){\n //swap elements\n temp = sortedCats.get(j-1);\n sortedCats.remove(j-1);\n sortedCats.add(j, temp);\n }\n }\n }\n return sortedCats;\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 }", "private static final List<Fooable> sortFooables(\n \t\t\tMap<Fooable, Integer> fooPairs) {\n \t\t// Create a list of Map.Entries based on the input Map\n \t\tList<Map.Entry<Fooable, Integer>> pairList = new ArrayList<>();\n \t\tpairList.addAll(fooPairs.entrySet());\n \n \t\t// Sort the list of Map.Entries containing Fooables and Levenshtein\n \t\t// Distances\n \t\tCollections.sort(pairList,\n \t\t\t\tnew Comparator<Map.Entry<Fooable, Integer>>() {\n \t\t\t\t\t@Override\n \t\t\t\t\tpublic int compare(Entry<Fooable, Integer> o1,\n \t\t\t\t\t\t\tEntry<Fooable, Integer> o2) {\n \t\t\t\t\t\t// Initially sort by Levenshtein Distance\n \t\t\t\t\t\tif (o1.getValue() < o2.getValue())\n \t\t\t\t\t\t\treturn -1;\n \n \t\t\t\t\t\tif (o1.getValue() > o2.getValue())\n \t\t\t\t\t\t\treturn 1;\n \n \t\t\t\t\t\t// Fallback sorting on String comparison\n \t\t\t\t\t\treturn o1.getKey().getName()\n \t\t\t\t\t\t\t\t.compareToIgnoreCase(o2.getKey().getName());\n \t\t\t\t\t}\n \t\t\t\t});\n \n \t\t// Construct a sorted list of Fooables\n \t\tList<Fooable> sortedList = new ArrayList<>();\n \t\tfor (Map.Entry<Fooable, Integer> pair : pairList) {\n \t\t\tsortedList.add(pair.getKey());\n \t\t}\n \n \t\treturn sortedList;\n \t}", "void topologicalSort() {\n\n\t\tfor (SimpleVertex vertice : allvertices) {\n\n\t\t\tif (vertice.isVisited == false) {\n\t\t\t\tlistset.add(vertice.Vertexname);\n\t\t\t\ttopologicalSortUtil(vertice);\n\n\t\t\t}\n\t\t}\n\n\t}", "Stream<String> listCollectionNames();", "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 }", "private List<Criterion> _sortCriterionList()\n {\n Collections.sort(_criterionList, _groupNameComparator);\n Collections.sort(_criterionList, _fieldOrderComparator);\n for(int count = 0 ; count < _criterionList.size() ; count++)\n {\n ((DemoAttributeCriterion)_criterionList.get(count)).setOrderDirty(false);\n }\n return _criterionList;\n }", "private void orderList() {\n Iterator<PlanarShape> sort = unorderedList.iterator();\n\n while(sort.hasNext()) {\n orderedList.insertInOrder(sort.next());\n }\n }", "@Test (priority = 1)\n public void sortAlphabetical(){\n\n for (int i = 0; i < allDepartments.getOptions().size()-1; i++) {\n String current = allDepartments.getOptions().get(i).getText();\n String next = allDepartments.getOptions().get(i+1).getText();\n\n System.out.println(\"comparing: \" + current + \" with \"+ next);\n\n Assert.assertTrue(current.compareTo(next)<=0);\n\n }\n }", "public SortListByNamesTest(ArrayList<String> expectedOrderOfNames, ArrayList<String> inputOrderOfNames) {\n\t\tsuper();\n\t\tthis.expectedOrderOfNames = expectedOrderOfNames;\n\t\tthis.inputOrderOfNames = inputOrderOfNames;\n\n\t}", "@SuppressWarnings(\"unchecked\")\n public C entriesListIsSortedAscBy(String field)\n {\n List<Model> modelEntries = modelCollection.getEntries();\n List<String> fieldValues = new ArrayList<String>();\n for(Model m: modelEntries)\n {\n Object model = loadModel(m);\n String fieldValue = \"\";\n try {\n fieldValue = BeanUtils.getProperty(model, field);\n fieldValues.add(fieldValue);\n }\n catch (Exception e)\n {\n // nothing to do\n }\n }\n Assert.assertTrue(Ordering.natural().isOrdered(fieldValues), String.format(\"Entries are not ordered ASC by %s\", field));\n return (C) modelCollection;\n }", "public void stringSelectionSort() {\n int nextMin;\n\n for (int i = 0; i < StringList.length - 1; i++) {\n nextMin = i;\n for (int j = i + 1; j < StringList.length; j++) {\n if (StringList[j].compareTo(StringList[nextMin]) < 0)\n nextMin = j;\n }\n if (nextMin != i)\n swapSelectionStrings(StringList, i, nextMin);\n }\n }", "String convertToSortProperty(String sortParameter) throws ValidationFailureException;", "public static void fillArrayList(List<String> list1){\n\t\tlist1.add(new String(\"Will\"));\n\t\tlist1.add(new String(\"John\"));\n\t\tlist1.add(new String(\"James\"));\n\t\tlist1.add(new String(\"Frank\"));\n\t\tlist1.add(new String(\"Fred\"));\n\t\tlist1.add(new String(\"Jake\"));\n\t\tlist1.add(new String(\"Winston\"));\n\t\tlist1.add(new String(\"Wally\"));\n\t\tlist1.add(new String(\"Karen\"));\n\t\tlist1.add(new String(\"Mary\"));\n\t\tlist1.add(new String(\"Michelle\"));\n\t\tlist1.add(new String(\"Micheal\"));\n\t\tlist1.add(new String(\"Mick\"));\n\t\tlist1.add(new String(\"Valdez\"));\n\t}", "public static void main(String[] args) {\n //Generic Version of Collection\n ArrayList<String> arrayList = new ArrayList<>();\n arrayList.add(\"Deepak\");\n arrayList.add(\"Kumar\");\n arrayList.add(\"Hello\");\n arrayList.add(\"Sandeep\");\n System.out.println(\"Collection Before Array Conversion=\" + arrayList);\n String[] names = new String[arrayList.size()];\n arrayList.toArray(names);\n System.out.println(\"Array After Conversion From Collection\");\n for (int i = 0; i < names.length; i++) {\n System.out.println(names[i]);\n }\n //Collection Normal Version\n ArrayList arrayList1 = new ArrayList<>();\n arrayList1.add(\"Deepak\");\n arrayList1.add('a');\n arrayList1.add(1);\n arrayList1.add(10.9f);\n arrayList1.add(10.90);\n arrayList1.add(true);\n\n\n System.out.println(\"Normal Colection without Conversion\"+arrayList1);\n Object[] object = arrayList1.toArray();\n\n System.out.println(\"Array After Conversion From Normal Collection\");\n for (int i = 0; i < object.length; i++) {\n System.out.println(object[i]);\n }\n\n ///Array to Collection Conversion\n String[] names1 = new String[]{\"Deepak\",\"Kuldeep\",\"Sandeep\",\"Pardeep\"};\n ArrayList<String> namesCollection = new ArrayList(Arrays.asList(names1));\n System.out.println(namesCollection);\n\n\n }", "public void alphabetize() {\n\t\t// write you code for alphabetize using the specifications above\n\t\tif (numElements==0){\n\t\t\treturn;\n\t\t}\n\t\tNode nodref = head;\n\t\tNode nodref1 = head.next;\n\t\tint count = 0;\n\t\tboolean x1 = false;\n\t\t\n\t\twhile(nodref!=null){\n\t\t\tnodref1=nodref.next;\n\t\t\tx1 = false;\n\t\t\twhile(nodref1!=null){\n\t\t\t\tint boo = nodref.data.compareTo(nodref1.data);\n\t\t\t\tSystem.out.println(this + \"\\n\" + nodref + \" \" + nodref1+ \" \" + boo +\"\\n\");\n\t\t\t\t\n\t\t\t\tif (boo>0){\n\t\t\t\t\tthis.add(nodref1.data);\n\t\t\t\t\tnumElements--;\n\t\t\t\t\tNode x = head;\n\t\t\t\t\tfor(int counter=0; counter<=count; counter++){\n\t\t\t\t\t\tx=x.next;\n\t\t\t\t\t}\n\t\t\t\t\tnodref.next = nodref.next.next;\n\t\t\t\t\tx1 = true;\n\t\t\t\t}\n\t\t\t\tnodref1 = nodref1.next;\n\t\t\t}\n\t\t\tSystem.out.println(count + \" \" + head + \" \" + x1);\n\t\t\tcount++;\n\t\t\tif(x1!=true){\n\t\t\t\tnodref = nodref.next;\n\t\t\t}\n\t\t\telse\n\t\t\t\tnodref = head;\n\t\t}\n\t}", "default YList<T> sorted() {\n return YCollections.sortedCollection(this);\n }", "public String sortBy();", "public void sortObjectList(){\n\t\tint counter = gameObjectsList.size() - 1;\n\t\tif (gameObjectsList == null || gameObjectsList.size() == 0){\n\t\t\treturn;\n\t\t}\n\t\tquicksort(0, counter);\n\t}", "public void updateList() {\n\t\tthis.myList.clear();\n\t\tIterator<String> item = this.myHashMap.keySet().iterator();\n\n\t\twhile (item.hasNext())\n\t\t{\n\t\t\tString name = (String)item.next();\n\t\t\tthis.myList.add(name);\n\t\t}\n\t\tthis.nameId = -1;\n\t\t\n\t}", "protected void sort() {\n\n\t\tCollections.sort(this.myRRList);\n\t}", "private static <File> void merge(ArrayList<File> firstList, ArrayList<File> secondList,\r\n ArrayList<File> wholeList, Comparator<File> usedComparison) {\r\n int i = 0;\r\n int j = 0;\r\n int k = 0;\r\n while (i < firstList.size() && j < secondList.size()) {\r\n if (usedComparison.compare(firstList.get(i), secondList.get(j)) < 0) {\r\n wholeList.set(k++, firstList.get(i++));\r\n } else {\r\n wholeList.set(k++, secondList.get(j++));\r\n }\r\n }\r\n while (i < firstList.size()) {\r\n wholeList.set(k++, firstList.get(i++));\r\n }\r\n while (j < secondList.size()) {\r\n wholeList.set(k++, secondList.get(j++));\r\n }\r\n }", "private void showCourtBookings()\n {\n ArrayList<Court> courtList = new ArrayList<Court>();\n ArrayList<Booking> bookingList = new ArrayList<Booking>();\n for(Sport sObj : sportsClub.sportList)\n {\n System.out.println(\"Displaying Courts for : \" + sObj.getSportName());\n courtList = sObj.getCourtList();\n for(Court cObj : courtList)\n { \n if(cObj.getCourtBookings().size()==0)\n System.out.println(\"Booking are not yet started for sport :\" + sObj.getSportName() + \" on Court : \" + cObj.getCourtId());\n else\n { \n\n Collections.sort(cObj.getCourtBookings());\n System.out.println(cObj.getCourtBookings().toString());\n\n } \n }\n } \n }", "public List<Pattern> getPatternsNameSorted() {\n List<Pattern> copy = new LinkedList<Pattern>(patterns);\r\n Collections.sort(copy, byName);\r\n return copy;\r\n }", "public static void main(String[] args) {\n\t\tStud1 s1=new Stud1(1,\"Yogi\");\r\n\t\tStud1 s2=new Stud1(4,\"Rushi\");\r\n\t\tStud1 s3=new Stud1(2,\"Praje\");\r\n\t\tStud1 s4=new Stud1(3,\"Amre\");\r\n\t\t\r\n\t\tList l=new ArrayList();\r\n\t\tl.add(s1);\r\n\t\tl.add(s2);\r\n\t\tl.add(s3);\r\n\t\tl.add(s4);\r\n\t\t\r\n\t\tSystem.out.println(l);\r\n\t\t\r\n\t\tCollections.sort(l);\r\n\t\t\r\n\t\tEnumeration e=Collections.enumeration(l);\r\n\t\t\r\n\t\twhile(e.hasMoreElements())\r\n\t\t{\r\n\t\t\tObject o=e.nextElement();\r\n\t\t\tSystem.out.println(o);\r\n\t\t}\r\n\r\n\t}", "public void testSortedList() {\r\n List<InfoNode> sortedList = MapUtils.sortByDistance(exampleList, node3.getTitle());\r\n assertTrue(sortedList.size() == 2);\r\n assertTrue(sortedList.get(0) == node2);\r\n assertTrue(sortedList.get(1) == node1);\r\n assertTrue(sortedList.contains(node1));\r\n assertTrue(sortedList.contains(node2));\r\n assertFalse(sortedList.contains(node3));\r\n\r\n sortedList = MapUtils.sortByDistance(exampleList, node1.getTitle());\r\n assertTrue(sortedList.size() == 2);\r\n assertTrue(sortedList.get(0) == node2);\r\n assertTrue(sortedList.get(1) == node3);\r\n assertFalse(sortedList.contains(node1));\r\n assertTrue(sortedList.contains(node2));\r\n assertTrue(sortedList.contains(node3));\r\n\r\n sortedList = MapUtils.sortByDistance(exampleList, \" \");\r\n assertTrue(sortedList.equals(exampleList));\r\n }", "private void sortMedApts(List<MedicationAppointment> medApts2) {\n \t}", "@Override\n public List<Client> clientsSortedAlphabetically(){\n log.trace(\"clientsSortedAlphabetically -- method entered\");\n Iterable<Client> clients = clientRepository.findAll();\n List<Client> result = StreamSupport.stream(clients.spliterator(),false).sorted(Comparator.comparing(Client::getName)).collect(Collectors.toList());\n log.trace(\"clientsSortedAlphabetically: result={}\", result);\n return result;\n\n }", "public static void main(String[] args) {\n List l = new ArrayList();\r\n\tl.add(Month.SEP);\r\n\tl.add(Month.MAR);\r\n\tl.add(Month.JUN);\r\n\tSystem.out.println(\"\\nList before sort : \\n\" + l);\r\n\tCollections.sort(l);\r\n\tSystem.out.println(\"\\nList after sort : \\n\" + l);\r\n }", "public CaseInsensitiveElementList(Collection<Element<String, V>> collection, Locale locale) {\n this(locale);\n addAll(collection);\n }", "public void sortElements(){\n\t\tgetInput();\n\t\tPeople[] all = countAndSort(people, 0, people.length-1);\n\t\t//PrintArray(all);\n\t\tSystem.out.println(InversionCount);\n\t}", "@Test\n public void testItem_Ordering() {\n OasisList<Integer> baseList = new SegmentedOasisList<>(2, 2);\n\n List<Integer> expResult = Arrays.asList(1, 2, 6, 8);\n baseList.addAll(expResult);\n\n for (int i = 0; i < expResult.size(); i++) {\n assertEquals(expResult.get(i), baseList.get(i));\n }\n }", "public Collection getSortedEntries(final PropertyAccessor sortProperty, boolean descending) {\n \t\tIEntryQueries queries = (IEntryQueries)getSession().getAdapter(IEntryQueries.class);\n \tif (queries != null) {\n \t\treturn queries.getSortedEntries(this, sortProperty, descending);\n \t} else {\n \t\t// IEntryQueries has not been implemented in the datastore.\n \t\t// We must therefore provide our own implementation.\n \t\t\n \t\tList sortedEntries = new LinkedList();\n \t\t\n \t\tIterator it = entries.iterator();\n \t\twhile (it.hasNext()) {\n \t\t\tsortedEntries.add(it.next());\n \t\t}\n \t\t\n \t\tComparator entryComparator;\n \t\tif (sortProperty.getPropertySet() == EntryInfo.getPropertySet()) {\n \t\t\tentryComparator = new Comparator() {\n \t\t\t\tpublic int compare(Object a, Object b) {\n \t\t\t\t\tObject value1 = ((Entry) a).getPropertyValue(sortProperty);\n \t\t\t\t\tObject value2 = ((Entry) b).getPropertyValue(sortProperty);\n \t\t\t\t\tif (value1 == null && value2 == null) return 0;\n \t\t\t\t\tif (value1 == null) return 1;\n \t\t\t\t\tif (value2 == null) return -1;\n \t\t\t\t\tif (Comparable.class.isAssignableFrom(sortProperty.getValueClass())) {\n \t\t\t\t\t\treturn ((Comparable)value1).compareTo(value2);\n \t\t\t\t\t} else {\n \t\t\t\t\t\tthrow new RuntimeException(\"not yet implemented\");\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t};\n \t\t} else if (sortProperty.getPropertySet() == TransactionInfo.getPropertySet()) {\n \t\t\tentryComparator = new Comparator() {\n \t\t\t\tpublic int compare(Object a, Object b) {\n \t\t\t\t\tObject value1 = ((Entry) a).getTransaction().getPropertyValue(sortProperty);\n \t\t\t\t\tObject value2 = ((Entry) b).getTransaction().getPropertyValue(sortProperty);\n \t\t\t\t\tif (value1 == null && value2 == null) return 0;\n \t\t\t\t\tif (value1 == null) return 1;\n \t\t\t\t\tif (value2 == null) return -1;\n \t\t\t\t\tif (Comparable.class.isAssignableFrom(sortProperty.getValueClass())) {\n \t\t\t\t\t\treturn ((Comparable)value1).compareTo(value2);\n \t\t\t\t\t} else {\n \t\t\t\t\t\tthrow new RuntimeException(\"not yet implemented\");\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t};\n \t\t} else if (sortProperty.getPropertySet() == AccountInfo.getPropertySet()) {\n \t\t\tentryComparator = new Comparator() {\n \t\t\t\tpublic int compare(Object a, Object b) {\n \t\t\t\t\tObject value1 = ((Entry) a).getAccount().getPropertyValue(sortProperty);\n \t\t\t\t\tObject value2 = ((Entry) b).getAccount().getPropertyValue(sortProperty);\n \t\t\t\t\tif (value1 == null && value2 == null) return 0;\n \t\t\t\t\tif (value1 == null) return 1;\n \t\t\t\t\tif (value2 == null) return -1;\n \t\t\t\t\tif (Comparable.class.isAssignableFrom(sortProperty.getValueClass())) {\n \t\t\t\t\t\treturn ((Comparable)value1).compareTo(value2);\n \t\t\t\t\t} else {\n \t\t\t\t\t\tthrow new RuntimeException(\"not yet implemented\");\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t};\n \t\t} else {\n \t\t\tthrow new RuntimeException(\"given property cannot be used for entry sorting\");\n \t\t}\n \t\t\n \t\tif (descending) {\n \t\t\tfinal Comparator ascendingComparator = entryComparator;\n \t\t\tentryComparator = new Comparator() {\n \t\t\t\tpublic int compare(Object a, Object b) {\n \t\t\t\t\treturn ascendingComparator.compare(b, a);\n \t\t\t\t}\n \t\t\t};\n \t\t}\n \t\t\n \t\tCollections.sort(sortedEntries, entryComparator);\n \t\t\n \t\treturn sortedEntries;\n \t}\n \t}", "public void writeList() {\n\n HeapSort heapSort = new HeapSort();\n heapSort.sort(list);\n\n// QuickSort quickSort = new QuickSort();\n// quickSort.sort(list);\n\n// MergeSort mergeSort = new MergeSort();\n// mergeSort.sortNumbers(list);\n\n System.out.println(\"Result of sorting :\");\n list.stream().forEach(s -> System.out.println(s));\n }", "public void listSortedByType(ArrayList<Pet> petList){\n System.out.println(\"Pets sorted by Type: \");\n for (Pet each: mySort.sortByType(petList)){\n System.out.println(each.getName() + \" is a \" + each.getType());\n }\n System.out.println();\n }", "private List<? extends Publication> sortPublicationsAfterTitle(Collection<? extends Publication> publicationList) {\n\n return publicationList.stream().sorted(Comparator.comparing(Publication::getTitle)).collect(Collectors.toList());\n }" ]
[ "0.6073694", "0.5812397", "0.57631063", "0.56514096", "0.5587637", "0.557276", "0.55237174", "0.55148166", "0.54944074", "0.54866445", "0.5470221", "0.54555607", "0.5434245", "0.5431267", "0.53837085", "0.537984", "0.5379352", "0.5365581", "0.5353991", "0.53147465", "0.53104234", "0.5283035", "0.52824056", "0.5249776", "0.5228655", "0.52141434", "0.5213949", "0.5205423", "0.51969564", "0.51561946", "0.51551133", "0.5153611", "0.51500106", "0.5148591", "0.51273304", "0.51255095", "0.5119093", "0.5114716", "0.5103664", "0.50993675", "0.5099006", "0.5098602", "0.509748", "0.509089", "0.50904334", "0.50797886", "0.50588685", "0.50543994", "0.5034882", "0.5026199", "0.5001392", "0.49996954", "0.49917328", "0.4987007", "0.49798506", "0.49742743", "0.49679017", "0.49551925", "0.49476296", "0.49333203", "0.49286115", "0.49199963", "0.49182096", "0.49166793", "0.49109545", "0.49100244", "0.49095932", "0.49065915", "0.49052325", "0.48961094", "0.48944554", "0.48941875", "0.48880294", "0.4881339", "0.4880715", "0.48733014", "0.48688564", "0.48594433", "0.4844675", "0.48409477", "0.4840459", "0.48329124", "0.4828377", "0.48268673", "0.48226485", "0.48053628", "0.4801418", "0.47996846", "0.47981647", "0.47908932", "0.47858885", "0.47845674", "0.47778723", "0.47709534", "0.47682923", "0.4765621", "0.47639126", "0.47609043", "0.4752399", "0.4751206" ]
0.64598095
0
/ Method puts listings elements into a collection. It then iterates through the collection and for each listing it creates a collection of the prices in the listing, which may be dorm and/or privates. The price for each listing is put into another collection. If there is more than one price in a listing the lowest price is put into this collection. This collection is then copied, and the copy sorted and compared with the original. If the two collections are the same then the property list is in price order.
public boolean sortByPrice() { listings = driver.findElements(By.xpath(listingsXpath)); listingsIterator = listings.iterator(); prices = new ArrayList<BigDecimal>(); listsEqual = false; while(listingsIterator.hasNext()) { listingElement = listingsIterator.next(); listingPrices = new ArrayList<BigDecimal>(); listingPriceElements = listingElement.findElements(By.xpath(listingPriceXpath)); priceIterator = listingPriceElements.iterator(); String priceText; while(priceIterator.hasNext()) { priceElement = priceIterator.next(); priceText = priceElement.getText().replaceAll("[€a-zA-Z\\t\\s]+",""); price = new BigDecimal(priceText); listingPrices.add(price); } prices.add(Collections.min(listingPrices)); } sortedPrices = prices; Collections.sort(sortedPrices); if(prices.equals(sortedPrices)) { listsEqual = true; } return listsEqual; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic List<Listing> findAllSortedByPrice() {\n\t\treturn theListingRepo.findAll(Sort.by(Direction.DESC, \"price\"));\n\t}", "public static void main(String[] args) {\n List<Double> priceList = new ArrayList<>();\n priceList.add(9.99);\n priceList.add(12.99);\n priceList.add(2.39);\n priceList.add(3.95);\n priceList.add(11.29);\n priceList.add(1.2);\n priceList.add(3.99);\n priceList.add(65.59);\n priceList.add(999.99);\n\n System.out.println(\"priceList = \" + priceList);\n // change the third price to 10 $\n\n priceList.set(2,10D);\n System.out.println(\"priceList 3rd item = \" + priceList);\n // Add 4 dollar to first price\n priceList.set(0,priceList.get(0)+4D);\n System.out.println(\"priceList add $4 ro the first item = \" + priceList);\n\n //change last price to sum of first and second price\n priceList.set(priceList.size()-1,priceList.get(0)+priceList.get(1));\n System.out.println(\"change last price to sum of first and second price \"+priceList);\n\n //give 40% off to second price\n priceList.set(1,priceList.get(1)*0.6);\n System.out.println(\"priceList 40% off = \" + priceList);\n \n \n //DOUBLE THE VALUE OF EACH AND EVERY PRICE IN THE LAST:\n\n for (int i = 0; i <priceList.size() ; i++) {\n priceList.set(i,priceList.get(i)*2);\n \n }\n\n System.out.println(\"priceList doubled= \" + priceList);\n \n // cut the price into half if the price is more than $20\n for (int i = 0; i <priceList.size() ; i++) {\n double eachPrice=priceList.get(i);\n if(eachPrice>=20){\n priceList.set(i,eachPrice/2);\n }\n }\n System.out.println(\"price list after cutting half the prices more than 20: \\n\\t\"+priceList);\n\n int lastIndex=priceList.size()-1;\n //swap the first value with the last value\n Double temp=priceList.get(0);\n priceList.set(0,priceList.get(lastIndex));\n priceList.set(lastIndex,temp);\n\n System.out.println(\"price list after swapping first and last value: \\n\\t\" +priceList);\n\n }", "public void initializeListings() {\n\t listings = new ArrayList<Listing>();\n\t Listings listingsToStore = Listings.getInstance();\n\t Iterator<Saveable> listingIterator = listingsToStore.iterator();\n\t\n\t int counter = 0;\n\t while (listingIterator.hasNext()) {\n\t\t Listing currentListing = listingsToStore.getListing(counter);\n\t\t for (int i = 0; i < listingIds.size(); i++) {\n\t\t\t \n\t\t\t if (currentListing.getInternalId() == listingIds.get(i)) {\n\t\t\t\t \n\t\t\t\t listings.add(currentListing);\n\t\t\t }\n\t\t }\n\t\t counter++;\n\t\t listingIterator.next();\n\t }\n\t \n }", "void addListing(Listing<P, C> listing) {\n this.collectionOfCurrentListings.add(listing);\n }", "public void f3(List<Book> a) {\r\n List<Book> list = new ArrayList<>();\r\n for (Book o : a) {\r\n if (o.getPrice() >= 20) {\r\n list.add(o);\r\n }\r\n }\r\n //sort by ascending\r\n Collections.sort(list, new Comparator<Book>() {\r\n @Override\r\n public int compare(Book o1, Book o2) {\r\n if (o1.getPrice() > o2.getPrice()) {\r\n return 1;\r\n } else if (o1.getPrice() < o2.getPrice()) {\r\n return -1;\r\n } else {\r\n return 0;\r\n }\r\n }\r\n });\r\n //add\r\n int index = 0;\r\n for (int i = 0; i < a.size(); i++) {\r\n if (a.get(i).getPrice() >= 20) {\r\n a.remove(i);\r\n a.add(i, list.get(index));\r\n index++;\r\n }\r\n }\r\n }", "public CalcPriceTest() {\n goods = new ArrayList<>(NUM_PLANETS);\n planets = new ArrayList<>(NUM_PLANETS);\n for (int i = 0; i < planets.size(); i++) {\n planets.add(new Planet());\n goods.add(new ArrayList<>(NUM_GOODS));\n }\n for (int i = 0; i < planets.size(); i++) {\n Planet thisPlanet = planets.get(i);\n ArrayList<TradeGood> theseGoods = goods.get(i);\n for (TradeGood.GoodType type : TradeGood.GoodType.values()) {\n TradeGood newGood = new TradeGood(type, thisPlanet);\n theseGoods.add(newGood);\n }\n }\n }", "public static ArrayList<Pets> sortArrayList(ArrayList<Pets> input){\n\t\t// destination ArrayList\n\t\tArrayList<Pets> sortedPets = new ArrayList<Pets>();\n\t\t\n\t\t// for each element read from the input list, compare it to the values in the destination list\n\t\t// and insert it.\n\t\tfor (int inputIndex = 0; inputIndex < input.size(); inputIndex++){\n\t\t\tint addIndex = 0;\n\t\t\tfor (int spIndex = 0; spIndex < sortedPets.size(); spIndex++) {\n\t\t\t\tif (input.get(inputIndex).getId() > sortedPets.get(spIndex).getId()) {\n\t\t\t\t\taddIndex++;\n\t\t\t\t} \n\t\t\t}\n\t\t\tsortedPets.add(addIndex, input.get(inputIndex));\n\t\t}\n\t\treturn sortedPets;\n\t}", "public List<Integer> getSortedPriceOfAllUnit(String unitSize){\r\n\t\tList<Integer> allUnitPrice=new ArrayList<Integer>();\r\n\t\tList<CateredWebElement> allUnitElements=new ArrayList<CateredWebElement>();\r\n\t\tString[] singleSizePrices;\r\n\t\t\r\n\t\tswitch(unitSize){\r\n\t\tcase \"Small\":\r\n\t\tallUnitElements=webAppDriver.findAllElementsByXpath(lbAllSmallPricesXpath);\r\n\t\tsingleSizePrices=new String[allUnitElements.size()];\r\n\t\tfor (int i=0;i<allUnitElements.size();i++){\r\n\t\t\tsingleSizePrices[i]=allUnitElements.get(i).getText().replace(\"$\", \"\");\r\n\t\t\tsingleSizePrices[i]=singleSizePrices[i].replace(\"/mo.\", \"\").trim();\r\n\t\t\tallUnitPrice.add(Integer.parseInt(singleSizePrices[i]));\t\t\t\r\n\t\t}\r\n\t\tCollections.sort(allUnitPrice);\r\n\t\treturn allUnitPrice;\r\n\t\tcase \"Medium\":\r\n\t\t\tallUnitElements=webAppDriver.findAllElementsByXpath(lbAllMediumPricesXpath);\r\n\t\t\tsingleSizePrices=new String[allUnitElements.size()];\r\n\t\t\tfor (int i=0;i<allUnitElements.size();i++){\r\n\t\t\t\tsingleSizePrices[i]=allUnitElements.get(i).getText().replace(\"$\", \"\");\r\n\t\t\t\tsingleSizePrices[i]=singleSizePrices[i].replace(\"/mo.\", \"\").trim();\r\n\t\t\t\tallUnitPrice.add(Integer.parseInt(singleSizePrices[i]));\t\r\n\t\t\t}\r\n\t\t\tCollections.sort(allUnitPrice);\r\n\t\t\treturn allUnitPrice;\r\n\t\tcase \"Large\":\r\n\t\t\tallUnitElements=webAppDriver.findAllElementsByXpath(lbAllLargePricesXpath);\r\n\t\t\tsingleSizePrices=new String[allUnitElements.size()];\r\n\t\t\tfor (int i=0;i<allUnitElements.size();i++){\r\n\t\t\t\tsingleSizePrices[i]=allUnitElements.get(i).getText().replace(\"$\", \"\");\r\n\t\t\t\tsingleSizePrices[i]=singleSizePrices[i].replace(\"/mo.\", \"\").trim();\r\n\t\t\t\tallUnitPrice.add(Integer.parseInt(singleSizePrices[i]));\t\r\n\t\t\t}\r\n\t\t\tCollections.sort(allUnitPrice);\r\n\t\t\treturn allUnitPrice;\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\tCollections.sort(allUnitPrice);\r\n\t\treturn allUnitPrice;\r\n\t}", "public void addToMatchingProduct(Listing listing) {\n\t\t\n\t\tSet<Product> productSet = findManufacturer(listing);\n\t\t\n\t\tif (productSet != null) {\n\t\t\tfor (Product p: productSet) {\n\t\t\t\tif (matches(listing, p)) {\n\t\t\t\t\tList<Listing> matchList = matchLists.get(p);\n\t\t\t\t\tif (matchList == null) {\n\t\t\t\t\t\tmatchList = new ArrayList<Listing>();\n\t\t\t\t\t\tmatchLists.put(p, matchList);\n\t\t\t\t\t}\n\t\t\t\t\tmatchList.add(listing);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void triCollection(){\r\n Collections.sort(collection);\r\n }", "public void SortByPrice() {\n for (int i = 1; i < LastIndex; i++) {\n int x = i;\n while (x >= 1) {\n if (ForChild[x - 1].getPrice() > ForChild[x].getPrice()) {\n Confectionery sweets = ForChild[x - 1];\n ForChild[x - 1] = ForChild[x];\n ForChild[x] = sweets;\n\n }\n x -= 1;\n }\n }\n }", "public ArrayList<Listing> getListings() {\n\n return this.listings;\n }", "public static Pizza orderPizza(){\n // Create a Scanner object\n Scanner input = new Scanner(System.in);\n\n String size = \"\";\n ArrayList<String> toppings =new ArrayList<>();\n\n int x = 0;\n int y =0;\n int z=0;\n int a=0;\n\n //Ask user if what size and toppings they would like to add to their pizza\n do {\n System.out.print(\"\\nWhat size of Pizza would you like?\\n\" +\n \"S-Small\\n\" +\n \"M-Medium\\n\" +\n \"L-Large\\n\");\n\n String answer = input.nextLine();\n switch (answer) {\n case \"S\":\n case \"s\":\n case \"Small\":\n case \"small\":\n size=\"Small\";\n x=0;\n break;\n case \"M\":\n case \"m\":\n case \"Medium\":\n case \"medium\":\n size = \"Medium\";\n x=0;\n break;\n case \"L\":\n case \"l\":\n case \"Large\":\n case \"large\":\n size = \"Large\";\n x=0;\n break;\n default:\n System.out.println(\"invalid choice\");\n x++;\n break;\n }\n } while (x>0);\n\n do {\n do {\n System.out.print(\"\\nWhat toppings would you like to add? Each pizza starts with cheese and red sauce.\\n\" +\n \"P- pepperoni\\n\" +\n \"S- sausage\\n\" +\n \"R- peppers\\n\" +\n \"C- chicken\\n\" +\n \"M- salami\\n\" +\n \"O- olives\\n\" +\n \"T- tomatoes\\n\" + \n \"A- anchovies \\n Please enter your toppings one at a time.\\n\");\n String answer = input.nextLine();\n\n switch (answer) {\n case \"P\":\n case \"p\":\n case \"Pepperoni\":\n case \"pepperoni\":\n toppings.add(\"Pepperoni\");\n y = 0;\n break;\n case \"S\":\n case \"s\":\n case \"Sausage\":\n case \"sausage\":\n toppings.add(\"Sausage\");\n y = 0;\n break;\n case \"R\":\n case \"r\":\n case \"Peppers\":\n case \"peppers\":\n toppings.add(\"Peppers\");\n y = 0;\n break; \n case \"A\":\n case \"a\":\n case \"Anchovies\":\n case \"anchovies\":\n toppings.add(\"Anchovies\");\n y = 0;\n break;\n case \"O\":\n case \"o\":\n case \"Olives\":\n case \"olives\":\n toppings.add(\"Olives\");\n y = 0;\n break;\n case \"T\":\n case \"t\":\n case \"Tomatoes\":\n case \"tomatoes\":\n toppings.add(\"Tomatoes\");\n y = 0;\n break;\n case \"M\":\n case \"m\":\n case \"Salami\":\n case \"salami\":\n toppings.add(\"Tomatoes\");\n y = 0;\n break;\n case \"C\":\n case \"c\":\n case \"Chicken\":\n case \"chicken\":\n toppings.add(\"Chicken\");\n y = 0;\n break;\n default:\n System.out.println(\"invalid choice\");\n y++;\n break;\n }\n } while (y > 0);\n\n do {\n System.out.print(\"\\nWould you like any more toppings (y or n): \");\n\n String answer = input.nextLine();\n switch (answer) {\n case \"Y\":\n case \"y\":\n case \"Yes\":\n case \"yes\":\n a=0;\n z++;\n break;\n case \"N\":\n case \"n\":\n case \"No\":\n case \"no\":\n a=0;\n z=0;\n break;\n default:\n System.out.println(\"invalid choice\");\n a++;\n break;\n }\n } while (a>0);\n }while (z>0);\n return new Pizza(\"Pizza\", size, toppings);\n }", "public BigDecimal getPriceList();", "@Test\n public void testAddAll_int_Collection_Order() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(3);\n instance.add(2);\n\n Collection c = Arrays.asList(1, 2, 3);\n instance.addAll(1, c);\n\n List expResult = Arrays.asList(3, 1, 2, 3, 2);\n\n for (int i = 0; i < expResult.size(); i++) {\n assertEquals(expResult.get(i), instance.get(i));\n }\n }", "public static void sortByPrice(List<Apartment> apartments) {\n Collections.sort(apartments, SORT_BY_PRICE);\n }", "public Pizza(String _name, ArrayList<String> _toppings){\n this.name = _name;\n this.toppings = _toppings;\n }", "public boolean sortByName()\n\t{\n\t\tlistings = driver.findElements(By.xpath(listingsXpath));\n\t\tlistingsIterator = listings.iterator();\n\t\tpropertyNames = new ArrayList<String>();\n\t\tlistsEqual = false;\n\t\tWebElement propertyNameElement;\n\t\tString propertyName;\n\t\t\n\t\twhile(listingsIterator.hasNext())\n\t\t{\n\t\t\tlistingElement = listingsIterator.next();\n\t\t\tpropertyNameElement = listingElement.findElement(By.cssSelector(\"h2\"));\n\t\t\tpropertyName = propertyNameElement.getText();\n\t\t\tpropertyNames.add(propertyName);\n\t\t}\n\t\t\n\t\tsortedPropertyNames = propertyNames;\n\t\tCollections.sort(sortedPropertyNames);\n\t\t\n\t if(propertyNames.equals(sortedPropertyNames))\n\t {\n\t \tlistsEqual = true;\n\t }\n\t\t\n\t\treturn listsEqual;\n\t}", "public BookListings(Book[] bookList) {\r\n bookListings = new Vector <Association <Book, Vector>> ();\r\n\r\n // Load the books into the BookListings\r\n for (int i = 0; i < bookList.length; i++) {\r\n Association <Book, ListingVector>> assoc = bookListings.get(i);\r\n assoc.getKey() = bookList(i);\r\n assoc.getValue() = new Vector<Listing>();\r\n }\r\n }", "@Override\n public List<Auction> meetCriteria(List<Auction> auctions) \n {\n List<Auction> firstCriteriaItems = criteria1.meetCriteria(auctions);\n List<Auction> otherCriteriaItems = criteria2.meetCriteria(auctions);\n // if an item b is in Collection B but is not in Collection A,\n // add item b to collection A. This yields unique elements b and a\n // in the new collection C.\n for (Auction auction : otherCriteriaItems) \n {\n if(!firstCriteriaItems.contains(auction))\n {\n firstCriteriaItems.add(auction);\n }\n }\t\n return firstCriteriaItems;\n }", "private static List<MoneyLoss> sortLosses(Collection<MoneyLoss> unsortedLosses)\n {\n //Sort budget items first on frequency and then alphabetically\n ArrayList<MoneyLoss> oneTimeItems = new ArrayList<MoneyLoss>();\n ArrayList<MoneyLoss> dailyItems = new ArrayList<MoneyLoss>();\n ArrayList<MoneyLoss> weeklyItems = new ArrayList<MoneyLoss>();\n ArrayList<MoneyLoss> biweeklyItems = new ArrayList<MoneyLoss>();\n ArrayList<MoneyLoss> monthlyItems = new ArrayList<MoneyLoss>();\n ArrayList<MoneyLoss> yearlyItems = new ArrayList<MoneyLoss>();\n\n for (MoneyLoss loss : unsortedLosses)\n {\n switch (loss.lossFrequency())\n {\n case oneTime:\n {\n oneTimeItems.add(loss);\n break;\n }\n case daily:\n {\n dailyItems.add(loss);\n break;\n }\n case weekly:\n {\n weeklyItems.add(loss);\n break;\n }\n case biWeekly:\n {\n biweeklyItems.add(loss);\n break;\n }\n case monthly:\n {\n monthlyItems.add(loss);\n break;\n }\n case yearly:\n {\n yearlyItems.add(loss);\n break;\n }\n }\n }\n\n Comparator<MoneyLoss> comparator = new Comparator<MoneyLoss>() {\n @Override\n public int compare(MoneyLoss lhs, MoneyLoss rhs) {\n return lhs.expenseDescription().compareTo(rhs.expenseDescription());\n }\n };\n\n Collections.sort(oneTimeItems, comparator);\n Collections.sort(dailyItems, comparator);\n Collections.sort(weeklyItems, comparator);\n Collections.sort(biweeklyItems, comparator);\n Collections.sort(monthlyItems, comparator);\n Collections.sort(yearlyItems, comparator);\n\n ArrayList<MoneyLoss> sortedItems = new ArrayList<MoneyLoss>();\n BadBudgetApplication.appendItems(sortedItems, oneTimeItems);\n BadBudgetApplication.appendItems(sortedItems, dailyItems);\n BadBudgetApplication.appendItems(sortedItems, weeklyItems);\n BadBudgetApplication.appendItems(sortedItems, biweeklyItems);\n BadBudgetApplication.appendItems(sortedItems, monthlyItems);\n BadBudgetApplication.appendItems(sortedItems, yearlyItems);\n\n return sortedItems;\n }", "@JsonIgnore\n public ArrayList<Ingredient> getShoppingList() {\n ArrayList<Ingredient> results = new ArrayList<>();\n for (Location location : route) {\n for (PreOrder preOrder : location.getPreOrders()) {\n for (DishWrapper dishWrapper : preOrder.getItems()) {\n for (Ingredient ingredient : dishWrapper.getDish().getIngredients()) {\n if (results.contains(ingredient)) {\n results.get(results.indexOf(ingredient)).addAmount(ingredient.getAmount() * dishWrapper.getAmount());\n } else {\n ingredient.setAmount(ingredient.getAmount() * dishWrapper.getAmount());\n }\n results.add(ingredient);\n }\n }\n }\n }\n return results;\n }", "public BigDecimal getPriceListEntered();", "@Test\n public void testAddAll_int_Collection_Order_Overflow() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2);\n instance.add(3);\n instance.add(2);\n instance.add(3);\n instance.add(2);\n instance.add(3);\n instance.add(2);\n\n Collection c = Arrays.asList(1, 2, 3);\n instance.addAll(1, c);\n\n List expResult = Arrays.asList(3, 1, 2, 3, 2, 3, 2, 3, 2);\n\n for (int i = 0; i < expResult.size(); i++) {\n assertEquals(expResult.get(i), instance.get(i));\n }\n }", "void addPricePointAndListNotEmpty(Prosument prosument, Point point, ArrayList<Point> pointList)\n\t{\n\t\tBoolean priceAlreadyInList = checkIfPriceExist(pointList,point.getPrice());\n\t\t\n\t\t//if price not in the list\n\t\tif (!priceAlreadyInList)\n\t\t{\n\t\t\t//says if found index that point.price < point(index).price\n\t\t\t//if not found add point as last in the list\n\t\t\tBoolean notFound = true; \n\t\t\t\n\t\t\tint a=0;\n\t\t\twhile (a<pointList.size() && notFound)\n\t\t\t{\n\t\t\t\tif (point.getPrice()<pointList.get(a).getPrice())\n\t\t\t\t{\n\t\t\t\t\t//jezeli a>0 to przestaw alfe i bete poprzednikowi dodawanego punktu\n\t\t\t\t\tif (a>0)\n\t\t\t\t\t{\n\t\t\t\t\t\tupdateAlfa(pointList.get(a-1),point,prosument,pointList,\"poprzednik dodawanego punktu\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//ustaw alfe i bete dodawanego punktu\n\t\t\t\t\tupdateAlfa(point,pointList.get(a),prosument,pointList,\"dodawany punkt\");\n\t\t\t\t\tpointList.add(a, point);\n\t\t\t\t\tnotFound=false;\t\n\t\t\t\t}\t\n\t\t\t\ta++;\n\t\t\t}\n\t\t\t\n\t\t\tif (notFound)\n\t\t\t{\n\t\t\t\tupdateAlfa(pointList.get(pointList.size()-1),point,prosument, pointList,\"not found\");\n\t\t\t\tpointList.add(point);\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public static <T extends Comparable<T>> List<T> createSortedList(Collection<T> collection) {\n\t\tList<T> list = createList(collection);\n\t\tCollections.sort(list);\n\t\treturn list;\n\t}", "public void orderByAscendantPrice() {\n\t\ttry {\n\t\t\t// Display the order list\n\t\t\tdiv_Order.click();\n\n\t\t\t// Select option order by ascendant price\n\t\t\ta_AscendantOption.click();\n\n\t\t\tList<WebElement> articleList = driver.findElements(by_ResultsArticles);\n\t\t\tDouble previousTotalArticle = null;\n\t\t\tfor (WebElement article : articleList) {\n\t\t\t\tDouble priceArticle;\n\t\t\t\tDouble totalArticle;\n\t\t\t\tString name = article.findElement(By.tagName(\"h3\")).getText();\n\t\t\t\tString price = article.findElement(By.xpath(\"ul/li[@class='lvprice prc']/span\")).getText();\n\n\t\t\t\tString shipping = null;\n\t\t\t\tDouble shippingArticle = 0.0;\n\t\t\t\tif (checkShippingElementExist(article)) {\n\t\t\t\t\tshipping = article.findElement(By.xpath(\"ul/li[@class='lvshipping']//span[@class='fee']\"))\n\t\t\t\t\t\t\t.getText();\n\t\t\t\t\tshippingArticle = getPriceNumber(shipping);\n\t\t\t\t}\n\n\t\t\t\tpriceArticle = getPriceNumber(price);\n\t\t\t\ttotalArticle = priceArticle + shippingArticle;\n\n\t\t\t\t// Assertions\n\t\t\t\tif (previousTotalArticle != null) {\n\t\t\t\t\tassertTrue(previousTotalArticle <= totalArticle);\n\t\t\t\t} else {\n\t\t\t\t\tassertTrue(0 < totalArticle);\n\t\t\t\t}\n\n\t\t\t\t// Print the first five results\n\t\t\t\tString infoArticle = String.format(\"The article %s has a total price of $%s\", name,\n\t\t\t\t\t\ttotalArticle.toString());\n\t\t\t\tSystem.out.println(infoArticle);\n\n\t\t\t\tpreviousTotalArticle = totalArticle;\n\t\t\t}\n\t\t} catch (Exception | AssertionError e) {\n\t\t\tString errorMessage = String.format(\"An error ocurred while ordering by ascendant price\", e.getMessage());\n\t\t\tthrow new Error(errorMessage);\n\t\t}\n\t}", "public ArrayList<ArrayList<Furniture>> produceOrder(){\n ArrayList<ArrayList<Furniture>> orders = new ArrayList<ArrayList<Furniture>>();\n ArrayList<ArrayList<Furniture>> all = getSubsets(getFoundFurniture());\n ArrayList<ArrayList<Furniture>> valid = getValid(all);\n ArrayList<ArrayList<Furniture>> orderedCheapest = comparePrice(valid);\n\n int n = 0;\n boolean set;\n // adding up to the number requested\n while(n != getRequestNum()){\n for(int i = 0; i < orderedCheapest.size(); i++){\n set = true;\n for(int j = 0; j < orderedCheapest.get(i).size(); j++){\n // looking at furniture item\n for(ArrayList<Furniture> furn : orders){\n // if the list of orders already contains an id dont add that furniture combo to the order\n if(furn.contains(orderedCheapest.get(i).get(j))){\n set = false;\n }\n }\n }\n if(set){\n orders.add(orderedCheapest.get(i));\n }\n }\n n++;\n }\n return orders;\n }", "private void showCourtBookings()\n {\n ArrayList<Court> courtList = new ArrayList<Court>();\n ArrayList<Booking> bookingList = new ArrayList<Booking>();\n for(Sport sObj : sportsClub.sportList)\n {\n System.out.println(\"Displaying Courts for : \" + sObj.getSportName());\n courtList = sObj.getCourtList();\n for(Court cObj : courtList)\n { \n if(cObj.getCourtBookings().size()==0)\n System.out.println(\"Booking are not yet started for sport :\" + sObj.getSportName() + \" on Court : \" + cObj.getCourtId());\n else\n { \n\n Collections.sort(cObj.getCourtBookings());\n System.out.println(cObj.getCourtBookings().toString());\n\n } \n }\n } \n }", "private void orderList() {\n Iterator<PlanarShape> sort = unorderedList.iterator();\n\n while(sort.hasNext()) {\n orderedList.insertInOrder(sort.next());\n }\n }", "private Map<String, Map<String, List<CmsCI>>> getOfferingsForClouds(Collection<CmsCI> clouds) {\n\t\tMap<String, Map<String, List<CmsCI>>> offeringsByNs = new HashMap<>();\n\t\tfor (CmsCI cloud : clouds) {\n\t\t\tList<CmsCI> offerings = cmProcessor.getCiBy3NsLike(getNs(cloud), \"cloud.Offering\", null);\n\t\t\tList<CmsCIRelation> serviceRels = cmProcessor.getFromCIRelations(cloud.getCiId(), BASE_PROVIDES, null);\n\t\t\tfor (CmsCIRelation rel : serviceRels) {\n\t\t\t\tCmsCIRelationAttribute attr = rel.getAttribute(\"service\");\n\t\t\t\tif (attr != null && attr.getDjValue() != null) {\n\t\t\t\t\tofferingsByNs.putIfAbsent(getNs(cloud), new HashMap<>());\n\t\t\t\t\tArrayList<CmsCI> list = new ArrayList<>();\n\t\t\t\t\tfor (Iterator<CmsCI> iterator = offerings.iterator(); iterator.hasNext(); ) {\n\t\t\t\t\t\tCmsCI offering = iterator.next();\n\t\t\t\t\t\tif (offering.getNsPath().endsWith(rel.getToCi().getCiClassName() + \"/\" + rel.getToCi().getCiName())) {\n\t\t\t\t\t\t\tlist.add(offering);\n\t\t\t\t\t\t\titerator.remove();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!list.isEmpty()) {\n\t\t\t\t\t\tofferingsByNs.get(getNs(cloud)).put(attr.getDjValue(), list);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn offeringsByNs;\n\t}", "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 sortByPrice()\n {\n Collections.sort(foodList, new Comparator<FoodItem>() {\n @Override\n public int compare(FoodItem o1, FoodItem o2) {\n return o1.getItemPrice().compareTo(o2.getItemPrice());\n }\n });\n foodListAdapter.notifyDataSetChanged();\n }", "void comparatorSort() {\n Collections.sort(vendor, Vendor.sizeVendor); // calling collection sort method and passing list and comparator variables\r\n for (HDTV item : vendor) { //looping arraylist\r\n System.out.println(\"Brand: \" + item.brandname + \" Size: \" + item.size);\r\n }\r\n }", "public ArrayList<Comparison> distribute (ArrayList<String> release) {\n\t\t\n\t\tfor (int i=0 ; i<release.size()-1 ; i++) {\n\t\t\t Comparison c = new Comparison(release.get(i),release.get(i+1));\n\t\t\t\tcomparison.add(c);\n\t\t}\n\t\t\n\t\treturn comparison;\n\t}", "public ArrayList orderToppings() {\r\n\t\t//left blank on purpose\r\n\t\treturn toppings;\r\n\t}", "public ArrayList<ArrayList<Dog>> getVetSchedule() {\n\t\t\tint initialCapacity = 10;\r\n\t\t\tArrayList<ArrayList<Dog>> list = new ArrayList<ArrayList<Dog>>(initialCapacity); //list to put in lists of dogs\r\n\t\t\t//intialize ArrayList with size ArrayList\r\n\t\t\tlist.add(new ArrayList<Dog>());\r\n\t\t\t/*for(int i=0; i<=10; i++){\r\n\t\t\t\tlist.add(new ArrayList<Dog>());\r\n\t\t\t}\r\n\t\t\t*/\r\n\t\t\tDogShelterIterator iterator = new DogShelterIterator();\r\n\t\t\twhile(iterator.hasNext()){\r\n\t\t\t\tDog nextDog = iterator.next();\r\n\t\t\t\tint index = nextDog.getDaysToNextVetAppointment()/7;\r\n\t\t\t\tif(index < list.size())list.get(index).add(nextDog);\r\n\t\t\t\telse{\r\n\t\t\t\t\t//index out of range --> create larger list\r\n\t\t\t\t\tArrayList<ArrayList<Dog>> newList = new ArrayList<ArrayList<Dog>>(index+1);\r\n\t\t\t\t\tnewList.addAll(list); //add all lists from the old list\r\n\t\t\t\t\tfor(int i=0; i<(index+1)-list.size(); i++){ //initialize the other half with new ArrayLists\r\n\t\t\t\t\t\tnewList.add(new ArrayList<Dog>());\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlist = newList; //update list to the larger newList\r\n\t\t\t\t\tlist.get(index).add(nextDog);\r\n\t\t\t\t}\r\n\t\t\t}\r\n return list;\r\n\t\t}", "public static void main(String[] args) {\n Collection collection= new ArrayList();\n collection.add(1500);\n collection.add(true);\n collection.add(12.32);\n collection.add(\"s\");\n collection.add('f');\n //System.out.println(collection);\n\n //Collection add(item) bunda item qo'sha olsa true aksi bo'lsa false qataradi\n System.out.println(collection.add(2200)); // bunda console da true bo'ladi 2200 qo'sha olgani uchun\n\n /* Collection ni addAll metothdi bu bizga collection methodiga narsalarni collection1 b-n\n ketma ketlikda qo'shish imkonini beradi*/\n\n Collection collection1=new ArrayList();\n collection1.addAll(collection);\n collection1.add(\"otherNumber1\");\n collection1.add(\"otherNumber2\");\n collection1.add(\"otherNumber3\");\n System.out.println(collection1);\n\n // boolean remove(object item) bu ko'rsatilgan obyektni collectionda o'chiradi listlarda index bilan bajariladi\n collection1.remove(12.32);\n System.out.println(collection1);\n\n // boolean removeAll(Collection<?> col)\n collection1.removeAll(collection);\n System.out.println(collection1);\n\n\n\n\n\n }", "private List<Article> orderArticles(List<Article> things){\n\t\t Comparator<Article> comparatorPrizes = new Comparator<Article>() {\n\t public int compare(Article x, Article y) {\n\t return (int) (x.getPrize() - y.getPrize());\n\t }\n\t };\n\t Collections.sort(things,comparatorPrizes); \n\t Collections.reverse(things);\n\t return things;\n\t }", "public void setPriceListEntered (BigDecimal PriceListEntered);", "public void getListingInfo(Listing listing) {\n\t\tWebClient webClient = new WebClient();\n\t\ttry {\n\t\t\tHtmlPage appPage = webClient.getPage(listing.getURL());\n\t\t\tlisting.addDetail(\"Name\", getValuePersist(appPage, Conf.XPATH_LISTING_NAME, 10));\n\t\t\tlisting.addDetail(\"Subtitle\", getValuePersist(appPage, Conf.XPATH_SUBTITLE, 1));\n\t\t\tlisting.addDetail(\"Number of Reviews\",\n\t\t\t\t\tgetValuePersist(appPage, Conf.XPATH_REVIEW_NUMBER, 1).replaceAll(\"\\\\D+\", \"\"));\n\t\t\tlisting.addDetail(\"Intro\", getValuePersist(appPage, Conf.XPATH_INTRO, 1));\n\t\t\tlisting.addDetail(\"Release date\", getValuePersist(appPage, Conf.XPATH_RELEASE_DATE, 1));\n\t\t\tlisting.addDetail(\"Pricing\", getValuePersist(appPage, Conf.XPATH_PRICING, 1));\n\t\t\tlisting.addDetail(\"Categories\", getValuePersist(appPage, Conf.XPATH_CATEGORIES, 1));\n\t\t\tString producer = getValuePersist(appPage, Conf.XPATH_PRODUCER, 1).replaceFirst(\"App by \", \"\");\n\t\t\tlisting.addDetail(\"Producer\", producer);\n\n\t\t\t// click on the detail button.\n\t\t\tappPage = ((HtmlElement) appPage.getByXPath(Conf.XPATH_DETAIL_TAB).get(0)).click();\n\n\t\t\tlisting.addDetail(\"Details\", getValuePersist(appPage, Conf.XPATH_DETAILS, 10));\n\n\t\t\tfor (Object contactInfo : appPage.getByXPath(Conf.XPATH_WEBSITE_OR_EMAIL)) {\n\t\t\t\ttry {\n\t\t\t\t\tif (((HtmlElement) contactInfo).asText().toLowerCase().contains(\"website\")) {\n\t\t\t\t\t\tlisting.addDetail(\"Company Website\", ((HtmlElement) contactInfo).getAttribute(\"href\"));\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tif (((HtmlElement) contactInfo).asText().toLowerCase().contains(\"email\")) {\n\t\t\t\t\t\tlisting.addDetail(\"Email\",\n\t\t\t\t\t\t\t\t((HtmlElement) contactInfo).getAttribute(\"href\").replaceFirst(\"mailto:\", \"\"));\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlisting.addDetail(\"Sales Phone\", getValuePersist(appPage, Conf.XPATH_SALES_PHONE, 1));\n\t\t\tlisting.addDetail(\"Salesforce Editions\", getValuePersist(appPage, Conf.XPATH_SALESFORCE_EDITIONS, 1)\n\t\t\t\t\t.replaceFirst(\"Salesforce Editions: \", \"\"));\n\t\t\tString techDetails = getValuePersist(appPage, Conf.XPATH_TECH_DETAILS, 1);\n\t\t\t// System.out.println(\"tech details:\" + techDetails);\n\t\t\ttry {\n\t\t\t\tPattern pat = Pattern.compile(\"First Release: (.+?)(\\r\\n|\\n|$)\");// after industries, and before the end\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// of line or end of string.\n\t\t\t\tMatcher mat = pat.matcher(techDetails);\n\t\t\t\tif (mat.find())\n\t\t\t\t\tlisting.addDetail(\"First Release\", mat.group(1));\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tPattern pat = Pattern.compile(\"Latest Release: (.+?)(\\r\\n|\\n|$)\");\n\t\t\t\tMatcher mat = pat.matcher(techDetails);\n\t\t\t\tif (mat.find())\n\t\t\t\t\tlisting.addDetail(\"Latest Release\", mat.group(1));\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tPattern pat = Pattern.compile(\"Version: (.+?)(\\r\\n|\\n|$)\");\n\t\t\t\tMatcher mat = pat.matcher(techDetails);\n\t\t\t\tif (mat.find())\n\t\t\t\t\tlisting.addDetail(\"Version\", mat.group(1));\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tPattern pat = Pattern.compile(\"Languages: (.+?)(\\r\\n|\\n|$)\");//\n\t\t\t\tMatcher mat = pat.matcher(techDetails);\n\t\t\t\tif (mat.find())\n\t\t\t\t\tlisting.addDetail(\"Language(s)\", mat.group(1));\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tPattern pat = Pattern.compile(\"Industries: (.+?)(\\r\\n|\\n|$)\");\n\t\t\t\tMatcher mat = pat.matcher(techDetails);\n\t\t\t\tif (mat.find())\n\t\t\t\t\tlisting.addDetail(\"Industries\", mat.group(1));\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t\tlisting.addDetail(\"Supported Features\", getValuePersist(appPage, Conf.XPATH_SUPPORTED_FEATURES, 1)\n\t\t\t\t\t.replaceFirst(\"Supported Features\\r\\n\", \"\"));\n\t\t\tappPage = ((HtmlElement) appPage.getByXPath(Conf.XPATH_PROVIDER_TAB).get(0)).click();\n\t\t\t// click on the PROVIDER tab.\n\t\t\tThread.sleep(3000);\n\n\t\t\tgetValuePersist(appPage, Conf.XPATH_SOMEWHERE_IN_PROVIDER_TAB, 10); // just to make sure that the page is\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// loaded.\n\t\t\ttry {\n\t\t\t\tlisting.addDetail(\"About Provider\",\n\t\t\t\t\t\tgetValueFromXPathAndDescendants(appPage, Conf.XPATH_ABOUT_PROVIDER));\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tnew URL(listing.getDetail(\"Company Website\"));\n\t\t\t} catch (Exception e) {\n\t\t\t\t// the item is not a url. so try to get the company website, from another source\n\t\t\t\tfor (Anchor a : getDescendantAnchors(appPage, Conf.XPATH_PROVIDER_DETAILS)) {\n\t\t\t\t\t// System.out.println(\"a: \" + a.href + \" \" + a.text);\n\t\t\t\t\tif (a.text.trim().toLowerCase().contains(\"website\")) {\n\t\t\t\t\t\t// System.out.println(\"found the anchor:\" + a.text);\n\t\t\t\t\t\tlisting.addDetail(\"Company Website\", a.href);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tString providerDetails = getValuePersist(appPage, Conf.XPATH_PROVIDER_DETAILS_INNER, 1);\n\n\t\t\ttry {\n\t\t\t\tPattern pat = Pattern.compile(\"Employees(\\r\\n|\\n)(.+?)(\\r\\n|\\n|$)\");\n\t\t\t\tMatcher mat = pat.matcher(providerDetails);\n\t\t\t\tif (mat.find())\n\t\t\t\t\tlisting.addDetail(\"Employees\", mat.group(2));\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tPattern pat = Pattern.compile(\"Year Founded(\\r\\n|\\n)(.+?)(\\r\\n|\\n|$)\");\n\t\t\t\tMatcher mat = pat.matcher(providerDetails);\n\t\t\t\tif (mat.find())\n\t\t\t\t\tlisting.addDetail(\"Year Founded\", mat.group(2));\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tPattern pat = Pattern.compile(\"Headquarters(\\r\\n|\\n)(.+?)(\\r\\n|\\n|$)\");\n\t\t\t\tMatcher mat = pat.matcher(providerDetails);\n\t\t\t\tif (mat.find())\n\t\t\t\t\tlisting.addDetail(\"Headquarters\", mat.group(2));\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tappPage = ((HtmlElement) appPage // click on the REVIEWS tab.\n\t\t\t\t\t.getByXPath(Conf.XPATH_REVIEWS_TAB).get(0)).click();\n\n\t\t\t// waiting until the page loads.\n\t\t\tgetValuePersist(appPage, Conf.XPATH_SOMEWHERE_IN_REVIEWS_TAB, 10);\n\t\t\tlisting.addDetail(\"Rating\", getValuePersist(appPage, Conf.XPATH_RATING_AVERAGE, 1));\n\t\t\ttry {\n\t\t\t\tlisting.addDetail(\"_5Stars\", ((HtmlElement) appPage.getFirstByXPath(Conf.XPATH_5STARS))\n\t\t\t\t\t\t.getAttribute(\"alt\").replaceAll(\"5 Stars? : \", \"\").replaceAll(\" reviews?\", \"\"));\n\t\t\t\tlisting.addDetail(\"_4Stars\", ((HtmlElement) appPage.getFirstByXPath(Conf.XPATH_4STARS))\n\t\t\t\t\t\t.getAttribute(\"alt\").replaceAll(\"4 Stars? : \", \"\").replaceAll(\" reviews?\", \"\"));\n\t\t\t\tlisting.addDetail(\"_3Stars\", ((HtmlElement) appPage.getFirstByXPath(Conf.XPATH_3STARS))\n\t\t\t\t\t\t.getAttribute(\"alt\").replaceAll(\"3 Stars? : \", \"\").replaceAll(\" reviews?\", \"\"));\n\t\t\t\tlisting.addDetail(\"_2Stars\", ((HtmlElement) appPage.getFirstByXPath(Conf.XPATH_2STARS))\n\t\t\t\t\t\t.getAttribute(\"alt\").replaceAll(\"2 Stars? : \", \"\").replaceAll(\" reviews?\", \"\"));\n\t\t\t\tlisting.addDetail(\"_1Stars\", ((HtmlElement) appPage.getFirstByXPath(Conf.XPATH_1STARS))\n\t\t\t\t\t\t.getAttribute(\"alt\").replaceAll(\"1 Stars? : \", \"\").replaceAll(\" reviews?\", \"\"));\n\t\t\t} catch (Exception e) {\n\t\t\t}\n\t\t\tgetReviews(listing, appPage);\n\t\t\tlisting.setStatus(Status.PROCESSED);\n\t\t\twebClient.close();\n\t\t} catch (Exception e) {\n\t\t\t// listing.setStatus(Status.OPEN); // only if you want the scraping to happen again.\n\t\t\te.printStackTrace();\n\t\t}\n\t\tsynchronized (Main.bell) {\n\t\t\tMain.bell.notify();\n\t\t}\n\t}", "protected List buildSearchResultList(Collection searchResultsCollection, Long actualSize) {\n CollectionIncomplete results = new CollectionIncomplete(searchResultsCollection, actualSize);\n\n // Sort list if default sort column given\n List searchResults = results;\n List defaultSortColumns = getDefaultSortColumns();\n if (defaultSortColumns.size() > 0) {\n Collections.sort(results, new BeanPropertyComparator(defaultSortColumns, true));\n }\n return searchResults;\n }", "public ArrayList<ArrayList<Furniture>> comparePrice(ArrayList<ArrayList<Furniture>> valid ){\n ArrayList<ArrayList<Furniture>> ordered = new ArrayList<ArrayList<Furniture>>();\n\n int i = valid.size();\n while(i != 0){\n int price = getComboPrice(valid.get(0));\n ArrayList<Furniture> cheapest = valid.get(0);\n\n for(ArrayList<Furniture> combo : valid){\n if(getComboPrice(combo) < price){\n price = getComboPrice(combo);\n cheapest = combo;\n }\n }\n // adds the cheapest element to the list and then removes it from the param list\n ordered.add(cheapest);\n valid.remove(cheapest);\n i--;\n }\n return ordered;\n }", "public void setPriceList (BigDecimal PriceList);", "public List<Product> scrapeProducts() {\n\n // Create empty list for the products that are going to be fetched\n List<Product> foundProducts = new ArrayList<>();\n\n // Open the url\n getDriver().get(getWebStore().getURL());\n\n // Locate the overview of all products\n System.out.println(getWebStore().getURL());\n WebElement productsOverview = getDriver().findElement(By.cssSelector(getWebStore().getProductsOverviewSelector()));\n\n // Get all products per class\n List<WebElement> products = productsOverview.findElements(By.className(getWebStore().getProductSelector().substring(1)));\n\n // Create a new webScraper\n WebScraper productPage = new WebScraper();\n productPage.setDriver(new HtmlUnitDriver());\n\n // Loop thru all found products and scrape information that is needed\n for (WebElement product : products) {\n Product newProduct = new Product();\n\n try {\n // Set up the information that is already visible\n newProduct.setBrand(new Brand(webStore.getBrand()));\n\n // Find the redirect link\n newProduct.setRedirectURL(\n product.findElement(By.cssSelector(webStore.getProductURLSelector())).getAttribute(\"href\")\n );\n\n foundProducts.add(newProduct);\n } catch (Exception e) {\n // Show error message when something goes wrong\n System.out.printf(\"Something went wrong while fetching the products of the brand: %s\\n\", getWebStore().getBrand());\n e.printStackTrace();\n }\n }\n\n // Add additional data to the products by visiting their individual page\n for (Product foundProduct : foundProducts) {\n try {\n scrapeAdditionalDataOfProduct(foundProduct);\n } catch (Exception e) {\n System.out.printf(\"Something went wrong while fetching the products of the brand: %s\\n\", getWebStore().getBrand());\n }\n }\n\n for (int i = 0; i < foundProducts.size(); i++) {\n if (foundProducts.get(i).getName() == null) {\n foundProducts.remove(foundProducts.get(i));\n }\n }\n\n return foundProducts;\n }", "public void putListInPointOrder() {\n for (int i = 0; i < players.size(); i++) {\n Player s = players.get(i);\n if (i < players.size() - 1) {\n for (int j = i; j < players.size(); j++) {\n while (s.getPoint() < players.get(j).getPoint()) {\n Collections.swap(players, i, j);\n }\n\n }\n }\n }\n }", "public List<Box> packThings (List<Thing> things){\n List<Box> boxes = new ArrayList<Box>();\r\n \r\n for (Thing thing : things){\r\n Box box = new Box(boxesVolume); //creates new box with specified volume\r\n box.addThing(thing); //adds things to the Box\r\n boxes.add(box); //adds box to list of boxes\r\n }\r\n \r\n return boxes;\r\n }", "private static void populateList(List<UsedCar> carList) {\n carList.add(new UsedCar(\"Ford\", \"Fiesta ST\", 2016, 25000.00));\n carList.add(new UsedCar(\"Ford\", \"Focus RS\", 2017, 40000.00));\n carList.add(new UsedCar(\"Ariel\", \"Atom\", 2018, 65000.00));\n carList.add(new UsedCar(\"Ford\", \"Pinto\", 1985, 1.00, 500.1));\n carList.add(new UsedCar(\"DMC\", \"DeLorean\", 1985, 20000.00, 50.0));\n carList.add(new UsedCar(\"Lamborghini\", \"Spyder\", 2006, 95995.00, 42.4));\n }", "public ArrayList<Double> GetPrices()\r\n\t{\r\n\t\treturn dayStockPrices;\r\n\t}", "public void sortLibrary() {\n libraries.sort(Comparator.comparingLong(Library::getSignupCost));\n\n //J-\n// libraries.sort((o1, o2) -> Long.compare(\n// o2.getCurrentScore() - (2 * o2.getDailyShipCapacity() * o2.getSignupCost()),\n// o1.getCurrentScore() - (2 * o1.getDailyShipCapacity() * o1.getSignupCost())\n// ));\n\n// libraries.sort((o1, o2) -> Long.compare(\n// (o2.getBooksCount() + o2.getSignupCost()) * o2.getDailyShipCapacity(),\n// (o1.getBooksCount() + o1.getSignupCost()) * o1.getDailyShipCapacity()));\n //J+\n }", "public static void main(String[] args) {\n Item item1=new Item(\"cucumber\",2,5);\n Item item2=new Item(\"appl\",3,6);\n Item item3=new Item(\"orange\",3,5);\n Item item4=new Item(\"bananas\",2,6);\n\n ArrayList<Item>shoppingList=new ArrayList<>();\n shoppingList.addAll(Arrays.asList(item1,item2,item3,item4));\n double totalCost=0;\n for (Item each:shoppingList){\n totalCost +=each.calCost();\n }\n for(int i=0;i<shoppingList.size();i++){\n totalCost+=shoppingList.get(i).calCost();\n }\n System.out.println(\"total:\"+totalCost);\n\n\n\n\n //System.out.println(item1.calCost());\n\n // System.out.println(item1);\n\n\n\n\n\n }", "@Test\r\n\tpublic void testAddAll() {\r\n\t\tDoubleList sample = new DoubleList(new Munitions(2, 4, \"ferrum\"));\r\n\t\tsample.addAll(list);\r\n\t\tAssert.assertEquals(16, sample.size());\r\n\t\tAssert.assertTrue(sample.get(0).equals(new Munitions(2, 4, \"ferrum\")));\r\n\t\tAssert.assertTrue(sample.get(1).equals(list.get(0)));\r\n\t\tAssert.assertTrue(sample.get(15).equals(list.get(14)));\r\n\t}", "public List prices() {\n List ls = new ArrayList();\n try {\n\n Connection connection = DBUtil.getConnection();\n //PreparedStatement pst = connection.prepareStatement(\"select PriceId,VegetableId,GovernmentPrice,FarmerPrice,WholeSellerPrice,\"\n // + \"RetailerPrice from PriceDetails\");\n /*PreparedStatement pst = connection.prepareStatement(\"SELECT PriceDetails.PriceId,VegetableDetails.VegetableName,PriceDetails.GovernmentPrice,\"\n + \"PriceDetails.FarmerPrice,PriceDetails.WholeSellerPrice,PriceDetails.RetailerPrice\"\n + \" from PriceDetails INNER JOIN VegetableDetails \"\n + \"ON PriceDetails.VegetableId = VegetableDetails.VegetableId\");\n */\n\n PreparedStatement pst = connection.prepareStatement(\"select PriceDetails.PriceId,VegetableDetails.VegetableName,\"\n + \"PriceDetails.GovernmentPrice,PriceDetails.FarmerPrice,PriceDetails.WholeSellerPrice,\"\n + \"PriceDetails.RetailerPrice from PriceDetails INNER JOIN VegetableDetails ON PriceDetails.VegetableId = \"\n + \"VegetableDetails.VegetableId\");\n\n ResultSet rs = pst.executeQuery();\n while (rs.next()) {\n ViewPricesBean vpb = new ViewPricesBean();\n\n vpb.setPriceId(rs.getInt(1));\n vpb.setVegetableName(rs.getString(2));\n // vpb.setRegionName(rs.getString(3));\n vpb.setGovernmentPrice(rs.getFloat(3));\n vpb.setFarmerPrice(rs.getFloat(4));\n vpb.setWholeSellerPrice(rs.getFloat(5));\n vpb.setRetailerPrice(rs.getFloat(6));\n\n\n ls.add(vpb);\n\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n return ls;\n\n }", "private void limit(order ord, ArrayList<order> lim){\n //B\n if (ord.BS.equals(\"B\")){\n System.out.println(\"ord:\" + ord.BS + \" \" + ord.qty + \" \" + ord.price + \" \" + ord.sequence);\n for(int i = 0; i < lim.size(); i++){\n if (ord.price > lim.get(i).price){\n lim.add(i, ord);\n reportClient(i, lim, \"Ord report:\" + ord.sysTime + \",\" + ord.stockNo+\",\"+\n ord.BS+\",\"+ord.qty+\",\"+ord.price);\n break;\n }\n\n if (lim.size()-1 == i){\n lim.add(ord);\n reportClient(i, lim, \"Ord report:\" + ord.sysTime + \",\" + ord.stockNo+\",\"+\n ord.BS+\",\"+ord.qty+\",\"+ord.price);\n break;\n }\n }\n if (lim.size() == 0) {\n lim.add(ord);\n reportClient(0, lim, \"Ord report:\" + ord.sysTime + \",\" + ord.stockNo+\",\"+\n ord.BS+\",\"+ord.qty+\",\"+ord.price);\n }\n }\n\n //S\n if (ord.BS.equals(\"S\")){\n System.out.println(\"ord:\" + ord.BS + \" \" + ord.qty + \" \" + ord.price + \" \" + ord.sequence);\n for(int i = 0; i < lim.size(); i++){\n if (ord.price < lim.get(i).price){\n lim.add(i, ord);\n reportClient(i, lim, \"Ord report:\" + ord.sysTime + \",\" + ord.stockNo+\",\"+\n ord.BS+\",\"+ord.qty+\",\"+ord.price);\n break;\n }\n\n if (lim.size()-1 == i){\n lim.add(ord);\n reportClient(i, lim, \"Ord report:\" + ord.sysTime + \",\" + ord.stockNo+\",\"+\n ord.BS+\",\"+ord.qty+\",\"+ord.price);\n break;\n }\n }\n if (lim.size() == 0) {\n lim.add(ord);\n reportClient(0, lim, \"Ord report:\" + ord.sysTime + \",\" + ord.stockNo+\",\"+\n ord.BS+\",\"+ord.qty+\",\"+ord.price);\n }\n }\n\n allOrder.add(ord);\n //Print\n //System.out.println(\"limit:\" + ord.BS + \" \" + ord.qty + \" \" + ord.price);\n for(int i = 0; i < lim.size(); i++) \n System.out.println(lim.get(i).BS + lim.get(i).price);\n\n }", "public static List<Integer> calcPriceList(List<TradeGood> allGoods, Planet planet) {\n List<Integer> priceList = new ArrayList<>();\n for (int i = 0; i < allGoods.size(); i++) {\n priceList.add(calcPrice(allGoods.get(i), planet));\n }\n return priceList;\n }", "public ArrayList<Property> addBothUtilitiesToGame(int gameID)\n {\n String query;\n int space;\n // flag for not owned by a player, but owned by the bank\n int owner = -1;\n String name;\n int price;\n \n ArrayList<Property> utilityList = new ArrayList<Property>();\n \n try \n { \n if(connection == null)\n {\n getDatabaseConnection();\n }\n \n query = \"SELECT * FROM utility_constants\";\n statement = connection.createStatement();\n resultSet = statement.executeQuery( query ); \n \n while(resultSet.next())\n { \n space = resultSet.getInt(\"space_id\");\n name = resultSet.getString(\"name\");\n price = resultSet.getInt(\"purchase_price\");\n \n query = \"INSERT INTO utility_game_data (space_id, game_id, name, has_mortgage) \"\n + \"VALUES ( '\" + space + \"', '\" + gameID + \"', '\" + name + \"', '0' ) \";\n \n statement.executeUpdate(query); \n Utility utility = new Utility();\n utility.initialize(owner, space, name, price, false, gameID); \n utilityList.add(utility); \n } \n \n resultSet.close();\n statement.close();\n }\n catch ( SQLException sqlex ) \n {\n System.err.println( \"Unable to add 2 new utilities\" );\n sqlex.printStackTrace();\n }\n finally\n {\n return utilityList;\n }\n \n }", "public void f6(List<Book> a) {\r\n double min = a.get(0).getPrice();\r\n for (Book o : a) {\r\n if (o.getPrice() < min) {\r\n min = o.getPrice();\r\n }\r\n }\r\n int acc = a.size();\r\n for (int i = acc-1; i > 0; i--) {\r\n a.remove(i);\r\n break;\r\n }\r\n }", "@Test\n public void testAdd() {\n list1.add(0, 11.25);\n list1.add(1, 12.25);\n list1.add(2, 13.25);\n list1.add(3, 14.25);\n list1.add(4, 15.25);\n list1.add(5, 17.25);\n list1.add(6, 18.25);\n list1.add(7, 19.25);\n list1.add(3, 16.25);\n assertEquals(16.25 , list1.get(3), 0);\n assertEquals(14.25 , list1.get(4), 0);\n assertEquals(15.25, list1.get(5), 0);\n assertEquals(9, list1.size());\n }", "private List<PricingRule> orderPricingRules(Set<PricingRule> pricingRules) {\n \tList<PricingRule> pricingRulesList = pricingRules.stream().collect(Collectors.toList());\n \tCollections.sort(pricingRulesList, new Comparator<PricingRule>() {\n\t\t\tpublic int compare(PricingRule o1, PricingRule o2) {\n\t\t\t\treturn ((o2.getClass().getAnnotation(PricingRuleOrder.class).value()) - (o1.getClass().getAnnotation(PricingRuleOrder.class).value()));\n\t\t\t}\n\t\t});\n\t\treturn pricingRulesList;\n }", "@Override\n\tpublic Page<Listing> findAllPagedSortedByPrice(int pageNumber) {\n\t\tint pageSize=9;\n\t\tSort sort= Sort.by(\"price\").ascending();\n\t\tPageable pageable= PageRequest.of(pageNumber-1, pageSize,sort);\n\t\treturn theListingRepo.findAll(pageable);\n\t}", "java.util.List<cosmos.base.v1beta1.CoinOuterClass.Coin> \n getPriceList();", "List<Property> givePropList(Kingdom kingdom) throws Exception;", "public void calculateToll(Vehicles v, ArrayList<Places> p){\n for(Places p1: p){\n if(p1.getToll() && p1.getPId()>= start && p1.getPId() <= end){\n tollbooths.add(p1.getPId());\n FeeForEachTollandTrip tt = new FeeForEachTollandTrip(isVip);\n tolltrips.add(tt);\n total += tt.calculateToll(v, p1.getPId());\n }\n }\n \n //printint the output\n /*\n Toll booths : B Amount : 20 Discount : 4 Total : 16\n */\n System.out.print(\"Tollbooths were: \");\n for(int i =0; i<tollbooths.size();i++){\n System.out.print(\" \" + tollbooths.get(i));\n }\n\n\n System.out.println();\n int amount;\n if(isVip)\n amount = (int) (total/0.8);\n else \n amount = (int)total;\n System.out.println(\"Amount is \" + amount);\n double discount = 0;\n if(isVip)\n discount = 0.2 * amount;\n System.out.println(\"Discount is \" + discount);\n System.out.println(\"Total is: \" +total);\n\n //checking if vehicle has already passed the toll before\n //if yes, nothing to be done.\n //if not, add the vehicle to the toll\n for(Places p1: p){\n if(p1.getToll() && tollbooths.contains(p1.getPId())){\n for(Vehicles v1: p1.getVehicles()){\n if(v1.getVehicleId() == v.getVehicleId()){\n break;\n }\n }\n p1.vehicles.add(v);\n }\n }\n }", "public void allBookings() {\n\t\t\tint i = 0;\r\n\t\t\tint k = 0;\r\n\t\t\tint j = 0;\r\n\t\t\tint roomNum; //Room number\r\n\t\t\tint buffNum; //buff room number\r\n\t\t\tint index = 0; //saves the index of the date stored in the arraylist dateArray\r\n\t\t\tBooking buff; //Booking buffer to use\r\n\t\t\tRooms roomCheck;\r\n\t\t\tArrayList<LocalDate> dateArray = new ArrayList<LocalDate>(); //Saves the booking dates of a room\r\n\t\t\tArrayList<Integer> nights = new ArrayList<Integer>(); //Saves the number of nights a room is booked for\r\n\t\t\t\r\n\t\t\twhile(i < RoomDetails.size()) { //Looping Room Number-wise\r\n\t\t\t\troomCheck = RoomDetails.get(i);\r\n\t\t\t\troomNum = roomCheck.getRoomNum();\r\n\t\t\t\tSystem.out.print(this.Name + \" \" + roomNum);\r\n\t\t\t\twhile(k < Bookings.size()) { //across all bookings\r\n\t\t\t\t\tbuff = Bookings.get(k);\r\n\t\t\t\t\twhile(j < buff.getNumOfRoom()) { //check each booked room\r\n\t\t\t\t\t\tbuffNum = buff.getRoomNumber(j);\r\n\t\t\t\t\t\tif(buffNum == roomNum) { //If a booking is found for a specific room (roomNum)\r\n\t\t\t\t\t\t\tdateArray.add(buff.getStartDate()); //add the date to the dateArray\r\n\t\t\t\t\t\t\tCollections.sort(dateArray); //sort the dateArray\r\n\t\t\t\t\t\t\tindex = dateArray.indexOf(buff.getStartDate()); //get the index of the newly add date\r\n\t\t\t\t\t\t\tnights.add(index, buff.getDays()); //add the number of nights to the same index as the date\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tj++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tk++;\r\n\t\t\t\t\tj=0;\r\n\t\t\t\t}\r\n\t\t\t\ti++;\r\n\t\t\t\tprintOccupancy(dateArray, nights); //print the occupancy of the room\r\n\t\t\t\tk=0;\r\n\t\t\t\tdateArray.clear(); //cleared to be used again\r\n\t\t\t\tnights.clear(); //cleared to be used again\r\n\t\t\t}\r\n\t\t}", "public static void organizeEntityList(List<Entity> entList, Location loc) {\n\t\tboolean keepGoing = true;\n\t\twhile (keepGoing == true) {\n\t\t\tkeepGoing = false;\n\t\t\tfor (int i = 0; i < entList.size() - 1; i++) {\n\t\t\t\tif (getDistanceSquared(loc, entList.get(i).getLocation()) > getDistanceSquared(loc,\n\t\t\t\t\t\tentList.get(i + 1).getLocation())) {\n\t\t\t\t\tkeepGoing = true;\n\t\t\t\t\tEntity temp;\n\t\t\t\t\ttemp = entList.get(i);\n\t\t\t\t\tentList.set(i, entList.get(i + 1));\n\t\t\t\t\tentList.set(i + 1, temp);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tArrayList<Integer> oneThruTen = new ArrayList<>();\n\t\tArrayList<Integer> sixThruFifteen = new ArrayList<>();\n\t\tArrayList<Integer> combinedNumbers = new ArrayList<>();\n\n\t\tfor (int i = 1; i < 11; i++) {\n\t\t\toneThruTen.add(i);\n\t\t\tsixThruFifteen.add(i + 5);\n\t\t}\n\n\t\tCollections.shuffle((List<?>) oneThruTen);\n\t\tCollections.shuffle((List<?>) sixThruFifteen);\n\n\t\tSystem.out.println(\"Collection 1:\");\n\t\tfor (Integer integer : oneThruTen) {\n\t\t\tSystem.out.println(integer);\n\t\t}\n\t\tSystem.out.println();\n\t\t\n\t\tSystem.out.println(\"Collection 2:\");\n\t\tfor (Integer integer : sixThruFifteen) {\n\t\t\tSystem.out.println(integer);\n\t\t}\n\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"Collection 1 Size: \" + oneThruTen.size());\n\t\tSystem.out.println(\"Collection 2 Size: \" + sixThruFifteen.size());\n\n\t\tcombinedNumbers.addAll(oneThruTen);\n\t\tcombinedNumbers.addAll(sixThruFifteen);\n\n\t\t// Converting to Set and then reverting to ArrayList to remove duplicate\n\t\tSet<Integer> tempset = new HashSet<>();\n\t\ttempset.addAll(combinedNumbers);\n\t\tcombinedNumbers.clear();\n\t\tcombinedNumbers.addAll(tempset);\n\t\t//sort in ascending order\n\t\tcombinedNumbers.sort(null);\n\t\t//remove middle value\n\t\tcombinedNumbers.remove((combinedNumbers.size() / 2)); // only works if ArrayList size is odd. Would need to check for\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t //if size is even or odd if size was unknown\n\t\tSystem.out.println(\"Third Collection in reverse order:\");\n\t\tfor (int i = (combinedNumbers.size() - 1); i > -1; i--) {\n\n\t\t\tSystem.out.println(combinedNumbers.get(i));\n\t\t}\n\t\n\t\tSystem.out.println(\"Third Collection size: \" + combinedNumbers.size());\n\n\t\t// HashMap was chosen because order did not matter and HashMap has the\n\t\t// best performance of the Set types in Collection framework\n\t\tHashMap<String, String> hmap = new HashMap<>();\n\t\thmap.putIfAbsent(\"Paul\", \"Pierce\");\n\t\thmap.putIfAbsent(\"Kevin\", \"Garnett\");\n\t\thmap.putIfAbsent(\"Ray\", \"Allen\");\n\t\thmap.putIfAbsent(\"Kendrick\", \"Perkins\");\n\t\thmap.putIfAbsent(\"Rajon\", \"Rondo\");\n\t\t\n\t\t//Adding duplicate and printing out key,value pair\n\t\tif (hmap.containsKey(\"Paul\")) {\n\t\t\tSystem.out.print(\"Duplicate Entry: \" + \"Paul \");\n\t\t}\n\t\tSystem.out.println(hmap.putIfAbsent(\"Paul\", \"Pierce\")); \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\tSystem.out.println(\"Key/Value Pairs \" + hmap);\n\t\tSystem.out.println(\"Key/Value Collection size: \" + hmap.size());\n\n\t}", "@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 WellSetListPOJOBigDecimal(Collection<WellSetBigDecimal> collection) {\n for(WellSetBigDecimal set : collection) {\n this.wellsets.add(new WellSetPOJOBigDecimal(set));\n }\n }", "public static void main(String[] args) {\n ArrayList<String> cars = new ArrayList<>();\n cars.add(\"Volvo\");\n cars.add(\"BMW\");\n cars.add(\"Ford\");\n cars.add(\"Mazda\");\n cars.add(\"Chevrolet\");\n cars.add(\"Kia\");\n\n ArrayList<String> cars2 = new ArrayList<>();\n cars2.add(\"Lamborghini\");\n cars2.add(\"Bugatti\");\n\n //1. Adding methods to the list\n //1.1 Add specified element to the end of the list\n cars.add(\"Nissan\");\n //1.2 Add specified element at the specified position\n //could be any position should be inside the length of the list, avoid out of bounds positions\n cars.add(1,\"Smart\");\n //1.3 Add all the elements a list to the another list\n cars.addAll(cars2);\n\n //2. Getting the size of the list\n int size = cars.size();\n System.out.println(\"Size of the list: \" + size);\n\n //3. Removing elements from the list\n //3.1 Remove the specified object from the list, by object or index\n cars.remove(\"Chevrolet\");\n cars.remove(7);\n //3.2 Remove all the elements from the list\n ArrayList<String> cars3 = new ArrayList<String>(cars);\n cars3.clear();\n //3.3 Remove elements from an specific range\n ArrayList<String> cars4 = new ArrayList<String>(cars);\n cars4.subList(4,6).clear();\n\n //4. Searching elements in the List\n //4.1 Search the specified element, return false if the specified element is not found\n cars.contains(\"Fiat\");\n //4.2 Returns the index of the first occurrence of the specified element\n cars.indexOf(\"BMW\");\n\n //5. Replaces the element at the specified position with the new element\n cars.set(3,\"Nissan\");\n }", "private void updateTrackingList(HashMap<String, ArrayList<Passenger>> pasGroupList, ArrayList<Passenger> individualList) {\n Iterator<String> iter = pasGroupList.keySet().iterator();\n while (iter.hasNext()) {\n String gName = iter.next();\n ArrayList<Passenger> group = pasGroupList.get(gName);\n groupReservedList.put(gName, new GroupOfPassenger(group, gName, group.get(1).isEconomy()));\n }\n\n for (Passenger k : individualList) {\n individualReservedList.put(k.getName(), k);\n }\n }", "public PriceList getPriceList() {\n\t\treturn priceList;\n\t}", "public Collection<Item> getSortedItems() {\n\t\tint i, j, first;\n\t int numLength = items.size();\n\t for (i= numLength - 1; i > 0; i--)\n\t {\n\t first = 0; // initialize to subscript of first element\n\t for (j=1; j<=i; j++) // locate smallest between positions 1 and i.\n\t {\n\t if (getQuantityOfItem(items.get(j).getItem()) < \n\t \t\t getQuantityOfItem(items.get(first).getItem()) )\n\t first = j;\n\t }\n\t //temp = items.get(first); // Swap smallest found with element in position i.\n\t //items.get(first)=items.get(i);\n\t ItemPair itemI = items.get(i);\n\t ItemPair firstitem = items.get(first);\n\t ItemPair temp = itemI;\n\t itemI = firstitem;\n\t firstitem = temp;\n\t \n\t // items.get(i)=temp;\n\t //num[first] = num[i];\n\t // num[i] = temp;\n\t }\n\t \n\t}", "public BudgetClass(double budget, ArrayList<ShoppingItems> shoppingList) {\n initialBudget = budget;\n this.shoppingList = shoppingList;\n Collections.sort(shoppingList, new SortingClass());\n buyItems(shoppingList);\n }", "@Test\n public void testItem_Ordering() {\n OasisList<Integer> baseList = new SegmentedOasisList<>(2, 2);\n\n List<Integer> expResult = Arrays.asList(1, 2, 6, 8);\n baseList.addAll(expResult);\n\n for (int i = 0; i < expResult.size(); i++) {\n assertEquals(expResult.get(i), baseList.get(i));\n }\n }", "public List<Distribution> calculateDistribution() {\n String[] distinctExpenses = getDistinctElements(listOfTargets);\n distributionList = initializeList(distinctExpenses);\n\n for (int i = 0; i < distributionList.size(); i++) {\n for (int j = 0; j < distinctExpenses.length; j++) {\n\n if (distinctExpenses[i].equals(distributionList.get(i).getName())) {\n distributionList.get(i).setAmount(valueLoader(distinctExpenses[i]));\n double tmp1 = valueLoader(distinctExpenses[i]);\n double tmp2 = sumOfExpenses;\n distributionList.get(i).setPercentage(tmp1 / tmp2 * 100);\n logger.debug(\"Calculated the distribution of an entity. {}\",\n distributionList.get(i).toString());\n }\n }\n }\n return distributionList;\n }", "private static <File> void merge(ArrayList<File> firstList, ArrayList<File> secondList,\r\n ArrayList<File> wholeList, Comparator<File> usedComparison) {\r\n int i = 0;\r\n int j = 0;\r\n int k = 0;\r\n while (i < firstList.size() && j < secondList.size()) {\r\n if (usedComparison.compare(firstList.get(i), secondList.get(j)) < 0) {\r\n wholeList.set(k++, firstList.get(i++));\r\n } else {\r\n wholeList.set(k++, secondList.get(j++));\r\n }\r\n }\r\n while (i < firstList.size()) {\r\n wholeList.set(k++, firstList.get(i++));\r\n }\r\n while (j < secondList.size()) {\r\n wholeList.set(k++, secondList.get(j++));\r\n }\r\n }", "private void setFurnitureInPlace(ArrayList<Furniture> furnitures, ArrayList<Place> places) {\n for (int i = 0; i < furnitures.size(); i++) {\n for (int j = 0; j < places.size(); j++) {\n if (places.get(j).getName().equals(furnitures.get(i).getLinkedPlace())) {\n // is linked Place\n places.get(j).addObjectToPlace(furnitures.get(i));\n }\n }\n }\n }", "public Map<Pricelist, Double> getSalesPrPricelist() {\n\t\tMap<Pricelist, Double> sales = new HashMap<>();\n\n\t\tfor (Order o : orders) {\n\t\t\tDouble currentTotal = sales.get(o.getPricelist());\n\n\t\t\tif (currentTotal == null) {\n\t\t\t\tcurrentTotal = 0.0;\n\t\t\t}\n\n\t\t\tcurrentTotal += o.totalPrice();\n\n\t\t\tsales.put(o.getPricelist(), currentTotal);\n\t\t}\n\n\t\treturn sales;\n\t}", "private void fixedPriceListings(FindItemsAdvancedRequest request, List<FindItemsAdvancedResponse> responses, Search search, Boolean automatic) throws Exception {\r\n\t\tif (SearchRequestMaker.isFixedPriceSelected(search)) {\r\n\t\t\tListingType listingType = ListingType.FIXED_PRICE;\r\n\t\t\trequest.getItemFilter().add(SearchRequestMaker.listingTypeFixedPrice(search));\r\n\t\t\t//time filter for fixed price listings(so reduce too many results)\r\n//\t\t\trequest.getItemFilter().add(SearchRequestMaker.startTimeFilter(search));\r\n\t\t\tif (search.getKeywordsQueries().size() == 0) {\r\n\t\t\t\tFindItemsAdvancedResponse response = sendRequestAndGetResponse(request, search, automatic, listingType);\r\n\t\t\t\tresponses.add(response);\r\n\t\t\t} else {\r\n\t\t\t\tfor (String keywords : search.getKeywordsQueries()) {\r\n\t\t\t\t\trequest.setKeywords(keywords);\r\n\t\t\t\t\tFindItemsAdvancedResponse response = sendRequestAndGetResponse(request, search, automatic, listingType);\r\n\t\t\t\t\tresponses.add(response);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//remove starting filter + listing type filter\r\n//\t\t\trequest.getItemFilter().remove(request.getItemFilter().size() - 1);\r\n\t\t\trequest.getItemFilter().remove(request.getItemFilter().size() - 1);\r\n\t\t}\r\n\t}", "public void setPricingElement(\r\n @NonNull\r\n final List<SalesOrderHeaderPrElement> value) {\r\n if (toPricingElement == null) {\r\n toPricingElement = Lists.newArrayList();\r\n }\r\n toPricingElement.clear();\r\n toPricingElement.addAll(value);\r\n }", "public Collection getSortedEntries(final PropertyAccessor sortProperty, boolean descending) {\n \t\tIEntryQueries queries = (IEntryQueries)getSession().getAdapter(IEntryQueries.class);\n \tif (queries != null) {\n \t\treturn queries.getSortedEntries(this, sortProperty, descending);\n \t} else {\n \t\t// IEntryQueries has not been implemented in the datastore.\n \t\t// We must therefore provide our own implementation.\n \t\t\n \t\tList sortedEntries = new LinkedList();\n \t\t\n \t\tIterator it = entries.iterator();\n \t\twhile (it.hasNext()) {\n \t\t\tsortedEntries.add(it.next());\n \t\t}\n \t\t\n \t\tComparator entryComparator;\n \t\tif (sortProperty.getPropertySet() == EntryInfo.getPropertySet()) {\n \t\t\tentryComparator = new Comparator() {\n \t\t\t\tpublic int compare(Object a, Object b) {\n \t\t\t\t\tObject value1 = ((Entry) a).getPropertyValue(sortProperty);\n \t\t\t\t\tObject value2 = ((Entry) b).getPropertyValue(sortProperty);\n \t\t\t\t\tif (value1 == null && value2 == null) return 0;\n \t\t\t\t\tif (value1 == null) return 1;\n \t\t\t\t\tif (value2 == null) return -1;\n \t\t\t\t\tif (Comparable.class.isAssignableFrom(sortProperty.getValueClass())) {\n \t\t\t\t\t\treturn ((Comparable)value1).compareTo(value2);\n \t\t\t\t\t} else {\n \t\t\t\t\t\tthrow new RuntimeException(\"not yet implemented\");\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t};\n \t\t} else if (sortProperty.getPropertySet() == TransactionInfo.getPropertySet()) {\n \t\t\tentryComparator = new Comparator() {\n \t\t\t\tpublic int compare(Object a, Object b) {\n \t\t\t\t\tObject value1 = ((Entry) a).getTransaction().getPropertyValue(sortProperty);\n \t\t\t\t\tObject value2 = ((Entry) b).getTransaction().getPropertyValue(sortProperty);\n \t\t\t\t\tif (value1 == null && value2 == null) return 0;\n \t\t\t\t\tif (value1 == null) return 1;\n \t\t\t\t\tif (value2 == null) return -1;\n \t\t\t\t\tif (Comparable.class.isAssignableFrom(sortProperty.getValueClass())) {\n \t\t\t\t\t\treturn ((Comparable)value1).compareTo(value2);\n \t\t\t\t\t} else {\n \t\t\t\t\t\tthrow new RuntimeException(\"not yet implemented\");\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t};\n \t\t} else if (sortProperty.getPropertySet() == AccountInfo.getPropertySet()) {\n \t\t\tentryComparator = new Comparator() {\n \t\t\t\tpublic int compare(Object a, Object b) {\n \t\t\t\t\tObject value1 = ((Entry) a).getAccount().getPropertyValue(sortProperty);\n \t\t\t\t\tObject value2 = ((Entry) b).getAccount().getPropertyValue(sortProperty);\n \t\t\t\t\tif (value1 == null && value2 == null) return 0;\n \t\t\t\t\tif (value1 == null) return 1;\n \t\t\t\t\tif (value2 == null) return -1;\n \t\t\t\t\tif (Comparable.class.isAssignableFrom(sortProperty.getValueClass())) {\n \t\t\t\t\t\treturn ((Comparable)value1).compareTo(value2);\n \t\t\t\t\t} else {\n \t\t\t\t\t\tthrow new RuntimeException(\"not yet implemented\");\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t};\n \t\t} else {\n \t\t\tthrow new RuntimeException(\"given property cannot be used for entry sorting\");\n \t\t}\n \t\t\n \t\tif (descending) {\n \t\t\tfinal Comparator ascendingComparator = entryComparator;\n \t\t\tentryComparator = new Comparator() {\n \t\t\t\tpublic int compare(Object a, Object b) {\n \t\t\t\t\treturn ascendingComparator.compare(b, a);\n \t\t\t\t}\n \t\t\t};\n \t\t}\n \t\t\n \t\tCollections.sort(sortedEntries, entryComparator);\n \t\t\n \t\treturn sortedEntries;\n \t}\n \t}", "public static void main(String[] args) {\n\t\tList<Map<String, Object>> dataList = new ArrayList<>();\n\t\tMap<String, Object> apple = new TreeMap<>();\n\t\tapple.put(\"Items\", \"Apple\");\n\t\tapple.put(\"Price\", 20.00);\n\t\tapple.put(\"Quantity\", 10);\n\n\t\tdataList.add(apple);\n\n\t\tMap<String, Object> orange = new TreeMap<String, Object>();\n\t\torange.put(\"Items\", \"Orange\");\n\t\torange.put(\"Price\", 21.99);\n\t\torange.put(\"Quantity\", 10);\n\n\t\tdataList.add(orange);\n\n\t\tSet<String> appleEntry = apple.keySet();\n\n\t\tIterator<String> appleIt = appleEntry.iterator();\n\n\t\tObject t = 0;\n\t\twhile (appleIt.hasNext()) {\n\t\t\tString key = appleIt.next();\n\t\t\tObject value = apple.get(key);\n\n\t\t\tdouble p = (double) apple.get(\"Price\");\n\t\t\tInteger q = (Integer) apple.get(\"Quantity\");\n\t\t\tt = p * q;\n\n\t\t\tSystem.out.print(key + \": \" + value + \" \");\n\t\t}\n\t\tSystem.out.println(\"SubTotal: \" + t);\n\n\t\tSet<String> orangeEntry = orange.keySet();\n\n\t\tObject t1 = 0;\n\t\tfor (String forLoop : orangeEntry) {\n\t\t\tString key = forLoop;\n\t\t\tObject value = orange.get(forLoop);\n\n\t\t\tDouble p = (Double) orange.get(\"Price\");\n\t\t\tInteger q = (Integer) orange.get(\"Quantity\");\n\t\t\tt1 = p * q;\n\n\t\t\tSystem.out.print(key + \": \" + value + \" \");\n\t\t}\n\t\tSystem.out.println(\"SubTotal: \" + t1);\n\n\t\tdouble appleTotal = (double) t;\n\t\tdouble orangeTotal = (double) t1;\n\t\tdouble totalPurchase = appleTotal + orangeTotal;\n\n\t\tSystem.out.println(\"Your Purchase is: \" + totalPurchase);\n\n\t\tSystem.out.println(\"- - - A N O T H E R - W A Y - - -\");\n\n\t\tList<Map<String, Object>> dataList1 = new ArrayList<Map<String, Object>>();\n\n\t\tMap<String, Object> appleMap = new HashMap<String, Object>();\n\t\tappleMap.put(\"Items\", \"Apple\");\n\t\tappleMap.put(\"Price\", 20.00);\n\t\tappleMap.put(\"Quantity\", 10);\n\t\tdataList1.add(appleMap);\n\n\t\tMap<String, Object> orangeMap = new HashMap<String, Object>();\n\t\torangeMap.put(\"Items\", \"Orange\");\n\t\torangeMap.put(\"Price\", 21.99);\n\t\torangeMap.put(\"Quantity\", 10);\n\n\t\tdataList1.add(orangeMap);\n\n\t\t// find purchase total Price.\n\t\tdouble purchaseTotalPrice = 0;\n\n\t\tfor (Map<String, Object> map : dataList1) {\n\t\t\tString items = map.get(\"Items\").toString();\n\t\t\tdouble price = Double.parseDouble(map.get(\"Price\").toString());\n\t\t\tdouble quantity = Double.parseDouble(map.get(\"Quantity\").toString());\n\t\t\tdouble lineTotal = price * quantity;\n\n\t\t\tSystem.out.println(\n\t\t\t\t\t\"Items: \" + items + \" Price: \" + price + \" Quantity: \" + quantity + \" SubTotal: \" + lineTotal);\n\t\t\tpurchaseTotalPrice += lineTotal;\n\t\t}\n\t\tSystem.out.println(\"Your Purchase total : \" + purchaseTotalPrice);\n\t}", "private void sortAddsAndRemoves(Collection<? extends Geometry> adds, Collection<? extends Geometry> removes,\n LazyMap<ProcessorDistributionKey, Collection<Geometry>> addKeyToGeoms,\n LazyMap<ProcessorDistributionKey, Collection<Geometry>> removeKeyToGeoms)\n {\n myUnprocessedGeometryLock.lock();\n try\n {\n sortByKeys(addKeyToGeoms, adds, myUnprocessedAdds);\n sortByKeys(removeKeyToGeoms, removes, null);\n }\n finally\n {\n myUnprocessedGeometryLock.unlock();\n }\n }", "private void displayListings() {\r\n\r\n //Lists all current listings\r\n System.out.println(\"Current Listings: \\n\" + cars.getListings());\r\n placeBid();\r\n }", "@FXML\n public void generateShoppingList(){\n\n shoppingListIngredients.clear();\n //loop through all days of the weeklist\n for (Days dm : ObservableWeekList){\n //if breakfast is set add ingredients to shopping list\n if (dm.isBreakfastSet()){\n shoppingListIngredients.addAll(dm.getBreakfast().getIngredients());\n }\n //if lunch is set add ingredients to shopping list\n if (dm.isLunchSet()){\n shoppingListIngredients.addAll(dm.getLunch().getIngredients());\n }\n //if dinner is set add ingredients to shopping list\n if (dm.isDinnerSet()){\n shoppingListIngredients.addAll(dm.getDinner().getIngredients());\n }\n }\n\n //Sort list into alphabetical order and combine repeat ingredients together adding up their quantities\n if (shoppingListIngredients.size() > 0){\n //sort the order of the list into alphabetical by ingredient name\n shoppingListIngredients.sort( ((o1, o2) -> o1.getName().compareTo(o2.getName())));\n if (shoppingListIngredients.size() > 1){\n for (int i = 0; i < shoppingListIngredients.size() -1; i ++){\n //get the unique ID of the ingredients to compare\n int firstIngredientID = shoppingListIngredients.get(i).getId();\n int secondIngredientID = shoppingListIngredients.get(i+1).getId();\n //if the ingredients are the same. Add their quantities together and remove one of them\n if (firstIngredientID == secondIngredientID){\n double firstIngredientQuantity = shoppingListIngredients.get(i).getQuantityInGrams();\n double secondIngredientQuantity = shoppingListIngredients.get(i+1).getQuantityInGrams();\n shoppingListIngredients.get(i).setQuantityInGrams(firstIngredientQuantity +\n secondIngredientQuantity);\n shoppingListIngredients.remove(i + 1);\n //if an ingredient is removed from the list then i needs to be rolled back by one so that\n //no ingredient is missed\n i --;\n }\n }\n }\n }\n\n //compare the cupboard ingredients list with shopping list. If the shopping list ingredient exists in the\n //cupboard stores then:\n //- If the cupboard stores has more than the required amount in shopping list, remove the ingredient from\n // the shopping list\n //- If the cupboard stores only has some of quantity required in the shopping list, reduce the quantity in the\n // the shopping list\n if (cupboardCheckBox.isSelected()){\n for (int z = 0; z < shoppingListIngredients.size(); z++){\n Ingredient shoppingIngredient = shoppingListIngredients.get(z);\n for (Ingredient cupboardIngredients: cupboardIngredients){\n if (shoppingIngredient.getId() == cupboardIngredients.getId()){\n //if the shopping list ingredients is already in the cupboard\n if (cupboardIngredients.getQuantityInGrams() > shoppingIngredient.getQuantityInGrams()){\n //if there is enough in the the cupboard remove item from the shopping list\n shoppingListIngredients.remove(shoppingIngredient);\n z --;\n } else {\n //if there isnt enough in the cupboard stores\n //remove the cupboard amount from the shopping item\n double newAmountInGrams = shoppingIngredient.getQuantityInGrams() \n - cupboardIngredients.getQuantityInGrams();\n shoppingIngredient.setQuantityInGrams(newAmountInGrams);\n }\n }\n }\n }\n }\n\n //When the shopping list is newly generated then the planner and shopping list are in sync\n plannerOutOfSyncWithShoppingList(false);\n //save when the shopping list was generated\n settings.setGeneratedShoppingList(LocalDateTime.now());\n //go to view the shopping list pane to view the shopping list straight away\n plannerShoppingListBtnClicked();\n\n //save the shopping list\n Data.<Ingredient>saveList(shoppingListIngredients, shoppingListFile);\n\n }", "public static void sort(ArrayList<Number> list) {\r\n\t\t\t\t\tfor (int i = 0; i < list.size(); i++) {\r\n\t\t\t\t\t\tfor (int j = 0; j < list.size(); j++) {\r\n\t\t\t\t\t\t\t// Ako je vrijadnost elementa na idneksu i manja od vrijednosti\r\n\t\t\t\t\t\t\t// elementa na idneksu j, zamijeni im pozicije.\r\n\t\t\t\t\t\t\tif (list.get(i).doubleValue() < list.get(j).doubleValue()) {\r\n\t\t\t\t\t\t\t\t// Cuvamo elemenat sa drugog indeksa u temp varijabli.\r\n\t\t\t\t\t\t\t\tNumber temp = list.get(j);\r\n\t\t\t\t\t\t\t\t// Kopiramo elemenat sa prvog indeksa preko drugog elementa.\r\n\t\t\t\t\t\t\t\tlist.set(j, list.get(i));\r\n\t\t\t\t\t\t\t\t// Kopiramo temp (drugi elemenat) preko prvog elementa.\r\n\t\t\t\t\t\t\t\tlist.set(i, temp);\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\r\n\t\t}", "public void sortProperties (ArrayList<Property> properties, String branchName) {\r\n\t\tsoldProperties.clear();\r\n\t\tnotSoldProperties.clear();\r\n\t\totherProperties.clear();\r\n \tint size = properties.size();\r\n \tfor (int i = 0; i < size; i++) {\r\n \t\tif (properties.get(i).getBranchName().equals(branchName)) {\r\n \t\t\tif (!properties.get(i).getSoldPrice().equals(\"\")) {\r\n \t\t\t\tsoldProperties.add(properties.get(i));\r\n \t\t\t}\r\n \t\t\telse {\r\n \t\t\t\tnotSoldProperties.add(properties.get(i));\r\n \t\t\t}\r\n \t\t}\r\n \t\telse {\r\n\t\t\t\totherProperties.add(properties.get(i));\r\n\t\t\t}\r\n \t}\r\n\t}", "public static <T extends Comparable<? super T>> List<T> merge(Collection<T> c1, Collection c2) {\n return merge(c1, c2, Comparator.naturalOrder(), DEFAULT_ALLOW_DUP);\n }", "private static void findPrice(){\n Document document;\n String newURL = getLink(broadWebsite)[0];\n\n try{\n document = Jsoup.connect(website +newURL).userAgent(USER_AGENT).get();\n }\n catch(IOException e){\n return;\n }\n System.out.println(\"hi\");\n //System.out.println(link);\n Elements elements = document.getElementsByClass(\"vehicle-info__price-display\");\n\n // for(Element e : elements){\n // System.out.println(e);\n // for(DataNode node : e.dataNodes()){\n // //If the key does not exist, then create a new one and add value to it\n // if(map.get(link) == null){\n // map.put(link, new ArrayList<String>());\n // map.get(link).add(\"Price: \"+ node.attr(\"price\")+\"\\n\");\n // }\n // //If it is there already, then just add\n // else{\n // map.get(link).add(\"Price: \"+ node.attr(\"price\")+\"\\n\");\n // }\n // }\n\n // }\n\n for(Element e : elements){\n System.out.println(e);\n System.out.println(\"---\");\n }\n }", "double getTotalPortfolioValue(){\n double total = 0.0;\n for (Listing<P, C> l : this.collectionOfCurrentListings) {\n total += l.getContract().getTotalPrice() * this.commissionRate;\n }\n return total;\n }", "public void addAll(Collection other) {\n\n\t\tclass AddProcessor extends Processor {\n\t\t\tpublic void process(Object value) {\n\t\t\t\tadd(value);\n\t\t\t}\n\t\t}\n\t\tAddProcessor addProcessor = new AddProcessor();\n\n\t\tother.forEach(addProcessor);\n\t}", "Collection<S> getStories ();", "boolean assignPropToKingdom(List<Property> list, Kingdom kingdom) throws Exception;", "Set<Art> getArtByPrice(Double upper, Double lower);", "interface Listings {\n String getObjectID();\n\n void setObjectID(String objectID);\n\n String getName();\n\n void setName(String name);\n\n String getEmail();\n\n void setEmail(String email);\n\n String getCurrentRate();\n\n void setCurrentRate(String currentrate);\n\n String getTotalSales();\n\n void setTotalSales(String totalSales);\n\n String getUserImage();\n\n void setUserImage(String userimage);\n}", "public ListUtilities cocktailSort(){\n\t\tboolean swaps = true;\n\t\tListUtilities temp = new ListUtilities();\n\t\t\n\t\twhile(swaps == true){\n\t\t\t//no swaps to begin with\n\t\t\tswaps = false;\n\n\t\t\t//if not end of list\n\t\t\tif (this.nextNum != null){\n\t\t\t\t\n\t\t\t\t//make temp point to next\n\t\t\t\ttemp = this.nextNum;\n\n\t\t\t\t//if b is greater than c\n\t\t\t\tif(this.num > this.nextNum.num){\n\t\t\t\t\t//it swapped\n\t\t\t\t\tswaps = true;\n\t\t\t\t\t\n\t\t\t\t\tswapF(temp);\n\t\t\t\t}\n\t\t\t//keep going until you hit end of list\n\t\t\ttemp.cocktailSort();\n\t\t\t}\n\t\t\t//if not beginning of list\n\t\t\tif (this.prevNum != null){\n\t\t\t\t//if c is smaller than b\n\t\t\t\tif(this.num < this.prevNum.num){\n\t\t\t\t\t//it swapped\n\t\t\t\t\tswaps = true;\n\t\t\t\t\tswapB(temp);\n\t\t\t\t}\n\t\t\t\t//keep going until hit beginning of list\n\t\t\t\ttemp.cocktailSort();\n\t\t\t}\n\t\t}\n\t//return beginning of list\n\treturn this.returnToStart();\n\t}", "public ArrayList<Book> getBookList()\r\n {\r\n ArrayList<Book> bookCopy = new ArrayList<Book>();\r\n //Add code here to copy the bookList ArrayList elements into the local variable bookCopy and return bookCopy\r\n //Hint: You will use the 2-arg Book constructor and the getters or you can add a copy constructor to the Book\r\n //Class\r\n for(Book book: bookList){\r\n Book bk = new Book(book.getTitle(), book.getPrice());\r\n bookCopy.add(bk);\r\n }\r\n return bookCopy;\r\n }", "void updatePaintings(Painting p) {\r\n\t\t\tthis.paintings = new ConsList<Painting>(p, this.paintings);\r\n\t}", "private void addPartList ()\r\n {\r\n // Map (page) ScorePart -> (score) ScorePart data\r\n List<ScorePart> partList = new ArrayList<>();\r\n\r\n for (Result result : connection.getResultMap().keySet()) {\r\n ScorePart scorePart = (ScorePart) result.getUnderlyingObject();\r\n partList.add(scorePart);\r\n }\r\n\r\n // Need map: pagePart instance -> set of related systemPart instances\r\n // (Since we only have the reverse link)\r\n Map<ScorePart, List<SystemPart>> page2syst = new LinkedHashMap<>();\r\n\r\n for (TreeNode pn : score.getPages()) {\r\n Page page = (Page) pn;\r\n\r\n for (TreeNode sn : page.getSystems()) {\r\n ScoreSystem system = (ScoreSystem) sn;\r\n\r\n for (TreeNode n : system.getParts()) {\r\n SystemPart systPart = (SystemPart) n;\r\n\r\n ScorePart pagePart = systPart.getScorePart();\r\n List<SystemPart> cousins = page2syst.get(pagePart);\r\n\r\n if (cousins == null) {\r\n cousins = new ArrayList<>();\r\n page2syst.put(pagePart, cousins);\r\n }\r\n\r\n cousins.add(systPart);\r\n }\r\n }\r\n }\r\n\r\n // Align each candidate to its related result (System -> Page -> Score)\r\n for (Result result : connection.getResultMap().keySet()) {\r\n ScorePart scorePart = (ScorePart) result.getUnderlyingObject();\r\n int newId = scorePart.getId();\r\n\r\n for (Candidate candidate : connection.getResultMap().get(result)) {\r\n ScorePart pagePart = (ScorePart) candidate.getUnderlyingObject();\r\n // Update (page) part id\r\n pagePart.setId(newId);\r\n\r\n // Update all related (system) part id\r\n for (SystemPart systPart : page2syst.get(pagePart)) {\r\n systPart.setId(newId);\r\n }\r\n }\r\n }\r\n\r\n score.setPartList(partList);\r\n }", "public static void main(String args[]) {\n LinkedList<Integer> ll = new LinkedList<Integer>();\r\n ll.add(new Integer(-8));\r\n ll.add(new Integer(20));\r\n ll.add(new Integer(-20));\r\n ll.add(new Integer(8));\r\n\r\n // Create a reverse order comparator\r\n Comparator<Integer> r = Collections.reverseOrder();\r\n // Sort list by using the comparator\r\n Collections.sort(ll, r);\r\n // Get iterator\r\n Iterator<Integer> li = ll.iterator();\r\n System.out.print(\"List sorted in reverse: \");\r\n while (li.hasNext()) {\r\n System.out.print(li.next() + \" \");\r\n }\r\n System.out.println(\"\\nList sorted in reverse: \" + ll);\r\n System.out.println();\r\n Collections.shuffle(ll);\r\n // display randomized list\r\n li = ll.iterator();\r\n System.out.print(\"List shuffled: \");\r\n while (li.hasNext()) {\r\n System.out.print(li.next() + \" \");\r\n }\r\n System.out.println(\"\\nList shuffled: \" + ll);\r\n System.out.println();\r\n System.out.println(\"Minimum: \" + Collections.min(ll));\r\n System.out.println(\"Maximum: \" + Collections.max(ll));\r\n\r\n LinkedList<Integer> cll = new LinkedList<Integer>();\r\n for (int i = 0; i < 4; i++) {\r\n cll.add(0);\r\n }\r\n Collections.copy(cll, ll);\r\n System.out.println(\"Collections.copy: \" + cll);\r\n Collections.fill(cll, new Integer(1));\r\n System.out.println(\"Collections.fill: \" + cll);\r\n Vector<Double> v = new Vector<Double>();\r\n v.addElement(1.0);\r\n v.add(2.0);\r\n ArrayList<Double> al = Collections.list(v.elements());\r\n System.out.println(\"list: \" + al);\r\n System.out.println(\"nCopies: \" + Collections.nCopies(3, Boolean.TRUE));\r\n Collections.reverse(al);\r\n System.out.println(\"reverse: \" + al);\r\n al.add(3.0);\r\n Collections.sort(al);\r\n System.out.println(\"sort: \" + al);\r\n Collections.rotate(al, 1);\r\n System.out.println(\"rotate 1: \" + al);\r\n Collections.rotate(al, -2);\r\n System.out.println(\"rotate -2: \" + al);\r\n Collections.swap(al, 0, 2);\r\n System.out.println(\"swap: \" + al);\r\n al.add(2.0);\r\n al.add(2.0);\r\n ArrayList<Double> sub = new ArrayList<>();\r\n sub.add(2.0);\r\n System.out.println(\"list: \" + al);\r\n System.out.println(\"sublist: \" + sub);\r\n System.out.println(\"lastIndexOfSubList: \" + Collections.lastIndexOfSubList(al, sub));\r\n System.out.println(\"indexOfSubList: \" + Collections.indexOfSubList(al, sub));\r\n\r\n Set<ArrayList<Double>> nl = Collections.singleton(al);\r\n System.out.println(\"singleton:\" + nl);\r\n System.out.println(\"EMPTY_LIST: \" + Collections.EMPTY_LIST);\r\n System.out.println(\"EMPTY_MAP: \" + Collections.EMPTY_MAP);\r\n System.out.println(\"EMPTY_SET: \" + Collections.EMPTY_SET);\r\n\r\n // create arraylist\r\n ArrayList<String> arlst = new ArrayList<String>();\r\n\r\n // populate the list\r\n arlst.add(\"TP\");\r\n arlst.add(\"PROVIDES\");\r\n arlst.add(\"QUALITY\");\r\n arlst.add(\"TUTORIALS\");\r\n\r\n // search the list for key 'QUALITY'\r\n int index = Collections.binarySearch(arlst, \"QUALITY\");\r\n\r\n System.out.println(\"'QUALITY' is available at index: \" + index);\r\n }" ]
[ "0.56480163", "0.56260735", "0.5543059", "0.5451158", "0.5399597", "0.52988446", "0.5208655", "0.5161028", "0.5153475", "0.5141057", "0.5006064", "0.49492434", "0.49425417", "0.49413222", "0.49281886", "0.48918596", "0.4889791", "0.487845", "0.48659155", "0.48410255", "0.4825534", "0.479358", "0.4789111", "0.47857735", "0.47514883", "0.47298986", "0.47202963", "0.47159943", "0.46868747", "0.46649212", "0.46469545", "0.4645382", "0.46434", "0.46256503", "0.46241736", "0.461909", "0.46184397", "0.46106604", "0.46106517", "0.46077567", "0.46051845", "0.46016437", "0.45976177", "0.45928434", "0.45920438", "0.45738557", "0.4572622", "0.45717523", "0.45715883", "0.45626822", "0.4559316", "0.45516253", "0.4551551", "0.45513073", "0.45492923", "0.4540648", "0.45319676", "0.45297047", "0.45296338", "0.45184064", "0.45124695", "0.45069912", "0.45008218", "0.4495889", "0.4489932", "0.44824055", "0.4468472", "0.4466982", "0.4456739", "0.44565225", "0.4454443", "0.44540703", "0.44505805", "0.44422373", "0.44396213", "0.44319683", "0.44306505", "0.44306433", "0.442697", "0.44268277", "0.44262287", "0.44218436", "0.4417178", "0.44135207", "0.44106683", "0.44068602", "0.43964612", "0.4394331", "0.43918416", "0.43911618", "0.43908346", "0.43763116", "0.4373112", "0.43727732", "0.43724552", "0.43697476", "0.43688527", "0.43660283", "0.43646985", "0.43609822" ]
0.6645982
0
Constructor with 2 fields
public BankAccount(double checkingBalance, double savingsBalance) { this.checkingBalance = checkingBalance; this.savingsBalance = savingsBalance; accountsCount++; totalAmount += checkingBalance; totalAmount += savingsBalance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Constructor() {\r\n\t\t \r\n\t }", "public Field(){\n\n // this(\"\",\"\",\"\",\"\",\"\");\n }", "public Person2(String fname, String lname) {\n this.fname = fname;\n this.lname = lname;\n }", "public Identity()\n {\n super( Fields.ARGS );\n }", "public Constructor(){\n\t\t\n\t}", "public Account() {\n this(0, 0.0, \"Unknown name\"); // Invole the 2-param constructor\n }", "public Person(String first, String last) {\n // Set instance var firstname to what is called from constructor\n this.firstName = first; \n // Set instance var lastname to what is called from constructor\n this.lastName = last;\n }", "public ARecord(Integer f1, Integer f2) {\n super(A.A);\n\n setF1(f1);\n setF2(f2);\n }", "public Field(String watermark,\n String showfieldname,\n String saveRequired,\n String jfunction,\n String onChange,\n String onKeyDown,\n String defaultValue,\n String type,\n String sqlValue,\n String field_name,\n String relation,\n String states,\n String relationField,\n String onClickVList,\n String jIdList,\n String name,\n String searchRequired,\n String id,\n String placeholder,\n String value,\n String fieldType,\n String onclicksummary,\n String newRecord,\n List<Field> dListArray,\n List<OptionModel> mOptionsArrayList,\n String onclickrightbutton,\n String webSaveRequired,\n String field_type) {\n\n this.watermark = watermark;\n this.showfieldname = showfieldname;\n this.saveRequired = saveRequired;\n this.jfunction = jfunction;\n this.onChange = onChange;\n this.onKeyDown = onKeyDown;\n this.defaultValue = defaultValue;\n this.type = type;\n this.sqlValue = sqlValue;\n this.field_name = field_name;\n this.relation = relation;\n this.states = states;\n this.relationField = relationField;\n this.onClickVList = onClickVList;\n this.jIdList = jIdList;\n this.name = name;\n this.searchRequired = searchRequired;\n this.id = id;\n this.placeholder = placeholder;\n this.value = value;\n this.fieldType = fieldType;\n this.onclicksummary = onclicksummary;\n this.newRecord = newRecord;\n this.dListArray = dListArray;\n this.optionsArrayList = mOptionsArrayList;\n this.onclickrightbutton = onclickrightbutton;\n this.webSaveRequired = webSaveRequired;\n this.field_type = field_type;\n\n// this( watermark, showfieldname, saveRequired, jfunction,\n// onChange, onKeyDown, defaultValue, type, sqlValue,\n// field_name, relation, states, relationField,\n// onClickVList, jIdList, name, \"\",\n// searchRequired, id, placeholder, value,\n// fieldType, onclicksummary, newRecord, \"\",\n// dListArray,mOptionsArrayList,onclickrightbutton);\n }", "private void __sep__Constructors__() {}", "public Card() { this(12, 3); }", "public Field() {\r\n\t}", "public bwq(String paramString1, String paramString2)\r\n/* 10: */ {\r\n/* 11: 9 */ this.a = paramString1;\r\n/* 12:10 */ this.f = paramString2;\r\n/* 13: */ }", "public Pasien() {\r\n }", "public Message(){\n this(\"Not Specified\",\"Not Specified\");\n }", "public BaseParameters(){\r\n\t}", "public IntegerField() {\r this(3, 0, 0, 0);\r }", "public Contructor(int year, String name) {\n // constructor name must match class name and cannot have return type\n // all classes have constructor by default\n // f you do not create a class constructor yourself, Java creates one for you.\n // However, then you are not able to set initial values for object attributes.\n // constructor can also take parameters\n batchYear = year;\n studentName = name;\n }", "public Struct(String a, int b){\r\n\tid=a;\r\n\tsize=b;\t\r\n\tform=0;\r\n }", "public User(String n, int a) { // constructor\r\n name = n;\r\n age = a;\r\n }", "public CampoModelo(String valor, String etiqueta, Integer longitud)\n/* 10: */ {\n/* 11:17 */ this.valor = valor;\n/* 12:18 */ this.etiqueta = etiqueta;\n/* 13:19 */ this.longitud = longitud;\n/* 14: */ }", "public User(){\n this(null, null);\n }", "public BookRecord(String NameOfTheBook, String NameofWriter, int isbnNumber, double booksCost) \r\n\r\n{ \r\n\r\nthis.NameOfTheBook = NameOfTheBook; \r\n\r\nthis.NameofWriter = NameofWriter; \r\n\r\nthis.isbnNumber = isbnNumber; \r\n\r\nthis.booksCost = booksCost; \r\n\r\n}", "public Video( int arg1, int arg2 ) { \n\t\tsuper( );\n\t}", "public Person(String name, String address, String postalCode, String city, String phone){\n // initialise instance variables\n this.name = name;\n this.address = address;\n this.postalCode = postalCode;\n this.city = city;\n this.phone = phone;\n }", "public Tiempo2( int h ) { \n this( h, 0, 0 ); // invoca al constructor de Tiempo2 con tres argumentos\n }", "public Person(String vorname, String nachname) {\n\n\t}", "@Test\n\tpublic void testProfessorConstructor2params(){\n\t\tString firstname = \"Steven\";\n\t\tString lastName = \"Beaty\";\n\t\tProfessor testProfessor = new Professor(firstname, lastName);\n\t\tAssert.assertEquals(\"Steven\", testProfessor.getFirstName());\n\t\tAssert.assertEquals(\"Beaty\", testProfessor.getLastName());\n\t}", "public AirField() {\n\n\t}", "public User() {\r\n this(\"\", \"\");\r\n }", "public UserImplPart1(int studentId, String yourName, int yourAge,int yourSchoolYear, String yourNationality){\n this.studentId = studentId;\n this.name= yourName;\n this.age = yourAge; \n this.schoolYear= yourSchoolYear;\n this.nationality= yourNationality;\n}", "public MyGeneric(A a, B b) { // TODO: check parameter type\n\t\tthis.a = a;\n\t\tthis.b = b;\n\t}", "public Bank(){\n this(\"Seneca@York\", 0);\n }", "public void testCtor2() {\n instance = new LogMessage(type, id, operator, message);\n\n assertEquals(\"'type' should be correct.\", type, instance.getType());\n assertEquals(\"'id' should be correct.\", id, instance.getId());\n assertEquals(\"'message' should be correct.\", message, instance.getMessage());\n assertNull(\"'error' should be correct.\", instance.getError());\n }", "public Customer(@NotBlank(message = \"Name can't be blank\") String name, @NotBlank(message = \"Surname can't be blank\") String surname, @NotBlank(message = \"Phone can't be blank\") String phone, @NotNull(message = \"Date of birth can't be blank\") LocalDate dateOfBirth, int numberOfOffices, @NotNull(message = \"level of privilege can't be blank\") int levelOfPrivilege) {\n super(name, surname, phone, dateOfBirth);\n this.numberOfOffices = numberOfOffices;\n this.levelOfPrivilege = levelOfPrivilege;\n }", "@Test\n public void billCustomConstructor_isCorrect() throws Exception {\n\n int billId = 100;\n String billName = \"test Bill\";\n int userId = 101;\n int accountId = 202;\n double billAmount = 300.25;\n String dueDate = \"02/02/2018\";\n int occurrenceRte = 1;\n\n //Create empty bill\n Bill bill = new Bill(billId,userId,accountId,billName,billAmount,dueDate,occurrenceRte);\n\n // Verify Values\n assertEquals(billId, bill.getBillId());\n assertEquals(billName, bill.getBillName());\n assertEquals(userId, bill.getUserId());\n assertEquals(accountId, bill.getAccountId());\n assertEquals(billAmount, bill.getBillAmount(), 0);\n assertEquals(dueDate, bill.getDueDate());\n assertEquals(occurrenceRte, bill.getOccurrenceRte());\n }", "public Chauffeur() {\r\n\t}", "public Clade() {}", "public Person (String inName, String inFirstName, LocalDate inDateOfBirth) {\n super(inName);\n this.dateOfBirth = inDateOfBirth;\n this.firstName = inFirstName;\n }", "public StudentCourse() {\n this(\"student_course\", null);\n }", "public Achterbahn() {\n }", "public Users(String username, String password, String email, String phone)\r\n/* 53: */ {\r\n/* 54:67 */ this.username = username;\r\n/* 55:68 */ this.password = password;\r\n/* 56:69 */ this.email = email;\r\n/* 57:70 */ this.phone = phone;\r\n/* 58: */ }", "public PSRelation()\n {\n }", "public Person (String firstName, String lastName, String address) {\n this.firstName = firstName;\n this.lastName = lastName;\n this.address = address;\n\n }", "@Test\n public void purchaseCustomConstructor_isCorrect() throws Exception {\n\n int purchaseId = 41;\n int userId = 99;\n int accountId = 6541;\n double price = 99.99;\n String date = \"02/19/2019\";\n String time = \"12:12\";\n String category = \"test category\";\n String location = \"test location\";\n String comment = \"test comment\";\n\n //Create empty purchase\n Purchase purchase = new Purchase(purchaseId, userId, accountId, price, date, time, category, location, comment);\n\n // Verify Values\n assertEquals(purchaseId, purchase.getPurchaseId());\n assertEquals(userId, purchase.getUserId());\n assertEquals(accountId, purchase.getAccountId());\n assertEquals(price, purchase.getPrice(), 0);\n assertEquals(date, purchase.getDate());\n assertEquals(time, purchase.getTime());\n assertEquals(category, purchase.getCategory());\n assertEquals(location, purchase.getLocation());\n assertEquals(comment, purchase.getComment());\n }", "private GrupoCuenta(String nombre, int operacion)\r\n/* 11: */ {\r\n/* 12:31 */ this.nombre = nombre;\r\n/* 13:32 */ this.operacion = operacion;\r\n/* 14: */ }", "public CoinsuperPair() {}", "public BankAccount() {\n this(12346, 5.00, \"Default Name\", \"Default Address\", \"default phone\");\n }", "public UserParameter() {\n }", "PassengerPersonalInfo(String First_Name, String Last_Name, int Age, Date dob, \n String Address, String Nationality, long Number, String eID) { \n this.firstName = First_Name;\n this.lastName = Last_Name;\n this.age = Age;\n this.dateOfBirth = dob;\n this.address = Address;\n this.nationality = Nationality;\n this.contact = Number;\n this.email = eID;\n }", "@Test\n public void userCustomConstructor_isCorrect() throws Exception {\n\n int id = 123456;\n int pin_hash = 98745;\n int pin = 9876;\n String salt = \"test salt\";\n String username = \"testUsername\";\n int firstTime = 0;\n String budget = \"test\";\n int hasPin = 1;\n\n //Create empty user\n User user = new User(id, username, pin_hash, pin, salt, firstTime, budget, hasPin);\n\n // Verify Values\n assertEquals(id, user.getId());\n assertEquals(pin_hash, user.getPin_hash());\n assertEquals(pin, user.getPin());\n assertEquals(salt, user.getSalt());\n assertEquals(username, user.getUsername());\n assertEquals(firstTime, user.getFirstTime());\n assertEquals(budget, user.getBudget());\n assertEquals(hasPin, user.getHasPin());\n }", "public Tuple(Datum fieldIn) {\n fields = new ArrayList<Datum>(1);\n fields.add(fieldIn);\n }", "private Params()\n {\n }", "public Student() {\n//\t\tname = \"\";\n//\t\tage = 0;\n\t\t\n\t\t\n\t\t//call constructors inside of other constructors\n\t\tthis(999,0);\n\t}", "public Tuple2() {\n }", "public CyanSus() {\n\n }", "public MethodEx2() {\n \n }", "public CreateUser(int age, String name){ // constructor\n userAge = age;\n userName = name;\n }", "public Cgg_jur_anticipo(){}", "public Complex(){\r\n\t this(0,0);\r\n\t}", "public Tiempo2( Tiempo2 tiempo ) {\n // invoca al constructor de Tiempo2 con tres argumentos\n this( tiempo.obtenerHora(), tiempo.obtenerMinuto(), tiempo.obtenerSegundo() );\n }", "public Address(String street, String city, String zipCode, String country)\n {\n //reference the object classes constructors\n this.street = street;\n this.city = city;\n this.zipCode = zipCode;\n this.country = country;\n }", "public Car(String licensePlate, double fuelEconomy){\n this.licensePlate = licensePlate;\n this.fuelEconomy = fuelEconomy;\n}", "@Test\n public void constructor(){\n /**Positive tests*/\n Road road = new Road(cityA, cityB, 4);\n assertEquals(road.getFrom(), cityA);\n assertEquals(road.getTo(), cityB);\n assertEquals(road.getLength(), 4);\n }", "public Student()\n {\n lname = \"Tantiviramanond\";\n fname = \"Anchalee\";\n grade = 12;\n studentNumber = 2185;\n }", "public ListElement()\n\t{\n\t\tthis(null, null, null); //invokes constructor with 3 arguments\n\t}", "public AirAndPollen() {\n\n\t}", "public Pitonyak_09_02() {\r\n }", "public Tiempo2( int h, int m ) { \n this( h, m, 0 ); // invoca al constructor de Tiempo2 con tres argumentos\n }", "private Font(long paramLong, Object paramObject) {\n/* 1031 */ this.a = paramLong;\n/* 1032 */ this.b = paramObject;\n/* */ }", "public StudentRecord() {}", "public Graph()\r\n {\r\n this( \"x\", \"y\" );\r\n }", "public HLCPaymentDetails() { }", "public AntrianPasien() {\r\n\r\n }", "public Parameters() {\n\t}", "public User (String username, String password, String fname, String lname) {\n\t\tthis.username = username;\n\t\tthis.password = password;\n\t\tthis.FirstName = fname;\n\t\tthis.LastName = lname;\n\t}", "public creditPayment(String nm,String expdate,long no,double paymentAmount)\n{\nname=nm;\nexdate=expdate;\ncardnumber=no;\namount = paymentAmount;\n}", "public Pair(Pair<T,V> p){\r\n this.v1 = p.v1;\r\n this.v2 = p.v2;\r\n }", "public LightParameter()\r\n\t{\r\n\t}", "public SalesPerson(String firstName, String lastName, String ppsNumber){\r\n //pulls the constructor with parameters from the superclass SalesEmployee\r\n super(firstName, lastName, ppsNumber);\r\n }", "public Employee(){\r\n this(\"\", \"\", \"\", 0, \"\", 0.0);\r\n }", "public ModuleParams()\n\t{\n\t}", "public Profile(String birthDate, String description, String address, Album album)\r\n {\r\n // initialise instance variables\r\n this.birthDate = birthDate;\r\n this.description = description;\r\n this.address = address;\r\n this.album = album;\r\n }", "public Bombas(int x,int y) {\n \tsuper(x,y);\n }", "public Par(A itemA, B itemB) {\r\n\t\tthis.itemA = itemA;\r\n\t\tthis.itemB = itemB;\r\n\t}", "public StringData1() {\n }", "public SeqArg(Argument a1, Argument a2){\n this.a1 = a1;\n this.a2 = a2;\n }", "@Test\n public void goalCustomConstructor_isCorrect() throws Exception {\n\n int goalId = 11;\n int userId = 1152;\n String name = \"Test Name\";\n int timePeriod = 1;\n int unit = 2;\n double amount = 1000.52;\n\n\n //Create goal\n Goal goal = new Goal(goalId, userId, name, timePeriod, unit, amount);\n\n // Verify Values\n assertEquals(goalId, goal.getGoalId());\n assertEquals(userId, goal.getUserId());\n assertEquals(name, goal.getGoalName());\n assertEquals(timePeriod, goal.getTimePeriod());\n assertEquals(unit, goal.getUnit());\n assertEquals(amount, goal.getAmount(),0);\n }", "private FieldInfo() {\r\n\t}", "public Person1() {\n\t\tsuper();\n\t}", "public Student() {\r\n\t\t\r\n\t\t//populating country options\r\n\t\t//can also be done using a properties file\r\n\t\t\r\n\t\t/*\r\n\t\t * countryOptions = new LinkedHashMap<String, String>();\r\n\t\t * \r\n\t\t * countryOptions.put(\"BR\", \"Brazil\"); countryOptions.put(\"IN\", \"India\");\r\n\t\t * countryOptions.put(\"US\", \"United States\"); countryOptions.put(\"CA\",\r\n\t\t * \"Canada\");\r\n\t\t */\r\n\t\t\r\n\t\t\r\n\t}", "public BabbleValue() {}", "public Time(int hour, int minute, int second){ //method in the initializer block\n setHour(hour);\n setMinute(minute);\n setSecond(second);\n}", "public CBookReviews(Integer _id, String _username,String _bookname,String _review,String _approved)\r\n{\t\r\n\tid=_id;\r\n\tusername=_username;\r\n\tbookname=_bookname;\r\n\treview=_review;\r\n\tapproved=_approved;\r\n}", "public BirthInfo() {}", "public NameInfo(String inFirst, String inLast)\n\t{\n\t\t//Set instance data.\n\t\tfirstName = inFirst;\n\t\tlastName = inLast;\n\n\t}", "public MyObject(String titleFrom, String DetailFrom,String Urifrom) {\n\t\t titleFromEdittext=titleFrom;\n\t\t UriFroFramgnet=Urifrom;\n\t\t DetailFromEdittext=DetailFrom;\n\t}", "public ArgList(Object arg1, Object arg2) {\n super(2);\n addElement(arg1);\n addElement(arg2);\n }", "public Car() {\r\n this(\"\", \"\", \"\", 0, Category.EMPTY, 0.00, \"\", 0, \"\", 0.00, \"\", DriveTrain.EMPTY,\r\n Aspiration.EMPTY, 0.00, 0.00, 0.00, 0.00, 0.0, 0.0, 0.0, 0.0, 0.0);\r\n }", "public Person()\n {\n this.name = \"John Doe\";\n this.address = \"1234 Somewhere Dr.\";\n this.phoneNumber = \"309-555-1234\";\n this.emailAddress = \"john.doe@organization.com\";\n }", "ConstuctorOverloading(){\n\t\tSystem.out.println(\"I am non=argument constructor\");\n\t}" ]
[ "0.6819577", "0.676978", "0.6550888", "0.6492179", "0.64911926", "0.64687896", "0.6424892", "0.63676035", "0.6321274", "0.6306258", "0.62764007", "0.6263857", "0.6246718", "0.623303", "0.6194848", "0.61883974", "0.6184462", "0.61703736", "0.61391896", "0.6122417", "0.61190647", "0.6108524", "0.6082296", "0.60781676", "0.6068851", "0.6056748", "0.6052352", "0.60361964", "0.6026409", "0.6018768", "0.60166585", "0.59989834", "0.5994993", "0.59910107", "0.5982408", "0.59814763", "0.5977592", "0.5976857", "0.5974343", "0.5973984", "0.5970136", "0.5970087", "0.5967553", "0.5961776", "0.5945111", "0.59419674", "0.59413356", "0.5934747", "0.593449", "0.5933683", "0.5930143", "0.59298545", "0.59185505", "0.59169036", "0.5913615", "0.59113204", "0.59105366", "0.5909561", "0.5909008", "0.5903537", "0.59025663", "0.5901758", "0.5898372", "0.5896204", "0.5894495", "0.58907413", "0.5889849", "0.5885617", "0.58849776", "0.5884386", "0.58840793", "0.58829427", "0.58789957", "0.58789784", "0.58743757", "0.5873464", "0.5871927", "0.5870549", "0.5868191", "0.58675003", "0.5867378", "0.58651906", "0.58641005", "0.58606184", "0.5855051", "0.58540785", "0.58523214", "0.5851224", "0.58457816", "0.5836559", "0.5830926", "0.5830818", "0.5823487", "0.5821544", "0.58193785", "0.58188695", "0.5817754", "0.58176786", "0.5817452", "0.58161944", "0.5812061" ]
0.0
-1
deposit money to an account
public void deposit(String accountType, double amount) { if(accountType.equals("savings")) { this.savingsBalance += amount; totalAmount += amount; } else if(accountType.equals("checking")) { this.checkingBalance += amount; totalAmount += amount; } else { System.out.println("Deposit failed"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void deposit(int value)//To deposit money from the account\n {\n balance += value;\n }", "void deposit(double Cash){\r\n\t\tbalance=balance+Cash;\r\n\t}", "@Override\n\tpublic void deposit(int money) {\n\t\t\n\t}", "public static void deposit(){\n TOTALCMONEY = TOTALCMONEY + BALANCEDEPOSIT; //the cashier money equals the cashier money plus the amount that is being deposited\r\n BALANCE = BALANCE + BALANCEDEPOSIT; //the user balance equals the user balance plus the amount that is being deposited\r\n }", "public void deposit(BigDecimal deposit){\n balance = balance.add(deposit);\n }", "public double depositInto(double amount)\r\n {\r\n _balance += amount;\r\n\r\n return _balance;\r\n }", "public void deposit(double amount) {\n balance = balance + amount + 10;\n }", "void depositByCash(double amount) {\n\t\tif (isSuspended()) {\n\t\t\tSystem.out.println(\"Account is suspended.\");\n\t\t\tSystem.out.println(\"Depositing failed.\");\n\t\t\treturn;\n\t\t}\n\t\tif (amount <= 0) {\n\t\t\tSystem.out.println(\"Amount must be more than 0.\");\n\t\t\tSystem.out.println(\"Depositing failed.\");\n\t\t\treturn;\n\t\t}\n\t\tbalance += amount;\n\t\tSystem.out.println(\"Deposit \" + amount + \" successfully\");\n\t}", "public void deposit(double amount)\n {\n balance = balance + amount;\n }", "public void depositAmount() {\n\t\n\t\ttry {\n\t\t\tlog.log(Level.INFO, \"Please Enter the account number you want to deposit: \");\n\t\t\tint depositAccountNumber = scan.nextInt();\n\t\t\tlong amount;\n\t\t\tlog.log(Level.INFO, \"Please Enter the amount you want to Deposit : \");\n\t\t\tamount = scan.nextLong();\n\t\t\tbankop.deposit(depositAccountNumber,amount);\n\t\t\t\n\t\t}catch(AccountDetailsException | BalanceException message ) {\n\t\t\tlog.log(Level.INFO, message.getMessage());\n\t\t}\n\t\t\n\t}", "public void deposit(double amount) {\n this.balance += amount;\n }", "public void deposit(double amount){\n\t\tbalance += amount;\n\t}", "public void deposit(double value){\r\n balance += value;\r\n}", "public void deposit(double amount) \n\t{\n\t\tbalance += amount;\n\t}", "@Override\n public void makeDeposit(BigInteger account, BigDecimal amount) {\n Account accountDeposit = accountDao.getAccountByIban(account);\n accountDeposit.setBalance(accountDeposit.getBalance().add(amount));\n accountDao.updateAccount(accountDeposit);\n\n transactionDao.storeTransaction(new Transaction(null, account, amount, TransactionType.DEPOSIT));\n }", "protected void deposit(double amount)\n\t{\n\t\tacc_balance+=amount;\n\t}", "public void deposit(int amount)\n {\n setBalance(getBalance()+amount);\n }", "public void depositMoney(double amount) {\n\t\tbalance = balance + amount;\n\t}", "@Override\r\n\tpublic void deposit(int amount) {\n\t\t\r\n\t}", "public void deposit (double amount) \r\n {\r\n\r\n balance += amount;\r\n System.out.println (\"Deposit into account shs: \" + account);\r\n System.out.println (\"Standing Amount: \" + amount);\r\n System.out.println (\"Current balance: \" + balance);\r\n System.out.println ();\r\n\r\n }", "public void deposit(double amount) {\n\t\tbalance += amount;\n\t}", "public void deposit(double amount) {\n\t\tbalance += amount;\n\t}", "public void deposit(double amount)\n {\n startingBalance += amount;\n }", "public long deposit(long amount) {\n balance += amount;\n return balance;\n }", "public void transferTo(double dollarAmount) {\r\n\t\tthis.accountBalance = this.accountBalance + dollarAmount;\r\n\t}", "@Override\n public boolean deposit(Account account, BigDecimal amount) {\n return false;\n }", "public static void deposit() {\n\t\ttry {\n\t\t\tif (!LoginMgr.isLoggedIn()) {\n\t\t\t\tthrow new NotLoggedInException();\n\t\t\t}\n\n\t\t\t//Scanner s = new Scanner(System.in);\n\t\t\tSystem.out.println(\"Enter account number:\");\n\t\t\tString accNum = \"\";\n\t\t\tif (Quinterac.s.hasNextLine())\n\t\t\t\taccNum = Quinterac.s.nextLine();\n\n\t\t\tif (!ValidAccListMgr.checkAccNumExist(accNum)) {\n\t\t\t\tSystem.out.println(\"Please enter a valid account number\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tSystem.out.println(\"Enter the amount of money to deposit in cents:\");\n\t\t\tint amount = 0;\n\t\t\tif (Quinterac.s.hasNextInt()) amount = Integer.parseInt(Quinterac.s.nextLine());\n\t\t\t\n\t\t\tString modeName = LoginMgr.checkMode();\n\t\t\tif (modeName.equals(\"machine\")) {\n\t\t\t\tatmCheckDepositValid(accNum, amount);\n\t\t\t} else if (modeName.equals(\"agent\")) {\n\t\t\t\tagentCheckDepositValid(accNum, amount);\n\t\t\t}\n\n\t\t} catch (NotLoggedInException e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t}", "public int depositCash(int cash, int ubalance)\n {\n\n ubalance += cash;\n return ubalance;\n }", "@Override\n public void deposit(double amount) {\n double balance = getBalance();\n setBalance(balance+amount);\n }", "public void deposit(long amount) {\n\t\n\tbalance += amount;\n\t\n\tlog += \"Deposit made to this account in the ammount of \"+amount+\" on \"+date+\"\\n\";\n\tlog += log += \" Current balance is \"+balance+\" \\n\";\n\tupdate();\n}", "public void deposit(int amountToDeposit) {\n if (amountToDeposit > 0) {\n balance = balance + amountToDeposit;\n }\n }", "@Override\r\n\tpublic double depositDao(double money) throws EwalletException {\n\t\ttemp.setCustBal(temp.getCustBal()+money);\r\n\t\ttry {\r\n\t\t\ttemp.settDetails(\"Date :\"+tDate+\" Depsoited Amount :\"+money+\" Total Balance :\"+temp.getCustBal());\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tdao.updatedetails(temp.getAccNum(),temp);\r\n\t\treturn temp.getCustBal();\r\n\t\t\r\n\t}", "public int deposit(int amount) {\n\n balance += amount;\n System.out.println(\"--------------------------------------------\\n\" +\n \"* Your new balance is \" + this.balance + \" *\\n\" +\n \"--------------------------------------------\\n\");\n return balance;\n\n }", "@Override\n public void deposit(int accountId, long amount) {\n if(!accounts.containsKey(accountId)){\n throw new IllegalArgumentException(\"Account \" + accountId + \" does not exist in this Bank.\");\n }\n else{\n synchronized (accounts.get(accountId)){\n accounts.get(accountId).deposit(amount);\n }\n }\n }", "public void deposit(double amount)\t{\n\t\tbalance = balance + amount;\n\t\tbalance = Math.round(balance * 100.0) / 100.0;\n\t}", "public void transferMoney(int customerAccountId, int accountId) throws SQLException {\n // check if the customer has this account\n boolean customerOwnsAccount = false;\n for (int i = 0; i < this.currentCustomer.getAccounts().size(); i++) {\n if (customerAccountId == this.currentCustomer.getAccounts().get(i).getId()) {\n customerOwnsAccount = true;\n break;\n }\n }\n // it is safe to proceed since the customer accounts have been authenticated\n if (customerOwnsAccount) {\n Account customerAccount = DatabaseSelectHelper.getAccountDetails(customerAccountId);\n // try and catch for valid input (int) expected\n try {\n System.out.println(\"Enter amount you wish to transfer:\");\n // take user input as a big decimal\n BigDecimal bigAmount = new BigDecimal(br.readLine());\n if (bigAmount.compareTo(customerAccount.getBalance()) <= 0) {\n // try to update accounts\n try {\n // update the account which received money in database\n DatabaseUpdateHelper.updateAccountBalance(\n bigAmount.add(DatabaseSelectHelper.getBalance(accountId)), accountId);\n // update account which transfered money in database\n DatabaseUpdateHelper.updateAccountBalance(\n customerAccount.getBalance().subtract(bigAmount), customerAccountId);\n // update the customer object for printing reasons for other options\n this.currentCustomer.updateAccounts();\n // Explicitly tell user money is transfered\n System.out.println(\"you have successfully transfered money to account \" + accountId);\n \n } catch (Exception e) {\n System.out.println(\"The account ID you wish to transfer money to does not exist\");\n }\n // error printing\n } else {\n System.out.println(\"This account does not have enough money to send this amount\");\n }\n \n } catch (Exception e) {\n System.out.println(\"Invalid amount\");\n }\n // error printing\n } else {\n System.out.println(\"You do not have access to this account\");\n }\n \n }", "public void deposit (int amount) {\n if (amount >= 0) {\n balance = balance + amount;\n valueDeposits = valueDeposits + amount;\n if (balance > maximumBalance) {\n maximumBalance = balance;\n }\n }\n }", "private void deposit() {\n userInput = 0;\n while (userInput <= 0) {\n System.out.printf(\"Din nuværende balance er: %.2f DKK\\n\" +\n \"Indtast ønsket beløb at indsætte: \", balanceConverted);\n\n textMenuKey(false, \"\");\n\n if (userInput <= 0) {\n System.out.println(\"Indtast et gyldigt beløb\");\n }\n }\n\n moneyController(userInput);\n mysql.transactionUpdate(customerNumber, customerName, balance, userInput, \"Deposited\");\n }", "public void Deposit(Integer accountNo,float depositMoney){\n\tSessionFactory sessionFactory = new Configuration().configure(\"hibernate.cfg.xml\").buildSessionFactory();\n\tSession session = sessionFactory.openSession();\n\tTransaction trans = null;\n\ttry{\n\t\ttrans = session.beginTransaction();\n\t\tQuery query=session.createQuery(\"UPDATE Account set balance+=:balance where accountNo=:accountNo\"); \n\t\tquery.setParameter(\"balance\",depositMoney); \n\t\tquery.setParameter(\"accountNo\",accountNo); \n\t}catch(HibernateException hibernateException){\n\t\tif(trans != null){\n\t\t\ttrans.rollback();\n\t\t}\n\t\thibernateException.printStackTrace();\n\t}\n\t}", "public void deposit(double value)\r\n {\r\n //TODO need logic to make sure you can't deposit more then you have in cash\r\n subtractCash(value);\r\n savings += value;\r\n }", "public void deposit(String accountNumber, int amount) {\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp, ll;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\tint lastBalance;\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttry{\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql = \"select balance,userId from \"+this.name+\" where accountNumber=?\";\n\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\tps.setString(1, accountNumber.toString());\n\t\tResultSet rs = ps.executeQuery();\n\t\tint nowBalance = 0;\n\t\tString id = \"\";\n\t\twhile(rs.next()) { \n\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\tid = rs.getString(\"userId\");\n\t\t}\n\t\tlastBalance = nowBalance + amount;\n\t\t//System.out.println(lastBalance);\n\t\t\n\t\tString sql1 = \"UPDATE \"+this.name+\" SET balance=? where accountNumber=?\";\n\t\tpp = (PreparedStatement) conn.prepareStatement(sql1);\n\t\tpp.setInt(1, lastBalance);\n\t\tpp.setString(2, accountNumber.toString());\n\t\tpp.executeUpdate();\n\t\t\n\t\tString logs = \"deposit : \"+ amount+\" / balance: \"+String.valueOf(lastBalance);\n\t\tString sql11 = \"insert into \"+id+\" (log) values (?)\";\n\t\tll = (PreparedStatement) conn.prepareStatement(sql11);\n\t\tll.setString(1, logs);\n\t\tll.executeUpdate();\n\t\t\n\t\t}catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t}", "public boolean depositMoney(int accountNo, float amount) {\n Account account = getAccountByAccountNo(accountNo);\n account.setBalance(account.getBalance() + amount);\n saveOrUpdate(account);\n // save transaction to database\n Transaction transaction = new Transaction();\n transaction.setAccountNo(accountNo);\n transaction.setTime(new Timestamp(new Date().getTime()));\n transaction.setType(\"deposit\");\n transactionRepository.save(transaction);\n return true;\n }", "public void decreaseMoneyForReserve(String login,BigDecimal money);", "public double deposit(double amount){\n double total=amount;\n if(type.equals(\"TMB\"));total=-0.5;\n currentBalance+=total;\n return currentBalance;\n }", "public void withdrawMoney(int amount) {\n wallet.withdraw(amount);\n }", "@Override\n\tpublic int deposit(double amount) throws RaiseException {\n\t\tValidator.validateDeposit(amount);\n\t\tif(amount < 0) {\n\t\t\treturn 0;\n\t\t} else {\n\t\t\tthis.setBalance(this.getBalance() + amount);\n\t\t\t\n\t\t\t//create a transaction and adding it to the list of transactions of this account \n\t\t\tTransaction tmpTransaction = new Transaction(amount, EnumTypeTransaction.deposit);\n\t\t\tthis.addTransaction(tmpTransaction);\n\t\t\t\n\t\t\treturn 1;\n\t\t}\n\t}", "public void deposit (double amount)\n {\n imposeTransactionFee ();\n super.deposit (amount);\n }", "public void depositMoney(double amount) {\n\t\tif (amount>=0){\n\t\t\tsetBalance(getBalance() + amount);\n\t\t}else{\n\t\t\tSystem.out.println(\"You can not deposit a negative value!\");\n\t\t}\n\t\t\n\t}", "void transfer(BankAccount x,double amt)\n\t{\n\t\tSystem.out.println(\"transferring the amount\");\n\t\twithdraw(amt);\n\t\tx.deposit(amt);\n\t\tSystem.out.println(\"transfer done successfully! \");\n\t}", "public void deposit(BigDecimal amount) {\n this.setBalance(this.getBalance().add(amount));\n }", "public boolean deposit(long id, String password, String currency, double amount);", "void deposit(double amount){\r\n\t\t//add to the current balance the amount\r\n\t\t setBalance(getBalance() + amount);\r\n\t }", "public void deposit(double amount){\n if (isFrozen == true){\n return;\n }\n if (UserAccount.isAmountValid(amount) == false){\n throw new IllegalArgumentException(\"Amount entered is not possible to be deposited\");\n }\n else{\n balance += amount;\n savingTransactions[arrayLocation]= \"Deposit into savings account of the amount: \" + String.valueOf(amount);\n arrayLocation++;\n }\n }", "public void deposit(double amount) {\n balance += amount;\n \n try {\n \n Class.forName(\"net.ucanaccess.jdbc.UcanaccessDriver\");\n \n // Load Driver\n String connURL=\"jdbc:ucanaccess://c:/Users/Ellen/Documents/CIST2373/ChattBankMDB.mdb\";\n \n // Get Connection\n Connection con = DriverManager.getConnection(connURL);\n \n // Create Statement\n Statement stmt = con.createStatement();\n \n // Create sql string \n String sql = \"Update Accounts set Balance = \"+getBalance()+ \n \" where AcctNo='\"+getAcctNo()+\"'\";\n \n // Check for properly formed sql\n System.out.println(sql);\n \n // Execute Statement\n int n = stmt.executeUpdate(sql);\n if (n == 1)\n System.out.println(\"Update was successful!\");\n else\n System.out.println(\"Update failed!\"); \n \n // Close Connection\n con.close(); \n } //end try\n \n catch (Exception err) {\n System.out.println(\"Error: \" + err);\n } //end catch\n }", "public void deposit (int amount){\n if(amount>=3000){\n super.deposit(amount+200);\n } else {\n super.deposit(amount);\n }\n }", "public void depositMoney(double amount, boolean checkingAccount) {\n if (checkingAccount) {\n checkingBalance += amount;\n totalBalance += amount;\n } else {\n savingsBalance += amount;\n totalBalance += amount;\n }\n }", "@Override\n public void deposit(double amount) {\n super.deposit(amount);\n store_trans(amount);\n }", "private static void deposite (double amount) {\n double resultDeposit = balance + amount;\r\n System.out.println(\"Deposit successful.\\nCurrent balance: \" + \"$\" + resultDeposit+ \".\");\r\n }", "@Override\n\tvoid deposit(double amount) {\n\t\tsuper.balance += amount - 20;\n\t}", "public void transfer(BigDecimal value, Account account) {\n\n\t\ttheValueHasToBeGreaterThanZero(value);\n\n\t\tif (value.compareTo(balance) <= 0) {\n\t\t\tthis.withdrawalAlgorithm(value);\n\t\t\taccount.depositAlgorithm(value);\n\t\t\taccount.notifyMovements(value, MovementAction.TRANSFER_RECEIVED);\n\t\t\tthis.movements.add(new Movement(MovementAction.TRANSFERRED, this));\n\t\t\treturn;\n\t\t}\n\n\t\tthrow new IllegalArgumentException(\"You do not have enough balance to transfer\");\n\t}", "@Override\r\n\tpublic void operateAmount(String AccountID, BigDecimal amount) {\n\r\n\t}", "public void credit(double amount) {\n this.balance += amount;\n }", "public void deposit( double amount ) throws Exception\n\t{\n // TODO\n // deposit amount of money, if it is legal/valid amount\n\t\tif(amount >= 0.0)\n\t\t\tbalance += amount;\n\t\telse\n\t\t\tthrow new Exception(\"Invalid Deposite Amount\");\n\t}", "public void deposit(double amount)\n {\n balanceChangeLock.lock();\n try\n {\n System.out.print(\"Depositando \" + amount);\n double newBalance = balance + amount;\n System.out.println(\", novo saldo igual a \" + newBalance);\n balance = newBalance;\n sufficientFundsCondition.signalAll();\n }\n finally\n {\n balanceChangeLock.unlock();\n }\n }", "void deposit(double amount) {\n try {Thread.sleep(10l);} catch (InterruptedException e) {}\r\n balance += amount;\r\n System.out.println(\"Inside deposit\"+ balance);\r\n }", "public void Deposit(double ammount){\n abal = ammount + abal;\n UpdateDB();\n }", "@Override\n public void deposit(double amount) {\n try {\n doDepositing(amount);\n } catch (BankException e) {\n System.out.println(e.getMessage());\n }\n }", "public void deposit(int depositAmount)\r\n {\n this.balance += depositAmount;\r\n System.out.println(\"Deposit of \" + depositAmount + \" made. New Balance is \" + this.balance);\r\n }", "@Override //nadpisanie - adnotacja, wskazówka\n public int withdraw(int cash) {\n super.balance -=cash;\n return cash;\n }", "public void deposit(int amount) {\n\t\tint newBalance = balance + amount;\n\t\ttry{\n\t\t\tThread.sleep(5); //added to make magnify corruption & make visible\n\t\t}catch(InterruptedException ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t\tthis.balance = newBalance;\n\t}", "void deposit() {\n System.out.println(\"Enter the amount to deposit : \");\n int deposit = scan.nextInt();\n balance += deposit;\n }", "public void pay(int cost) {\r\n\t\tmoney -= cost;\r\n\t}", "@Override\n\tpublic void DepositMoney(Gamers gamer) {\n\t\tSystem.out.println(\"Lütfen yatıracağınız para miktarını giriniz\");\n\t\tint newDepositMoney;\n\t\tnewDepositMoney=sc.nextInt();\n\t\tsc.nextLine();\n\t\tgamer.setWalletBalance(gamer.getWalletBalance()+newDepositMoney);\n\t\tdbserviceadaptors.Save(gamer);\n\t\tSystem.out.println(\"Yeni bakiyeniz \"+gamer.getWalletBalance()+\" olarak güncellendi.\");\n\t\t\n\t}", "public void addCash(double amount) {\r\n cash += amount;\r\n }", "public boolean deposit(String accountNumber, double amount) {\r\n\t\tif (!DaoUtility.isAccountNumberValid(accountNumber))\r\n\t\t\treturn false;\r\n\r\n\t\tConnection conn = null;\r\n\r\n\t\ttry {\r\n\t\t\tStatement st;\r\n\t\t\tResultSet rs;\r\n\t\t\tString sql;\r\n\r\n\t\t\tconn = dbConnector.getConnection();\r\n\t\t\tif (conn == null)\r\n\t\t\t\treturn false;\r\n\r\n\t\t\t// atomic operation\r\n\t\t\tst = conn.createStatement();\r\n\r\n\t\t\t// get the aid and old balance\r\n\t\t\tint aid = 0;\r\n\t\t\tdouble oldbalance = 0;\r\n\t\t\tsql = String.format(\r\n\t\t\t\t\t\"select * from tbAccount where acnumber='%s' \",\r\n\t\t\t\t\taccountNumber);\r\n\r\n\t\t\trs = st.executeQuery(sql);\r\n\t\t\tif (rs.next()) {\r\n\t\t\t\taid = rs.getInt(\"aid\");\r\n\t\t\t\toldbalance = rs.getDouble(\"balance\");\r\n\t\t\t\tboolean isactive = rs.getBoolean(\"isactive\");\r\n\r\n\t\t\t\t// If the account is Frozen(isactive=false), then cannot\r\n\t\t\t\t// deposit.\r\n\t\t\t\tif (!isactive) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\t// ac.balance += amount.\r\n\t\t\t// update tbAccount set balance='new balance' where\r\n\t\t\t// acnumber='acnumber'\r\n\t\t\tdouble newBalance = oldbalance + amount;\r\n\t\t\tsql = String.format(\r\n\t\t\t\t\t\"update tbAccount set balance=%f where acnumber='%s' \",\r\n\t\t\t\t\tnewBalance, accountNumber);\r\n\t\t\tst.addBatch(sql);\r\n\r\n\t\t\t// insert a transaction record\r\n\t\t\t// insert into tbTransaction(aid,trtype,amount,description)\r\n\t\t\t// values( select aid from tbAccount where acnumber='acnumber',\r\n\t\t\t// DEPOSIT_TRANSACTION_TYPE_ID,\r\n\t\t\t// amount, 'deposit 123.4 dollars on 2014-09-19')\r\n\t\t\t//\r\n\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\r\n\t\t\tjava.util.Date date = new java.util.Date();\r\n\t\t\tString currentDate = dateFormat.format(date); // 2014-08-06\r\n\r\n\t\t\tsql = String.format(\r\n\t\t\t\t\t\"insert into tbTransaction(aid,trtype,amount,description) \"\r\n\t\t\t\t\t\t\t+ \" values( %d, \" + \"\t\t\t%d, \"\r\n\t\t\t\t\t\t\t+ \"\t\t\t%f, 'deposit %.2f dollars on %s' ) \", aid,\r\n\t\t\t\t\tDEPOSIT_TRANSACTION_TYPE_ID, amount, amount, currentDate);\r\n\r\n\t\t\tst.addBatch(sql);\r\n\r\n\t\t\t// Execute transaction\r\n\t\t\tint[] nRes = st.executeBatch();\r\n\t\t\tif (nRes[1] > 0)\r\n\t\t\t\treturn true;\r\n\t\t\telse\r\n\t\t\t\treturn false;\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tif (conn != null)\r\n\t\t\t\t\tconn.close();\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "public void deposit();", "@Override\r\n\tpublic double calculate(double account, double money) {\n\t\treturn account-money;\r\n\t}", "public void withdrawMoney(double amount) {\n\t\tbalance = balance - amount;\n\t}", "void deposit(float amount) {\n\n float newBalance;\n if (this.transactionHistory.isEmpty()) {\n newBalance = amount;\n } else {\n newBalance = this.transactionHistory.getLastTransaction().getBalanceAfter() + amount;\n }\n Transaction transaction = new Transaction(amount, true, newBalance);\n transactionHistory.addTransaction(transaction);\n }", "private void doDeposit() {\n System.out.println(\"How much do you want to deposit?\");\n boolean keepgoing = true;\n int amount = -1;\n while (keepgoing) {\n amount = input.nextInt();\n if (amount > 0) {\n keepgoing = false;\n pickedAccount.deposit(amount);\n }\n }\n System.out.println(\"deposited \" + amount + \" $\");\n }", "@Override\n\tvoid make_deposit(DataStore ds){\n\tds.setbalancedepositAccount1(ds.getbalanceAccount1_temp()+ds.getdepositAccount1());\n\t}", "@Override\n\tpublic void withdraw(int money) {\n\t\t\n\t}", "public void nonSyncdeposit(double amount)\r\n\t {\r\n\t if(amount<0){//if deposit amount is negative\r\n\t \t System.out.println(\"Invalid amount cannot deposit\");\r\n\t }\r\n\t else{ //logic to deposit amount\r\n\t\t System.out.print(\"Depositing \" + amount);\r\n\t double newBalance = balance + amount;\r\n\t System.out.println(\", new balance is \" + newBalance);\r\n\t balance = newBalance;\r\n\t }\r\n\t }", "boolean deposit(UUID name, double amount);", "@Override\n\tpublic boolean desposit(int accNo, double money) {\n\t\treturn false;\n\t}", "void deposit(double amount)\n\t{\n\t\tbalance += amount;\n\t\t//what this translates to is\n\t\t// this.balance += amount;\n\t}", "public void transfer(double amount, checkingAccount cAccount)throws InsufficientFundsException{\n if (isFrozen == true){\n return;\n }\n if (UserAccount.isAmountValid(amount) == false){\n throw new IllegalArgumentException(\"Amount entered is not possible to be deposited\");\n }\n else if (amount > balance){\n throw new InsufficientFundsException(\"Not enough money\");\n }\n else{\n balance -= amount;\n cAccount.balance += amount;\n savingTransactions[arrayLocation] = \"Transfer from savings account into checkings account of the amount: \" + String.valueOf(amount);\n arrayLocation++;\n }\n }", "public void depositar(double valor) {\n this.saldo += valor;\n }", "public void deposit (double amount) {\r\n\t\t\r\n\t\tbalance=balance+amount;\r\n\t\tif(balance > 0) {\r\n\t\t\t\r\n\t\t\toverDrawn = false;\r\n\t\t}\r\n\t\t\r\n\t}", "public void makeDeposit() {\n deposit();\n }", "public void deposit(double deposit){\n accTransactions.add(new Transaction('D', deposit, balance, \"deposit\"));\n balance += deposit;\n }", "public void recordPurchase(double amount)\n {\n balance = balance - amount;\n // your code here\n \n }", "Money getCashSettlementAmount();", "public double deposit(double amount, boolean branch) {\n balance += amount;\n return balance;\n }", "public int deposit(int depositAmmount);", "public void deposit(double depAmnt){\n try {\n String queryStr = \"update dummybank set amount = ? where accountNo = ?\";\n ps = con.prepareStatement(queryStr);\n ps.setDouble(1,this.amnt + depAmnt );\n ps.setString(2, accNo);\n ps.executeUpdate();\n } catch (SQLException ex) {\n Logger.getLogger(BankDBConnector.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public abstract boolean deposit(float amount);", "@Test\n\tpublic void testDeposit() {\n\t\tAccount acc1 = new Account(00000, \"acc1\", true, 1000.00, 0, false);\n\t\taccounts.add(acc1);\n\n\t\ttransactions.add(0, new Transaction(10, \"acc1\", 00000, 0, \"\"));\n\t\ttransactions.add(1, new Transaction(04, \"acc1\", 00000, 100.00, \"\"));\n\t\ttransactions.add(2, new Transaction(00, \"acc1\", 00000, 0, \"\"));\n\n\t\ttransHandler = new TransactionHandler(accounts, transactions);\n\t\toutput = transHandler.HandleTransactions();\n\n\t\tif (outContent.toString().contains(\"Deposit Successful\")) {\n\t\t\ttestResult = true;\n\t\t} else {\n\t\t\ttestResult = false;\n\t\t}\n\n\t\tassertTrue(\"unable to deposit money\", testResult);\n\t}", "int deposit(int id, int amount, int accountType) {\n int idCompare; // will contain the ID needed\n double accountBalance = 0;\n String account; // 0 = chequing, 1 = savings\n\n // If the accountType is 0, then it's a Chequing account the user wants to deposit to, if it's 1 then\n // it's savings\n account = accountType == 0 ? \"UserBalanceC\" : \"UserBalanceS\";\n\n // Look into the account number and user balance for the deposit\n String sql = \"SELECT AccountNum, \" + account + \" FROM CashiiDB2\";\n\n try {\n rs = st.executeQuery(sql);\n while (rs.next()) {\n idCompare = rs.getInt(\"AccountNum\"); // grab the id to compare with after\n\n // If the ID turns about to be the one that's needed, get the balance and add the amount needed\n if (idCompare == id) {\n accountBalance = rs.getDouble(account);\n accountBalance += amount;\n break;\n } else\n return -1;\n }\n // Run the operation to update the balance only for the user's account\n updateAccount(id, accountBalance, account);\n } catch (java.sql.SQLException e) {\n e.printStackTrace();\n }\n System.out.println(\"AMOUNT: \" + accountBalance);\n return 1;\n }", "@Override\n\tpublic void deposit() {\n\t\t\n\t}", "public void transferMoney(float amount, String transferToNumber) {}" ]
[ "0.8263843", "0.8040177", "0.7792722", "0.7696474", "0.7608607", "0.75617516", "0.75510544", "0.75450367", "0.7534802", "0.748862", "0.7481107", "0.7448446", "0.7411524", "0.7368429", "0.7336533", "0.7327316", "0.7325861", "0.7316863", "0.72666407", "0.7255865", "0.72536325", "0.72536325", "0.71979046", "0.71944517", "0.71912664", "0.7178571", "0.71411544", "0.7128237", "0.7121926", "0.71152693", "0.7105265", "0.71008587", "0.70975065", "0.7095517", "0.70927024", "0.7074978", "0.7058018", "0.7056007", "0.7046365", "0.70445424", "0.6999188", "0.6997785", "0.6987645", "0.6985656", "0.6971053", "0.69609964", "0.69570696", "0.69469166", "0.69316", "0.69003975", "0.6899889", "0.6896164", "0.6873861", "0.6869628", "0.68414307", "0.6838249", "0.68272173", "0.68193066", "0.6812228", "0.6805708", "0.68030864", "0.67990404", "0.6792337", "0.67797554", "0.6779324", "0.6767751", "0.6766399", "0.6765967", "0.67630017", "0.6735431", "0.6733047", "0.67321604", "0.6728054", "0.6721395", "0.6709164", "0.6708277", "0.6701068", "0.6699934", "0.6696714", "0.66966647", "0.6688969", "0.66836816", "0.66784334", "0.66676444", "0.6656741", "0.66527563", "0.66479766", "0.66390467", "0.66340834", "0.66251504", "0.66160756", "0.6614765", "0.66096514", "0.6603586", "0.6595947", "0.6590862", "0.6573981", "0.6570357", "0.65679145", "0.6567117", "0.656297" ]
0.0
-1
withdraw money from checking account
public void withdrawFromChecking(double amount) { if(amount > this.getSavingsBalance()) { System.out.println("Unsufficient funds"); } else { this.checkingBalance -= amount; totalAmount -= amount; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void withdrawMoney(double amount, boolean checkingAccount) {\n if (checkingAccount && amount <= checkingBalance) {\n checkingBalance -= amount;\n totalBalance -= amount;\n } else if (!checkingAccount && amount <= savingsBalance) {\n savingsBalance -= amount;\n totalBalance -= amount;\n } else {\n System.out.println(\"Insufficient Funds.\");\n }\n }", "private static void withdraw(double amount) {\n double resultWithdraw = balance - amount;\r\n if (resultWithdraw < 0 || amount > 2000) {\r\n System.out.println(\"Withdrawal cannot exceed $2000. Balance cannot be reduced below $0.\");\r\n } else {\r\n System.out.println(amount + \" has been withdrawn from your bank account.\\nCurrent balance \" + resultWithdraw + \".\");\r\n }\r\n }", "@Override\r\n\tpublic boolean deopsit(double amount) {\n\t\ttry {\r\n\t\t\tif (accountStatus.equals(AccountStatus.ACTIVE)) {\r\n\t\t\t\tbalance = (float) (balance + amount);\r\n\t\t\t} else {\r\n\t\t\t\tthrow new AccountInactiveException(\"You'er Account is not Active !\");\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\tSystem.err.println(e.getMessage());\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "void withdraw(double amount) {\n\t\tif (isSuspended()) {\n\t\t\tSystem.out.println(\"Account is suspended.\");\n\t\t\treturn;\n\t\t}\n\t\tif (amount <= 0) {\n\t\t\tSystem.out.println(\"Amount must be more than 0.\");\n\t\t\tSystem.out.println(\"Withdrawing failed.\");\n\t\t\treturn;\n\t\t}\n\t\tif (check(amount)) {\n\t\t\tbalance -= amount;\n\t\t\tSystem.out.println(\"Withdraw \" + amount + \" successfully.\");\n\t\t} else {\n\t\t\tSystem.out.println(\"Withdraw \" + amount + \" unsuccessfully. Do not have enough available funds.\");\n\t\t}\n\t}", "void withdraw(double amount){\r\n\t\t//subtract to the current balance the amount\r\n\t\tsetBalance(getBalance() - amount);\r\n\t\t\r\n\t\t//alert the user that his bank account is in the red if the balance lower than 0\r\n\t\tif(getBalance()<0){\r\n\t\t\tSystem.out.println(\"Your bank account is in the red.\");\r\n\t\t}\r\n\t}", "public void subtractCreditTransaction(double withdrawAmount){\n if(!checkAccountOpen()){\n System.out.println(\"Your credit transaction in the amount of -$\" + withdrawAmount +\" has been declined\");\n }\n else {\n this.currentBalance = this.currentBalance - withdrawAmount;\n if(this.currentBalance<0){\n System.out.println(\"Appropriate funds not found. Please check your current balance.\");\n this.currentBalance = this.currentBalance + withdrawAmount;\n }\n else {\n System.out.println(\"Your credit transaction has been approved!\");\n System.out.println(\"Your current balance is: $\" + currentBalance);\n }\n }\n\n }", "private void withdraw() {\n userInput = 0;\n while (userInput <= 0) {\n System.out.printf(\"Din nuværende balance er: %.2f DKK\\n\" +\n \"Indtast ønsket beløb at hæve: \", balanceConverted);\n\n textMenuKey(false, \"\");\n\n if (userInput <= 0) {\n System.out.println(\"Indtast et gyldigt beløb\");\n }\n }\n\n if ((userInput * 100) <= balance) {\n moneyController(-userInput);\n mysql.transactionUpdate(customerNumber, customerName, balance, userInput, \"Withdraw\");\n } else {\n System.out.println(\"Utilstrækkelig balance på kontien\");\n }\n }", "public void withdrawMoney(double amount) {\n\t\tbalance = balance - amount;\n\t}", "public void withdraw(double amount)\n {\n if (amount <= balance) {\n balance = balance - amount;\n }\n else {\n System.err.println(\"Transaction Declined\");\n remainder = balance - amount;\n System.out.println(\"Your balance would have been \" + remainder);\n }\n }", "public double withdrawFrom(double amount)\r\n {\r\n _balance -= amount;\r\n\r\n return _balance;\r\n }", "public void withdraw(double amount){\n\t\tbalance -= amount;\n\t}", "@Override\n\tpublic boolean withdraw(int accNo, double money) {\n\t\treturn false;\n\t}", "public void withdraw(long amount) {\n\t\n\tif(canWithdraw == true) {\n\t\tSystem.out.println(\"before \"+balance);\n\t\tbalance\t-= amount;\n\t\tSystem.out.println(\"after \"+balance);\n\t\t//add to log\n\t\tlog += \"Withdraw made to this account in the ammount of \"+amount+\" on \"+date+\"\\n\";\n\t\tlog += log += \" Current balance is \"+balance+\" \\n\"+date;\n\t\tupdate();\n\t}else {\n\t\tlog += \"Overdraft account on \"+date+\" \\n\";\n\t\tSystem.out.println(\"Insufficients funds to complete tranaction!\");\n\t\t}//end else statement\n}", "@Override //nadpisanie - adnotacja, wskazówka\n public int withdraw(int cash) {\n super.balance -=cash;\n return cash;\n }", "public static void deposit(){\n TOTALCMONEY = TOTALCMONEY + BALANCEDEPOSIT; //the cashier money equals the cashier money plus the amount that is being deposited\r\n BALANCE = BALANCE + BALANCEDEPOSIT; //the user balance equals the user balance plus the amount that is being deposited\r\n }", "private void doWithdrawal() {\n while(true){\n try{\n Account userAccount = ui.readAccount(currentUser.getAccounts());\n int amountWithdrawn = ui.readWithdrawalAmount();\n\n if(userAccount.debit(amountWithdrawn)){\n ui.displayNewBalance(userAccount);\n break;\n\n } else {\n ui.displayError(\"You do not have enough money in this account to withdraw \" + amountWithdrawn);\n }\n }catch(Exception e){\n ui.displayError(\"Please enter a valid number.\");\n }\n }\n\n }", "void withdraw() {\n System.out.println(\"Enter the amount to withdraw : \");\n int withdraw = scan.nextInt();\n balance -= withdraw;\n }", "public void decreaseMoneyForReserve(String login,BigDecimal money);", "public void withdraw(double amount)\n {\n startingBalance -= amount;\n }", "@Override\n\tpublic void withdraw(int money) {\n\t\t\n\t}", "void deposit(int value)//To deposit money from the account\n {\n balance += value;\n }", "public void withdraw(double amount) {\n this.balance -= amount;\n }", "public void withdraw(double amount)\n\t{\n\t\tbalance -= amount;\n\t}", "public void depositMoney(double amount, boolean checkingAccount) {\n if (checkingAccount) {\n checkingBalance += amount;\n totalBalance += amount;\n } else {\n savingsBalance += amount;\n totalBalance += amount;\n }\n }", "@Test \n\tpublic void test1() {\n\t\taccount.withdraw(1000);\n\t\t//Sample (Expected) Output\n\t\tassertEquals(1000, account.getAmount(),0.01);\n\t}", "public void withdrawMoney(int amount) {\n wallet.withdraw(amount);\n }", "@Override\r\n\tpublic boolean withdraw(double amount) {\n\t\ttry {\r\n\t\t\tif (accountStatus.equals(AccountStatus.ACTIVE)) {\r\n\t\t\t\tif (balance > amount) {\r\n\t\t\t\t\tbalance = (float) (balance - amount);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthrow new InsufficientBalanceException(\"You'er Balance is insufficient to make this transation !\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\telse {\r\n\t\t\t\tthrow new AccountInactiveException(\"You'er Account is not Active !\");\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\tSystem.err.println(e.getMessage());\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public void withdrawMoney(double amount) {\n\t\tif (amount>=0){\n\t\t\tsetBalance(this.balance - amount);\n\t\t}else{\n\t\t\tSystem.out.println(\"You can not withdraw a negative value!\");\n\t\t}\n\t\t\t\t\n\t}", "public int withdraw() {\n\t\tif ((acc.getBalance() - keyboard.getAmt()) > acc.getMinimumBalace()) {\r\n\t\t\tif (casher.withdraw(keyboard.getAmt()) == 1) {\r\n\t\t\t\tsetNewBalance();\r\n\t\t\t\t\r\n\t\t\t\treciept.printer(acc.getAccountNumber(), acc.getBalance(), keyboard.getAmt());\r\n\t\t\t\treturn 1;\r\n\t\t\t} else\r\n\t\t\t\treturn 0;\r\n\t\t}\r\n\t\treturn 0;\r\n\r\n\t}", "public int withdrawCash(int cash, int ubalance)\n {\n if (ubalance <= 0)\n {\n System.out.println(\"cash is not available\");\n return 0;\n }\n else\n {\n ubalance -= cash;\n return ubalance;\n }\n }", "public long withdraw(long amount) {\n if (amount > balance) {\n long tmp = balance;\n balance = 0;\n return tmp;\n } else {\n balance -= amount;\n return amount;\n }\n }", "void preWithdraw(double amount) {\n\t\tSystem.out.println(\"Your account is not saver account.\");\n\t}", "@Override\r\n\tpublic double deductAccountMaintenanceFee() {\n\t\tif (this.getBalance() < 250.0)\r\n\t\t\treturn super.withdraw(250.0);\r\n\t\telse \r\n\t\t\treturn this.getBalance();\r\n\t\t\r\n\t}", "public Integer withdraw(Integer amount) {\r\n\t if (balance < amount) {\r\n\t throw new NotEnoughFundsException(amount, balance);\r\n\t }\r\n\t balance -= amount;\r\n\t return balance;\r\n\t }", "public void withdrawFromBalance(double withdrawBalanceAmount) \n\t{\n\t\taccountBalance -= withdrawBalanceAmount;\n\t}", "public void withdraw(double amount){\n accTransactions.add(new Transaction('W', amount, balance, \"withdraw\"));\n balance -= amount;\n }", "public void withdraw(double amount) {\n\t\tbalance -= amount;\n\t}", "void deposit(double Cash){\r\n\t\tbalance=balance+Cash;\r\n\t}", "@Override\n\tpublic boolean desposit(int accNo, double money) {\n\t\treturn false;\n\t}", "@Override\r\n\tvoid withdraw(double amount) {\n\t\tsuper.withdraw(amount);\r\n\t\tif(minimumblc>500)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"you have withdraw rupees\"+ (amount));\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tSystem.out.println(\"withdraw failed \");\r\n\t\t}\r\n\t\t\r\n\t}", "private static void deposite (double amount) {\n double resultDeposit = balance + amount;\r\n System.out.println(\"Deposit successful.\\nCurrent balance: \" + \"$\" + resultDeposit+ \".\");\r\n }", "public void transferToChecking(double amount){\n withdrawSavings(amount);\r\n depositChecking(amount);\r\n }", "@Override\r\n\tpublic double withdrawlDao(double money) throws EwalletException {\n\t\tif(money<temp.getCustBal()) {\r\n\t\t\ttemp.setCustBal(temp.getCustBal()-money);\r\n\t\t\ttry {\r\n\t\t\t\ttemp.settDetails(\"Date :\"+tDate+\" Amount Withdrawn :\"+money+\" Total Balance :\"+temp.getCustBal());\r\n\t\t\t} catch (Exception 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\tdao.updatedetails(temp.getAccNum(),temp);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tSystem.out.println(\" Low Balance :( \");\r\n\t\t\treturn temp.getCustBal();\r\n\t}", "@Override\n\tpublic void deposit(int money) {\n\t\t\n\t}", "@Test\n\tpublic void testWithdraw(){\n\t\t\n\t\t// Arrange\n\t\tBigDecimal amountToWithdraw = new BigDecimal(10.00);\n\t\tBigDecimal expectedBalance = new BigDecimal(110.5);\n\t\tdouble delta = 1e-3;\n\t\t// Act\n\t\tcurrentAccount.withdraw(amountToWithdraw);\n\t\tBalance actualBalance = currentAccount.checkBalance();\n\t\t\n\t\t// Assert\n\t\tassertEquals(expectedBalance.doubleValue(), actualBalance.getAmount().doubleValue(), delta);\n\t}", "public void withdraw (int amount) {\n if (amount >= 0) {\n balance = balance - amount;\n valueWithdrawals = valueWithdrawals + amount;\n if (balance < minimumBalance){\n minimumBalance = balance;\n }\n }\n }", "public int withdraw(int amount) {\n\n this.balance -= amount;\n if (balance < 0) {\n\n this.balance = 0;\n System.out.println(\"--------------------------------------------\\n\" +\n \"* Your new balance is \" + this.balance + \" *\\n\" +\n \"--------------------------------------------\\n\");\n return this.balance;\n\n } else {\n System.out.println(\"--------------------------------------------\\n\" +\n \"* Your new balance is \" + this.balance + \" *\\n\" +\n \"--------------------------------------------\\n\");\n return balance;\n }\n }", "public void withdraw( double amount ) throws Exception\n\t{\n\t\tif(amount >= 0.0 && amount <= balance)\n\t\t\tbalance -= amount;\n\t\t\n\t\telse\n\t\t\tthrow new Exception(\"Insufficient Balance\");\n\t}", "protected boolean withdraw(double amount)\n\t{\n\t\tif(amount>acc_balance)\n\t\t\treturn false;\n\t\t\n\t\t//else the deduction is done from balance and success message is passed\n\t\tacc_balance-=amount;\n\t\treturn true;\n\t}", "@Override\n\tpublic int withdraw(double amount) throws RaiseException {\n\t\tValidator.validateWithdraw(this.getBalance(), amount);\n\t\tif(amount <= this.getBalance()) {\n\t\t\tthis.setBalance(this.getBalance() - amount);\n\t\t\t\n\t\t\t//create a transaction and adding it to the list of transactions of this account \n\t\t\tTransaction tmpTransaction = new Transaction(amount, EnumTypeTransaction.withdraw);\n\t\t\tthis.addTransaction(tmpTransaction);\n\t\t\t\n\t\t\treturn 1;\n\t\t}\n\t\treturn 0;\n\t}", "public double withdraw(double withdrawalAmount) {\n\t\tdouble savingsBalance = getBalance();\n\t\tif ((savingsBalance - withdrawalAmount) >= overdraft) { // Check if balance is less than overdraft limit.\n\t\t\tsuper.withdraw(withdrawalAmount);\n\t\t}\n\t\tif ((savingsBalance - withdrawalAmount) < overdraft) {\n\t\t\tSystem.out.print(\"Cannot execute withdraw action: greater than savings withdraw limit.\\n\");\n\t\t}\n\t\treturn getBalance();\n\t}", "public void withdraw (double amount) throws InsufficientFundsException{\n if (isFrozen == true){\n return;\n }\n if (UserAccount.isAmountValid(amount) == false){\n throw new IllegalArgumentException(\"Amount entered is not possible to be withdrawn\");\n }\n if (dailyMaxWithdraw != null){\n todayWithdraw += amount;\n if(todayWithdraw > dailyMaxWithdraw){\n throw new IllegalArgumentException(\"Amount entered would exceed your daily withdraw limit\");\n }\n }\n else if (amount <= balance){\n balance -= amount;\n savingTransactions[arrayLocation] = \"Withdraw from savings account of the amount: \" + String.valueOf(amount);\n arrayLocation++;\n }\n else {\n throw new InsufficientFundsException(\"Not enough money\");\n }\n }", "void withdraw(double amount) {\n try {Thread.sleep(10l);} catch (InterruptedException e) {}\r\n balance -= amount;\r\n System.out.println(\"Inside withdraw\"+ balance);\r\n }", "public boolean withdrawal (double amount) \r\n {\r\n\r\n boolean result = false;\r\n\r\n if ( ! super.withdrawal (amount) ) \r\n {\r\n System.out.println (\"Using overdraft...\");\r\n if ( ! overdraft.withdrawal (amount-balance) )\r\n System.out.println (\"Overdraft source insufficient.\");\r\n else {\r\n balance = 0;\r\n System.out.println (\"Current Balance on account \" + account + \": \" + balance);\r\n result = true;\r\n }\r\n }\r\n System.out.println ();\r\n\r\n return result;\r\n\r\n }", "public void withDrawAmount() {\n\t\t\n\t\ttry {\t\n\t\t\tlog.log(Level.INFO, \"Please Enter the account number you want to withdraw: \");\n\t\t\tint withdrawAccountNumber = scan.nextInt();\n\t\t\tlong amount;\n\t\t\tlog.log(Level.INFO, \"Please Enter the amount you want to withdraw : \");\n\t\t\tamount = scan.nextLong();\n\t\t\tbankop.withDraw(withdrawAccountNumber,amount);\n\t\t\t\n\t\t}catch(AccountDetailsException | BalanceException message ) {\n\t\t\tlog.log(Level.INFO, message.getMessage());\n\t\t}\n\n\t}", "public void withdraw(double dollarAmount) throws InsufficientFundsException {\r\n\t\tif (this.accountBalance - dollarAmount < 0 || this.accountBalance - dollarAmount - 1.50 < 0) {\r\n\t\t\tthrow new InsufficientFundsException();\r\n\t\t} else {\r\n\t\t\ttransactionTracker++;\r\n\t\t\tSystem.out.println(transactionTracker);\r\n\t\t\tif (transactionTracker > 4) {\r\n\t\t\t\tthis.accountBalance = this.accountBalance - dollarAmount - 1.50;\r\n\t\t\t} else {\r\n\t\t\t\tthis.accountBalance = this.accountBalance - dollarAmount;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static void extract_money(){\n TOTALCMONEY = TOTALCMONEY - BALANCERETRIEVE; //the total cashier money equals the total cashier money minus the retrieve request\r\n BALANCE = BALANCE - BALANCERETRIEVE; //the user balance equals the account minus the retrieve request\r\n }", "public void depositAmount() {\n\t\n\t\ttry {\n\t\t\tlog.log(Level.INFO, \"Please Enter the account number you want to deposit: \");\n\t\t\tint depositAccountNumber = scan.nextInt();\n\t\t\tlong amount;\n\t\t\tlog.log(Level.INFO, \"Please Enter the amount you want to Deposit : \");\n\t\t\tamount = scan.nextLong();\n\t\t\tbankop.deposit(depositAccountNumber,amount);\n\t\t\t\n\t\t}catch(AccountDetailsException | BalanceException message ) {\n\t\t\tlog.log(Level.INFO, message.getMessage());\n\t\t}\n\t\t\n\t}", "public void takeoutMoney (double amount) {\n if(amount >= 2.0) {\n int numberToRemove = (int) Math.min(getToonie(), amount / 2.0);\n for(int i = 0; i < numberToRemove; i++) {\n for(int j = 0; j < coins.size(); j++) {\n if(coins.get(j).getValue() == 2.0) {\n coins.remove(j);\n break;\n }\n }\n }\n NToonie -= numberToRemove;\n amount -= 2.0 * numberToRemove;\n }\n if(amount >= 1.0) {\n int numberToRemove = (int) Math.min(getLoonie(), amount / 1.0);\n for(int i = 0; i < numberToRemove; i++) {\n for(int j = 0; j < coins.size(); j++) {\n if(coins.get(j).getValue() == 1.0) {\n coins.remove(j);\n break;\n }\n }\n }\n NLoonie -= numberToRemove;\n amount -= 1.0 * numberToRemove;\n }\n if(amount >= 0.25) {\n int numberToRemove = (int) Math.min(getQuarter(), amount / 0.25);\n for(int i = 0; i < numberToRemove; i++) {\n for(int j = 0; j < coins.size(); j++) {\n if(coins.get(j).getValue() == 0.25) {\n coins.remove(j);\n break;\n }\n }\n }\n NQuarter -= numberToRemove;\n amount -= 0.25 * numberToRemove;\n }\n if(amount >= 0.1) {\n int numberToRemove = (int) Math.min(getDime(), amount / 0.1);\n for(int i = 0; i < numberToRemove; i++) {\n for(int j = 0; j < coins.size(); j++) {\n if(coins.get(j).getValue() == 0.1) {\n coins.remove(j);\n break;\n }\n }\n }\n NDime -= numberToRemove;\n amount -= 0.1 * numberToRemove;\n }\n if(amount >= 0.05) {\n int numberToRemove = (int) Math.min(getNickel(), amount / 0.05);\n for(int i = 0; i < numberToRemove; i++) {\n for(int j = 0; j < coins.size(); j++) {\n if(coins.get(j).getValue() == 0.05) {\n coins.remove(j);\n break;\n }\n }\n }\n NNickel -= numberToRemove;\n amount -= 0.05 * numberToRemove;\n }\n }", "void depositByCash(double amount) {\n\t\tif (isSuspended()) {\n\t\t\tSystem.out.println(\"Account is suspended.\");\n\t\t\tSystem.out.println(\"Depositing failed.\");\n\t\t\treturn;\n\t\t}\n\t\tif (amount <= 0) {\n\t\t\tSystem.out.println(\"Amount must be more than 0.\");\n\t\t\tSystem.out.println(\"Depositing failed.\");\n\t\t\treturn;\n\t\t}\n\t\tbalance += amount;\n\t\tSystem.out.println(\"Deposit \" + amount + \" successfully\");\n\t}", "public void withdraw(double withdrawalAmount) {\n if (withdrawalAmount < 0) throw new IllegalArgumentException(\"Withdrawal amount cannot be negative\");\n if (balance - withdrawalAmount < 0) throw new IllegalArgumentException(\"Cannot withdraw more than account balance\");\n balance -= withdrawalAmount;\n numWithdrawals++;\n }", "@Override\n public boolean deposit(Account account, BigDecimal amount) {\n return false;\n }", "@Override\n\tvoid withdraw(double amount) {\n\t\tsuper.balance -= amount - 20;\n\t}", "public int withdrawal(Account account, double amount) { \r\n\t\tint found = find(account); //get the account that wants to withdraw\r\n\t\t\r\n\t\t//if the account doesn't exist \r\n\t\tif ( found == -1 ) {\r\n\t\t\treturn -1; \r\n\t\t}\r\n\t\t//get the balance amount, and call debit() to decrease the balance by amount \r\n\t\tDouble balance = accounts[found].getBalance();\r\n\t\taccount.setBalance(balance);\r\n\t\taccount.debit(amount); \r\n\t\t\r\n\t\t//if its less than 0, means that there are insufficient funds\r\n\t\tif ( account.getBalance() < 0 ) {\r\n\t\t\treturn 1; \r\n\t\t} \r\n\t\taccounts[found].setBalance(account.getBalance());\r\n\t\t\r\n\t\t\r\n\t\t//check if the account is a MoneyMarket account, then increment the count of withdrawls\r\n\t\tif ( accounts[found] instanceof MoneyMarket ) {\r\n\t\t\tMoneyMarket moneyAcc = (MoneyMarket) accounts[found];\r\n\t\t\tint numberOfWithdraws = moneyAcc.getWithdrawals() + 1;\r\n\t\t\tmoneyAcc.setWithdrawals(numberOfWithdraws);\r\n\t\t}\r\n\t\t\r\n\t\treturn 0;\r\n\t}", "public void withdraw (double amount)\n {\n super.withdraw (amount);\n imposeTransactionFee ();\n }", "public void withdraw(float amount) {}", "public void withdraw(float amount) {}", "public void debitBankAccount() {\n\t\tint beforeDebit = this.sender.getBankAccount().getAmount();\n\t\tthis.sender.getBankAccount().setAmount(beforeDebit - this.getCost());\n\t\tSystem.out.println(this.getCost() + \" euros is debited from \" + this.sender.getName()\n\t\t\t\t+ \" account whose balance is now \" + this.sender.getBankAccount().getAmount() + \" euros\");\n\t}", "protected void deposit(double amount)\n\t{\n\t\tacc_balance+=amount;\n\t}", "@Test\n\tpublic void withdrawTest(){\n\t\tCustomer cus = new Customer(\"wgl\", myDate, \"Beijing\");\n\t\tAccount cAcc = new CurrentAccount(cus);\n\t\tbc.withdraw(cAcc, 300);\n\t\tboolean flag = false;\n\t\tif(cAcc.getBalance() == -300.0){\n\t\t\tflag = true;\n\t\t}\n\t\tassertTrue(flag);\n\t}", "public void deposit (double amount) {\r\n\t\t\r\n\t\tbalance=balance+amount;\r\n\t\tif(balance > 0) {\r\n\t\t\t\r\n\t\t\toverDrawn = false;\r\n\t\t}\r\n\t\t\r\n\t}", "public void withdraw(double amount) throws InsufficientFundsException {\n if (amount <= balance) {\n balance -= amount;\n \n try {\n \n Class.forName(\"net.ucanaccess.jdbc.UcanaccessDriver\");\n \n // Load Driver\n String connURL=\"jdbc:ucanaccess://c:/Users/Ellen/Documents/CIST2373/ChattBankMDB.mdb\";\n \n // Get Connection\n Connection con = DriverManager.getConnection(connURL);\n \n // Create Statement\n Statement stmt = con.createStatement();\n \n // Create sql string \n String sql = \"Update Accounts set Balance = \"+getBalance()+ \n \" where AcctNo= '\"+getAcctNo()+\"'\";\n \n // Check for properly formed sql\n System.out.println(sql);\n \n // Execute Statement\n int n = stmt.executeUpdate(sql);\n if (n == 1)\n System.out.println(\"Update was successful!\");\n else\n System.out.println(\"Update failed!\"); \n \n // Close Connection\n con.close(); \n } //end try\n \n catch (Exception err) {\n System.out.println(\"Error: \" + err);\n } //end catch\n } //end if\n else {\n throw new InsufficientFundsException(amount);\n } //end else\n }", "@Override\n\tpublic void takeMoneyOut(double amount) throws NoEnoughMoneyException {\n\t\tif (this.balance - amount < 0) {\n\t\t\tthrow new NoEnoughMoneyException(\"Sorry, operation failed. \" +\n\t\t\t\t\"The amount exceeds existing balance in this account\");\n\t\t}\n\t\tthis.balance -= amount;\n\t}", "public void withdraw(double amount) {\n\t\tif (amount < balance) {\n\t\t\tSystem.out.println(\"Successful withdraw: $\" + amount);\n\t\t\tbalance -= amount;\n\t\t} else {\n\t\t\tSystem.out.println(\"Withdraw Failed: Insufficient balance. The amount of $\" + amount + \" is more than your balance ($\" + balance +\").\");\n\t\t}\n\t}", "public void reduceBalance(int amount){\n this.money.subtractMoney(amount);\n }", "@Override\n public BigDecimal withdraw(Account account, BigDecimal bigDecimal) {\n return null;\n }", "@Override\n\tpublic void withdraw(double amount) {\n\t\tif (super.getBalance() - amount > overdraftLimit) {\n\t\t\tsuper.setBalance(getBalance() - amount);\n\t\t}\n\t\telse\n\t\t\tSystem.out.println(\"Amount exceeds overdraft limit.\");\n\t}", "@Override\n protected void withdraw(int request, boolean isOverdraft){\n if(request>0){\n request += SERVICE_FEE;\n }\n //need to change both balances just in case there was a LARGE_DEPOSIT \n //making it so that the 2 balance values differ\n setBalance(getBalance() - request);\n setBalanceAvailable(getBalanceAvailable() - request);\n }", "public int withdrawal(Account account, double amount) {\n int accountPosition = find(account);\n if (accountPosition == -1) {\n return -1;\n }\n double currBal = accounts[accountPosition].getBalance();\n if (currBal < amount) {\n return 1;\n }\n accounts[accountPosition].debit(amount);\n return 0;\n }", "@Override\r\n\tpublic double calculate(double account, double money) {\n\t\treturn account-money;\r\n\t}", "public void failedWithdraw(){\n\t\tstate = ATM_State.WITHDRAWALNOTIFICATION;\n\t\tgui.setDisplay(\"Invalid withdrawal amount.\");\n\t}", "boolean withdraw (int value )\n {\n if (value>balance)\n {\n return false;\n }\n else {\n balance-=value;\n return true;\n }\n }", "public double withdraw(double withAmnt){\n try {\n String queryStr = \"update dummybank set amount = ? where accountNo = ?\";\n ps = con.prepareStatement(queryStr);\n ps.setDouble(1,this.amnt - withAmnt );\n ps.setString(2, accNo);\n ps.executeUpdate();\n } catch (SQLException ex) {\n Logger.getLogger(BankDBConnector.class.getName()).log(Level.SEVERE, null, ex);\n }\n return this.amnt - withAmnt;\n }", "public void deposit(double amount){\n\t\tbalance += amount;\n\t}", "public void payEconomical() {\n if (this.balance >= 2.50) {\n this.balance -= 2.50;\n }\n }", "public void withdraw(int amount)\n {\n setBalance(getBalance()-amount);\n }", "public void recordPurchase(double amount)\n {\n balance = balance - amount;\n // your code here\n \n }", "public abstract String withdrawAmount(double amountToBeWithdrawn);", "@Test\n public void testImpossible2TransferMoney() {\n Bank bank = new Bank();\n User user = new User(\"Petr\", \"0000 000000\");\n AccountOfUser acc = new AccountOfUser(0, \"0000 0000 0000 0001\");\n bank.addUser(user);\n bank.addAccountToUser(user.getPassport(), acc);\n assertThat(bank.transferMoney(user.getPassport(), \"0000 0000 0000 0000\", user.getPassport(), acc.getRequisites(), 100), is(false));\n }", "public double withdraw(double amount, boolean branch) {\n if ((amount > 25) && !branch) {\n throw new IllegalArgumentException();\n }\n balance -= amount;\n return balance;\n }", "public void withdraw(int amount) throws RejectedException {\n if (amount < 0) {\n throw new RejectedException(\n \"Tried to withdraw negative value, illegal value: \" + amount + \".\" + accountInfo());\n }\n if (balance - amount < 0) {\n throw new RejectedException(\n \"Tried to overdraft, illegal value: \" + amount + \".\" + accountInfo());\n }\n balance -= amount;\n }", "public void restCash(double amount) {\r\n cash -= amount;\r\n }", "public double depositInto(double amount)\r\n {\r\n _balance += amount;\r\n\r\n return _balance;\r\n }", "public boolean withdrawMoney(int accountNo, float amount) {\n Account account = getAccountByAccountNo(accountNo);\n //check if account has sufficient balance\n if (checkIfEnough(account, amount)) {\n account.setBalance(account.getBalance() - amount);\n saveOrUpdate(account);\n //save transaction to database\n Transaction transaction = new Transaction();\n transaction.setAccountNo(accountNo);\n transaction.setTime(new Timestamp(new Date().getTime()));\n transaction.setType(\"withdraw\");\n transactionRepository.save(transaction);\n return true;\n }\n return false;\n }", "public void withdraw (double amount) {\r\n\t\tif(!overDrawn) {\r\n\t\t\tbalance=balance-amount;\r\n\t\t\tif(balance< -1)\r\n\t\t\t{\r\n\t\t\t\toverDrawn = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\telse {\r\n\t\t\tSystem.out.println(\"Negative amount!\");\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "private void deposit() {\n userInput = 0;\n while (userInput <= 0) {\n System.out.printf(\"Din nuværende balance er: %.2f DKK\\n\" +\n \"Indtast ønsket beløb at indsætte: \", balanceConverted);\n\n textMenuKey(false, \"\");\n\n if (userInput <= 0) {\n System.out.println(\"Indtast et gyldigt beløb\");\n }\n }\n\n moneyController(userInput);\n mysql.transactionUpdate(customerNumber, customerName, balance, userInput, \"Deposited\");\n }", "public void removeBalance(float withdraw) {\r\n\t\tthis.balance -= withdraw;\r\n\t}", "public void dispenseMoney(Money amount){\n\t\ttry{\n\t\t\tThread.sleep(4000);\n\t\t} catch(InterruptedException e)\n\t\t{}\n\t\tavailableCash.subtract(amount);\n\t}", "public void checkOut(double priceIn) {\n \n if (this.balance < priceIn) {\n System.out.println(\"Insufficient funds. Remove an item.\");\n }\n else {\n System.out.print(\"Sufficient funds. Your new balance is $\");\n this.balance -= priceIn;\n System.out.print(this.balance + \".\\n\");\n success = true;\n }\n }", "public int depositCash(int cash, int ubalance)\n {\n\n ubalance += cash;\n return ubalance;\n }" ]
[ "0.7590173", "0.7279589", "0.72780865", "0.7246358", "0.7237383", "0.7190305", "0.7188343", "0.715852", "0.7135473", "0.7132526", "0.7127173", "0.7114487", "0.7103057", "0.7102659", "0.709493", "0.7089917", "0.70839363", "0.7078691", "0.7066617", "0.70516604", "0.70466244", "0.7038852", "0.7036777", "0.7011353", "0.7008303", "0.70079327", "0.698718", "0.6983651", "0.69836193", "0.69793075", "0.6970838", "0.6940503", "0.69289213", "0.69246805", "0.691218", "0.69110465", "0.6909292", "0.68888867", "0.6873871", "0.6868964", "0.6865372", "0.6839401", "0.6833004", "0.68218327", "0.68161225", "0.67962664", "0.67913437", "0.6788917", "0.6787304", "0.67709994", "0.67494917", "0.67468125", "0.6740546", "0.6739415", "0.67311126", "0.67290914", "0.6724496", "0.6703584", "0.6698839", "0.669192", "0.66846734", "0.66677785", "0.666315", "0.66620773", "0.6639738", "0.66271305", "0.66271305", "0.6626493", "0.66148615", "0.6607268", "0.66057783", "0.65873855", "0.6581513", "0.6581266", "0.6571045", "0.65630955", "0.6552405", "0.65459484", "0.65439713", "0.6540114", "0.6538384", "0.6532896", "0.65280855", "0.65258276", "0.65134186", "0.6512429", "0.65119976", "0.6511323", "0.65062064", "0.65034056", "0.6495211", "0.6485754", "0.6477688", "0.64706796", "0.6466221", "0.6459314", "0.6453001", "0.645138", "0.6433742", "0.64269286" ]
0.72700757
3
The frame we manipulate default constructor
public Mat2Image() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public BreukFrame() {\n super();\n initialize();\n }", "public SiscobanFrame() {\r\n\t\tsuper();\r\n\t\tinitialize();\r\n\t}", "private Frame3() {\n\t}", "Frame createFrame();", "public MainFrame() {\n\t\tsuper();\n\t\tinitialize();\n\t}", "protected HFrame(){\n\t\tinit();\n\t}", "FRAME createFRAME();", "public GPFrame(String title) {\r\n super(title); // call the constructor of the super class\r\n }", "public Frame() {\n initComponents();\n }", "public Frame() {\n initComponents();\n }", "public internalFrame() {\r\n initComponents();\r\n }", "public FirstNewFrame() {\n\t\tjbInit();\n\t}", "public OrganizerFrame() {\n super(\"Органайзер\");\n init();\n }", "public BaseFrame() {\n initComponents();\n }", "protected ProtocolControlFrame() {\n super();\n }", "public TestFrames() {\n\t\tclasslogger.info(\"Called constructor for TestFrames...\");\n\t}", "public MassMsgFrame() {\n\t}", "public JGSFrame() {\n\tsuper();\n\tinitialize();\n }", "public void buildFrame();", "public FrameControl() {\n initComponents();\n }", "public frame() {\r\n\t\tframeOwner = 0;\r\n\t\tassignedProcess = 0;\r\n\t\tpageNumber = 0;\r\n\t}", "public PilaFrame() {\n initComponents();\n }", "public NewFrame() {\n initComponents();\n }", "public frame() {\r\n\t\tadd(createMainPanel());\r\n\t\tsetTitle(\"Lunch Date\");\r\n\t\tsetSize(FRAME_WIDTH, FRAME_HEIGHT);\r\n\r\n\t}", "public FrameDesign() {\n initComponents();\n }", "public MainFrameController() {\n }", "public SerialCommFrame()\n {\n super();\n initialize();\n }", "public FrameForm() {\n initComponents();\n }", "public FrameInsert() {\n initComponents();\n }", "public LoginFrame() {\n\t\tsuper();\n\t\tinitialize();\n\t}", "public MainFrame() {\n initComponents();\n \n }", "private void createFrame() {\n System.out.println(\"Assembling \" + name + \" frame\");\n }", "public MercadoFrame() {\n initComponents();\n }", "public POSFrame() {\n initComponents();\n }", "public EmulatorFrame() {\r\n\t\tsuper(\"Troyboy Chip8 Emulator\");\r\n\t\t\r\n\t\tsetNativeLAndF();\r\n\t\tinitComponents();\r\n\t\tinitMenubar();\r\n\t\tsetupLayout();\r\n\t\tinitFrame();\r\n\t\t//frame is now ready to run a game\r\n\t\t//running of any games must be started by loading a ROM\r\n\t}", "public Mainframe() {\n initComponents();\n }", "public FrameJogo() {\n initComponents();\n createBufferStrategy(2);\n Thread t = new Thread(this);\n t.start();\n }", "public FramePrincipal() {\n initComponents();\n }", "public NewJFrame() {\r\n initComponents();\r\n }", "public FramePrincipal() {\n\t\tinitComponents();\n\t}", "public launchFrame() {\n \n initComponents();\n \n }", "public FramePrincipal() {\r\n initComponents();\r\n }", "public MiFrame2() {\n initComponents();\n }", "private void createFrame(){\n System.out.println(\"Assembling \" + name + \" frame.\");\n }", "public FrameOpcoesAgenda() {\n initComponents();\n }", "public FrameBodyASPI() {\r\n super();\r\n }", "public Window(Frame parent) {\n this(parent, (GraphicsConfiguration) null); \n }", "public FrameAnimator(String location)\n\t{\n\t\tthis(location, \"basic\");\n\t}", "public addStFrame() {\n initComponents();\n }", "public FrameBodyTBPM() {\r\n super();\r\n }", "private Frame buildFrame() {\n return new Frame(command, headers, body);\n }", "public NewJFrame() {\n initComponents();\n }", "public NewJFrame() {\n initComponents();\n }", "public NewJFrame() {\n initComponents();\n }", "public NewJFrame() {\n initComponents();\n }", "public NewJFrame() {\n initComponents();\n }", "public NewJFrame() {\n initComponents();\n }", "public NewJFrame() {\n initComponents();\n }", "public NewJFrame()\r\n {\r\n initComponents();\r\n }", "public mainframe() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MiFrame() {\n initComponents();\n this.setLocationRelativeTo(null);\n }", "public CFJInternalFrame( ) {\n initComponents();\n \n refresh();\n }", "public NewJFrame() {\n initComponents();\n \n }", "public ActionFrame() {\n \tsetTitle(\"Action Frame\");\n initComponents();\n this.setLocationRelativeTo(null);\n }", "public Badminton()\n { \n frame.add(new Board()); \n frame.setSize(900, 900);\n frame.setResizable(false);\n frame.setTitle(\"PE Class\");\n //frame.setLocationRelativeTo(null);\n frame.setVisible(true);\n }", "public NewConnectionFrame() {\n initComponents();\n }", "public Zombie() {\r\n\t\tsuper(myAnimationID, 0, 0, 60, 60);\r\n\t}", "private FrameUIController(){\r\n\t\t\r\n\t}", "public JFrame() {\n initComponents();\n }", "private void init(Element frame) {\n\t\tthis.frameWidth = Integer.parseInt(frame.attributeValue(\"width\"));\n\t\tthis.frameHeight = Integer.parseInt(frame.attributeValue(\"height\"));\n\t\tthis.paddle = Integer.parseInt(frame.attributeValue(\"paddle\"));\n\t\tthis.size = Integer.parseInt(frame.attributeValue(\"size\"));\n\t}", "public InfoFilterFrame() {\n enableEvents(AWTEvent.WINDOW_EVENT_MASK);\n try {\n jbInit();\n init(); // do local intializations\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public FinalFrame()\n\t{\n\t\tsuper.setFirstRoll(0); //uses superclass to set first and second roll, and type\n\t\tsuper.setSecondRoll(0);\n\t\tsuper.setType(\"\");\n\t\troll3 = 0; //sets default third roll\n\t}", "public MenuFrame() {\n initComponents();\n }", "public SMFrame() {\n initComponents();\n updateComponents();\n }", "protected CGEFrameRenderer(int dummy) {\n\n }", "public FrameMain() {\n try {\n UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\n initComponents();\n refreshSchedule();\n } catch (ClassNotFoundException ex) {\n Logger.getLogger(FrameMain.class.getName()).log(Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n Logger.getLogger(FrameMain.class.getName()).log(Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n Logger.getLogger(FrameMain.class.getName()).log(Level.SEVERE, null, ex);\n } catch (UnsupportedLookAndFeelException ex) {\n Logger.getLogger(FrameMain.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public DisplayStaffMemberFrame() {\n initComponents();\n }", "public BookingFrame() {\r\n try {\r\n jbInit();\r\n } catch (Exception exception) {\r\n exception.printStackTrace();\r\n }\r\n }", "Frame getFrame();", "public Jframe() {\n initComponents();\n setIndice();\n loadTextBoxs();\n }", "public TifViewFrame() {\n initComponents();\n }", "public FrameIntroGUI() {\n\t\ttry {\n\t\t\tjbInit();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public StartProgramFrame() {\n initComponents();\n }", "public Scoreboard() { // constructor to initialize \n\t\tfor (int i = 1; i < 10; i++) { // adds the first 9 frames, hence the start from i = 1.\n\t\t\tframes.add(new Frame(this));\n\t\t}\n\t\tframes.add(new FinalFrame(this)); // 10th frame is added separately with its own properties. \n\t\t\n\t\tcurrent = frames.get(0); // current is the first added frame at 0th index. \n\t}", "public MainFrame() {\n initComponents();\n setLocationRelativeTo(null);\n }", "public holdersframe() {\n initComponents();\n }", "private void setFrame(Pool p)\n\t{\n\t\tthis.frame = new Frame(p);\n\t}", "public Frame2() {\n \n initComponents();\n }", "@SuppressWarnings(\"OverridableMethodCallInConstructor\")\n public ServerFrame() {\n initComponents();\n init();\n connection();\n }" ]
[ "0.7758814", "0.7536468", "0.750878", "0.73905444", "0.73827887", "0.7304347", "0.7235452", "0.7227313", "0.71740246", "0.71740246", "0.716935", "0.7121867", "0.71171343", "0.7115685", "0.710833", "0.70981765", "0.70748925", "0.70426863", "0.70393044", "0.70072645", "0.6988698", "0.69575393", "0.6920339", "0.69172794", "0.68859726", "0.68481326", "0.67500263", "0.6736562", "0.6734052", "0.6711399", "0.67012066", "0.66805184", "0.6677677", "0.66590834", "0.6624135", "0.6622413", "0.6621466", "0.6606593", "0.6585439", "0.65791607", "0.65735054", "0.6570477", "0.6544819", "0.6543484", "0.6540745", "0.65403074", "0.65219975", "0.6489736", "0.64790905", "0.6457468", "0.6457449", "0.6443024", "0.6443024", "0.6443024", "0.6443024", "0.6443024", "0.6443024", "0.6443024", "0.6437839", "0.64351976", "0.6434202", "0.6434202", "0.6434202", "0.6434202", "0.6434202", "0.6434202", "0.6434202", "0.6434202", "0.6434202", "0.6434202", "0.6434202", "0.6434202", "0.6432357", "0.6429109", "0.64269084", "0.6422579", "0.6420762", "0.640641", "0.63998914", "0.6397862", "0.63921565", "0.63919854", "0.63912743", "0.6388455", "0.6379662", "0.6379436", "0.6370225", "0.6361526", "0.6360693", "0.6354222", "0.6352964", "0.63460594", "0.6343808", "0.6341031", "0.6331194", "0.632864", "0.6328599", "0.63278806", "0.63263935", "0.6322517", "0.6315238" ]
0.0
-1
get color space of image, for conversion to mat
public void getSpace(Mat mat) { int type = 0; if (mat.channels() == 1) { type = BufferedImage.TYPE_BYTE_GRAY; } else if (mat.channels() == 3) { type = BufferedImage.TYPE_3BYTE_BGR; } this.mat = mat; int w = mat.cols(); int h = mat.rows(); if (img == null || img.getWidth() != w || img.getHeight() != h || img.getType() != type) img = new BufferedImage(w, h, type); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected ColorSpace getImageColorSpace() {\n return this.image.getColorSpace();\n }", "public native PixelPacket[] getColormap() throws MagickException;", "public native int getColorspace() throws MagickException;", "protected abstract ColorSpace getColorSpace();", "public static Color[][] getImageC(Image img) {\n\n // Get the raw pixel data \n iObserver observer = new iObserver();\n int width1 = img.getWidth(observer);\n int height1 = img.getHeight(observer);\n int[] rawPixels = utils.getPixels(img,width1,height1);\n\n // Each pixel is represented by 32 bits. Separate the tH32 bits into\n // four 8-bit values (red, green, blue, offset).\n\n // Arrange the data by rows and columns\n //row-col has been reversed\n Color[][] imagePixels = new Color[height1][width1];\n int index=0;\n for(int row=0; row<imagePixels.length; row++) {\n for(int col=0; col<imagePixels[0].length; col++) {\n imagePixels[col][row] = new Color(rawPixels[index]);\n index++;\n } // for col\n } // for row\n return imagePixels;\n }", "public static Mat convertColorMat(Mat in, ColorSpace spaceIn, ColorSpace spaceOut) {\n if (spaceIn == spaceOut)\n return in;\n if (!spaceIn.canConvertTo(spaceOut))\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n\n Mat output = in.clone();\n\n try {\n for (int i = 0; i < spaceIn.getConversionsTo(spaceOut).length; i += 3) {\n int conversion = spaceIn.getConversionsTo(spaceOut)[i];\n int inputDim = spaceIn.getConversionsTo(spaceOut)[i + 1];\n int outputDim = spaceIn.getConversionsTo(spaceOut)[i + 2];\n\n Imgproc.cvtColor(output, output, conversion, outputDim);\n }\n } catch (Exception ignored) {\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n }\n\n return output;\n }", "private Color[] imageToArray(BufferedImage image){\n Color[] pixels = new Color[image.getWidth() * image.getWidth()];\n for (int i = 0; i < image.getHeight(); i++) {\n for (int j = 0; j < image.getWidth(); j++) {\n Color color = new Color(image.getRGB(j,i));\n pixels[i*image.getWidth() + j] = color;\n }\n }\n return pixels;\n }", "public native PixelPacket getColormap(int index) throws MagickException;", "private List<int[]> separateColorChannels(RGBImage image) {\n\t\tList<int[]> outList = new ArrayList<int[]>(3);\n\t\tint[] data = (int[]) image.getValue();\n\t\tint[] rch = new int[data.length];\n\t\tint[] gch = new int[data.length];\n\t\tint[] bch = new int[data.length];\n\t\tfor (int i = 0; i < data.length && start; i++) {\n\t\t\trch[i] = (data[i] >> 16) & MASK;\n\t\t\tgch[i] = (data[i] >> 8) & MASK;\n\t\t\tbch[i] = data[i] & MASK;\n\t\t}\n\t\toutList.add(0, rch);\n\t\toutList.add(1, gch);\n\t\toutList.add(2, bch);\n\t\treturn outList;\n\t}", "BufferedImage getImage(Mat mat){\n Imgproc.cvtColor(mat,mat,Imgproc.COLOR_RGB2BGR);\n\n //Hue Saturation Lighting to Blue Green Red values\n Imgproc.cvtColor(mat,mat,Imgproc.COLOR_HLS2BGR);\n\n //Re-reverses Blue and Red color values\n Imgproc.cvtColor(mat,mat,Imgproc.COLOR_BGR2RGB);\n\n //Sets colors to grayscale\n Imgproc.cvtColor(mat,mat,Imgproc.COLOR_RGB2GRAY);\n\n\n getSpace(mat);\n WritableRaster raster = img.getRaster();\n DataBufferByte dataBuffer = (DataBufferByte) raster.getDataBuffer();\n byte[] data = dataBuffer.getData();\n mat.get(0, 0, data);\n return img;\n }", "public static Integer[][][] getRGBMatrixFromImage(BufferedImage img) {\n int w = img.getWidth();\n int h = img.getHeight();\n Integer[][][] data = new Integer[3][h][w];\n for (int y = 0; y < h; y++) {\n for (int x = 0; x < w; x++) {\n Color c = new Color(img.getRGB(x, y));\n data[0][y][x] = c.getRed();\n data[1][y][x] = c.getGreen();\n data[2][y][x] = c.getBlue();\n }\n }\n return data;\n }", "protected abstract float[] getRgbLut();", "protected abstract void toSpace( float[] rgb );", "public static ColorImage toColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "public static ColorImage toColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tcolor = img.get(x, y);\n\t\t\t\ticolor[0] = (int) color[0];\n\t\t\t\ticolor[1] = (int) color[1];\n\t\t\t\ticolor[2] = (int) color[2];\n\t\t\t\tnewimg.set(x, y, icolor);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "int getBitsPerPixel();", "private static int[][][] getImagePixels(Image img) {\n\n // Get the raw pixel data \n iObserver observer = new iObserver();\n int width1 = img.getWidth(observer);\n int height1 = img.getHeight(observer);\n int[] rawPixels = utils.getPixels(img,width1,height1);\n\n // Each pixel is represented by 32 bits. Separate the tH32 bits into\n // four 8-bit values (red, green, blue, offset).\n int[][] rgbPixels = new int[rawPixels.length][4];\n for(int j=0; j<rawPixels.length; j++) {\n rgbPixels[j][0] = ((rawPixels[j]>>16)&0xff);\n rgbPixels[j][1] = ((rawPixels[j]>>8)&0xff);\n rgbPixels[j][2] = (rawPixels[j]&0xff);\n rgbPixels[j][3] =((rawPixels[j]>>24)&0xff);\n } // for j\n\n // Arrange the data by rows and columns\n int[][][] imagePixels = new int[height1][width1][4];\n int index=0;\n for(int row=0; row<imagePixels.length; row++) {\n for(int col=0; col<imagePixels[0].length; col++) {\n for(int rgbo=0; rgbo<4; rgbo++) {\n imagePixels[row][col][rgbo]=rgbPixels[index][rgbo];\n } // for rgbo\n index++;\n } // for col\n } // for row\n return imagePixels;\n }", "public double[][] convert_img_mat()\n\t{\n\t\tif(orderflag)\n\t\t{\n\t\t\tputpixel_1();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//rotate the image and get the pixels as usual form\t\n \t\tputpixel_2();\n\t\t}\n\treturn matrix;\n\t}", "private static int[][][] convertToArray(BufferedImage image) {\n int width = image.getWidth();\n int height = image.getHeight();\n\n int[][][] result = new int[width][height][4];\n\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n int p = image.getRGB(x, y);\n int a = (p >> 24) & 0xff;\n int r = (p >> 16) & 0xff;\n int g = (p >> 8) & 0xff;\n int b = p & 0xff;\n\n result[x][y][0] = a;\n result[x][y][1] = r;\n result[x][y][2] = g;\n result[x][y][3] = b;\n }\n }\n return result;\n }", "public static ColorImage toColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "public static RealColorImage toRealColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\ticolor = img.get(x, y);\n\t\t\t\tcolor[0] = (float) icolor[0];\n\t\t\t\tcolor[1] = (float) icolor[1];\n\t\t\t\tcolor[2] = (float) icolor[2];\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "private static INDArray imageToNDArray(BufferedImage image) {\n float[][][][] data = new float[1][1][image.getWidth()][image.getHeight()];\n\n // Loop through each pixel of the image\n for (int x = 0; x < image.getWidth(); x++) {\n for (int y = 0; y < image.getHeight(); y++) {\n\n // Get color components (r, g, b)\n Color color = new Color(image.getRGB(x, y));\n int red = color.getRed();\n int green = color.getGreen();\n int blue = color.getBlue();\n\n // Calculate grey scale value and normalise\n float grey = (float) (red + green + blue) / 3;\n float normalised = 1 - grey / 255.0f;\n\n // Save value into array\n data[0][0][y][x] = normalised;\n }\n }\n\n // Convert java array to NDArray\n return Nd4j.create(data);\n }", "public static ColorImage toColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = (int) gray;\n\t\t\t\tcolor[1] = (int) gray;\n\t\t\t\tcolor[2] = (int) gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "public ColorSpace<?> getFillColorSpace(\n )\n {return fillColorSpace;}", "public static int[][] getChannel(BufferedImage img, String channel){\r\n int[][] table = new int[img.getWidth()][img.getHeight()];\r\n int flag, shift;\r\n if(channel.toLowerCase().equals(\"red\")){\r\n flag = 16711680;\r\n shift = 16;\r\n } else if (channel.toLowerCase().equals(\"green\")){\r\n flag = 65280;\r\n shift = 8;\r\n } else if (channel.toLowerCase().equals(\"blue\")) {\r\n flag = 255;\r\n shift = 0;\r\n } else {\r\n return null;\r\n }\r\n\r\n for (int i = 0; i < img.getWidth(); i++){\r\n for (int j = 0; j < img.getHeight(); j++){\r\n table[i][j] = (img.getRGB(i, j) & flag) >> shift;\r\n }\r\n }\r\n return table;\r\n }", "public static int[] getPixelColor(BufferedImage image,int x,int y) {\n int colors[] = new int[3];\n int clr = 0;\n\n try{\n clr = image.getRGB(x,y); \n }catch(Exception e){\n System.out.println(e);\n System.out.println(x + \" \" + y);\n }\n\n int red = (clr & 0x00ff0000) >> 16;\n int green = (clr & 0x0000ff00) >> 8;\n int blue = clr & 0x000000ff;\n colors[0] = red;\n colors[1] = green;\n colors[2] = blue;\n return colors;\n }", "public native int getColors() throws MagickException;", "public char identifyColor(Mat in)\r\n\t{\r\n\t\t//Mat blue = new Mat(in.rows(), in.cols(), CvType.CV_8UC1);\r\n\t\t//Mat green = new Mat(in.rows(), in.cols(), CvType.CV_8UC1);\r\n\t\t//Mat red = new Mat(in.rows(), in.cols(), CvType.CV_8UC1);\r\n\t\t\r\n\t\t//split the channels of the image\r\n\t\tMat blue = new Mat(); // default is CV_8UC3\r\n\t\tMat green = new Mat();\r\n\t\tMat red = new Mat();\r\n\t\tList<Mat> channels = new ArrayList<Mat>(3);\r\n\t\tCore.split(in, channels);\r\n\t\tblue = channels.get(0); // makes all 3 CV_8UC1\r\n\t\tgreen = channels.get(1);\r\n\t\tred = channels.get(2);\r\n\t\t//System.out.println(blue.toString());\r\n\t\t\r\n\t\t// add the intensities\r\n\t\tMat intensity = new Mat(in.rows(), in.cols(), CvType.CV_32F);\r\n\t\t//Mat mask = new Mat();\r\n\t\tCore.add(blue, green, intensity);//, mask, CvType.CV_32F);\r\n\t\tCore.add(intensity, red, intensity);//, mask, CvType.CV_32F);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t// not sure if correct from here to ...\r\n\t\t\r\n\t\t\r\n\t\tMat inten = new Mat();\r\n\t\tCore.divide(intensity, Scalar.all(3.0), inten);\r\n\t\t//System.out.println(intensity.toString());\r\n\t\t//Core.divide(3.0, intensity, inten);\r\n\t\t// if intensity = intensity / 3.0; means element-wise division\r\n\t\t// use intensity.muls(Mat m)\r\n\t\t// so make new Mat m of same size that has each element of 1/3\r\n\t\t\r\n\t\t/*\r\n\t\t * or\r\n\t\t * About per-element division you can use Core.divide()\r\n\r\n\t\t\tCore.divide(A,Scalar.all(d), B);\r\n\t\t\t\r\n\t\t\tIt's equivalent to B=A/d\r\n\t\t */\r\n\t\t\r\n\t\t// find normalized values\r\n\t\tMat bnorm = new Mat();\r\n\t\tMat gnorm = new Mat();\r\n\t\tMat rnorm = new Mat();\r\n\t\t//blue.convertTo(blue, CvType.CV_32F);\r\n\t\t//green.convertTo(green, CvType.CV_32F);\r\n\t\t//red.convertTo(red, CvType.CV_32F);\r\n\t\t\r\n\t\tCore.divide(blue, inten, bnorm);\r\n\t\tCore.divide(green, inten, gnorm);\r\n\t\tCore.divide(red, inten, rnorm);\r\n\t\t\r\n\t\t\r\n\t\t// find average norm values\r\n\t\tScalar val = new Scalar(0);\r\n\t\tval = Core.mean(bnorm);\r\n\t\tString value[] = val.toString().split(\",\");\r\n\t\tString s = value[0].substring(1);\r\n\t\tdouble bavg = Double.parseDouble(s);\r\n\t\tval = Core.mean(gnorm);\r\n\t\tString value1[] = val.toString().split(\",\");\r\n\t\tString s1 = value1[0].substring(1);\r\n\t\tdouble gavg = Double.parseDouble(s1);\r\n\t\tval = Core.mean(rnorm);\r\n\t\tString value2[] = val.toString().split(\",\");\r\n\t\tString s2 = value2[0].substring(1);\r\n\t\tdouble ravg = Double.parseDouble(s2);\r\n\t\t\r\n\t\t\r\n\t\t// ... here\r\n\t\t\r\n\t\t\r\n\t\t//original values\r\n\t\t/*\r\n\t\t// define the reference color values\r\n\t\t//double RED[] = {0.4, 0.5, 1.8};\r\n\t\t//double GREEN[] = {1.0, 1.2, 1.0};\r\n\t\tdouble BLUE[] = {1.75, 1.0, 0.5};\r\n\t\t//double YELLOW[] = {0.82, 1.7, 1.7};\r\n\t\tdouble ORANGE[] = {0.2, 1.0, 2.0};\r\n\t\tdouble WHITE[] = {2.0, 1.7, 1.7};\r\n\t\t//double BLACK[] = {0.0, 0.3, 0.3};\r\n\t\t*/\r\n\t\t\r\n\t\t\r\n\t\t// define the reference color values\r\n\t\t//double RED[] = {0.4, 0.5, 1.8};\r\n\t\t//double GREEN[] = {1.0, 1.2, 1.0};\r\n\t\tdouble BLUE[] = {1.75, 1.0, 0.5};\r\n\t\t//double YELLOW[] = {0.82, 1.7, 1.7};\r\n\t\tdouble ORANGE[] = {0.2, 1.0, 2.0};\r\n\t\tdouble WHITE[] = {2.0, 1.7, 1.7};\r\n\t\t//double BLACK[] = {0.0, 0.3, 0.3};\r\n\t\t\r\n\t\t// compute the square error relative to the reference color values\r\n\t\t//double minError = 3.0;\r\n\t\tdouble minError = 2.0;\r\n\t\tdouble errorSqr;\r\n\t\tchar bestFit = 'x';\r\n\t\t\r\n\t\t\r\n\t\t//test++;\r\n\t\t//System.out.print(\"\\n\\n\" + test + \"\\n\\n\");\r\n\t\t\r\n\t\t\r\n\t\t// check BLUE fitness\r\n\t\terrorSqr = normSqr(BLUE[0], BLUE[1], BLUE[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"Blue: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_BLUE;\r\n\t\t}\r\n\t\t// check ORANGE fitness\r\n\t\terrorSqr = normSqr(ORANGE[0], ORANGE[1], ORANGE[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"Orange: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_ORANGE;\r\n\t\t}\r\n\t\t// check WHITE fitness\r\n\t\terrorSqr = normSqr(WHITE[0], WHITE[1], WHITE[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"White: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_WHITE;\r\n\t\t}\r\n\t\t// check BLACK fitness\r\n\t\t/*errorSqr = normSqr(BLACK[0], BLACK[1], BLACK[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"Black: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_BLACK;\r\n\t\t}*/\r\n\t\t\r\n\t\t// return the best fit color label\r\n\t\treturn bestFit;\r\n\t}", "@Override\n public native Color getPixelColor(int x, int y);", "public Scalar convertColorScalar(ColorSpace to) {\n if (getColorSpace() == to)\n return getScalar();\n if (!getColorSpace().canConvertTo(to))\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n\n Scalar output = this.getScalar();\n\n try {\n for (int i = 0; i < getColorSpace().getConversionsTo(to).length; i += 3) {\n int conversion = getColorSpace().getConversionsTo(to)[i];\n int inputDim = getColorSpace().getConversionsTo(to)[i + 1];\n int outputDim = getColorSpace().getConversionsTo(to)[i + 2];\n\n Mat pointMatTo = new Mat();\n Mat pointMatFrom = new Mat(1, 1, CvType.CV_8UC(inputDim), output);\n Imgproc.cvtColor(pointMatFrom, pointMatTo, conversion, outputDim);\n output = new Scalar(pointMatTo.get(0, 0));\n pointMatTo.release();\n pointMatFrom.release();\n }\n } catch (Exception ignored) {\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n }\n\n return output;\n }", "public BufferedImage toImage(){\n // turn it into a png\n int scale = 8;\n int w = 16;\n int h = 16;\n BufferedImage image = new BufferedImage(w * scale, h * scale, BufferedImage.TYPE_INT_ARGB);\n Color background = new Color(240, 240, 240);\n java.awt.Graphics gr = image.getGraphics();\n gr.setColor(background);\n gr.fillRect(0, 0, w * scale, h * scale);\n\n // so each 3 bytes describes 1 color?\n for(int i = 0; i < 256; ++i){\n\n // int r = palette.get(i * 3);\n // int g = palette.get(i * 3 + 1);\n // int b = palette.get(i * 3 + 2);\n\n // the Color() constructor that takes ints does values 0..255\n // but it has a float constructor, so why not divide\n //Color awtColor = new Color(r/64.0f, g/64.0f, b/64.0f);\n Color awtColor = getAwtColor(i);\n\n int row = i / 16;\n int col = i % 16;\n int y = row * scale;\n int x = col * scale;\n gr.setColor(awtColor);\n gr.fillRect(x, y, x + scale, y + scale);\n }\n\n return image;\n }", "public void gettingImageInput(){\n Bitmap bm = getYourInputImage();\n int z;\n if(res==2) { z=50; }\n else { z=224; }\n Bitmap bitmap = Bitmap.createScaledBitmap(bm, z, z, true);\n input = ByteBuffer.allocateDirect(z * z * 3 * 4).order(ByteOrder.nativeOrder());\n for (int y = 0; y < z; y++) {\n for (int x = 0; x < z; x++) {\n int px = bitmap.getPixel(x, y);\n\n // Get channel values from the pixel value.\n int r = Color.red(px);\n int g = Color.green(px);\n int b = Color.blue(px);\n\n // Normalize channel values to [-1.0, 1.0]. This requirement depends\n // on the model. For example, some models might require values to be\n // normalized to the range [0.0, 1.0] instead.\n float rf = (r) / 255.0f;\n float gf = (g) / 255.0f;\n float bf = (b) / 255.0f;\n\n input.putFloat(rf);\n input.putFloat(gf);\n input.putFloat(bf);\n }\n }\n }", "public static int[][] getMatrizBin(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 int[][] output = new int[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] = 1;\r\n } else {\r\n output[x][y] = 0;\r\n }\r\n \r\n }\r\n }\r\n\r\n return output;\r\n }", "private native int grayToRgb(byte src[],int dst[]);", "public static ColorImage toColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (int) img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "public RGBImage makeRGBImage()\r\n {\r\n\tint rows = getHeight();\r\n\tint cols = getWidth();\r\n \r\n\tshort[][] red = new short[rows][cols]; \r\n\tshort[][] green = new short[rows][cols]; \r\n\tshort[][] blue = new short[getHeight()][getWidth()]; \r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\tshort v1, v2, v3, h, h0, sat, intens;\r\n\tint sector;\r\n\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\r\n\t\tif (saturation[row][col] == 0)\r\n\t\t{\r\n\t\t red[row][col] = intensity[row][col];\r\n\t\t green[row][col] = intensity[row][col];\r\n\t\t blue[row][col] = intensity[row][col];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t h0 = hue[row][col];\r\n\r\n\t\t if (h0 <= (L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)h0;\r\n\t\t\tsector = 1;\r\n\t\t }\r\n\t\t else if (h0 <= 2*(L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)(h0 - (L-1)/3);\r\n\t\t\tsector = 2;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\th = (short)(h0 - 2*(L-1)/3);\r\n\t\t\tsector = 3;\r\n\t\t }\r\n\r\n\t\t H = h * 2 * Math.PI / (L-1);\r\n\r\n\t\t sat = saturation[row][col];\r\n\t\t S = (double)sat / (L-1);\r\n\r\n\t\t intens = intensity[row][col]; \r\n\t\t I = (double)intens / (L-1);\r\n\r\n\t\t v1 = (short)Math.round(intens * (1 - S));\r\n\t\t v1 = checkInterval (v1);\r\n\r\n\t\t v2 = (short)Math.round(intens * (1 + S * Math.cos(H)/\r\n\t\t\t\t\t\t Math.cos(Math.PI/3 - H) ));\r\n\t\t v2 = checkInterval (v2);\r\n \r\n\t\t v3 = (short)Math.round(3 * intens - (v1 + v2));\r\n\t\t v3 = checkInterval (v3);\r\n \r\n\t\t if (sector == 1)\r\n\t\t {\r\n\t\t\tblue[row][col] = v1;\r\n\t\t\tred[row][col] = v2;\r\n\t\t\tgreen[row][col] = v3;\r\n\t\t }\r\n\t\t else if (sector == 2)\r\n\t\t {\r\n\t\t\tred[row][col] = v1;\r\n\t\t\tgreen[row][col] = v2;\r\n\t\t\tblue[row][col] = v3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tgreen[row][col] = v1;\r\n\t\t\tblue[row][col] = v2;\r\n\t\t\tred[row][col] = v3;\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t}\r\n \r\n\treturn new RGBImage (red, green, blue);\r\n }", "public ByteBuffer getColorBuffer() {\n if (colorBuf == null){\n \tcolorBuf = ByteBuffer.allocateDirect(getIndicesBuffer().limit()*4*4);\n \tcolorBuf.order(ByteOrder.nativeOrder());\n \tFloatBuffer fb = colorBuf.asFloatBuffer();\n \tfor (int i=0; i<getIndicesBuffer().limit(); i++){\n \t\tfb.put(defaultColor);\n \t}\n\t\t\tcolorBuf.position(0);\n }\n \treturn colorBuf;\n }", "private static int colorspaceSh(int s) {\r\n return (s << 16);\r\n }", "public static RealColorImage toRealColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "public native boolean rgbTransformImage(int colorspace)\n\t\t\tthrows MagickException;", "public Color[][] getPixels() {\r\n return pixels;\r\n }", "public static int[] getPixelColor(final BufferedImage img, final int x, final int y){\n int rgb = img.getRGB(x, y);\n int r = (rgb >> 16) & 0xFF;\n int g = (rgb >> 8) & 0xFF;\n int b = (rgb & 0xFF);\n\t\n return new int[]{r,g,b};\n }", "float[] getColorData(int trisCount, int color) {\n float[] colDat = new float[trisCount * 4];\n float alpha = 255;\n float red = 255;\n float green = 255;\n float blue = 255;\n if(color != -1) {\n alpha = color >> 24 & 0xff;\n red = color >> 16 & 0xff;\n green = color >> 8 & 0xff;\n blue = color & 0xff;\n }\n// Log.e(\"Modelbase\", \"shift = \" + red + \",\" + green + \",\" + blue + \",\" + alpha);\n red /= 255f;\n green /= 255f;\n blue /= 255f;\n alpha /= 255f;\n// Log.e(\"Modelbase\", \"div by 255 = \" + red + \",\" + green + \",\" + blue + \",\" +\n// alpha);\n for (int i = 0; i < colDat.length; i += 4) {\n colDat[i] = red;\n colDat[i + 1] = green;\n colDat[i + 2] = blue;\n colDat[i + 3] = alpha;\n }\n return colDat;\n }", "public int getTransparency() {\n/* 148 */ return this.bufImg.getColorModel().getTransparency();\n/* */ }", "public Mat Convert(BufferedImage im) {\n\t\t// Convert INT to BYTE\n\t\t//im = new BufferedImage(im.getWidth(), im.getHeight(),BufferedImage.TYPE_3BYTE_BGR);\n\t\t// Convert bufferedimage to byte array\n\t\tbyte[] pixels = ((DataBufferByte) im.getRaster().getDataBuffer())\n\t\t\t\t.getData();\n\n\t\t// Create a Matrix the same size of image\n\t\tMat image = new Mat(im.getHeight(), im.getWidth(), CvType.CV_8UC3);\n\t\t// Fill Matrix with image values\n\t\timage.put(0, 0, pixels);\n\n\t\treturn image;\n\n\n\t}", "private static double [][][] convertToArray1(BufferedImage image) {\n int width = image.getWidth();\n int height = image.getHeight();\n\n double [][][] result = new double [width][height][4];\n\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n int p = image.getRGB(x, y);\n int a = (p >> 24) & 0xff;\n int r = (p >> 16) & 0xff;\n int g = (p >> 8) & 0xff;\n int b = p & 0xff;\n\n result[x][y][0] = a;\n result[x][y][1] = r;\n result[x][y][2] = g;\n result[x][y][3] = b;\n }\n }\n return result;\n }", "public Color convertColor(ColorSpace to) {\n Scalar output = convertColorScalar(to);\n\n Class<? extends Color> colorClass = to.getColorClass();\n\n try {\n return colorClass.getConstructor(Scalar.class).newInstance(output);\n } catch (Exception ignored) {\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n }\n }", "void greyscale();", "void greyscale();", "public int getRgbColor()\n {\n return _rgbColor;\n }", "public static RealColorImage toRealColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "public native boolean transformRgbImage(int colorspace)\n\t\t\tthrows MagickException;", "public BufferedImage getImage(int[][] data) {\n BufferedImage image = new BufferedImage(IMGSIZEX, IMGSIZEY,\n BufferedImage.TYPE_INT_RGB);\n for (int x = 0; x < IMGSIZEX; x++) {\n for (int y = 0; y < IMGSIZEY; y++) {\n int pixelColor = data[x][y];\n // Set Colors based on Binary Image value\n if (pixelColor == 0) {\n pixelColor = Color.ORANGE.getRGB();\n } else {\n pixelColor = Color.CYAN.getRGB();\n }\n image.setRGB(x, y, pixelColor);\n } // End for y.\n } // End for x.\n return image;\n }", "protected int[] getPalettePixels() {\n \t\t\tif (palettePixels == null) {\n \n \t\t\t\tpalettePixels = new int[numColors];\n \t\t\t\t\n \t\t\t\tfor (int x = 0; x < numColors; x++) {\n \t\t\t\t\tpalettePixels[x] = rgb8ToPixel(palette[x]);\n \t\t\t\t}\n \t\t\t}\n \t\t\treturn palettePixels;\n \t\t}", "java.awt.Color getColor();", "public int[] getRGB() throws ImageException {\r\n\tif (!bValid){\r\n\t\tthrow new ImageException(\"image not valid\");\r\n\t}\t\r\n\treturn originalRGB;\r\n}", "@Test\r\n public void testDirectMatPainting8SC1() {\n Mat m = new Mat(width, height, CV_8SC1);\r\n assertEquals(1, m.channels());\r\n assertEquals(1, m.capacity());\r\n assertEquals(width, m.step());\r\n assertEquals(width, m.cols());\r\n assertEquals(height, m.rows());\r\n\r\n ByteBuffer bb = m.createBuffer();\r\n for (long i = 0; i < width * height; i++) {\r\n long x = i % width, y = i / width;\r\n // blue to gray:\r\n byte gray = (byte) (pixelFunc(x, y) & 0xff);\r\n bb.put(gray);\r\n }\r\n\r\n // negative gray values get ignored/mapped to black/0. The total\r\n // (Java byte -> gray value) mapping is then:\r\n // -128..127 -> 128x 0, 0..127\r\n imwrite(new File(TEMP_DIR, \"testDirectMatPainting8SC1.png\").getAbsolutePath(), m);\r\n // @insert:image:testDirectMatPainting8SC1.png@\r\n }", "public static RealColorImage toRealColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "private BufferedImage worldToImage() {\n if (world == null) {\n return null;\n }\n\n BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);\n\n int[] rgbWorld = new int[width * height];\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n int index = twoDimIndexToOneDimIndex(x, y);\n rgbWorld[index] = world[x][y].getRgbColor();\n }\n }\n\n image.setRGB(0, 0, width, height, rgbWorld, 0, width);\n\n return image;\n }", "public Color[] getColors();", "public native PixelPacket getBackgroundColor() throws MagickException;", "private TileType[][] imageToWorld(BufferedImage image) {\n if (image == null) {\n return null;\n }\n\n width = image.getWidth();\n height = image.getHeight();\n int[] rgbWorld = image.getRGB(0, 0, width, height, null, 0, width);\n\n TileType[][] tileWorld = new TileType[width][height];\n\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n int index = twoDimIndexToOneDimIndex(x, y);\n tileWorld[x][y] = TileType.rgbColorToTile(rgbWorld[index]);\n if (tileWorld[x][y] == TileType.UNKNOWN) {\n System.err.println(\"Locaetion: \" + index + \" (\" + x + \",\" + y + \")\");\n }\n }\n }\n return tileWorld;\n }", "public ArrayList getColors(int amount){\n \n \tArrayList colors = new ArrayList();\n\n \tfloat step = img.width/amount;\n\n \tfor (int i=0; i < Math.floor(img.width/step); i++){\n \t\tfloat index = map(i*step,0,img.width,0,(float)1.0);\n \t\tint c = getColorAt(index);\n \t\tcolors.add(c);\n \t} \n\n \treturn colors;\n\n }", "Picture colourComponentImage() throws Exception;", "public abstract Color getRegionColor(double[] offset, double[] size);", "int[] getStartRGB();", "public abstract RGBPixel getPixelRgb(int x, int y);", "@Test\n public void testSetColorModel() throws FitsException, IOException{\n IndexColorModel colorModel = ColorTable.getColorModel(2);\n ImageData imageData = new ImageData(frArray, IMAGE_TYPE,COLROID, rangeValues, 0,0, 100, 100, true );\n imageData.setColorModel(colorModel);\n Assert.assertEquals(-1, imageData.getColorTableId());\n\n }", "public void ToImage(){\n\t\tint row=SL.length;\n\t\tint col=SL[0].length;\n\t\tint cr=0;\n\t\tint cb=0;\n\t\t// System.out.println(row+\" \"+col);\n\t\tint[] intArray = new int[3*row*col];\n\t\tint w=row;\n\t int h=col;\n\t BufferedImage image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);\n\t\tint pixel = 0;\n\t\tfor(int x=0;x<row;x++){\n\t\t\tfor(int y=0;y<col;y++){\n\t\t\t\tint rByte = (int)(SL[x][y]);\n\t\t int gByte = (int)(SL[x][y]);\n\t\t int bByte = (int)(SL[x][y]);\n\t\t \n\t\t // int rByte = (int)(SL[x][y]+1.402*(cr-128));\n\t\t // int gByte = (int)(SL[x][y]-0.3414*(cb-128)-0.71414*(cr-128));\n\t\t // int bByte = (int)(SL[x][y]+1.772*(cb-128));\n\t\t int rgb = (rByte *65536) + (gByte * 256) + bByte;\n\t\t image.setRGB(x,y,rgb);\n\t \t}\n\t\t}\n\t try {\n\t ImageIO.write(image, \"bmp\", new File(\"\"+picture_num+\".png\"));\n\t } catch (Exception e) {\n\t e.printStackTrace();\n\t }\n\t}", "public abstract RGBIColor toRGBColor();", "private int[][] readPixels() throws IOException {\n \t\tif (!imageFile.exists()) {\n \t\t\tSystem.err.println(\"No such image: \" + imageFile.getPath());\n \t\t\tSystem.exit(2);\n \t\t}\n \n \t\t// read and scale input image\n \t\tfinal BufferedImage image =\n \t\t\tscale(ImageIO.read(imageFile), CAL_WIDTH, CAL_HEIGHT);\n \n \t\t// convert to 2-bit grayscale data\n \t\tfinal int[][] pix = new int[CAL_HEIGHT][CAL_WIDTH];\n \t\tfor (int y = 0; y < CAL_HEIGHT; y++) {\n \t\t\tfor (int x = 0; x < CAL_WIDTH; x++) {\n \t\t\t\tfinal int rgb = image.getRGB(x, y);\n \t\t\t\t// CTR CHECK\n \t\t\t\tfinal int r = 0xff & rgb;\n \t\t\t\tfinal int g = 0xff & (rgb >> 8);\n \t\t\t\tfinal int b = 0xff & (rgb >> 16);\n \n \t\t\t\t// convert RGB to 8-bit grayscale\n \t\t\t\tfinal int gray = (int) Math.round(0.299 * r + 0.587 * g + 0.114 * b);\n \n \t\t\t\t// convert 8-bit to 2-bit (4 possible values)\n \t\t\t\tpix[y][x] = gray / 64;\n \t\t\t}\n \t\t}\n \t\treturn pix;\n \t}", "public int[] getColorIndices();", "private BufferedImage initImg() throws IOException {\n\t\tint h = 256, w = 256;\n\t\tBufferedImage img = new BufferedImage(h, w, BufferedImage.TYPE_INT_ARGB);\n\t\t\n\t\t//int red = 0xff000000 + 0x00ff0000 + 0x00000000 + 0x00000000;\n\t\tshort max = 0, min = 255, c = max;\n\t\tint color = SimpleImageViewer.getIntPixel(c, c, c);\n\t\t\n\t\tfor (int y = 0; y < h; y++) {\n\t\t\tfor (int x = 0; x < w; x++) {\n\t\t\t\timg.setRGB(x, y, color);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn img;\n\t}", "public static RealColorImage toRealColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "public static double[][][] scale(BufferedImage image, int scaledWidth, int scaledHeight) {\n double [][][] m = new double[3][scaledHeight][scaledWidth];\n\n int width = image.getWidth();\n int height = image.getHeight();\n double xScale = width / (double) scaledWidth;\n double yScale = height / (double) scaledHeight;\n\n double yEnd = 0;\n for (int i = 0; i < scaledHeight; i++) {\n\n double yStart = yEnd;\n yEnd = (i + 1) * yScale;\n if (yEnd >= height) {\n yEnd = height - 0.000001;\n }\n double xEnd = 0;\n for (int j = 0; j < scaledWidth; j++) {\n\n double xStart = xEnd;\n xEnd = (j + 1) * xScale;\n if (xEnd >= width) {\n xEnd = width - 0.000001;\n }\n\n double sumL = 0;\n double sumCb = 0;\n double sumCr = 0;\n\n for (int y = (int)yStart; y <= yEnd; y++) {\n double yPortion = 1.0;\n if (y == (int)yStart) {\n yPortion -= yStart - y;\n }\n if (y == (int)yEnd) {\n yPortion -= y + 1 - yEnd;\n }\n\n for (int x = (int)xStart; x <= xEnd; x++) {\n double xPortion = 1.0;\n if (x == (int)xStart) {\n xPortion -= xStart - x;\n }\n if (x == (int)xEnd) {\n xPortion -= x + 1 - xEnd;\n }\n\n Color color = new Color(image.getRGB(x, y));\n int r = color.getRed();\n int g = color.getGreen();\n int b = color.getBlue();\n\n double l = 0.299 * r + 0.587 * g + 0.114 * b;\n double cb = 128 - 0.169 * r - 0.331 * g + 0.500 * b;\n double cr = 128 + 0.500 * r - 0.419 * g - 0.081 * b;\n\n double portionArea = xPortion * yPortion;\n sumL += l * portionArea;\n sumCb += cb * portionArea;\n sumCr += cr * portionArea;\n }\n }\n double invArea = 1.0 / ((xEnd - xStart) * (yEnd - yStart));\n m[0][i][j] = sumL * invArea - 128;\n m[1][i][j] = sumCb * invArea - 128;\n m[2][i][j] = sumCr * invArea - 128;\n }\n }\n\n return m;\n }", "public static IntArrayPtr\ngetPackedColors(SoState state) \n{ \n SoLazyElement curElt = getInstance(state);\n if(state.isCacheOpen()) curElt.registerGetDependence(state, masks.DIFFUSE_MASK.getValue()); \n //return curElt.ivState.packedColors;\n return curElt.coinstate.packedarray;\n}", "public int[][][] getdata(){\r\n\t\theight = BfImage.getHeight();\r\n\t\twidth = BfImage.getWidth();\r\n\t\tint[][][] data = new int[height][width][3];\r\n\t\t\r\n\t\tfor (int x = 0; x < width; x++)\t\t\t\t//store image's RGB data\r\n\t\t\tfor (int y = 0; y < height; y++) {\r\n\t\t\t\tint rgb = BfImage.getRGB(x, y);\r\n\t\t\t\tif (rgb == 0 || rgb == 3){\t//is transparent || Transparency.TRANSLUCENT\r\n\t\t\t\t\tdata[y][x][0] = -1;\r\n\t\t\t\t\tdata[y][x][1] = -1;\r\n\t\t\t\t\tdata[y][x][2] = -1;\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tdata[y][x][0] = Utils.getR(rgb);\r\n\t\t\t\t\tdata[y][x][1] = Utils.getG(rgb);\r\n\t\t\t\t\tdata[y][x][2] = Utils.getB(rgb);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\treturn data;\r\n\t}", "public IntBuffer getData(BufferedImage img)\n\t{\n\t\tIntBuffer buf = IntBuffer.allocate(img.getWidth()*img.getHeight());\n\t\t//ByteBuffer b = ByteBuffer.allocate(buf.capacity()*4);\n\n\t\tfor(int i=0; i<img.getHeight(); i++)\n\t\t{\n\t\t\tfor(int j=0; j<img.getWidth(); j++)\n\t\t\t{\n\t\t\t\t// We need to shuffle the RGB values to pass them correctly to OpenGL. \n\t\t\t\tint in = img.getRGB(j,i);\n\t\t\t\tint out = ((in & 0x000000FF) << 16) | (in & 0x0000FF00) | ((in & 0x00FF0000) >> 16);\n\t\t\t\tbuf.put((img.getHeight()-i-1)*img.getWidth()+j, out);\n\t\t\t}\n\t\t}\n\t\t//b.asIntBuffer().put(buf);\n\t\treturn buf;\n\t}", "public Mat convertToEdges(Mat img) {\n\n return img;\n }", "public FloatBuffer getColorBuffer() {\n return this.colorBuffer;\n }", "public static Integer[] findEdgecolors(BufferedImage image)\r\n\t{\r\n\t\t// try to clean up the image by removing stray marks\r\n\t\t\t\tInteger[] colors=new Integer[10]; \r\n\t\t\t\tint[] width={0,image.getWidth()-1}; // horizontal comparision array\r\n\t\t\t\tint[] heigth={0,image.getHeight()-1}; // vertical comparision array\r\n\t\t\t\tint i=0;\r\n\t\t\t\tfor(int x=0;x<=1;x++){ \r\n\t\t\t\t\tfor (int y=0; y<image.getHeight(); y++) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tint pixelVal = image.getRGB(width[x], y);//getting the edge color in RGB value\r\n\t\t\t\t\t\tif(!Arrays.asList(colors).contains(pixelVal)) // checking if the color already exists if yes do nothing if no add the color to array\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcolors[i]=pixelVal;\r\n\t\t\t\t\t\t\ti++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t i=0;\r\n\t\t\t\t\tfor(int x=0;x<image.getWidth();x++){\r\n\t\t\t\t\t\tfor (int y=0; y<=1; y++) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tint pixelVal = image.getRGB(x, width[y]);//getting the edge color in RGB value\r\n\t\t\t\t\t\t\tif(!Arrays.asList(colors).contains(pixelVal))// checking if the color already exists if yes do nothing if no add the color to array\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tcolors[i]=pixelVal;\r\n\t\t\t\t\t\t\t\ti++;\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\treturn colors;\r\n\t}", "private static BufferedImage colorImage(BufferedImage image, Color color) {\n int width = image.getWidth();\n int height = image.getHeight();\n WritableRaster raster = image.getRaster();\n\n for (int xx = 0; xx < width; xx++) {\n for (int yy = 0; yy < height; yy++) {\n int[] pixels = raster.getPixel(xx, yy, (int[]) null);\n\n //colorize the pixels only if the pixel is opaque and white\n if (pixels[0] > 50 && pixels[1] > 50 && pixels[2] > 50) {\n pixels[0] = (int) (color.getRed()*255);\n pixels[1] = (int) (color.getGreen()*255);\n pixels[2] = (int) (color.getBlue()*255);\n raster.setPixel(xx, yy, pixels);\n }\n\n }\n }\n return image;\n }", "RGB getRealRGB(Color color) {\n\tImage colorImage = new Image(display, 10, 10);\n\tGC imageGc = new GC(colorImage);\n\tImageData imageData;\n\tPaletteData palette;\n\tint pixel;\n\t\n\timageGc.setBackground(color);\n\timageGc.setForeground(color);\n\timageGc.fillRectangle(0, 0, 10, 10);\n\timageData = colorImage.getImageData();\n\tpalette = imageData.palette;\n\timageGc.dispose();\n\tcolorImage.dispose();\n\tpixel = imageData.getPixel(0, 0);\n\treturn palette.getRGB(pixel);\n}", "void imageData(int width, int height, int[] rgba);", "@LargeTest\n public void testIntrinsicsColorMatrix() {\n TestAction ta = new TestAction(TestName.INTRINSICS_COLOR_MATRIX);\n runTest(ta, TestName.INTRINSICS_COLOR_MATRIX.name());\n }", "private void createFromVCImage(VCImage vcImage) throws ImageException {\r\n\tsizeX = vcImage.getNumX();\r\n\tsizeY = vcImage.getNumY();\r\n\tsizeZ = vcImage.getNumZ();\r\n\tif (sizeX*sizeY*sizeZ!=vcImage.getPixels().length){\r\n\t\tthrow new ImageException(\"pixelData not properly formed\");\r\n\t}\r\n\toriginalRGB = new int[sizeX*sizeY*sizeZ];\r\n\tfor (int i=0;i<vcImage.getPixels().length;i++){\r\n\t\tint pixel = ((int)vcImage.getPixels()[i])&0xff;\r\n\t\toriginalRGB[i] = new java.awt.Color(pixel,pixel,pixel).getRGB();\r\n\t}\r\n\tbValid = true;\r\n\timageName = (vcImage.getVersion()!=null)?vcImage.getVersion().getName():\"unnamedImage\";\t\r\n}", "public int colorVertices();", "public void toGreen(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 \r\n for(int j=startY;j<endY;j++){\r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = 0*pixels[0];\r\n ww[1] = pixels[1];\r\n ww[2] = 0*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 }", "private int[] makeRGBArray(Color color) {\n\t\treturn new int[]{color.getRed(), color.getGreen(), color.getBlue()};\n\t}", "public void toRed(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] = pixels[0];\r\n ww[1] = 0*pixels[1];\r\n ww[2] = 0*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 }", "Color getColor();", "Color getColor();", "Color getColor();", "Color getColor();", "Color getColor();", "public int[] getColorIndexes()\n {\n return this.colorIndexes;\n }", "public short[] getRed() {\n short[] buf = new short[pixels.length];\n for (int i = 0; i < buf.length; ++i)\n buf[i] = (short) cModel.getRed(pixels[i]);\n return buf;\n }", "private static int[][] copyRegiontoArray(int[] dim, ArrayList<PositionAndColor> region) {\n\t\tint[][] res = new int[(dim[1] - dim[0]) + 1][(dim[3] - dim[2]) + 1];\n\t\tImageOperation.fillArray(res, ImageOperation.BACKGROUND_COLORint);\n\t\tfor (Iterator<PositionAndColor> i = region.iterator(); i.hasNext();) {\n\t\t\tPositionAndColor temp = i.next();\n\t\t\tres[temp.x - dim[0]][temp.y - dim[2]] = temp.intensityInt;\n\t\t}\n\t\treturn res;\n\t}", "public static BufferedImage sharpenByMatrix3(BufferedImage img) {\n\t\tint width = img.getWidth();\n\t\tint height = img.getHeight();\n\t\tint[] pixels = new int[width*height];\n\t\timg.getRGB(0, 0, width, height, pixels, 0, width);\n\t\tint[][] pixelArr = quantize.changeDimension2(pixels, width);\n\t\tint[][] newArr = new int[height][width];\n\t\tfor (int i = 0 ;i < width; i++) {\n\t\t\tfor (int j = 0; j < height; j++) {\n\t\t\t\tnewArr[j][i] = getNewData(pixelArr, coefficient9, i, j);\n\t\t\t}\n\t\t}\n\t\tBufferedImage image = new BufferedImage(width, height, img.getType());\n\t\timage.setRGB(0, 0, width, height, quantize.changeDimension1(newArr), 0, width);\n\t\treturn image;\n\t}", "public Color[] getExperimentColors();" ]
[ "0.72883844", "0.68518764", "0.6780608", "0.67418027", "0.672192", "0.62538284", "0.6212731", "0.6120523", "0.611928", "0.6105473", "0.6092443", "0.60914946", "0.60761267", "0.60568833", "0.60379595", "0.5919536", "0.5899321", "0.58551383", "0.5851213", "0.5805033", "0.5793096", "0.5781359", "0.57585984", "0.56948614", "0.56255555", "0.5624654", "0.5624179", "0.5608132", "0.5597326", "0.55856186", "0.5563164", "0.5547059", "0.5542249", "0.5526543", "0.55048484", "0.54602915", "0.5446861", "0.5438553", "0.5438528", "0.5435568", "0.54272234", "0.5398612", "0.5393034", "0.5386907", "0.5376689", "0.5363026", "0.5332425", "0.5326879", "0.5326879", "0.5317854", "0.5305892", "0.53015876", "0.5293854", "0.5292487", "0.52769136", "0.5276879", "0.5268727", "0.52598363", "0.5233154", "0.5230791", "0.52035224", "0.51971227", "0.5196919", "0.5180372", "0.51777697", "0.51599586", "0.5157186", "0.51567477", "0.5151464", "0.51417905", "0.5136011", "0.5123012", "0.51185334", "0.51172465", "0.51065576", "0.5104528", "0.51042557", "0.50956017", "0.50933874", "0.5080337", "0.50797135", "0.5070755", "0.5065641", "0.50631714", "0.50493515", "0.5049073", "0.50302035", "0.5021712", "0.5012047", "0.4994958", "0.4986288", "0.4986288", "0.4986288", "0.4986288", "0.4986288", "0.49855703", "0.49817312", "0.4978829", "0.4974318", "0.49655372" ]
0.60554534
14
A set of different image manipulations Reverses Red and Blue color values
BufferedImage getImage(Mat mat){ Imgproc.cvtColor(mat,mat,Imgproc.COLOR_RGB2BGR); //Hue Saturation Lighting to Blue Green Red values Imgproc.cvtColor(mat,mat,Imgproc.COLOR_HLS2BGR); //Re-reverses Blue and Red color values Imgproc.cvtColor(mat,mat,Imgproc.COLOR_BGR2RGB); //Sets colors to grayscale Imgproc.cvtColor(mat,mat,Imgproc.COLOR_RGB2GRAY); getSpace(mat); WritableRaster raster = img.getRaster(); DataBufferByte dataBuffer = (DataBufferByte) raster.getDataBuffer(); byte[] data = dataBuffer.getData(); mat.get(0, 0, data); return img; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void decomposeColors(int[][] array,int[][] red,int[][] green,int[][] blue){\n\t\tfor(int i=0;i<array.length;i++){\n\t\t\tfor(int j=0;j<array[0].length;j++){\n\t\t\t\tint pixel = array[i][j];\n\t\t\t\tred[i][j] = GImage.getRed(pixel);\n\t\t\t\tgreen[i][j] = GImage.getGreen(pixel);\n\t\t\t\tblue[i][j] = GImage.getBlue(pixel);\n\t\t\t}\n\t\t}\n\t\t//Your code ends here\n\t}", "public void runDarken() {\n BufferedImage transformedImage = new BufferedImage(this.image.getWidth(), this.image.getHeight(), this.image.getType());\n\n try {\n for(int i = 0; i < this.image.getWidth(); i++) {\n for(int j = 0; j < this.image.getHeight(); j++) {\n transformedImage.setRGB(i, j, image.getRGB(i,j));\n }\n }\n float scaleFactor = 0.5f;\n RescaleOp op = new RescaleOp(scaleFactor, 0, null);\n transformedImage = op.filter(transformedImage, null);\n\n File outputImageFileLocation = new File(this.exportLocation);\n ImageIO.write(transformedImage, Files.getFileExtension(this.imageLocation), outputImageFileLocation);\n System.out.println(\"Success\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void invert() {\n int len= currentIm.getRows() * currentIm.getCols();\n \n // invert all pixels (leave alpha/transparency value alone)\n \n // invariant: pixels 0..p-1 have been complemented.\n for (int p= 0; p < len; p= p+1) {\n int rgb= currentIm.getPixel(p);\n int red= 255 - DM.getRed(rgb);\n int blue= 255 - DM.getBlue(rgb);\n int green= 255 - DM.getGreen(rgb);\n int alpha= DM.getAlpha(rgb);\n currentIm.setPixel(p,\n (alpha << 24) | (red << 16) | (green << 8) | blue);\n }\n }", "private void recompose(int[][] array,int[][] red,int[][] green,int[][] blue){\n\t\tfor(int i=0;i<array.length;i++){\n\t\t\tfor(int j=0;j<array[0].length;j++){\n\t\t\t\tarray[i][j]=GImage.createRGBPixel(red[i][j],green[i][j],blue[i][j]);\n\t\t\t}\n\t\t}\n\t\t//Your code ends here\n\t}", "public void invertImage()\r\n {\r\n BufferedImage toInvert;\r\n if (isChanged || isBlured )\r\n {\r\n toInvert = cropedEdited;\r\n }\r\n else\r\n {\r\n toInvert = cropedPart;\r\n }\r\n for (int x = 0; x < toInvert.getWidth(); x++) {\r\n for (int y = 0; y < toInvert.getHeight(); y++) {\r\n int rgba = toInvert.getRGB(x, y);\r\n Color col = new Color(rgba, true);\r\n col = new Color(255 - col.getRed(),\r\n 255 - col.getGreen(),\r\n 255 - col.getBlue());\r\n toInvert.setRGB(x, y, col.getRGB());\r\n }\r\n }\r\n repaint();\r\n }", "private static Picture negateColor(Picture pic){\r\n int red = 0, green = 0, blue = 0;\r\n\r\n for( Pixel p : pic.getPixels()){\r\n // get colors of pixel and negate\r\n red = 255 - p.getRed();\r\n green = 255 - p.getGreen();\r\n blue = 255 - p.getBlue();\r\n p.setColor(new Color(red, green, blue));\r\n // pic.setBasicPixel(p.getX(), p.getY(), color.hashCode());\r\n }\r\n return pic;\r\n }", "public Pic invert() {\n Pic output = image.deepCopy();\n Pixel[][] outputPixels = output.getPixels();\n for (int row = 0; row < output.getHeight(); row++) {\n for (int col = 0; col < output.getWidth(); col++) {\n Pixel current = outputPixels[row][col];\n current.setRed(255 - current.getRed());\n current.setGreen(255 - current.getGreen());\n current.setBlue(255 - current.getBlue());\n }\n }\n return output;\n }", "public void apply(OFImage image)\n {\n int height = image.getHeight();\n int width = image.getWidth();\n OFImage original = new OFImage(image);\n \n for(int y = 0; y < height; y++) {\n for(int x = 0; x < width; x++) {\n Color currentPixel = original.getPixel(x,y);\n int grn,blu,red;\n grn = 255 - currentPixel.getGreen();\n red = 255 - currentPixel.getRed();\n blu = 255 - currentPixel.getBlue();\n image.setPixel(x, y, new Color(red,blu,grn));\n }\n }\n }", "public void complement(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(255-originPixel[index].getGreen());\n originPixel[index].setBlue(255-originPixel[index].getBlue());\n originPixel[index].setRed(255-originPixel[index].getRed()); \n }\n \n \n \n }", "private void changePixelValues(ImageProcessor ip) {\n\t\t\tint[] pixels = (int[])ip.getPixels();\r\n\t\t\t\r\n\t\t\tfor (int y=0; y<height; y++) {\r\n\t\t\t\tfor (int x=0; x<width; x++) {\r\n\t\t\t\t\tint pos = y*width + x;\r\n\t\t\t\t\tint argb = origPixels[pos]; // Lesen der Originalwerte \r\n\t\t\t\t\t\r\n\t\t\t\t\tint r = (argb >> 16) & 0xff;\r\n\t\t\t\t\tint g = (argb >> 8) & 0xff;\r\n\t\t\t\t\tint b = argb & 0xff;\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t// anstelle dieser drei Zeilen später hier die Farbtransformation durchführen,\r\n\t\t\t\t\t// die Y Cb Cr -Werte verändern und dann wieder zurücktransformieren\r\n\t\t\t\t\t\r\n\t\t\t\t\tYUV c = new YUV(r, g, b);\r\n\t\t\t\t\t\r\n\t\t\t\t\tc.changeBrightness(brightness).changeContrast(contrast).changeSaturation(saturation).changeHue(hue);\r\n\t\t\t\t\t\r\n\t\t\t\t\tint[] rgbNew = c.toRGB();\r\n\r\n\t\t\t\t\t// Hier muessen die neuen RGB-Werte wieder auf den Bereich von 0 bis 255 begrenzt werden\r\n\t\t\t\t\t\r\n\t\t\t\t\tpixels[pos] = (0xFF<<24) | (rgbNew[0]<<16) | (rgbNew[1]<<8) | rgbNew[2];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "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}", "public void decida()\n {\n if(color == Color.red)\n {\n color = Color.yellow;\n }\n \n else if(color == Color.yellow){\n color = Color.red;\n }\n }", "private void DecreaseBrightnessActionPerformed(java.awt.event.ActionEvent evt) {\n if(flag==1){\n for(int y=0;y<height;y++){\n // c = ((y/height)*100);\n // ProgressBar.setValue(c);\n for(int x=0;x<width;x++)\n {\n p=tempImg.getRGB(x,y);\n a =(p>>24)&0xff;\n r =(p>>16)&0xff;\n g=(p>>8)&0xff;\n b =p&0xff;\n r=(int)(r-fb);\n g=(int)(g-fb);\n b=(int)(b-fb);\n if(r<0)\n r=0;\n if(g<0)\n g=0;\n if(b<0)\n b=0;\n p=(a<<24)|(r<<16)|(g<<8)|b;\n tempImg.setRGB(x,y,p);\n \n // ProgressBar.set\n // ProgressBar.setCursor(cursor);\n }\n }\n Display(tempImg);\n progressLog.append(\"Brightness Decreased \\n\");\n \n }\n \n else\n progressLog.append(\"Load Image First!!! \\n\");\n \n }", "public static Bitmap InvertColor(Bitmap src) {\n Bitmap bmOut = Bitmap.createBitmap(src.getWidth(), src.getHeight(), src.getConfig());\n // color info\n int A, R, G, B;\n int pixelColor;\n // image size\n int height = src.getHeight();\n int width = src.getWidth();\n\n // scan through every pixel\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n // get one pixel\n pixelColor = src.getPixel(x, y);\n // saving alpha channel\n A = Color.alpha(pixelColor);\n // inverting byte for each R/G/B channel\n R = 255 - Color.red(pixelColor);\n G = 255 - Color.green(pixelColor);\n B = 255 - Color.blue(pixelColor);\n // set newly-inverted pixel to output image\n bmOut.setPixel(x, y, Color.argb(A, R, G, B));\n }\n }\n\n // return final bitmap\n return bmOut;\n\n }", "void greyscale();", "void greyscale();", "public void toBlue(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 \r\n for(int j=startY;j<endY;j++){\r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = 0*pixels[0];\r\n ww[1] = 0*pixels[1];\r\n ww[2] = 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 }", "private void updateImage() {\r\n \tfor(int i=0;i<rows;i++){\r\n for(int j=0;j<cols;j++){\r\n if(complexArray[i][j].escapeTime(RADIUS, maxIterations)!=-1){//the complex escaped\r\n mandelbrotColor[i][j]=new RGBColor(palette[complexArray[i][j].escapeTime(RADIUS, maxIterations)]);\r\n }\r\n else{\r\n mandelbrotColor[i][j]=palette[complexArray[i][j].escapeTime(RADIUS, maxIterations)+1];//the complex didnt escaped\r\n }\r\n }\r\n }\r\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 void negative (BufferedImage bi)\n {\n imageList.add(deepCopy(bi)); // add the image to the undo list\n int xSize = bi.getWidth();\n int ySize = bi.getHeight();\n\n for (int x = 0; x < xSize; x++)\n {\n for (int y = 0; y < ySize; y++)\n {\n // Calls method in BufferedImage that returns R G B and alpha values\n // encoded together in an integer\n int rgb = bi.getRGB(x, y);\n\n // Call the unpackPixel method to retrieve the four integers for\n // R, G, B and alpha and assign them each to their own integer\n int[] rgbValues = unpackPixel (rgb);\n int alpha = rgbValues[0];\n int red = rgbValues[1];\n int green = rgbValues[2];\n int blue = rgbValues[3];\n\n // make light areas dark, and dark areas light\n blue = 255-blue;\n red = 255-red;\n green = 255-green;\n\n int newColour = packagePixel (red, green, blue, alpha);\n bi.setRGB (x, y, newColour);\n }\n }\n redoList.add(deepCopy(bi)); // add the image to the redo list\n }", "public RGBImage makeRGBImage()\r\n {\r\n\tint rows = getHeight();\r\n\tint cols = getWidth();\r\n \r\n\tshort[][] red = new short[rows][cols]; \r\n\tshort[][] green = new short[rows][cols]; \r\n\tshort[][] blue = new short[getHeight()][getWidth()]; \r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\tshort v1, v2, v3, h, h0, sat, intens;\r\n\tint sector;\r\n\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\r\n\t\tif (saturation[row][col] == 0)\r\n\t\t{\r\n\t\t red[row][col] = intensity[row][col];\r\n\t\t green[row][col] = intensity[row][col];\r\n\t\t blue[row][col] = intensity[row][col];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t h0 = hue[row][col];\r\n\r\n\t\t if (h0 <= (L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)h0;\r\n\t\t\tsector = 1;\r\n\t\t }\r\n\t\t else if (h0 <= 2*(L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)(h0 - (L-1)/3);\r\n\t\t\tsector = 2;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\th = (short)(h0 - 2*(L-1)/3);\r\n\t\t\tsector = 3;\r\n\t\t }\r\n\r\n\t\t H = h * 2 * Math.PI / (L-1);\r\n\r\n\t\t sat = saturation[row][col];\r\n\t\t S = (double)sat / (L-1);\r\n\r\n\t\t intens = intensity[row][col]; \r\n\t\t I = (double)intens / (L-1);\r\n\r\n\t\t v1 = (short)Math.round(intens * (1 - S));\r\n\t\t v1 = checkInterval (v1);\r\n\r\n\t\t v2 = (short)Math.round(intens * (1 + S * Math.cos(H)/\r\n\t\t\t\t\t\t Math.cos(Math.PI/3 - H) ));\r\n\t\t v2 = checkInterval (v2);\r\n \r\n\t\t v3 = (short)Math.round(3 * intens - (v1 + v2));\r\n\t\t v3 = checkInterval (v3);\r\n \r\n\t\t if (sector == 1)\r\n\t\t {\r\n\t\t\tblue[row][col] = v1;\r\n\t\t\tred[row][col] = v2;\r\n\t\t\tgreen[row][col] = v3;\r\n\t\t }\r\n\t\t else if (sector == 2)\r\n\t\t {\r\n\t\t\tred[row][col] = v1;\r\n\t\t\tgreen[row][col] = v2;\r\n\t\t\tblue[row][col] = v3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tgreen[row][col] = v1;\r\n\t\t\tblue[row][col] = v2;\r\n\t\t\tred[row][col] = v3;\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t}\r\n \r\n\treturn new RGBImage (red, green, blue);\r\n }", "public Color4 getEffectColorMul();", "public static void main(String[]args){\n Scanner reader = new Scanner(System.in);\n System.out.print(\"Enter an image file name: \");\n String fileName = reader.nextLine();\n APImage theOriginal = new APImage(fileName);\n theOriginal.draw();\n\n // Create a copy of the image to blur\n APImage newImage = theOriginal.clone();\n\n // Visit all pixels except for those on the perimeter\n for (int y = 1; y < theOriginal.getHeight() - 1; y++)\n for (int x = 1; x < theOriginal.getWidth() - 1; x++){\n\n // Obtain info from the old pixel and its neighbors\n Pixel old = theOriginal.getPixel(x, y);\n Pixel left = theOriginal.getPixel(x - 1, y);\n Pixel right = theOriginal.getPixel(x + 1, y);\n Pixel top = theOriginal.getPixel(x, y - 1);\n Pixel bottom = theOriginal.getPixel(x, y + 1);\n int redAve = (old.getRed() + left.getRed() + right.getRed() + \n top.getRed() + bottom.getRed()) / 5;\n int greenAve = (old.getGreen() + left.getGreen() + right.getGreen() + \n top.getGreen() + bottom.getGreen()) / 5;\n int blueAve = (old.getBlue() + left.getBlue() + right.getBlue() + \n top.getBlue() + bottom.getBlue()) / 5;\n\n // Reset new pixel to that info\n Pixel newPixel = newImage.getPixel(x, y);\n newPixel.setRed(redAve);\n newPixel.setGreen(greenAve);\n newPixel.setBlue(blueAve);\n }\n System.out.print(\"Press return to continue:\");\n reader.nextLine();\n newImage.draw();\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 resetAlphaValues();", "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 static Image Transform1ColorToTransparency2ToColors(\n\t\t\tfinal BufferedImage image, final Color c1, final Color c2, \n\t\t\tfinal Color c3, final Color c4, final int otherColor1,\n\t\t\tfinal Color c5, final Color c6, final int otherColor2){\n\t\tfinal int r1 = c1.getRed();\n\t\tfinal int g1 = c1.getGreen();\n\t\tfinal int b1 = c1.getBlue();\n\t\tfinal int r2 = c2.getRed();\n\t\tfinal int g2 = c2.getGreen();\n\t\tfinal int b2 = c2.getBlue();\n\t\tfinal int r3 = c3.getRed();\n\t\tfinal int g3 = c3.getGreen();\n\t\tfinal int b3 = c3.getBlue();\n\t\tfinal int r4 = c4.getRed();\n\t\tfinal int g4 = c4.getGreen();\n\t\tfinal int b4 = c4.getBlue();\n\t\tfinal int r5 = c5.getRed();\n\t\tfinal int g5 = c5.getGreen();\n\t\tfinal int b5 = c5.getBlue();\n\t\tfinal int r6 = c6.getRed();\n\t\tfinal int g6 = c6.getGreen();\n\t\tfinal int b6 = c6.getBlue();\n\n\t\tfinal ImageFilter filter = new RGBImageFilter(){\n\t\t\tpublic final int filterRGB(int x, int y, int rgb)\n\t\t\t{\n\t\t\t\tint r = (rgb & 0xFF0000) >> 16;\n\t\tint g = (rgb & 0xFF00) >> 8;\n\t\tint b = rgb & 0xFF;\n\t\tif (r >= r1 && r <= r2 &&\n\t\t\t\tg >= g1 && g <= g2 &&\n\t\t\t\tb >= b1 && b <= b2){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn rgb & 0xFFFFFF;\n\t\t}\n\t\tif (r >= r3 && r <= r4 &&\n\t\t\t\tg >= g3 && g <= g4 &&\n\t\t\t\tb >= b3 && b <= b4){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn otherColor1;\n\t\t}\n\t\tif (r >= r5 && r <= r6 &&\n\t\t\t\tg >= g5 && g <= g6 &&\n\t\t\t\tb >= b5 && b <= b6){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn otherColor2;\n\t\t}\n\t\treturn rgb;\n\t\t\t}\n\t\t};\n\n\t\tImageProducer ip = new FilteredImageSource(image.getSource(), filter);\n\t\treturn Toolkit.getDefaultToolkit().createImage(ip);\n\t}", "RGB getOldColor();", "public void normalizeImages(){\n\n biegeAlien.setImageResource(R.drawable.alienbeige);\n greenAlien.setImageResource(R.drawable.aliengreen);\n pinkAlien.setImageResource(R.drawable.alienpink);\n blueAlien.setImageResource(R.drawable.alienblue);\n yellowAlien.setImageResource(R.drawable.alienyellow);\n yellowAlien.setBackgroundColor(view.getSolidColor());\n blueAlien.setBackgroundColor(view.getSolidColor());\n greenAlien.setBackgroundColor(view.getSolidColor());\n pinkAlien.setBackgroundColor(view.getSolidColor());\n biegeAlien.setBackgroundColor(view.getSolidColor());\n }", "public void fade2black() {\n int var3 = this.field_723 * this.field_724;\n int var2 = 0;\n if(field_759 || var2 < var3) {\n do {\n int var1 = this.pixels[var2] & 16777215;\n this.pixels[var2] = (var1 >>> 1 & 8355711) + (var1 >>> 2 & 4144959) + (var1 >>> 3 & 2039583) + (var1 >>> 4 & 986895);\n ++var2;\n } while(var2 < var3);\n\n }\n }", "public static BufferedImage negative(BufferedImage image) {\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 new negative R,B,G values \n int[] negat = new int[3];\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(); x++){\n for (int y = 0; y < image.getHeight(); y++) {\n colors = getPixelColor(image,x,y);\n for (int i = 0; i < 3; i++) {\n //Negative filter means doing 1 - original pixel\n if(colors[i] == 0){\n negat[i] = -1;\n }else{\n negat[i] = 1-colors[i];\n }\n }\n bitmap.setPixel(x,y,negat);\n }\n }\n //Create the negative image and return it\n BufferedImage subImage = new BufferedImage(image.getColorModel(),tesela,image.isAlphaPremultiplied(),null);\n return subImage;\n }", "void dither();", "void dither();", "void invertAllBits();", "public void recolor(double nr, double ng, double nb){\n ir = (float)nr;\n ig = (float)ng;\n ib = (float)nb;\n }", "private void colorCalibration()\n {\n\n if(ntRedColorCalibration.getBoolean(false))\n {\n if(colorCalibrationEnabled)\n {\n /* NON-OPERATIONAL SENSOR\n kRedTargetRedValue = detectedColor.red;\n kRedTargetGreenValue = detectedColor.green;\n kRedTargetBlueValue = detectedColor.blue;\n */\n ntRedRValue.forceSetDouble(kRedTargetRedValue);\n ntRedGValue.forceSetDouble(kRedTargetGreenValue);\n ntRedBValue.forceSetDouble(kRedTargetBlueValue);\n kRedTarget = new Color(new Color8Bit((int) (kRedTargetRedValue * 255), \n (int) (kRedTargetGreenValue * 255), (int) (kRedTargetBlueValue * 255)));\n\n updateColorMatcher();\n }\n colorCalibrationEnabled = false;\n ntRedColorCalibration.setBoolean(false);\n }\n \n if(ntGreenColorCalibration.getBoolean(false))\n {\n if(colorCalibrationEnabled)\n {\n /* NON-OPERATIONAL SENSOR\n kGreenTargetRedValue = detectedColor.red;\n kGreenTargetGreenValue = detectedColor.green;\n kGreenTargetBlueValue = detectedColor.blue; \n */\n ntGreenRValue.forceSetDouble(kGreenTargetRedValue);\n ntGreenGValue.forceSetDouble(kGreenTargetGreenValue);\n ntGreenBValue.forceSetDouble(kGreenTargetBlueValue);\n kGreenTarget = new Color(new Color8Bit((int) (kGreenTargetRedValue * 255), \n (int) (kGreenTargetGreenValue * 255), (int) (kGreenTargetBlueValue * 255)));\n\n updateColorMatcher();\n }\n colorCalibrationEnabled = false;\n ntGreenColorCalibration.setBoolean(false);\n }\n\n if(ntBlueColorCalibration.getBoolean(false))\n {\n if(colorCalibrationEnabled)\n {\n /* NON-OPERATIONAL SENSOR\n kBlueTargetRedValue = detectedColor.red;\n kBlueTargetGreenValue = detectedColor.green;\n kBlueTargetBlueValue = detectedColor.blue;\n */\n ntBlueRValue.forceSetDouble(kBlueTargetRedValue);\n ntBlueGValue.forceSetDouble(kBlueTargetGreenValue);\n ntBlueBValue.forceSetDouble(kBlueTargetBlueValue);\n kBlueTarget = new Color(new Color8Bit((int) (kBlueTargetRedValue * 255), \n (int) (kBlueTargetGreenValue * 255), (int) (kBlueTargetBlueValue * 255)));\n\n updateColorMatcher();\n }\n colorCalibrationEnabled = false;\n ntBlueColorCalibration.setBoolean(false);\n }\n\n if(ntYellowColorCalibration.getBoolean(false))\n {\n if(colorCalibrationEnabled)\n {\n /* NON-OPERATIONAL SENSOR\n kYellowTargetRedValue = detectedColor.red;\n kYellowTargetGreenValue = detectedColor.green;\n kYellowTargetBlueValue = detectedColor.blue;\n */\n ntYellowRValue.forceSetDouble(kYellowTargetRedValue);\n ntYellowGValue.forceSetDouble(kYellowTargetGreenValue);\n ntYellowBValue.forceSetDouble(kYellowTargetBlueValue);\n kYellowTarget = new Color(new Color8Bit((int) (kYellowTargetRedValue * 255), \n (int) (kYellowTargetGreenValue * 255), (int) (kYellowTargetBlueValue * 255)));\n\n updateColorMatcher();\n }\n colorCalibrationEnabled = false;\n ntYellowColorCalibration.setBoolean(false);\n }\n ntColorCalibrationEnabled.setBoolean(colorCalibrationEnabled);\n }", "public void toRed(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] = pixels[0];\r\n ww[1] = 0*pixels[1];\r\n ww[2] = 0*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 BufferedImage NOT(BufferedImage timg) {\n int width = timg.getWidth();\n int height = timg.getHeight();\n\n int[][][] ImageArray1 = convertToArray(timg);\n int[][][] ImageArray2 = convertToArray(timg);\n\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n\n int r = ImageArray1[x][y][1]; //r\n int g = ImageArray1[x][y][2]; //g\n int b = ImageArray1[x][y][3]; //b\n\n ImageArray2[x][y][1] = (~r) & 0xFF; //r\n ImageArray2[x][y][2] = (~g) & 0xFF; //g\n ImageArray2[x][y][3] = (~b) & 0xFF; //b\n\n }\n }\n return convertToBimage(ImageArray2);\n\n }", "public void hreflect() {\n int rows= currentIm.getRows();\n int cols= currentIm.getCols();\n int h= 0;\n int k= rows-1;\n //invariant: rows 0..h-1 and k+1.. have been inverted\n while (h < k) {\n // Swap row h with row k\n // invariant: pixels 0..c-1 of rows h and k have been swapped\n for (int c= 0; c != cols; c= c+1) {\n currentIm.swapPixels(h, c, k, c);\n }\n \n h= h+1; k= k-1;\n }\n }", "public int transformPixel(int p0, int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8) {\n\n// int red = constrain(Color.red(inPixel) + ADJUSTMENT);\n// int green = constrain(Color.green(inPixel) + ADJUSTMENT);\n// int blue = constrain(Color.blue(inPixel) + ADJUSTMENT);\n// int outPixel = Color.argb(Color.alpha(inPixel), red, green, blue);\n int west[] = {1, 1, -1, 1, -2, -1, 1, 1, -1};\n int current[] = {p0, p1, p2, p3, p4, p5, p6, p7, p8};\n int outPixelR = 0, outPixelG = 0, outPixelB = 0;\n\n int[] currentR = new int[west.length];\n int[] currentG = new int[west.length];\n int[] currentB = new int[west.length];\n\n\n //separate RGB\n for (int i = 0; i < west.length; i++) {\n currentR[i] = constrain(Color.red(current[i]));\n currentG[i] = constrain(Color.green(current[i]));\n currentB[i] = constrain(Color.blue(current[i]));\n }\n\n //sum\n for (int i = 0; i < west.length; i++) {\n\n outPixelR += currentR[i] * west[i];\n outPixelG += currentG[i] * west[i];\n outPixelB += currentB[i] * west[i];\n\n }\n\n //divide for average\n outPixelG /= 9;\n outPixelR /= 9;\n outPixelB /= 9;\n\n\n\n\n int outPixel = Color.argb(Color.alpha(p4), outPixelR, outPixelG, outPixelB);\n\n\n return outPixel;\n }", "public static void main(String[] args)\n {\n \n //opens selfie picture \n /**/ \n //relative path\n //og pics\n Picture apic = new Picture(\"images/selfie.jpg\");\n Picture obama = new Picture(\"images/obama.jpg\");\n apic.explore();\n obama.explore();\n\n //change with selfie picture\n Picture me = new Picture(\"images/selfie.jpg\"); \n Picture me1 = new Picture(\"images/selfie.jpg\");\n Picture me2 = new Picture(\"images/selfie.jpg\");\n \n //initializes array pix\n Pixel[] pix;\n \n /**\n * method 1 change\n * divides colors into 4 equal groups\n */\n //initializes vars for rgb values\n int red;\n int blue;\n int green;\n pix = me.getPixels(); \n \n for (Pixel spot: pix) {\n //gets rgb values of colors\n red = spot.getRed();\n blue = spot.getBlue();\n green = spot.getGreen();\n \n //if pixel under a certain value then the color is changed\n if (red < 63 && blue < 63 && green < 63) {\n spot.setColor(new Color(2, 32, 62));\n }\n else if (red < 127 && blue < 127 && green < 127) {\n spot.setColor(new Color(198, 37, 8));\n }\n else if (red < 191 && blue < 191 && green < 191) {\n spot.setColor(new Color(102, 157, 160));\n }\n else {\n spot.setColor(new Color(250, 238, 192));\n }\n }\n me.explore();\n me.write(\"images/selfie1.jpg\");\n\n /**\n * method 2 change\n * changes color based on intensity using max and min grayscale values\n */\n pix = me1.getPixels(); \n int s = 0; //smallest pix value\n int b = 255; //largest pix value\n int ave;\n int quads; //size of four equal range of colors\n \n for (Pixel spot: pix) {\n red = spot.getRed();\n blue = spot.getBlue();\n green = spot.getGreen();\n \n ave = (red + blue + green)/3;\n if (ave > b) { //gets maximum grayscale\n b = ave;\n }\n if (ave < s) { //gets min grayscale\n s = ave;\n }\n quads = (b-s)/4; //divides range of pix values into 4\n \n //sees if pixel value is less than the factor of quad\n if (red < quads && blue < quads && green < quads) {\n spot.setColor(new Color(2, 32, 62));\n }\n else if (red < quads*2 && blue < quads*2 && green < quads*2 ) {\n spot.setColor(new Color(198, 37, 8));\n }\n else if (red < quads*3 && blue < quads*3 && green < quads*3) {\n spot.setColor(new Color(102, 157, 160));\n }\n else {\n spot.setColor(new Color(250, 238, 192));\n }\n }\n me1.explore();\n me1.write(\"images/selfie2.jpg\");\n \n /**\n * custom color palette\n */\n pix = me2.getPixels();\n \n for (Pixel spot: pix) {\n red = spot.getRed();\n blue = spot.getBlue();\n green = spot.getGreen();\n \n //sets color to new value if under a certain value\n if (red < 63 && blue < 63 && green < 63) {\n spot.setColor(new Color(77, 105, 170));\n }\n else if (red < 127 && blue < 127 && green < 127) {\n spot.setColor(new Color(71, 183, 116));\n }\n else if (red < 191 && blue < 191 && green < 191) {\n spot.setColor(new Color(254, 129, 99));\n }\n else {\n spot.setColor(new Color(254, 202, 99));\n }\n }\n me2.explore();\n me2.write(\"images/selfie3.jpg\");\n \n }", "public void revertColor()\r\n\t{\r\n\t\tif (savedColor != null)\r\n\t\t{\r\n\t\t\tg.setColor(savedColor);\r\n\t\t}\r\n\t}", "public Pic noRed() {\n Pic output = image.deepCopy();\n Pixel[][] outputPixels = output.getPixels();\n for (int row = 0; row < output.getHeight(); row++) {\n for (int col = 0; col < output.getWidth(); col++) {\n Pixel current = outputPixels[row][col];\n current.setRed(0);\n }\n }\n return output;\n }", "private static BufferedImage transformImage(BufferedImage image) {\n // Scale image to desired dimension (28 x 28)\n Image tmp = image.getScaledInstance(28, 28, Image.SCALE_SMOOTH);\n BufferedImage scaledImage = new BufferedImage(28, 28, BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = scaledImage.createGraphics();\n g2d.drawImage(tmp, 0, 0, null);\n\n // Loop through each pixel of the new image\n for (int x = 0; x < 28; x++) {\n for (int y = 0; y < 28; y++) {\n // Get original color\n Color color = new Color(scaledImage.getRGB(x, y));\n\n // Ignore white values\n if (color.getRGB() == -1) {\n continue;\n }\n\n // 'Boost' the grey values so they become more black\n float[] hsv = new float[3];\n Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), hsv);\n hsv[2] = (float) 0.5 * hsv[2];\n int newColor = Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]);\n\n // Save new color\n scaledImage.setRGB(x, y, newColor);\n }\n }\n\n // Free resources\n g2d.dispose();\n\n return scaledImage;\n }", "public @NotNull Image flipH()\n {\n if (this.data != null)\n {\n if (this.mipmaps > 1) Image.LOGGER.warning(\"Image manipulation only applied to base mipmap level\");\n \n if (this.format != ColorFormat.RGBA)\n {\n Color.Buffer output = Color.malloc(this.format, this.width * this.height);\n \n long srcPtr = this.data.address();\n long dstPtr = output.address();\n \n long bytesPerLine = Integer.toUnsignedLong(this.width) * this.format.sizeof;\n for (int y = 0; y < this.height; y++)\n {\n for (int x = 0; x < this.width; x++)\n {\n // OPTION 1: Move pixels with memCopy()\n long src = Integer.toUnsignedLong(y * this.width + this.width - 1 - x) * this.format.sizeof;\n long dst = Integer.toUnsignedLong(y * this.width + x) * this.format.sizeof;\n \n MemoryUtil.memCopy(srcPtr + src, dstPtr + dst, bytesPerLine);\n \n // OPTION 2: Just copy data pixel by pixel\n // output.put(y * this.width + x, this.data.getBytes(y * this.width + (this.width - 1 - x)));\n }\n }\n \n this.data.free();\n \n this.data = output;\n }\n else\n {\n // OPTION 3: Faster implementation (specific for 32bit pixels)\n // NOTE: It does not require additional allocations\n IntBuffer ptr = this.data.toBuffer().asIntBuffer();\n for (int y = 0; y < this.height; y++)\n {\n for (int x = 0; x < this.width / 2; x++)\n {\n int backup = ptr.get(y * this.width + x);\n ptr.put(y * this.width + x, ptr.get(y * this.width + this.width - 1 - x));\n ptr.put(y * this.width + this.width - 1 - x, backup);\n }\n }\n }\n this.mipmaps = 1;\n }\n \n return this;\n }", "@Test\r\n public void testTrivialReplacement(){\r\n List<Tone> palette = Arrays.asList(new Tone(new Color(200,10,10)),\r\n new Tone(new Color(10,200,10)),\r\n new Tone(new Color(10,10,200)));\r\n\r\n BufferedImage image = ImageFileUtils.loadImageResource(\"/sampleImages/geometric/redBlueQuarter.png\");\r\n\r\n PaletteReplacer replacer = new PaletteReplacer();\r\n\r\n BufferedImage result = replacer.replace(image, palette);\r\n\r\n PaletteDistribution analysis = new Palettester().analyseAllColors(result);\r\n\r\n assertEquals(2, analysis.byCount().size());\r\n assertEquals(palette.get(0), analysis.byCount().get(0).getTone());\r\n assertEquals(palette.get(2), analysis.byCount().get(1).getTone());\r\n }", "private Bitmap processBitmap(Bitmap bitmap) {\n Bitmap pic = bitmap.copy(Bitmap.Config.ARGB_8888, true);\n\n // Get dimensions to base the following work off of.\n int picHeight = pic.getHeight();\n int picWidth = pic.getWidth();\n\n // In this block we're go to change every pixel to the closest 3-bit value. Then we're\n // going to \"dither\", or randomize, the adjacent, further pixels as to make the image\n // look more cleaner... for a 3-bit looking image that is... Ha!\n int x, y, oldPixel, newPixel;\n int quantError, rightPixel, bottomRightPixel, bottomPixel, bottomLeftPixel;\n for(y=0; y<picHeight; y++) {\n for(x=0; x<picWidth; x++) {\n oldPixel = pic.getPixel(x, y);\n newPixel = colorPicker(oldPixel);\n pic.setPixel(x, y, newPixel);\n\n quantError = computeQuantizationError(oldPixel, newPixel);\n\n if(x+1 < picWidth) { // Right pixel\n rightPixel = pic.getPixel(x+1, y);\n pic.setPixel(x+1, y, ditherPixel(rightPixel, quantError, 7.0/16.0));\n\n if (y+1 < picHeight) { // Right bottom pixel\n bottomRightPixel = pic.getPixel(x+1, y+1);\n pic.setPixel(x + 1, y+1, ditherPixel(bottomRightPixel, quantError, 1.0/16.0));\n }\n }\n if(y+1 < picHeight) { // Bottom pixel\n bottomPixel = pic.getPixel(x, y+1);\n pic.setPixel(x, y+1, ditherPixel(bottomPixel, quantError, 5.0/16.0));\n\n if (x-1 >= 0) { // Left bottom pixel\n bottomLeftPixel = pic.getPixel(x-1, y+1);\n pic.setPixel(x-1, y+1, ditherPixel(bottomLeftPixel, quantError, 3.0/16.0));\n }\n }\n }\n }\n\n return pic;\n }", "public static Bitmap VintageEffect(Bitmap original)\n {\n Bitmap finalImage=Bitmap.createBitmap(original.getWidth(),original.getHeight(),original.getConfig());\n\n int A,R,G,B;\n int pixelColor;\n int height=original.getHeight();\n int width=original.getWidth();\n for(int y=0;y<height;y++)\n {\n for(int x=0;x<width;x++)\n {\n pixelColor=original.getPixel(x,y);\n A= Color.alpha(pixelColor);\n R= 255-Color.red(pixelColor);\n G= 255-Color.green(pixelColor);\n B= 255-Color.blue(pixelColor);\n finalImage.setPixel(x,y,Color.argb(A,R,G,B));\n\n }\n }\n\n return finalImage;\n }", "@Test\r\n public void testComplex(){\r\n List<Tone> palette = StandardPalettes.PWG_STANDARD;\r\n\r\n BufferedImage image = ImageFileUtils.loadImageResource(\"/sampleImages/complex/rooves.jpg\");\r\n\r\n PaletteReplacer replacer = new PaletteReplacer();\r\n\r\n BufferedImage result = replacer.replace(image, palette);\r\n\r\n BufferedImage target = ImageFileUtils.loadImageResource(\"/resultImages/paletteReplacer/pwgRooves.png\");\r\n\r\n assertPixelsMatch(target, result);\r\n }", "public BufferedImage Negative_Linear(BufferedImage timg) {\n int width = timg.getWidth();\n int height = timg.getHeight();\n\n int[][][] ImageArray = convertToArray(timg); // Convert the image to array\n\n // Image Negative Operation:\n\n\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n ImageArray[x][y][1] = 255 - ImageArray[x][y][1]; //r\n ImageArray[x][y][2] = 255 - ImageArray[x][y][2]; //g\n ImageArray[x][y][3] = 255 - ImageArray[x][y][3]; //b\n }\n }\n\n return convertToBimage(ImageArray); // Convert the array to BufferedImage\n }", "public void invScale(Color rhs) {\n\n\t\tthis.r /= rhs.r;\n\t\tthis.g /= rhs.g;\n\t\tthis.b /= rhs.b;\n\t}", "void deriveImage()\n\t{\n\n\t\t//img = new BufferedImage(dimx, dimy, BufferedImage.TYPE_INT_ARGB);\n\t\timg = null;\n\t\ttry{\n\t\t\timg = ImageIO.read(new File(\"src/input/World.png\"));\n\n\t\t}catch (IOException e){\n\t\t\tSystem.out.println(\"world image file error\");\n\t\t}\n\t\t//System.out.println(img.getHeight());\n\t\t//System.out.println(img.getWidth());\n//\t\tfloat maxh = -10000.0f, minh = 10000.0f;\n//\n//\t\t// determine range of tempVals s\n//\t\tfor(int x=0; x < dimx; x++)\n//\t\t\tfor(int y=0; y < dimy; y++) {\n//\t\t\t\tfloat h = tempVals [x][y];\n//\t\t\t\tif(h > maxh)\n//\t\t\t\t\tmaxh = h;\n//\t\t\t\tif(h < minh)\n//\t\t\t\t\tminh = h;\n//\t\t\t}\n\t\t\n\t\tfor(int x=0; x < dimx; x++)\n\t\t\tfor(int y=0; y < dimy; y++) {\n\t\t\t\t \t\n\t\t\t\t// find normalized tempVals value in range\n\t\t\t\t//float val = (tempVals [x][y] - minh) / (maxh - minh);\n\t\t\t\tfloat val = tempVals[x][y];\n\n\t\t\t\t//System.out.println(val);\n\n\t\t\t\tColor c = new Color(img.getRGB(x,y));\n\n\t\t\t\tif((c.getRed() > 50 && c.getGreen() > 100 && c.getBlue() < 200)) {\n\n\t\t\t\t\tif (val != 0.0f) {\n\t\t\t\t\t\tColor col = new Color(val, 0, 0);\n\t\t\t\t\t\timg.setRGB(x, y, col.getRGB());\n\t\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}", "static public int[][] flipAndInvertImage(int[][] A) {\n for(int i =0;i<A.length;i++){\n processARow(A[i]);\n }\n return A;\n }", "public @NotNull Image flipV()\n {\n if (this.data != null)\n {\n if (this.mipmaps > 1) Image.LOGGER.warning(\"Image manipulation only applied to base mipmap level\");\n \n Color.Buffer output = Color.malloc(this.format, this.width * this.height);\n \n long srcPtr = this.data.address();\n long dstPtr = output.address();\n \n long bytesPerLine = Integer.toUnsignedLong(this.width) * this.format.sizeof;\n for (int i = this.height - 1, offsetSize = 0; i >= 0; i--)\n {\n long src = srcPtr + Integer.toUnsignedLong(i * this.width) * this.format.sizeof;\n \n MemoryUtil.memCopy(src, dstPtr + offsetSize, bytesPerLine);\n offsetSize += bytesPerLine;\n }\n \n this.data.free();\n this.data = output;\n this.mipmaps = 1;\n }\n return this;\n }", "private void updateMainColors () {\n int mainColor = getCurrentMainColor();\n int index = 0;\n int[] topColors = new int[256];\n for ( int y = 0; y < 256; y++ ) {\n for ( int x = 0; x < 256; x++ ) {\n if ( y == 0 ) {\n mMainColors[index] = Color.rgb( 255 - ( 255 - Color.red( mainColor ) ) * x / 255, 255 - ( 255 - Color.green( mainColor ) ) * x / 255, 255 - ( 255 - Color.blue( mainColor ) ) * x / 255 );\n topColors[x] = mMainColors[index];\n } else\n mMainColors[index] = Color.rgb( ( 255 - y ) * Color.red( topColors[x] ) / 255, ( 255 - y ) * Color.green( topColors[x] ) / 255, ( 255 - y ) * Color.blue( topColors[x] ) / 255 );\n index++;\n }\n }\n }", "private static Image Transform1ColorToTransparency1ToColor(\n\t\t\tfinal BufferedImage image, final Color c1, final Color c2, \n\t\t\tfinal Color c3, final Color c4, final int otherColor){\n\t\tfinal int r1 = c1.getRed();\n\t\tfinal int g1 = c1.getGreen();\n\t\tfinal int b1 = c1.getBlue();\n\t\tfinal int r2 = c2.getRed();\n\t\tfinal int g2 = c2.getGreen();\n\t\tfinal int b2 = c2.getBlue();\n\t\tfinal int r3 = c3.getRed();\n\t\tfinal int g3 = c3.getGreen();\n\t\tfinal int b3 = c3.getBlue();\n\t\tfinal int r4 = c4.getRed();\n\t\tfinal int g4 = c4.getGreen();\n\t\tfinal int b4 = c4.getBlue();\n\n\t\tImageFilter filter = new RGBImageFilter(){\n\t\t\tpublic final int filterRGB(int x, int y, int rgb)\n\t\t\t{\n\t\t\t\tint r = (rgb & 0xFF0000) >> 16;\n\t\t\t\tint g = (rgb & 0xFF00) >> 8;\n\t\tint b = rgb & 0xFF;\n\t\tif (r >= r1 && r <= r2 &&\n\t\t\t\tg >= g1 && g <= g2 &&\n\t\t\t\tb >= b1 && b <= b2){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn rgb & 0xFFFFFF;\n\t\t}\n\t\tif (r >= r3 && r <= r4 &&\n\t\t\t\tg >= g3 && g <= g4 &&\n\t\t\t\tb >= b3 && b <= b4){\n\t\t\t// Set fully transparent but keep color\n\t\t\treturn otherColor;\n\t\t}\n\t\treturn rgb;\n\t\t\t}\n\t\t};\n\t\tImageProducer ip = new FilteredImageSource(image.getSource(), filter);\n\t\treturn Toolkit.getDefaultToolkit().createImage(ip);\n\t}", "public void recolor(int src, int dst) {\n\t\tfor (int k = 0; k < faceCount; k++) {\n\t\t\tif (faceColor[k] == src) {\n\t\t\t\tfaceColor[k] = dst;\n\t\t\t}\n\t\t}\n\t}", "public ImageResource makeInversion(ImageResource inputImg) {\n // creates the outputImg with same dimensions\n ImageResource outputImg = new ImageResource(inputImg.getWidth(), inputImg.getHeight());\n //for each pixel in outputImg\n for (Pixel pixel : outputImg.pixels()) {\n Pixel inputImgPixel = inputImg.getPixel(pixel.getX(), pixel.getY());\n // r= red g= green b= blue\n int r,g,b;\n r= inputImgPixel.getRed();\n g=inputImgPixel.getGreen();\n b=inputImgPixel.getBlue();\n pixel.setRed(255-r);\n pixel.setGreen(255-g);\n pixel.setBlue(255-b);\n }\n return outputImg;\n }", "public BufferedImage RescaleImage(BufferedImage timg) {\n int width = timg.getWidth();\n int height = timg.getHeight();\n\n int[][][] ImageArray = convertToArray(timg); // convert to array\n\n\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n ImageArray[x][y][1] = (int) (1.3 * ImageArray[x][y][1]); //r\n ImageArray[x][y][2] = (int) (1.3 * ImageArray[x][y][2]); //g\n ImageArray[x][y][3] = (int) (1.3 * ImageArray[x][y][3]); //b\n }\n }\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n if (ImageArray[x][y][1] < 0)\n ImageArray[x][y][1] = 0;\n if (ImageArray[x][y][2] < 0)\n ImageArray[x][y][2] = 0;\n if (ImageArray[x][y][3] < 0)\n ImageArray[x][y][3] = 0;\n if (ImageArray[x][y][1] > 255)\n ImageArray[x][y][1] = 255;\n if (ImageArray[x][y][2] > 255)\n ImageArray[x][y][2] = 255;\n if (ImageArray[x][y][3] > 255)\n ImageArray[x][y][3] = 255;\n }\n }\n return convertToBimage(ImageArray); //convert the array to BufferedImage\n }", "public void runLighten() {\n BufferedImage transformedImage = new BufferedImage(this.image.getWidth(), this.image.getHeight(), this.image.getType());\n\n try {\n for(int i = 0; i < this.image.getWidth(); i++) {\n for(int j = 0; j < this.image.getHeight(); j++) {\n transformedImage.setRGB(i, j, image.getRGB(i,j));\n }\n }\n float scaleFactor = 5.3f;\n RescaleOp op = new RescaleOp(scaleFactor, 0, null);\n transformedImage = op.filter(transformedImage, null);\n\n File outputImageFileLocation = new File(this.exportLocation);\n ImageIO.write(transformedImage, Files.getFileExtension(this.imageLocation), outputImageFileLocation);\n System.out.println(\"Success\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public native MagickImage flipImage() throws MagickException;", "@LargeTest\n public void testIntrinsicsBlend() {\n TestAction ta = new TestAction(TestName.INTRINSICS_BLEND);\n runTest(ta, TestName.INTRINSICS_BLEND.name());\n }", "@LargeTest\n public void testIntrinsicsColorMatrixGrey() {\n TestAction ta = new TestAction(TestName.INTRINSICS_COLOR_MATRIX_GREY);\n runTest(ta, TestName.INTRINSICS_COLOR_MATRIX_GREY.name());\n }", "public static void flipVertical (BufferedImage bi)\n {\n imageList.add(deepCopy(bi)); // add the image to the undo list\n int xSize = bi.getWidth();\n int ySize = bi.getHeight();\n\n // Temp image, to store pixels as we reverse everything\n BufferedImage newBi = new BufferedImage (xSize, ySize, 3); \n\n for (int i = 0; i < xSize; i++)\n {\n for (int j = 0; j< ySize; j++)\n {\n int rgb = bi.getRGB(i,j);\n newBi.setRGB(i,ySize-j-1, rgb); //flip the pixels\n }\n }\n for (int i = 0; i < xSize; i++)\n {\n for (int j = 0; j< ySize; j++)\n {\n bi.setRGB(i,j,newBi.getRGB(i,j)); // set each pixel of the original image \n }\n }\n redoList.add(deepCopy(bi)); // add the new image to the redo list\n }", "public static BufferedImage getDifferenceImage(BufferedImage img1, BufferedImage img2) {\n int width1 = img1.getWidth(); // Change - getWidth() and getHeight() for BufferedImage\n int width2 = img2.getWidth(); // take no arguments\n int height1 = img1.getHeight();\n int height2 = img2.getHeight();\n if ((width1 != width2) || (height1 != height2)) {\n System.err.println(\"Error: Images dimensions mismatch\");\n System.exit(1);\n }\n\n // NEW - Create output Buffered image of type RGB\n BufferedImage outImg = new BufferedImage(width1, height1, BufferedImage.TYPE_INT_RGB);\n\n // Modified - Changed to int as pixels are ints\n int diff;\n int result; // Stores output pixel\n for (int i = 0; i < height1; i++) {\n for (int j = 0; j < width1; j++) {\n int rgb1 = img1.getRGB(j, i);\n int rgb2 = img2.getRGB(j, i);\n int r1 = (rgb1 >> 16) & 0xff;\n int g1 = (rgb1 >> 8) & 0xff;\n int b1 = (rgb1) & 0xff;\n int r2 = (rgb2 >> 16) & 0xff;\n int g2 = (rgb2 >> 8) & 0xff;\n int b2 = (rgb2) & 0xff;\n diff = Math.abs(r1 - r2); // Change\n diff += Math.abs(g1 - g2);\n diff += Math.abs(b1 - b2);\n diff /= 3; // Change - Ensure result is between 0 - 255\n // Make the difference image gray scale\n // The RGB components are all the same\n result = (diff << 16) | (diff << 8) | diff;\n outImg.setRGB(j, i, result); // Set result\n }\n }\n\n // Now return\n return outImg;\n}", "public void UndoRedoAction()\r\n {\r\n BufferedImage[] tempImages = new BufferedImage[4];\r\n Boolean[] tempStates = new Boolean[7];\r\n \r\n tempImages[0] = bufferedImage;\r\n tempImages[1] = edited;\r\n tempImages[2] = cropedPart;\r\n tempImages[3] = bufferedImage;\r\n\r\n tempStates[0] = isBlured;\r\n tempStates[1] = isReadyToSave;\r\n tempStates[2] = isChanged;\r\n tempStates[3] = isInverted;\r\n tempStates[4] = isRectangularCrop;\r\n tempStates[5] = isCircularCrop;\r\n tempStates[6] = isImageLoaded;\r\n \r\n changeAction();\r\n \r\n imageCopy[0] = tempImages[0];\r\n imageCopy[1] = tempImages[1];\r\n imageCopy[2] = tempImages[2];\r\n imageCopy[3] = tempImages[3];\r\n\r\n statesCopy[0] = tempStates[0];\r\n statesCopy[1] = tempStates[1];\r\n statesCopy[2] = tempStates[2];\r\n statesCopy[3] = tempStates[3];\r\n statesCopy[4] = tempStates[4];\r\n statesCopy[5] = tempStates[5];\r\n statesCopy[6] = tempStates[6];\r\n \r\n repaint();\r\n \r\n }", "public void doImageRendering( int frame )\n\t{\n\t\tArrayColormap cmap = new ArrayColormap();\n\t\tColor color1 = new Color((int)red1.get(frame), (int)green1.get(frame), (int)blue1.get(frame) );\n\t\tColor color2 = new Color((int)red2.get(frame), (int)green2.get(frame), (int)blue2.get(frame) );\n\t\tColor color3 = new Color((int)red3.get(frame), (int)green3.get(frame), (int)blue3.get(frame) );\n\n\t\tcmap.setColor( 0, color2.getRGB() );\n\t\tcmap.setColor( 255, color1.getRGB() );\n\t\tcmap.setColorInterpolated(middleValue.get(), 0, 255, color3.getRGB() );\n\n\t\tfor( int j = 0; j < 256; j++ )\n\t\t\trbgLook[ j ] = cmap.getColor( (float) j / 255.0f ) & alpha_mask;\n\n\t\t//--- Do color replacement.\n\t\tBufferedImage source = getFlowImage();\n\t\tint[] pix = getBank( source );\n\t\tint rbg;\n\t\tint lumaValue;\n\t\tint a;\n\t\tint r;\n\t\tint g;\n\t\tint b;\n\n\t\tfor( int i = 0; i < pix.length; i++ )\n\t\t{\n\t\t\ta = ( pix[ i ] >> alpha ) & 0xff;\n\t\t\tr = ( pix[ i ] >> red ) & 0xff;\n\t\t\tg = ( pix[ i ] >> green ) & 0xff;\n\t\t\tb = ( pix[ i ] & 0xff );\n\n\t\t\tlumaValue = (( r + g + b ) * 255 ) / MAX_RGB;\n\t\t\trbg = rbgLook[ lumaValue ];\n\n\t\t\tpix[ i ] = a << alpha | rbg;\n\t\t}\n\n\t\tsendFilteredImage( source, frame );\n\n\t}", "public int filterRGB(int x, int y, int argb) {\n color = new Color(argb);\n newBlue = multColor(color.getBlue(), blueMultiplier);\n newGreen = multColor(color.getGreen(), greenMultiplier);\n newRed = multColor(color.getRed(), redMultiplier);\n newColor = new Color(newRed, newGreen, newBlue);\n return (newColor.getRGB());\n }", "private int del_energyCal(int x1, int y1, int x2, int y2) {\n Color a = pic.get(x1, y1);\n Color b = pic.get(x2, y2);\n\n int Red = a.getRed() - b.getRed();\n int Green = a.getGreen() - b.getGreen();\n int Blue = a.getBlue() - b.getBlue();\n\n int RedGreenBlue = (Red * Red) + (Green * Green) + (Blue * Blue);\n return RedGreenBlue;\n\n }", "public static void invert(ImageProcessor output) {\r\n\t\tfor (int x = 0; x < output.getWidth(); x++) {\r\n\t\t\tfor (int y = 0; y < output.getHeight(); y++) {\r\n\t\t\t\tboolean a = output.get(x, y) > 127;\r\n\t\t\t\toutput.set(x, y, (!a) ? WHITE : BLACK);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void ConvertImage() {\n int width = source.width();\n int height = source.height();\n int bgStrel_width = (int) Math.round(width * bgStrelConst_width);\n int bgStrel_height = (int) Math.round(height * bgStrelConst_width);\n Log.i(\"Process Trace\",\"begining grayscale conversion\");\n Imgproc.cvtColor(source, convertedImage, Imgproc.COLOR_RGB2GRAY);\n Log.i(\"Process Trace\",\"done with grayscale conversion\");\n\n\n //adjust the image intensity/contrast\n Log.i(\"Process Trace\",\"begining image intensity/contrast adjustment\");\n //Imgproc.equalizeHist(convertedImage,convertedImage);\n convertedImage.convertTo(convertedImage, -1, 1.5, -100.0);\n Log.i(\"Process Trace\",\"done with image intensity/contrast adjustment\");\n\n //Removing Background\n //Creating background Strel\n Mat background = convertedImage.clone();\n Imgproc.medianBlur(background, background, 39);\n Log.i(\"Process Trace\",\"begining to create backgroundStrel\");\n Log.i(\"Process Trace\",\"backgroundStrel created\");\n Log.i(\"Process Trace\",\"Eroding convertedImage against backgroundStrel\");\n Imgproc.threshold(background,background,90,110,Imgproc.THRESH_BINARY);\n Imgproc.erode(background,background,Imgproc.getStructuringElement(Imgproc.CV_SHAPE_RECT, new Size(bgStrel_width,bgStrel_height)));\n Log.i(\"Process Trace\",\"Final Background created\");\n Log.i(\"Process Trace\",\"begining to subtract background from image\");\n Core.absdiff(convertedImage,background,convertedImage);\n Log.i(\"Process Trace\",\"Background removed\");\n\n //Imgproc.equalizeHist(convertedImage,convertedImage);// correction before applying filters\n\n/**/\n\n\n Imgproc.medianBlur(convertedImage, convertedImage, 3);\n //something\n //Log.i(\"Displaying Mat\", convertedImage.);\n //ty to blur out the fine details fo creating the bg.\n //this will make a better mask for removing the bg\n //Mat bg = new Mat();\n //Imgproc.threshold(convertedImage,bg,90,110,Imgproc.THRESH_BINARY);\n //Core.absdiff(convertedImage,bg,convertedImage);\n\n //Removing Background and Noise\n\n\n //Initial Contrast enhancement\n //Imgproc.equalizeHist(convertedImage,convertedImage);\n\n //mockProcess: assuming bg and noise are removed\n Mat octagon = Imgproc.getStructuringElement(Imgproc.CV_SHAPE_CROSS, new Size((int)(width*.008),(int)(height*.0075)));\n Imgproc.dilate(convertedImage,convertedImage,octagon);\n //Imgproc.floodFill(convertedImage,convertedImage,new Point(0,0),new Scalar(255,255,255));\n Imgproc.medianBlur(convertedImage,convertedImage,7);\n //Imgproc.equalizeHist(convertedImage,convertedImage);\n //Imgproc.floodFill(convertedImage,convertedImage,new Point(0,0),new Scalar(255,255,255))\n }", "private static RenderedImage brigthen(final RenderedImage image,final int brightness) throws PortrayalException{\n final ColorModel model = image.getColorModel();\n\n if(model instanceof IndexColorModel){\n //no contrast enhance for indexed colormap\n return image;\n }else if(model instanceof ComponentColorModel){\n\n byte[][] lut = new byte[3][256];\n byte[][] newlut = new byte[3][256];\n\n // initialize lookup table\n for ( int i = 0; i < 256; i++ ) {\n lut[0][i] = (byte) i;\n lut[1][i] = (byte) i;\n lut[2][i] = (byte) i;\n }\n\n for (int i = 0; i < 256; i++ ) {\n int red = (int)lut[0][i]&0xFF;\n int green = (int)lut[1][i]&0xFF;\n int blue = (int)lut[2][i]&0xFF;\n newlut[0][i] = clamp(red + brightness);\n newlut[1][i] = clamp(green + brightness);\n newlut[2][i] = clamp(blue + brightness);\n }\n\n return colorize(image,newlut);\n\n }else{\n throw new PortrayalException(\"Unsupported image color model, found :\" + model.getClass());\n }\n\n }", "void setColor(float r, float g, float b) {\n color c = color(r, g, b);\n for(int x = 0; x < _img.width; x++) {\n for(int y = 0; y < _img.height; y++) {\n _img.set(x, y, c);\n }\n }\n }", "public Color4 getEffectColorAdd();", "@Test\n public void testChangeGrey() {\n System.out.println(\"changeGrey\");\n ImageFilter instance = null;\n BufferedImage expResult = null;\n BufferedImage result = instance.changeGrey();\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 }", "String removeImageStyle();", "void colorize(ObservableValue<? extends Number> ov, Number old_val,\n Number new_val, Color color, BufferedImage myBufferedImage,\n ImageView myImage) {\n double coefColor = (new_val.doubleValue() / 100 + 0.5)\n / (old_val.doubleValue() / 100 + 0.5);\n this.colorizer.setChangeColor(color);\n this.colorizer.setRatio(coefColor);\n myBufferedImage = Utils.clone(this.colorizer.process(myBufferedImage));\n myImage.setImage(SwingFXUtils.toFXImage(myBufferedImage, null));\n }", "private static BufferedImage colorBird(final BufferedImage refImage,\n final Color color) {\n \n final BufferedImage image = new BufferedImage(BIRD_WIDTH,\n BIRD_HEIGHT, BufferedImage.TYPE_INT_ARGB);\n \n final Color bright = color.brighter().brighter();\n final Color dark = color.darker().darker();\n \n for (int y = 0; y < BIRD_HEIGHT; ++y){\n for (int x = 0; x < BIRD_WIDTH; ++x) {\n int argb = refImage.getRGB(x, y);\n if (argb == 0xffe0802c)\n argb = dark.getRGB();\n else if (argb == 0xfffad78c)\n argb = bright.getRGB();\n else if (argb == 0xfff8b733)\n argb = color.getRGB();\n image.setRGB(x, y, argb);\n }\n } \n return image;\n }", "private void grayscale(){\n int len= currentIm.getRows() * currentIm.getCols();\n \n for (int p= 0; p < len; p= p+1) {\n int rgb= currentIm.getPixel(p);\n int red= DM.getRed(rgb);\n int blue= DM.getBlue(rgb);\n int green= DM.getGreen(rgb);\n int alpha= DM.getAlpha(rgb);\n \n double brightness = 0.3 * red + 0.6 * green + 0.1 * blue;\n \n currentIm.setPixel(p,\n (alpha << 24) | ((int)brightness << 16) | ((int)brightness << 8) | (int)brightness);\n \n }\n }", "void draw() {\n\n // SeamInfo lowestSeam = this.lowestSeamVert();\n // lowestSeam.changeColor();\n\n ComputedPixelImage seamRemovedImg = new ComputedPixelImage(this.newImg.width,\n this.newImg.height);\n int countRow = 0;\n int countCol = 0;\n\n Pixel current = this.curPixel;\n Pixel temp;\n\n while (current.down != null) {\n temp = current.down;\n while (current.right != null) {\n Color c = Color.MAGENTA;\n if (current.highlighted) {\n c = Color.RED;\n }\n else {\n c = current.color;\n }\n if (this.showType.equals(\"e\")) {\n int energy = (int) (current.energy * 100);\n if (energy > 255) {\n System.out.println(\"energy: \" + energy + \" to 255\");\n energy = 255;\n }\n c = new Color(energy, energy, energy);\n }\n else if (this.showType.equals(\"w\")) {\n int weight = (int) (current.seam.totalWeight);\n if (weight > 255) {\n System.out.println(\"weight: \" + weight + \" to 255\");\n weight = 255;\n }\n c = new Color(weight, weight, weight);\n }\n\n seamRemovedImg.setColorAt(countCol, countRow, c);\n countCol += 1;\n current = current.right;\n }\n countCol = 0;\n countRow += 1;\n current = temp;\n }\n countCol = 0;\n\n this.newImg = seamRemovedImg;\n\n }", "List<List<Pixel>> transform(Image img, String operation);", "private void traverseBayeredPatternFullSizeRGB() {\n\n for (int x = 0; x < originalImageHeight -1; x++){\n for (int y = 1; y < originalImageWidth -1; y++){\n Point position = new Point(x,y);\n int absolutePosition = getAbsolutPixelPosition(position);\n\n PixelType pixelType = null;\n\n if (x%2 == 0 && y%2 == 0) pixelType = PixelType.GREEN_TOPRED;\n if (x%2 == 0 && y%2 == 1) pixelType = PixelType.BLUE;\n if (x%2 == 1 && y%2 == 0) pixelType = PixelType.RED;\n if (x%2 == 1 && y%2 == 1) pixelType = PixelType.GREEN_TOPBLUE;\n\n fullSizePixRGB[absolutePosition] = getFullSizeRGB(new Point(x,y),pixelType);\n }\n }\n }", "public abstract BufferedImage transform();", "public void disperse() {\t\t\n\t\tfor (int r = 0; r < rows; r++){\n\t\t\tfor (int c = 1; c < cols; c++){\n\t\t\t\tint sum = values[r+1][c-1] + values[r+1][c] + values[r+1][c+1];\n\t\t\t\tif(r < rows - fireLevel + 14){\n\t\t\t\t\tvalues[r][c] = (sum / 3) - 1;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tvalues[r][c] = (int)((sum / 3.0) - 0.0); \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (values[r][c] < 0) values[r][c] = 0;\n\t\t\t\tg2.setColor(colors[values[r][c]]);\n\t\t\t\tif(values[r][c] > 5){\n\t\t\t\t\tg2.fillRect(c*res,r*res,res,res);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "RGB getNewColor();", "private static int colorToRGB(int alpha, int red, int green, int blue) {\n \n int newPixel = 0;\n newPixel += alpha; newPixel = newPixel << 8;\n newPixel += red; newPixel = newPixel << 8;\n newPixel += green; newPixel = newPixel << 8;\n newPixel += blue;\n \n return newPixel;\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 void initColors() {\n\n int i;\n float j;\n\n int start;\n int numShades = 5;\n float shadeInc = 1 / (float) numShades;\n\n\n aColors = new Color[glb.MAXCOLORS]; /* set array size */\n\n\n /* White to Black */\n start = 0;\n for (i = start, j = 1; i < start + 6; j -= shadeInc, i++) {\n aColors[i] = new Color(j, j, j);\n }\n\n start = 6;\n /* Red to almost Magenta */\n for (i = start, j = 0; i < start + 5; j += shadeInc, i++) {\n aColors[i] = new Color((float) 1, (float) 0, j);\n }\n\n\n /* Magenta to almost Blue */\n start += 5;\n for (i = start, j = 1; i < start + 5; j -= shadeInc, i++) {\n aColors[i] = new Color(j, (float) 0, (float) 1);\n }\n\n\n /* Blue to almost Cyan */\n start += 5;\n for (i = start, j = 0; i < start + 5; j += shadeInc, i++) {\n aColors[i] = new Color((float) 0, j, (float) 1);\n }\n\n /* Cyan to almost Green */\n start += 5;\n for (i = start, j = 1; i < start + 5; j -= shadeInc, i++) {\n aColors[i] = new Color((float) 0, (float) 1, j);\n }\n\n\n\n /* Green to almost Yellow */\n start += 5;\n for (i = start, j = 0; i < start + 5; j += shadeInc, i++) {\n aColors[i] = new Color(j, (float) 1, (float) 0);\n }\n\n /* Yellow to almost Red */\n start += 5;\n for (i = start, j = 1; i < start + 5; j -= shadeInc, i++) {\n aColors[i] = new Color((float) 1, j, (float) 0);\n }\n\n }", "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}", "private void fuzPixel(int rPix, int cPix, ImageArray iCopy){\n \n /*int rgb= currentIm.getPixel(rPix,cPix);\n double red= DM.getRed(rgb);\n double blue= DM.getBlue(rgb);\n double green= DM.getGreen(rgb);\n int alpha= DM.getAlpha(rgb);*/\n \n int rgb = 0;\n double red = 0.0;\n double blue = 0.0;\n double green = 0.0;\n int alpha = 0;\n \n for(int rr = rPix-1; rr < rPix+2; rr++){\n \n for(int cc = cPix-1; cc <cPix+2; cc++){\n rgb = currentIm.getPixel(rr,cc);\n red = red + DM.getRed(rgb);\n blue = blue + DM.getBlue(rgb);\n green = green + DM.getGreen(rgb);\n alpha= alpha + DM.getAlpha(rgb);\n \n }\n \n }\n \n red = red/9;\n blue = blue/9;\n green = green/9;\n \n iCopy.setPixel(rPix, cPix,\n (alpha << 24) | ((int)red << 16) | ((int)green << 8) | \n (int)blue);\n }", "protected abstract void toSpace( float[] rgb );", "void setImage(BufferedImage valueImage, BufferedImage BackImage);", "public ColorPlus darkenRGB(int value) {\n\t\tint r = this.getRed();\n\t\tint g = this.getGreen();\n\t\tint b = this.getBlue();\n\n\t\tr = (Math.max(r - value, 0));\n\t\tg = (Math.max(g - value, 0));\n\t\tb = (Math.max(b - value, 0));\n\t\treturn new ColorPlus(r,g,b);\n\t}", "private void resetLights() {\n\n List<Integer> colors = DataHolder.getInstance().getColors();\n int iter = 0;\n for (int color: colors) {\n if (color == 2) {\n colors.set(iter, 0);\n }\n iter++;\n }\n DataHolder.getInstance().setColors(colors);\n }", "int[] getEndRGB();", "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 }", "public static Integer[][] fixRGBValues(Integer[][] input) {\n Integer[][] output = new Integer[input.length][input.length];\n for (int y = 0; y < input.length; y++) {\n for (int x = 0; x < input.length; x++) {\n int k = input[y][x];\n if (k < 0) k = -k;\n if (k > 255) k = 255;\n output[y][x] = k;\n }\n }\n return output;\n }", "public void setIntensities(float r0, float g0, float b0, float a0,\n float r1, float g1, float b1, float a1,\n float r2, float g2, float b2, float a2) {\n // Check if we need alpha or not?\n if ((a0 != 1.0f) || (a1 != 1.0f) || (a2 != 1.0f)) {\n INTERPOLATE_ALPHA = true;\n a_array[0] = (a0 * 253f + 1.0f) * 65536f;\n a_array[1] = (a1 * 253f + 1.0f) * 65536f;\n a_array[2] = (a2 * 253f + 1.0f) * 65536f;\n m_drawFlags|=R_ALPHA;\n } else {\n INTERPOLATE_ALPHA = false;\n m_drawFlags&=~R_ALPHA;\n }\n \n // Check if we need to interpolate the intensity values\n if ((r0 != r1) || (r1 != r2)) {\n INTERPOLATE_RGB = true;\n m_drawFlags |= R_GOURAUD;\n } else if ((g0 != g1) || (g1 != g2)) {\n INTERPOLATE_RGB = true;\n m_drawFlags |= R_GOURAUD;\n } else if ((b0 != b1) || (b1 != b2)) {\n INTERPOLATE_RGB = true;\n m_drawFlags |= R_GOURAUD;\n } else {\n //m_fill = parent.filli;\n m_drawFlags &=~ R_GOURAUD;\n }\n \n // push values to arrays.. some extra scaling is added\n // to prevent possible color \"overflood\" due to rounding errors\n r_array[0] = (r0 * 253f + 1.0f) * 65536f;\n r_array[1] = (r1 * 253f + 1.0f) * 65536f;\n r_array[2] = (r2 * 253f + 1.0f) * 65536f;\n \n g_array[0] = (g0 * 253f + 1.0f) * 65536f;\n g_array[1] = (g1 * 253f + 1.0f) * 65536f;\n g_array[2] = (g2 * 253f + 1.0f) * 65536f;\n \n b_array[0] = (b0 * 253f + 1.0f) * 65536f;\n b_array[1] = (b1 * 253f + 1.0f) * 65536f;\n b_array[2] = (b2 * 253f + 1.0f) * 65536f;\n \n // for plain triangles\n m_fill = 0xFF000000 | \n ((int)(255*r0) << 16) | ((int)(255*g0) << 8) | (int)(255*b0);\n }", "public void revertColorAndFont()\r\n\t{\r\n\t\trevertColor();\r\n\t\trevertFont();\r\n\t}", "public void fromRGBImage(RGBImage image)\r\n {\r\n\tshort[][] red = image.getRed();\r\n\tshort[][] green = image.getGreen();\r\n\tshort[][] blue = image.getBlue();\r\n\r\n\tint rows = image.getHeight();\r\n\tint cols = image.getWidth();\r\n\r\n\tthis.hue = new short[rows][cols];\r\n\tthis.saturation = new short[rows][cols];\r\n\tthis.intensity = new short[rows][cols];\r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\t@SuppressWarnings(\"unused\")\r\n\tshort sector, r, g, b, h, t;\r\n\tdouble sum, t1, t2, theta, minrgb;\r\n\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\tr = red[row][col];\r\n\t\tg = green[row][col];\r\n\t\tb = blue[row][col];\r\n\t\tsum = r + g + b;\r\n\r\n\t\tif (r == g && r == b)\r\n\t\t{\r\n\t\t // black, gray or white\r\n\t\t hue[row][col] = (short)0;\r\n\t\t saturation[row][col] = (short)0;\r\n\t\t intensity[row][col] = (short)((r + g + b)/3);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n \r\n\t\t if (g == 0 && b == 0)\r\n\t\t {\r\n\t\t\t// only red\r\n\t\t\tt = 0;\r\n\t\t }\r\n\t\t else if ((r == 0 && b == 0) || (b == 0 && g == 0))\r\n\t\t {\r\n\t\t\t// only green or blue\r\n\t\t\tt = (L-1)/3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tt1 = 0.5 * ((r-g) + (r-b));\r\n\t\t\tt2 = Math.sqrt((r-g)*(r-g) + (r-b)*(g-b));\r\n\t\t\ttheta = Math.acos (t1/t2);\r\n\t\t\tt = (short)((L-1) * theta/(2*Math.PI));\r\n\t\t }\r\n\r\n\t\t if (b <= g)\r\n\t\t\thue[row][col] = t;\r\n\t\t else\r\n\t\t\thue[row][col] = (short)((L-1) - t);\r\n\r\n\t\t minrgb = r;\r\n\t\t if (g < minrgb)\r\n\t\t\tminrgb = g;\r\n\t\t if (b < minrgb)\r\n\t\t\tminrgb = b;\r\n \r\n\t\t saturation[row][col] = (short)\r\n\t\t\t((L-1)*(1 - minrgb*3.0/sum));\r\n\t\t intensity[row][col] = (short)(sum / 3.0);\r\n\t\t}\r\n\t }\r\n\t}\r\n\r\n }", "public void reverseFrame() {\r\n if (reversedImage) {\r\n reversedImage = false;\r\n } else {\r\n reversedImage = true;\r\n }\r\n }" ]
[ "0.68012184", "0.6705084", "0.66269517", "0.6582671", "0.6570677", "0.64876986", "0.6216478", "0.62123513", "0.61879694", "0.6135395", "0.6103331", "0.61003834", "0.59880954", "0.59808826", "0.5978585", "0.5978585", "0.59556645", "0.5953169", "0.59412694", "0.5934661", "0.59344256", "0.5908896", "0.58926666", "0.5844018", "0.58296585", "0.58206636", "0.5815943", "0.57865983", "0.5756517", "0.5741238", "0.5716638", "0.5704286", "0.5704286", "0.570209", "0.56888354", "0.567326", "0.56661725", "0.5648259", "0.564041", "0.5639628", "0.5635075", "0.5630104", "0.56280714", "0.56265736", "0.5614442", "0.56100947", "0.5605856", "0.5603053", "0.557325", "0.5570654", "0.55685896", "0.5567902", "0.5551698", "0.5544845", "0.55404294", "0.55285823", "0.5511063", "0.5498878", "0.549707", "0.54923844", "0.5480878", "0.5478474", "0.5467441", "0.54673713", "0.5460373", "0.5456826", "0.5456494", "0.5446537", "0.5444154", "0.5440934", "0.5438592", "0.5421857", "0.54125834", "0.541112", "0.5405764", "0.5399009", "0.5398021", "0.5389398", "0.53734297", "0.5363479", "0.53465265", "0.53388315", "0.5334101", "0.53238016", "0.53168476", "0.5315614", "0.5311162", "0.5304718", "0.52957594", "0.52950513", "0.5292406", "0.5284046", "0.52826685", "0.52750707", "0.52714354", "0.5269982", "0.52697486", "0.5266416", "0.5263911", "0.5263534", "0.5257342" ]
0.0
-1
TODO Autogenerated method stub
@Override public void reportUp(MultipartFile file) { ProjectRrepUP projectRrepUp = new ProjectRrepUP(); List<Project> lists = projectRrepUp.check(file); if (lists != null) { for (Project project : lists) { projRrep.save(project); } } }
{ "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 Map<String, Object> serch(Pageable pageble, Map<String, String> map) { if (pageble == null) { return null; } Map<String, Object> resultMap = new HashMap<String, Object>(); Page<Project> page = projRrep.serch(pageble, map); if (page != null) { List<Project> list = page.getContent(); int pageSize = page.getTotalPages(); resultMap.put("content", list); resultMap.put("rows", pageSize); return resultMap; } 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}", "@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