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 |
|---|---|---|---|---|---|---|
A helper to hide keyboard because that android design patter itself is bad for hiding keyboard | public static void hideKeyboardFrom(Context context, View view) {
if (view != null) {
InputMethodManager imm = (InputMethodManager) context.getSystemService(Activity.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void hideKeyboard(){\n\t\tInputMethodManager inputMethodManager = (InputMethodManager) getApplicationContext().getSystemService(Context.INPUT_METHOD_SERVICE);\n\t\tinputMethodManager.toggleSoftInput(InputMethodManager.HIDE_IMPLICIT_ONLY, 0);\n\t}",
"public void hideSoftKeyboard(){\n InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);\n imm.hideSoftInputFromWindow(view.getWindowToken(), 0);\n // imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_IMPLICIT_ONLY);\n }",
"private void hideKeyboard() {\n View view = this.getCurrentFocus();\n if (view != null) {\n InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);\n imm.hideSoftInputFromWindow(view.getWindowToken(), 0);\n }\n }",
"private void hideKeyboard() {\n View view = this.getCurrentFocus();\n if (view != null) {\n InputMethodManager inputManager = (InputMethodManager) this.getSystemService( Context.INPUT_METHOD_SERVICE );\n inputManager.hideSoftInputFromWindow( view.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS );\n }\n }",
"public void hideKeyboard() {\n try {\n InputMethodManager inputmanager = (InputMethodManager)this.getSystemService(Context.INPUT_METHOD_SERVICE);\n if (inputmanager != null) {\n inputmanager.hideSoftInputFromWindow(this.getCurrentFocus().getWindowToken(), 0);\n }\n } catch (Exception var2) {\n }\n }",
"private void hideKeyboard() {\n //check to make sure no view has focus\n View view = this.getCurrentFocus();\n\n if (view != null) {\n InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);\n imm.hideSoftInputFromWindow(view.getWindowToken(), 0);\n }\n }",
"private void hideKeypad() {\n EditText editTextView = (EditText) findViewById(R.id.book_search_text);\n\n InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);\n imm.hideSoftInputFromWindow(editTextView.getWindowToken(), 0);\n }",
"private void hideKeyboard() {\n View view = this.getCurrentFocus();\n if (view != null) {\n InputMethodManager inputManager = (InputMethodManager) this\n .getSystemService(Context.INPUT_METHOD_SERVICE);\n inputManager.hideSoftInputFromWindow(view.getWindowToken(),\n InputMethodManager.HIDE_NOT_ALWAYS);\n }\n }",
"public void hideKeyboard() {\n View view = this.getCurrentFocus();\n if (view != null) {\n InputMethodManager inputManager = (InputMethodManager) this.getSystemService(Context.INPUT_METHOD_SERVICE);\n inputManager.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);\n }\n }",
"private void hideKeyboard() {\n View view = getActivity().getCurrentFocus();\n if (view != null) {\n InputMethodManager inputManager = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);\n inputManager.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);\n }\n }",
"private void hideKeyboard() {\n\t View view = this.getCurrentFocus();\n\t if (view != null) {\n\t InputMethodManager inputManager = (InputMethodManager) this.getSystemService(Context.INPUT_METHOD_SERVICE);\n\t inputManager.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);\n\t }\n\t}",
"private void hideKeyboard() {\n\t View view = this.getCurrentFocus();\n\t if (view != null) {\n\t InputMethodManager inputManager = (InputMethodManager) this.getSystemService(Context.INPUT_METHOD_SERVICE);\n\t inputManager.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);\n\t }\n\t}",
"public void hideKeyboard() {\n getDriver().hideKeyboard();\n }",
"public void hideKeyboard() {\n View view = getCurrentFocus();\n if (view != null) {\n InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);\n if (imm != null) {\n imm.hideSoftInputFromWindow(view.getWindowToken(), 0);\n }\n }\n }",
"private void hideKeyboard() {\n\t\tView view = getActivity().getCurrentFocus();\n\t\tif ( view != null ) {\n\t\t\tInputMethodManager inputManager = ( InputMethodManager ) getActivity().getSystemService( Context.INPUT_METHOD_SERVICE );\n\t\t\tinputManager.hideSoftInputFromWindow( view.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS );\n\t\t}\n\t}",
"public void hideWindowSoftKeyboard() {\n getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);\n }",
"@Override\n public void hide() {\n Gdx.input.setOnscreenKeyboardVisible(false);\n super.hide();\n }",
"private void hideKeyboard() {\n\t\tInputMethodManager inputMgr = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);\n\t\tEditText editText = (EditText)findViewById(R.id.searchtext);\n\t\tinputMgr.hideSoftInputFromWindow(editText.getWindowToken(), 0);\t\t\n\t}",
"public void setInputMethodShowOff() {\n\n }",
"public void hideSoftKeyboard() {\n if(getCurrentFocus()!=null) {\n InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);\n inputMethodManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);\n }\n }",
"private void hideKeyboard(View view) {\n InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);\n imm.hideSoftInputFromWindow(view.getWindowToken(), 0);\n\n }",
"protected void hideKeyboard(View view)\n {\n InputMethodManager in = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);\n in.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);\n }",
"public void onPressHideKeyboard(EditText editText){\n editText.setOnFocusChangeListener(new View.OnFocusChangeListener() {\n /*hide keyboard\n If press any else where on screen, (need clickable=\"true\" & focusableInTouchMode=\"true\" in base layer xml)\n */\n @Override\n public void onFocusChange(View v, boolean hasFocus) { // if focus has changed\n if (!hasFocus) {\n InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(Activity.INPUT_METHOD_SERVICE);\n inputMethodManager.hideSoftInputFromWindow(v.getWindowToken(), 0);\n }\n }\n });\n\n }",
"void hideSoftKeyBoard();",
"public void hideSoftKeyboard() {\n\t if(getCurrentFocus()!=null) {\n\t InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);\n\t inputMethodManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);\n\t }\n\t}",
"public void hideSoftKeyboard() {\n if (getActivity().getCurrentFocus() != null) {\n InputMethodManager inputMethodManager = (InputMethodManager) getActivity().getSystemService(getActivity().INPUT_METHOD_SERVICE);\n inputMethodManager.hideSoftInputFromWindow(getActivity().getCurrentFocus().getWindowToken(), 0);\n }\n }",
"public void hideSoftKeyboard()\n\t{\n\t\tif (getCurrentFocus() != null)\n\t\t{\n\t\t\tInputMethodManager inputMethodManager = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);\n\t\t\tinputMethodManager.hideSoftInputFromWindow(getCurrentFocus()\n\t\t\t\t\t.getWindowToken(), 0);\n\t\t}\n\t\t// InputMethodManager imm = (InputMethodManager)\n\t\t// getSystemService(INPUT_METHOD_SERVICE);\n\t\t// imm.hideSoftInputFromWindow(editHousePrice.getWindowToken(), 0);\n\t}",
"private void hideKeyboard(View v) {\n InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);\n imm.hideSoftInputFromWindow(v.getWindowToken(), 0);\n\n }",
"public void hideSoftKeyboard() {\n\t\tif (getCurrentFocus() != null) {\n\t\t\tInputMethodManager inputMethodManager = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);\n\t\t\tinputMethodManager.hideSoftInputFromWindow(getCurrentFocus()\n\t\t\t\t\t.getWindowToken(), 0);\n\t\t}\n\t}",
"private void hideSoftKeyboard() {\n\n FragmentActivity activity = getActivity();\n\n InputMethodManager in = (InputMethodManager)activity.getSystemService(Context.INPUT_METHOD_SERVICE);\n in.hideSoftInputFromWindow(editTextEmail.getWindowToken(), 0);\n }",
"@Override\n public void onFocusChange(View v, boolean hasFocus) { // if focus has changed\n if (!hasFocus) {\n InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(Activity.INPUT_METHOD_SERVICE);\n inputMethodManager.hideSoftInputFromWindow(v.getWindowToken(), 0);\n }\n }",
"public static void hideSoftKeypad(Context context) {\n Activity activity = (Activity) context;\n if(activity != null) {\n InputMethodManager imm = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);\n if (activity.getCurrentFocus() != null) {\n imm.hideSoftInputFromWindow(activity.getCurrentFocus().getWindowToken(), 0);\n }\n }\n }",
"public static void hideKeyboard(Activity instance) \n\t{\n\t\tInputMethodManager imm = (InputMethodManager) instance.getSystemService(Activity.INPUT_METHOD_SERVICE);\n\t imm.toggleSoftInput(InputMethodManager.HIDE_IMPLICIT_ONLY, 0); // hide\n\t}",
"public static void hideKeyboard(View view) {\n InputMethodManager inputManager = (InputMethodManager) view.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);\n inputManager.hideSoftInputFromWindow(view.getWindowToken(), 0);\n }",
"public static void hideKeyboard(Context context, View myEditText) {\n hideKeyboard(context);\n try {\n InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);\n imm.hideSoftInputFromWindow(myEditText.getWindowToken(), 0);\n } catch (Exception ignored) {\n }\n }",
"public void closeKeyboard(){\n View v = getCurrentFocus();\n if(v != null){\n imm = (InputMethodManager) getSystemService(Activity.INPUT_METHOD_SERVICE);\n imm.toggleSoftInput(InputMethodManager.HIDE_IMPLICIT_ONLY, 0);\n }\n }",
"public static void hideKeyboard(Activity activity) {\n activity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);\n }",
"public void supressKeyboard() {\n\t\tgetWindow().setSoftInputMode(\n\t\t\t\tWindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);\n\t}",
"@Override\n public boolean onTouchEvent(MotionEvent event) {\n if(event.getAction() == MotionEvent.ACTION_DOWN){\n if(getCurrentFocus()!=null && getCurrentFocus().getWindowToken()!=null){\n manager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);\n }\n }\n return super.onTouchEvent(event);\n }",
"public static void HideKeyboardMain(Activity mContext, View view) {\n try {\n InputMethodManager imm = (InputMethodManager) mContext\n .getSystemService(Context.INPUT_METHOD_SERVICE);\n // R.id.search_img\n imm.hideSoftInputFromWindow(view.getWindowToken(), 0);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"@Override\r\n\tpublic boolean onTouchEvent(MotionEvent event) {\n\t\tif (event.getAction() == MotionEvent.ACTION_DOWN) {\r\n\t\t\tif (getCurrentFocus() != null\r\n\t\t\t\t\t&& getCurrentFocus().getWindowToken() != null) {\r\n\t\t\t\tmanager.hideSoftInputFromWindow(getCurrentFocus()\r\n\t\t\t\t\t\t.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn super.onTouchEvent(event);\r\n\t}",
"public static void requestHideKeyboard(Context context, View v) {\n InputMethodManager imm = ((InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE));\n imm.hideSoftInputFromWindow(v.getWindowToken(), 0);\n }",
"public static void hideKeyboard(Context context, EditText editText) {\n InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);\n if (editText != null) {\n imm.hideSoftInputFromWindow(editText.getWindowToken(), 0);\n //editText.clearFocus();\n //editText.setInputType(0);\n }\n }",
"private void schowajKlawiature() {\n View view = this.getActivity().getCurrentFocus(); //inside a fragment you should use getActivity()\n if (view != null) {\n InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(context.INPUT_METHOD_SERVICE);\n imm.hideSoftInputFromWindow(view.getWindowToken(), 0);\n }\n }",
"public void onClick(View v) {\n editText1.setInputType(InputType.TYPE_NULL);\n InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);\n mgr.hideSoftInputFromWindow(editText1.getWindowToken(),InputMethodManager.HIDE_IMPLICIT_ONLY);\n }",
"public boolean hideSoftInputBase() {\n if (tOverlaySupport != null) {\n return tOverlaySupport.hideSoftInputBase();\n }\n return false;\n }",
"private void dismisskeyboard() {\n InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);\n imm.hideSoftInputFromWindow(usernameTxt.getWindowToken(), 0);\n imm.hideSoftInputFromWindow(passwordTxt.getWindowToken(), 0);\n imm.hideSoftInputFromWindow(fullnameTxt.getWindowToken(), 0);\n }",
"public static void hideKeyboard(Activity activity)\n {\n View view = activity.getCurrentFocus();\n //If no view currently has focus, create a new one, just so we can grab a window token from it\n if(view != null)\n {\n InputMethodManager inputMethodManager = (InputMethodManager) activity.getSystemService(Activity.INPUT_METHOD_SERVICE);\n inputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), 0);\n }\n }",
"void onKeyboardVisibilityChanged(boolean isKeyboardShow);",
"public static void hideKeyboard(Activity activity) {\n View view = activity.findViewById(android.R.id.content);\n if (view != null) {\n InputMethodManager imm = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);\n imm.hideSoftInputFromWindow(view.getWindowToken(), 0);\n }\n }",
"public void onClick(View v) {\n editText2.setInputType(InputType.TYPE_NULL);\n InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);\n mgr.hideSoftInputFromWindow(editText2.getWindowToken(),InputMethodManager.HIDE_IMPLICIT_ONLY);\n }",
"private void closeKeyboard(){\n View view = this.getCurrentFocus();\n if (view != null){\n InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);\n imm.hideSoftInputFromWindow(view.getWindowToken(), 0);\n }\n }",
"private static void hideSoftKeyboard(Activity activity) {\n InputMethodManager inputMethodManager =\n (InputMethodManager) activity.getSystemService(\n Activity.INPUT_METHOD_SERVICE);\n inputMethodManager.hideSoftInputFromWindow(\n activity.getCurrentFocus().getWindowToken(), 0);\n }",
"private void hideKeyboardOnClick(View view) {\n\t\t// Set up touch listener for non-text box views to hide keyboard.\n\t\tif (!(view instanceof EditText) && !(view instanceof Button)) {\n\t\t\tview.setOnTouchListener(new OnTouchListener() {\n\t\t\t\t@Override\n\t\t\t\tpublic boolean onTouch(View v, MotionEvent event) {\n\t\t\t\t\tInputMethodManager inputMethodManager = (InputMethodManager) getSystemService(Activity.INPUT_METHOD_SERVICE);\n\t\t\t\t\tif (getCurrentFocus() != null) {\n\t\t\t\t\t\tinputMethodManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\t// If a layout container, iterate over children and seed recursion.\n\t\tif (view instanceof ViewGroup) {\n\t\t\tfor (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) {\n\t\t\t\tView innerView = ((ViewGroup) view).getChildAt(i);\n\t\t\t\thideKeyboardOnClick(innerView);\n\t\t\t}\n\t\t}\n\t}",
"@Override\n\t\t\tpublic boolean onEditorAction(TextView v, int actionId, KeyEvent event) {\n\t\t\t\tif(event!=null){\n\t\t\t\tInputMethodManager imm = (InputMethodManager)getSystemService(\n\t\t\t\t\t Context.INPUT_METHOD_SERVICE);\n\t\t\t\t\timm.hideSoftInputFromWindow(v.getWindowToken(), 0);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}",
"public void hideInputMethod(IBinder token) {\n \tif (mImMgr != null) {\n \t\tmImMgr.hideSoftInputFromWindow(token, 0);\n \t}\n }",
"public void onClick(View v) {\n editText3.setInputType(InputType.TYPE_NULL);\n InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);\n mgr.hideSoftInputFromWindow(editText3.getWindowToken(),InputMethodManager.HIDE_IMPLICIT_ONLY);\n }",
"public static void hideKeyboard(Activity activity){\n\t\tif (activity.getCurrentFocus() != null){\n\t \tInputMethodManager inputMethodManager = (InputMethodManager) activity.getSystemService(Activity.INPUT_METHOD_SERVICE);\n\t \tinputMethodManager.hideSoftInputFromWindow(activity.getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);\n\t }\n\t}",
"@Override\r\n public boolean dispatchTouchEvent(MotionEvent event) {\n\r\n if (event.getAction() == MotionEvent.ACTION_DOWN) {\r\n View v = getCurrentFocus();\r\n if (v instanceof EditText) {\r\n Rect outRect = new Rect();\r\n v.getGlobalVisibleRect(outRect);\r\n if (!outRect.contains((int) event.getRawX(), (int) event.getRawY())) {\r\n v.clearFocus();\r\n InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);\r\n imm.hideSoftInputFromWindow(v.getWindowToken(), 0);\r\n }\r\n }\r\n }\r\n return super.dispatchTouchEvent(event);\r\n }",
"public static void hideKeyboardFrom(Context context, View view) {\n if(context == null){\n throw new IllegalArgumentException(\"Context cannot be null\");\n }\n\n if(view == null){\n throw new IllegalArgumentException(\"View cannot be null\");\n }\n\n InputMethodManager imm = (InputMethodManager) context\n .getSystemService(Activity.INPUT_METHOD_SERVICE);\n imm.hideSoftInputFromWindow(view.getWindowToken(), 0);\n }",
"public static void hideKeyboardOnClickingScreen(View view, final Context context) {\n //Set up touch listener for non-text box views to hide keyboard.\n if (!(view instanceof EditText)) {\n view.setOnTouchListener(new View.OnTouchListener() {\n public boolean onTouch(View v, MotionEvent event) {\n hideKeyboard(context);\n hideKeyboard(context, v);\n return false;\n }\n });\n }\n\n //If a layout container, iterate over children and seed recursion.\n if (view instanceof ViewGroup) {\n for (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) {\n View innerView = ((ViewGroup) view).getChildAt(i);\n hideKeyboardOnClickingScreen(innerView, context);\n }\n }\n }",
"public static void hideKeyboard(Context mContext) {\n try {\n InputMethodManager inputManager = (InputMethodManager) mContext\n .getSystemService(Activity.INPUT_METHOD_SERVICE);\n inputManager.hideSoftInputFromWindow(((Activity) mContext).getCurrentFocus().getWindowToken(), 0);\n } catch (Exception ignored) {\n }\n }",
"public void showKeyboard(){\n\t\tInputMethodManager inputMethodManager = (InputMethodManager) getApplicationContext().getSystemService(Context.INPUT_METHOD_SERVICE);\n\t\tinputMethodManager.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);\n\t}",
"public static void toggleKeyboard(Context context) {\n InputMethodManager imm = ((InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE));\n imm.toggleSoftInput(0, 0);\n }",
"@Override\n\t\t\t\tpublic void onClick(View v) {\n\t \t\t\t getWindow().setSoftInputMode(\n\t \t \t WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);\n\t \t\t\tshowDialog();\n\t\t\t\t}",
"public static void hideSoftKeyboardwithEdit(View view, Context mContext) {\n if (!(view instanceof EditText)) {\n try {\n InputMethodManager inputManager = (InputMethodManager) mContext\n .getSystemService(Activity.INPUT_METHOD_SERVICE);\n inputManager.hideSoftInputFromWindow(((Activity) mContext).getCurrentFocus().getWindowToken(), 0);\n } catch (Exception ignored) {\n }\n\n }\n\n }",
"public static void hideSoftKeyboard(Activity activity) {\n\n InputMethodManager inputManager = (InputMethodManager)\n activity.getSystemService(\n Context.INPUT_METHOD_SERVICE);\n View focusedView = activity.getCurrentFocus();\n\n if (focusedView != null) {\n\n try{\n assert inputManager != null;\n inputManager.hideSoftInputFromWindow(focusedView.getWindowToken(),\n InputMethodManager.HIDE_NOT_ALWAYS);\n }catch(AssertionError e){\n e.printStackTrace();\n }\n }\n }",
"private void closeKeyboard()\n {\n View view = this.getCurrentFocus();\n if(view != null)\n {\n InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);\n imm.hideSoftInputFromWindow(view.getWindowToken(), 0);\n }\n }",
"public static void hideSoftInputMethod(Activity activity) {\n InputMethodManager inputManager = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);\n inputManager.hideSoftInputFromWindow(\n activity.getWindow().getDecorView().getWindowToken(),\n 0\n );\n try {\n View currentFocus = activity.getWindow().getCurrentFocus();\n if (currentFocus != null)\n currentFocus.clearFocus();\n } catch (Exception e) {\n // current focus could be out of visibility\n }\n }",
"public static void hideSoftKeyboard(Activity activity) {\n if (activity.getCurrentFocus() != null) {\n InputMethodManager inputMethodManager = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);\n inputMethodManager.hideSoftInputFromWindow(activity.getCurrentFocus().getWindowToken(), 0);\n }\n }",
"public static void hideKeyboard(Activity activity) {\n if(activity == null){\n throw new IllegalArgumentException(\"Activity cannot be null\");\n }\n\n InputMethodManager imm = (InputMethodManager) activity\n .getSystemService(Activity.INPUT_METHOD_SERVICE);\n //Find the currently focused view, so we can grab the correct window token from it.\n View view = activity.getCurrentFocus();\n //If no view currently has focus, create a new one, just so we can grab a window token from it\n if (view == null) {\n view = new View(activity);\n }\n imm.hideSoftInputFromWindow(view.getWindowToken(), 0);\n }",
"@Override\n public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n InputMethodManager inputMethodManager = (InputMethodManager)\n getSystemService(Context.INPUT_METHOD_SERVICE);\n inputMethodManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);\n }",
"@Override\n\t\t\tpublic boolean onTouch(View v, MotionEvent event) {\n\t\t\t\tInputMethodManager imm = (InputMethodManager) getApplicationContext()\n\t\t\t\t\t\t.getSystemService(Context.INPUT_METHOD_SERVICE);\n\t\t\t\timm.hideSoftInputFromWindow(v.getWindowToken(), 0);\n\t\t\t\treturn false;\n\t\t\t}",
"@Override\n public boolean setSoftKeyboardShowMode(int mode) {\n return false;\n }",
"public static void hideKeyBoard(Activity mActivity, View mGetView) {\n\t\ttry {\n\t\t\t((InputMethodManager) mActivity\n\t\t\t\t\t.getSystemService(Activity.INPUT_METHOD_SERVICE))\n\t\t\t\t\t.hideSoftInputFromWindow(mGetView.getRootView()\n\t\t\t\t\t\t\t.getWindowToken(), 0);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"@Override\n\tpublic boolean onTouchEvent(MotionEvent event) {\n\t\tif (event.getAction() == MotionEvent.ACTION_DOWN) {\n\t\t\tif (ChangeLoginActivity.this.getCurrentFocus() != null) {\n\t\t\t\tif (ChangeLoginActivity.this.getCurrentFocus().getWindowToken() != null) {\n\t\t\t\t\tInputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);\n\t\t\t\t\timm.hideSoftInputFromWindow(ChangeLoginActivity.this\n\t\t\t\t\t\t\t.getCurrentFocus().getWindowToken(),\n\t\t\t\t\t\t\tInputMethodManager.HIDE_NOT_ALWAYS);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn super.onTouchEvent(event);\n\t}",
"@Override\n public boolean dispatchTouchEvent(MotionEvent event) {\n if (event.getAction() == MotionEvent.ACTION_UP) {\n View v = getCurrentFocus();\n if (v instanceof EditText) {\n Rect outRect = new Rect();\n v.getGlobalVisibleRect(outRect);\n if (!outRect.contains((int)event.getRawX(), (int)event.getRawY())) {\n v.clearFocus();\n InputMethodManager imm =\n (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);\n imm.hideSoftInputFromWindow(v.getWindowToken(), 0);\n }\n }\n }\n return super.dispatchTouchEvent(event);\n }",
"public static void disableSoftInputFromAppearing(EditText editText) {\n if (Build.VERSION.SDK_INT >= 11) {\n editText.setRawInputType(InputType.TYPE_CLASS_TEXT);\n editText.setTextIsSelectable(true);\n } else {\n editText.setRawInputType(InputType.TYPE_NULL);\n editText.setFocusable(true);\n }\n }",
"@Override\n\tprotected void onResume()\n\t{\n\t\tsuper.onResume();\n\t\t// hideSoftKeyboard();\n\t}",
"public static void hideKeyboard(AndroidDriver driver) {\n\t\ttry {\n\t\t\tdriver.hideKeyboard();\n\t\t\tThread.sleep(2000);\n\t\t} catch (Throwable e) {\n\n\t\t}\n\t}",
"public static void hideKeyboard(AndroidDriver driver) {\n\t\ttry {\n\t\t\tdriver.hideKeyboard();\n\t\t\tThread.sleep(2000);\n\t\t} catch (Throwable e) {\n\n\t\t}\n\t}",
"public void setInputMethodShowOn() {\n\n }",
"@Override\n public void onDrawerClosed(View drawerView) {\n super.onDrawerClosed(drawerView);\n InputMethodManager inputMethodManager = (InputMethodManager)\n getSystemService(Context.INPUT_METHOD_SERVICE);\n inputMethodManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);\n }",
"@Override\n public void onDrawerClosed(View drawerView) {\n super.onDrawerClosed(drawerView);\n InputMethodManager inputMethodManager = (InputMethodManager)\n getSystemService(Context.INPUT_METHOD_SERVICE);\n inputMethodManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);\n }",
"public static void hideKeyboard(Context mContext, View v) {\n InputMethodManager imm = (InputMethodManager) mContext\n .getSystemService(Context.INPUT_METHOD_SERVICE);\n imm.hideSoftInputFromWindow(v.getWindowToken(),\n InputMethodManager.HIDE_NOT_ALWAYS);\n }",
"@Override\n public void onKeyboardChange(boolean isShow, int keyboardHeight) {\n if (!isShow) {\n // dismiss();\n }\n }",
"public static void hideKeyboard(Fragment fragment) {\n fragment.getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);\n }",
"public void m16206h() {\n this.f13199d.setVisibility(0);\n this.f13199d.setFocusableInTouchMode(true);\n this.f13199d.requestFocus();\n this.f13199d.setOnKeyListener(this.f13198c);\n this.f13125b.f13131e = true;\n }",
"public void setupKeyboardHide(final View view) {\n\t\tif(!(view instanceof EditText)) {\n\n\t\t\tview.setOnTouchListener(new View.OnTouchListener() {\n\n\t\t\t\tpublic boolean onTouch(View v, MotionEvent event) {\n\t\t\t\t\thideSoftKeyboard(MainActivity.this);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t});\n\t\t}\n\n\t\t//If a layout container, iterate over children and seed recursion.\n\t\tif (view instanceof ViewGroup) {\n\n\t\t\tfor (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) {\n\n\t\t\t\tView innerView = ((ViewGroup) view).getChildAt(i);\n\n\t\t\t\tsetupKeyboardHide(innerView);\n\t\t\t}\n\t\t}\n\t}",
"@Override\n public void setFocus(Context context) {\n InputMethodManager inputManager =\n (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);\n inputManager.hideSoftInputFromWindow(this.getWindowToken(), 0);\n\n }",
"private void hideLoginScreen()\n {\n logIngEditText.setVisibility(View.INVISIBLE);\n passwordEditText.setVisibility(View.INVISIBLE);\n loginButton.setVisibility(View.INVISIBLE);\n textViewLabel.setVisibility(View.INVISIBLE);\n }",
"@Override\n\tpublic void showKeyboard() {\n\t\t\n\t}",
"public void showSoftKeyboard(){\n if(view.requestFocus()){\n InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);\n imm.showSoftInput(view,InputMethodManager.SHOW_IMPLICIT);\n // imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_IMPLICIT_ONLY);\n }\n }",
"@Override\n public void hideCategoryOtherEditTextField() {\n mEditTextProductCategoryOther.setVisibility(View.INVISIBLE);\n }",
"@Override\n public void onFocusChange(View v, boolean hasFocus) {\n if (hasFocus)\n showKeyboard();\n else {\n hideKeyboard();\n }\n\n }",
"@Override\n public boolean dispatchTouchEvent(MotionEvent event)\n {\n View v = getCurrentFocus();\n boolean ret = super.dispatchTouchEvent(event);\n\n if (v instanceof EditText) {\n View w = getCurrentFocus();\n int[] scrCoords = new int[2];\n w.getLocationOnScreen(scrCoords);\n float x = event.getRawX() + w.getLeft() - scrCoords[0];\n float y = event.getRawY() + w.getTop() - scrCoords[1];\n\n if (event.getAction() == MotionEvent.ACTION_UP && (x < w.getLeft() || x >= w.getRight() || y < w.getTop() || y > w.getBottom()) ) {\n\n InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);\n imm.hideSoftInputFromWindow(getWindow().getCurrentFocus().getWindowToken(), 0);\n }\n }\n return ret;\n }",
"@Override\n public boolean dispatchTouchEvent(MotionEvent event) {\n if (event.getAction() == MotionEvent.ACTION_DOWN) {\n View v = getCurrentFocus();\n if ( v instanceof EditText) {\n Rect outRect = new Rect();\n v.getGlobalVisibleRect(outRect);\n if (!outRect.contains((int)event.getRawX(), (int)event.getRawY())) {\n v.clearFocus();\n hideKeyboard();\n }\n }\n }\n return super.dispatchTouchEvent( event );\n }",
"public static void hide(@Nullable Activity activity) {\n if (activity == null) {\n LogHelper.writeWithTrace(Level.WARNING, TAG, \"Activity is null!\");\n return;\n }\n\n InputMethodManager mgr = (InputMethodManager)activity\n .getSystemService(Context.INPUT_METHOD_SERVICE);\n if (mgr != null) {\n mgr.hideSoftInputFromWindow(activity\n .getWindow().getDecorView().getWindowToken(), 0);\n }\n }",
"private void hideMe() {\n\t\tthis.setVisible(false);\n\t\ttxtName.setText(\"\");\n\t\ttxtEmail.setText(\"\");\n\t\ttxtPhone.setText(\"\");\n\t}",
"public void hideBoomKeyTip() {\n }"
] | [
"0.8607854",
"0.8232066",
"0.82017595",
"0.81868386",
"0.8178324",
"0.81716895",
"0.81604064",
"0.81497467",
"0.81339806",
"0.81316036",
"0.81258494",
"0.81258494",
"0.81205744",
"0.81112665",
"0.80983806",
"0.80553365",
"0.80363905",
"0.7963366",
"0.7926815",
"0.7904587",
"0.78949994",
"0.7869392",
"0.7868857",
"0.7867126",
"0.7851888",
"0.77954555",
"0.77466446",
"0.766459",
"0.76495004",
"0.76121736",
"0.75668436",
"0.7566819",
"0.7543771",
"0.7523759",
"0.7515949",
"0.7496049",
"0.7478231",
"0.7456805",
"0.7435622",
"0.73817503",
"0.7373757",
"0.73682356",
"0.7347936",
"0.7310257",
"0.7296929",
"0.7285331",
"0.7278485",
"0.7277016",
"0.7247596",
"0.7181805",
"0.71728253",
"0.71628815",
"0.7149466",
"0.71465504",
"0.71430194",
"0.71366847",
"0.71119803",
"0.7100785",
"0.709759",
"0.70789784",
"0.7070396",
"0.704028",
"0.7031338",
"0.7021307",
"0.70202494",
"0.70188594",
"0.70105",
"0.70070213",
"0.70033044",
"0.69748974",
"0.69627225",
"0.69354045",
"0.69281936",
"0.6916068",
"0.69112355",
"0.6863828",
"0.6844044",
"0.6843281",
"0.6779535",
"0.67731845",
"0.67731845",
"0.6769156",
"0.67671347",
"0.67671347",
"0.6738565",
"0.67368114",
"0.6731913",
"0.671612",
"0.6708989",
"0.6708217",
"0.6600966",
"0.6563332",
"0.65574276",
"0.65210295",
"0.64923805",
"0.64839107",
"0.6478915",
"0.64756846",
"0.64407784",
"0.6439623"
] | 0.7237665 | 49 |
Parses the primary section entity ID from the request uri. | protected String parsePrimaryId(String uriTxt) {
String id = null;
int idx = uriTxt.lastIndexOf(QuickLinksAction.CHAR_SLASH);
if (idx < uriTxt.length())
id = uriTxt.substring(idx+1);
return id;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private Integer extractId(Request request) throws InvalidInputException {\n\t\tString intString = (String)request.getAttributes().get(RequestParamConstants.PARAM_META_ID);\n\t\tInteger id = null;\n\t\ttry {\n\t\t\tid = new Integer(intString);\n\t\t} catch (NumberFormatException e) {\n\t\t\tthrow new InvalidInputException(\"Bad integer format in id: \"+intString, e);\n\t\t}\n\t\treturn id;\n\t}",
"public static String getIdFromURI(final String uri) {\r\n\r\n if (uri == null) {\r\n return null;\r\n }\r\n Matcher matcher = PATTERN_GET_ID_FROM_URI_OR_FEDORA_ID.matcher(uri);\r\n if (matcher.find()) {\r\n return matcher.group(1);\r\n }\r\n else {\r\n return uri;\r\n }\r\n }",
"public static long getIdFromUri(Uri uri)\n {\n return ContentUris.parseId(uri);\n }",
"public static String getPlaceDetailId(Uri uri) {\n\t\t\treturn uri.getLastPathSegment();\n\t\t}",
"public static String getPlaceId(Uri uri) {\n\t\t\treturn uri.getLastPathSegment();\n\t\t}",
"private String computeHeaderIdForNumber(String header) {\n\t\tString id = header;\n\t\tif (isKramdownFix()) {\n\t\t\tid = id .replaceAll(\"\\\\.\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\n\t\t}\n\t\tid = id.replaceAll(\"[^a-zA-Z0-9]+\", \"-\"); //$NON-NLS-1$ //$NON-NLS-2$\n\t\tid = id.toLowerCase();\n\t\tid = id.replaceFirst(\"^[^a-zA-Z0-9]+\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\n\t\tid = id.replaceFirst(\"[^a-zA-Z0-9]+$\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\n\t\tif (Strings.isEmpty(id)) {\n\t\t\treturn \"section\"; //$NON-NLS-1$\n\t\t}\n\t\treturn id;\n\t}",
"private Option<String> getParleysId(String url) {\n Matcher m = ID_PARLEYS_PATTERN.matcher(url);\n\n if (!m.find())\n return Option.none();\n\n return Option.of(m.group(1));\n }",
"protected abstract String getInitialPageId();",
"@Override\n public String getIdFromHref(String href) {\n int spos = href.indexOf(\"#\");\n if (spos == -1) {\n throw new IllegalArgumentException(href + \" is not a valid href\");\n }\n String ns = href.substring(0, spos);\n int dpos = ns.indexOf(\".\");\n if (dpos == -1) {\n throw new IllegalArgumentException(href + \" is not a valid href\");\n }\n String prefix = ns.substring(dpos + 1, ns.length());\n if (!this.prefix.equals(prefix)) {\n throw new IllegalArgumentException(\"Expected href with prefix=\" + this.prefix);\n }\n return href.substring(spos + 1);\n }",
"@JsonIgnore\n public String getId() {\n return UriHelper.getLastUriPart(getUri());\n }",
"private String computeHeaderIdForText(String header) {\n\t\tString id = header.replaceAll(\"[^a-zA-Z0-9]+\", \"-\"); //$NON-NLS-1$ //$NON-NLS-2$\n\t\tid = id.toLowerCase();\n\t\tid = id.replaceFirst(\"^[^a-zA-Z0-9]+\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\n\t\tid = id.replaceFirst(\"[^a-zA-Z0-9]+$\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\n\t\tif (Strings.isEmpty(id)) {\n\t\t\treturn \"section\"; //$NON-NLS-1$\n\t\t}\n\t\treturn id;\n\t}",
"String getIdFromLocation(final String location) {\n return location.substring(location.lastIndexOf(\"/\") + 1);\n }",
"int getSectionID(Vector<Integer> sectionIDs, Vector<Integer> sectionLinIDs, Vector<String> sectionCodes, String cellValue, int lineID);",
"public static long getContactInformationId(Uri uri) {\n return ContentUris.parseId(uri);\n }",
"final Integer getIdFromStringPerson(String selectedValue) {\n String [] tokens = selectedValue.split(\":\"); //Split our String\n int idPosition = 1; // ID's position in the our String(See getAsString())\n return Integer.parseInt(tokens[idPosition]); //Extract Id from the string\n }",
"String getParseObjectId();",
"public URI getId();",
"public URI getId();",
"public static long getMovieIdFromUri(Uri uri)\n {\n return ContentUris.parseId(uri);\n }",
"public static long getMovieIdFromUri(Uri uri)\n {\n return ContentUris.parseId(uri);\n }",
"public static String getObjidFromHref(final String href) {\r\n return href.substring(href.lastIndexOf('/') + 1);\r\n }",
"public static Object parseEntityId(String entityName, String entityId) {\n if (!StringUtils.isEmpty(entityId) && !StringUtils.isEmpty(entityId)) {\n Metadata metadata = AppBeans.get(Metadata.NAME);\n MetaClass metaClass = metadata.getClassNN(entityName);\n MetaProperty idProperty = metaClass.getPropertyNN(\"id\");\n Class idClass = idProperty.getJavaType();\n if (UUID.class.isAssignableFrom(idClass)) {\n return UuidProvider.fromString(entityId);\n } else if (Integer.class.isAssignableFrom(idClass)) {\n return Integer.valueOf(entityId);\n } else if (Long.class.isAssignableFrom(idClass)) {\n return Long.valueOf(entityId);\n } else if (String.class.isAssignableFrom(idClass)) {\n return entityId;\n } else {\n throw new UnsupportedOperationException(String.format(\"Unknown entity '%s' id type '%s'\", entityName, entityId));\n }\n }\n return null;\n }",
"private static Long readAnnotationId(String url) {\r\n\t\treturn Long.parseLong(url.replace(Config.getInstance().getAnnotationBaseUrl(), \"\"));\r\n\t}",
"public static Optional<String> getIdAsStrFromSpecifiedGameEndpoint(String endpoint) {\n Matcher matcher = getGameIdPattern.matcher(endpoint);\n if (matcher.find()) {\n return Optional.of(matcher.group());\n }\n return Optional.empty();\n }",
"int getMajorFragmentId();",
"private Integer getId(final URI uri) {\n //Preconditions\n assert uri != null : \"uri must not be null\";\n\n final String uriString = RDFUtility.formatResource(uri);\n Integer id = uriToIdDictionary.get(uriString);\n if (id == null) {\n id = nextId++;\n uriToIdDictionary.put(uriString, id);\n uris.add(uriString);\n assert uris.get(id).equals(uriString);\n }\n return id;\n }",
"public static int getFirstPtId() {\n\t\tif (xml == null) return 1;\n\t\treturn firstPtId;\n\t}",
"private String getPrimaryNumber(long _id) {\n String primaryNumber = null;\n try {\n Cursor cursor = getContentResolver().query( ContactsContract.CommonDataKinds.Phone.CONTENT_URI,\n new String[]{ContactsContract.CommonDataKinds.Phone.NUMBER, ContactsContract.CommonDataKinds.Phone.TYPE},\n ContactsContract.CommonDataKinds.Phone.CONTACT_ID +\" = \"+ _id, // We need to add more selection for phone type\n null,\n null);\n if(cursor != null) {\n while(cursor.moveToNext()){\n switch(cursor.getInt(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.TYPE))){\n case ContactsContract.CommonDataKinds.Phone.TYPE_MOBILE :\n primaryNumber = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));\n break;\n case ContactsContract.CommonDataKinds.Phone.TYPE_HOME :\n primaryNumber = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));\n break;\n case ContactsContract.CommonDataKinds.Phone.TYPE_WORK :\n primaryNumber = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));\n break;\n case ContactsContract.CommonDataKinds.Phone.TYPE_OTHER :\n }\n if(primaryNumber != null)\n break;\n }\n }\n } catch (Exception e) {\n Log.i(\"test\", \"Exception \" + e.toString());\n } finally {\n if(cursor != null) {\n cursor.deactivate();\n cursor.close();\n }\n }\n return primaryNumber;\n }",
"public static long getItemId(Uri itemUri) {\n return Long.parseLong(itemUri.getPathSegments().get(1));\n }",
"public static long getItemId(Uri itemUri) {\n return Long.parseLong(itemUri.getPathSegments().get(1));\n }",
"public static long getItemId(Uri itemUri) {\n return Long.parseLong(itemUri.getPathSegments().get(1));\n }",
"public String getIdNode() {\r\n String idNode = null;\r\n idNode = this.getParam(ESCOConstantes.ID_NODE);\r\n // Add the root element if not present\r\n if (null != idNode && !idNode.startsWith(ESCOConstantes.STEM_NAME_SEPARATOR)) {\r\n idNode = ESCOConstantes.STEM_NAME_SEPARATOR + idNode;\r\n }\r\n\r\n return idNode;\r\n }",
"Serializable extractId(Object entity);",
"@Override\n public String getId(@Nonnull IRI iri) {\n\n Preconditions.checkNotNull(iri, \"Default pid uri must not be null.\");\n Preconditions.checkState(iri.toString().contains(\"#\"), \"Not an valid default pid uri.\");\n String id = null;\n String uri = iri.toString();\n id = uri.substring(uri.lastIndexOf('#') + 1);\n return id;\n }",
"@GET(\"w/api.php?action=parse&format=json&noimage\")\n Call<JsonElement> getSectionFrom(@Query(\"pageid\") long pageid,@Query(\"section\") long section);",
"protected String getIdentifier() {\n return getBaseUrl() + normalizePath(getRequest().getPath());\n }",
"private final void m75322a(Section section) {\n Integer valueOf = Integer.valueOf(section.index.global);\n String str = section.f40387id;\n C32569u.m150513a((Object) str, C6969H.m41409d(\"G7A86D60EB63FA567EF0A\"));\n mo78149b(valueOf, str);\n if (!TextUtils.isEmpty(section.sectionCell.url)) {\n m75351f().mo77906b(this.f53742u, m75342c());\n ZRouter.m72968a(getContext(), section.sectionCell.url);\n }\n }",
"private Integer getNumId(String idString, boolean isUri) {\n\t\tString numString;\n\t\tif (isUri) {\n\t\t\tif (!idString.startsWith(\"http://www.wikidata.org/entity/\")) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tnumString = idString.substring(\"http://www.wikidata.org/entity/Q\"\n\t\t\t\t\t.length());\n\t\t} else {\n\t\t\tnumString = idString.substring(1);\n\t\t}\n\t\treturn new Integer(numString);\n\t}",
"protected URI getImportOrcidIdURI(String uid, UriInfo uriInfo) {\n\t\tUriBuilder builder = UriBuilder.fromUri(uriInfo.getBaseUri());\n\t\tbuilder.path(\"uid\");\n\t\tbuilder.path(uid);\n\t\tbuilder.path(\"export\").path(\"orcid\").path(\"create/process\");\n\t\treturn builder.build();\n\t}",
"public String getIdFromRootElement(final String xml) {\r\n String result = null;\r\n // FIXME PATTERN_OBJID_ATTRIBUTE is static field !\r\n // FIXME this pattern does not work for componentId\r\n Pattern patternObjidAttributeJustForThisMethod = Pattern.compile(\"href=\\\"/ir/[^/]+/([^\\\"]*)\\\"\");\r\n Matcher m1 = patternObjidAttributeJustForThisMethod.matcher(xml);\r\n if (m1.find()) {\r\n result = m1.group(1);\r\n }\r\n\r\n return result;\r\n }",
"private boolean initializeAuthority(String p_uriSpec) {\n \n int index = 0;\n int start = 0;\n int end = p_uriSpec.length();\n \n char testChar = '\\0';\n String userinfo = null;\n \n // userinfo is everything up to @\n if (p_uriSpec.indexOf('@', start) != -1) {\n while (index < end) {\n testChar = p_uriSpec.charAt(index);\n if (testChar == '@') {\n break;\n }\n index++;\n }\n userinfo = p_uriSpec.substring(start, index);\n index++;\n }\n \n // host is everything up to last ':', or up to \n // and including ']' if followed by ':'.\n String host = null;\n start = index;\n boolean hasPort = false;\n if (index < end) {\n if (p_uriSpec.charAt(start) == '[') {\n int bracketIndex = p_uriSpec.indexOf(']', start);\n index = (bracketIndex != -1) ? bracketIndex : end;\n if (index+1 < end && p_uriSpec.charAt(index+1) == ':') {\n ++index;\n hasPort = true;\n }\n else {\n index = end;\n }\n }\n else {\n int colonIndex = p_uriSpec.lastIndexOf(':', end);\n index = (colonIndex > start) ? colonIndex : end;\n hasPort = (index != end);\n }\n }\n host = p_uriSpec.substring(start, index);\n int port = -1;\n if (host.length() > 0) {\n // port\n if (hasPort) {\n index++;\n start = index;\n while (index < end) {\n index++;\n }\n String portStr = p_uriSpec.substring(start, index);\n if (portStr.length() > 0) {\n // REVISIT: Remove this code.\n /** for (int i = 0; i < portStr.length(); i++) {\n if (!isDigit(portStr.charAt(i))) {\n throw new MalformedURIException(\n portStr +\n \" is invalid. Port should only contain digits!\");\n }\n }**/\n // REVISIT: Remove this code.\n // Store port value as string instead of integer.\n try {\n port = Integer.parseInt(portStr);\n if (port == -1) --port;\n }\n catch (NumberFormatException nfe) {\n port = -2;\n }\n }\n }\n }\n \n if (isValidServerBasedAuthority(host, port, userinfo)) {\n m_host = host;\n m_port = port;\n m_userinfo = userinfo;\n return true;\n }\n // Note: Registry based authority is being removed from a\n // new spec for URI which would obsolete RFC 2396. If the\n // spec is added to XML errata, processing of reg_name\n // needs to be removed. - mrglavas.\n else if (isValidRegistryBasedAuthority(p_uriSpec)) {\n m_regAuthority = p_uriSpec;\n return true;\n }\n return false;\n }",
"public final EObject entryRuleEPREFIX_ID() throws RecognitionException {\n EObject current = null;\n\n EObject iv_ruleEPREFIX_ID = null;\n\n\n try {\n // InternalRMParser.g:9162:51: (iv_ruleEPREFIX_ID= ruleEPREFIX_ID EOF )\n // InternalRMParser.g:9163:2: iv_ruleEPREFIX_ID= ruleEPREFIX_ID EOF\n {\n newCompositeNode(grammarAccess.getEPREFIX_IDRule()); \n pushFollow(FOLLOW_1);\n iv_ruleEPREFIX_ID=ruleEPREFIX_ID();\n\n state._fsp--;\n\n current =iv_ruleEPREFIX_ID; \n match(input,EOF,FOLLOW_2); \n\n }\n\n }\n\n catch (RecognitionException re) {\n recover(input,re);\n appendSkippedTokens();\n }\n finally {\n }\n return current;\n }",
"public final EObject ruleEPREFIX_ID() throws RecognitionException {\n EObject current = null;\n\n Token lv_module_0_0=null;\n Token otherlv_1=null;\n Token lv_id_2_0=null;\n Token otherlv_3=null;\n Token lv_version_4_0=null;\n\n\n \tenterRule();\n\n try {\n // InternalRMParser.g:9175:2: ( ( ( ( (lv_module_0_0= RULE_ID ) ) otherlv_1= Solidus )? ( (lv_id_2_0= RULE_ID ) ) (otherlv_3= CommercialAt ( (lv_version_4_0= RULE_VERSION ) ) )? ) )\n // InternalRMParser.g:9176:2: ( ( ( (lv_module_0_0= RULE_ID ) ) otherlv_1= Solidus )? ( (lv_id_2_0= RULE_ID ) ) (otherlv_3= CommercialAt ( (lv_version_4_0= RULE_VERSION ) ) )? )\n {\n // InternalRMParser.g:9176:2: ( ( ( (lv_module_0_0= RULE_ID ) ) otherlv_1= Solidus )? ( (lv_id_2_0= RULE_ID ) ) (otherlv_3= CommercialAt ( (lv_version_4_0= RULE_VERSION ) ) )? )\n // InternalRMParser.g:9177:3: ( ( (lv_module_0_0= RULE_ID ) ) otherlv_1= Solidus )? ( (lv_id_2_0= RULE_ID ) ) (otherlv_3= CommercialAt ( (lv_version_4_0= RULE_VERSION ) ) )?\n {\n // InternalRMParser.g:9177:3: ( ( (lv_module_0_0= RULE_ID ) ) otherlv_1= Solidus )?\n int alt72=2;\n int LA72_0 = input.LA(1);\n\n if ( (LA72_0==RULE_ID) ) {\n int LA72_1 = input.LA(2);\n\n if ( (LA72_1==Solidus) ) {\n alt72=1;\n }\n }\n switch (alt72) {\n case 1 :\n // InternalRMParser.g:9178:4: ( (lv_module_0_0= RULE_ID ) ) otherlv_1= Solidus\n {\n // InternalRMParser.g:9178:4: ( (lv_module_0_0= RULE_ID ) )\n // InternalRMParser.g:9179:5: (lv_module_0_0= RULE_ID )\n {\n // InternalRMParser.g:9179:5: (lv_module_0_0= RULE_ID )\n // InternalRMParser.g:9180:6: lv_module_0_0= RULE_ID\n {\n lv_module_0_0=(Token)match(input,RULE_ID,FOLLOW_89); \n\n \t\t\t\t\t\tnewLeafNode(lv_module_0_0, grammarAccess.getEPREFIX_IDAccess().getModuleIDTerminalRuleCall_0_0_0());\n \t\t\t\t\t\n\n \t\t\t\t\t\tif (current==null) {\n \t\t\t\t\t\t\tcurrent = createModelElement(grammarAccess.getEPREFIX_IDRule());\n \t\t\t\t\t\t}\n \t\t\t\t\t\tsetWithLastConsumed(\n \t\t\t\t\t\t\tcurrent,\n \t\t\t\t\t\t\t\"module\",\n \t\t\t\t\t\t\tlv_module_0_0,\n \t\t\t\t\t\t\t\"org.sodalite.dsl.RM.ID\");\n \t\t\t\t\t\n\n }\n\n\n }\n\n otherlv_1=(Token)match(input,Solidus,FOLLOW_5); \n\n \t\t\t\tnewLeafNode(otherlv_1, grammarAccess.getEPREFIX_IDAccess().getSolidusKeyword_0_1());\n \t\t\t\n\n }\n break;\n\n }\n\n // InternalRMParser.g:9201:3: ( (lv_id_2_0= RULE_ID ) )\n // InternalRMParser.g:9202:4: (lv_id_2_0= RULE_ID )\n {\n // InternalRMParser.g:9202:4: (lv_id_2_0= RULE_ID )\n // InternalRMParser.g:9203:5: lv_id_2_0= RULE_ID\n {\n lv_id_2_0=(Token)match(input,RULE_ID,FOLLOW_90); \n\n \t\t\t\t\tnewLeafNode(lv_id_2_0, grammarAccess.getEPREFIX_IDAccess().getIdIDTerminalRuleCall_1_0());\n \t\t\t\t\n\n \t\t\t\t\tif (current==null) {\n \t\t\t\t\t\tcurrent = createModelElement(grammarAccess.getEPREFIX_IDRule());\n \t\t\t\t\t}\n \t\t\t\t\tsetWithLastConsumed(\n \t\t\t\t\t\tcurrent,\n \t\t\t\t\t\t\"id\",\n \t\t\t\t\t\tlv_id_2_0,\n \t\t\t\t\t\t\"org.sodalite.dsl.RM.ID\");\n \t\t\t\t\n\n }\n\n\n }\n\n // InternalRMParser.g:9219:3: (otherlv_3= CommercialAt ( (lv_version_4_0= RULE_VERSION ) ) )?\n int alt73=2;\n int LA73_0 = input.LA(1);\n\n if ( (LA73_0==CommercialAt) ) {\n alt73=1;\n }\n switch (alt73) {\n case 1 :\n // InternalRMParser.g:9220:4: otherlv_3= CommercialAt ( (lv_version_4_0= RULE_VERSION ) )\n {\n otherlv_3=(Token)match(input,CommercialAt,FOLLOW_91); \n\n \t\t\t\tnewLeafNode(otherlv_3, grammarAccess.getEPREFIX_IDAccess().getCommercialAtKeyword_2_0());\n \t\t\t\n // InternalRMParser.g:9224:4: ( (lv_version_4_0= RULE_VERSION ) )\n // InternalRMParser.g:9225:5: (lv_version_4_0= RULE_VERSION )\n {\n // InternalRMParser.g:9225:5: (lv_version_4_0= RULE_VERSION )\n // InternalRMParser.g:9226:6: lv_version_4_0= RULE_VERSION\n {\n lv_version_4_0=(Token)match(input,RULE_VERSION,FOLLOW_2); \n\n \t\t\t\t\t\tnewLeafNode(lv_version_4_0, grammarAccess.getEPREFIX_IDAccess().getVersionVERSIONTerminalRuleCall_2_1_0());\n \t\t\t\t\t\n\n \t\t\t\t\t\tif (current==null) {\n \t\t\t\t\t\t\tcurrent = createModelElement(grammarAccess.getEPREFIX_IDRule());\n \t\t\t\t\t\t}\n \t\t\t\t\t\tsetWithLastConsumed(\n \t\t\t\t\t\t\tcurrent,\n \t\t\t\t\t\t\t\"version\",\n \t\t\t\t\t\t\tlv_version_4_0,\n \t\t\t\t\t\t\t\"org.sodalite.dsl.RM.VERSION\");\n \t\t\t\t\t\n\n }\n\n\n }\n\n\n }\n break;\n\n }\n\n\n }\n\n\n }\n\n\n \tleaveRule();\n\n }\n\n catch (RecognitionException re) {\n recover(input,re);\n appendSkippedTokens();\n }\n finally {\n }\n return current;\n }",
"String getRootId();",
"String getRootId();",
"int getPrimarySnId();",
"int getPrimarySnId();",
"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();",
"public static String getIdFromRootElementHref(final Document document) throws Exception {\r\n\r\n return getObjidFromHref(getRootElementHrefValue(document));\r\n }",
"public String getId()\r\n\t{\n\t\treturn id.substring(2, 5);\r\n\t}",
"private static String extractVolumeIDFromFilePath(String path) {\n\t\tString prefix = \"loc\";\r\n\r\n\t\tString filename = \"ark+=13960=t9765kx0j.mets.xml\";\r\n\r\n\t\t// the full filename sans the extension is the cleaned headless ID\r\n\t\tString cleanedHeadlessID = filename.substring(0, filename.length()\r\n\t\t\t\t- \".mets.xml\".length());\r\n\r\n\t\t// must unclean this token using Pairtree\r\n\t\tPairtree pairtree = new Pairtree();\r\n\t\tString uncleanedHeadlessID = pairtree.uncleanId(cleanedHeadlessID);\r\n\r\n\t\tString str = prefix + \".\" + uncleanedHeadlessID;\r\n\r\n\t\treturn prefix + \".\" + uncleanedHeadlessID;\r\n\r\n\t}",
"String serviceId(RequestContext ctx) {\n\n String serviceId = (String) ctx.get(SERVICE_ID);\n if (serviceId == null) {\n log.info(\"No service id found in request context {}\", ctx);\n }\n return serviceId;\n }",
"private void parseId(Node node) {\r\n if (switchTest) return;\r\n skipTrace = true;\r\n parse(node.ref());\r\n }",
"java.lang.String getRequestID();",
"java.lang.String getAoisId();",
"public Section findById (Section section) throws DataAccessException;",
"public static int getIdentifier(String resource) {\n String fileName = new File(resource).getName();\n String tokens[] = fileName.split(\"\\\\.(?=[^\\\\.]+$)\");\n int identifier;\n if (tokens.length == 2 && tokens[0].matches(\"\\\\d+\")) {\n identifier = Integer.valueOf(tokens[0]);\n } else {\n int hashCode = Math.abs(fileName.hashCode());\n int minValue = Integer.MAX_VALUE / 2;\n identifier = minValue + hashCode / 2;\n }\n return identifier;\n }",
"public static String getIdentifier(BaseDocument doc, int offset)\n throws BadLocationException {\n int[] blk = getIdentifierBlock(doc, offset);\n return (blk != null) ? doc.getText(blk[0], blk[1] - blk[0]) : null;\n }",
"java.lang.String getQueryId();",
"@Override\n public URI getId() {\n return id;\n }",
"public synchronized String getId(long entry) throws IOException, EOFException {\n long startOfEntry = IDX_START_OF_CONTENT + (entry * bytesPerSlot);\n idx.seek(startOfEntry);\n byte[] bytes = new byte[bytesPerId];\n int bytesRead = idx.read(bytes);\n if (bytesRead < bytesPerId || bytes[1] == '\\n')\n throw new IllegalStateException(\"No data at address \" + entry);\n return new String(bytes);\n }",
"public Address getPrimaryContactParsed();",
"public String getStringID() {\r\n\t\treturn uri.getPath();\r\n\t}",
"public String getEntityId() {\r\n\t\treturn EngineTools.getEntityId(getEntityKeys()[2]);\r\n\t}",
"@RequestMapping( value = \"/detail\", method = RequestMethod.GET )\n\t@Transactional\n\tpublic @ResponseBody Map<String, Object> getPublicationDetail( \n\t\t\t@RequestParam( value = \"id\", required = false ) final String id, \n\t\t\t@RequestParam( value = \"uri\", required = false ) final String uri,\n\t\t\t@RequestParam( value = \"section\", required = false ) String section,\n\t\t\tfinal HttpServletResponse response) throws InterruptedException, IOException, ExecutionException\n\t{\n\t\tif ( section == null || ( section != null && section.isEmpty() ) )\n\t\t\tsection = \"all\";\n\t\treturn publicationFeature.getPublicationDetail().getPublicationDetailById( id, section );\n\t}",
"public static int[] getIdentifierBlock(BaseDocument doc, int offset)\n throws BadLocationException {\n int[] ret = null;\n int idStart = getWordStart(doc, offset);\n if (idStart >= 0) {\n int idEnd = getWordEnd(doc, idStart);\n if (idEnd >= 0) {\n String id = doc.getText(idStart, idEnd - idStart);\n if (doc.getSyntaxSupport().isIdentifier(id)) {\n ret = new int[] { idStart, idEnd };\n } else { // not identifier by syntax support\n id = getWord(doc, offset); // try right at offset\n if (doc.getSyntaxSupport().isIdentifier(id)) {\n ret = new int[] { offset, offset + id.length() };\n }\n }\n }\n }\n return ret;\n }",
"public int getEntityId ( ) {\n\t\treturn invokeSafe ( \"getEntityId\" );\n\t}",
"public static String getIdentifierBefore(BaseDocument doc, int offset)\n throws BadLocationException {\n int wordStart = getWordStart(doc, offset);\n if (wordStart != -1) {\n String word = new String(doc.getChars(wordStart,\n offset - wordStart), 0, offset - wordStart);\n if (doc.getSyntaxSupport().isIdentifier(word)) {\n return word;\n }\n }\n return null;\n }",
"private int findSiteID(String s) {\n\t\tint firstP = s.indexOf(\"(\");\n\t\tint lastP = s.indexOf(\")\");\n\n\t\tString siteId = s.substring(firstP + 1, lastP);\n\n\t\treturn Integer.parseInt(siteId);\n\t}",
"public ID getPsl46_MainService() { \r\n\t\tID retVal = this.getTypedField(46, 0);\r\n\t\treturn retVal;\r\n }",
"public void setSectionID(Integer sectionID){\n this.sectionID = sectionID;\n }",
"java.lang.String getDocumentId();",
"public final EObject entryRulePrefixedPrimaryExpCS() throws RecognitionException {\n EObject current = null;\n\n EObject iv_rulePrefixedPrimaryExpCS = null;\n\n\n try {\n // InternalMyDsl.g:7689:61: (iv_rulePrefixedPrimaryExpCS= rulePrefixedPrimaryExpCS EOF )\n // InternalMyDsl.g:7690:2: iv_rulePrefixedPrimaryExpCS= rulePrefixedPrimaryExpCS EOF\n {\n if ( state.backtracking==0 ) {\n newCompositeNode(grammarAccess.getPrefixedPrimaryExpCSRule()); \n }\n pushFollow(FOLLOW_1);\n iv_rulePrefixedPrimaryExpCS=rulePrefixedPrimaryExpCS();\n\n state._fsp--;\n if (state.failed) return current;\n if ( state.backtracking==0 ) {\n current =iv_rulePrefixedPrimaryExpCS; \n }\n match(input,EOF,FOLLOW_2); if (state.failed) return current;\n\n }\n\n }\n\n catch (RecognitionException re) {\n recover(input,re);\n appendSkippedTokens();\n }\n finally {\n }\n return current;\n }",
"public String getInoId();",
"String getRouteID();",
"public String getId(Node node) {\n String id = \"\";\n if (node instanceof AIdExp) {\n AIdExp idNode = (AIdExp) node;\n id = idNode.getId().getText();\n }\n\treturn id;\n }",
"public static long getCoinItemIdx(Uri coinItemUri) {\n return Long.parseLong(coinItemUri.getPathSegments().get(1));\n }",
"private static String getSessionIDFromRequest (HTTPRequest aRequest)\n\t{\n\t\treturn aRequest.getQueryValue (\"sessionID\");\n\t}",
"private String getPid(String filename) \r\n {\r\n\tString xml_file = filename;\r\n\tString pid = \"00000\";\r\n\t\r\n\t/* make a formal XML file name , taking \"DATA\" out of xml filename \r\n\t Johnson_arizona_0009D_10063_DATA.xml ==> 10063\r\n\t*/\r\n\tint loc = xml_file.lastIndexOf(\"_DATA.xml\"); \r\n\txml_file = xml_file.substring (0, loc); // \t\r\n\tSystem.out.println (\"xml_file +\" + xml_file);\r\n \r\n\tint loc_begin = xml_file.lastIndexOf(\"_\") + 1 ;\t\r\n\r\n\tif(loc_begin < 0)\r\n\t {\r\n\t\tSystem.out.println(\"Error (copyFile): File \" + xml_file + \" must be of form LastName_arizona_\\\\d\");\r\n\t\treturn pid;\r\n\t }\r\n\telse{\r\n\t pid = xml_file.substring (loc_begin); // get pid = something like \"10063\" \r\n\t //System.out.println(\"***** pid = \" + pid);\r\n\r\n\t if(pid == null || pid.length() < 1)\r\n\t\t{\r\n\t\t System.out.println(\"Error (copyFile): Unable to parse out persistent identifier (pid) from name \" + xml_file);\r\n\t\t return null;\r\n\t\t}\r\n\t return pid;\r\n\t}\r\n }",
"private String readPrefixPart()\n // { return readWordSub(false, false) ; }\n {\n return readSegment(false);\n }",
"private UUID uuidFromUri(URI uri) {\n Pattern pairRegex = Pattern.compile(\"\\\\p{XDigit}{8}-\\\\p{XDigit}{4}-\\\\p{XDigit}{4}-\\\\p{XDigit}{4}-\\\\p{XDigit}{12}\");\n Matcher matcher = pairRegex.matcher(uri.toString());\n String uuid = \"\";\n while (matcher.find()) {\n uuid = matcher.group(0);\n }\n return UUID.fromString(uuid);\n }",
"private String extractHostFromDBUrl(String url) throws Exception {\n\t\tint start = url.indexOf(\"sid=\") + 4;\n\t\tif (start > 3) {\n\t\t\tint stop = url.indexOf(\")\", start);\n\t\t\tif (stop > -1) {\n\t\t\t\treturn url.substring(start, stop);\n\t\t\t}\n\t\t} else {\n\t\t\tlog.warn(\"Try to extract sid from short url\");\n\t\t\tstart = url.lastIndexOf(\":\") + 1;\n\t\t\tif (start > 0) {\n\t\t\t\treturn url.substring(start, url.length());\n\t\t\t}\n\t\t}\n\t\tthrow new Exception(\"Unable to extract the SID from the URL \" + url);\n\t}"
] | [
"0.5284825",
"0.52025944",
"0.51091516",
"0.500934",
"0.500281",
"0.49602345",
"0.4932574",
"0.49244753",
"0.49179086",
"0.48984736",
"0.4883615",
"0.48733932",
"0.48590252",
"0.48165968",
"0.47970712",
"0.47947022",
"0.47915596",
"0.47915596",
"0.4745974",
"0.4745974",
"0.4621917",
"0.4600007",
"0.45588952",
"0.45470917",
"0.4538651",
"0.4524212",
"0.45166382",
"0.45023155",
"0.44988158",
"0.44988158",
"0.44988158",
"0.44815528",
"0.44763643",
"0.44627085",
"0.44484958",
"0.44377348",
"0.4426692",
"0.44099346",
"0.44051564",
"0.44047275",
"0.43841696",
"0.43832412",
"0.43495214",
"0.4346505",
"0.4346505",
"0.43427327",
"0.43427327",
"0.43379602",
"0.43379602",
"0.43379602",
"0.43379602",
"0.43379602",
"0.43379602",
"0.43379602",
"0.43379602",
"0.43379602",
"0.43379602",
"0.43379602",
"0.43379602",
"0.43379602",
"0.43379602",
"0.43379602",
"0.43379602",
"0.43379602",
"0.43379602",
"0.43379602",
"0.43374482",
"0.43200493",
"0.43151128",
"0.43090108",
"0.43071246",
"0.4306557",
"0.42792457",
"0.42751348",
"0.42745006",
"0.42676267",
"0.42550302",
"0.42476687",
"0.42448553",
"0.42397854",
"0.42355797",
"0.42327648",
"0.42314628",
"0.4228573",
"0.42008787",
"0.41855288",
"0.4185127",
"0.41834456",
"0.41740835",
"0.41690752",
"0.41605812",
"0.41564107",
"0.4151384",
"0.41324034",
"0.4129981",
"0.41251713",
"0.41239727",
"0.41214794",
"0.41123405",
"0.41118357"
] | 0.6592277 | 0 |
Adds the favorite to the user's profile favorites. | protected void updateProfileFavorites(ActionRequest req, PageViewVO fav) throws ActionException {
log.debug("updateProfileFavorites...");
MyFavoritesAction mfa = new MyFavoritesAction(getActionInit());
mfa.setAttributes(getAttributes());
mfa.setDBConnection(dbConn);
boolean isDelete = Convert.formatBoolean(req.getParameter("isDelete"));
if (isDelete) {
mfa.deleteFavorite(req);
} else {
// set additional req params needed for inserts.
req.setParameter(QuickLinksAction.PARAM_KEY_TYPE_CD, fav.getReferenceCode());
req.setParameter(QuickLinksAction.PARAM_KEY_REL_ID, fav.getPageId());
mfa.insertFavorite(req);
}
updateSessionFavorites(req.getSession(),fav,isDelete);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void addToFavorites() {\n\n favoriteBool = true;\n preferencesConfig.writeAddFavoriteTip(shownTipIndex);\n Toast.makeText(getContext(), \"Added to favorites.\", Toast.LENGTH_SHORT).show();\n\n }",
"public void favouriteUser() {\r\n\t\tif(favourited) {\r\n\t\t\tcurrentUser.unfavouriteUser(userToView.getUserID());\r\n\t\t\tfavouriteButton.setText(\"Favourite\");\r\n\t\t\tfavourited = false;\r\n\t\t} else if(currentUser.getUserID() != userToView.getUserID()){\r\n\t\t\tcurrentUser.favouriteUser(userToView.getUserID());\r\n\t\t\tfavouriteButton.setText(\"Unfavourite\");\r\n\t\t\tfavourited = true;\r\n\t\t} else {\r\n\t\t\tCONSTANTS.makeAlertWindow(\"warning\",\"You can not favorite yourself!\");\r\n\t\t}\r\n\t}",
"public void addToFavorites() {\n\n // Create new content values object\n ContentValues contentValues = new ContentValues();\n\n contentValues.put(FavMovieEntry.COLUMN_MOVIE_ID, sMovie.getMovieId());\n contentValues.put(FavMovieEntry.COLUMN_MOVIE_TITLE, sMovie.getMovieTitle());\n contentValues.put(FavMovieEntry.COLUMN_MOVIE_ORIGINAL_TITLE, sMovie.getMovieOriginalTitle());\n contentValues.put(FavMovieEntry.COLUMN_POSTER_PATH, sMovie.getPoster());\n contentValues.put(FavMovieEntry.COLUMN_BACKDROP_PATH, sMovie.getMovieBackdrop());\n contentValues.put(FavMovieEntry.COLUMN_MOVIE_RELEASE_DATE, sMovie.getReleaseDate());\n contentValues.put(FavMovieEntry.COLUMN_MOVIE_RATING, sMovie.getVoteAverage());\n contentValues.put(FavMovieEntry.COLUMN_MOVIE_SYNOPSIS, sMovie.getPlotSynopsis());\n\n try {\n mCurrentMovieUri = getContentResolver().insert(FavMovieEntry.CONTENT_URI,\n contentValues);\n } catch (IllegalArgumentException e) {\n mCurrentMovieUri = null;\n Log.v(LOG_TAG, e.toString());\n }\n\n if (mCurrentMovieUri != null) {\n isAddedToFavorites();\n }\n\n }",
"public void saveFavorite(){\n //make sure movie is NOT already a favorite\n if(!mMovieStaff.alreadyFavorite(mMovie.getTMDBId())){\n //is a new favorite, favorite movie list status has changed\n mFavoriteChanged = true;\n\n //set movie item favorite status as true\n mMovie.setFavorite(true);\n\n //save movie to favorite database table\n mMovieValet.saveFavorite(mMovie);\n\n //add movie to favorite movie list buffer\n mMovieStaff.addFavorite(mMovie);\n }\n\n //check if movie list type is display a favorite list and if the device is a tablet\n if(mMovieType == PosterHelper.NAME_ID_FAVORITE && mIsTablet){\n //both yes, get favorite movies to update poster fragment\n getMovieList(PosterHelper.NAME_ID_FAVORITE);\n }\n }",
"public void setFavorite(boolean favorite) {\n this.favorite = favorite;\n }",
"public void setToFavorite(boolean favorite) {\n this.isFavorite = favorite;\n }",
"public void setFavorite(boolean favorite) {\n isFavorite = favorite;\n }",
"public void setIsUserFav(User user) {\n if(user.isUsersFavouritePost(this.mPost))\n this.isFavourite.set(true);\n else\n this.isFavourite.set(false);\n\n //if(this.mPost.getFavourite().contains(user))\n // this.isFavourite.set(true);\n //this.isFavourite.set(false);\n }",
"private void addToDatabase(Favorites favorites) {\n FirebaseUser currentUser = mAuth.getCurrentUser();\n String uid = currentUser.getUid();\n mDatabase = db.getReference();\n\n mDatabase.child(\"favorites\").child(uid).setValue(favorites);\n }",
"@Override\n\tpublic void onFavorite(User source, User target, Status favoritedStatus) {\n\n\t}",
"@Override\n\t\tpublic void onFavorite(User arg0, User arg1, Status arg2) {\n\t\t\t\n\t\t}",
"@Override\n\tpublic void addFavorit(FavorisImpl newfavorit) {\n\t\t\n\t}",
"public void setFavorite(boolean favorite) {\n if (mFavorite != favorite) {\n mFavorite = favorite;\n // Avoid infinite recursions if setChecked() is called from a listener\n if (mBroadcasting) {\n return;\n }\n\n mBroadcasting = true;\n if (mOnFavoriteChangeListener != null) {\n mOnFavoriteChangeListener.onFavoriteChanged(this, mFavorite);\n }\n updateFavoriteButton(favorite);\n mBroadcasting = false;\n }\n }",
"@Override\n\tpublic void setFavorite(boolean value) {\n\t\tthis.isFavorite = value;\n\t}",
"@Override\n public void onClick(View view) {\n\n FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();\n\n if (favorited) {\n unFavorite(mangaID, user);\n } else {\n favorite(mangaID, mangaDetails.getTitle(), user);\n }\n\n }",
"@Override\n public void onClick(View view) {\n isFavorite = !isFavorite;\n\n if (isFavorite) {\n Toast.makeText(ShowTeacherActivity.this,\n getString(R.string.message_teacher_add_to_favorites), Toast.LENGTH_SHORT)\n .show();\n presenter.saveFavorite(ShowTeacherActivity.this, teacher);\n ibFavorite.setImageResource(R.drawable.ic_favorite_full);\n } else {\n Toast.makeText(ShowTeacherActivity.this,\n getString(R.string.message_teacher_delete_from_favorites), Toast.LENGTH_SHORT)\n .show();\n presenter.deleteFavorite(ShowTeacherActivity.this, teacher.getId());\n ibFavorite.setImageResource(R.drawable.ic_favorite_border);\n }\n }",
"public void onFavouritesIconPressed() {\n if (currentAdvertIsFavourite()) {\n dataModel.removeFromFavourites(advertisement);\n view.setIsNotAFavouriteIcon();\n } else {\n dataModel.addToFavourites(advertisement);\n view.setIsAFavouriteIcon();\n }\n }",
"public void setUpFavouriteIcon() {\n if (isUserOwner()) {\n view.hideFavouriteIcon();\n } else if (currentAdvertIsFavourite()) {\n view.setIsAFavouriteIcon();\n } else {\n view.setIsNotAFavouriteIcon();\n }\n }",
"public void addTermToFavourites(Term term) {\n // Set the favourited status of the term\n term.setFavourited(1);\n // Add the term to the table favourites\n addTermWithId(term, TABLE_FAVOURITES);\n // Update the favourite status of the term in the table terms\n updateTermFavouritedFlag(term, TABLE_TERMS);\n }",
"@SuppressWarnings(\"unchecked\")\n\tprotected void updateSessionFavorites(SMTSession session, PageViewVO fav, boolean isDelete) {\n\t\t// get the Favs map off of the session.\n\t\tMap<String,List<PageViewVO>> favMap = (Map<String,List<PageViewVO>>)session.getAttribute(MyFavoritesAction.MY_FAVORITES);\n\t\tList<PageViewVO> favs = favMap.get(fav.getReferenceCode());\n\t\tif (favs == null) favs = new ArrayList<>();\n\t\tif (isDelete) {\n\t\t\t// remove fav\n\t\t\tremoveFromSession(favs, fav.getPageId());\n\t\t} else {\n\t\t\t// add fav\n\t\t\tfavs.add(fav);\n\t\t}\n\t\t// replace the favs map on the session.\n\t\tsession.setAttribute(MyFavoritesAction.MY_FAVORITES, favMap);\n\t}",
"public boolean isAlreadyFavorited(){\r\n if(ui.isIsUserAuthenticated()){\r\n Users user = ui.getUser();\r\n if(user.getFavorites() != null){\r\n return user.getFavorites().contains(recipe);\r\n }\r\n else{\r\n return false;\r\n }\r\n }\r\n else{\r\n return false;\r\n }\r\n }",
"public void toggleFavorites()\n {\n this.showFavorites = !this.showFavorites;\n this.setupMorphs(Morphing.get(this.mc.thePlayer));\n }",
"public void addFavourite(View view){\n // We need to get the input from the fields\n EditText editTextName = (EditText) findViewById(R.id.editTextItemName);\n\n // First we need to make sure that the two required fields have entries and are valid\n if (editTextName.length() == 0) {\n Context context = getApplicationContext();\n CharSequence text = \"Missing Name.\";\n int duration = Toast.LENGTH_SHORT;\n\n Toast toast = Toast.makeText(context, text, duration);\n toast.show();\n\n return;\n }\n\n Context context = getApplicationContext();\n CharSequence text = \"Entry added as favourite\";\n int duration = Toast.LENGTH_SHORT;\n Toast toast = Toast.makeText(context, text, duration);\n toast.show();\n view.setClickable(false); // Turns button off //\n view.setVisibility(View.INVISIBLE);\n\n // Also make text entry invisible\n editTextName.setVisibility(editTextName.INVISIBLE);\n\n Globals.l.add(editTextName.getText().toString(),Globals.f);\n\n\n }",
"public void onFavButtonClicked(View view) {\n isFav = !isFav;\n toggleButtonText(isFav);\n \n // Update DB\n new OperateWithDBMovieAsyncTask().execute(isFav ? ADD_MOVIE : REMOVE_MOVIE);\n }",
"private boolean isAddedToFavorites() {\n boolean isFavorite = false;\n\n String[] projection = {FavMovieEntry.COLUMN_MOVIE_ID};\n String selection = FavMovieEntry.COLUMN_MOVIE_ID + \"=?\";\n String[] selectionArgs = new String[]{\n String.valueOf(sMovie.getMovieId())};\n\n Cursor cursor = this.getContentResolver().query(\n FavMovieEntry.CONTENT_URI,\n projection,\n selection,\n selectionArgs,\n null\n );\n\n if (cursor != null && cursor.moveToFirst()) {\n if (cursor.getCount() > 0) {\n isFavorite = true;\n long currentIndex = cursor.getLong(cursor.getColumnIndex(FavMovieEntry.COLUMN_MOVIE_ID));\n mCurrentMovieUri = ContentUris.withAppendedId(FavMovieEntry.CONTENT_URI, currentIndex);\n } else {\n isFavorite = false;\n\n mCurrentMovieUri = null;\n }\n cursor.close();\n }\n\n return isFavorite;\n }",
"void setProjectFavourite(int accountId, int projectId, boolean favourite);",
"public void addMovieToFavorites(Movie movie) {\n movie.setFavorite(true);\n isFavorite = true;\n //change the star from gray to yellow\n star.setImageResource(R.drawable.ic_grade_yellow_36px);\n //save the poster in local storage\n String imageName = saveMoviePoster();\n\n //load the necessary movie fields into the ContentValues object\n ContentValues values = new ContentValues();\n values.put(FavoriteMoviesContract.MovieEntry.MOVIEDB_ID, movie.getId());\n values.put(FavoriteMoviesContract.MovieEntry.AVERAGE_VOTE, movie.getVoteAverage());\n values.put(FavoriteMoviesContract.MovieEntry.ORIGINAL_TITLE, movie.getOriginalTitle());\n values.put(FavoriteMoviesContract.MovieEntry.RELEASE_YEAR, movie.getReleaseYear());\n values.put(FavoriteMoviesContract.MovieEntry.RUNTIME, movie.getRuntime());\n values.put(FavoriteMoviesContract.MovieEntry.SYNOPSIS, movie.getSynopsis());\n values.put(FavoriteMoviesContract.MovieEntry.POSTER_IMAGE_NAME, imageName);\n\n //insert the movie into the Favorites db\n Uri uri = getActivity().getContentResolver().\n insert(FavoriteMoviesContract.MovieEntry.CONTENT_URI, values);\n\n if (uri != null) {\n String successMessage = \"You have successfully added \" + movie.getOriginalTitle() +\n \" to the Favorites collection\";\n Toast.makeText(getActivity(), successMessage, Toast.LENGTH_LONG).show();\n }\n }",
"public void setFavortiestate(String favortiestate) {\n this.favortiestate = favortiestate;\n }",
"public boolean isFavorite() {\n return isFavorite;\n }",
"public boolean isFavorite() {\n return isFavorite;\n }",
"@Override\n\tpublic boolean isFavorite() {\n\t\treturn this.isFavorite;\n\t}",
"public void add(FavoriteEntity obj)\n {\n super.add(obj);\n }",
"public void saveFavorites(Context context, List<Recipes> favorites) {\n SharedPreferences settings;\n SharedPreferences.Editor editor;\n\n settings = context.getSharedPreferences(PREFS_NAME,\n Context.MODE_PRIVATE);\n editor = settings.edit();\n\n Gson gson = new Gson();\n String jsonFavorites = gson.toJson(favorites);\n\n editor.putString(FAVORITES, jsonFavorites);\n\n editor.apply();\n }",
"@Override\n public void addProductToFavorites(View view, Intent intent) {\n try {\n if(iProduct != null && view != null && intent != null){\n Context context = view.getContext();\n String jsonProduct = intent.getStringExtra(CommonPresenter.DETAIL_PRODUCT);\n Product product = CommonPresenter.getProductFromJSON(jsonProduct);\n CRUDFavorite crudFavorite = new CRUDFavorite(context);\n boolean isProductExists = crudFavorite.isProductExists(product.getProductId());\n if(isProductExists){\n crudFavorite.deleteByProductId(product.getProductId());\n CommonPresenter.showSnackBarMessage(view, context.getString(R.string.lb_product_delete_to_favorite));\n iProduct.changeImageRightResource(R.drawable.ic_add_to_favorite_32dp);\n }\n else{\n crudFavorite.add(new Favorite(0, product));\n CommonPresenter.showSnackBarMessage(view, context.getString(R.string.lb_product_add_to_favorite));\n iProduct.changeImageRightResource(R.drawable.ic_favorite_32dp);\n }\n }\n }\n catch (Exception ex){\n Log.e(\"TAG_ERROR\", \"ProductPresenter-->addProductToFavorites() : \"+ex.getMessage());\n }\n }",
"public void setFavorite(int favorite) throws Exception {\n if (favorite == 0) {mFavorite = false;}\n else if (favorite == 1) {mFavorite = true;}\n else {throw new Exception(\"Error: Cannot resolve movie 'favorite' \");}\n }",
"public void toggleFavorite() {\n setFavorite(!mFavorite);\n }",
"public boolean insertFavToDB(Favorite favorite) {\n ContentValues contentValues = new ContentValues();\n contentValues.put(mDBAccountString, favorite.getAccount());\n contentValues.put(mDBTitleString, favorite.getTitle());\n contentValues.put(mDBDescString, favorite.getDescription());\n contentValues.put(mDBURLString, favorite.getUrl());\n long rowId = mFavSQLiteDB.insert(\"Favorites\", null, contentValues);\n return rowId != -1; //If insert fails, rowID will equal -1\n }",
"private void removeFromFavorites() {\n favoriteBool = false;\n preferencesConfig.writeRemoveFavoriteTip(shownTipIndex);\n Toast.makeText(getContext(), \"Removed from favorites\", Toast.LENGTH_SHORT).show();\n\n }",
"public void toggleFavorite() {\n\t\tsynchronized (this) {\n\t\t\tif (mFavoritesCache != null) {\n\t\t\t\tmFavoritesCache.toggleSong(getAudioId(), getTrackHost(),\n\t\t\t\t\t\tgetTrackName(), getAlbumName(), getArtistName());\n\t\t\t}\n\t\t}\n\t}",
"public void removeFavorite(){\n //check if movie is in the user favorite list\n if(mMovieStaff.alreadyFavorite(mMovie.getTMDBId())){\n //is in the favorite list, mark that list has changed\n mFavoriteChanged = true;\n\n //update movie item favorite status\n mMovie.setFavorite(false);\n\n //delete movie item from favorite database table\n mMovieValet.deleteFavorite(mMovie);\n\n //remove movie item from favorite movie list buffer\n mMovieStaff.removeFavorite(mMovie);\n }\n\n //check if movie list type is display a favorite list and if the device is a tablet\n if(mMovieType == PosterHelper.NAME_ID_FAVORITE && mIsTablet){\n //both yes, get favorite movies to update poster fragment\n getMovieList(PosterHelper.NAME_ID_FAVORITE);\n }\n }",
"public void saveFavorites(Context context, List<ClassDataGejala> favorites) {\n SharedPreferences settings;\n SharedPreferences.Editor editor;\n\n settings = context.getSharedPreferences(GEJALA,\n Context.MODE_PRIVATE);\n editor = settings.edit();\n\n Gson gson = new Gson();\n String jsonFavorites = gson.toJson(favorites);\n\n editor.putString(GEJALA, jsonFavorites);\n\n editor.commit();\n }",
"public void updateFeedItemAsFavorite(FeedItem item) {\n new updateFeedItemFavoriteAsync(itemDao).execute(item);\n }",
"@RequestMapping(\"/favorites\")\n public String favorites(Model model) {\n // TODO: Get list of all GIFs marked as favorite\n List<Gif> faves = new ArrayList<>();\n\n model.addAttribute(\"gifs\", faves);\n model.addAttribute(\"username\", \"Chris Ramacciotti\"); // Static username\n return \"gif/favorites\";\n }",
"private void getUsersFavorites(String user) throws TwitterException {\n System.out.println(\"##########Getting \".concat(user).concat(\" Likes##########\"));\n List<Status> tweets = twitter.getFavorites(user);\n List<User> topics = new LinkedList<>();\n for (Status status : tweets) {\n\n User userLike = status.getUser();\n if (!user.equals(userLike.getScreenName()))\n topics.add(status.getUser());\n\n }\n addEdgesToGraph(user, topics);\n }",
"private boolean checkIfFavorite() {\n if (favoriteIds.contains(movie.getId())) {\n movie.setFavorite(true);\n return true;\n }\n movie.setFavorite(false);\n return false;\n }",
"public void writeFavorites() {\n ArrayList<String> favorites = new ArrayList<>();\n for(Landmark landmark : landmarks.getFavorites()) {\n favorites.add(landmark.toStringForOutput());\n }\n FileManager.writeLines(favoritesPath, favorites);\n }",
"public static void saveFavourite(Long idRes, Long idUser) {\n\t\tArrayList<Favourite> allFav=loadFavourite();\n\t\tint size=allFav.size()-1;\n\t\tFavourite last=allFav.get(size);\n\t\tLong idLast=last.getIdF();\n\t\tFavourite save=new Favourite(idLast+1,idUser,idRes);\n\t\tallFav.add(save);\n\t\tsaveToFile(allFav);\n\t}",
"void addToFavorites(int recipeId);",
"public void makeFavorite(String title, int favorite)\n {\n SQLiteDatabase db = this.getWritableDatabase();\n\n /* the execSQL Method simply executes this query on the Database, in this Query UPDATE is\n * used to specify the Table Name to Update, SET specifies the Column name to Update in this\n * case COL8 contains favorites and WHERE is the condition in this case it is to make sure\n * that the Movie Title Matches with the given title\n */\n db.execSQL(\n \"UPDATE \" + TABLE_NAME +\n \" SET \" + COL8 + \" = \" + favorite +\n \" WHERE \" + COL2 + \" = '\" + title + \"'\");\n }",
"public void setFavortieid(Integer favortieid) {\n this.favortieid = favortieid;\n }",
"public void onFavouritesPress(View view) {\n\n favouritesDBHandler.addGame(game);\n Toast.makeText(getContext(), game.getName() + \" has been added to your favourites!\", Toast.LENGTH_SHORT).show();\n\n }",
"public static void updateFavorite(String userId, final String foodId, final boolean option, final ImageButton favButton) {\n //get database reference\n final DatabaseReference dbref = FirebaseDatabase.getInstance().getReference(\"users\").child(userId);\n //add eventlistener to reference\n dbref.child(\"favoritesList\").addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n ArrayList<String> updated = new ArrayList<>();\n boolean exists = false;\n for (DataSnapshot favDataSnapshot : dataSnapshot.getChildren()) {\n String fav = favDataSnapshot.getValue(String.class);\n if (!option) {\n if (foodId.equals(fav))\n Log.d(\"favor\", \"this one should be deleted \");\n else\n updated.add(fav);\n } else {\n if (foodId.equals(fav)) {\n exists = true;\n updated.add(fav);\n } else\n updated.add(fav);\n }\n }\n if (!exists && option) {\n favButton.setImageResource(R.drawable.ic_favorite);\n updated.add(foodId);\n }\n else\n favButton.setImageResource(R.drawable.ic_favorite_empty);\n dbref.child(\"favoritesList\").setValue(updated);\n\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n\n }\n });\n }",
"public void changeFavorite(boolean a) {\r\n favorite = a;\r\n }",
"@Override\n\tpublic void getFavorit(int idUser) {\n\t\t\n\t}",
"public void addFavourite(RecipeDbItem1 recipeDbItem1)\n {\n SQLiteDatabase db = this.getWritableDatabase();\n ContentValues values = new ContentValues();\n values.put(KEY_ID,recipeDbItem1.getID());\n values.put(KEY_TITLE,recipeDbItem1.getTitle());\n //insert a row\n db.insert(TABLE_FAVOURITES,null,values);\n db.close();\n //System.out.println(\"\\n Inserted into Favourites Table: \"+recipeDbItem1.getID()+\" \"+recipeDbItem1.getTitle());\n }",
"public void m7904a(boolean favorite) {\n this.f6695h = favorite;\n }",
"boolean isFavorite(int id);",
"private void showFavouriteList() {\n setToolbarText(R.string.title_activity_fave_list);\n showFavouriteIcon(false);\n buildList(getFavourites());\n }",
"public boolean isFavorite() {\n\t\tsynchronized (this) {\n\t\t\tif (mFavoritesCache != null) {\n\t\t\t\treturn mFavoritesCache.isFavoriteSong(getAudioId(),\n\t\t\t\t\t\tgetTrackHost());\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public void setFavorite(Tweet tweet, AsyncHttpResponseHandler handler) {\n String apiUrl = getApiUrl(\"favorites/create.json\");\n RequestParams params = new RequestParams();\n\n params.put(\"id\", String.valueOf(tweet.getTid()));\n\n // Execute the request\n getClient().post(apiUrl, params, handler);\n }",
"@POST(\"/attractions/{attractionId}/favorite\")\n Call<Void> markFavoriteAttraction(\n @Path(\"attractionId\") int attractionId,\n @Header(\"Authorization\") String bearer\n );",
"public void favorite(int index)\n {\n if (latest != null && latest.index == index)\n {\n if (this.showFavorites && !latest.morph.favorite)\n {\n this.toRemove.put(index, new MorphRemove(index, latest.typeIndex));\n this.remove(index);\n }\n\n latest = null;\n }\n }",
"public void saveAsMyFavorite(View v){\n\n MyFavoriteLocations myFavoriteLocation=new MyFavoriteLocations();\n myFavoriteLocation.setMyFavoriteLocations(new Locations(1,titleText, address, descriptionText, budgetText, lt, ln, \"df\"));\n\n myFavoriteLocation.save();\n }",
"@FXML\n private void chooseFavouritePhotoEvent() {\n if (!PhotoManager.getFavouriteList().isEmpty()) {\n User.setGalleryPhotos(PhotoManager.getFavouriteList());\n fadeOutEvent();\n }\n }",
"public void addToFavorites(View view) {\n FirebaseUser currentUser = mAuth.getCurrentUser();\n String uid = currentUser.getUid();\n mDatabase = db.getReference(\"favorites\").child(uid);\n\n ValueEventListener postListener = new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n favorites = dataSnapshot.getValue(Favorites.class);\n favorites.addVolume(currentVolume.getTitle(), currentVolume.getId());\n addToDatabase(favorites);\n Intent intent = new Intent(VolumeActivity.this, FavoritesActivity.class);\n startActivity(intent);\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n // Getting Post failed, log a message\n Log.w(\"FavoritesActivity\", \"loadPost:onCancelled\", databaseError.toException());\n // ...\n }\n\n };\n mDatabase.addListenerForSingleValueEvent(postListener);\n }",
"private boolean checkFavorite(User user, Product product) {\n for (Favorite favorite: favorites) {\n if (favorite.getProduct().getProductName().equals(product.getProductName())\n && favorite.getUser().getUserUID().equals(user.getUserUID())) {\n return true;\n }\n }\n\n return false;\n }",
"@RequestMapping(value = \"/gifs/{gifId}/favorite\", method = RequestMethod.POST)\n public String toggleFavorite(@PathVariable Long gifId, HttpServletRequest request) {\n Gif gif = gifService.findById(gifId);\n gifService.toggleFavorite(gif);\n return String.format(\"redirect:%s\", request.getHeader(\"referer\"));\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == R.id.action_fav) {\n FavoritesDataSource dataSource = new FavoritesDataSource(getBaseContext());\n dataSource.open();\n if(isFav){\n //remove from favorites\n dataSource.deleteFromFavorites(placeid);\n item.setIcon(R.drawable.ic_heart_outline_white);\n Toast.makeText(getBaseContext(),placeName+\" was removed from favorites\",Toast.LENGTH_SHORT).show();\n isFav = false;\n }else{\n //add to favorites\n Place place = new Place(placeid,placeName,address,true,picURL);\n dataSource.addToFavorites(place);\n item.setIcon(R.drawable.ic_heart_fill_white);\n Toast.makeText(getBaseContext(),placeName+\" was added to favorites\",Toast.LENGTH_SHORT).show();\n isFav = true;\n }\n dataSource.close();\n return true;\n }else if(id == R.id.action_share){\n //open twitter url\n String tweetParams = \"text=\"+ URLEncoder.encode(\"Check out \"+placeName+\" located at \"+address+\". Website \")+\"&url=\"+URLEncoder.encode(tweetURL)+\"&hashtags=TravelAndEntertainmentSearch\";\n Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(\"https://twitter.com/intent/tweet?\"+tweetParams));\n startActivity(browserIntent);\n return true;\n }else if(id == android.R.id.home){\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\r\n public void onFavoriteClicked() {\r\n fragFav = new FragmentFavoritesList();\r\n FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();\r\n // Replace whatever is in the fragment_container view with this fragment,\r\n // and add the transaction to the back stack so the user can navigate back\r\n if (getResources().getBoolean(R.bool.isTablet)) {\r\n transaction.add(R.id.listFrag_tab,fragFav, \"FragmentFavoritesList\");\r\n }else {\r\n transaction.add(R.id.activity_main_smart, fragFav, \"FragmentFavoritesList\");\r\n }\r\n transaction.addToBackStack(null);\r\n // Commit the transaction\r\n transaction.commit();\r\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.action_settings) {\r\n if(item.getTitle().equals(\"Add to Favorites\")) {\r\n SharedPreferences commonpreferences = getSharedPreferences(\"Common\", Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor1 = commonpreferences.edit();\r\n\r\n String value1 = url_fav + \" \" + name_fav + \" \" + type_fav;\r\n\r\n\r\n editor1.putString(id_fav, value1);\r\n editor1.commit();\r\n if (type_fav.equals(\"Users\")) {\r\n SharedPreferences userpreferences = getSharedPreferences(\"Users\", Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor = userpreferences.edit();\r\n\r\n String value = url_fav + \" \" + name_fav + \" \" + type_fav;\r\n\r\n\r\n editor.putString(id_fav, value);\r\n editor.commit();\r\n } else if (type_fav.equals(\"Pages\")) {\r\n SharedPreferences pagepreferences = getSharedPreferences(\"Pages\", Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor = pagepreferences.edit();\r\n\r\n String value = url_fav + \" \" + name_fav + \" \" + type_fav;\r\n\r\n\r\n editor.putString(id_fav, value);\r\n editor.commit();\r\n } else if (type_fav.equals(\"Events\")) {\r\n SharedPreferences eventpreferences = getSharedPreferences(\"Events\", Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor = eventpreferences.edit();\r\n\r\n String value = url_fav + \" \" + name_fav + \" \" + type_fav;\r\n\r\n\r\n editor.putString(id_fav, value);\r\n editor.commit();\r\n } else if (type_fav.equals(\"Places\")) {\r\n SharedPreferences placepreferences = getSharedPreferences(\"Places\", Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor = placepreferences.edit();\r\n\r\n String value = url_fav + \" \" + name_fav + \" \" + type_fav;\r\n\r\n\r\n editor.putString(id_fav, value);\r\n editor.commit();\r\n } else if (type_fav.equals(\"Groups\")) {\r\n SharedPreferences grouppreferences = getSharedPreferences(\"Groups\", Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor = grouppreferences.edit();\r\n\r\n String value = url_fav + \" \" + name_fav + \" \" + type_fav;\r\n\r\n\r\n editor.putString(id_fav, value);\r\n editor.commit();\r\n }\r\n\r\n Toast.makeText(getApplicationContext(), \"Added to Favorites\", Toast.LENGTH_LONG).show();\r\n }\r\n else\r\n {\r\n SharedPreferences commonpreferences = getSharedPreferences(\"Common\", Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor1 = commonpreferences.edit();\r\n editor1.remove(id_fav);\r\n editor1.commit();\r\n\r\n if (type_fav.equals(\"Users\")) {\r\n SharedPreferences userpreferences = getSharedPreferences(\"Users\", Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor = userpreferences.edit();\r\n\r\n editor.remove(id_fav);\r\n editor.commit();\r\n } else if (type_fav.equals(\"Pages\")) {\r\n SharedPreferences pagepreferences = getSharedPreferences(\"Pages\", Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor = pagepreferences.edit();\r\n\r\n editor.remove(id_fav);\r\n editor.commit();\r\n } else if (type_fav.equals(\"Events\")) {\r\n SharedPreferences eventpreferences = getSharedPreferences(\"Events\", Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor = eventpreferences.edit();\r\n\r\n editor.remove(id_fav);\r\n editor.commit();\r\n } else if (type_fav.equals(\"Places\")) {\r\n SharedPreferences placepreferences = getSharedPreferences(\"Places\", Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor = placepreferences.edit();\r\n\r\n editor.remove(id_fav);\r\n editor.commit();\r\n } else if (type_fav.equals(\"Groups\")) {\r\n SharedPreferences grouppreferences = getSharedPreferences(\"Groups\", Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor = grouppreferences.edit();\r\n\r\n editor.remove(id_fav);\r\n editor.commit();\r\n }\r\n\r\n\r\n Toast.makeText(getApplicationContext(), \"Removed from Favorites\", Toast.LENGTH_LONG).show();\r\n }\r\n //SharedPreferences.Editor editor = sharedpreferences.edit();\r\n //editor.putString(\"Name\", \"Rachit\");\r\n //SharedPreferences events=getSharedPreferences(\"Events\", Context.MODE_PRIVATE);\r\n //String l=\"-1\";\r\n //String value=events.getString(id_fav,l);\r\n //editor.commit();\r\n return true;\r\n }\r\n else if (id == R.id.share) {\r\n if (ShareDialog.canShow(ShareLinkContent.class)) {\r\n ShareLinkContent linkContent = new ShareLinkContent.Builder()\r\n .setContentUrl(Uri.parse(\"http://developers.facebook.com/android\"))\r\n .build();\r\n shareDialog.show(linkContent);\r\n }\r\n\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }",
"public static boolean checkForFavorite(Context context,String id){\n Set<String> setSavedFav = getAllFavorites(context);\n if(setSavedFav!=null){\n Log.v(TAG,\"SAVED ID: \"+setSavedFav);\n if(setSavedFav.contains(id))\n return true;\n }\n return false;\n }",
"public void onFavoriteChanged(MaterialFavoriteButton buttonView, boolean favorite);",
"public void saveMovieToFavorites() {\n Cursor moviecursor = this.getContentResolver().query(MovieContract.MovieEntry.CONTENT_URI, null, MovieContract.MovieEntry.COLUMN_NAME_MOVIE_ID + \" = \" + mMovie.getID(), null, null, null);\n if(moviecursor.getCount() == 0) { // first time this movie has been favorited insert record\n Uri movieUri = this.getContentResolver().insert(MovieContract.MovieEntry.CONTENT_URI, Constants.createMovieRecord(mMovie));\n long movieid = ContentUris.parseId(movieUri);\n int insertedTrailerCount = this.getContentResolver().bulkInsert(MovieContract.TrailerEntry.CONTENT_URI, Constants.createBulkTrailerValues(Constants.mTrailers, movieid));\n int insertedReviewCount = this.getContentResolver().bulkInsert(MovieContract.ReviewEntry.CONTENT_URI, Constants.createBulkReviewValues(Constants.mReviews, movieid));\n\n if(insertedTrailerCount < 1)\n Log.e(TAG,\"Trailer failed to insert\");\n\n if(insertedReviewCount < 1)\n Log.e(TAG, \" Review failed to insert\");\n }\n }",
"private void addChannelToFavorites(String channel) {\r\n channel = prepareChannel(channel);\r\n if (channel != null) {\r\n settings.setAdd(FAVORITES_SETTING, channel);\r\n }\r\n }",
"@Override\n public void onResume() {\n super.onResume();\n initListFavorite();\n }",
"private void retrieveFavoritesCompleted(ArrayList<MovieItem> movies){\n //get number of favorite movies in the list\n int count = movies.size();\n\n //check if there are any movies\n if(count > 0){\n //save movies to buffer\n mMovieStaff.setMovies(movies, PosterHelper.NAME_ID_FAVORITE);\n }\n\n //check if the current poster fragment is displaying the user favorite list\n if(mMovieType == PosterHelper.NAME_ID_FAVORITE){\n //yes, show new movie list\n showMovieList(movies, PosterHelper.NAME_ID_FAVORITE);\n }\n }",
"public static void findFavourites() {\n DataManager.currentFavouritesList.clear();\n\n for (int i = 0; i < DataManager.fullFavouritesList.size(); i++) {\n Attraction attraction = DataManager.findAttractionByName(DataManager.fullFavouritesList.get(i));\n\n if (attraction != null) {\n DataManager.currentFavouritesList.add(attraction);\n }\n }\n\n FavouritesListFragment.backgroundLayout.setVisibility(DataManager.currentFavouritesList.size() == 0 ? View.VISIBLE : View.INVISIBLE);\n\n AttractionsListFragment.attractionsAdapter.notifyDataSetChanged();\n }",
"public void addBusinessToFavorites(Business business) {\n for(Business b : favorites) {\n if(b.getTitle().equals(business.getTitle()))\n return;\n }\n\n //add business to favorites list.\n favorites.add(business);\n }",
"@Override\n public void onClick(View v) {\n FavouriteDatabase fd = new FavouriteDatabase();\n fd.addToFavouritesList(catID);\n Toast.makeText(getContext(), \"Added to your Favourites\", Toast.LENGTH_SHORT).show();\n }",
"private static Achievement createFavoriteAchievement(){\n\n ArrayList<String> picturesPaths = new ArrayList<>();\n picturesPaths.add(\"favorite_none\");\n picturesPaths.add(\"favorite_bronze\");\n picturesPaths.add(\"favorite_silver\");\n picturesPaths.add(\"favorite_diamond\");\n\n ArrayList<String> picturesLabels = new ArrayList<>();\n picturesLabels.add(\"No favorite\");\n picturesLabels.add(\"Curious Chef\");\n picturesLabels.add(\"Local Chef\");\n picturesLabels.add(\"Library Chef\");\n\n ArrayList<Integer> levelSteps = new ArrayList<>();\n levelSteps.add(1);\n levelSteps.add(10);\n levelSteps.add(50);\n\n Function<User, Integer> getUserNbFavorites = u -> u.getFavourites().size();\n\n return new Achievement(\"favorite\", STANDARD_NB_LEVELS, picturesPaths, picturesLabels, levelSteps, getUserNbFavorites);\n }",
"protected void processFavorite(Map<String,List<PageViewVO>> pages, FavoriteVO fav) {\n\t\ttry {\n\t\t\tcheckCollectionKey(fav.getTypeCd());\n\t\t} catch (Exception e) {\n\t\t\t// this fav is not a 'Section' type so return.\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// convert favorite into a PageViewVO\n\t\tPageViewVO page = new PageViewVO();\n\t\tpage.setReferenceCode(fav.getTypeCd());\n\t\tpage.setPageId(fav.getRelId());\n\t\tpage.setRequestUri(fav.getUriTxt());\n\n\t\tif (fav.getAsset() != null) {\n\t\t\tSolrDocument sDoc = (SolrDocument)fav.getAsset();\n\t\t\tpage.setPageDisplayName(sDoc.getFieldValue(SearchDocumentHandler.TITLE).toString());\n\t\t}\n\n\t\tlog.debug(\"adding favorite: ref cd | pageId | uri | name: \" + page.getReferenceCode() +\"|\"+page.getPageId() +\"|\"+page.getRequestUri() +\"|\"+page.getPageDisplayName());\n\n\t\tList<PageViewVO>pList = pages.get(page.getReferenceCode());\n\t\tif (pList != null)\n\t\t\tpList.add(page);\n\t}",
"public Profile(String username, String password) {\n favorites = new ArrayList();\n this.username = username;\n this.password = password;\n }",
"public void setFavSite(final String favSite){\n\t\tthis.favSite = favSite;\n\t}",
"public void addFavorite(String google_id, String store_name, Integer account_id){\r\n Map<String, String> params = new HashMap<>();\r\n params.put(\"google_id\", google_id);\r\n params.put(\"name\", store_name);\r\n params.put(\"account_id\", String.valueOf(account_id));\r\n String url = API_DOMAIN + STORE_EXT + ADD_FAVORITE_ACTION;\r\n this.makeVolleyRequest( url, params );\r\n }",
"@Override\n\tpublic int updateFavoriteVO(FavoriteVO vo) {\n\t\treturn 0;\n\t}",
"public void clickFavoritesLink()\n\t{\n \telementUtils.performElementClick(wbFavoritesLink);\n\t}",
"@Override\n\tpublic void onCreate(final Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tthis.datasource = super.getDatasource();\n\t\tthis.context = super.getContext();\n\n\t\tthis.setContentView(R.layout.add_or_edit_favorite);\n\n\t\t// get values of calling activity\n\t\tfinal int selectedFavoriteId = this.getIntent().getIntExtra(DBConstants.COL_FAVORITE_ID, -1);\n\t\tfinal String selectedFavoriteName = this.getIntent().getStringExtra(DBConstants.COL_FAVORITE_NAME);\n\n\t\t// set the title to match the activity\n\t\tthis.textViewTitle = (TextView) this.findViewById(R.id.titleAddFavorite);\n\t\tthis.textViewTitle.setText(R.string.title_edit_name_favoritelist);\n\n\t\tthis.editTextFavoriteName = (EditText) this.findViewById(R.id.editTextNameAddFavoritelist);\n\t\tthis.editTextFavoriteName.setText(selectedFavoriteName);\n\t\tthis.editTextFavoriteName.addTextChangedListener(super.getTextWatcher(R.id.editTextNameAddFavoritelist));\n\n\t\tthis.buttonEditFavorite = (Button) this.findViewById(R.id.buttonConfirmAddFavoritelist);\n\t\tthis.buttonEditFavorite.setText(R.string.button_text_save);\n\n\t\tthis.buttonEditFavorite.setOnClickListener(new OnClickListener() {\n\n\t\t\tpublic void onClick(final View v) {\n\t\t\t\tif (EditFavoriteActivity.super.setErrorOnEmptyEditTexts(editTextIds)) {\n\n\t\t\t\t\t// check whether there is already a favoritelist with this\n\t\t\t\t\t// name\n\t\t\t\t\tfinal Favorite alreadyExistingFavorite = EditFavoriteActivity.this.datasource\n\t\t\t\t\t\t\t.getFavoriteByName(EditFavoriteActivity.this.editTextFavoriteName.getText().toString());\n\n\t\t\t\t\tif (alreadyExistingFavorite == null) {\n\n\t\t\t\t\t\tfinal Favorite favoriteToUpdate = new Favorite();\n\t\t\t\t\t\tfavoriteToUpdate.setId(selectedFavoriteId);\n\t\t\t\t\t\tfavoriteToUpdate.setName(EditFavoriteActivity.this.editTextFavoriteName.getText().toString());\n\n\t\t\t\t\t\tEditFavoriteActivity.this.datasource.updateFavorite(favoriteToUpdate);\n\t\t\t\t\t\tEditFavoriteActivity.this.finish();\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tToast.makeText(EditFavoriteActivity.this.context,\n\t\t\t\t\t\t\t\tEditFavoriteActivity.this.getString(R.string.msg_favorite_already_exists), Toast.LENGTH_SHORT)\n\t\t\t\t\t\t\t\t.show();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}",
"private void initListFavorite() {\n favoritesList = mApiService.getFavorites();\n mRecyclerView.setAdapter(new MyNeighbourRecyclerViewAdapter(favoritesList, this));\n }",
"public static void readFavorites(String userId, final ListView favoritesList, final Context context) {\n //get database reference\n DatabaseReference dbref = FirebaseDatabase.getInstance().getReference(\"users\").child(userId);\n //add eventlistener to reference\n dbref.child(\"favoritesList\").addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n\n\n ArrayList<String> favs = new ArrayList<>();\n\n for (DataSnapshot favDataSnapshot : dataSnapshot.getChildren()) {\n String fav = favDataSnapshot.getValue(String.class);\n favs.add(fav);\n }\n FoodController.readFavoriteFoods(favoritesList, context, favs);\n\n\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n\n }\n });\n }",
"public long addMovieToFavorites(long movieId) {\n if (!isMovieIsFavorite(movieId)) {\n SQLiteDatabase database = this.getWritableDatabase();\n ContentValues values = insertFavoriteMovieIntoContentValues(movieId);\n long rowId = database.insert(FavoriteMoviesEntry.TABLE_NAME, null, values);\n database.close();\n return rowId;\n } else return 0;\n }",
"private boolean isFavorite() {\n for (int favoriteIndex : favoriteIndexes) {\n if (favoriteIndex == shownTipIndex) {\n return true;\n }\n }\n return false;\n }",
"public void onClicklistenerForFavorites(View view){\n if(isAlreadyFavorteis() == true){\n Boolean hasDeleted = dBhelper.deleteFavortiesByCategoryId(userAskAbout,inputSpinnerOne.getSelectedItemPosition(),inputSpinnertow.getSelectedItemPosition());\n if(hasDeleted == true) {\n Toast.makeText(getApplicationContext(), \"Your data has deleted in Favorties\", Toast.LENGTH_LONG).show();\n favortiesImageView.setBackgroundResource(R.drawable.ic_favourites);\n isAlreadyFavorties = false;\n }\n\n }else\n {\n favortiesMethed();\n isAlreadyFavorties = true;\n favortiesImageView.setBackgroundResource(R.drawable.ic_favourites_pressed);\n }\n\n }",
"private void setupFavoritesListView() {\n ListView listFavorites = (ListView) findViewById(R.id.list_favorites);\n try{\n PlayerDatabaseHelper PlayerDatabaseHelper = new PlayerDatabaseHelper(this);\n db = PlayerDatabaseHelper.getReadableDatabase();\n\n favoritesCursor = db.rawQuery(\"WITH sel_Players(P_id) As (Select player_id FROM SELECTION, USER WHERE NAME = ? AND _id = user_id) SELECT _id, NAME FROM PLAYER, sel_Players WHERE P_id = _id\", new String[] {User.getUName()});\n\n CursorAdapter favoriteAdapter =\n new SimpleCursorAdapter(TopLevelActivity.this,\n android.R.layout.simple_list_item_1,\n favoritesCursor,\n new String[]{\"NAME\"},\n new int[]{android.R.id.text1}, 0);\n listFavorites.setAdapter(favoriteAdapter);\n db.close();\n } catch(SQLiteException e) {\n Toast toast = Toast.makeText(this, \"Database unavailable\", Toast.LENGTH_SHORT);\n toast.show();\n }\n\n listFavorites.setOnItemClickListener(new AdapterView.OnItemClickListener() {\n @Override\n public void onItemClick(AdapterView<?> listView, View v, int position, long id) {\n Intent intent = new Intent(TopLevelActivity.this, forward.class);\n intent.putExtra(forward.EXTRA_PLAYERID, (int)id);\n startActivity(intent);\n }\n });\n }",
"public boolean favouriteCurrentAccount()\n {\n if(accountInfo == null)\n {\n System.out.println(\"You need to generate an account before getting the details.\");\n return false;\n }\n return accountInfo.favouriteAccount();\n }",
"@Override\n public void FavouriteMovieSelected(View view) {\n if(view.getTag().equals(MovieDetailAdapter.FAVOURITE)) {\n StoreFavoriteMovieIntentService.startAction_ADD_FAV_MOVIE(getActivity(),\n mMovieItem,\n movieDeatailAdapter.getmMovieItemDetail());\n } else {\n StoreFavoriteMovieIntentService.removeFavriteMovie(getActivity(),mMovieItem.getId());\n }\n movieDeatailAdapter.notifyDataSetChanged();\n }",
"public Optional<User> favoriteSocialNetwork(Long id, FavouriteNetworkDTO favouriteNetwork) {\n\t\t// Usuario\n\t\tOptional<User> userOptional = userRepository.findById(id);\n\n\t\tif (!userOptional.isPresent()) {\n\t\t\treturn Optional.empty();\n\t\t}\n\n\t\tUser user = userOptional.get();\n\n\t\t// Red Social\n\t\tOptional<SocialNetwork> socialNetworkOptional = socialNetworkRespository.findById(favouriteNetwork.getFavourite());\n\n\t\tif (!socialNetworkOptional.isPresent()) {\n\t\t\treturn Optional.empty();\n\t\t}\n\n\t\tSocialNetwork socialNetwork = socialNetworkOptional.get();\n\n\t\t// Actualizacion de la Red Social Favorita\n\t\tuser.setFavouriteNetwork(socialNetwork);\n\t\tuserRepository.save(user);\n\n\t\treturn Optional.of(user);\n\t}",
"public static void add(UserBookmark userBookmark) {\n\t\tuserBookmarks[bookmarkIndex++]=userBookmark;\n\t\n}",
"public void addToWish( String product_id, String product_name,String product_brand, String product_img,\n String product_price,String product_desc, String product_discount, String product_varieties )\n {\n boolean isAdded = mDatabaseFavorite.insert(product_id, product_name,product_brand, product_img,\n product_price,product_discount);\n\n if (isAdded == true)\n {\n Toast.makeText(DetailActivity.this,\"Added to Favorite\",Toast.LENGTH_SHORT).show();\n\n }\n\n else {\n\n Toast.makeText(DetailActivity.this,\"Already present in favoriteList\",Toast.LENGTH_SHORT).show();\n\n }\n\n }",
"public void setFavTitle(final String favTitle){\n\t\tthis.favTitle = favTitle;\n\t}",
"@FXML\n private void toggleFavorite() {\n raise(new ToggleFavoritePersonEvent(id.getText().substring(0, id.getText().indexOf(\".\"))));\n }"
] | [
"0.77086014",
"0.7406009",
"0.687075",
"0.6849626",
"0.6807747",
"0.6779497",
"0.6711759",
"0.66945547",
"0.6654614",
"0.66383135",
"0.6448181",
"0.63991416",
"0.63472766",
"0.6326491",
"0.62361073",
"0.6200467",
"0.61936903",
"0.61606294",
"0.61341465",
"0.61148643",
"0.60815495",
"0.60581094",
"0.604958",
"0.6048997",
"0.60480714",
"0.604238",
"0.6036985",
"0.6011306",
"0.5993345",
"0.5993345",
"0.59838855",
"0.5969702",
"0.5962718",
"0.59514934",
"0.5948596",
"0.5945271",
"0.5920231",
"0.5869354",
"0.5869228",
"0.58406943",
"0.5823763",
"0.582368",
"0.5811967",
"0.57953763",
"0.5787298",
"0.5781231",
"0.5779593",
"0.5756218",
"0.57280284",
"0.56864285",
"0.5667753",
"0.56624216",
"0.5662131",
"0.5661516",
"0.56603175",
"0.56546897",
"0.5645677",
"0.5635206",
"0.5590512",
"0.5578009",
"0.5569486",
"0.5564953",
"0.5545495",
"0.55445373",
"0.5528886",
"0.5528345",
"0.55183446",
"0.550842",
"0.5505061",
"0.5503342",
"0.5500178",
"0.5474699",
"0.54679555",
"0.54590505",
"0.5449282",
"0.5411137",
"0.5410189",
"0.54081905",
"0.54069954",
"0.5405001",
"0.5361315",
"0.5347541",
"0.5342254",
"0.5341678",
"0.5337309",
"0.5333355",
"0.5326057",
"0.5314297",
"0.53141254",
"0.5297959",
"0.52943015",
"0.52772593",
"0.5270136",
"0.52622396",
"0.5254157",
"0.5248101",
"0.52459186",
"0.52422154",
"0.5227352",
"0.5222844"
] | 0.6519714 | 10 |
Updates the appropriate Favorite collection on the session. | @SuppressWarnings("unchecked")
protected void updateSessionFavorites(SMTSession session, PageViewVO fav, boolean isDelete) {
// get the Favs map off of the session.
Map<String,List<PageViewVO>> favMap = (Map<String,List<PageViewVO>>)session.getAttribute(MyFavoritesAction.MY_FAVORITES);
List<PageViewVO> favs = favMap.get(fav.getReferenceCode());
if (favs == null) favs = new ArrayList<>();
if (isDelete) {
// remove fav
removeFromSession(favs, fav.getPageId());
} else {
// add fav
favs.add(fav);
}
// replace the favs map on the session.
session.setAttribute(MyFavoritesAction.MY_FAVORITES, favMap);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void saveFavorite(){\n //make sure movie is NOT already a favorite\n if(!mMovieStaff.alreadyFavorite(mMovie.getTMDBId())){\n //is a new favorite, favorite movie list status has changed\n mFavoriteChanged = true;\n\n //set movie item favorite status as true\n mMovie.setFavorite(true);\n\n //save movie to favorite database table\n mMovieValet.saveFavorite(mMovie);\n\n //add movie to favorite movie list buffer\n mMovieStaff.addFavorite(mMovie);\n }\n\n //check if movie list type is display a favorite list and if the device is a tablet\n if(mMovieType == PosterHelper.NAME_ID_FAVORITE && mIsTablet){\n //both yes, get favorite movies to update poster fragment\n getMovieList(PosterHelper.NAME_ID_FAVORITE);\n }\n }",
"protected void updateProfileFavorites(ActionRequest req, PageViewVO fav) throws ActionException {\n\t\tlog.debug(\"updateProfileFavorites...\");\n\n\t\tMyFavoritesAction mfa = new MyFavoritesAction(getActionInit());\n\t\tmfa.setAttributes(getAttributes());\n\t\tmfa.setDBConnection(dbConn);\n\n\t\tboolean isDelete = Convert.formatBoolean(req.getParameter(\"isDelete\"));\n\t\tif (isDelete) {\n\t\t\tmfa.deleteFavorite(req);\n\t\t} else {\n\t\t\t// set additional req params needed for inserts.\n\t\t\treq.setParameter(QuickLinksAction.PARAM_KEY_TYPE_CD, fav.getReferenceCode());\n\t\t\treq.setParameter(QuickLinksAction.PARAM_KEY_REL_ID, fav.getPageId());\n\t\t\tmfa.insertFavorite(req);\n\t\t}\n\n\t\tupdateSessionFavorites(req.getSession(),fav,isDelete);\n\n\t}",
"public final void resetFavorites() {\n Favorites favorites = Favorites.INSTANCE;\n favorites.clear();\n favorites.load(this.persistenceWrapper.readFavorites());\n }",
"private void addToFavorites() {\n\n favoriteBool = true;\n preferencesConfig.writeAddFavoriteTip(shownTipIndex);\n Toast.makeText(getContext(), \"Added to favorites.\", Toast.LENGTH_SHORT).show();\n\n }",
"@Override\n\tpublic int updateFavoriteVO(FavoriteVO vo) {\n\t\treturn 0;\n\t}",
"public static void findFavourites() {\n DataManager.currentFavouritesList.clear();\n\n for (int i = 0; i < DataManager.fullFavouritesList.size(); i++) {\n Attraction attraction = DataManager.findAttractionByName(DataManager.fullFavouritesList.get(i));\n\n if (attraction != null) {\n DataManager.currentFavouritesList.add(attraction);\n }\n }\n\n FavouritesListFragment.backgroundLayout.setVisibility(DataManager.currentFavouritesList.size() == 0 ? View.VISIBLE : View.INVISIBLE);\n\n AttractionsListFragment.attractionsAdapter.notifyDataSetChanged();\n }",
"public void addToFavorites() {\n\n // Create new content values object\n ContentValues contentValues = new ContentValues();\n\n contentValues.put(FavMovieEntry.COLUMN_MOVIE_ID, sMovie.getMovieId());\n contentValues.put(FavMovieEntry.COLUMN_MOVIE_TITLE, sMovie.getMovieTitle());\n contentValues.put(FavMovieEntry.COLUMN_MOVIE_ORIGINAL_TITLE, sMovie.getMovieOriginalTitle());\n contentValues.put(FavMovieEntry.COLUMN_POSTER_PATH, sMovie.getPoster());\n contentValues.put(FavMovieEntry.COLUMN_BACKDROP_PATH, sMovie.getMovieBackdrop());\n contentValues.put(FavMovieEntry.COLUMN_MOVIE_RELEASE_DATE, sMovie.getReleaseDate());\n contentValues.put(FavMovieEntry.COLUMN_MOVIE_RATING, sMovie.getVoteAverage());\n contentValues.put(FavMovieEntry.COLUMN_MOVIE_SYNOPSIS, sMovie.getPlotSynopsis());\n\n try {\n mCurrentMovieUri = getContentResolver().insert(FavMovieEntry.CONTENT_URI,\n contentValues);\n } catch (IllegalArgumentException e) {\n mCurrentMovieUri = null;\n Log.v(LOG_TAG, e.toString());\n }\n\n if (mCurrentMovieUri != null) {\n isAddedToFavorites();\n }\n\n }",
"public void toggleFavorite() {\n\t\tsynchronized (this) {\n\t\t\tif (mFavoritesCache != null) {\n\t\t\t\tmFavoritesCache.toggleSong(getAudioId(), getTrackHost(),\n\t\t\t\t\t\tgetTrackName(), getAlbumName(), getArtistName());\n\t\t\t}\n\t\t}\n\t}",
"private boolean checkIfFavorite() {\n if (favoriteIds.contains(movie.getId())) {\n movie.setFavorite(true);\n return true;\n }\n movie.setFavorite(false);\n return false;\n }",
"public void toggleFavorites()\n {\n this.showFavorites = !this.showFavorites;\n this.setupMorphs(Morphing.get(this.mc.thePlayer));\n }",
"public void saveFavorites(Context context, List<Recipes> favorites) {\n SharedPreferences settings;\n SharedPreferences.Editor editor;\n\n settings = context.getSharedPreferences(PREFS_NAME,\n Context.MODE_PRIVATE);\n editor = settings.edit();\n\n Gson gson = new Gson();\n String jsonFavorites = gson.toJson(favorites);\n\n editor.putString(FAVORITES, jsonFavorites);\n\n editor.apply();\n }",
"@Override\n\tpublic void addFavorit(FavorisImpl newfavorit) {\n\t\t\n\t}",
"public void saveFavorites(Context context, List<ClassDataGejala> favorites) {\n SharedPreferences settings;\n SharedPreferences.Editor editor;\n\n settings = context.getSharedPreferences(GEJALA,\n Context.MODE_PRIVATE);\n editor = settings.edit();\n\n Gson gson = new Gson();\n String jsonFavorites = gson.toJson(favorites);\n\n editor.putString(GEJALA, jsonFavorites);\n\n editor.commit();\n }",
"public void removeFavorite(){\n //check if movie is in the user favorite list\n if(mMovieStaff.alreadyFavorite(mMovie.getTMDBId())){\n //is in the favorite list, mark that list has changed\n mFavoriteChanged = true;\n\n //update movie item favorite status\n mMovie.setFavorite(false);\n\n //delete movie item from favorite database table\n mMovieValet.deleteFavorite(mMovie);\n\n //remove movie item from favorite movie list buffer\n mMovieStaff.removeFavorite(mMovie);\n }\n\n //check if movie list type is display a favorite list and if the device is a tablet\n if(mMovieType == PosterHelper.NAME_ID_FAVORITE && mIsTablet){\n //both yes, get favorite movies to update poster fragment\n getMovieList(PosterHelper.NAME_ID_FAVORITE);\n }\n }",
"public void favouriteUser() {\r\n\t\tif(favourited) {\r\n\t\t\tcurrentUser.unfavouriteUser(userToView.getUserID());\r\n\t\t\tfavouriteButton.setText(\"Favourite\");\r\n\t\t\tfavourited = false;\r\n\t\t} else if(currentUser.getUserID() != userToView.getUserID()){\r\n\t\t\tcurrentUser.favouriteUser(userToView.getUserID());\r\n\t\t\tfavouriteButton.setText(\"Unfavourite\");\r\n\t\t\tfavourited = true;\r\n\t\t} else {\r\n\t\t\tCONSTANTS.makeAlertWindow(\"warning\",\"You can not favorite yourself!\");\r\n\t\t}\r\n\t}",
"public void setFavorite(boolean favorite) {\n this.favorite = favorite;\n }",
"public void saveMovieToFavorites() {\n Cursor moviecursor = this.getContentResolver().query(MovieContract.MovieEntry.CONTENT_URI, null, MovieContract.MovieEntry.COLUMN_NAME_MOVIE_ID + \" = \" + mMovie.getID(), null, null, null);\n if(moviecursor.getCount() == 0) { // first time this movie has been favorited insert record\n Uri movieUri = this.getContentResolver().insert(MovieContract.MovieEntry.CONTENT_URI, Constants.createMovieRecord(mMovie));\n long movieid = ContentUris.parseId(movieUri);\n int insertedTrailerCount = this.getContentResolver().bulkInsert(MovieContract.TrailerEntry.CONTENT_URI, Constants.createBulkTrailerValues(Constants.mTrailers, movieid));\n int insertedReviewCount = this.getContentResolver().bulkInsert(MovieContract.ReviewEntry.CONTENT_URI, Constants.createBulkReviewValues(Constants.mReviews, movieid));\n\n if(insertedTrailerCount < 1)\n Log.e(TAG,\"Trailer failed to insert\");\n\n if(insertedReviewCount < 1)\n Log.e(TAG, \" Review failed to insert\");\n }\n }",
"public void setFavorite(boolean favorite) {\n isFavorite = favorite;\n }",
"@RequestMapping(\"/favorites\")\n public String favorites(Model model) {\n // TODO: Get list of all GIFs marked as favorite\n List<Gif> faves = new ArrayList<>();\n\n model.addAttribute(\"gifs\", faves);\n model.addAttribute(\"username\", \"Chris Ramacciotti\"); // Static username\n return \"gif/favorites\";\n }",
"public void updateFeedItemAsFavorite(FeedItem item) {\n new updateFeedItemFavoriteAsync(itemDao).execute(item);\n }",
"@Override\n public void onFavoriteDatabaseChanged() {\n //setCategoryCount(FileCategory.Favorite, mFavoriteList.getCount());\n }",
"void updateFavor(HouseFavor houseFavor);",
"private void addToDatabase(Favorites favorites) {\n FirebaseUser currentUser = mAuth.getCurrentUser();\n String uid = currentUser.getUid();\n mDatabase = db.getReference();\n\n mDatabase.child(\"favorites\").child(uid).setValue(favorites);\n }",
"public boolean isAlreadyFavorited(){\r\n if(ui.isIsUserAuthenticated()){\r\n Users user = ui.getUser();\r\n if(user.getFavorites() != null){\r\n return user.getFavorites().contains(recipe);\r\n }\r\n else{\r\n return false;\r\n }\r\n }\r\n else{\r\n return false;\r\n }\r\n }",
"private void initListFavorite() {\n favoritesList = mApiService.getFavorites();\n mRecyclerView.setAdapter(new MyNeighbourRecyclerViewAdapter(favoritesList, this));\n }",
"public static void updateFavorite(String userId, final String foodId, final boolean option, final ImageButton favButton) {\n //get database reference\n final DatabaseReference dbref = FirebaseDatabase.getInstance().getReference(\"users\").child(userId);\n //add eventlistener to reference\n dbref.child(\"favoritesList\").addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n ArrayList<String> updated = new ArrayList<>();\n boolean exists = false;\n for (DataSnapshot favDataSnapshot : dataSnapshot.getChildren()) {\n String fav = favDataSnapshot.getValue(String.class);\n if (!option) {\n if (foodId.equals(fav))\n Log.d(\"favor\", \"this one should be deleted \");\n else\n updated.add(fav);\n } else {\n if (foodId.equals(fav)) {\n exists = true;\n updated.add(fav);\n } else\n updated.add(fav);\n }\n }\n if (!exists && option) {\n favButton.setImageResource(R.drawable.ic_favorite);\n updated.add(foodId);\n }\n else\n favButton.setImageResource(R.drawable.ic_favorite_empty);\n dbref.child(\"favoritesList\").setValue(updated);\n\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n\n }\n });\n }",
"public void backToPosters(){\n //check if favorite list is going to be displayed or if favorite list has changed\n if(mMovieType == PosterHelper.NAME_ID_FAVORITE && mFavoriteChanged){\n //refresh favorite list\n showMovieList(mMovieStaff.getMovies(PosterHelper.NAME_ID_FAVORITE),\n PosterHelper.NAME_ID_FAVORITE);\n }\n }",
"private void setupFavoritesListView() {\n ListView listFavorites = (ListView) findViewById(R.id.list_favorites);\n try{\n PlayerDatabaseHelper PlayerDatabaseHelper = new PlayerDatabaseHelper(this);\n db = PlayerDatabaseHelper.getReadableDatabase();\n\n favoritesCursor = db.rawQuery(\"WITH sel_Players(P_id) As (Select player_id FROM SELECTION, USER WHERE NAME = ? AND _id = user_id) SELECT _id, NAME FROM PLAYER, sel_Players WHERE P_id = _id\", new String[] {User.getUName()});\n\n CursorAdapter favoriteAdapter =\n new SimpleCursorAdapter(TopLevelActivity.this,\n android.R.layout.simple_list_item_1,\n favoritesCursor,\n new String[]{\"NAME\"},\n new int[]{android.R.id.text1}, 0);\n listFavorites.setAdapter(favoriteAdapter);\n db.close();\n } catch(SQLiteException e) {\n Toast toast = Toast.makeText(this, \"Database unavailable\", Toast.LENGTH_SHORT);\n toast.show();\n }\n\n listFavorites.setOnItemClickListener(new AdapterView.OnItemClickListener() {\n @Override\n public void onItemClick(AdapterView<?> listView, View v, int position, long id) {\n Intent intent = new Intent(TopLevelActivity.this, forward.class);\n intent.putExtra(forward.EXTRA_PLAYERID, (int)id);\n startActivity(intent);\n }\n });\n }",
"public void setFavoriteInRecyclerView(){\n favoriteViewModel = new ViewModelProvider(requireActivity(), AoE2DecencyInjector.getViewModelFactory()).get(FavoriteViewModel.class);\n favoriteViewModel.getFavoritesCivilizations().observe(getViewLifecycleOwner(), new Observer<List<CivilizationFavoriteItemViewModel>>() {\n @Override\n public void onChanged(List<CivilizationFavoriteItemViewModel> civilizationFavoriteItemViewModels) {\n civilizationFavoriteAdapter.setListItemViewModels(civilizationFavoriteItemViewModels);\n }\n });\n\n favoriteViewModel.getCivAdd().observe(getViewLifecycleOwner(), new Observer<Event<String>>() {\n @Override\n public void onChanged(Event<String> stringEvent) {\n //Do nothing\n }\n });\n\n favoriteViewModel.getCivRem().observe(getViewLifecycleOwner(), new Observer<Event<String>>() {\n @Override\n public void onChanged(Event<String> stringEvent) {\n //Do nothing\n }\n });\n }",
"public void setToFavorite(boolean favorite) {\n this.isFavorite = favorite;\n }",
"private boolean isAddedToFavorites() {\n boolean isFavorite = false;\n\n String[] projection = {FavMovieEntry.COLUMN_MOVIE_ID};\n String selection = FavMovieEntry.COLUMN_MOVIE_ID + \"=?\";\n String[] selectionArgs = new String[]{\n String.valueOf(sMovie.getMovieId())};\n\n Cursor cursor = this.getContentResolver().query(\n FavMovieEntry.CONTENT_URI,\n projection,\n selection,\n selectionArgs,\n null\n );\n\n if (cursor != null && cursor.moveToFirst()) {\n if (cursor.getCount() > 0) {\n isFavorite = true;\n long currentIndex = cursor.getLong(cursor.getColumnIndex(FavMovieEntry.COLUMN_MOVIE_ID));\n mCurrentMovieUri = ContentUris.withAppendedId(FavMovieEntry.CONTENT_URI, currentIndex);\n } else {\n isFavorite = false;\n\n mCurrentMovieUri = null;\n }\n cursor.close();\n }\n\n return isFavorite;\n }",
"void addToFavorites(int recipeId);",
"@RequestMapping(\"/favorites\")\n public String favorites(ModelMap modelMap) {\n List<Gif> gifs = gifRepo.findFavorites();\n modelMap.put(\"gifs\", gifs);\n return \"favorites\";\n }",
"public void writeFavorites() {\n ArrayList<String> favorites = new ArrayList<>();\n for(Landmark landmark : landmarks.getFavorites()) {\n favorites.add(landmark.toStringForOutput());\n }\n FileManager.writeLines(favoritesPath, favorites);\n }",
"private void retrieveFavoritesCompleted(ArrayList<MovieItem> movies){\n //get number of favorite movies in the list\n int count = movies.size();\n\n //check if there are any movies\n if(count > 0){\n //save movies to buffer\n mMovieStaff.setMovies(movies, PosterHelper.NAME_ID_FAVORITE);\n }\n\n //check if the current poster fragment is displaying the user favorite list\n if(mMovieType == PosterHelper.NAME_ID_FAVORITE){\n //yes, show new movie list\n showMovieList(movies, PosterHelper.NAME_ID_FAVORITE);\n }\n }",
"private ArrayList<MovieItem> getFavoriteMovies(){\n //get list of favorite movies from buffer\n ArrayList<MovieItem> movies = mMovieStaff.getMovies(PosterHelper.NAME_ID_FAVORITE);\n\n //check if favorite movie list has changed\n if(mFavoriteChanged){\n //list has changed, show new movie list\n showMovieList(movies, PosterHelper.NAME_ID_FAVORITE);\n }\n\n //return movie list\n return movies;\n }",
"public void toggleFavorite() {\n setFavorite(!mFavorite);\n }",
"public interface IFavoriteService {\n\n\tList<Favorite> getFavorites();\n\n\tList<Favorite> getFavoritesByGenre(GenreType genreType);\n\n\tList<Favorite> getFavoritesByParent(FavoriteCategory parent);\n\n\tList<Favorite> getFavoritesByParentId(int parentId);\n\n\tList<Favorite> getFavoritesByRate(int rate);\n\n\tList<Favorite> getFavoritesByBackupStatus(boolean isBackup);\n\n\tList<Favorite> getFavoritesByModifyStatus(boolean isModified);\n\n\tint getFavoriteCountInRate(int rate);\n\n\tint getFavoriteCountInCategory(int parentId);\n\n\tvoid delete(Favorite favorite);\n\n\tvoid delete(List<Favorite> favorites);\n\n\tvoid update(Favorite favorite);\n\n\tvoid update(List<Favorite> favorites);\n\n\tvoid insert(Favorite favorite);\n\n\tvoid insert(List<Favorite> favorites);\n\n\tList<FavoriteCategory> getFavoriteCategories();\n\n\tList<FavoriteCategory> getFavoriteCategoriesByRate(int rate);\n\n\tList<FavoriteCategory> getFavoriteCategoriesByBackupStatus(boolean isBackup);\n\n\tList<FavoriteCategory> getFavoriteCategoriesByModifyStatus(boolean isModified);\n\n\tvoid insertCategory(FavoriteCategory category);\n\n\tvoid insertCategory(List<FavoriteCategory> categories);\n\n\tvoid updateCategory(FavoriteCategory category);\n\n\tvoid updateCategories(List<FavoriteCategory> categories);\n\n\tvoid deleteCategory(FavoriteCategory category);\n\n\tvoid deleteCategories(List<FavoriteCategory> categories);\n}",
"public void updateFavorited(UserProfile up, String itemCode, Boolean madeIt) {\n ConnectionPool pool = ConnectionPool.getInstance();\n Connection connection = pool.getConnection();\n PreparedStatement ps = null;\n\n String query = \"UPDATE userItems \"\n + \"SET madeIt = ? \"\n + \"WHERE itemCode = ?\";\n try {\n ps = connection.prepareStatement(query);\n ps.setBoolean(1, madeIt);\n ps.setString(2, itemCode);\n\n ps.executeUpdate();\n } catch (SQLException se) {\n System.out.println(\"ERROR: Could not execute SQL statement in: \" + \"Item.changeRating()\");\n System.out.println(\"ERROR: Could not execute SQL statement: \" + se);\n } finally {\n DBUtil.closePreparedStatement(ps);\n pool.freeConnection(connection);\n }\n up.updateFav(itemCode, madeIt);\n }",
"public void saveFavoritesID(ArrayList<String> idList) {\n\n\t\tSAVE_FILE = FAVORITE_FILE;\n\t\tsaveIds(idList);\n\t}",
"public void addMovieToFavorites(Movie movie) {\n movie.setFavorite(true);\n isFavorite = true;\n //change the star from gray to yellow\n star.setImageResource(R.drawable.ic_grade_yellow_36px);\n //save the poster in local storage\n String imageName = saveMoviePoster();\n\n //load the necessary movie fields into the ContentValues object\n ContentValues values = new ContentValues();\n values.put(FavoriteMoviesContract.MovieEntry.MOVIEDB_ID, movie.getId());\n values.put(FavoriteMoviesContract.MovieEntry.AVERAGE_VOTE, movie.getVoteAverage());\n values.put(FavoriteMoviesContract.MovieEntry.ORIGINAL_TITLE, movie.getOriginalTitle());\n values.put(FavoriteMoviesContract.MovieEntry.RELEASE_YEAR, movie.getReleaseYear());\n values.put(FavoriteMoviesContract.MovieEntry.RUNTIME, movie.getRuntime());\n values.put(FavoriteMoviesContract.MovieEntry.SYNOPSIS, movie.getSynopsis());\n values.put(FavoriteMoviesContract.MovieEntry.POSTER_IMAGE_NAME, imageName);\n\n //insert the movie into the Favorites db\n Uri uri = getActivity().getContentResolver().\n insert(FavoriteMoviesContract.MovieEntry.CONTENT_URI, values);\n\n if (uri != null) {\n String successMessage = \"You have successfully added \" + movie.getOriginalTitle() +\n \" to the Favorites collection\";\n Toast.makeText(getActivity(), successMessage, Toast.LENGTH_LONG).show();\n }\n }",
"public void onClicked() {\n mypreference = PreferenceManager.getDefaultSharedPreferences(getContext());\n SharedPreferences.Editor editorpref = mypreference.edit();\n Gson gson = new Gson();\n //retrieve the stored ArrayList of fovorite movies as json format\n String storedJsonList = mypreference.getString(\"storedjsonList\", \"\");\n // get the type of this json format\n Type type = new TypeToken<ArrayList<ItemsClass>>() {\n }.getType();\n ArrayList<ItemsClass> movieArrayList = new ArrayList<ItemsClass>();\n //create array list of the retrieved json\n // store it in my Arraylist\n movieArrayList = gson.fromJson(storedJsonList, type);\n\n// favo.setSelected(va[0]);\n ischecked = va[0];\n if (va[0] == true) {\n\n if (movieArrayList == null) {\n\n favoImageButton.setImageResource(R.drawable.liked);\n\n String loadedPosterString = encodeTobase64(theposterImage);\n\n\n serItems.add(new ItemsClass(loadedPosterString, title, releaseDate, overview, rate, id));\n\n Toast.makeText(getContext(), \"you have favo this movie with id of \" + id + \"and you list size is\" + serItems.size(), Toast.LENGTH_SHORT).show();\n //convert all the arraylist with the old and new Items to Json format\n String jsonList = gson.toJson(serItems);\n //save to sharedPreference\n editorpref.putString(\"storedjsonList\", jsonList);\n editorpref.commit();\n va[0] = !va[0];\n\n } else if (movieArrayList != null) {\n serItems = movieArrayList;\n for (int i = 0; i < serItems.size(); i++) {\n int detectId = serItems.get(i).getId();\n if (serItems.size() > 0 && detectId == id) {\n Toast.makeText(getContext(), \"you already have this movie in favorite list \", Toast.LENGTH_SHORT).show();\n favoImageButton.setImageResource(R.drawable.liked);\n break;\n } else if (serItems.size() > 0 && detectId != id && i < serItems.size() - 1) {\n\n continue;\n\n } else if (detectId != id && i == serItems.size() - 1 && i > serItems.size() - 2) {\n Toast.makeText(getContext(), \"you have favo this movie with id of \" + id, Toast.LENGTH_SHORT).show();\n favoImageButton.setImageResource(R.drawable.like);\n serItems.add(new ItemsClass(storedPoster, title, releaseDate, overview, rate, id));\n serItems.size();\n //convert all the arraylist with the old and new Items to Json format\n String jsonList = gson.toJson(serItems);\n //save to sharedPreference\n editorpref.putString(\"storedjsonList\", jsonList);\n editorpref.commit();\n va[0] = !va[0];\n break;\n }\n\n }\n }\n\n } else {\n if (movieArrayList != null) {\n serItems = movieArrayList;\n for (int i = 0; i < serItems.size(); i++) {\n\n int detectId = serItems.get(i).getId();\n if (i < serItems.size() && serItems.size() > 0 && detectId == id) {\n Toast.makeText(getContext(), \"you have deleted this movie this movie with id of \" + id, Toast.LENGTH_SHORT).show();\n favoImageButton.setImageResource(R.drawable.like);\n mypreference = getContext().getSharedPreferences(\"moviepref\", Context.MODE_PRIVATE);\n editorpref.putString(\"storedPoster\", \"\");\n editorpref.putString(\"storedTitle\", \"\");\n editorpref.putString(\"storedOverview\", \"\");\n editorpref.putString(\"storedDate\", \"\");\n editorpref.putFloat(\"storedrating\", (float) 0.0);\n editorpref.commit();\n va[0] = !va[0];\n//\n break;\n } else if (detectId != id && i < serItems.size() - 1) {\n continue;\n } else if (detectId == id && i == serItems.size() - 1) {\n Toast.makeText(getContext(), \" actually you don't have this movie in your favorite list \", Toast.LENGTH_SHORT).show();\n }\n\n }\n }\n }\n }",
"protected void processFavorite(Map<String,List<PageViewVO>> pages, FavoriteVO fav) {\n\t\ttry {\n\t\t\tcheckCollectionKey(fav.getTypeCd());\n\t\t} catch (Exception e) {\n\t\t\t// this fav is not a 'Section' type so return.\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// convert favorite into a PageViewVO\n\t\tPageViewVO page = new PageViewVO();\n\t\tpage.setReferenceCode(fav.getTypeCd());\n\t\tpage.setPageId(fav.getRelId());\n\t\tpage.setRequestUri(fav.getUriTxt());\n\n\t\tif (fav.getAsset() != null) {\n\t\t\tSolrDocument sDoc = (SolrDocument)fav.getAsset();\n\t\t\tpage.setPageDisplayName(sDoc.getFieldValue(SearchDocumentHandler.TITLE).toString());\n\t\t}\n\n\t\tlog.debug(\"adding favorite: ref cd | pageId | uri | name: \" + page.getReferenceCode() +\"|\"+page.getPageId() +\"|\"+page.getRequestUri() +\"|\"+page.getPageDisplayName());\n\n\t\tList<PageViewVO>pList = pages.get(page.getReferenceCode());\n\t\tif (pList != null)\n\t\t\tpList.add(page);\n\t}",
"@Override\n\tpublic void setFavorite(boolean value) {\n\t\tthis.isFavorite = value;\n\t}",
"private void updateFavoriteButtons() {\n new AsyncTask<Void, Void, Boolean>() {\n\n @Override\n protected Boolean doInBackground(Void... params) {\n return isFavorite();\n }\n\n @Override\n protected void onPostExecute(Boolean isFavorite) {\n if (isFavorite) {\n mButtonRemoveFavorites.setVisibility(View.VISIBLE);\n mButtonMarkAsFavorite.setVisibility(View.GONE);\n } else {\n mButtonMarkAsFavorite.setVisibility(View.VISIBLE);\n mButtonRemoveFavorites.setVisibility(View.GONE);\n }\n }\n }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);\n\n mButtonMarkAsFavorite.setOnClickListener(\n new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n markAsFavorite();\n }\n });\n\n mButtonRemoveFavorites.setOnClickListener(\n new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n removeFromFavorites();\n }\n });\n }",
"public void update() {\n\n dbWork.cleanAll();\n\n List<DataFromServiceKudaGo> list = requestDataFromService();\n\n List<Film> films = new ArrayList<>();\n for (DataFromServiceKudaGo data : list) {\n Film film = new Film(list.indexOf(data), data.getNameMovie(), data.getPosterMoviePath(),\n data.getRunning_time(), data.getPrice(), data.getImax(),\n data.getCountryFilm(), data.getYearFilm(), data.getTrailerFilm(),\n data.getAgeFilm(), data.getDirectorFilm(), data.getNameCinema(),\n data.getAddressCinema(), data.getPhone(), data.getStationAboutCinema(),\n data.getPosterCinemaPath(), data.getBeginning_time(), data.getDescription());\n films.add(film);\n }\n\n dbWork.setFilms(films);\n\n fillShows();\n }",
"public void setFavorite(boolean favorite) {\n if (mFavorite != favorite) {\n mFavorite = favorite;\n // Avoid infinite recursions if setChecked() is called from a listener\n if (mBroadcasting) {\n return;\n }\n\n mBroadcasting = true;\n if (mOnFavoriteChangeListener != null) {\n mOnFavoriteChangeListener.onFavoriteChanged(this, mFavorite);\n }\n updateFavoriteButton(favorite);\n mBroadcasting = false;\n }\n }",
"private void removeFromFavorites() {\n favoriteBool = false;\n preferencesConfig.writeRemoveFavoriteTip(shownTipIndex);\n Toast.makeText(getContext(), \"Removed from favorites\", Toast.LENGTH_SHORT).show();\n\n }",
"private void populateFavoritesSections() {\n \tif (mUserProfile.userFavoriteAlbums != null && !Utils.isListEmpty(mUserProfile.userFavoriteAlbums.albums)) {\n \t\tmContainerFavoriteAlbums.setVisibility(View.VISIBLE);\n \t\t\n \t\tUserFavoriteAlbums userFavoriteAlbums = mUserProfile.userFavoriteAlbums;\n \t\tmTextFavoriteFavoriteAlbumsValue.setText(Integer.toString(userFavoriteAlbums.albumCount));\n \t\t\n \t\tStack<ImageView> favoriteAlbumsImages = new Stack<ImageView>();\n \t\tfavoriteAlbumsImages.add(mTextFavoriteFavoriteAlbum3);\n \t\tfavoriteAlbumsImages.add(mTextFavoriteFavoriteAlbum2);\n \t\tfavoriteAlbumsImages.add(mTextFavoriteFavoriteAlbum1);\n\n \t\tImageView albumImage = null;\n \t\t\n \t\tfor (MediaItem mediaItem : userFavoriteAlbums.albums) {\n \t\t\tif (favoriteAlbumsImages.isEmpty())\n \t\t\t\tbreak;\n \t\t\t\n \t\t\talbumImage = favoriteAlbumsImages.pop();\n \t\t\t\n \t\t\t//mImageFetcher.loadImage(mediaItem.getImageUrl(), albumImage);\n \t\t\t\n \t\t\tPicasso.with(getActivity()).cancelRequest(albumImage);\n \t\t\tif(getActivity() != null && mediaItem.getImageUrl() != null){\n \t\t\t\tPicasso.with(getActivity()).load(mediaItem.getImageUrl()).into(albumImage);\t\n \t\t\t}\n\t\t\t}\n \t\t\n \t} else {\n \t\tmContainerFavoriteAlbums.setVisibility(View.GONE);\n \t}\n \t\n \t// populates the favorite songs.\n \tif (mUserProfile.userFavoriteSongs != null && !Utils.isListEmpty(mUserProfile.userFavoriteSongs.songs)) {\n \t\tmContainerFavoriteSongs.setVisibility(View.VISIBLE);\n \t\t\n \t\tUserFavoriteSongs userFavoriteSongs = mUserProfile.userFavoriteSongs;\n \t\tmTextFavoriteSongsValue.setText(Integer.toString(userFavoriteSongs.songsCount));\n \t\t\n \t\tStack<TextView> favoriteSongsNames = new Stack<TextView>();\n \t\tfavoriteSongsNames.add(mTextFavoriteSong3Name);\n \t\tfavoriteSongsNames.add(mTextFavoriteSong2Name);\n \t\tfavoriteSongsNames.add(mTextFavoriteSong1Name);\n\n \t\tTextView songName = null;\n \t\t\n \t\tfor (MediaItem mediaItem : userFavoriteSongs.songs) {\n \t\t\tif (favoriteSongsNames.isEmpty())\n \t\t\t\tbreak;\n \t\t\t\n \t\t\tsongName = favoriteSongsNames.pop();\n \t\t\tsongName.setText(mediaItem.getTitle());\n\t\t\t}\n \t\t\n \t} else {\n \t\tmContainerFavoriteSongs.setVisibility(View.GONE);\n \t}\n \t\n \t// populates the favorite playlists.\n \tif (mUserProfile.userFavoritePlaylists != null && !Utils.isListEmpty(mUserProfile.userFavoritePlaylists.playlists)) {\n \t\tmContainerFavoritePlaylists.setVisibility(View.VISIBLE);\n \t\t\n \t\tUserFavoritePlaylists userFavoritePlaylists = mUserProfile.userFavoritePlaylists;\n \t\tmTextFavoritePlaylistValue.setText(Integer.toString(userFavoritePlaylists.playlistCount));\n \t\t\n \t\tStack<TextView> favoritePlaylistsNames = new Stack<TextView>();\n \t\tfavoritePlaylistsNames.add(mTextFavoritePlaylist3Name);\n \t\tfavoritePlaylistsNames.add(mTextFavoritePlaylist2Name);\n \t\tfavoritePlaylistsNames.add(mTextFavoritePlaylist1Name);\n\n \t\tTextView playlistsName = null;\n \t\t\n \t\tfor (MediaItem mediaItem : userFavoritePlaylists.playlists) {\n \t\t\tif (favoritePlaylistsNames.isEmpty())\n \t\t\t\tbreak;\n \t\t\t\n \t\t\tplaylistsName = favoritePlaylistsNames.pop();\n \t\t\tplaylistsName.setText(mediaItem.getTitle());\n\t\t\t}\n \t\t\n \t} else {\n \t\tmContainerFavoritePlaylists.setVisibility(View.GONE);\n \t}\n \t\n \t// populates the favorite videos.\n \tif (mUserProfile.userFavoriteVideos != null && !Utils.isListEmpty(mUserProfile.userFavoriteVideos.videos)) {\n \t\tmContainerFavoriteVideos.setVisibility(View.VISIBLE);\n \t\t\n \t\tUserFavoriteVideos userFavoriteVideos = mUserProfile.userFavoriteVideos;\n \t\tmTextFavoriteVideosValue.setText(Integer.toString(userFavoriteVideos.videoCount));\n \t\t\n \t\tStack<ImageView> favoriteVideosImages = new Stack<ImageView>();\n \t\tfavoriteVideosImages.add(mTextFavoriteVideo3);\n \t\tfavoriteVideosImages.add(mTextFavoriteVideo2);\n \t\tfavoriteVideosImages.add(mTextFavoriteVideo1);\n\n \t\tImageView videoImage = null;\n \t\t\n \t\tfor (MediaItem mediaItem : userFavoriteVideos.videos) {\n \t\t\tif (favoriteVideosImages.isEmpty())\n \t\t\t\tbreak;\n \t\t\t\n \t\t\tvideoImage = favoriteVideosImages.pop();\n \t\t\t\n \t\t\t//mImageFetcher.loadImage(mediaItem.getImageUrl(), videoImage);\n \t\t\t\n \t\t\tPicasso.with(getActivity()).cancelRequest(videoImage);\n \t\t\tif(getActivity() != null && !TextUtils.isEmpty(mediaItem.getImageUrl())){\n \t\t\t\tPicasso.with(getActivity()).load(mediaItem.getImageUrl()).into(videoImage); \t\t\t\t\n \t\t\t}\n\t\t\t}\n \t\t\n \t} else {\n \t\tmContainerFavoriteVideos.setVisibility(View.GONE);\n \t}\n\t}",
"@Override\n public void onResume() {\n super.onResume();\n initListFavorite();\n }",
"@Override\n\tpublic boolean isFavorite() {\n\t\treturn this.isFavorite;\n\t}",
"private void getAllFavorite(){\n\n\n MainViewModel viewModel = ViewModelProviders.of(this).get(MainViewModel.class);\n viewModel.getFavorite().observe(this, new Observer<List<FavoriteEntry>>() {\n @Override\n public void onChanged(@Nullable List<FavoriteEntry> imageEntries) {\n List<Movie> movies = new ArrayList<>();\n for (FavoriteEntry entry : imageEntries){\n Movie movie = new Movie();\n movie.setId(entry.getMovieid());\n movie.setOverview(entry.getOverview());\n movie.setOriginalTitle(entry.getTitle());\n movie.setPosterPath(entry.getPosterpath());\n movie.setVoteAverage(entry.getUserrating());\n movie.setReleaseDate(entry.getReleasedate());\n movies.add(movie);\n }\n\n adapter.setMovies(movies);\n }\n });\n }",
"public void setFavorite(int favorite) throws Exception {\n if (favorite == 0) {mFavorite = false;}\n else if (favorite == 1) {mFavorite = true;}\n else {throw new Exception(\"Error: Cannot resolve movie 'favorite' \");}\n }",
"public void setUpFavouriteIcon() {\n if (isUserOwner()) {\n view.hideFavouriteIcon();\n } else if (currentAdvertIsFavourite()) {\n view.setIsAFavouriteIcon();\n } else {\n view.setIsNotAFavouriteIcon();\n }\n }",
"@RequestMapping(value = \"/gifs/{gifId}/favorite\", method = RequestMethod.POST)\n public String toggleFavorite(@PathVariable Long gifId, HttpServletRequest request) {\n Gif gif = gifService.findById(gifId);\n gifService.toggleFavorite(gif);\n return String.format(\"redirect:%s\", request.getHeader(\"referer\"));\n }",
"public void onFavouritesIconPressed() {\n if (currentAdvertIsFavourite()) {\n dataModel.removeFromFavourites(advertisement);\n view.setIsNotAFavouriteIcon();\n } else {\n dataModel.addToFavourites(advertisement);\n view.setIsAFavouriteIcon();\n }\n }",
"@SuppressWarnings(\"unchecked\")\n\tprotected Map<String, List<PageViewVO>> processUserFavorites(ModuleVO mod) \n\t\t\tthrows ActionException {\n\t\tlog.debug(\"processUserFavorites...\");\n\t\tMap<String, List<PageViewVO>> pageMap = initializePageMap();\n\t\tif (mod.getErrorCondition()) return pageMap;\n\n\t\tList<FavoriteVO> favs = (List<FavoriteVO>)mod.getActionData();\n\n\t\tfor (FavoriteVO fav : favs) {\n\t\t\tlog.debug(\"found fav, typeCd | relId | uriTxt: \" + fav.getTypeCd() + \"|\" + fav.getRelId() + \"|\" + fav.getUriTxt());\n\t\t\tif (fav.getAsset() == null) continue; \n\t\t\tprocessFavorite(pageMap,fav);\n\t\t}\n\t\treturn pageMap;\n\t}",
"public void setFavAutomated(Group g) throws IllegalArgumentException {\r\n\r\n\t\tArrayList<Integer> fav = listItemMapper.autoSetFav(g);\r\n\r\n\t\tfor (int a = 0; a < fav.size(); a++) {\r\n\r\n\t\t\tint item_id = fav.get(a);\r\n\t\t\tBoolean available = favoriteItemMapper.checkById(item_id);\r\n\r\n\t\t\tif (available == false) {\r\n\r\n\t\t\t\tItem i = new Item();\r\n\t\t\t\ti.setId(item_id);\r\n\t\t\t\tfavoriteItemMapper.insert(i, g);\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}",
"FavoriteQuestions() {\n list = SharedPrefs.getFavList();\n }",
"public boolean isFavorite() {\n return isFavorite;\n }",
"public boolean isFavorite() {\n return isFavorite;\n }",
"@Override\n\tpublic void onFavorite(User source, User target, Status favoritedStatus) {\n\n\t}",
"boolean isFavorite(int id);",
"@FXML\n private void chooseFavouritePhotoEvent() {\n if (!PhotoManager.getFavouriteList().isEmpty()) {\n User.setGalleryPhotos(PhotoManager.getFavouriteList());\n fadeOutEvent();\n }\n }",
"private void addChannelToFavorites(String channel) {\r\n channel = prepareChannel(channel);\r\n if (channel != null) {\r\n settings.setAdd(FAVORITES_SETTING, channel);\r\n }\r\n }",
"public void favorite(int index)\n {\n if (latest != null && latest.index == index)\n {\n if (this.showFavorites && !latest.morph.favorite)\n {\n this.toRemove.put(index, new MorphRemove(index, latest.typeIndex));\n this.remove(index);\n }\n\n latest = null;\n }\n }",
"private void addSelectedtoFavorites(){\n\t\t\n\t\tCursor c=getContentResolver().query(Uri.parse(Const.URI_STRING+\"/videolist/\"+mPlayListId), null, null, null, null);\n\t\tif(mCheckData==null || c==null){\n\t\t\tLogging.e(\"Error Data NULL\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(mCheckData.size()!=c.getCount()){\n\t\t\tLogging.e(\"Error Data and Cursor count has different value\");\n\t\t}\n\t\t\n\t\tif(c!=null){\n\t\t\tLogging.d(\"Insert Start\");\n\t\t \tfor(int i=0;i<c.getCount();i++){\n\t \t\tBoolean tagged=mCheckData.get(i);\n\t \t\tif(tagged){\n\t \t\t\tc.moveToPosition(i);\n\t \t\t\tContentValues cv=new ContentValues();\n\t \t\t\tcv.put(MyList.PRJ_TITLE, c.getString(c.getColumnIndex(PlayList.PRJ_TITLE)));\n\t \t\t\tcv.put(MyList.PRJ_PLAYLIST_ID, mTitle);\n\t \t\t\tcv.put(MyList.PRJ_DESCRIPTION, c.getString(c.getColumnIndex(PlayList.PRJ_DESCRIPTION)));\n\t \t\t\tcv.put(MyList.PRJ_DURATION, c.getString(c.getColumnIndex(PlayList.PRJ_DURATION)));\n\t \t\t\tcv.put(MyList.PRJ_THUMNAIL, c.getString(c.getColumnIndex(PlayList.PRJ_THUMNAIL)));\n\t \t\t\tcv.put(MyList.PRJ_VIDEO_ID, c.getString(c.getColumnIndex(PlayList.PRJ_VIDEO_ID)));\n\t \t\t\t\n\t \t\t\tgetContentResolver().insert(Uri.parse(\"content://\"+Const.MYLIST_AUTHORITY+\"/videolist\"), cv);\n\t \t\t\tLogging.d(\"Insert \"+i);\n\t \t\t}\n\t \t}\n\t\t \tc.close();\n\t\t \tLogging.d(\"Insert End\");\n\t\t}\n\t}",
"public void setIsUserFav(User user) {\n if(user.isUsersFavouritePost(this.mPost))\n this.isFavourite.set(true);\n else\n this.isFavourite.set(false);\n\n //if(this.mPost.getFavourite().contains(user))\n // this.isFavourite.set(true);\n //this.isFavourite.set(false);\n }",
"private void toggleFavorite(Set<Long> selectedSet) {\n toggleMultiple(selectedSet, new MultiToggleHelper() {\n\n @Override\n public boolean getField(Cursor c) {\n return c.getInt(MessagesAdapter.COLUMN_FAVORITE) != 0;\n }\n\n @Override\n public void setField(long messageId, boolean newValue) {\n mController.setMessageFavoriteSync(messageId, newValue);\n }\n });\n }",
"public void onClicklistenerForFavorites(View view){\n if(isAlreadyFavorteis() == true){\n Boolean hasDeleted = dBhelper.deleteFavortiesByCategoryId(userAskAbout,inputSpinnerOne.getSelectedItemPosition(),inputSpinnertow.getSelectedItemPosition());\n if(hasDeleted == true) {\n Toast.makeText(getApplicationContext(), \"Your data has deleted in Favorties\", Toast.LENGTH_LONG).show();\n favortiesImageView.setBackgroundResource(R.drawable.ic_favourites);\n isAlreadyFavorties = false;\n }\n\n }else\n {\n favortiesMethed();\n isAlreadyFavorties = true;\n favortiesImageView.setBackgroundResource(R.drawable.ic_favourites_pressed);\n }\n\n }",
"public void fetchFavoritedMovies() {\n favoritesSelected = true;\n Cursor cursor =\n getActivity().getContentResolver().query(MovieContract.FavoriteMovieEntry.CONTENT_URI,\n null,\n null,\n null,\n null);\n ArrayList<MovieModel> movieModels = new ArrayList<>();\n if (cursor != null) {\n while (cursor.moveToNext()) {\n MovieModel movieModel = new MovieModel(getActivity(), cursor);\n // Get the trailers and reviews\n String movieId = cursor.getString(cursor.getColumnIndex(MovieContract.FavoriteMovieEntry._ID));\n Cursor trailerCursor =\n getActivity().getContentResolver().query(MovieContract.TrailerEntry.CONTENT_URI,\n null,\n MovieContract.TrailerEntry.COLUMN_MOVIE_KEY + \" = ?\",\n new String[]{movieId},\n null);\n Cursor reviewCursor =\n getActivity().getContentResolver().query(MovieContract.ReviewEntry.CONTENT_URI,\n null,\n MovieContract.ReviewEntry.COLUMN_MOVIE_KEY + \" = ?\",\n new String[]{movieId},\n null);\n ArrayList<MovieTrailerModel> movieTrailerModels = new ArrayList<>();\n ArrayList<MovieReviewModel> movieReviewModels = new ArrayList<>();\n if (trailerCursor != null) {\n while (trailerCursor.moveToNext()) {\n movieTrailerModels.add(new MovieTrailerModel(getActivity(), trailerCursor));\n }\n trailerCursor.close();\n }\n if (reviewCursor != null) {\n while (reviewCursor.moveToNext()) {\n movieReviewModels.add(new MovieReviewModel(getActivity(), reviewCursor));\n }\n reviewCursor.close();\n }\n movieModel.setReviews(movieReviewModels);\n movieModel.setTrailers(movieTrailerModels);\n movieModels.add(movieModel);\n }\n cursor.close();\n }\n movieGridAdapter.setMovieModels(movieModels);\n }",
"@Override\n\t\tpublic void onFavorite(User arg0, User arg1, Status arg2) {\n\t\t\t\n\t\t}",
"public void clickFavoritesLink()\n\t{\n \telementUtils.performElementClick(wbFavoritesLink);\n\t}",
"public void setFavortieid(Integer favortieid) {\n this.favortieid = favortieid;\n }",
"@Override\n\tpublic void getFavorit(int idUser) {\n\t\t\n\t}",
"public void onFavButtonClicked(View view) {\n isFav = !isFav;\n toggleButtonText(isFav);\n \n // Update DB\n new OperateWithDBMovieAsyncTask().execute(isFav ? ADD_MOVIE : REMOVE_MOVIE);\n }",
"public synchronized Set<String> getFavorites() {\r\n return new HashSet<>(settings.getList(FAVORITES_SETTING));\r\n }",
"void setProjectFavourite(int accountId, int projectId, boolean favourite);",
"public boolean isFavorite() {\n\t\tsynchronized (this) {\n\t\t\tif (mFavoritesCache != null) {\n\t\t\t\treturn mFavoritesCache.isFavoriteSong(getAudioId(),\n\t\t\t\t\t\tgetTrackHost());\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public synchronized void addChannelsToFavorites(Set<String> channels) {\r\n for (String channel : channels) {\r\n addChannelToFavorites(channel);\r\n }\r\n settings.setSettingChanged(FAVORITES_SETTING);\r\n }",
"@Override\n public void addProductToFavorites(View view, Intent intent) {\n try {\n if(iProduct != null && view != null && intent != null){\n Context context = view.getContext();\n String jsonProduct = intent.getStringExtra(CommonPresenter.DETAIL_PRODUCT);\n Product product = CommonPresenter.getProductFromJSON(jsonProduct);\n CRUDFavorite crudFavorite = new CRUDFavorite(context);\n boolean isProductExists = crudFavorite.isProductExists(product.getProductId());\n if(isProductExists){\n crudFavorite.deleteByProductId(product.getProductId());\n CommonPresenter.showSnackBarMessage(view, context.getString(R.string.lb_product_delete_to_favorite));\n iProduct.changeImageRightResource(R.drawable.ic_add_to_favorite_32dp);\n }\n else{\n crudFavorite.add(new Favorite(0, product));\n CommonPresenter.showSnackBarMessage(view, context.getString(R.string.lb_product_add_to_favorite));\n iProduct.changeImageRightResource(R.drawable.ic_favorite_32dp);\n }\n }\n }\n catch (Exception ex){\n Log.e(\"TAG_ERROR\", \"ProductPresenter-->addProductToFavorites() : \"+ex.getMessage());\n }\n }",
"@Override\r\n public void onFavoriteClicked() {\r\n fragFav = new FragmentFavoritesList();\r\n FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();\r\n // Replace whatever is in the fragment_container view with this fragment,\r\n // and add the transaction to the back stack so the user can navigate back\r\n if (getResources().getBoolean(R.bool.isTablet)) {\r\n transaction.add(R.id.listFrag_tab,fragFav, \"FragmentFavoritesList\");\r\n }else {\r\n transaction.add(R.id.activity_main_smart, fragFav, \"FragmentFavoritesList\");\r\n }\r\n transaction.addToBackStack(null);\r\n // Commit the transaction\r\n transaction.commit();\r\n }",
"@Override\n public void onClick(View view) {\n isFavorite = !isFavorite;\n\n if (isFavorite) {\n Toast.makeText(ShowTeacherActivity.this,\n getString(R.string.message_teacher_add_to_favorites), Toast.LENGTH_SHORT)\n .show();\n presenter.saveFavorite(ShowTeacherActivity.this, teacher);\n ibFavorite.setImageResource(R.drawable.ic_favorite_full);\n } else {\n Toast.makeText(ShowTeacherActivity.this,\n getString(R.string.message_teacher_delete_from_favorites), Toast.LENGTH_SHORT)\n .show();\n presenter.deleteFavorite(ShowTeacherActivity.this, teacher.getId());\n ibFavorite.setImageResource(R.drawable.ic_favorite_border);\n }\n }",
"public Cursor fetchAllFavorites() {\n\n return mDb.query(DATABASE_TABLE_FAVORITES, new String[] {KEY_ROWID, KEY_TITLE,\n KEY_BODY}, null, null, null, null, null);\n }",
"int updateByPrimaryKeySelective(MemberFav record);",
"public void setFavoriteLogList(List<FavoriteLog> favoriteLogList) {\n _favoriteLogList = favoriteLogList;\n }",
"public void makeFavorite(String title, int favorite)\n {\n SQLiteDatabase db = this.getWritableDatabase();\n\n /* the execSQL Method simply executes this query on the Database, in this Query UPDATE is\n * used to specify the Table Name to Update, SET specifies the Column name to Update in this\n * case COL8 contains favorites and WHERE is the condition in this case it is to make sure\n * that the Movie Title Matches with the given title\n */\n db.execSQL(\n \"UPDATE \" + TABLE_NAME +\n \" SET \" + COL8 + \" = \" + favorite +\n \" WHERE \" + COL2 + \" = '\" + title + \"'\");\n }",
"private void showFavouriteList() {\n setToolbarText(R.string.title_activity_fave_list);\n showFavouriteIcon(false);\n buildList(getFavourites());\n }",
"int updateByPrimaryKey(MemberFav record);",
"public void addBusinessToFavorites(Business business) {\n for(Business b : favorites) {\n if(b.getTitle().equals(business.getTitle()))\n return;\n }\n\n //add business to favorites list.\n favorites.add(business);\n }",
"public List<Pizza> updateFavoriteOrder(ObjectId customerId, List<Pizza> newFavorite) throws Exception{\n\t\tCustomer target;\n\t\ttry {\n\t\t\ttarget = custRepo.findBy_id(customerId);\n\t\t} catch (Exception e) {\n\t\t\tthrow new Exception(\"Target customer not found.\");\n\t\t}\n\t\t\n\t\ttarget.setFavoriteOrder(newFavorite);\n\t\ttarget = custRepo.save(target);\n\t\tif (target.getFavoriteOrder().equals(newFavorite)) {\n\t\t\treturn target.getFavoriteOrder();\n\t\t} else {\n\t\t\tthrow new Exception(\"Target customer's favorite order did not properly update.\");\n\t\t}\n\t}",
"public void changeFavorite(boolean a) {\r\n favorite = a;\r\n }",
"int updateByPrimaryKey(EcsFavourableActivity record);",
"public static void readFavorites(String userId, final ListView favoritesList, final Context context) {\n //get database reference\n DatabaseReference dbref = FirebaseDatabase.getInstance().getReference(\"users\").child(userId);\n //add eventlistener to reference\n dbref.child(\"favoritesList\").addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n\n\n ArrayList<String> favs = new ArrayList<>();\n\n for (DataSnapshot favDataSnapshot : dataSnapshot.getChildren()) {\n String fav = favDataSnapshot.getValue(String.class);\n favs.add(fav);\n }\n FoodController.readFavoriteFoods(favoritesList, context, favs);\n\n\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n\n }\n });\n }",
"private void getFavData() {\n favouriteViewModel.getFavouritePostData().observe(this, result -> {\n if (result != null) {\n if (result.status == Status.SUCCESS) {\n if (this.getActivity() != null) {\n Utils.psLog(result.status.toString());\n favouriteViewModel.setLoadingState(false);\n itemViewModel.setItemDetailObj(itemViewModel.itemId, itemViewModel.historyFlag, loginUserId);\n }\n\n } else if (result.status == Status.ERROR) {\n if (this.getActivity() != null) {\n Utils.psLog(result.status.toString());\n favouriteViewModel.setLoadingState(false);\n }\n }\n }\n });\n }",
"public interface Favorite {\n boolean get(String id);\n boolean toggle(String id);\n}",
"public void setFavoriteFlag(int flag, long videoID) {\n try {\n SQLiteDatabase database = this.getReadableDatabase();\n database.enableWriteAheadLogging();\n ContentValues contents = new ContentValues();\n contents.put(VideoTable.KEY_VIDEO_IS_FAVORITE, flag);\n database.update(VideoTable.VIDEO_TABLE, contents, VideoTable.KEY_VIDEO_ID + \"=?\", new String[]{\"\" + videoID});\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"@Override\n public void onClick(View v) {\n FavouriteDatabase fd = new FavouriteDatabase();\n fd.addToFavouritesList(catID);\n Toast.makeText(getContext(), \"Added to your Favourites\", Toast.LENGTH_SHORT).show();\n }",
"protected abstract SQLQuery getFavoriteUpdateSQLQuery();",
"public void addTermToFavourites(Term term) {\n // Set the favourited status of the term\n term.setFavourited(1);\n // Add the term to the table favourites\n addTermWithId(term, TABLE_FAVOURITES);\n // Update the favourite status of the term in the table terms\n updateTermFavouritedFlag(term, TABLE_TERMS);\n }"
] | [
"0.6886483",
"0.66207874",
"0.631244",
"0.61239797",
"0.60992783",
"0.60719675",
"0.606572",
"0.60336196",
"0.59790397",
"0.59746426",
"0.5926367",
"0.5907959",
"0.58892506",
"0.5876871",
"0.5852635",
"0.5783347",
"0.5727064",
"0.57179713",
"0.57145894",
"0.5703119",
"0.5702193",
"0.5697279",
"0.56970024",
"0.56953895",
"0.5663236",
"0.5655192",
"0.5646667",
"0.56294084",
"0.5624396",
"0.5614063",
"0.55832124",
"0.55758363",
"0.55387807",
"0.5534799",
"0.5493477",
"0.5479795",
"0.5471673",
"0.546534",
"0.5461637",
"0.5448422",
"0.5437121",
"0.5429235",
"0.5424115",
"0.5418364",
"0.5417716",
"0.53985417",
"0.536502",
"0.5352779",
"0.53507555",
"0.53356683",
"0.5322317",
"0.53089035",
"0.53",
"0.5288792",
"0.52884525",
"0.5285405",
"0.52788115",
"0.52782047",
"0.5270745",
"0.5263134",
"0.5263134",
"0.52611226",
"0.5257401",
"0.52548754",
"0.5243963",
"0.52285725",
"0.52210337",
"0.5219576",
"0.5213673",
"0.5200037",
"0.5199373",
"0.519925",
"0.51969224",
"0.5183875",
"0.5166877",
"0.5164151",
"0.51557374",
"0.5154084",
"0.5141909",
"0.5139949",
"0.5139542",
"0.51385653",
"0.51382273",
"0.5125503",
"0.51223695",
"0.512019",
"0.51199377",
"0.5103244",
"0.50895727",
"0.5088973",
"0.50882673",
"0.5082734",
"0.50774604",
"0.507329",
"0.50691843",
"0.5050193",
"0.5049668",
"0.5045807",
"0.50413954",
"0.5025404"
] | 0.724632 | 0 |
Iterates a List of PageViewVO and removes the page that matches the pageId passed in. | protected void removeFromSession(List<PageViewVO> pages, String favPageId) {
if (pages.isEmpty()) return;
// loop and remove
ListIterator<PageViewVO> li = pages.listIterator();
while (li.hasNext()) {
PageViewVO tmp = li.next();
if (favPageId.equalsIgnoreCase(tmp.getPageId())) {
li.remove();
break;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void removePage(int index)\n {\n pages.remove(index);\n }",
"public synchronized void removeData(int pageId)\n\t\t{\n\t\t\tif (sessionIdentifier == null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tgetManager().removePage(pageId);\n\t\t}",
"public void remove(@PAGE int page) {\n mPageSummary.remove(page);\n }",
"boolean delete(PageId pageId);",
"private void removeDescriptionPage(Map<Object, String> pageMap) {\r\n\t\tfor (Iterator<Object> iterator = pageMap.keySet().iterator(); iterator.hasNext();) {\r\n\t\t\tfinal Object key = iterator.next();\r\n\t\t\tif (key instanceof CustomCategoryDescriptionPage) {\r\n\t\t\t\titerator.remove();\r\n\t\t\t\t// we assume that only one CustomCategoryDescriptionPage is added - so break in first match\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public synchronized void discardPage(PageId pid) {\n // some code goes here\n // not necessary for proj1\n }",
"public void deletePagoById(String id){\n pagoMongoRepository.deleteById(id);\n }",
"public void removePage(Page page){\n\t\tpages.remove(page);\n\t\t///////////////////observer metode\n\t\tModelUpdateEvent event = new ModelUpdateEvent((Object)page,false,true);\n\t\tsetChanged();\n\t\tnotifyObservers(event);\n\t\t///////////////////////////////////\n\t}",
"public void removeSessionPages(AccessDetailVO requestPage){\r\n \t\r\n \tlogger.info(\"Removing Lock Pages for Session: \" + requestPage.getSessionId());\r\n \tfor (Entry<String, AccessDetailVO> curPage : pageAccess.entrySet()) {\r\n \t\tAccessDetailVO currLock = curPage.getValue();\r\n \t\tif(currLock.getSessionId().equals(requestPage.getSessionId())){\r\n \t\t\tremovePageLock(currLock);\r\n \t\t}\r\n \t}\r\n\r\n }",
"private void removeFromList(Visit visit){\n\t\tfor (int i=0; i<searchResults.size(); i++) {\n\t\t\tif(searchResults.get(i).getClientRegNo().equals(visit.getClientRegNo())\n\t\t\t\t\t&& searchResults.get(i).getPropertyRegNo().equals(visit.getPropertyRegNo())\n\t\t\t\t\t&& searchResults.get(i).getDate().equals(visit.getDate())){\n\t\t\t\tsearchResults.remove(i);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t}",
"public void updateAfterDeletion(List<Integer> pageList) {\n if (pageList == null || pageList.size() == 0) {\n return;\n }\n\n mDocPagesModified = true;\n mCurrentPage -= pageList.size();\n\n Collections.sort(pageList); // since we will use binary search\n\n // Update page numbers\n ListIterator<Map<String, Object>> it = mDataList.listIterator();\n int deleteCnt = 0;\n Integer pageNum;\n while (it.hasNext()) {\n Map<String, Object> item = it.next();\n pageNum = (Integer) item.get(PAGE_NUMBER_SRC);\n try {\n if (Collections.binarySearch(pageList, pageNum) >= 0) {\n mDataLock.lock();\n item.put(THUMB_IMAGE, null);\n mDataLock.unlock();\n\n it.remove();\n\n // Update cached page list\n removeCachedPage(pageNum);\n\n ++deleteCnt;\n } else {\n item.put(PAGE_NUMBER_SRC, pageNum - deleteCnt);\n }\n } catch (Exception ignored) {\n }\n }\n\n Utils.safeNotifyDataSetChanged(this);\n\n // scroll to the item after the first deleted item\n pageNum = Collections.min(pageList);\n if (pageNum == mDataList.size()) {\n --pageNum;\n }\n safeScrollToPosition(pageNum - 1);\n }",
"public void removePage(int page_number){\n\t\tint pageIndex = getPageIndexInArrayList(page_number);\n\t\tif (pageIndex == -1)\n\t\t\treturn;\n\t\tpages_loaded.remove(pageIndex);\n\t\tpages_loaded_number.remove(pageIndex);\n\t\tpages_loaded_is_changed.remove(pageIndex);\n\t\t\n\t}",
"ItemStack removePage(EntityPlayer player, ItemStack itemstack, int index);",
"public void removePageLock(AccessDetailVO requestPage){ \t\r\n\r\n \tlogger.info(\"Removing Lock Page: \" + requestPage.toString());\r\n \tpageAccess.remove(requestPage.getPage());\r\n }",
"public synchronized void discardPage(PageId pid) {\n // some code goes here\n // only necessary for lab5\n bufferPool.remove(pid);\n }",
"public void deletePagesBeforePageIndex(final long pageIndex) {\n final Set<Long> indexSet = this.getExistingBackFileIndexSet();\n for (final Long index : indexSet)\n if (index < pageIndex)\n this.deletePage(index);\n }",
"private void garbageColl(){\n\t\tfor(Page p: pageList){\n\t\t\tp.garbageColl();\n\t\t}\n\t\tpageIndex = 0;\n\t}",
"@Override\r\n\tpublic void remove(long id) {\n\t\tObject obj = getHibernateTemplate().get(CustomizePage.class, id);\r\n\t\tgetHibernateTemplate().delete(obj);\r\n\t}",
"public void deletePage(int pageId) throws SQLException {\n\t\tif (upodDao.pageExists(pageId)) {\n\t\t\tupodDao.deletePage(pageId);\n\t\t}\n\t}",
"public void deletePage(int position)\n {\n arrayIndexes.remove(position);\n // Notify the adapter that the data set is changed\n notifyDataSetChanged();\n }",
"@Override\n\tpublic void removeAll() {\n\t\tfor (PhatVay phatVay : findAll()) {\n\t\t\tremove(phatVay);\n\t\t}\n\t}",
"public void unpinPage(PageId pageId, boolean dirty) throws Exception {\n\t\t// if this page ID doesnot exists\n\t\tif (!pageHashtable.containsKey(pageId.pid)) {\n\t\t\tthrow new HashEntryNotFoundException(null, \"Page not in buffer\");\n\t\t} else {\n\t\t\tint frameNum = pageHashtable.get(pageId.pid);\n\t\t\t// if unpinning frame with already pincount =0\n\t\t\tif (frameDescriptor[frameNum].getPinCount() == 0) {\n\t\t\t\tthrow new PagePinnedException(null, \"Pin count is already 0\");\n\t\t\t}\n\t\t\t// set the dirty boolean and decrease the number of the count\n\t\t\tframeDescriptor[frameNum].setDirty(dirty);\n\t\t\tframeDescriptor[frameNum].decreasePinCount();\n\t\t\t// return it to the queue if the pin count ==0\n\t\t\tif (frameDescriptor[frameNum].getPinCount() == 0) {\n\t\t\t\treplace.enqueue(frameNum);\n\t\t\t}\n\t\t}\n\t}",
"public void removePaginationLoading() {\n mTvShows.remove(mTvShows.size() - 1);\n notifyItemRemoved(mTvShows.size());\n }",
"private void deleteBooking() \n {\n Scanner memberID=new Scanner(System.in);\n System.out.println(\"Please enter your member number: \");\n int memberId = memberID.nextInt();\n \n Member mem = sportsClub.searchMember(memberId);\n if(mem==null || mem.getBookings()==null)\n {\n System.out.println(\"Sorry! There are no members with the given ID. \");\n\n \n\n }\n else\n {\n for(Booking b : mem.getBookings())//Displays the member details n bookings\n {\n System.out.println(\"Booking Id : \" + b.hashCode()+ \" Booking made by \"+mem.getMemberName() +\" for \" + b.getBookingDate() + \" at \" + b.getBookingTime() + \" for \" + b.getBookingEndTime() + \" minutes on Court number \" + b.getCourt().getCourtId());\n\n }\n \n if(mem.getBookings().size()!=0)\n {\n Scanner inputID=new Scanner(System.in);\n System.out.println(\"Enter Booking ID: \");\n int input = inputID.nextInt();\n Iterator<Booking> itr = mem.getBookings().iterator();\n\n\n while(itr.hasNext())//delettion starts based on the ID\n { \n if(itr.next().hashCode() == input)\n {\n itr.remove();\n for(String str : mem.getSportsPlayed())\n {\n Sport sportObj = sportsClub.findSport(str);\n\n ArrayList<Court> itrCourt = sportObj.getCourtList();\n for(Court c : itrCourt)//finds the court\n {\n\n Iterator<Booking> itrBooking = c.getCourtBookings().iterator();\n while(itrBooking.hasNext())//helps to get the booking object\n {\n if(itrBooking.next().hashCode() == input)\n {\n itrBooking.remove();//removes the booking object\n System.out.println(\"Deleted Successfully\");\n }\n } \n } \n } \n }\n }\n }\n }\n\n\n\n }",
"@Override\n\tpublic void removeByMaCTV(String maCTV) {\n\t\tfor (PhatVay phatVay :\n\t\t\t\tfindByMaCTV(\n\t\t\t\t\tmaCTV, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {\n\n\t\t\tremove(phatVay);\n\t\t}\n\t}",
"public void deletePageById(long id) {\n pageImpl.deletePageById(id);\n }",
"@Override\n\tpublic int removeView(ViewPager viewPager, View view) {\n\t\tfor (int i = 0; i < pagerFragments.size(); i++) {\n\t\t\tSpinMenuFragment fragment = pagerFragments.get(i);\n\t\t\tif (fragment.getContent().equals(view)) {\n\t\t\t\treturn removeView(viewPager, i);\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}",
"public void removeSessionByPage(String page){\r\n \t\r\n \tAccessDetailVO access = pageAccess.get(page);\r\n \t\r\n \tremoveSessionPages(access);\r\n \t\r\n }",
"public void removeTemplatesPage()\r\n {\r\n getSemanticObject().removeProperty(swpres_templatesPage);\r\n }",
"void removeRelated(int i);",
"public boolean pageExistsAndRemoved(AccessDetailVO requestPage){\r\n \t\r\n \t//Check if Page is already locked\r\n \tsynchronized(pageAccess){\t// Synchronised to avoid race conditions \t\r\n \t\t if(isPageLocked(requestPage)){ \r\n \t\t\tlogger.info(\"Removing Lock Page: \" + requestPage.toString());\r\n \t\t\tpageAccess.remove(requestPage.getPage());\r\n \t\t\treturn true;\r\n \t\t }\r\n \t }\r\n \t\r\n \treturn false;\r\n }",
"public void removeDocPage(int pageNum) {\n mDocPagesModified = true;\n\n boolean shouldUnlock = false;\n try {\n mPdfViewCtrl.docLock(true);\n shouldUnlock = true;\n\n final PDFDoc doc = mPdfViewCtrl.getDoc();\n if (doc == null) {\n return;\n }\n\n Page pageToDelete = doc.getPage(pageNum);\n PageIterator pageIterator = doc.getPageIterator(pageNum);\n doc.pageRemove(pageIterator);\n\n removeUserBookmarks(pageToDelete.getSDFObj().getObjNum(), pageNum, doc.getPageCount());\n } catch (Exception e) {\n AnalyticsHandlerAdapter.getInstance().sendException(e);\n } finally {\n if (shouldUnlock) {\n mPdfViewCtrl.docUnlock();\n }\n }\n\n int position = updatePageNumberOnDelete(pageNum);\n if (position >= 0) {\n notifyItemRemoved(position);\n }\n }",
"public void onPagesDeleted(List<Integer> pageList) {\n/* 625 */ if (pageList == null || pageList.size() == 0 || !this.mPdfViewCtrl.isUndoRedoEnabled()) {\n/* */ return;\n/* */ }\n/* */ \n/* */ try {\n/* 630 */ JSONObject jsonObj = new JSONObject();\n/* 631 */ if (this.mContext != null) {\n/* 632 */ String strPageDelete = this.mContext.getResources().getString(R.string.undo_redo_page_delete);\n/* 633 */ jsonObj.put(\"Action\", strPageDelete);\n/* */ } \n/* 635 */ jsonObj.put(\"Action event\", \"delete_pages\");\n/* 636 */ jsonObj.put(\"Pages\", convertPageListToString(pageList));\n/* */ \n/* 638 */ if (Utils.isNullOrEmpty(jsonObj.toString())) {\n/* 639 */ AnalyticsHandlerAdapter.getInstance().sendException(new Exception(\"takeUndoSnapshot with an empty string\"));\n/* */ }\n/* */ \n/* 642 */ takeUndoSnapshot(jsonObj.toString());\n/* 643 */ if (sDebug)\n/* 644 */ Log.d(TAG, \"snapshot: \" + jsonObj.toString()); \n/* 645 */ } catch (Exception e) {\n/* 646 */ AnalyticsHandlerAdapter.getInstance().sendException(e);\n/* */ } \n/* */ }",
"@Override\n\tpublic PhatVay remove(long phatVayId) throws NoSuchPhatVayException {\n\t\treturn remove((Serializable)phatVayId);\n\t}",
"public void removePerson(Person p){\n Iterator<Person> itr = personList.iterator();\n while(itr.hasNext()){\n Person x = itr.next();\n if(x.equals(p)){itr.remove();}\n }\n }",
"@Override\n public void onSuccess(Void aVoid) {\n Query fquery = FirebaseDatabase.getInstance().getReference(\"Posts\").orderByChild(\"pId\").equalTo(postId);\n fquery.addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n for (DataSnapshot ds: dataSnapshot.getChildren()){\n\n ds.getRef().removeValue(); // remove value from firebase where pId matched\n\n }\n Toast.makeText(PostDetailActivity.this, \"Post Deleted !\", Toast.LENGTH_SHORT).show();\n progressDialog.dismiss();\n\n\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n\n }\n });\n\n\n\n }",
"public static void remove(ArrayList<Medicine> list, int id){\n // search by id\n Medicine medicine = search(list, id);\n list.remove(medicine); // reomve from list\n }",
"public void removeMovieListing(int movieId) {\n Optional<MovieListing> movieListing = Stream.of(movieListings).filter(listing -> listing.getId() == movieId).findFirst();\n if (movieListing.isPresent()) {\n int position = movieListings.indexOf(movieListing.get());\n movieListings.remove(movieListing.get());\n notifyItemRemoved(position);\n }\n }",
"@Override\n\tpublic void removeByUuid_C(String uuid, long companyId) {\n\t\tfor (Paper paper : findByUuid_C(uuid, companyId, QueryUtil.ALL_POS,\n\t\t\t\tQueryUtil.ALL_POS, null)) {\n\t\t\tremove(paper);\n\t\t}\n\t}",
"void removeHasInstitutionHomePage(Object oldHasInstitutionHomePage);",
"void removeControlPersons(int i);",
"@Override\n public void destroyItem(ViewGroup container, int position, Object object)\n {\n \n container.removeView(mPagersList.get(position));\n }",
"public void deleteById(String movieId) {\n\t\tfor(Rating r : li)\r\n\t\t{\r\n\t\t\tif(r.getMovieId().equals(movieId))\r\n\t\t\t{\r\n\t\t\t\tli.remove(r);break;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}",
"public void removeItem(int id);",
"void delete(List<ViewResourcesMappingPK> list) throws Exception;",
"public Builder clearPage() {\n if (pageBuilder_ == null) {\n page_ = null;\n onChanged();\n } else {\n page_ = null;\n pageBuilder_ = null;\n }\n\n return this;\n }",
"void removeControlPersonsExt(int i);",
"public Builder clearPageNo() {\n if (pageNoBuilder_ == null) {\n pageNo_ = null;\n onChanged();\n } else {\n pageNo_ = null;\n pageNoBuilder_ = null;\n }\n\n return this;\n }",
"public void removePayment(int n){\n assert(n <= payment.size());\n removePayment(payment.get(n));\n }",
"public void delObject(int id) {\n\n\t\t// last element?\n\t\tif (elements.size() - 1 == id) {\n\t\t\t// remove it\n\t\t\telements.remove(id);\n\t\t} else {\n\t\t\t// reset only element\n\t\t\telements.get(id).setObject(createObject());\n\t\t\telements.get(id).setModified(true);\n\t\t}\n\n\t\t// inform tab\n\t\tbuildEmptyView();\n\t}",
"@Override\n public void elimina(int id_alumno) {\n\n try {\n Alumno a = admin.alumnosTotales.get(id_alumno);\n int area = a.area;\n char grupo = a.grupo;\n\n admin.fisicoMatematicas.remove(a);\n admin.biologicasYsalud.remove(a);\n admin.cienciasSociales.remove(a);\n admin.humanidadesYartes.remove(a);\n admin.fotoLabPrensa.remove(a);\n admin.viajesyhoteleria.remove(a);\n admin.nutriologo.remove(a);\n admin.labQuimico.remove(a);\n\n Iterador<Profesor> ite = new Iterador<>(admin.profesores);\n\n while (ite.hasNext()) {\n Profesor profeActual = ite.next();\n if (profeActual.area == area & profeActual.grupo == grupo) {\n profeActual.eliminaAlumnoLista(a);\n }\n }\n \n admin.alumnosTotales.remove(id_alumno);\n \n } catch (NullPointerException e) {\n System.out.println(\"No existe el Alumno\");\n }\n \n \n\n }",
"void removeVideoFromCollection(User user, String video_id);",
"public Builder clearPageNo() {\n if (pageNoBuilder_ == null) {\n pageNo_ = null;\n onChanged();\n } else {\n pageNo_ = null;\n pageNoBuilder_ = null;\n }\n\n return this;\n }",
"@Override\n\tpublic void removeByIdSala(long id_sala) {\n\t\tfor (Approvatore approvatore : findByIdSala(id_sala, QueryUtil.ALL_POS,\n\t\t\t\tQueryUtil.ALL_POS, null)) {\n\t\t\tremove(approvatore);\n\t\t}\n\t}",
"@Override\r\n\tpublic void deleteItem() {\n\t\taPList.remove();\r\n\t}",
"public void onAnnotationsRemovedOnPage(int pageNum) {\n/* 408 */ if (!this.mPdfViewCtrl.isUndoRedoEnabled()) {\n/* */ return;\n/* */ }\n/* */ \n/* */ try {\n/* 413 */ JSONObject jsonObj = new JSONObject();\n/* 414 */ if (this.mContext != null) {\n/* 415 */ String strRemoveAnnotations = this.mContext.getResources().getString(R.string.undo_redo_annots_remove_from_page, new Object[] { Integer.valueOf(pageNum) });\n/* 416 */ jsonObj.put(\"Action\", strRemoveAnnotations);\n/* */ } \n/* 418 */ jsonObj.put(\"Action event\", \"remove_annots_from_page\");\n/* */ \n/* 420 */ if (Utils.isNullOrEmpty(jsonObj.toString())) {\n/* 421 */ AnalyticsHandlerAdapter.getInstance().sendException(new Exception(\"takeUndoSnapshot with an empty string\"));\n/* */ }\n/* */ \n/* 424 */ takeUndoSnapshot(jsonObj.toString());\n/* 425 */ if (this.mToolManager.getAnnotManager() != null) {\n/* 426 */ this.mToolManager.getAnnotManager().onLocalChange(\"delete\");\n/* */ }\n/* 428 */ if (sDebug)\n/* 429 */ Log.d(TAG, \"snapshot: \" + jsonObj.toString()); \n/* 430 */ } catch (Exception e) {\n/* 431 */ AnalyticsHandlerAdapter.getInstance().sendException(e);\n/* */ } \n/* */ }",
"public void deletePage(final long index) {\n // remove the page from cache first\n cache.remove(index);\n final String fileName = this.getFileNameByIndex(index);\n int count = 0;\n final int maxRound = 10;\n boolean deleted = false;\n while (count < maxRound)\n try {\n FileUtil.deleteFile(new File(fileName));\n deleted = true;\n break;\n }\n catch (final IllegalStateException ex) {\n try {\n Thread.sleep(200);\n }\n catch (final InterruptedException e) {\n }\n count++;\n if (logger.isDebugEnabled())\n logger.warn(\"fail to delete file \" + fileName + \", tried round = \" + count);\n }\n if (deleted)\n logger.info(\"Page file \" + fileName + \" was just deleted.\");\n else\n logger.warn(\"fail to delete file \" + fileName + \" after max \" + maxRound + \" rounds of try, you may delete it manually.\");\n }",
"private void markUnusedPagesDirty(long nextPageId) throws IgniteCheckedException {\n while (nextPageId != 0L) {\n long pageId = nextPageId;\n\n long page = acquirePage(pageId, IoStatisticsHolderNoOp.INSTANCE);\n try {\n long pageAddr = writeLock(pageId, page);\n\n try {\n PagesListMetaIO io = PagesListMetaIO.VERSIONS.forPage(pageAddr);\n\n io.resetCount(pageAddr);\n\n if (needWalDeltaRecord(pageId, page, null))\n wal.log(new PageListMetaResetCountRecord(grpId, pageId));\n\n nextPageId = io.getNextMetaPageId(pageAddr);\n }\n finally {\n writeUnlock(pageId, page, pageAddr, true);\n }\n }\n finally {\n releasePage(pageId, page);\n }\n }\n }",
"private void removeTagAndContent(ArrayList p_tags, HtmlObjects.Tag p_tag)\n {\n int i_start = 0;\n int i_end = 0;\n\n loop: for (int i = 0, max = p_tags.size(); i < max; i++)\n {\n Object o = p_tags.get(i);\n\n if (o == p_tag)\n {\n i_start = i;\n\n for (int j = i + 1; j < max; j++)\n {\n Object o1 = p_tags.get(j);\n\n if (o1 instanceof HtmlObjects.EndTag)\n {\n HtmlObjects.EndTag etag = (HtmlObjects.EndTag) o1;\n\n if (p_tag.tag.equalsIgnoreCase(etag.tag)\n && p_tag.partnerId == etag.partnerId)\n {\n i_end = j;\n break loop;\n }\n }\n }\n }\n }\n\n if (i_start >= 0 && i_end > i_start)\n {\n p_tags.subList(i_start, i_end + 1).clear();\n }\n }",
"@Override\r\n\tpublic void destroyItem(ViewGroup container, int position, Object object) {\n\t\t((ViewPager)container).removeView(list.get(position));\r\n\t}",
"public void removePageChangeListener(final PageChangeListener l) {\n this.listenerList.remove(PageChangeListener.class, l);\n }",
"private void deleteSelectedWaypoints() {\r\n\t ArrayList<String> waypointsToRemove = new ArrayList<String>();\r\n\t int size = _selectedList.size();\r\n\t for (int i = _selectedList.size() - 1; i >= 0; --i) {\r\n boolean selected = _selectedList.get(i);\r\n if (selected) {\r\n waypointsToRemove.add(UltraTeleportWaypoint.getWaypoints().get(i).getWaypointName());\r\n }\r\n }\r\n\t UltraTeleportWaypoint.removeWaypoints(waypointsToRemove);\r\n\t UltraTeleportWaypoint.notufyHasChanges();\r\n\t}",
"public void eliminarTipoPago(String codTipoPago) throws Exception {\n if (this.tiposPagos.containsKey(codTipoPago)) {\r\n this.generarAuditoria(\"BAJA\", \"TIPOPAGO\", codTipoPago, \"\", GuiIngresar.getUsuario());\r\n this.tiposPagos.remove(codTipoPago);\r\n setChanged();\r\n notifyObservers();\r\n //retorno = true;\r\n } else {\r\n throw new Exception(\"El tipo pago no Existe\");\r\n }\r\n //return retorno;\r\n }",
"public void removeConcert(long concertId){\n ArrayList<Concert> tempConcertList = cloneConcertList();\n for(Concert concert: tempConcertList){\n if(concert.getId() == concertId){\n concertList.remove(concert);\n }\n }\n }",
"private void removeDelRevisions(ArrayList p_tags)\n {\n boolean b_changed = true;\n\n deltags: while (b_changed)\n {\n for (int i = 0, max = p_tags.size(); i < max; i++)\n {\n Object o = p_tags.get(i);\n\n if (o instanceof HtmlObjects.Tag)\n {\n HtmlObjects.Tag tag = (HtmlObjects.Tag) o;\n String original = tag.original;\n\n if (tag.tag.equalsIgnoreCase(\"span\")\n && original.indexOf(\"class=msoDel\") >= 0)\n {\n removeTagAndContent(p_tags, tag);\n\n continue deltags;\n }\n }\n }\n\n b_changed = false;\n }\n }",
"@Override\n\t\t\t\tpublic void onClick(ClickEvent event) {\n\t\t\t\t\tint removeIndex = listpag.indexOf(rowb);\n\t\t\t\t\tlistpag.remove(removeIndex);\n\t\t\t\t\tgetView().getPaginaweb().removeRow(removeIndex + 1);\n\t\t\t\t}",
"@Override\r\n\tpublic void remover(int id) {\n\t\tfor(int i=0;i<TAMANHO;i++) {\r\n\t\t\tif(perfis[i] != null) {\r\n\t\t\t\tif(perfis[i].getId() == id) {\r\n\t\t\t\t\tperfis[i] = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private PageBuilder removeMostUnsed(Map<PartitionKey, PageBuilder> hash)\n {\n Iterator<Map.Entry<PartitionKey, PageBuilder>> ite = hash.entrySet().iterator();\n PageBuilder builder = ite.next().getValue();\n ite.remove();\n return builder;\n }",
"void removeDetail(String id);",
"public void deletePolynom(int position) {\n collection.remove(position);\n }",
"@Override\n public void onChildRemoved(DataSnapshot dataSnapshot) {\n int removedBooking = Integer.parseInt(dataSnapshot.getKey());\n try {\n ObservableLists.bookingsList.forEach(b -> {\n if(b.getBookingNumber() == removedBooking){\n ObservableLists.bookingsList.remove(b);\n }\n });\n } catch (ConcurrentModificationException ex){\n //This occurs because I am removing an from a list while I am iterating through that list\n //functions properly and works well however if I have time I will look at alternative ways\n }\n\n }",
"public void delete() {\r\n if (this.selectedTag != null) {\r\n for (int i = uploads.size() -1; i >= 0 ; i--) {\r\n if (this.selectedTag.equals(uploads.get(i).getTag())) {\r\n FileUtil.deleteFile(uploads.get(i).getFilepath());\r\n uploads.remove(i);\r\n break;\r\n }\r\n }\r\n }\r\n }",
"public void removeByid_(long id_);",
"public void domicilioElimina(){\r\n\t\tlog.info(\"DomicilioElimina()\");\r\n\t\tfor (int i = 0; i < DomicilioPersonaList.size(); i++) { \t\t\r\n\t \tlog.info(\"\"+DomicilioPersonaList.get(i).getItem()+\" ,idd \"+getIdd() +\" \"+DomicilioPersonaList.get(i).getDomicilio());\r\n\r\n\t\tif((DomicilioPersonaList.get(i).getIddomiciliopersona()== 0 || DomicilioPersonaList.get(i).getIddomiciliopersona()== null) && DomicilioPersonaList.get(i).getItem()==\"Por Agregar\"){\r\n\t\t\tlog.info(\"N2----> DomicilioPersonaList.get(i).getIddomiciliopersona()\" +\" \" +DomicilioPersonaList.get(i).getIddomiciliopersona());\r\n\t\t\tDomicilioPersonaSie domtemp = new DomicilioPersonaSie();\r\n\t\t\tdomtemp.setIddomiciliopersona(idd);\r\n\t\t\tDomicilioPersonaList.remove(domtemp);\r\n\t\tfor (int j = i; j < DomicilioPersonaList.size(); j++) {\r\n\t\t\tlog.info(\" i \" +i+\" j \"+ j);\r\n\t\t\ti=i+1;\r\n\t\t\tDomicilioPersonaList.set(j, DomicilioPersonaList.get(j));\r\n\t\t}break;\r\n\t\t}\r\n\t\telse if(DomicilioPersonaList.get(i).getIddomiciliopersona() ==(getIdd()) && DomicilioPersonaList.get(i).getItem()==\"Agregado\"){\r\n\t\t\tlog.info(\"ALERTA WDFFFF\");\r\n\t\t\tDomicilioPersonaSie obj = new DomicilioPersonaSie();\r\n\t\t\tobj.setIddomiciliopersona(idd);\r\n\t\t\tlog.info(\"DENTRO LISTA DESHABILITADO\");\r\n\t\t\tDomicilioPersonaDeshabilitado.add(obj);\t\r\n\t\t\tFaceMessage.FaceMessageError(\"ALERTA\", \"Los Cambios se realizaran despues de hacer clic en el boton Guardar\");\t\t\t\r\n//\t\t\tmsg = new FacesMessage(FacesMessage.SEVERITY_WARN,\r\n//\t\t\tConstants.MESSAGE_ERROR_TELEFONO_CLIENTE,mensaje);\r\n//\t\t\tFacesContext.getCurrentInstance().addMessage(null, msg);\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void removeByCompanyId(long companyId);",
"@Override\r\n\tpublic void action() throws Exception {\n\t\tthis.pageAction();\r\n\t\t//when action finished \r\n\t\tInteger currentPageNumber = (Integer) context.get(\"currentPageNumber\");\r\n\t\tString currentPageContent = (String)context.get(\"currentPageContent\");\r\n\t if(currentPageNumber!=null){\r\n\t\t\tcontext.remove(currentPageNumber);\r\n\t\t}\r\n\t\tif(currentPageContent!=null){\r\n\t\t\tcontext.remove(currentPageContent);\r\n\t\t}\r\n\t\t//action end\r\n\t\t//after action remove the previous variables\r\n\t\t\r\n\t\tcontext.remove(\"pageUrlRegex\");\r\n\t\tcontext.remove(\"contentRegex\");\r\n\r\n\t\tcontext.remove(\"pageSize\");\r\n\r\n\t\tcontext.remove(\"totalRecorderNumber\");\r\n\t\tcontext.remove(\"currentFieldName\");\r\n\r\n\t}",
"public void removeParam(int index) {\n params = Lists.remove(params, index);\n }",
"public Builder clearPageNoNull() {\n \n pageNoNull_ = false;\n onChanged();\n return this;\n }",
"public void removeVoting(int index){\n if (index>=0 && index< votingList.size()){\n votingList.remove(index);\n }\n else {\n System.out.println(\"index is not valid\");\n }\n\n }",
"void deleteSppprmFromPrimesRejetees(\r\n\t\t\tList<Pointage> listPointageRejetesVentilesOrderedByDateAsc);",
"@Override\n\tpublic void removeByUuid_C(String uuid, long companyId)\n\t\tthrows SystemException {\n\t\tfor (TvShow tvShow : findByUuid_C(uuid, companyId, QueryUtil.ALL_POS,\n\t\t\t\tQueryUtil.ALL_POS, null)) {\n\t\t\tremove(tvShow);\n\t\t}\n\t}",
"public void removeIt() { \n\t\t\tcollection.remove(currIndex);\n\t\t\tcurrIndex--;\n\t\t}",
"@Override\n\tpublic void removeAll() {\n\t\tfor (VcmsPortion vcmsPortion : findAll()) {\n\t\t\tremove(vcmsPortion);\n\t\t}\n\t}",
"private synchronized void evictPage() throws DbException {\n // some code goes here\n // not necessary for lab1\n Page pg = bufferPool.evictPage();\n PageId pid = pg.getId();\n try {\n if (pg != null) {\n flushPage(pid);\n discardPage(pid);\n }\n } catch (IOException e) {\n throw new DbException(\"evictPage: unable to error when flush a page\");\n }\n }",
"public void remove(Object selObj){\n\t\t_list.removeElement(selObj);\n\t}",
"public void removeAtIndexFor(int index, int size) {\r\n int start = offset + index + size;\r\n int end = offset + count;\r\n ArrayUtils.shiftDown(objects, size, start, end, false);\r\n count -= size;\r\n }",
"@Override\n\tpublic void destroyItem(View container, int position, Object object) {\n\t\t((ViewPager) container).removeView(mList.get(position));\n\t}",
"@Override\r\n\tpublic int delete(int num) {\n\t\treturn mypagedao.delete(num);\r\n\t}",
"void removeNextId(int nextId);",
"public void removeConfigPage()\r\n {\r\n getSemanticObject().removeProperty(swpres_configPage);\r\n }",
"public void eliminarVideojuegoPorPlataforma(String plataforma)\n {\n Iterator<Videojuegos> iteration = listaDeVideojuegos.iterator();\n while(iteration.hasNext()){\n Videojuegos iter = iteration.next();\n String plataformaVideojuego = iter.getPlataforma();\n if(plataformaVideojuego.equals(plataforma)){\n iteration.remove();\n }\n }\n }",
"public void removeParade(){\n\t\tfor(int i = 0; i < count; i++){\n\t\t\tthis.getChildren().remove(paradeCards[i]);\n\t\t}\n\t}",
"public void delParticipant (int idParticipant){\n for (Participant participant :lesParticipants){\n if (participant.getIdParticipant()==idParticipant){\n lesParticipants.remove(participant);\n } \n }\n }",
"@Override\n\tpublic void removeByUuid(String uuid) {\n\t\tfor (Paper paper : findByUuid(uuid, QueryUtil.ALL_POS,\n\t\t\t\tQueryUtil.ALL_POS, null)) {\n\t\t\tremove(paper);\n\t\t}\n\t}",
"public boolean deletePagesInfo (java.lang.String in_page_no) throws com.mcip.orb.CoException {\n return this._delegate.deletePagesInfo(in_page_no);\n }",
"public void removeOrderDetails(final Map idList);",
"public void clean(ImageView view) {\n for (int i = 0; i < photosToLoad.size(); ) {\n if (photosToLoad.get(i).imageView == view) {\n photosToLoad.remove(i);\n }\n else {\n ++i;\n }\n }\n }",
"public void removeBycourse_id(long course_id);",
"@Override\n public boolean equals(Object object) {\n if (!(object instanceof Pages)) {\n return false;\n }\n Pages other = (Pages) object;\n if ((this.pageId == null && other.pageId != null) || (this.pageId != null && !this.pageId.equals(other.pageId))) {\n return false;\n }\n return true;\n }",
"void removeIdFromList(Integer mCanalId);"
] | [
"0.6092238",
"0.5610374",
"0.5573516",
"0.5548737",
"0.54643345",
"0.54221016",
"0.5416851",
"0.540953",
"0.53804785",
"0.5348807",
"0.53444946",
"0.53151023",
"0.5309161",
"0.52178943",
"0.51787335",
"0.5177916",
"0.5177382",
"0.5174104",
"0.5170631",
"0.5150273",
"0.5141476",
"0.5139282",
"0.5135237",
"0.50864965",
"0.50862175",
"0.50767064",
"0.5059677",
"0.5058849",
"0.50575304",
"0.5053511",
"0.5034152",
"0.5004121",
"0.4999654",
"0.4948217",
"0.4924893",
"0.48930362",
"0.48899207",
"0.48767364",
"0.48531568",
"0.48510987",
"0.48477998",
"0.4847169",
"0.48355222",
"0.48309752",
"0.48145753",
"0.48143563",
"0.47932953",
"0.47917038",
"0.47916687",
"0.47879705",
"0.47788897",
"0.47778615",
"0.47761214",
"0.47673568",
"0.47541893",
"0.47502875",
"0.47352672",
"0.47185835",
"0.46952602",
"0.46925518",
"0.46900108",
"0.46819338",
"0.4678361",
"0.46763298",
"0.4672446",
"0.46704915",
"0.4662379",
"0.46468094",
"0.46379563",
"0.46334156",
"0.46322027",
"0.46272606",
"0.46206474",
"0.46185195",
"0.46157014",
"0.46082342",
"0.46068975",
"0.46009606",
"0.4594053",
"0.45928198",
"0.45923975",
"0.45915923",
"0.45883623",
"0.45854303",
"0.45844406",
"0.4583976",
"0.458327",
"0.45822135",
"0.45775768",
"0.45729885",
"0.45719394",
"0.45705283",
"0.45684832",
"0.45649302",
"0.45634428",
"0.45604557",
"0.45568138",
"0.45466977",
"0.45438278",
"0.45377743"
] | 0.66933995 | 0 |
Retrieves the map collection key by using the enum to validate the section value passed in. | protected String checkCollectionKey(String section) throws ActionException {
log.debug("evaluating section val: " + section);
String key = StringUtil.checkVal(section).toUpperCase();
try {
Section.valueOf(key);
} catch (Exception e) {
throw new ActionException("Unknown section value: " + section);
}
return key;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static AbstractType<?> keyType(CollectionType<?> type)\n {\n return type.nameComparator();\n }",
"private static URLMapping getURLMappingByKey(String key, URLMappingEnum urlMappingEnum) {\n\n if (urlMappingEnum == URLMappingEnum.ACTION) {\n\n for (URLMapping urlMapping : urlMappingList) {\n\n if (StringUtils.equals(urlMapping.getSplitKey()[1], ACTION_PREFIX)\n && StringUtils.equals(urlMapping.getSplitKey()[2], key)) {\n return urlMapping;\n }\n }\n } else {\n\n for (URLMapping urlMapping : urlMappingList) {\n\n if (StringUtils.equals(urlMapping.getSplitKey()[1], PARAM_PREFIX)\n && StringUtils.equals(urlMapping.getSplitKey()[2], key)) {\n return urlMapping;\n }\n }\n }\n\n return null;\n }",
"String getLookupKey();",
"java.lang.String getKey();",
"java.lang.String getKey();",
"java.lang.String getKey();",
"java.lang.String getKey();",
"java.lang.String getKey();",
"java.lang.String getKey();",
"String getKey(int index);",
"String getKey();",
"String getKey();",
"String getKey();",
"String getKey();",
"String getKey();",
"String getKey();",
"String getKey();",
"String getKey();",
"String getKey();",
"String getKey();",
"String getKey();",
"String getKey();",
"String getKey();",
"public static CollectionStatus codeOf(Object code) {\n if (code == null) { return null; }\n if (code instanceof CollectionStatus) { return (CollectionStatus)code; }\n return _codeValueMap.get(code.toString().toLowerCase());\n }",
"String getIdFieldName(String collectionName) {\n HashMap<String,Object> collection = getCollectionConfig(collectionName);\n if (collection == null || !collection.containsKey(\"idField\")) return null;\n String indexField = collection.get(\"idField\").toString();\n if (!collection.containsKey(\"fields\")) return null;\n HashMap<String,Object> fields = (HashMap<String,Object>)collection.get(\"fields\");\n if (!fields.containsKey(indexField)) return null;\n return indexField;\n }",
"public static JavaType getKeyType(DeserializationContext ctxt, BeanProperty property) {\n\t\tJavaType type = (property == null ? null : property.getType().containedType(0));\n \t \n \t if(type == null) {\n \t\t type = ctxt.getContextualType().containedType(0);\n \t }\n \t \n \t if(type == null && ctxt.getContextualType() instanceof MapLikeType) {\n \t\t type = ((MapLikeType) ctxt.getContextualType()).getKeyType();\n \t }\n\t\treturn type;\n\t}",
"Object getKey();",
"Resolvable<String> getKey(int index);",
"int getKey();",
"int getKey();",
"default String getKey() {\n return key(getClassName(), getName());\n }",
"int getKey(int i);",
"private String getKey(int houseNo, int colorNo) {\n return houseNo + \"_\" + colorNo;\n }",
"public HasID get(@SuppressWarnings(\"rawtypes\") Class type, String key);",
"public String getKey();",
"public String getKey();",
"public String getKey();",
"public String getKey();",
"public KeyEnum getKeyEnum() {\n return this.key;\n }",
"boolean hasKey(String collection, String hkey);",
"private Object findByNameProperty(String key, Collection collection) throws InvocationTargetException, IllegalAccessException, NoSuchMethodException {\n for (Object candidate : collection) {\n Object candidateName = getProperty(candidate, \"name\");\n if (candidateName != null && key.equals(candidateName.toString())) {\n return candidate;\n }\n }\n return null;\n }",
"public int getKeyMap() {\r\n return Input.Keys.valueOf(keyMapName);\r\n }",
"public final String entryRuleCollectionTypeIdentifier() throws RecognitionException {\n String current = null;\n\n AntlrDatatypeRuleToken iv_ruleCollectionTypeIdentifier = null;\n\n\n try {\n // InternalMyDsl.g:5743:64: (iv_ruleCollectionTypeIdentifier= ruleCollectionTypeIdentifier EOF )\n // InternalMyDsl.g:5744:2: iv_ruleCollectionTypeIdentifier= ruleCollectionTypeIdentifier EOF\n {\n if ( state.backtracking==0 ) {\n newCompositeNode(grammarAccess.getCollectionTypeIdentifierRule()); \n }\n pushFollow(FOLLOW_1);\n iv_ruleCollectionTypeIdentifier=ruleCollectionTypeIdentifier();\n\n state._fsp--;\n if (state.failed) return current;\n if ( state.backtracking==0 ) {\n current =iv_ruleCollectionTypeIdentifier.getText(); \n }\n match(input,EOF,FOLLOW_2); if (state.failed) return current;\n\n }\n\n }\n\n catch (RecognitionException re) {\n recover(input,re);\n appendSkippedTokens();\n }\n finally {\n }\n return current;\n }",
"public int getKey() {\n\t\treturn 0;\n\t}",
"public abstract String getLocalizationKey();",
"private static String getCollectionArgument(Map<String, Entity> entitiesMap, FieldType fieldType) {\r\n if (!fieldType.getTypeArguments().isEmpty()) {\r\n return fieldType.getTypeArguments()\r\n .stream()\r\n .map(FieldType::transformName)\r\n .filter(entitiesMap::containsKey)\r\n .findFirst()\r\n .orElse(fieldType.getTypeArguments().get(0));\r\n } else {\r\n return fieldType.getName();\r\n }\r\n }",
"public abstract FieldKey getParticipantIDFieldKey(Map<LinkToStudyKeys, FieldKey> fieldKeyMap);",
"public org.biocatalogue.x2009.xml.rest.TagsParameters.Sort.UrlKey.Enum getUrlKey()\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_attribute_user(URLKEY$0);\r\n if (target == null)\r\n {\r\n return null;\r\n }\r\n return (org.biocatalogue.x2009.xml.rest.TagsParameters.Sort.UrlKey.Enum)target.getEnumValue();\r\n }\r\n }",
"public String createKey(String type) {\n int i = 0;\n for(i=0; i<EnumFactory.numberOfTypes; i++) {\n if (type.equals(EnumFactory.typeStrings[i])) {\n break;\n }\n }\n countKeys[i]++;\n String key = String.format(\"%s$%d\", EnumFactory.typeStrings[i],countKeys[i]);\n return key;\n }",
"public int getMandatoryInt(String key) throws ConfigNotFoundException;",
"@MapName(\"lnfkey\")\n \tString getLnfKey();",
"abstract public String getKey();",
"String get(Integer key);",
"String getLocaleKey(String subject);",
"@Override\n public Class<?> getKeyClass() {\n return this.isCollection() && this.getKeyDataClassDefinition() != null?this.getKeyDataClassDefinition().getDataClass():null;\n }",
"TemplateModel getKey();",
"public String getKey()\r\n {\r\n return getValue().toString();\r\n }",
"public String getColumnKey(int col){\n return keys.get(col);\n }",
"public String getLookupKey() {\n return queryLookupKey(contactId);\n }",
"public String getCategoryKey() {\n return getCategory().getWordVal();\n }",
"private <T, E> T getKeyByValue(Map<T, E> map, E value) {\n for (Map.Entry<T, E> entry : map.entrySet()) {\n if (value.equals(entry.getValue())) {\n return entry.getKey();\n }\n }\n return null;\n }",
"public static <T extends EnumWithKey> T fromKey(Class<T> enumType, String key) {\n\t\tfor (T enumValue : enumType.getEnumConstants()) {\n\t\t\tif (enumValue.getKey().equals(key)) {\n\t\t\t\treturn enumValue;\n\t\t\t}\n\t\t}\n\n\t\tthrow new IllegalArgumentException(\"Invalid key: \" + key);\n\t}",
"K findKeyForValue(V val);",
"public String getKey() { \n\t\treturn getKeyElement().getValue();\n\t}",
"@Override\n public int getKey() {\n return key_;\n }",
"protected String getKey(int index)\n/* */ {\n/* 1425 */ return null;\n/* */ }",
"private static Object findKey(Map<?, ?> in, Object value) {\n\t\tfor (Object key : in.keySet()) {\n\t\t\tif (in.get(key).equals(value)) {\n\t\t\t\treturn key;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public int getPropertyInt(String key);",
"@Override\n public int getKey() {\n return key_;\n }",
"NestedListKey getKey();",
"public int getKey() {\n\t\t\treturn this.key; // to be replaced by student code\n\t\t}",
"@Override\n protected String handleGetExceptionKey()\n {\n\n final String type = this.getExceptionType();\n final int dotIndex = type.lastIndexOf(\".\");\n\n // the dot may not be the last character\n return StringUtilsHelper.toResourceMessageKey((dotIndex < (type.length() - 1)) ? type.substring(dotIndex + 1) : type);\n\n }",
"public IValidator get(String key)\n {\n \t return validatorMap.get(key);\n }",
"String key();",
"public String getMaxKey() {\n if (list.isEmpty()) {\n return \"\";\n }\n return v.get(list.getFirst()).iterator().next();\n }",
"private static URLMapping getURLMappingByValue(String value, URLMappingEnum urlMappingEnum) {\n\n if (urlMappingEnum == URLMappingEnum.ACTION) {\n\n for (URLMapping urlMapping : urlMappingList) {\n\n if (StringUtils.equals(urlMapping.getSplitKey()[1], ACTION_PREFIX)\n && StringUtils.equals(urlMapping.getFinalValue(), value)) {\n return urlMapping;\n }\n }\n } else {\n\n for (URLMapping urlMapping : urlMappingList) {\n\n if (StringUtils.equals(urlMapping.getSplitKey()[1], PARAM_PREFIX)\n && StringUtils.equals(urlMapping.getValue(), value)) {\n return urlMapping;\n }\n }\n }\n return null;\n }",
"int getSectionID(Vector<Integer> sectionIDs, Vector<Integer> sectionLinIDs, Vector<String> sectionCodes, String cellValue, int lineID);",
"public static CollectionTypes get(int value) {\n\t\tswitch (value) {\n\t\t\tcase SET_VALUE: return SET;\n\t\t\tcase BAG_VALUE: return BAG;\n\t\t\tcase SEQUENCE_VALUE: return SEQUENCE;\n\t\t}\n\t\treturn null;\n\t}",
"public String getMinKey() {\n if (list.isEmpty()) {\n return \"\";\n }\n return v.get(list.getLast()).iterator().next();\n }",
"XClass getMapKey();",
"public static CollectionStatus nameOf(String name) {\n if (name == null) { return null; }\n try { return valueOf(name); } catch (RuntimeException ignored) { return null; }\n }",
"public com.hps.july.persistence.DivisionKey getDivisionKey() throws java.rmi.RemoteException, javax.ejb.CreateException, javax.ejb.FinderException, javax.naming.NamingException {\n return (((com.hps.july.persistence.DivisionKey) __getCache(\"divisionKey\")));\n }",
"public com.hps.july.persistence.DivisionKey getDivisionKey() throws java.rmi.RemoteException, javax.ejb.CreateException, javax.ejb.FinderException, javax.naming.NamingException {\n return (((com.hps.july.persistence.DivisionKey) __getCache(\"divisionKey\")));\n }",
"public Object getKey() { return name; }",
"HashMap<String,Object> getCollectionConfig(String collectionName) {\n if (!this.collections.containsKey(collectionName)) return null;\n return (HashMap<String,Object>)collections.get(collectionName);\n }",
"private int getUnitKey(){\n\t\t\n\t\tint panelIndex = tabbedPane.getSelectedIndex();\n\t\tString keyString = tabbedPane.getTitleAt(panelIndex);\n\t\t\n\t\tif(panelIndex == LOCAL_UNIT)// local unit selected\n\t\t\treturn LOCAL_UNIT;\n\t\telse{\n\t\t\tint key = Integer.parseInt(keyString.split(\" \")[2]);\n\t\t\treturn key;\n\t\t}\n\t}",
"BListKey getKey();",
"public String getOutputKeyCollectionName() {\r\n return OutputKeyCollectionName;\r\n }",
"@Override\n public int getKey() {\n return this.key;\n }",
"private static <K, V> K getKey(final Map<K, V> map, final V value) {\n if (value == null) {\n return null; // None of the maps have a null value anyway.\n }\n\n for (final Entry<K, V> entry : map.entrySet()) {\n if (value.equals(entry.getValue())) {\n return entry.getKey();\n }\n }\n\n return null;\n }",
"public int getKey(){\n return key;\n }",
"@Override\n public byte key() {\n return keys[entryIndex];\n }",
"java.lang.String getContKey();",
"Class<?> getKeyType();",
"private Integer getRandomMapKey() {\r\n\t\tList<Integer> mapKeys = new ArrayList<Integer>(this.compleQuestions.keySet());\r\n\t\tint randomIndex = (int) (Math.random() * mapKeys.size());\r\n\t\treturn mapKeys.get(randomIndex);\r\n\t}",
"public static String getKey(){\n\t\treturn key;\n\t}",
"public Object lookupConfigurationEntry(String key);",
"@Override\r\n\tpublic String getKey() {\n\t\treturn null;\r\n\t}",
"@Override\r\n\tpublic String getKey() {\n\t\treturn null;\r\n\t}",
"protected String getKeymapName() {\n String nm = getClass().getName();\n int index = nm.lastIndexOf('.');\n if (index >= 0) {\n nm = nm.substring(index+1);\n }\n return nm;\n }"
] | [
"0.574965",
"0.5371903",
"0.52174085",
"0.52127606",
"0.52127606",
"0.52127606",
"0.52127606",
"0.52127606",
"0.52127606",
"0.5161142",
"0.5136229",
"0.5136229",
"0.5136229",
"0.5136229",
"0.5136229",
"0.5136229",
"0.5136229",
"0.5136229",
"0.5136229",
"0.5136229",
"0.5136229",
"0.5136229",
"0.5136229",
"0.5112615",
"0.5099854",
"0.5081533",
"0.5065016",
"0.50482947",
"0.50094265",
"0.50094265",
"0.50010735",
"0.49955586",
"0.491717",
"0.49162483",
"0.4911485",
"0.4911485",
"0.4911485",
"0.4911485",
"0.4895999",
"0.48938036",
"0.48512176",
"0.4839454",
"0.48363793",
"0.4830161",
"0.4829702",
"0.48273897",
"0.4804885",
"0.4789038",
"0.4778175",
"0.4770259",
"0.4747687",
"0.47374254",
"0.47256193",
"0.47124326",
"0.46996456",
"0.4687323",
"0.467986",
"0.46690807",
"0.4655365",
"0.4646665",
"0.4645064",
"0.46388704",
"0.46236634",
"0.4620179",
"0.46084902",
"0.46073273",
"0.4603628",
"0.45937648",
"0.4590278",
"0.4582711",
"0.45772278",
"0.45763162",
"0.4572328",
"0.45721832",
"0.45687467",
"0.45620024",
"0.45599866",
"0.4549033",
"0.4543604",
"0.45300937",
"0.45275557",
"0.45229283",
"0.45229283",
"0.45092434",
"0.45030904",
"0.449698",
"0.44702122",
"0.44638008",
"0.44599265",
"0.4457294",
"0.4453051",
"0.44520852",
"0.4450868",
"0.44502395",
"0.4448913",
"0.44478142",
"0.44385546",
"0.4432351",
"0.4432351",
"0.44259554"
] | 0.6694656 | 0 |
Parses a user's favorites into a map of page views keyed by section (e.g. MARKET, COMPANY, etc.). | @SuppressWarnings("unchecked")
protected Map<String, List<PageViewVO>> processUserFavorites(ModuleVO mod)
throws ActionException {
log.debug("processUserFavorites...");
Map<String, List<PageViewVO>> pageMap = initializePageMap();
if (mod.getErrorCondition()) return pageMap;
List<FavoriteVO> favs = (List<FavoriteVO>)mod.getActionData();
for (FavoriteVO fav : favs) {
log.debug("found fav, typeCd | relId | uriTxt: " + fav.getTypeCd() + "|" + fav.getRelId() + "|" + fav.getUriTxt());
if (fav.getAsset() == null) continue;
processFavorite(pageMap,fav);
}
return pageMap;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void populateFavoritesSections() {\n \tif (mUserProfile.userFavoriteAlbums != null && !Utils.isListEmpty(mUserProfile.userFavoriteAlbums.albums)) {\n \t\tmContainerFavoriteAlbums.setVisibility(View.VISIBLE);\n \t\t\n \t\tUserFavoriteAlbums userFavoriteAlbums = mUserProfile.userFavoriteAlbums;\n \t\tmTextFavoriteFavoriteAlbumsValue.setText(Integer.toString(userFavoriteAlbums.albumCount));\n \t\t\n \t\tStack<ImageView> favoriteAlbumsImages = new Stack<ImageView>();\n \t\tfavoriteAlbumsImages.add(mTextFavoriteFavoriteAlbum3);\n \t\tfavoriteAlbumsImages.add(mTextFavoriteFavoriteAlbum2);\n \t\tfavoriteAlbumsImages.add(mTextFavoriteFavoriteAlbum1);\n\n \t\tImageView albumImage = null;\n \t\t\n \t\tfor (MediaItem mediaItem : userFavoriteAlbums.albums) {\n \t\t\tif (favoriteAlbumsImages.isEmpty())\n \t\t\t\tbreak;\n \t\t\t\n \t\t\talbumImage = favoriteAlbumsImages.pop();\n \t\t\t\n \t\t\t//mImageFetcher.loadImage(mediaItem.getImageUrl(), albumImage);\n \t\t\t\n \t\t\tPicasso.with(getActivity()).cancelRequest(albumImage);\n \t\t\tif(getActivity() != null && mediaItem.getImageUrl() != null){\n \t\t\t\tPicasso.with(getActivity()).load(mediaItem.getImageUrl()).into(albumImage);\t\n \t\t\t}\n\t\t\t}\n \t\t\n \t} else {\n \t\tmContainerFavoriteAlbums.setVisibility(View.GONE);\n \t}\n \t\n \t// populates the favorite songs.\n \tif (mUserProfile.userFavoriteSongs != null && !Utils.isListEmpty(mUserProfile.userFavoriteSongs.songs)) {\n \t\tmContainerFavoriteSongs.setVisibility(View.VISIBLE);\n \t\t\n \t\tUserFavoriteSongs userFavoriteSongs = mUserProfile.userFavoriteSongs;\n \t\tmTextFavoriteSongsValue.setText(Integer.toString(userFavoriteSongs.songsCount));\n \t\t\n \t\tStack<TextView> favoriteSongsNames = new Stack<TextView>();\n \t\tfavoriteSongsNames.add(mTextFavoriteSong3Name);\n \t\tfavoriteSongsNames.add(mTextFavoriteSong2Name);\n \t\tfavoriteSongsNames.add(mTextFavoriteSong1Name);\n\n \t\tTextView songName = null;\n \t\t\n \t\tfor (MediaItem mediaItem : userFavoriteSongs.songs) {\n \t\t\tif (favoriteSongsNames.isEmpty())\n \t\t\t\tbreak;\n \t\t\t\n \t\t\tsongName = favoriteSongsNames.pop();\n \t\t\tsongName.setText(mediaItem.getTitle());\n\t\t\t}\n \t\t\n \t} else {\n \t\tmContainerFavoriteSongs.setVisibility(View.GONE);\n \t}\n \t\n \t// populates the favorite playlists.\n \tif (mUserProfile.userFavoritePlaylists != null && !Utils.isListEmpty(mUserProfile.userFavoritePlaylists.playlists)) {\n \t\tmContainerFavoritePlaylists.setVisibility(View.VISIBLE);\n \t\t\n \t\tUserFavoritePlaylists userFavoritePlaylists = mUserProfile.userFavoritePlaylists;\n \t\tmTextFavoritePlaylistValue.setText(Integer.toString(userFavoritePlaylists.playlistCount));\n \t\t\n \t\tStack<TextView> favoritePlaylistsNames = new Stack<TextView>();\n \t\tfavoritePlaylistsNames.add(mTextFavoritePlaylist3Name);\n \t\tfavoritePlaylistsNames.add(mTextFavoritePlaylist2Name);\n \t\tfavoritePlaylistsNames.add(mTextFavoritePlaylist1Name);\n\n \t\tTextView playlistsName = null;\n \t\t\n \t\tfor (MediaItem mediaItem : userFavoritePlaylists.playlists) {\n \t\t\tif (favoritePlaylistsNames.isEmpty())\n \t\t\t\tbreak;\n \t\t\t\n \t\t\tplaylistsName = favoritePlaylistsNames.pop();\n \t\t\tplaylistsName.setText(mediaItem.getTitle());\n\t\t\t}\n \t\t\n \t} else {\n \t\tmContainerFavoritePlaylists.setVisibility(View.GONE);\n \t}\n \t\n \t// populates the favorite videos.\n \tif (mUserProfile.userFavoriteVideos != null && !Utils.isListEmpty(mUserProfile.userFavoriteVideos.videos)) {\n \t\tmContainerFavoriteVideos.setVisibility(View.VISIBLE);\n \t\t\n \t\tUserFavoriteVideos userFavoriteVideos = mUserProfile.userFavoriteVideos;\n \t\tmTextFavoriteVideosValue.setText(Integer.toString(userFavoriteVideos.videoCount));\n \t\t\n \t\tStack<ImageView> favoriteVideosImages = new Stack<ImageView>();\n \t\tfavoriteVideosImages.add(mTextFavoriteVideo3);\n \t\tfavoriteVideosImages.add(mTextFavoriteVideo2);\n \t\tfavoriteVideosImages.add(mTextFavoriteVideo1);\n\n \t\tImageView videoImage = null;\n \t\t\n \t\tfor (MediaItem mediaItem : userFavoriteVideos.videos) {\n \t\t\tif (favoriteVideosImages.isEmpty())\n \t\t\t\tbreak;\n \t\t\t\n \t\t\tvideoImage = favoriteVideosImages.pop();\n \t\t\t\n \t\t\t//mImageFetcher.loadImage(mediaItem.getImageUrl(), videoImage);\n \t\t\t\n \t\t\tPicasso.with(getActivity()).cancelRequest(videoImage);\n \t\t\tif(getActivity() != null && !TextUtils.isEmpty(mediaItem.getImageUrl())){\n \t\t\t\tPicasso.with(getActivity()).load(mediaItem.getImageUrl()).into(videoImage); \t\t\t\t\n \t\t\t}\n\t\t\t}\n \t\t\n \t} else {\n \t\tmContainerFavoriteVideos.setVisibility(View.GONE);\n \t}\n\t}",
"protected void processFavorite(Map<String,List<PageViewVO>> pages, FavoriteVO fav) {\n\t\ttry {\n\t\t\tcheckCollectionKey(fav.getTypeCd());\n\t\t} catch (Exception e) {\n\t\t\t// this fav is not a 'Section' type so return.\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// convert favorite into a PageViewVO\n\t\tPageViewVO page = new PageViewVO();\n\t\tpage.setReferenceCode(fav.getTypeCd());\n\t\tpage.setPageId(fav.getRelId());\n\t\tpage.setRequestUri(fav.getUriTxt());\n\n\t\tif (fav.getAsset() != null) {\n\t\t\tSolrDocument sDoc = (SolrDocument)fav.getAsset();\n\t\t\tpage.setPageDisplayName(sDoc.getFieldValue(SearchDocumentHandler.TITLE).toString());\n\t\t}\n\n\t\tlog.debug(\"adding favorite: ref cd | pageId | uri | name: \" + page.getReferenceCode() +\"|\"+page.getPageId() +\"|\"+page.getRequestUri() +\"|\"+page.getPageDisplayName());\n\n\t\tList<PageViewVO>pList = pages.get(page.getReferenceCode());\n\t\tif (pList != null)\n\t\t\tpList.add(page);\n\t}",
"@SuppressWarnings(\"unchecked\")\n public List<IUserLayoutNodeDescription> getFavoritePortletLayoutNodes(IUserLayout userLayout) {\n\n logger.trace(\"Extracting favorite portlets from layout [{}]\", userLayout);\n\n List<IUserLayoutNodeDescription> favorites = new LinkedList<>();\n\n Enumeration<String> childrenOfRoot = userLayout.getChildIds(userLayout.getRootId());\n\n // loop over folders that might be the favorites folder\n while (childrenOfRoot.hasMoreElements()) {\n String nodeId = childrenOfRoot.nextElement();\n\n try {\n\n IUserLayoutNodeDescription nodeDescription = userLayout.getNodeDescription(nodeId);\n\n if (FOLDER.equals(nodeDescription.getType())\n && nodeDescription instanceof IUserLayoutFolderDescription) {\n\n IUserLayoutFolderDescription folderDescription =\n (IUserLayoutFolderDescription) nodeDescription;\n\n if (FAVORITES_TYPE.equalsIgnoreCase(folderDescription.getFolderType())) {\n // TODO: assumes columns structure, but should traverse tree to collect all\n // portlets regardless\n Enumeration<String> columns = userLayout.getChildIds(nodeId);\n\n // loop through columns to gather beloved portlets\n while (columns.hasMoreElements()) {\n String column = columns.nextElement();\n Enumeration<String> portlets = userLayout.getChildIds(column);\n while (portlets.hasMoreElements()) {\n String portlet = portlets.nextElement();\n IUserLayoutNodeDescription portletDescription =\n userLayout.getNodeDescription(portlet);\n favorites.add(portletDescription);\n }\n }\n } else {\n logger.trace(\"Ignoring non-favorites folder node [{}]\", nodeDescription);\n }\n\n } else {\n logger.trace(\"Ignoring non-folder node [{}]\", nodeDescription);\n }\n\n } catch (Exception e) {\n logger.error(\n \"Ignoring on error a node while examining for favorites: node ID is [{}]\",\n nodeId,\n e);\n }\n }\n\n logger.debug(\"Extracted favorite portlets [{}] from [{}]\", favorites, userLayout);\n\n return favorites;\n }",
"public List<IUserLayoutNodeDescription> getFavoriteCollections(IUserLayout userLayout) {\n\n if (null == userLayout) {\n throw new IllegalArgumentException(\n \"Cannot get favorites collections from a null userLayout\");\n }\n\n logger.trace(\"Extracting favorites collections from layout [{}].\", userLayout);\n\n Enumeration<String> nodeIds = userLayout.getChildIds(userLayout.getRootId());\n\n List<IUserLayoutNodeDescription> results = new LinkedList<IUserLayoutNodeDescription>();\n\n while (nodeIds.hasMoreElements()) {\n String nodeId = nodeIds.nextElement();\n\n try {\n IUserLayoutNodeDescription nodeDescription = userLayout.getNodeDescription(nodeId);\n\n String parentId = userLayout.getParentId(nodeId);\n String nodeName = nodeDescription.getName();\n IUserLayoutNodeDescription.LayoutNodeType nodeType = nodeDescription.getType();\n\n if (FOLDER.equals(nodeType)\n && nodeDescription instanceof IUserLayoutFolderDescription) {\n\n IUserLayoutFolderDescription folderDescription =\n (IUserLayoutFolderDescription) nodeDescription;\n\n String folderType = folderDescription.getFolderType();\n\n if (FAVORITE_COLLECTION_TYPE.equals(folderType)) {\n\n results.add(nodeDescription);\n\n logger.trace(\n \"Selected node with id [{}] named [{}] with \"\n + \"folderType [{}] and type [{}] as a collection of favorites.\",\n nodeId,\n nodeName,\n folderType,\n nodeType);\n\n } else {\n\n logger.trace(\n \"Rejected node with id [{}] named [{}] with \"\n + \"folderType [{}] and type [{}] as not a collection of favorites.\",\n nodeId,\n nodeName,\n folderType,\n nodeType);\n }\n\n } else {\n logger.trace(\n \"Rejected non-folder node with id [{}] named [{}] \"\n + \"with parentId [{}] and type [{}] as not a collection of favorites.\",\n nodeId,\n nodeName,\n parentId,\n nodeType);\n }\n\n // if something goes wrong in processing a node, exclude it\n } catch (Exception e) {\n logger.error(\n \"Error determining whether to include layout node [{}]\"\n + \" as a collection of favorites. Excluding.\",\n nodeId,\n e);\n }\n }\n\n logger.debug(\"Extracted favorites collections [{}] from [{}]\", results, userLayout);\n\n return results;\n }",
"private Set<IPortletDefinition> calculateFavoritePortlets(HttpServletRequest request) {\n final IUserInstance ui = userInstanceManager.getUserInstance(request);\n final UserPreferencesManager upm = (UserPreferencesManager) ui.getPreferencesManager();\n final IUserLayoutManager ulm = upm.getUserLayoutManager();\n final IUserLayout layout = ulm.getUserLayout();\n final Set<IPortletDefinition> rslt = favoritesUtils.getFavoritePortletDefinitions(layout);\n\n log.debug(\n \"Found the following favoritePortlets for user='{}': {}\",\n request.getRemoteUser(),\n rslt);\n return rslt;\n }",
"private void getUsersFavorites(String user) throws TwitterException {\n System.out.println(\"##########Getting \".concat(user).concat(\" Likes##########\"));\n List<Status> tweets = twitter.getFavorites(user);\n List<User> topics = new LinkedList<>();\n for (Status status : tweets) {\n\n User userLike = status.getUser();\n if (!user.equals(userLike.getScreenName()))\n topics.add(status.getUser());\n\n }\n addEdgesToGraph(user, topics);\n }",
"private void getFavorites(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {\n\t\ttry {\n\t\t\tnoticiasList.clear();\n\t\t\tLong userId = Long.parseLong(req.getParameter(Constants.USER_IDENTIFIER));\n\t\t\tPrintWriter out = res.getWriter();\n\t\t\tif (userId != null) {\n\t\t\t\tLOGGER.info(\"Los contenidos valorados por el usuario \" + UserDB.getnameOfUser(userId) + \" son:\");\n\t\t\t\tPreferenceArray preferencesUser = myRecommender.getPreferencesFromUser(userId);\n\t\t\t\tfor (int i = 0; i < preferencesUser.length(); i++) {\n\t\t\t\t\thave = \"1\";\n\t\t\t\t\tString content = ContentDB.getTitleOfContent(preferencesUser.getItemID(i));\n\t\t\t\t\tfloat value = preferencesUser.getValue(i);\n\n\t\t\t\t\tNoticia not = new Noticia(Long.toString(ContentDB.getContentId(content)), content,\n\t\t\t\t\t\t\tContentDB.getVideoOfContent(preferencesUser.getItemID(i)),\n\t\t\t\t\t\t\tContentDB.getCaptureOfContent(preferencesUser.getItemID(i)),\n\t\t\t\t\t\t\tContentDB.getDateOfContent(preferencesUser.getItemID(i)),\n\t\t\t\t\t\t\tContentDB.getContent(preferencesUser.getItemID(i)),\n\t\t\t\t\t\t\tContentDB.getAuthorOfContent(preferencesUser.getItemID(i)), have, Float.toString(value));\n\n\t\t\t\t\tnoticiasList.add(not);\n\n\t\t\t\t}\n\t\t\t\tconjunto = new Conjunto(noticiasList);\n\t\t\t\tout.print(gson.toJson(conjunto).subSequence(12, gson.toJson(conjunto).length() - 1));\n\t\t\t} else {\n\t\t\t\tLOGGER.warning(\"Usuario no encontrado\");\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tres.setStatus(HttpServletResponse.SC_SERVICE_UNAVAILABLE);\n\t\t}\n\t}",
"public static void readFavorites(String userId, final ListView favoritesList, final Context context) {\n //get database reference\n DatabaseReference dbref = FirebaseDatabase.getInstance().getReference(\"users\").child(userId);\n //add eventlistener to reference\n dbref.child(\"favoritesList\").addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n\n\n ArrayList<String> favs = new ArrayList<>();\n\n for (DataSnapshot favDataSnapshot : dataSnapshot.getChildren()) {\n String fav = favDataSnapshot.getValue(String.class);\n favs.add(fav);\n }\n FoodController.readFavoriteFoods(favoritesList, context, favs);\n\n\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n\n }\n });\n }",
"public void writeFavorites() {\n ArrayList<String> favorites = new ArrayList<>();\n for(Landmark landmark : landmarks.getFavorites()) {\n favorites.add(landmark.toStringForOutput());\n }\n FileManager.writeLines(favoritesPath, favorites);\n }",
"@RequestMapping(\"/favorites\")\n public String favorites(ModelMap modelMap) {\n List<Gif> gifs = gifRepo.findFavorites();\n modelMap.put(\"gifs\", gifs);\n return \"favorites\";\n }",
"public void showFavorites() {\n System.out.println(\"Mina favoriter: \" + myFavorites.size());\n for (int i = 0; i < myFavorites.size(); i++) {\n System.out.println(\"\\n\" + (i + 1) + \". \" + myFavorites.get(i).getTitle() +\n \"\\nRegissör: \" + myFavorites.get(i).getDirector() + \" | \" +\n \"Genre: \" + myFavorites.get(i).getGenre() + \" | \" +\n \"År: \" + myFavorites.get(i).getYear() + \" | \" +\n \"Längd: \" + myFavorites.get(i).getDuration() + \" min | \" +\n \"Betyg: \" + myFavorites.get(i).getRating());\n }\n }",
"public void fetchFavoritedMovies() {\n favoritesSelected = true;\n Cursor cursor =\n getActivity().getContentResolver().query(MovieContract.FavoriteMovieEntry.CONTENT_URI,\n null,\n null,\n null,\n null);\n ArrayList<MovieModel> movieModels = new ArrayList<>();\n if (cursor != null) {\n while (cursor.moveToNext()) {\n MovieModel movieModel = new MovieModel(getActivity(), cursor);\n // Get the trailers and reviews\n String movieId = cursor.getString(cursor.getColumnIndex(MovieContract.FavoriteMovieEntry._ID));\n Cursor trailerCursor =\n getActivity().getContentResolver().query(MovieContract.TrailerEntry.CONTENT_URI,\n null,\n MovieContract.TrailerEntry.COLUMN_MOVIE_KEY + \" = ?\",\n new String[]{movieId},\n null);\n Cursor reviewCursor =\n getActivity().getContentResolver().query(MovieContract.ReviewEntry.CONTENT_URI,\n null,\n MovieContract.ReviewEntry.COLUMN_MOVIE_KEY + \" = ?\",\n new String[]{movieId},\n null);\n ArrayList<MovieTrailerModel> movieTrailerModels = new ArrayList<>();\n ArrayList<MovieReviewModel> movieReviewModels = new ArrayList<>();\n if (trailerCursor != null) {\n while (trailerCursor.moveToNext()) {\n movieTrailerModels.add(new MovieTrailerModel(getActivity(), trailerCursor));\n }\n trailerCursor.close();\n }\n if (reviewCursor != null) {\n while (reviewCursor.moveToNext()) {\n movieReviewModels.add(new MovieReviewModel(getActivity(), reviewCursor));\n }\n reviewCursor.close();\n }\n movieModel.setReviews(movieReviewModels);\n movieModel.setTrailers(movieTrailerModels);\n movieModels.add(movieModel);\n }\n cursor.close();\n }\n movieGridAdapter.setMovieModels(movieModels);\n }",
"public synchronized Set<String> getFavorites() {\r\n return new HashSet<>(settings.getList(FAVORITES_SETTING));\r\n }",
"private void retrieveFavoritesCompleted(ArrayList<MovieItem> movies){\n //get number of favorite movies in the list\n int count = movies.size();\n\n //check if there are any movies\n if(count > 0){\n //save movies to buffer\n mMovieStaff.setMovies(movies, PosterHelper.NAME_ID_FAVORITE);\n }\n\n //check if the current poster fragment is displaying the user favorite list\n if(mMovieType == PosterHelper.NAME_ID_FAVORITE){\n //yes, show new movie list\n showMovieList(movies, PosterHelper.NAME_ID_FAVORITE);\n }\n }",
"@SuppressWarnings(\"unchecked\")\n\tprotected void updateSessionFavorites(SMTSession session, PageViewVO fav, boolean isDelete) {\n\t\t// get the Favs map off of the session.\n\t\tMap<String,List<PageViewVO>> favMap = (Map<String,List<PageViewVO>>)session.getAttribute(MyFavoritesAction.MY_FAVORITES);\n\t\tList<PageViewVO> favs = favMap.get(fav.getReferenceCode());\n\t\tif (favs == null) favs = new ArrayList<>();\n\t\tif (isDelete) {\n\t\t\t// remove fav\n\t\t\tremoveFromSession(favs, fav.getPageId());\n\t\t} else {\n\t\t\t// add fav\n\t\t\tfavs.add(fav);\n\t\t}\n\t\t// replace the favs map on the session.\n\t\tsession.setAttribute(MyFavoritesAction.MY_FAVORITES, favMap);\n\t}",
"public ArrayList<String[]> getFavoritePairs() {\n ArrayList<String[]> favPairs = new ArrayList<>();\n for(Landmark landmark : landmarks.getFavorites()) {\n favPairs.add(new String[]{landmark.getName(), landmark.getLocation().toString(), landmark.getDescription()});\n }\n return favPairs;\n }",
"private ArrayList<MovieItem> getFavoriteMovies(){\n //get list of favorite movies from buffer\n ArrayList<MovieItem> movies = mMovieStaff.getMovies(PosterHelper.NAME_ID_FAVORITE);\n\n //check if favorite movie list has changed\n if(mFavoriteChanged){\n //list has changed, show new movie list\n showMovieList(movies, PosterHelper.NAME_ID_FAVORITE);\n }\n\n //return movie list\n return movies;\n }",
"@Override\r\n\tpublic List<Place> getFavoritePlaces(String userId) {\n\t\tif(conn == null) {\r\n\t\t\treturn new ArrayList<>();\r\n\t\t}\r\n\r\n\t\tList<Place> favoritePlaces = new ArrayList<>();\r\n\t\tList<String> placeIds = getFavoritePlaceIds(userId);\r\n\t\ttry {\r\n\t\t\tString sql = \"SELECT * FROM places WHERE place_id = ?\";\r\n\t\t\tPreparedStatement ps = conn.prepareStatement(sql);\r\n\t\t\tfor(String placeId : placeIds) {\r\n\t\t\t\tps.setString(1, placeId);\r\n\t\t\t\tResultSet rs = ps.executeQuery();\r\n\t\t\t\tPlaceBuilder builder = new PlaceBuilder();\r\n\t\t\t\twhile(rs.next()) {\r\n\t\t\t\t\tbuilder.setPlaceId(rs.getString(\"place_id\"));\r\n\t\t\t\t\tbuilder.setName(rs.getString(\"name\"));\r\n\t\t\t\t\tbuilder.setRating(rs.getDouble(\"Rating\"));\r\n\t\t\t\t\tbuilder.setAddress(rs.getString(\"address\"));\r\n\t\t\t\t\tbuilder.setIcon(rs.getString(\"icon\"));\r\n\t\t\t\t\tbuilder.setLat(rs.getDouble(\"latitude\"));\r\n\t\t\t\t\tbuilder.setLon(rs.getDouble(\"longitude\"));\r\n\t\t\t\t\tbuilder.setTypes(getTypes(rs.getString(\"place_id\")));\r\n\t\t\t\t\tbuilder.setPhotos(getPhotos(rs.getString(\"place_id\")));\r\n\t\t\t\t\tbuilder.setCity(rs.getString(\"city\"));\r\n\r\n\t\t\t\t\tfavoritePlaces.add(builder.build());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn favoritePlaces;\r\n\t}",
"@RequestMapping(\"/favorites\")\n public String favorites(Model model) {\n // TODO: Get list of all GIFs marked as favorite\n List<Gif> faves = new ArrayList<>();\n\n model.addAttribute(\"gifs\", faves);\n model.addAttribute(\"username\", \"Chris Ramacciotti\"); // Static username\n return \"gif/favorites\";\n }",
"public static void findFavourites() {\n DataManager.currentFavouritesList.clear();\n\n for (int i = 0; i < DataManager.fullFavouritesList.size(); i++) {\n Attraction attraction = DataManager.findAttractionByName(DataManager.fullFavouritesList.get(i));\n\n if (attraction != null) {\n DataManager.currentFavouritesList.add(attraction);\n }\n }\n\n FavouritesListFragment.backgroundLayout.setVisibility(DataManager.currentFavouritesList.size() == 0 ? View.VISIBLE : View.INVISIBLE);\n\n AttractionsListFragment.attractionsAdapter.notifyDataSetChanged();\n }",
"private void populateUserPlaylitstsSection() {\n \tPlaylist dumyPlaylist = new Playlist();\n \tMap<Long, Playlist> playlistsMap = mDataManager.getStoredPlaylists();\n \tList<Playlist> playlists = new ArrayList<Playlist>();\n \t\n \t// Convert from Map<Long, Playlist> to List<Itemable> \n \tif (playlistsMap != null && playlistsMap.size() > 0) {\n \t\tfor(Map.Entry<Long, Playlist> p : playlistsMap.entrySet()){\n \t\t\tplaylists.add(p.getValue());\n \t\t}\n \t}\n\t\t\n \t// populates the favorite playlists.\n \tif (!Utils.isListEmpty(playlists)) {\n \t\tmContainerMyPlaylists.setVisibility(View.VISIBLE);\n \t\t// shows any internal component except the empty text.\n \t\tmTextMyPlaylist1Name.setVisibility(View.VISIBLE);\n \t\tmTextMyPlaylist2Name.setVisibility(View.VISIBLE);\n \t\tmTextMyPlaylist3Name.setVisibility(View.VISIBLE);\n \t\tmImageMoreIndicator.setVisibility(View.VISIBLE);\n \t\tmTextMyPlaylistEmpty.setVisibility(View.GONE);\n \t\t\n \t\tmTextMyPlaylistsValue.setText(Integer.toString(playlists.size()));\n \t\t\n \t\tStack<TextView> playlistsNames = new Stack<TextView>();\n \t\tplaylistsNames.add(mTextMyPlaylist3Name);\n \t\tplaylistsNames.add(mTextMyPlaylist2Name);\n \t\tplaylistsNames.add(mTextMyPlaylist1Name);\n\n \t\tTextView songName = null;\n \t\t\n \t\tfor (Playlist playlist : playlists) {\n \t\t\tif (playlistsNames.isEmpty())\n \t\t\t\tbreak;\n \t\t\t\n \t\t\tsongName = playlistsNames.pop();\n \t\t\tsongName.setText(playlist.getName());\n\t\t\t}\n \t\t\n \t} else {\n \t\tmContainerMyPlaylists.setVisibility(View.GONE);\n \t}\n\t}",
"public void getRecentUsers(View view){\n SharedPreferences sharedPref = getContext().getSharedPreferences(\"recentVisited\", Context.MODE_PRIVATE);\n int size = sharedPref.getInt(\"size\", 0);\n\n // clears the variables.\n userName.clear();\n uid.clear();\n for (int i = size+1; i >0 ; i--) {\n String name= sharedPref.getString(\"name_\"+i,\"deleted\");\n String userId= sharedPref.getString(\"uid_\"+i,\"deleted\");\n if (!Objects.equals(name, \"deleted\")){\n userName.add(name);\n uid.add(userId);\n }\n\n }\n\n setList(view);\n }",
"private void populateViews(List<ParseUser> friendUsers){\n retrieveCheeseCountsLocally();\n populateUserView();\n populateFriendsListView(friendUsers);\n populateHistoryListView();\n\t}",
"@Override\r\n\tpublic List<String> getFavoritePlaceIds(String userId) {\n\t\tif(conn == null) {\r\n\t\t\tSystem.err.println(\"DB connection failed\");\r\n\t\t\treturn new ArrayList<>();\r\n\t\t}\r\n\r\n\t\tList<String> favoritePlaces = new ArrayList<>();\r\n\r\n\t\ttry {\r\n\t\t\tString sql = \"SELECT * FROM favorites WHERE user_id = ?\";\r\n\t\t\tPreparedStatement ps = conn.prepareStatement(sql);\r\n\t\t\tps.setString(1, userId);\r\n\t\t\tResultSet rs = ps.executeQuery();\r\n\r\n\t\t\twhile(rs.next()) {\r\n\t\t\t\tString placeId = rs.getString(\"place_id\");\r\n\t\t\t\tfavoritePlaces.add(placeId);\r\n\t\t\t}\r\n\r\n\t\t}catch(SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn favoritePlaces;\r\n\t}",
"@Override\n\tpublic void getFavorit(int idUser) {\n\t\t\n\t}",
"private void getAllFavorite(){\n\n\n MainViewModel viewModel = ViewModelProviders.of(this).get(MainViewModel.class);\n viewModel.getFavorite().observe(this, new Observer<List<FavoriteEntry>>() {\n @Override\n public void onChanged(@Nullable List<FavoriteEntry> imageEntries) {\n List<Movie> movies = new ArrayList<>();\n for (FavoriteEntry entry : imageEntries){\n Movie movie = new Movie();\n movie.setId(entry.getMovieid());\n movie.setOverview(entry.getOverview());\n movie.setOriginalTitle(entry.getTitle());\n movie.setPosterPath(entry.getPosterpath());\n movie.setVoteAverage(entry.getUserrating());\n movie.setReleaseDate(entry.getReleasedate());\n movies.add(movie);\n }\n\n adapter.setMovies(movies);\n }\n });\n }",
"private void setupFavoritesListView() {\n ListView listFavorites = (ListView) findViewById(R.id.list_favorites);\n try{\n PlayerDatabaseHelper PlayerDatabaseHelper = new PlayerDatabaseHelper(this);\n db = PlayerDatabaseHelper.getReadableDatabase();\n\n favoritesCursor = db.rawQuery(\"WITH sel_Players(P_id) As (Select player_id FROM SELECTION, USER WHERE NAME = ? AND _id = user_id) SELECT _id, NAME FROM PLAYER, sel_Players WHERE P_id = _id\", new String[] {User.getUName()});\n\n CursorAdapter favoriteAdapter =\n new SimpleCursorAdapter(TopLevelActivity.this,\n android.R.layout.simple_list_item_1,\n favoritesCursor,\n new String[]{\"NAME\"},\n new int[]{android.R.id.text1}, 0);\n listFavorites.setAdapter(favoriteAdapter);\n db.close();\n } catch(SQLiteException e) {\n Toast toast = Toast.makeText(this, \"Database unavailable\", Toast.LENGTH_SHORT);\n toast.show();\n }\n\n listFavorites.setOnItemClickListener(new AdapterView.OnItemClickListener() {\n @Override\n public void onItemClick(AdapterView<?> listView, View v, int position, long id) {\n Intent intent = new Intent(TopLevelActivity.this, forward.class);\n intent.putExtra(forward.EXTRA_PLAYERID, (int)id);\n startActivity(intent);\n }\n });\n }",
"public ArrayList<String> loadFavorites() {\n\n\t\tSAVE_FILE = FAVORITE_FILE;\n\t\tArrayList<String> list = new ArrayList<String>();\n\t\tlist = loadIds();\n\t\treturn list;\n\t}",
"private void showFavouriteList() {\n setToolbarText(R.string.title_activity_fave_list);\n showFavouriteIcon(false);\n buildList(getFavourites());\n }",
"private void getFavData() {\n favouriteViewModel.getFavouritePostData().observe(this, result -> {\n if (result != null) {\n if (result.status == Status.SUCCESS) {\n if (this.getActivity() != null) {\n Utils.psLog(result.status.toString());\n favouriteViewModel.setLoadingState(false);\n itemViewModel.setItemDetailObj(itemViewModel.itemId, itemViewModel.historyFlag, loginUserId);\n }\n\n } else if (result.status == Status.ERROR) {\n if (this.getActivity() != null) {\n Utils.psLog(result.status.toString());\n favouriteViewModel.setLoadingState(false);\n }\n }\n }\n });\n }",
"protected Map<String,List<Address>> extract(View view) {\n Map<String,List<Address>> map=new HashMap<>(view.size());\n for(Address mbr: view) {\n SiteAddress member=(SiteAddress)mbr;\n String key=member.getSite();\n List<Address> list=map.computeIfAbsent(key, k -> new ArrayList<>());\n if(!list.contains(member))\n list.add(member);\n }\n return map;\n }",
"private boolean isFavorite() {\n for (int favoriteIndex : favoriteIndexes) {\n if (favoriteIndex == shownTipIndex) {\n return true;\n }\n }\n return false;\n }",
"public void saveFavorite(){\n //make sure movie is NOT already a favorite\n if(!mMovieStaff.alreadyFavorite(mMovie.getTMDBId())){\n //is a new favorite, favorite movie list status has changed\n mFavoriteChanged = true;\n\n //set movie item favorite status as true\n mMovie.setFavorite(true);\n\n //save movie to favorite database table\n mMovieValet.saveFavorite(mMovie);\n\n //add movie to favorite movie list buffer\n mMovieStaff.addFavorite(mMovie);\n }\n\n //check if movie list type is display a favorite list and if the device is a tablet\n if(mMovieType == PosterHelper.NAME_ID_FAVORITE && mIsTablet){\n //both yes, get favorite movies to update poster fragment\n getMovieList(PosterHelper.NAME_ID_FAVORITE);\n }\n }",
"public List<Map<String, Object>> getStatisticsByStaff(String classify);",
"public void favouriteUser() {\r\n\t\tif(favourited) {\r\n\t\t\tcurrentUser.unfavouriteUser(userToView.getUserID());\r\n\t\t\tfavouriteButton.setText(\"Favourite\");\r\n\t\t\tfavourited = false;\r\n\t\t} else if(currentUser.getUserID() != userToView.getUserID()){\r\n\t\t\tcurrentUser.favouriteUser(userToView.getUserID());\r\n\t\t\tfavouriteButton.setText(\"Unfavourite\");\r\n\t\t\tfavourited = true;\r\n\t\t} else {\r\n\t\t\tCONSTANTS.makeAlertWindow(\"warning\",\"You can not favorite yourself!\");\r\n\t\t}\r\n\t}",
"public static ArrayList<Restaurant> getFav(Long idUser) {\n\t\tArrayList<Favourite> allFav=loadFavourite();\n\t\tArrayList<Restaurant> allRes=RestaurantDao.loadRestaurants();\n\t\tArrayList<Restaurant> returnFavRes=new ArrayList<>();\n\t\tfor(Favourite f:allFav) {\n\t\t\tif(f.getUserId().equals(idUser)) {\n\t\t\t\tfor(Restaurant r:allRes) {\n\t\t\t\t\tif(f.getIdRes().equals(r.getId())) {\n\t\t\t\t\t\treturnFavRes.add(r);\n\t\t\t\t\t\tSystem.out.println(\"restoran\"+r.getName() +\"\" +r.getAddress());\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn returnFavRes;\n\t}",
"public List<StockFavorite> getListFavoriteStock(int userId);",
"void favoriteView();",
"public boolean hasAnyFavorites(IUserLayout layout) {\n Validate.notNull(layout, \"Cannot determine whether a null layout contains favorites.\");\n\n // (premature) performance optimization: short circuit returns true if nonzero favorite\n // portlets\n return (!getFavoritePortletLayoutNodes(layout).isEmpty()\n || !getFavoriteCollections(layout).isEmpty());\n }",
"private static TreeMap<Double, ArrayList<String>> factorInRatings(Map<Integer,\n ArrayList<String>> map, User user) {\n TreeMap<Double, ArrayList<String>> mapWithRatings = new TreeMap<>(Collections.reverseOrder());\n //iterates through every count in the map\n for (int count = map.keySet().size(); count > 0; count--) {\n ArrayList<String> rep = map.get(count);\n //iterate through every recipe\n for (String recipe : rep) {\n Recipe recipeObj = getRecipeObject(recipe, user);\n int numIngredients = recipeObj.getIngredients().size();\n if (recipeObj == null) {\n continue;\n }\n //calculate a weighted sum to decide the match\n Double metric = count / numIngredients * SCORE_WEIGHT + SIMILARITY_WEIGHT\n * recipeObj.getValue();\n ArrayList<String> newRating;\n //add this rating to a hashmap, that sorts based on metric\n if (mapWithRatings.get(metric) == null) {\n newRating = new ArrayList<>();\n newRating.add(recipe);\n mapWithRatings.put(metric, newRating);\n } else {\n newRating = mapWithRatings.get(metric);\n newRating.add(recipe);\n mapWithRatings.put(metric, newRating);\n }\n }\n }\n return mapWithRatings;\n }",
"public static Map<Integer, List> prepareHotelsListToView(List<Hotel> filteredHotelsToView) {\r\n\t\tMap<Integer, List> map = new HashMap<Integer, List>();\r\n\r\n\t\tfor (Hotel hotel : filteredHotelsToView) {\r\n\t\t\tList hotelData = new ArrayList();\r\n\t\t\t\r\n\t\t\thotelData.add(hotel.getDestination().getCountry());\r\n\t\t\thotelData.add(hotel.getDestination().getCity());\r\n\t\t\thotelData.add(hotel.getDestination().getRegionID());\r\n\t\t\thotelData.add(hotel.getHotelInfo().getHotelName());\r\n\t\t\thotelData.add(convertDateListToString(hotel.getOfferDateRange().getTravelStartDate()));\r\n\t\t\thotelData.add(convertDateListToString(hotel.getOfferDateRange().getTravelEndDate()));\r\n\t\t\thotelData.add(hotel.getHotelInfo().getHotelStarRating());\r\n\t\t\thotelData.add(hotel.getHotelInfo().getHotelGuestReviewRating());\r\n\t\t\thotelData.add(hotel.getHotelInfo().getHotelReviewTotal());\r\n\t\t\thotelData.add(hotel.getHotelInfo().getHotelImageUrl());\r\n\t\t\t\r\n\t\t\tmap.put(map.size() + 1, hotelData);\r\n\t\t}\r\n\r\n\t\treturn map;\r\n\t}",
"private void initListFavorite() {\n favoritesList = mApiService.getFavorites();\n mRecyclerView.setAdapter(new MyNeighbourRecyclerViewAdapter(favoritesList, this));\n }",
"public void removeFavorite(){\n //check if movie is in the user favorite list\n if(mMovieStaff.alreadyFavorite(mMovie.getTMDBId())){\n //is in the favorite list, mark that list has changed\n mFavoriteChanged = true;\n\n //update movie item favorite status\n mMovie.setFavorite(false);\n\n //delete movie item from favorite database table\n mMovieValet.deleteFavorite(mMovie);\n\n //remove movie item from favorite movie list buffer\n mMovieStaff.removeFavorite(mMovie);\n }\n\n //check if movie list type is display a favorite list and if the device is a tablet\n if(mMovieType == PosterHelper.NAME_ID_FAVORITE && mIsTablet){\n //both yes, get favorite movies to update poster fragment\n getMovieList(PosterHelper.NAME_ID_FAVORITE);\n }\n }",
"protected void updateProfileFavorites(ActionRequest req, PageViewVO fav) throws ActionException {\n\t\tlog.debug(\"updateProfileFavorites...\");\n\n\t\tMyFavoritesAction mfa = new MyFavoritesAction(getActionInit());\n\t\tmfa.setAttributes(getAttributes());\n\t\tmfa.setDBConnection(dbConn);\n\n\t\tboolean isDelete = Convert.formatBoolean(req.getParameter(\"isDelete\"));\n\t\tif (isDelete) {\n\t\t\tmfa.deleteFavorite(req);\n\t\t} else {\n\t\t\t// set additional req params needed for inserts.\n\t\t\treq.setParameter(QuickLinksAction.PARAM_KEY_TYPE_CD, fav.getReferenceCode());\n\t\t\treq.setParameter(QuickLinksAction.PARAM_KEY_REL_ID, fav.getPageId());\n\t\t\tmfa.insertFavorite(req);\n\t\t}\n\n\t\tupdateSessionFavorites(req.getSession(),fav,isDelete);\n\n\t}",
"@RequestMapping(value = \"home\", method = RequestMethod.GET)\n public String home(Model model, HttpServletRequest request){\n IronUser user = (IronUser)request.getSession().getAttribute(\"user\");\n\n Long usrId = user.getId();\n\n // get users favorites\n Set<Movie> favs = userRepository.findOne(usrId).getFavs();\n\n\n // put them in a model\n model.addAttribute(\"favs\", favs);\n\n // send them to the dam\n return \"home\";\n }",
"private void addToFavorites() {\n\n favoriteBool = true;\n preferencesConfig.writeAddFavoriteTip(shownTipIndex);\n Toast.makeText(getContext(), \"Added to favorites.\", Toast.LENGTH_SHORT).show();\n\n }",
"public final void resetFavorites() {\n Favorites favorites = Favorites.INSTANCE;\n favorites.clear();\n favorites.load(this.persistenceWrapper.readFavorites());\n }",
"private HashMap<String, String> listFoodItems(WebDriver driver)\n throws NullPointerException, NoSuchElementException, TimeoutException, ElementNotVisibleException,\n StaleElementReferenceException {\n if (driver == null) {\n throw new NullPointerException(\"Input is Null. Please check the data\");\n }\n HashMap<String, String> map = new LinkedHashMap<>();\n List<WebElement> foodName = driver.findElements(By.cssSelector(\".title.ng-binding\"));\n List<WebElement> foodServing = driver.findElements(By.cssSelector(\".description.ng-binding\"));\n for (int idx = 0; idx < foodName.size(); idx++) {\n map.put(foodName.get(idx).getText(), foodServing.get(idx).getText());\n }\n return map;\n }",
"public void saveFavorites(Context context, List<Recipes> favorites) {\n SharedPreferences settings;\n SharedPreferences.Editor editor;\n\n settings = context.getSharedPreferences(PREFS_NAME,\n Context.MODE_PRIVATE);\n editor = settings.edit();\n\n Gson gson = new Gson();\n String jsonFavorites = gson.toJson(favorites);\n\n editor.putString(FAVORITES, jsonFavorites);\n\n editor.apply();\n }",
"private void retrieveFavoritePhotos() {\n showProgress(this.mProgressBar, this.mRlContent);\n this.mFavoritePhotosViewModel.retrievePhotos();\n }",
"private static Map<String, Double> findAveragePriceViewedAllSessions(\r\n List<String> sessionsWithPurchases, Map<String, List<View>> viewsFromSessions\r\n ) {\r\n // Initializes the list of doubles (averages) we're going to return.\r\n Map<String, Double> averageMap = new HashMap<>();\r\n\r\n // Calculates the average price of viewed items in each session.\r\n for (String session : sessionsWithPurchases) {\r\n int viewPriceTot = 0;\r\n int viewedItems = 0;\r\n for (View viewItem : viewsFromSessions.get(session)) {\r\n viewPriceTot += viewItem.getPrice();\r\n viewedItems += 1;\r\n }\r\n averageMap.put(session, ((double) viewPriceTot) / viewedItems);\r\n }\r\n\r\n return averageMap;\r\n }",
"public static boolean testMyFavoriteGetAll() {\r\n MyFavorite inst = new MyFavorite(10);\r\n for (Pokemon item : testList) {\r\n inst.put(item.getName(), item);\r\n }\r\n LinkedList<Pokemon> list = inst.getAll();\r\n if (list.size() != 6)\r\n return false;\r\n for (Pokemon item : testList) {\r\n if (!list.contains(item)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }",
"private void populateFriendsListView(List<ParseUser> userFriends) {\n\t\tfriendsList.clear();\n\t\tfacebookIdFirstNameMap.clear();\n\t\tfor(ParseUser friend : userFriends){\n\t\t\tString imageUrl = String.format(StealTheCheeseApplication.FRIEND_CHEESE_COUNT_PIC_URL, friend.getString(\"facebookId\"));\n\t\t\tfriendsList.add(new PlayerViewModel(friend.getString(\"facebookId\"), \n\t\t\t\t\t\t\t\t\t\t\t\timageUrl,\n\t\t\t\t\t\t\t\t\t\t\t\tlocalCountMap.get(friend.getString(\"facebookId\")), \n\t\t\t\t\t\t\t\t\t\t\t\tlocalShowMeMap.get(friend.getString(\"facebookId\")),\n\t\t\t\t\t\t\t\t\t\t\t\tfalse));\n\t\t\t\n\t\t\tfacebookIdFirstNameMap.put(friend.getString(\"facebookId\"), friend.getString(\"firstName\"));\n\t\t}\n\t\t\n\t\tCollections.sort(friendsList, chain);\n\t\tfriendsListAdapter.notifyDataSetChanged(); \n\t}",
"public List<Event> recommendEvents(String userId, double lat, double lon) {\n\t\tDBConnection conn = DBConnectionFactory.getConnection();\n\t\tSet<String> favoritedEventIds = conn.getFavoriteEventIds(userId);\n\t\tMap<String, Integer> favoritedCategories = new HashMap<>();\n\t\tfor (String eventId : favoritedEventIds) {\n\t\t\tSet<String> categories = conn.getCategoriesFromDB(eventId);\n\t\t\tfor (String category : categories) {\n\t\t\t\tfavoritedCategories.put(category, favoritedCategories.getOrDefault(category, 0) + 1);\n\t\t\t}\n\t\t}\n\t\t// sort the favorite categories by frequency\n\t\tList<Entry<String, Integer>> categoryList = new ArrayList<> (favoritedCategories.entrySet());\n\t\tCollections.sort(categoryList, new Comparator<Entry<String, Integer>>() {\n\t\t\t@Override\n\t\t\tpublic int compare(Entry<String, Integer> o1, Entry<String, Integer> o2) {\n\t\t\t\treturn Integer.compare(o2.getValue(), o1.getValue());\n\t\t\t}\n\t\t});\n\n\t\t//search nearby events based on categories and filter out the favorite events\n\t\tList<Event> recommendedEvents = new ArrayList<>();\n\t\tEventSourceAPI source = new TicketMasterAPI();\n\t\tfor (Entry<String, Integer> category : categoryList) {\n\t\t\tList<Event> filteredEvents = new ArrayList<>();\n\t\t\tList<Event> events = source.search(lat, lon, category.getKey());\n\t\t\tconn.saveEvents(events);\n\t\t\tfor (Event event : events) {\n\t\t\t\tif (! favoritedEventIds.contains(event.getEventId())) {\n\t\t\t\t\tfilteredEvents.add(event);\n\t\t\t\t\tfavoritedEventIds.add(event.getEventId());\n\t\t\t\t}\n\t\t\t}\n\t\t\tCollections.sort(filteredEvents, new Comparator<Event>() {\n\t\t\t\t@Override\n\t\t\t\tpublic int compare(Event item1, Event item2) {\n\t\t\t\t\treturn Double.compare(item1.getDistance(), item2.getDistance());\n\t\t\t\t}\n\t\t\t});\n\t\t\trecommendedEvents.addAll(filteredEvents);\n\t\t}\n\t\tconn.close();\n\t\treturn recommendedEvents;\n\n\t}",
"private void removeFromFavorites() {\n favoriteBool = false;\n preferencesConfig.writeRemoveFavoriteTip(shownTipIndex);\n Toast.makeText(getContext(), \"Removed from favorites\", Toast.LENGTH_SHORT).show();\n\n }",
"void onGetEquiposFavoritos(Task<QuerySnapshot> task);",
"public List<MovieDetails> getAllFavoriteMovies() {\n SQLiteDatabase database = this.getWritableDatabase();\n List<MovieDetails> movieDetailses = new ArrayList<>();\n List<Integer> favoritesMovieId = new ArrayList<>();\n String selectQuery = \"SELECT * FROM \" + FavoriteMoviesEntry.TABLE_NAME;\n Cursor cursor = database.rawQuery(selectQuery, null);\n if (cursor.moveToFirst()) {\n do {\n int id = getIdFromCursor(cursor);\n String selectFavoriteMovieQuery = \"SELECT * FROM \" + MoviesDetailsEntry.TABLE_NAME + \"WHERE \" + MoviesDetailsEntry._ID + \"= \" + id;\n Cursor movieCursor = database.rawQuery(selectFavoriteMovieQuery, null);\n if (movieCursor.moveToFirst()) {\n do {\n MovieDetails movieDetails = getMovieDetailsFromCursor(movieCursor);\n movieDetailses.add(movieDetails);\n } while (movieCursor.moveToNext());\n }\n } while (cursor.moveToNext());\n }\n database.close();\n\n return movieDetailses;\n }",
"public interface IFavoriteService {\n\n\tList<Favorite> getFavorites();\n\n\tList<Favorite> getFavoritesByGenre(GenreType genreType);\n\n\tList<Favorite> getFavoritesByParent(FavoriteCategory parent);\n\n\tList<Favorite> getFavoritesByParentId(int parentId);\n\n\tList<Favorite> getFavoritesByRate(int rate);\n\n\tList<Favorite> getFavoritesByBackupStatus(boolean isBackup);\n\n\tList<Favorite> getFavoritesByModifyStatus(boolean isModified);\n\n\tint getFavoriteCountInRate(int rate);\n\n\tint getFavoriteCountInCategory(int parentId);\n\n\tvoid delete(Favorite favorite);\n\n\tvoid delete(List<Favorite> favorites);\n\n\tvoid update(Favorite favorite);\n\n\tvoid update(List<Favorite> favorites);\n\n\tvoid insert(Favorite favorite);\n\n\tvoid insert(List<Favorite> favorites);\n\n\tList<FavoriteCategory> getFavoriteCategories();\n\n\tList<FavoriteCategory> getFavoriteCategoriesByRate(int rate);\n\n\tList<FavoriteCategory> getFavoriteCategoriesByBackupStatus(boolean isBackup);\n\n\tList<FavoriteCategory> getFavoriteCategoriesByModifyStatus(boolean isModified);\n\n\tvoid insertCategory(FavoriteCategory category);\n\n\tvoid insertCategory(List<FavoriteCategory> categories);\n\n\tvoid updateCategory(FavoriteCategory category);\n\n\tvoid updateCategories(List<FavoriteCategory> categories);\n\n\tvoid deleteCategory(FavoriteCategory category);\n\n\tvoid deleteCategories(List<FavoriteCategory> categories);\n}",
"UserFriendsEntry getUserFriendsList(Integer user_id);",
"public void filter(final List<ActivityDTO> activitiesCollection, final PersonModelView user)\n {\n List<ActivityDTO> activities = new LinkedList<ActivityDTO>();\n List<Long> activityIds = new LinkedList<Long>();\n \n // Need a List to preserve order.\n for (ActivityDTO activity : activitiesCollection)\n {\n activityIds.add(activity.getId());\n activities.add(activity);\n }\n \n List<List<Long>> likedCollection = getLikedActivityIdsByUserIdsMapper\n .execute(Arrays.asList(user.getEntityId()));\n \n List<Long> liked = null;\n \n if (likedCollection != null && likedCollection.size() > 0)\n {\n liked = likedCollection.iterator().next();\n }\n else\n {\n return;\n }\n \n List<List<Long>> likersCollection = getPeopleWhoLikedActivityMapper.execute(activityIds);\n List<Long> allLikerIds = new LinkedList<Long>();\n \n // Build list of all needed likers\n for (List<Long> likerList : likersCollection)\n {\n if (likerList.size() > likerLimit - 1)\n {\n allLikerIds.addAll(likerList.subList(0, likerLimit));\n }\n else\n {\n allLikerIds.addAll(likerList);\n }\n }\n \n List<PersonModelView> allLikersList = peopleMapper.execute(allLikerIds);\n \n Map<Long, PersonModelView> allLikersMap = new HashMap<Long, PersonModelView>();\n \n for (PersonModelView person : allLikersList)\n {\n allLikersMap.put(person.getId(), person);\n }\n \n for (int i = 0; i < activities.size(); i++)\n {\n ActivityDTO activity = activities.get(i);\n \n List<Long> likers = likersCollection.get(i);\n \n activity.setLikeCount(likers.size());\n \n List<PersonModelView> likersModels = new LinkedList<PersonModelView>();\n \n for (int j = 0; j < likers.size() && j < likerLimit - 1; j++)\n {\n likersModels.add(allLikersMap.get(likers.get(j)));\n }\n \n activity.setLikers(likersModels);\n activity.setLiked(liked.contains(activity.getId()));\n }\n }",
"public Iterable<E> getFavorites(int k) throws IllegalArgumentException {\n if (k < 0 || k > size())\n throw new IllegalArgumentException(\"Invalid k\");\n PositionalList<E> result = new LinkedPositionalList<>();\n Iterator<Item<E>> iterator = list.iterator();\n for (int j = 0; j < k; j++)\n result.addLast(iterator.next().getValue());\n return result;\n }",
"public void getFavoriteEateries(Integer account_id){\r\n Map<String, String> params = new HashMap<>();\r\n params.put(\"account_id\", String.valueOf(account_id));\r\n String url = API_DOMAIN + ACCOUNT_EXT + GET_FAVORITES;\r\n this.makeVolleyRequest( url, params );\r\n }",
"public HashMap<Integer, User> process(List<User> list) {\n HashMap<Integer, User> map = new HashMap<>();\n for (User user : list) {\n int userId = user.getId();\n map.putIfAbsent(userId, user);\n }\n return map;\n }",
"protected Map<String,List<PageViewVO>> initializePageMap() {\n\t\tMap<String,List<PageViewVO>> pm = new HashMap<>();\n\t\tfor (Section sect : Section.values()) {\n\t\t\tpm.put(sect.name(), new ArrayList<>());\n\t\t}\n\t\treturn pm;\n\t}",
"private Cursor loadFavorites() {\n PermissionUtils.checkPermissionsGranted(getContext(), new String[]{READ_CONTACTS}, true);\n String selection = ContactsCursorLoader.COLUMN_STARRED + \" = 1\";\n return getContext().getContentResolver().query(\n buildFavoritesUri(),\n getProjection(),\n selection,\n null,\n getSortOrder());\n }",
"private boolean isAddedToFavorites() {\n boolean isFavorite = false;\n\n String[] projection = {FavMovieEntry.COLUMN_MOVIE_ID};\n String selection = FavMovieEntry.COLUMN_MOVIE_ID + \"=?\";\n String[] selectionArgs = new String[]{\n String.valueOf(sMovie.getMovieId())};\n\n Cursor cursor = this.getContentResolver().query(\n FavMovieEntry.CONTENT_URI,\n projection,\n selection,\n selectionArgs,\n null\n );\n\n if (cursor != null && cursor.moveToFirst()) {\n if (cursor.getCount() > 0) {\n isFavorite = true;\n long currentIndex = cursor.getLong(cursor.getColumnIndex(FavMovieEntry.COLUMN_MOVIE_ID));\n mCurrentMovieUri = ContentUris.withAppendedId(FavMovieEntry.CONTENT_URI, currentIndex);\n } else {\n isFavorite = false;\n\n mCurrentMovieUri = null;\n }\n cursor.close();\n }\n\n return isFavorite;\n }",
"public List<Favorite> getFavorites(String signedInAccount) {\n String[] columns = {\n mDBAccountString, mDBTitleString, mDBDescString, mDBURLString\n };\n String[] selectArgs = {signedInAccount};\n\n Cursor cursor = mFavSQLiteDB.query(\n FAVORITES_TABLE,\n columns,\n mDBAccountString + \" = ?\",\n selectArgs,\n null,\n null,\n null\n );\n cursor.moveToFirst();\n List<Favorite> list = new ArrayList<>();\n for (int i = 0; i < cursor.getCount(); i++) {\n String account = cursor.getString(0);\n String title = cursor.getString(1);\n String desc = cursor.getString(2);\n String url = cursor.getString(3);\n Favorite favorite = new Favorite(account, title, desc, url);\n list.add(favorite);\n cursor.moveToNext();\n }\n cursor.close();\n return list;\n }",
"public void saveFavorites(Context context, List<ClassDataGejala> favorites) {\n SharedPreferences settings;\n SharedPreferences.Editor editor;\n\n settings = context.getSharedPreferences(GEJALA,\n Context.MODE_PRIVATE);\n editor = settings.edit();\n\n Gson gson = new Gson();\n String jsonFavorites = gson.toJson(favorites);\n\n editor.putString(GEJALA, jsonFavorites);\n\n editor.commit();\n }",
"public List<Theater> findPreferedTheaterListByUserNo(int user_no) throws Exception;",
"public Map<String, Object> getUserList(Map<String, String> paraMap,\n\t\t\tUser user) {\n\t\treturn null;\n\t}",
"private Map<Profile, String> review(){\n\t\treturn allReviews;\n\t}",
"public void toggleFavorites()\n {\n this.showFavorites = !this.showFavorites;\n this.setupMorphs(Morphing.get(this.mc.thePlayer));\n }",
"public Map<String, Object> predicatesFor(String userid)\n {\n Map<String, Object> userPredicates;\n \n // Find out if any predicates for this userid are cached.\n if (!this.predicateCache.containsKey(userid))\n {\n // Create them if not.\n userPredicates = Collections.synchronizedMap(new HashMap<String, Object>());\n this.predicateCache.put(userid, userPredicates);\n } \n else\n {\n userPredicates = this.predicateCache.get(userid);\n if (userPredicates == null)\n {\n // This should never happen!\n throw new DeveloperError(\"userPredicates is null.\", new NullPointerException());\n } \n } \n return userPredicates;\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.action_settings) {\r\n if(item.getTitle().equals(\"Add to Favorites\")) {\r\n SharedPreferences commonpreferences = getSharedPreferences(\"Common\", Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor1 = commonpreferences.edit();\r\n\r\n String value1 = url_fav + \" \" + name_fav + \" \" + type_fav;\r\n\r\n\r\n editor1.putString(id_fav, value1);\r\n editor1.commit();\r\n if (type_fav.equals(\"Users\")) {\r\n SharedPreferences userpreferences = getSharedPreferences(\"Users\", Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor = userpreferences.edit();\r\n\r\n String value = url_fav + \" \" + name_fav + \" \" + type_fav;\r\n\r\n\r\n editor.putString(id_fav, value);\r\n editor.commit();\r\n } else if (type_fav.equals(\"Pages\")) {\r\n SharedPreferences pagepreferences = getSharedPreferences(\"Pages\", Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor = pagepreferences.edit();\r\n\r\n String value = url_fav + \" \" + name_fav + \" \" + type_fav;\r\n\r\n\r\n editor.putString(id_fav, value);\r\n editor.commit();\r\n } else if (type_fav.equals(\"Events\")) {\r\n SharedPreferences eventpreferences = getSharedPreferences(\"Events\", Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor = eventpreferences.edit();\r\n\r\n String value = url_fav + \" \" + name_fav + \" \" + type_fav;\r\n\r\n\r\n editor.putString(id_fav, value);\r\n editor.commit();\r\n } else if (type_fav.equals(\"Places\")) {\r\n SharedPreferences placepreferences = getSharedPreferences(\"Places\", Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor = placepreferences.edit();\r\n\r\n String value = url_fav + \" \" + name_fav + \" \" + type_fav;\r\n\r\n\r\n editor.putString(id_fav, value);\r\n editor.commit();\r\n } else if (type_fav.equals(\"Groups\")) {\r\n SharedPreferences grouppreferences = getSharedPreferences(\"Groups\", Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor = grouppreferences.edit();\r\n\r\n String value = url_fav + \" \" + name_fav + \" \" + type_fav;\r\n\r\n\r\n editor.putString(id_fav, value);\r\n editor.commit();\r\n }\r\n\r\n Toast.makeText(getApplicationContext(), \"Added to Favorites\", Toast.LENGTH_LONG).show();\r\n }\r\n else\r\n {\r\n SharedPreferences commonpreferences = getSharedPreferences(\"Common\", Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor1 = commonpreferences.edit();\r\n editor1.remove(id_fav);\r\n editor1.commit();\r\n\r\n if (type_fav.equals(\"Users\")) {\r\n SharedPreferences userpreferences = getSharedPreferences(\"Users\", Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor = userpreferences.edit();\r\n\r\n editor.remove(id_fav);\r\n editor.commit();\r\n } else if (type_fav.equals(\"Pages\")) {\r\n SharedPreferences pagepreferences = getSharedPreferences(\"Pages\", Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor = pagepreferences.edit();\r\n\r\n editor.remove(id_fav);\r\n editor.commit();\r\n } else if (type_fav.equals(\"Events\")) {\r\n SharedPreferences eventpreferences = getSharedPreferences(\"Events\", Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor = eventpreferences.edit();\r\n\r\n editor.remove(id_fav);\r\n editor.commit();\r\n } else if (type_fav.equals(\"Places\")) {\r\n SharedPreferences placepreferences = getSharedPreferences(\"Places\", Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor = placepreferences.edit();\r\n\r\n editor.remove(id_fav);\r\n editor.commit();\r\n } else if (type_fav.equals(\"Groups\")) {\r\n SharedPreferences grouppreferences = getSharedPreferences(\"Groups\", Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor = grouppreferences.edit();\r\n\r\n editor.remove(id_fav);\r\n editor.commit();\r\n }\r\n\r\n\r\n Toast.makeText(getApplicationContext(), \"Removed from Favorites\", Toast.LENGTH_LONG).show();\r\n }\r\n //SharedPreferences.Editor editor = sharedpreferences.edit();\r\n //editor.putString(\"Name\", \"Rachit\");\r\n //SharedPreferences events=getSharedPreferences(\"Events\", Context.MODE_PRIVATE);\r\n //String l=\"-1\";\r\n //String value=events.getString(id_fav,l);\r\n //editor.commit();\r\n return true;\r\n }\r\n else if (id == R.id.share) {\r\n if (ShareDialog.canShow(ShareLinkContent.class)) {\r\n ShareLinkContent linkContent = new ShareLinkContent.Builder()\r\n .setContentUrl(Uri.parse(\"http://developers.facebook.com/android\"))\r\n .build();\r\n shareDialog.show(linkContent);\r\n }\r\n\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }",
"Set<String> getUsers(String page);",
"public void GetUserFavs() {\n //create reference of database location\n DatabaseReference dbRef = FirebaseDatabase.getInstance().getReference();\n //attach listener to location where favorites for user are stored\n dbRef.child(\"ascentusers/\" + currentUser.getUid() + \"/Favorites\").addChildEventListener(new ChildEventListener() {\n @Override\n public void onChildAdded(@NonNull DataSnapshot snapshot, @Nullable String previousChildName) {\n //checking the snapshot exists\n if (snapshot.exists()) {\n String favoriteName = snapshot.getKey();\n //add the snapshot key to favorites list as it will be the boulder problem name\n //favorites.add(snapshot.getKey());\n dbRef.child(\"BoulderProblems\").child(\"UserCreated\").child(favoriteName).addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot snapshot) {\n BoulderProblem bp = snapshot.getValue(BoulderProblem.class);\n\n //create value event listener to find display name of setter in database\n ValueEventListener setterListener = new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot snapshot) {\n //set the setter display name of the boulder problem\n bp.SetSetter(snapshot.getValue().toString());\n //add to list of boulder problems\n bps.add(bp);\n //call method to apply searches, filters and sorts to get correct display list\n BPSearch();\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError error) {\n\n }\n };\n AttachSetterListener(bp.GetSetterId(), setterListener);\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError error) {\n\n }\n });\n //call the favorites search method\n //FavoritesSearch();\n }\n }\n\n @Override\n public void onChildChanged(@NonNull DataSnapshot snapshot, @Nullable String previousChildName) {\n\n }\n\n @Override\n public void onChildRemoved(@NonNull DataSnapshot snapshot) {\n //listens for removed favorites\n\n //check the snapshot exists\n if(snapshot.exists())\n {\n for(int i = 0; i < bps.size(); i++)\n {\n if(bps.get(i).GetName().equals(snapshot.getKey()))\n {\n bps.remove(i);\n BPSearch();\n break;\n }\n }\n /*\n //find and remove the boulder problem from the favorites list\n for(int i = 0; i < favorites.size(); i++)\n {\n if(favorites.get(i).equals(snapshot.getKey()))\n {\n favorites.remove(i);\n //find and remove the boulder problem from the bps list\n for(int j = 0; j < bps.size(); j++)\n {\n if(bps.get(j).GetName().equals(snapshot.getKey()))\n {\n bps.remove(j);\n PopulateRV();\n break;\n }\n }\n break;\n }\n }*/\n }\n }\n\n @Override\n public void onChildMoved(@NonNull DataSnapshot snapshot, @Nullable String previousChildName) {\n\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError error) {\n\n }\n });\n }",
"@SuppressWarnings(\"unchecked\")\n private List createTeamList() {\n\n ArrayList result = new ArrayList();\n for( int i = 0 ; i < leagues_array.size() ; ++i ) {\n /* each group need each HashMap-Here for each group we have 3 subgroups */\n ArrayList secList = new ArrayList();\n for( int n = 0 ; n < SplashScreen.full_teams_array.get(i).size() ; n++ ) {\n HashMap child = new HashMap();\n child.put( \"Team\", SplashScreen.full_teams_array.get(i).get(n) );\n boolean favorite_found = false;\n for(int j=0; j<SplashScreen.new_favorites_array.size(); j++) {\n if(SplashScreen.full_teams_array.get(i).get(n).toString().equals(SplashScreen.new_favorites_array.get(j)[1]) &&\n leagues_array.get(i).equals(SplashScreen.new_favorites_array.get(j)[0]) ) {\n favorite_found = true;\n }\n }\n if(favorite_found) { child.put( \"Favorite\", \"1\" ); }\n else { child.put( \"Favorite\", \"0\" ); }/*\n if(SplashScreen.full_teams_array.get(i).get(n).toString().equals(favorite_team) &&\n leagues_array.get(i).equals(favorite_league) ) {\n child.put( \"Favorite\", \"1\" );\n } else {\n }\n child.put( \"Favorite\", \"0\" );/*\n }*/\n secList.add( child );\n }\n result.add( secList );\n }\n return result;\n }",
"private List<Equipe> getFavoriteEquipes(List<Equipe> allEquipes) {\n\t\tList<Equipe> retain = new ArrayList<Equipe>(allEquipes.size());\n\t\tfor (Equipe equipe : allEquipes) {\n\t\t\tif (equipe.favorite) {\n\t\t\t\tretain.add(equipe);\n\t\t\t}\n\t\t}\n\t\treturn retain;\n\t}",
"@Override\n public List<UserCirclePostPojo> getUserCirclePostFavouritesList(Map<String, Object> params) {\n return yourFavouritesDetaildao.getUserCirclePostFavouritesList(params);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == R.id.action_settings) {\n\n return true;\n }\n if (id == R.id.action_fav) {\n Intent intent = new Intent(getApplicationContext(),ThirdActivity.class);\n startActivity(intent);\n return true;\n }\n if (id == R.id.action_addfav) {\n\n int i = 0;\n Map<String, ?> map = sharedPreferences.getAll();\n for(Map.Entry mEntry : map.entrySet()){\n if(Pattern.matches(\"fav \"+titre.getText(), mEntry.getKey()+\"\")){\n Toast.makeText(this,titre.getText()+\" removed from favorite\",Toast.LENGTH_SHORT).show();\n sharedPreferences\n .edit()\n .remove(mEntry.getKey()+\"\")\n .remove(titre.getText()+\" id\")\n .apply();\n i=1;\n }\n }\n\n if(i==0) {\n Toast.makeText(this, titre.getText() + \" added to favorite\", Toast.LENGTH_SHORT).show();\n sharedPreferences\n .edit()\n .putString(\"fav \" + titre.getText(), titre.getText() + \"\")\n .putInt(titre.getText() + \" id\", idAnime)\n .apply();\n }\n i=0;\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"public Cursor fetchAllFavorites() {\n\n return mDb.query(DATABASE_TABLE_FAVORITES, new String[] {KEY_ROWID, KEY_TITLE,\n KEY_BODY}, null, null, null, null, null);\n }",
"@Test\n public void favoritesFragment_shouldOnlyShowFavoritesNeighbours() {\n onView(allOf(isDisplayed(), withId(R.id.list_neighbours)))\n .perform(RecyclerViewActions.actionOnItemAtPosition(0, click()));\n onView(withId(R.id.add_favorite_fab)).check(matches(isDisplayed()));\n onView(withId(R.id.add_favorite_fab)).perform(click());\n //When : press toolbar home button to parent activity and get favorite neighbour fragment\n pressBack();\n FragmentTransaction favoritesFragment = favoritesFragment();\n favoritesFragment.commit();\n //Then : check if Textview displayed and filled with favorite neighbour name\n onView(allOf(withId(R.id.item_list_name), withText(\"Caroline\"),\n childAtPosition(childAtPosition(withId(R.id.list_favorite_neighbours),\n 0), 1), isDisplayed())).check(matches(withText(\"Caroline\")));\n }",
"public boolean isAlreadyFavorited(){\r\n if(ui.isIsUserAuthenticated()){\r\n Users user = ui.getUser();\r\n if(user.getFavorites() != null){\r\n return user.getFavorites().contains(recipe);\r\n }\r\n else{\r\n return false;\r\n }\r\n }\r\n else{\r\n return false;\r\n }\r\n }",
"public Map<Integer, List<String>> getUsers() {\n\t\tMap<Integer, List<String>> userMap = new HashMap<Integer, List<String>>();\n\t\tList<String> userData = new ArrayList<String>();\n\t\t\n\t\t// Step 1: read the data.csv file\n\t\t// STep 2: fill out the userMap and userData\n\t\t// userID is the key, everything else is userData\n\t\t\n\t\treturn userMap;\n\t}",
"@Override\n\tpublic ArrayList<UserProfile> viewAllFriends(String userId) {\n\t\tArrayList<UserProfile> arrUserProfile = new ArrayList<UserProfile>();\n\t\tUserProfile profile;\n\t\tUserProfileService userProfileService = new UserProfileService();\n\t\t\n\t\tconn = ConnectionFactory.getConnection();\n\n\t\ttry {\n\t\t\tString sql = \"select user_id_2 from friendship where user_id_1=? and status='Y'\";\n\t\t\tpstmt = conn.prepareStatement(sql);\n\t\t\tpstmt.setString(1, userId);\n\n\t\t\tset = pstmt.executeQuery();\n\n\t\t\twhile(set.next()){\n\t\t\t\t//Retrieve by column name\n\t\t\t\tprofile = userProfileService.viewUserProfile(set.getString(\"user_id_2\"));\n\t\t\t\t\n\t\t\t\tarrUserProfile.add(profile);\n\t\t\t}\n\t\t} catch(SQLException sqlex) {\n\t\t\tsqlex.printStackTrace();\n\t\t} catch(Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t} finally {\n\t\t\tConnectionFactory.closeResources(set, pstmt, conn);\n\t\t}\n\n\t\treturn arrUserProfile;\n\t}",
"public List<Integer> getNewsFeed(int userId) {\n List<Integer> res = new ArrayList<Integer>();\n if (!followMap.containsKey(userId)) return res;\n PriorityQueue<Tweet> pq = new PriorityQueue<Tweet>(10000, new Comparator<Tweet>() {\n @Override\n public int compare(final Tweet t1, final Tweet t2) {\n return t2.ts - t1.ts;\n }\n });\n for (int followee : followMap.get(userId)) {\n if (!tweetMap.containsKey(followee) || tweetMap.get(followee).size()==0) continue;\n for (Tweet tweet : tweetMap.get(followee)) pq.add(tweet);\n }\n while (pq.size() > 0 && res.size() < 10) res.add(pq.poll().id);\n return res;\n }",
"public void setFavortiestate(String favortiestate) {\n this.favortiestate = favortiestate;\n }",
"private void updatePage() {\n\t\ttry {\n\t\t\tList<ParseUser> friendUsers = ParseUser.getQuery()\n\t\t\t\t\t\t\t\t\t\t\t\t\t.fromLocalDatastore()\n\t\t\t\t\t\t\t\t\t\t\t\t\t.whereNotEqualTo(\"facebookId\", currentUser.getString(\"facebookId\"))\n\t\t\t\t\t\t\t\t\t\t\t\t\t.find();\n\t\t\t\n\t\t\tpopulateViews(friendUsers);\n\t\t\n\t\t} catch (ParseException e) {\n\t\t\tLog.e(StealTheCheeseApplication.LOG_TAG, \"Fetch friends from localstore failed with message: \" + e);\n\t\t}\n\t}",
"public interface MyFavouriteCollectionsInterface\n{\n /**\n * Return a list of assets that the specified user has added to their favorites list.\n *\n * @param userId userId of user making request.\n * @param startFrom index of the list to start from (0 for start)\n * @param pageSize maximum number of elements to return.\n *\n * @return list of asset details\n *\n * @throws InvalidParameterException one of the parameters is invalid.\n * @throws PropertyServerException there is a problem retrieving information from the property server(s).\n * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request.\n */\n List<AssetCollectionMember> getMyAssets(String userId,\n int startFrom,\n int pageSize) throws InvalidParameterException,\n PropertyServerException,\n UserNotAuthorizedException;\n\n\n /**\n * Add an asset to the identified user's list of favorite assets.\n *\n * @param userId userId of user making request.\n * @param assetGUID unique identifier of the asset.\n *\n * @throws InvalidParameterException one of the parameters is invalid.\n * @throws PropertyServerException there is a problem updating information in the property server(s).\n * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request.\n */\n void addToMyAssets(String userId,\n String assetGUID) throws InvalidParameterException,\n PropertyServerException,\n UserNotAuthorizedException;\n\n\n /**\n * Remove an asset from identified user's list of favorite assets.\n *\n * @param userId userId of user making request.\n * @param assetGUID unique identifier of the asset.\n *\n * @throws InvalidParameterException one of the parameters is invalid.\n * @throws PropertyServerException there is a problem updating information in the property server(s).\n * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request.\n */\n void removeFromMyAssets(String userId,\n String assetGUID) throws InvalidParameterException,\n PropertyServerException,\n UserNotAuthorizedException;\n\n\n /**\n * Return a list of projects that the specified user has added to their favorites list.\n *\n * @param userId userId of user making request.\n * @param startFrom index of the list to start from (0 for start)\n * @param pageSize maximum number of elements to return.\n *\n * @return list of project details\n *\n * @throws InvalidParameterException one of the parameters is invalid.\n * @throws PropertyServerException there is a problem retrieving information from the property server(s).\n * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request.\n */\n List<ProjectCollectionMember> getMyProjects(String userId,\n int startFrom,\n int pageSize) throws InvalidParameterException,\n PropertyServerException,\n UserNotAuthorizedException;\n\n\n /**\n * Add a project to the identified user's list of favorite projects.\n *\n * @param userId userId of user making request.\n * @param projectGUID unique identifier of the project.\n *\n * @throws InvalidParameterException one of the parameters is invalid.\n * @throws PropertyServerException there is a problem updating information in the property server(s).\n * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request.\n */\n void addToMyProjects(String userId,\n String projectGUID) throws InvalidParameterException,\n PropertyServerException,\n UserNotAuthorizedException;\n\n\n /**\n * Remove a project from identified user's list of favorite projects.\n *\n * @param userId userId of user making request.\n * @param projectGUID unique identifier of the project.\n *\n * @throws InvalidParameterException one of the parameters is invalid.\n * @throws PropertyServerException there is a problem updating information in the property server(s).\n * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request.\n */\n void removeFromMyProjects(String userId,\n String projectGUID) throws InvalidParameterException,\n PropertyServerException,\n UserNotAuthorizedException;\n\n\n /**\n * Return a list of communities that the specified user has added to their favorites list.\n *\n * @param userId userId of user making request.\n * @param startFrom index of the list to start from (0 for start)\n * @param pageSize maximum number of elements to return.\n *\n * @return list of community details\n *\n * @throws InvalidParameterException one of the parameters is invalid.\n * @throws PropertyServerException there is a problem retrieving information from the property server(s).\n * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request.\n */\n List<CommunityCollectionMember> getMyCommunities(String userId,\n int startFrom,\n int pageSize) throws InvalidParameterException,\n PropertyServerException,\n UserNotAuthorizedException;\n\n\n /**\n * Add a community to the identified user's list of favorite communities.\n *\n * @param userId userId of user making request.\n * @param communityGUID unique identifier of the community.\n *\n * @throws InvalidParameterException one of the parameters is invalid.\n * @throws PropertyServerException there is a problem updating information in the property server(s).\n * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request.\n */\n void addToMyCommunities(String userId,\n String communityGUID) throws InvalidParameterException,\n PropertyServerException,\n UserNotAuthorizedException;\n\n\n /**\n * Remove a community from identified user's list of favorite communities.\n *\n * @param userId userId of user making request.\n * @param communityGUID unique identifier of the community.\n *\n * @throws InvalidParameterException one of the parameters is invalid\n * @throws PropertyServerException there is a problem updating information in the property server(s)\n * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request\n */\n void removeFromMyCommunities(String userId,\n String communityGUID) throws InvalidParameterException,\n PropertyServerException,\n UserNotAuthorizedException;\n\n}",
"@Override\r\n\tpublic PageInfo<Users> getFans(Integer userId,Integer pageNum,Integer pageSize) {\n\t\tPageHelper.startPage(pageNum, pageSize, true);\r\n\t\tList<Users> fans = this.uMapper.getFans(userId);\r\n\t\treturn new PageInfo<>(fans);\r\n\t}",
"public HashMap<Integer, ArrayList<Integer>> getFollowers(String file) {\n List<String[]> data = this.extract(file);\n HashMap<Integer, ArrayList<Integer>> followers = new HashMap<>();\n for (String[] row : data) {\n int user_id = Integer.parseInt(row[0]);\n int follower_id = Integer.parseInt(row[1]);\n if (followers.containsKey(user_id)) {\n followers.get(user_id).add(follower_id);\n } else {\n followers.put(user_id, new ArrayList<>());\n followers.get(user_id).add(follower_id);\n }\n }\n return followers;\n }",
"public void onLoadMenuMyFavoritesSelected();",
"public void setIsUserFav(User user) {\n if(user.isUsersFavouritePost(this.mPost))\n this.isFavourite.set(true);\n else\n this.isFavourite.set(false);\n\n //if(this.mPost.getFavourite().contains(user))\n // this.isFavourite.set(true);\n //this.isFavourite.set(false);\n }",
"public Map<Integer, List<Fruit>> groupByLikes() {\n\t\treturn fruits.stream().collect(Collectors.groupingBy(Fruit::getLikes));\n\t}",
"@Override\n public void onResume() {\n super.onResume();\n initListFavorite();\n }",
"public FavoriteAdapter(Map<Cocktail, String> cocktails, Context c) {\n this.map_favorites = cocktails;\n this.mDataSet = getStringArrFromMap();\n this.map_View_Favs = new HashMap<>();\n this.context = c;\n }",
"private Map<String, SortedSet<PortletCategoryBean>> getRegistry43(\n WebRequest request,\n IPerson user,\n PortletCategory rootCategory,\n boolean includeUncategorized,\n Set<IPortletDefinition> favorites) {\n\n /*\n * This collection of all the portlets in the portal is for the sake of\n * tracking which ones are uncategorized. They will be added to the\n * output if includeUncategorized=true.\n */\n Set<IPortletDefinition> portletsNotYetCategorized =\n includeUncategorized\n ? new HashSet<>(portletDefinitionRegistry.getAllPortletDefinitions())\n : new HashSet<>(); // Not necessary to fetch them if we're not\n // tracking them\n\n // construct a new channel registry\n Map<String, SortedSet<PortletCategoryBean>> rslt = new TreeMap<>();\n SortedSet<PortletCategoryBean> categories = new TreeSet<>();\n\n // add the root category and all its children to the registry\n final Locale locale = getUserLocale(user);\n categories.add(\n preparePortletCategoryBean(\n request, rootCategory, portletsNotYetCategorized, user, locale, favorites));\n\n if (includeUncategorized) {\n /*\n * uPortal historically has provided for a convention that portlets not in any category\n * may potentially be viewed by users but may not be subscribed to.\n *\n * As of uPortal 4.2, the logic below now takes any portlets the user has BROWSE access to\n * that have not already been identified as belonging to a category and adds them to a category\n * called Uncategorized.\n */\n\n EntityIdentifier ei = user.getEntityIdentifier();\n IAuthorizationPrincipal ap =\n AuthorizationServiceFacade.instance().newPrincipal(ei.getKey(), ei.getType());\n\n Set<PortletDefinitionBean> marketplacePortlets = new HashSet<>();\n for (IPortletDefinition portlet : portletsNotYetCategorized) {\n if (authorizationService.canPrincipalBrowse(ap, portlet)) {\n PortletDefinitionBean pdb =\n preparePortletDefinitionBean(\n request, portlet, locale, favorites.contains(portlet));\n marketplacePortlets.add(pdb);\n }\n }\n\n // construct a new channel category bean for this category\n final String uncName = messageSource.getMessage(UNCATEGORIZED, new Object[] {}, locale);\n final String uncDescription =\n messageSource.getMessage(UNCATEGORIZED_DESC, new Object[] {}, locale);\n PortletCategory pc =\n new PortletCategory(\n uncName); // Use of this String for Id matches earlier version of API\n pc.setName(uncName);\n pc.setDescription(uncDescription);\n PortletCategoryBean unc =\n PortletCategoryBean.fromPortletCategory(pc, null, marketplacePortlets);\n\n // Add even if no portlets in category\n categories.add(unc);\n }\n\n rslt.put(CATEGORIES_MAP_KEY, categories);\n return rslt;\n }",
"public List<Integer> getNewsFeed(int userId) {\n List<Integer> ret = new ArrayList<>();\n if (!map.containsKey(userId)) return ret;\n User u = map.get(userId);\n PriorityQueue<Tweet> q = new PriorityQueue<>(u.followee.size(), (a, b) -> (b.time - a.time));\n for (User usr: u.followee) {\n if (usr.tweet != null)\n q.add(usr.tweet);\n }\n for (int i = 0; i < 10 && !q.isEmpty(); i++) {\n Tweet t = q.poll();\n ret.add(t.ID);\n if (t.next != null)\n q.add(t.next);\n }\n return ret;\n }",
"public void addToFavorites() {\n\n // Create new content values object\n ContentValues contentValues = new ContentValues();\n\n contentValues.put(FavMovieEntry.COLUMN_MOVIE_ID, sMovie.getMovieId());\n contentValues.put(FavMovieEntry.COLUMN_MOVIE_TITLE, sMovie.getMovieTitle());\n contentValues.put(FavMovieEntry.COLUMN_MOVIE_ORIGINAL_TITLE, sMovie.getMovieOriginalTitle());\n contentValues.put(FavMovieEntry.COLUMN_POSTER_PATH, sMovie.getPoster());\n contentValues.put(FavMovieEntry.COLUMN_BACKDROP_PATH, sMovie.getMovieBackdrop());\n contentValues.put(FavMovieEntry.COLUMN_MOVIE_RELEASE_DATE, sMovie.getReleaseDate());\n contentValues.put(FavMovieEntry.COLUMN_MOVIE_RATING, sMovie.getVoteAverage());\n contentValues.put(FavMovieEntry.COLUMN_MOVIE_SYNOPSIS, sMovie.getPlotSynopsis());\n\n try {\n mCurrentMovieUri = getContentResolver().insert(FavMovieEntry.CONTENT_URI,\n contentValues);\n } catch (IllegalArgumentException e) {\n mCurrentMovieUri = null;\n Log.v(LOG_TAG, e.toString());\n }\n\n if (mCurrentMovieUri != null) {\n isAddedToFavorites();\n }\n\n }",
"public List<Integer> getNewsFeed(int userId) {\n List<Integer> feedList = new LinkedList<>();\n\n if (!usersMap.containsKey(userId)) return feedList;\n\n PriorityQueue<Tweet> minHeap = new PriorityQueue<>(10, new Comparator<Tweet>() {\n @Override\n public int compare(Tweet t1, Tweet t2) {\n return t2.time - t1.time;\n }\n });\n\n for (int followerId : usersMap.get(userId).follows) {\n User user = usersMap.get(followerId);\n // System.out.println(usersMap.get(userId).follows);\n if (user.tweetHead != null)\n minHeap.add(user.tweetHead);\n }\n\n\n Tweet tmpTweet;\n while (!minHeap.isEmpty() && feedList.size() < 10) {\n tmpTweet = minHeap.poll();\n if (tmpTweet != null)\n feedList.add(tmpTweet.tweetId);\n\n if (tmpTweet.next != null) {\n minHeap.add(tmpTweet.next);\n }\n }\n\n return feedList;\n }"
] | [
"0.63980716",
"0.63447785",
"0.5697689",
"0.5613639",
"0.55295163",
"0.545945",
"0.544981",
"0.5185372",
"0.5088193",
"0.5071896",
"0.5035194",
"0.5016374",
"0.5006748",
"0.4993676",
"0.4969845",
"0.496869",
"0.49389723",
"0.49035287",
"0.49034056",
"0.48899975",
"0.4886947",
"0.48644033",
"0.48539832",
"0.48466298",
"0.48426273",
"0.48369318",
"0.48368326",
"0.48140708",
"0.48091382",
"0.47948512",
"0.46911687",
"0.46832553",
"0.4655131",
"0.46526024",
"0.46402505",
"0.46201316",
"0.4620122",
"0.46103394",
"0.46035564",
"0.46030506",
"0.46009493",
"0.4592911",
"0.4590946",
"0.45866832",
"0.4579884",
"0.4575559",
"0.4567633",
"0.45501134",
"0.45364758",
"0.45342076",
"0.452769",
"0.45276886",
"0.45138708",
"0.4502678",
"0.44860336",
"0.44833",
"0.44759127",
"0.44705418",
"0.44664004",
"0.44592357",
"0.44488925",
"0.44423062",
"0.44281572",
"0.44240564",
"0.4422074",
"0.44184983",
"0.4398097",
"0.43954656",
"0.43824852",
"0.43726313",
"0.43723553",
"0.43720835",
"0.43704322",
"0.43672422",
"0.43661958",
"0.4357226",
"0.435155",
"0.43499705",
"0.4346057",
"0.43408275",
"0.43396932",
"0.43379003",
"0.43300137",
"0.4317218",
"0.43142226",
"0.43119466",
"0.43116114",
"0.43052647",
"0.42992702",
"0.4298069",
"0.42963043",
"0.4295759",
"0.42954668",
"0.42706704",
"0.42548162",
"0.4254562",
"0.42498416",
"0.4247052",
"0.42463052",
"0.42460644"
] | 0.6599482 | 0 |
Parses a Favorite asset to determine if it is a section page favorite. If so, the asset is parsed into a PageViewVO and is added to the appropriate collection of pages on the page map. | protected void processFavorite(Map<String,List<PageViewVO>> pages, FavoriteVO fav) {
try {
checkCollectionKey(fav.getTypeCd());
} catch (Exception e) {
// this fav is not a 'Section' type so return.
return;
}
// convert favorite into a PageViewVO
PageViewVO page = new PageViewVO();
page.setReferenceCode(fav.getTypeCd());
page.setPageId(fav.getRelId());
page.setRequestUri(fav.getUriTxt());
if (fav.getAsset() != null) {
SolrDocument sDoc = (SolrDocument)fav.getAsset();
page.setPageDisplayName(sDoc.getFieldValue(SearchDocumentHandler.TITLE).toString());
}
log.debug("adding favorite: ref cd | pageId | uri | name: " + page.getReferenceCode() +"|"+page.getPageId() +"|"+page.getRequestUri() +"|"+page.getPageDisplayName());
List<PageViewVO>pList = pages.get(page.getReferenceCode());
if (pList != null)
pList.add(page);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@SuppressWarnings(\"unchecked\")\n\tprotected Map<String, List<PageViewVO>> processUserFavorites(ModuleVO mod) \n\t\t\tthrows ActionException {\n\t\tlog.debug(\"processUserFavorites...\");\n\t\tMap<String, List<PageViewVO>> pageMap = initializePageMap();\n\t\tif (mod.getErrorCondition()) return pageMap;\n\n\t\tList<FavoriteVO> favs = (List<FavoriteVO>)mod.getActionData();\n\n\t\tfor (FavoriteVO fav : favs) {\n\t\t\tlog.debug(\"found fav, typeCd | relId | uriTxt: \" + fav.getTypeCd() + \"|\" + fav.getRelId() + \"|\" + fav.getUriTxt());\n\t\t\tif (fav.getAsset() == null) continue; \n\t\t\tprocessFavorite(pageMap,fav);\n\t\t}\n\t\treturn pageMap;\n\t}",
"private void populateFavoritesSections() {\n \tif (mUserProfile.userFavoriteAlbums != null && !Utils.isListEmpty(mUserProfile.userFavoriteAlbums.albums)) {\n \t\tmContainerFavoriteAlbums.setVisibility(View.VISIBLE);\n \t\t\n \t\tUserFavoriteAlbums userFavoriteAlbums = mUserProfile.userFavoriteAlbums;\n \t\tmTextFavoriteFavoriteAlbumsValue.setText(Integer.toString(userFavoriteAlbums.albumCount));\n \t\t\n \t\tStack<ImageView> favoriteAlbumsImages = new Stack<ImageView>();\n \t\tfavoriteAlbumsImages.add(mTextFavoriteFavoriteAlbum3);\n \t\tfavoriteAlbumsImages.add(mTextFavoriteFavoriteAlbum2);\n \t\tfavoriteAlbumsImages.add(mTextFavoriteFavoriteAlbum1);\n\n \t\tImageView albumImage = null;\n \t\t\n \t\tfor (MediaItem mediaItem : userFavoriteAlbums.albums) {\n \t\t\tif (favoriteAlbumsImages.isEmpty())\n \t\t\t\tbreak;\n \t\t\t\n \t\t\talbumImage = favoriteAlbumsImages.pop();\n \t\t\t\n \t\t\t//mImageFetcher.loadImage(mediaItem.getImageUrl(), albumImage);\n \t\t\t\n \t\t\tPicasso.with(getActivity()).cancelRequest(albumImage);\n \t\t\tif(getActivity() != null && mediaItem.getImageUrl() != null){\n \t\t\t\tPicasso.with(getActivity()).load(mediaItem.getImageUrl()).into(albumImage);\t\n \t\t\t}\n\t\t\t}\n \t\t\n \t} else {\n \t\tmContainerFavoriteAlbums.setVisibility(View.GONE);\n \t}\n \t\n \t// populates the favorite songs.\n \tif (mUserProfile.userFavoriteSongs != null && !Utils.isListEmpty(mUserProfile.userFavoriteSongs.songs)) {\n \t\tmContainerFavoriteSongs.setVisibility(View.VISIBLE);\n \t\t\n \t\tUserFavoriteSongs userFavoriteSongs = mUserProfile.userFavoriteSongs;\n \t\tmTextFavoriteSongsValue.setText(Integer.toString(userFavoriteSongs.songsCount));\n \t\t\n \t\tStack<TextView> favoriteSongsNames = new Stack<TextView>();\n \t\tfavoriteSongsNames.add(mTextFavoriteSong3Name);\n \t\tfavoriteSongsNames.add(mTextFavoriteSong2Name);\n \t\tfavoriteSongsNames.add(mTextFavoriteSong1Name);\n\n \t\tTextView songName = null;\n \t\t\n \t\tfor (MediaItem mediaItem : userFavoriteSongs.songs) {\n \t\t\tif (favoriteSongsNames.isEmpty())\n \t\t\t\tbreak;\n \t\t\t\n \t\t\tsongName = favoriteSongsNames.pop();\n \t\t\tsongName.setText(mediaItem.getTitle());\n\t\t\t}\n \t\t\n \t} else {\n \t\tmContainerFavoriteSongs.setVisibility(View.GONE);\n \t}\n \t\n \t// populates the favorite playlists.\n \tif (mUserProfile.userFavoritePlaylists != null && !Utils.isListEmpty(mUserProfile.userFavoritePlaylists.playlists)) {\n \t\tmContainerFavoritePlaylists.setVisibility(View.VISIBLE);\n \t\t\n \t\tUserFavoritePlaylists userFavoritePlaylists = mUserProfile.userFavoritePlaylists;\n \t\tmTextFavoritePlaylistValue.setText(Integer.toString(userFavoritePlaylists.playlistCount));\n \t\t\n \t\tStack<TextView> favoritePlaylistsNames = new Stack<TextView>();\n \t\tfavoritePlaylistsNames.add(mTextFavoritePlaylist3Name);\n \t\tfavoritePlaylistsNames.add(mTextFavoritePlaylist2Name);\n \t\tfavoritePlaylistsNames.add(mTextFavoritePlaylist1Name);\n\n \t\tTextView playlistsName = null;\n \t\t\n \t\tfor (MediaItem mediaItem : userFavoritePlaylists.playlists) {\n \t\t\tif (favoritePlaylistsNames.isEmpty())\n \t\t\t\tbreak;\n \t\t\t\n \t\t\tplaylistsName = favoritePlaylistsNames.pop();\n \t\t\tplaylistsName.setText(mediaItem.getTitle());\n\t\t\t}\n \t\t\n \t} else {\n \t\tmContainerFavoritePlaylists.setVisibility(View.GONE);\n \t}\n \t\n \t// populates the favorite videos.\n \tif (mUserProfile.userFavoriteVideos != null && !Utils.isListEmpty(mUserProfile.userFavoriteVideos.videos)) {\n \t\tmContainerFavoriteVideos.setVisibility(View.VISIBLE);\n \t\t\n \t\tUserFavoriteVideos userFavoriteVideos = mUserProfile.userFavoriteVideos;\n \t\tmTextFavoriteVideosValue.setText(Integer.toString(userFavoriteVideos.videoCount));\n \t\t\n \t\tStack<ImageView> favoriteVideosImages = new Stack<ImageView>();\n \t\tfavoriteVideosImages.add(mTextFavoriteVideo3);\n \t\tfavoriteVideosImages.add(mTextFavoriteVideo2);\n \t\tfavoriteVideosImages.add(mTextFavoriteVideo1);\n\n \t\tImageView videoImage = null;\n \t\t\n \t\tfor (MediaItem mediaItem : userFavoriteVideos.videos) {\n \t\t\tif (favoriteVideosImages.isEmpty())\n \t\t\t\tbreak;\n \t\t\t\n \t\t\tvideoImage = favoriteVideosImages.pop();\n \t\t\t\n \t\t\t//mImageFetcher.loadImage(mediaItem.getImageUrl(), videoImage);\n \t\t\t\n \t\t\tPicasso.with(getActivity()).cancelRequest(videoImage);\n \t\t\tif(getActivity() != null && !TextUtils.isEmpty(mediaItem.getImageUrl())){\n \t\t\t\tPicasso.with(getActivity()).load(mediaItem.getImageUrl()).into(videoImage); \t\t\t\t\n \t\t\t}\n\t\t\t}\n \t\t\n \t} else {\n \t\tmContainerFavoriteVideos.setVisibility(View.GONE);\n \t}\n\t}",
"public void saveFavorite(){\n //make sure movie is NOT already a favorite\n if(!mMovieStaff.alreadyFavorite(mMovie.getTMDBId())){\n //is a new favorite, favorite movie list status has changed\n mFavoriteChanged = true;\n\n //set movie item favorite status as true\n mMovie.setFavorite(true);\n\n //save movie to favorite database table\n mMovieValet.saveFavorite(mMovie);\n\n //add movie to favorite movie list buffer\n mMovieStaff.addFavorite(mMovie);\n }\n\n //check if movie list type is display a favorite list and if the device is a tablet\n if(mMovieType == PosterHelper.NAME_ID_FAVORITE && mIsTablet){\n //both yes, get favorite movies to update poster fragment\n getMovieList(PosterHelper.NAME_ID_FAVORITE);\n }\n }",
"private PortletCategoryBean filterCategoryFavoritesOnly(PortletCategoryBean category) {\n\n // Subcategories\n final Set<PortletCategoryBean> subcategories = new HashSet<>();\n category.getSubcategories()\n .forEach(\n sub -> {\n final PortletCategoryBean filteredBean =\n filterCategoryFavoritesOnly(sub);\n if (filteredBean != null) {\n subcategories.add(filteredBean);\n }\n });\n\n // Portlets\n final Set<PortletDefinitionBean> portlets = new HashSet<>();\n category.getPortlets()\n .forEach(\n child -> {\n if (child.getFavorite()) {\n log.debug(\n \"Including portlet '{}' because it is a favorite: {}\",\n child.getFname());\n portlets.add(child);\n } else {\n log.debug(\n \"Skipping portlet '{}' because it IS NOT a favorite: {}\",\n child.getFname());\n }\n });\n\n return !subcategories.isEmpty() || !portlets.isEmpty()\n ? PortletCategoryBean.create(\n category.getId(),\n category.getName(),\n category.getDescription(),\n subcategories,\n portlets)\n : null;\n }",
"@Override\n public void onTabSelected(Tab tab, FragmentTransaction fragmentTransaction) {\n viewPager.setCurrentItem(tab.getPosition());\n\n // If the favorites tab is selected, remove any items that have been unfavorited.\n if (tab.getPosition() == TAB_FAVORITES) {\n SectionsPagerAdapter adapter = (SectionsPagerAdapter) viewPager.getAdapter();\n TalkListFragment fragment = (TalkListFragment) adapter.getItem(TAB_FAVORITES);\n fragment.removeUnfavoritedItems();\n }\n }",
"private boolean isAddedToFavorites() {\n boolean isFavorite = false;\n\n String[] projection = {FavMovieEntry.COLUMN_MOVIE_ID};\n String selection = FavMovieEntry.COLUMN_MOVIE_ID + \"=?\";\n String[] selectionArgs = new String[]{\n String.valueOf(sMovie.getMovieId())};\n\n Cursor cursor = this.getContentResolver().query(\n FavMovieEntry.CONTENT_URI,\n projection,\n selection,\n selectionArgs,\n null\n );\n\n if (cursor != null && cursor.moveToFirst()) {\n if (cursor.getCount() > 0) {\n isFavorite = true;\n long currentIndex = cursor.getLong(cursor.getColumnIndex(FavMovieEntry.COLUMN_MOVIE_ID));\n mCurrentMovieUri = ContentUris.withAppendedId(FavMovieEntry.CONTENT_URI, currentIndex);\n } else {\n isFavorite = false;\n\n mCurrentMovieUri = null;\n }\n cursor.close();\n }\n\n return isFavorite;\n }",
"private void getFavData() {\n favouriteViewModel.getFavouritePostData().observe(this, result -> {\n if (result != null) {\n if (result.status == Status.SUCCESS) {\n if (this.getActivity() != null) {\n Utils.psLog(result.status.toString());\n favouriteViewModel.setLoadingState(false);\n itemViewModel.setItemDetailObj(itemViewModel.itemId, itemViewModel.historyFlag, loginUserId);\n }\n\n } else if (result.status == Status.ERROR) {\n if (this.getActivity() != null) {\n Utils.psLog(result.status.toString());\n favouriteViewModel.setLoadingState(false);\n }\n }\n }\n });\n }",
"public void addBusinessToFavorites(Business business) {\n for(Business b : favorites) {\n if(b.getTitle().equals(business.getTitle()))\n return;\n }\n\n //add business to favorites list.\n favorites.add(business);\n }",
"@SuppressWarnings(\"unchecked\")\n\tprotected void updateSessionFavorites(SMTSession session, PageViewVO fav, boolean isDelete) {\n\t\t// get the Favs map off of the session.\n\t\tMap<String,List<PageViewVO>> favMap = (Map<String,List<PageViewVO>>)session.getAttribute(MyFavoritesAction.MY_FAVORITES);\n\t\tList<PageViewVO> favs = favMap.get(fav.getReferenceCode());\n\t\tif (favs == null) favs = new ArrayList<>();\n\t\tif (isDelete) {\n\t\t\t// remove fav\n\t\t\tremoveFromSession(favs, fav.getPageId());\n\t\t} else {\n\t\t\t// add fav\n\t\t\tfavs.add(fav);\n\t\t}\n\t\t// replace the favs map on the session.\n\t\tsession.setAttribute(MyFavoritesAction.MY_FAVORITES, favMap);\n\t}",
"public static void findFavourites() {\n DataManager.currentFavouritesList.clear();\n\n for (int i = 0; i < DataManager.fullFavouritesList.size(); i++) {\n Attraction attraction = DataManager.findAttractionByName(DataManager.fullFavouritesList.get(i));\n\n if (attraction != null) {\n DataManager.currentFavouritesList.add(attraction);\n }\n }\n\n FavouritesListFragment.backgroundLayout.setVisibility(DataManager.currentFavouritesList.size() == 0 ? View.VISIBLE : View.INVISIBLE);\n\n AttractionsListFragment.attractionsAdapter.notifyDataSetChanged();\n }",
"@Override\n\tpublic void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {\n\t\tmCurrentTabPosition = tab.getPosition();\n\n\t\tif (mCurrentTabPosition == 1) {\n\t\t\tmFavoriteFragment = mSectionsPagerAdapter.getItem(tab.getPosition());\n\t\t\tfragmentTransaction.attach(mFavoriteFragment);\n\n\t\t\tif (mFavoriteFragment.getView() != null) {\n\t\t\t\t((ListView) mFavoriteFragment.getView().findViewById(android.R.id.list)).setAdapter(createSentenceArrayAdapter(mFavoriteFragment.getActivity().getBaseContext(), mTempFavoriteList));\n\t\t\t}\n\n\t\t\tif (mOptionsMenu != null) {\n\t\t\t\tinvalidateOptionsMenu();\n\t\t\t\tgetMenuInflater().inflate(R.menu.menu_sentence_favorite, mOptionsMenu);\n\t\t\t}\n\t\t} else if (mCurrentTabPosition == 0) {\n\t\t\tmSentenceFragment = mSectionsPagerAdapter.getItem(tab.getPosition());\n\t\t\tfragmentTransaction.attach(mSentenceFragment);\n\n\t\t\tif (mOptionsMenu != null) {\n\t\t\t\tinvalidateOptionsMenu();\n\t\t\t\tgetMenuInflater().inflate(R.menu.menu_sentence, mOptionsMenu);\n\t\t\t}\n\t\t}\n\n\t\tmViewPager.setCurrentItem(mCurrentTabPosition);\n\t}",
"@Override\n public void addProductToFavorites(View view, Intent intent) {\n try {\n if(iProduct != null && view != null && intent != null){\n Context context = view.getContext();\n String jsonProduct = intent.getStringExtra(CommonPresenter.DETAIL_PRODUCT);\n Product product = CommonPresenter.getProductFromJSON(jsonProduct);\n CRUDFavorite crudFavorite = new CRUDFavorite(context);\n boolean isProductExists = crudFavorite.isProductExists(product.getProductId());\n if(isProductExists){\n crudFavorite.deleteByProductId(product.getProductId());\n CommonPresenter.showSnackBarMessage(view, context.getString(R.string.lb_product_delete_to_favorite));\n iProduct.changeImageRightResource(R.drawable.ic_add_to_favorite_32dp);\n }\n else{\n crudFavorite.add(new Favorite(0, product));\n CommonPresenter.showSnackBarMessage(view, context.getString(R.string.lb_product_add_to_favorite));\n iProduct.changeImageRightResource(R.drawable.ic_favorite_32dp);\n }\n }\n }\n catch (Exception ex){\n Log.e(\"TAG_ERROR\", \"ProductPresenter-->addProductToFavorites() : \"+ex.getMessage());\n }\n }",
"public void removeFavorite(){\n //check if movie is in the user favorite list\n if(mMovieStaff.alreadyFavorite(mMovie.getTMDBId())){\n //is in the favorite list, mark that list has changed\n mFavoriteChanged = true;\n\n //update movie item favorite status\n mMovie.setFavorite(false);\n\n //delete movie item from favorite database table\n mMovieValet.deleteFavorite(mMovie);\n\n //remove movie item from favorite movie list buffer\n mMovieStaff.removeFavorite(mMovie);\n }\n\n //check if movie list type is display a favorite list and if the device is a tablet\n if(mMovieType == PosterHelper.NAME_ID_FAVORITE && mIsTablet){\n //both yes, get favorite movies to update poster fragment\n getMovieList(PosterHelper.NAME_ID_FAVORITE);\n }\n }",
"public interface MyFavouriteCollectionsInterface\n{\n /**\n * Return a list of assets that the specified user has added to their favorites list.\n *\n * @param userId userId of user making request.\n * @param startFrom index of the list to start from (0 for start)\n * @param pageSize maximum number of elements to return.\n *\n * @return list of asset details\n *\n * @throws InvalidParameterException one of the parameters is invalid.\n * @throws PropertyServerException there is a problem retrieving information from the property server(s).\n * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request.\n */\n List<AssetCollectionMember> getMyAssets(String userId,\n int startFrom,\n int pageSize) throws InvalidParameterException,\n PropertyServerException,\n UserNotAuthorizedException;\n\n\n /**\n * Add an asset to the identified user's list of favorite assets.\n *\n * @param userId userId of user making request.\n * @param assetGUID unique identifier of the asset.\n *\n * @throws InvalidParameterException one of the parameters is invalid.\n * @throws PropertyServerException there is a problem updating information in the property server(s).\n * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request.\n */\n void addToMyAssets(String userId,\n String assetGUID) throws InvalidParameterException,\n PropertyServerException,\n UserNotAuthorizedException;\n\n\n /**\n * Remove an asset from identified user's list of favorite assets.\n *\n * @param userId userId of user making request.\n * @param assetGUID unique identifier of the asset.\n *\n * @throws InvalidParameterException one of the parameters is invalid.\n * @throws PropertyServerException there is a problem updating information in the property server(s).\n * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request.\n */\n void removeFromMyAssets(String userId,\n String assetGUID) throws InvalidParameterException,\n PropertyServerException,\n UserNotAuthorizedException;\n\n\n /**\n * Return a list of projects that the specified user has added to their favorites list.\n *\n * @param userId userId of user making request.\n * @param startFrom index of the list to start from (0 for start)\n * @param pageSize maximum number of elements to return.\n *\n * @return list of project details\n *\n * @throws InvalidParameterException one of the parameters is invalid.\n * @throws PropertyServerException there is a problem retrieving information from the property server(s).\n * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request.\n */\n List<ProjectCollectionMember> getMyProjects(String userId,\n int startFrom,\n int pageSize) throws InvalidParameterException,\n PropertyServerException,\n UserNotAuthorizedException;\n\n\n /**\n * Add a project to the identified user's list of favorite projects.\n *\n * @param userId userId of user making request.\n * @param projectGUID unique identifier of the project.\n *\n * @throws InvalidParameterException one of the parameters is invalid.\n * @throws PropertyServerException there is a problem updating information in the property server(s).\n * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request.\n */\n void addToMyProjects(String userId,\n String projectGUID) throws InvalidParameterException,\n PropertyServerException,\n UserNotAuthorizedException;\n\n\n /**\n * Remove a project from identified user's list of favorite projects.\n *\n * @param userId userId of user making request.\n * @param projectGUID unique identifier of the project.\n *\n * @throws InvalidParameterException one of the parameters is invalid.\n * @throws PropertyServerException there is a problem updating information in the property server(s).\n * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request.\n */\n void removeFromMyProjects(String userId,\n String projectGUID) throws InvalidParameterException,\n PropertyServerException,\n UserNotAuthorizedException;\n\n\n /**\n * Return a list of communities that the specified user has added to their favorites list.\n *\n * @param userId userId of user making request.\n * @param startFrom index of the list to start from (0 for start)\n * @param pageSize maximum number of elements to return.\n *\n * @return list of community details\n *\n * @throws InvalidParameterException one of the parameters is invalid.\n * @throws PropertyServerException there is a problem retrieving information from the property server(s).\n * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request.\n */\n List<CommunityCollectionMember> getMyCommunities(String userId,\n int startFrom,\n int pageSize) throws InvalidParameterException,\n PropertyServerException,\n UserNotAuthorizedException;\n\n\n /**\n * Add a community to the identified user's list of favorite communities.\n *\n * @param userId userId of user making request.\n * @param communityGUID unique identifier of the community.\n *\n * @throws InvalidParameterException one of the parameters is invalid.\n * @throws PropertyServerException there is a problem updating information in the property server(s).\n * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request.\n */\n void addToMyCommunities(String userId,\n String communityGUID) throws InvalidParameterException,\n PropertyServerException,\n UserNotAuthorizedException;\n\n\n /**\n * Remove a community from identified user's list of favorite communities.\n *\n * @param userId userId of user making request.\n * @param communityGUID unique identifier of the community.\n *\n * @throws InvalidParameterException one of the parameters is invalid\n * @throws PropertyServerException there is a problem updating information in the property server(s)\n * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request\n */\n void removeFromMyCommunities(String userId,\n String communityGUID) throws InvalidParameterException,\n PropertyServerException,\n UserNotAuthorizedException;\n\n}",
"@Override\r\n public void onFavoriteClicked() {\r\n fragFav = new FragmentFavoritesList();\r\n FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();\r\n // Replace whatever is in the fragment_container view with this fragment,\r\n // and add the transaction to the back stack so the user can navigate back\r\n if (getResources().getBoolean(R.bool.isTablet)) {\r\n transaction.add(R.id.listFrag_tab,fragFav, \"FragmentFavoritesList\");\r\n }else {\r\n transaction.add(R.id.activity_main_smart, fragFav, \"FragmentFavoritesList\");\r\n }\r\n transaction.addToBackStack(null);\r\n // Commit the transaction\r\n transaction.commit();\r\n }",
"public boolean isFavorite() {\n\t\tsynchronized (this) {\n\t\t\tif (mFavoritesCache != null) {\n\t\t\t\treturn mFavoritesCache.isFavoriteSong(getAudioId(),\n\t\t\t\t\t\tgetTrackHost());\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public void addToFavorites() {\n\n // Create new content values object\n ContentValues contentValues = new ContentValues();\n\n contentValues.put(FavMovieEntry.COLUMN_MOVIE_ID, sMovie.getMovieId());\n contentValues.put(FavMovieEntry.COLUMN_MOVIE_TITLE, sMovie.getMovieTitle());\n contentValues.put(FavMovieEntry.COLUMN_MOVIE_ORIGINAL_TITLE, sMovie.getMovieOriginalTitle());\n contentValues.put(FavMovieEntry.COLUMN_POSTER_PATH, sMovie.getPoster());\n contentValues.put(FavMovieEntry.COLUMN_BACKDROP_PATH, sMovie.getMovieBackdrop());\n contentValues.put(FavMovieEntry.COLUMN_MOVIE_RELEASE_DATE, sMovie.getReleaseDate());\n contentValues.put(FavMovieEntry.COLUMN_MOVIE_RATING, sMovie.getVoteAverage());\n contentValues.put(FavMovieEntry.COLUMN_MOVIE_SYNOPSIS, sMovie.getPlotSynopsis());\n\n try {\n mCurrentMovieUri = getContentResolver().insert(FavMovieEntry.CONTENT_URI,\n contentValues);\n } catch (IllegalArgumentException e) {\n mCurrentMovieUri = null;\n Log.v(LOG_TAG, e.toString());\n }\n\n if (mCurrentMovieUri != null) {\n isAddedToFavorites();\n }\n\n }",
"public boolean hasAnyFavorites(IUserLayout layout) {\n Validate.notNull(layout, \"Cannot determine whether a null layout contains favorites.\");\n\n // (premature) performance optimization: short circuit returns true if nonzero favorite\n // portlets\n return (!getFavoritePortletLayoutNodes(layout).isEmpty()\n || !getFavoriteCollections(layout).isEmpty());\n }",
"public FavoriteFragment() {\n }",
"protected void updateProfileFavorites(ActionRequest req, PageViewVO fav) throws ActionException {\n\t\tlog.debug(\"updateProfileFavorites...\");\n\n\t\tMyFavoritesAction mfa = new MyFavoritesAction(getActionInit());\n\t\tmfa.setAttributes(getAttributes());\n\t\tmfa.setDBConnection(dbConn);\n\n\t\tboolean isDelete = Convert.formatBoolean(req.getParameter(\"isDelete\"));\n\t\tif (isDelete) {\n\t\t\tmfa.deleteFavorite(req);\n\t\t} else {\n\t\t\t// set additional req params needed for inserts.\n\t\t\treq.setParameter(QuickLinksAction.PARAM_KEY_TYPE_CD, fav.getReferenceCode());\n\t\t\treq.setParameter(QuickLinksAction.PARAM_KEY_REL_ID, fav.getPageId());\n\t\t\tmfa.insertFavorite(req);\n\t\t}\n\n\t\tupdateSessionFavorites(req.getSession(),fav,isDelete);\n\n\t}",
"public void setFavorite(boolean favorite) {\n this.favorite = favorite;\n }",
"public void onClicklistenerForFavorites(View view){\n if(isAlreadyFavorteis() == true){\n Boolean hasDeleted = dBhelper.deleteFavortiesByCategoryId(userAskAbout,inputSpinnerOne.getSelectedItemPosition(),inputSpinnertow.getSelectedItemPosition());\n if(hasDeleted == true) {\n Toast.makeText(getApplicationContext(), \"Your data has deleted in Favorties\", Toast.LENGTH_LONG).show();\n favortiesImageView.setBackgroundResource(R.drawable.ic_favourites);\n isAlreadyFavorties = false;\n }\n\n }else\n {\n favortiesMethed();\n isAlreadyFavorties = true;\n favortiesImageView.setBackgroundResource(R.drawable.ic_favourites_pressed);\n }\n\n }",
"public boolean isAlreadyFavorited(){\r\n if(ui.isIsUserAuthenticated()){\r\n Users user = ui.getUser();\r\n if(user.getFavorites() != null){\r\n return user.getFavorites().contains(recipe);\r\n }\r\n else{\r\n return false;\r\n }\r\n }\r\n else{\r\n return false;\r\n }\r\n }",
"public void onClicked() {\n mypreference = PreferenceManager.getDefaultSharedPreferences(getContext());\n SharedPreferences.Editor editorpref = mypreference.edit();\n Gson gson = new Gson();\n //retrieve the stored ArrayList of fovorite movies as json format\n String storedJsonList = mypreference.getString(\"storedjsonList\", \"\");\n // get the type of this json format\n Type type = new TypeToken<ArrayList<ItemsClass>>() {\n }.getType();\n ArrayList<ItemsClass> movieArrayList = new ArrayList<ItemsClass>();\n //create array list of the retrieved json\n // store it in my Arraylist\n movieArrayList = gson.fromJson(storedJsonList, type);\n\n// favo.setSelected(va[0]);\n ischecked = va[0];\n if (va[0] == true) {\n\n if (movieArrayList == null) {\n\n favoImageButton.setImageResource(R.drawable.liked);\n\n String loadedPosterString = encodeTobase64(theposterImage);\n\n\n serItems.add(new ItemsClass(loadedPosterString, title, releaseDate, overview, rate, id));\n\n Toast.makeText(getContext(), \"you have favo this movie with id of \" + id + \"and you list size is\" + serItems.size(), Toast.LENGTH_SHORT).show();\n //convert all the arraylist with the old and new Items to Json format\n String jsonList = gson.toJson(serItems);\n //save to sharedPreference\n editorpref.putString(\"storedjsonList\", jsonList);\n editorpref.commit();\n va[0] = !va[0];\n\n } else if (movieArrayList != null) {\n serItems = movieArrayList;\n for (int i = 0; i < serItems.size(); i++) {\n int detectId = serItems.get(i).getId();\n if (serItems.size() > 0 && detectId == id) {\n Toast.makeText(getContext(), \"you already have this movie in favorite list \", Toast.LENGTH_SHORT).show();\n favoImageButton.setImageResource(R.drawable.liked);\n break;\n } else if (serItems.size() > 0 && detectId != id && i < serItems.size() - 1) {\n\n continue;\n\n } else if (detectId != id && i == serItems.size() - 1 && i > serItems.size() - 2) {\n Toast.makeText(getContext(), \"you have favo this movie with id of \" + id, Toast.LENGTH_SHORT).show();\n favoImageButton.setImageResource(R.drawable.like);\n serItems.add(new ItemsClass(storedPoster, title, releaseDate, overview, rate, id));\n serItems.size();\n //convert all the arraylist with the old and new Items to Json format\n String jsonList = gson.toJson(serItems);\n //save to sharedPreference\n editorpref.putString(\"storedjsonList\", jsonList);\n editorpref.commit();\n va[0] = !va[0];\n break;\n }\n\n }\n }\n\n } else {\n if (movieArrayList != null) {\n serItems = movieArrayList;\n for (int i = 0; i < serItems.size(); i++) {\n\n int detectId = serItems.get(i).getId();\n if (i < serItems.size() && serItems.size() > 0 && detectId == id) {\n Toast.makeText(getContext(), \"you have deleted this movie this movie with id of \" + id, Toast.LENGTH_SHORT).show();\n favoImageButton.setImageResource(R.drawable.like);\n mypreference = getContext().getSharedPreferences(\"moviepref\", Context.MODE_PRIVATE);\n editorpref.putString(\"storedPoster\", \"\");\n editorpref.putString(\"storedTitle\", \"\");\n editorpref.putString(\"storedOverview\", \"\");\n editorpref.putString(\"storedDate\", \"\");\n editorpref.putFloat(\"storedrating\", (float) 0.0);\n editorpref.commit();\n va[0] = !va[0];\n//\n break;\n } else if (detectId != id && i < serItems.size() - 1) {\n continue;\n } else if (detectId == id && i == serItems.size() - 1) {\n Toast.makeText(getContext(), \" actually you don't have this movie in your favorite list \", Toast.LENGTH_SHORT).show();\n }\n\n }\n }\n }\n }",
"public void setFavortiestate(String favortiestate) {\n this.favortiestate = favortiestate;\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == R.id.action_favorites) {\n if(gameFragment.isFavorites()) {\n item.setIcon(R.drawable.ic_favorite_border);\n gameFragment.filterFavorites(false);\n }\n else {\n item.setIcon(R.drawable.ic_favorite);\n gameFragment.filterFavorites(true);\n }\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Test\n public void favoritesFragment_shouldOnlyShowFavoritesNeighbours() {\n onView(allOf(isDisplayed(), withId(R.id.list_neighbours)))\n .perform(RecyclerViewActions.actionOnItemAtPosition(0, click()));\n onView(withId(R.id.add_favorite_fab)).check(matches(isDisplayed()));\n onView(withId(R.id.add_favorite_fab)).perform(click());\n //When : press toolbar home button to parent activity and get favorite neighbour fragment\n pressBack();\n FragmentTransaction favoritesFragment = favoritesFragment();\n favoritesFragment.commit();\n //Then : check if Textview displayed and filled with favorite neighbour name\n onView(allOf(withId(R.id.item_list_name), withText(\"Caroline\"),\n childAtPosition(childAtPosition(withId(R.id.list_favorite_neighbours),\n 0), 1), isDisplayed())).check(matches(withText(\"Caroline\")));\n }",
"@Override\n\tpublic boolean isFavorite() {\n\t\treturn this.isFavorite;\n\t}",
"public boolean isFavorite() {\n return isFavorite;\n }",
"public boolean isFavorite() {\n return isFavorite;\n }",
"private boolean isFavorite() {\n for (int favoriteIndex : favoriteIndexes) {\n if (favoriteIndex == shownTipIndex) {\n return true;\n }\n }\n return false;\n }",
"public static Favourite newInstance(int sectionNumber) {\n Favourite fragment = new Favourite();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"void favoriteView();",
"public void setFavorite(boolean favorite) {\n isFavorite = favorite;\n }",
"public interface IFavoriteService {\n\n\tList<Favorite> getFavorites();\n\n\tList<Favorite> getFavoritesByGenre(GenreType genreType);\n\n\tList<Favorite> getFavoritesByParent(FavoriteCategory parent);\n\n\tList<Favorite> getFavoritesByParentId(int parentId);\n\n\tList<Favorite> getFavoritesByRate(int rate);\n\n\tList<Favorite> getFavoritesByBackupStatus(boolean isBackup);\n\n\tList<Favorite> getFavoritesByModifyStatus(boolean isModified);\n\n\tint getFavoriteCountInRate(int rate);\n\n\tint getFavoriteCountInCategory(int parentId);\n\n\tvoid delete(Favorite favorite);\n\n\tvoid delete(List<Favorite> favorites);\n\n\tvoid update(Favorite favorite);\n\n\tvoid update(List<Favorite> favorites);\n\n\tvoid insert(Favorite favorite);\n\n\tvoid insert(List<Favorite> favorites);\n\n\tList<FavoriteCategory> getFavoriteCategories();\n\n\tList<FavoriteCategory> getFavoriteCategoriesByRate(int rate);\n\n\tList<FavoriteCategory> getFavoriteCategoriesByBackupStatus(boolean isBackup);\n\n\tList<FavoriteCategory> getFavoriteCategoriesByModifyStatus(boolean isModified);\n\n\tvoid insertCategory(FavoriteCategory category);\n\n\tvoid insertCategory(List<FavoriteCategory> categories);\n\n\tvoid updateCategory(FavoriteCategory category);\n\n\tvoid updateCategories(List<FavoriteCategory> categories);\n\n\tvoid deleteCategory(FavoriteCategory category);\n\n\tvoid deleteCategories(List<FavoriteCategory> categories);\n}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case R.id.action_favorite:\n ItemFavoriteUrl db = new ItemFavoriteUrl(webView.getTitle(), webView.getUrl());\n db.save();\n adapter.notifyDataSetChanged();\n //adapter.add(ItemFavoriteUrl.findById(ItemFavoriteUrl.class, ItemFavoriteUrl.count(ItemFavoriteUrl.class)));\n Toast.makeText(MainActivity.this, R.string.favorite_saved, Toast.LENGTH_SHORT).show();\n /*for (int i=0; i<ItemFavoriteUrl.count(ItemFavoriteUrl.class); i++) {\n db = ItemFavoriteUrl.find\n Log.d(\"db\", db.url);\n }*/\n Log.d(\"count\", adapter.getCount() + \"\");\n break;\n\n case R.id.action_clear:\n ItemFavoriteUrl.deleteAll(ItemFavoriteUrl.class);\n adapter.notifyDataSetChanged();\n Toast.makeText(MainActivity.this, R.string.clear, Toast.LENGTH_SHORT).show();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"public void setFavortieid(Integer favortieid) {\n this.favortieid = favortieid;\n }",
"private boolean checkIfFavorite() {\n if (favoriteIds.contains(movie.getId())) {\n movie.setFavorite(true);\n return true;\n }\n movie.setFavorite(false);\n return false;\n }",
"@Override\n public void onFavouriteClick(int position) {\n int id = newLest2.get(position).getId();\n Bundle bundle = new Bundle();\n bundle.putInt(\"id\", id);\n bundle.putString(\"name\", newLest2.get(position).getName_en());\n bundle.putString(\"url\", newLest2.get(position).getImage());\n Navigation.findNavController(view).navigate(R.id.action_homeFragment_to_showItemInCategories, bundle);\n\n }",
"public void setToFavorite(boolean favorite) {\n this.isFavorite = favorite;\n }",
"public void setFavoriteInRecyclerView(){\n favoriteViewModel = new ViewModelProvider(requireActivity(), AoE2DecencyInjector.getViewModelFactory()).get(FavoriteViewModel.class);\n favoriteViewModel.getFavoritesCivilizations().observe(getViewLifecycleOwner(), new Observer<List<CivilizationFavoriteItemViewModel>>() {\n @Override\n public void onChanged(List<CivilizationFavoriteItemViewModel> civilizationFavoriteItemViewModels) {\n civilizationFavoriteAdapter.setListItemViewModels(civilizationFavoriteItemViewModels);\n }\n });\n\n favoriteViewModel.getCivAdd().observe(getViewLifecycleOwner(), new Observer<Event<String>>() {\n @Override\n public void onChanged(Event<String> stringEvent) {\n //Do nothing\n }\n });\n\n favoriteViewModel.getCivRem().observe(getViewLifecycleOwner(), new Observer<Event<String>>() {\n @Override\n public void onChanged(Event<String> stringEvent) {\n //Do nothing\n }\n });\n }",
"@Override\n\tpublic void addFavorit(FavorisImpl newfavorit) {\n\t\t\n\t}",
"boolean isProjectFavourite(int accountId, int projectId);",
"@Override\n public void FavouriteMovieSelected(View view) {\n if(view.getTag().equals(MovieDetailAdapter.FAVOURITE)) {\n StoreFavoriteMovieIntentService.startAction_ADD_FAV_MOVIE(getActivity(),\n mMovieItem,\n movieDeatailAdapter.getmMovieItemDetail());\n } else {\n StoreFavoriteMovieIntentService.removeFavriteMovie(getActivity(),mMovieItem.getId());\n }\n movieDeatailAdapter.notifyDataSetChanged();\n }",
"@Override\n\tpublic FavoriteVO selectFavoriteVO(int pl_index, String mem_mail) {\n\t\treturn null;\n\t}",
"public void updateFeedItemAsFavorite(FeedItem item) {\n new updateFeedItemFavoriteAsync(itemDao).execute(item);\n }",
"private ArrayList<MovieItem> getFavoriteMovies(){\n //get list of favorite movies from buffer\n ArrayList<MovieItem> movies = mMovieStaff.getMovies(PosterHelper.NAME_ID_FAVORITE);\n\n //check if favorite movie list has changed\n if(mFavoriteChanged){\n //list has changed, show new movie list\n showMovieList(movies, PosterHelper.NAME_ID_FAVORITE);\n }\n\n //return movie list\n return movies;\n }",
"private void addToFavorites() {\n\n favoriteBool = true;\n preferencesConfig.writeAddFavoriteTip(shownTipIndex);\n Toast.makeText(getContext(), \"Added to favorites.\", Toast.LENGTH_SHORT).show();\n\n }",
"private void getAllFavorite(){\n\n\n MainViewModel viewModel = ViewModelProviders.of(this).get(MainViewModel.class);\n viewModel.getFavorite().observe(this, new Observer<List<FavoriteEntry>>() {\n @Override\n public void onChanged(@Nullable List<FavoriteEntry> imageEntries) {\n List<Movie> movies = new ArrayList<>();\n for (FavoriteEntry entry : imageEntries){\n Movie movie = new Movie();\n movie.setId(entry.getMovieid());\n movie.setOverview(entry.getOverview());\n movie.setOriginalTitle(entry.getTitle());\n movie.setPosterPath(entry.getPosterpath());\n movie.setVoteAverage(entry.getUserrating());\n movie.setReleaseDate(entry.getReleasedate());\n movies.add(movie);\n }\n\n adapter.setMovies(movies);\n }\n });\n }",
"private void retrieveFavoritesCompleted(ArrayList<MovieItem> movies){\n //get number of favorite movies in the list\n int count = movies.size();\n\n //check if there are any movies\n if(count > 0){\n //save movies to buffer\n mMovieStaff.setMovies(movies, PosterHelper.NAME_ID_FAVORITE);\n }\n\n //check if the current poster fragment is displaying the user favorite list\n if(mMovieType == PosterHelper.NAME_ID_FAVORITE){\n //yes, show new movie list\n showMovieList(movies, PosterHelper.NAME_ID_FAVORITE);\n }\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_home) {\n selectedItem = 0;\n // Handle the home action\n FriendsFragment friendsFragment = FriendsFragment.newInstance();\n getSupportFragmentManager()\n .beginTransaction()\n .replace(R.id.main_content_container, friendsFragment, AppConstants.TAG_FRIENDS)\n .commit();\n } else if (id == R.id.nav_profile) {\n selectedItem = 1;\n // Handle the profile action\n ProfileFragment profileFragment = ProfileFragment.newInstance();\n getSupportFragmentManager()\n .beginTransaction()\n .replace(R.id.main_content_container, profileFragment, AppConstants.TAG_PROFILE)\n .commit();\n } else if (id == R.id.nav_discover) {\n selectedItem = 2;\n // Handle the discover action\n DiscoverFragment discoverFragment = DiscoverFragment.newInstance();\n getSupportFragmentManager()\n .beginTransaction()\n .replace(R.id.main_content_container, discoverFragment, AppConstants.TAG_DISCOVER)\n .commit();\n } else if (id == R.id.nav_request) {\n selectedItem = 3;\n // Handle the requests action\n RequestsFragment requestsFragment = RequestsFragment.newInstance();\n getSupportFragmentManager()\n .beginTransaction()\n .replace(R.id.main_content_container, requestsFragment, AppConstants.TAG_REQUESTS)\n .commit();\n } else if (id == R.id.nav_favorites) {\n selectedItem = 4;\n // Handle the favorites action\n FavoritesFragment favoritesFragment = FavoritesFragment.newInstance();\n getSupportFragmentManager()\n .beginTransaction()\n .replace(R.id.main_content_container, favoritesFragment, AppConstants.TAG_FAVORITES)\n .commit();\n } else if (id == R.id.nav_share) {\n // Handle the share action\n startActivity(Intent.createChooser(ShareCompat.IntentBuilder.from(this)\n .setType(\"text/plain\")\n .setSubject(getString(R.string.share_subject))\n .setText(getString(R.string.share_text)) // I will change it later.\n .getIntent(), getString(R.string.action_share)));\n } else if (id == R.id.nav_feedback) {\n // Handle the feedback action\n Intent mailToIntent = new Intent(Intent.ACTION_SEND);\n mailToIntent.setData(Uri.parse(\"mailto:\"));\n mailToIntent.setType(\"text/plain\");\n mailToIntent.putExtra(Intent.EXTRA_EMAIL, new String[]{getString(R.string.developer_email)});\n mailToIntent.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.feedback_subject));\n startActivity(Intent.createChooser(mailToIntent, getString(R.string.send_mail)));\n } else if (id == R.id.nav_about) {\n // Handle the about action\n startActivity(new Intent(this, AboutActivity.class));\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"public List<Favorite> getFavorites(String signedInAccount) {\n String[] columns = {\n mDBAccountString, mDBTitleString, mDBDescString, mDBURLString\n };\n String[] selectArgs = {signedInAccount};\n\n Cursor cursor = mFavSQLiteDB.query(\n FAVORITES_TABLE,\n columns,\n mDBAccountString + \" = ?\",\n selectArgs,\n null,\n null,\n null\n );\n cursor.moveToFirst();\n List<Favorite> list = new ArrayList<>();\n for (int i = 0; i < cursor.getCount(); i++) {\n String account = cursor.getString(0);\n String title = cursor.getString(1);\n String desc = cursor.getString(2);\n String url = cursor.getString(3);\n Favorite favorite = new Favorite(account, title, desc, url);\n list.add(favorite);\n cursor.moveToNext();\n }\n cursor.close();\n return list;\n }",
"@Override\n\tpublic int updateFavoriteVO(FavoriteVO vo) {\n\t\treturn 0;\n\t}",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.action_settings) {\r\n if(item.getTitle().equals(\"Add to Favorites\")) {\r\n SharedPreferences commonpreferences = getSharedPreferences(\"Common\", Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor1 = commonpreferences.edit();\r\n\r\n String value1 = url_fav + \" \" + name_fav + \" \" + type_fav;\r\n\r\n\r\n editor1.putString(id_fav, value1);\r\n editor1.commit();\r\n if (type_fav.equals(\"Users\")) {\r\n SharedPreferences userpreferences = getSharedPreferences(\"Users\", Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor = userpreferences.edit();\r\n\r\n String value = url_fav + \" \" + name_fav + \" \" + type_fav;\r\n\r\n\r\n editor.putString(id_fav, value);\r\n editor.commit();\r\n } else if (type_fav.equals(\"Pages\")) {\r\n SharedPreferences pagepreferences = getSharedPreferences(\"Pages\", Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor = pagepreferences.edit();\r\n\r\n String value = url_fav + \" \" + name_fav + \" \" + type_fav;\r\n\r\n\r\n editor.putString(id_fav, value);\r\n editor.commit();\r\n } else if (type_fav.equals(\"Events\")) {\r\n SharedPreferences eventpreferences = getSharedPreferences(\"Events\", Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor = eventpreferences.edit();\r\n\r\n String value = url_fav + \" \" + name_fav + \" \" + type_fav;\r\n\r\n\r\n editor.putString(id_fav, value);\r\n editor.commit();\r\n } else if (type_fav.equals(\"Places\")) {\r\n SharedPreferences placepreferences = getSharedPreferences(\"Places\", Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor = placepreferences.edit();\r\n\r\n String value = url_fav + \" \" + name_fav + \" \" + type_fav;\r\n\r\n\r\n editor.putString(id_fav, value);\r\n editor.commit();\r\n } else if (type_fav.equals(\"Groups\")) {\r\n SharedPreferences grouppreferences = getSharedPreferences(\"Groups\", Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor = grouppreferences.edit();\r\n\r\n String value = url_fav + \" \" + name_fav + \" \" + type_fav;\r\n\r\n\r\n editor.putString(id_fav, value);\r\n editor.commit();\r\n }\r\n\r\n Toast.makeText(getApplicationContext(), \"Added to Favorites\", Toast.LENGTH_LONG).show();\r\n }\r\n else\r\n {\r\n SharedPreferences commonpreferences = getSharedPreferences(\"Common\", Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor1 = commonpreferences.edit();\r\n editor1.remove(id_fav);\r\n editor1.commit();\r\n\r\n if (type_fav.equals(\"Users\")) {\r\n SharedPreferences userpreferences = getSharedPreferences(\"Users\", Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor = userpreferences.edit();\r\n\r\n editor.remove(id_fav);\r\n editor.commit();\r\n } else if (type_fav.equals(\"Pages\")) {\r\n SharedPreferences pagepreferences = getSharedPreferences(\"Pages\", Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor = pagepreferences.edit();\r\n\r\n editor.remove(id_fav);\r\n editor.commit();\r\n } else if (type_fav.equals(\"Events\")) {\r\n SharedPreferences eventpreferences = getSharedPreferences(\"Events\", Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor = eventpreferences.edit();\r\n\r\n editor.remove(id_fav);\r\n editor.commit();\r\n } else if (type_fav.equals(\"Places\")) {\r\n SharedPreferences placepreferences = getSharedPreferences(\"Places\", Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor = placepreferences.edit();\r\n\r\n editor.remove(id_fav);\r\n editor.commit();\r\n } else if (type_fav.equals(\"Groups\")) {\r\n SharedPreferences grouppreferences = getSharedPreferences(\"Groups\", Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor = grouppreferences.edit();\r\n\r\n editor.remove(id_fav);\r\n editor.commit();\r\n }\r\n\r\n\r\n Toast.makeText(getApplicationContext(), \"Removed from Favorites\", Toast.LENGTH_LONG).show();\r\n }\r\n //SharedPreferences.Editor editor = sharedpreferences.edit();\r\n //editor.putString(\"Name\", \"Rachit\");\r\n //SharedPreferences events=getSharedPreferences(\"Events\", Context.MODE_PRIVATE);\r\n //String l=\"-1\";\r\n //String value=events.getString(id_fav,l);\r\n //editor.commit();\r\n return true;\r\n }\r\n else if (id == R.id.share) {\r\n if (ShareDialog.canShow(ShareLinkContent.class)) {\r\n ShareLinkContent linkContent = new ShareLinkContent.Builder()\r\n .setContentUrl(Uri.parse(\"http://developers.facebook.com/android\"))\r\n .build();\r\n shareDialog.show(linkContent);\r\n }\r\n\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }",
"@SuppressWarnings(\"unchecked\")\n public List<IUserLayoutNodeDescription> getFavoritePortletLayoutNodes(IUserLayout userLayout) {\n\n logger.trace(\"Extracting favorite portlets from layout [{}]\", userLayout);\n\n List<IUserLayoutNodeDescription> favorites = new LinkedList<>();\n\n Enumeration<String> childrenOfRoot = userLayout.getChildIds(userLayout.getRootId());\n\n // loop over folders that might be the favorites folder\n while (childrenOfRoot.hasMoreElements()) {\n String nodeId = childrenOfRoot.nextElement();\n\n try {\n\n IUserLayoutNodeDescription nodeDescription = userLayout.getNodeDescription(nodeId);\n\n if (FOLDER.equals(nodeDescription.getType())\n && nodeDescription instanceof IUserLayoutFolderDescription) {\n\n IUserLayoutFolderDescription folderDescription =\n (IUserLayoutFolderDescription) nodeDescription;\n\n if (FAVORITES_TYPE.equalsIgnoreCase(folderDescription.getFolderType())) {\n // TODO: assumes columns structure, but should traverse tree to collect all\n // portlets regardless\n Enumeration<String> columns = userLayout.getChildIds(nodeId);\n\n // loop through columns to gather beloved portlets\n while (columns.hasMoreElements()) {\n String column = columns.nextElement();\n Enumeration<String> portlets = userLayout.getChildIds(column);\n while (portlets.hasMoreElements()) {\n String portlet = portlets.nextElement();\n IUserLayoutNodeDescription portletDescription =\n userLayout.getNodeDescription(portlet);\n favorites.add(portletDescription);\n }\n }\n } else {\n logger.trace(\"Ignoring non-favorites folder node [{}]\", nodeDescription);\n }\n\n } else {\n logger.trace(\"Ignoring non-folder node [{}]\", nodeDescription);\n }\n\n } catch (Exception e) {\n logger.error(\n \"Ignoring on error a node while examining for favorites: node ID is [{}]\",\n nodeId,\n e);\n }\n }\n\n logger.debug(\"Extracted favorite portlets [{}] from [{}]\", favorites, userLayout);\n\n return favorites;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_team, container, false);\n\n team = (Team) getArguments().getSerializable(\"team\");\n\n TextView name = view.findViewById(R.id.team_name);\n name.setText(team.getName());\n\n TextView league = view.findViewById(R.id.team_league);\n league.setText(team.getLeagueName());\n\n TextView country = view.findViewById(R.id.team_country);\n country.setText(team.getCountry());\n\n TextView year = view.findViewById(R.id.team_year);\n year.setText(getString(R.string.formed_in, team.getFormedYear()));\n\n TextView website = view.findViewById(R.id.team_website);\n website.setText(team.getWebsiteUrl());\n\n ImageView badge = view.findViewById(R.id.badge);\n Picasso.get().load(team.getBadgeUrl()).placeholder(R.drawable.progress_image).into(badge);\n\n favoriteTeamsStore = getActivity().getSharedPreferences(MainActivity.FAVORITE_TEAMS_STORE, 0);\n favoriteTeams = new HashSet<>(favoriteTeamsStore.getStringSet(MainActivity.FAVORITE_TEAMS, new HashSet<>()));\n\n SparkButton favoriteButton = view.findViewById(R.id.favorite_button);\n if (favoriteTeams.contains(String.valueOf(team.getId())))\n favoriteButton.setChecked(true);\n\n favoriteButton.setEventListener(new SparkEventListener() {\n @Override\n public void onEvent(ImageView button, boolean buttonState) {\n if (buttonState) {\n favoriteTeams.add(String.valueOf(team.getId()));\n } else {\n favoriteTeams.remove(String.valueOf(team.getId()));\n }\n favoriteTeamsStore.edit().putStringSet(MainActivity.FAVORITE_TEAMS, favoriteTeams).apply();\n }\n\n @Override\n public void onEventAnimationEnd(ImageView button, boolean buttonState) {\n\n }\n\n @Override\n public void onEventAnimationStart(ImageView button, boolean buttonState) {\n\n }\n });\n\n playersList = view.findViewById(R.id.players_list);\n setPlayersList();\n return view;\n }",
"@Override\n public boolean onNavigationItemSelected(@NonNull MenuItem item) { de incercat cu ternary operator\n\n\n\n //\n\n if (item.getItemId() == R.id.nav_home) {\n if (viewModel.getSelectedFragment() != viewModel.getHomeFragment()) {\n fragmentManager.beginTransaction()\n .hide(viewModel.getSelectedFragment())\n .show(viewModel.getHomeFragment())\n .commit();\n viewModel.setSelectedFragment(viewModel.getHomeFragment());\n }\n } else if (item.getItemId() == R.id.nav_favorites) {\n if (viewModel.getSelectedFragment() != viewModel.getFavoritesFragment()) {\n fragmentManager.beginTransaction()\n .hide(viewModel.getSelectedFragment())\n .show(viewModel.getFavoritesFragment())\n .commit();\n viewModel.setSelectedFragment(viewModel.getFavoritesFragment());\n }\n } else if (item.getItemId() == R.id.nav_profile) {\n Intent intent = new Intent(MainActivity.this, CountySelector.class);\n startActivity(intent);\n } else if (item.getItemId() == R.id.nav_settings) {\n if (viewModel.getSelectedFragment() != viewModel.getSettingsFragment()) {\n fragmentManager.beginTransaction()\n .hide(viewModel.getSelectedFragment())\n .show(viewModel.getSettingsFragment())\n .commit();\n viewModel.setSelectedFragment(viewModel.getSettingsFragment());\n }\n }\n\n return true;\n }",
"boolean isFavorite(int id);",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == R.id.take_photo) {\n goToCamera();\n return true;\n }\n\n if (id == R.id.add_favorite) {\n dbHandler.setFavoritesUpdated(true);\n Model model = new Model(this.getApplicationContext());\n if(_img.getDrawable() != null) {\n BitmapDrawable bitmapDrawable = ((BitmapDrawable) _img.getDrawable());\n loc.setPicture(bitmapDrawable.getBitmap());\n }\n model.addFavorite(loc);\n if(menu != null) {\n checkFavorite();\n }\n return true;\n }\n if(id == R.id.rem_favorite){\n dbHandler.setFavoritesUpdated(true);\n model.deleteFavorite(loc.getId());\n if(menu != null) {\n checkFavorite();\n }\n }\n\n return super.onOptionsItemSelected(item);\n }",
"public void onFavButtonClicked(View view) {\n isFav = !isFav;\n toggleButtonText(isFav);\n \n // Update DB\n new OperateWithDBMovieAsyncTask().execute(isFav ? ADD_MOVIE : REMOVE_MOVIE);\n }",
"@RequestMapping(\"/favorites\")\n public String favorites(Model model) {\n // TODO: Get list of all GIFs marked as favorite\n List<Gif> faves = new ArrayList<>();\n\n model.addAttribute(\"gifs\", faves);\n model.addAttribute(\"username\", \"Chris Ramacciotti\"); // Static username\n return \"gif/favorites\";\n }",
"public void setUpFavouriteIcon() {\n if (isUserOwner()) {\n view.hideFavouriteIcon();\n } else if (currentAdvertIsFavourite()) {\n view.setIsAFavouriteIcon();\n } else {\n view.setIsNotAFavouriteIcon();\n }\n }",
"public void lookForLiveItems(){\n\t\ttools.findWithScroll(\"com.fic.foxsports:id/HomeViewPager\", \"com.fic.foxsports:id/live_video_title\"); //Texto\r\n\t\ttools.findWithScroll(\"com.fic.foxsports:id/HomeViewPager\", \"com.fic.foxsports:id/overthumb_channelLogo\"); //Logo\r\n\t\ttools.findWithScroll(\"com.fic.foxsports:id/HomeViewPager\", \"com.fic.foxsports:id/clipItemImage\"); //Background\r\n\t}",
"@Override\n public void onBindViewHolder(final ViewHolder holder, int position) {\n final JSONObject js = mData.get(position);\n\n if(mData.isEmpty())\n {\n Log.d(TAG, \"onBindViewHolder: \");\n ((PlacesActivity)context).checkEmpty();\n }\n\n String place_name = null;\n String placeIcon = null;\n String vicinity = null;\n //final String placeid= null;\n try {\n place_name = js.get(\"name\").toString();\n vicinity = js.getString(\"vicinity\");\n placeIcon= js.get(\"icon\").toString();\n String placeid= js.get(\"place_id\").toString();\n if(myprefs.contains(placeid))\n {\n holder.myPlaceFav.setImageResource(R.drawable.ic_resfav);\n holder.myPlaceFav.setTag(1);\n }\n else\n holder.myPlaceFav.setTag(0);\n //placeid = js.get(\"place_id\").toString();\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n\n holder.myTextView.setText(place_name);\n holder.myAdr.setText(vicinity);\n Picasso.get().load(placeIcon).into(holder.myPlaceIcon);\n\n\n\n holder.myPlaceFav.setOnClickListener(\n new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n String placeid = null;\n String placename = \"\";\n //boolean flag= false;\n try{\n placeid= js.get(\"place_id\").toString();\n placename= js.get(\"name\").toString();\n }\n catch (JSONException e)\n {\n e.printStackTrace();\n }\n if(Integer.parseInt(holder.myPlaceFav.getTag().toString())==0)\n {\n\n SharedPreferences.Editor editor = myprefs.edit();\n\n editor.putString(placeid,js.toString());\n editor.commit();\n holder.myPlaceFav.setImageResource(R.drawable.ic_resfav);\n holder.myPlaceFav.setTag(1);\n toastMessage(placename+\" added to favorites\");\n\n\n\n\n }\n else\n {\n SharedPreferences.Editor editor = myprefs.edit();\n editor.remove(placeid);\n editor.commit();\n holder.myPlaceFav.setImageResource(R.drawable.ic_resnofav);\n holder.myPlaceFav.setTag(0);\n toastMessage(placename+\" removed from favorites\");\n\n\n }\n\n }\n }\n );\n\n\n //Picasso.get().load(R.drawable.ic_search).into(holder.myPlaceFav);\n }",
"public void setIsUserFav(User user) {\n if(user.isUsersFavouritePost(this.mPost))\n this.isFavourite.set(true);\n else\n this.isFavourite.set(false);\n\n //if(this.mPost.getFavourite().contains(user))\n // this.isFavourite.set(true);\n //this.isFavourite.set(false);\n }",
"@Override\n public Fragment getItem(int position) {\n switch (position) {\n case TAB_SCHEDULE: {\n if (scheduleFragment == null) {\n scheduleFragment = new TalkListFragment();\n Bundle args = new Bundle();\n scheduleFragment.setArguments(args);\n }\n return scheduleFragment;\n }\n case TAB_FAVORITES: {\n if (favoritesFragment == null) {\n favoritesFragment = new TalkListFragment();\n Bundle args = new Bundle();\n args.putBoolean(\"favoritesOnly\", true);\n favoritesFragment.setArguments(args);\n }\n return favoritesFragment;\n }\n }\n return null;\n }",
"@FXML\n private void chooseFavouritePhotoEvent() {\n if (!PhotoManager.getFavouriteList().isEmpty()) {\n User.setGalleryPhotos(PhotoManager.getFavouriteList());\n fadeOutEvent();\n }\n }",
"@Override\n\tpublic void onViewCreated(View view, Bundle savedInstanceState)\n {\n\t\tsuper.onViewCreated(view, savedInstanceState);\n\t\t\n\t\tfinal RuntimeApplication runtimeApp = new RuntimeApplication();\n// \t\t\t(RuntimeApplication) this.getActivity().getApplication();\n\t\t\n\t\tfinal int color;\n\t\tif(runtimeApp.switcher!=null)\n\t\tcolor= runtimeApp.switcher.getSelectedColorSwitcher();\n\t\telse color = Color.parseColor(\"#ffffff\");\n\t\tString[] tabNames = {\"Near\", \"Featured\", \"Price\"};\n TabHeader tabHeader = (TabHeader) this.getActivity().findViewById(R.id.tabHeader);\n tabHeader.setOnTabHeaderListener(this);\n tabHeader.setTab(tabNames, R.layout.tab_entry, R.id.btnTab, LayoutConfig.INNER_TAB_WEIGHT);\n \n // set the empty view colors when the list doesnt show any data.\n TextView emptyView = (TextView) this.getActivity().findViewById(R.id.tvEmpty);\n TextTint.tintTextView(this.getActivity(), emptyView, color);\n \n \n createSlider(runtimeApp.globalEntryListSlider);\n if(runtimeApp.globalEntryListApartments!=null)\n if(runtimeApp.globalEntryListApartments.size() == 0)\n {\n \tdownloadApartmentsData();\n }\n else\n {\n \ttabHeader.setSelectedTab(selectedIndex);\n \tsetListDataTab(runtimeApp.globalEntryListApartments, selectedIndex);\n } \n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == R.id.action_fav) {\n FavoritesDataSource dataSource = new FavoritesDataSource(getBaseContext());\n dataSource.open();\n if(isFav){\n //remove from favorites\n dataSource.deleteFromFavorites(placeid);\n item.setIcon(R.drawable.ic_heart_outline_white);\n Toast.makeText(getBaseContext(),placeName+\" was removed from favorites\",Toast.LENGTH_SHORT).show();\n isFav = false;\n }else{\n //add to favorites\n Place place = new Place(placeid,placeName,address,true,picURL);\n dataSource.addToFavorites(place);\n item.setIcon(R.drawable.ic_heart_fill_white);\n Toast.makeText(getBaseContext(),placeName+\" was added to favorites\",Toast.LENGTH_SHORT).show();\n isFav = true;\n }\n dataSource.close();\n return true;\n }else if(id == R.id.action_share){\n //open twitter url\n String tweetParams = \"text=\"+ URLEncoder.encode(\"Check out \"+placeName+\" located at \"+address+\". Website \")+\"&url=\"+URLEncoder.encode(tweetURL)+\"&hashtags=TravelAndEntertainmentSearch\";\n Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(\"https://twitter.com/intent/tweet?\"+tweetParams));\n startActivity(browserIntent);\n return true;\n }else if(id == android.R.id.home){\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n\tpublic boolean shouldVisit(Page page, WebURL url) {\n\t\tString href = url.getURL().toLowerCase();\n\t\treturn !FILTERS.matcher(href).matches()\n\t\t\t\t&& (href.startsWith(\"http://www.amarujala.com/education\"));\n\t\t\t\t/*\n\t\t\t\t|| href.startsWith(\"http://www.amarujala.com/crime\"));\n\t\t\t\t*/\n\t}",
"@Override\n public void onResume() {\n super.onResume();\n initListFavorite();\n }",
"public void writeFavorites() {\n ArrayList<String> favorites = new ArrayList<>();\n for(Landmark landmark : landmarks.getFavorites()) {\n favorites.add(landmark.toStringForOutput());\n }\n FileManager.writeLines(favoritesPath, favorites);\n }",
"public static FavoritePhotosFragment newInstance() {\n return new FavoritePhotosFragment();\n }",
"public static boolean testMyFavoriteGetAll() {\r\n MyFavorite inst = new MyFavorite(10);\r\n for (Pokemon item : testList) {\r\n inst.put(item.getName(), item);\r\n }\r\n LinkedList<Pokemon> list = inst.getAll();\r\n if (list.size() != 6)\r\n return false;\r\n for (Pokemon item : testList) {\r\n if (!list.contains(item)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == R.id.action_favorite) {\n setFavortiesLayout();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public void onBindViewHolder(ViewHolderFav viewHolder, final int position) {\n Log.d(\"BarkeeperApp\", \"Element \" + position + \" set.\");\n\n // Get element from your dataset at this position and replace the contents of the view\n // with that element\n viewHolder.getTextView().setText(mDataSet[position]);\n\n Cocktail c = getRightCocktail(mDataSet[position]);\n\n this.map_View_Favs.put(viewHolder.itemView, c);\n\n ImageView imageView = (ImageView) viewHolder.itemView.findViewById(R.id.imageview_listitem);\n if (c.getIsFavourite()){\n imageView.setImageResource(R.drawable.icons8starfilled96);\n imageView.setVisibility(View.VISIBLE);\n }\n }",
"@Override\n protected void onPostExecute(RSSItem item) {\n Log.d(TAG, \"item fav changed\");\n String toast = ((item.getFav()) == 1) ? \"添加收藏成功\" : \"取消收藏成功\";\n Toast.makeText(context, toast, Toast.LENGTH_SHORT).show();\n }",
"private void retrieveFavoritePhotos() {\n showProgress(this.mProgressBar, this.mRlContent);\n this.mFavoritePhotosViewModel.retrievePhotos();\n }",
"public int getNumOfFav() {\n return fullPhoto.getNumOfFav();\n }",
"public interface IFragmentView {\n\n void setCategoryItems(List<PictureModel> list);\n\n String getTitle();\n\n}",
"private Set<IPortletDefinition> calculateFavoritePortlets(HttpServletRequest request) {\n final IUserInstance ui = userInstanceManager.getUserInstance(request);\n final UserPreferencesManager upm = (UserPreferencesManager) ui.getPreferencesManager();\n final IUserLayoutManager ulm = upm.getUserLayoutManager();\n final IUserLayout layout = ulm.getUserLayout();\n final Set<IPortletDefinition> rslt = favoritesUtils.getFavoritePortletDefinitions(layout);\n\n log.debug(\n \"Found the following favoritePortlets for user='{}': {}\",\n request.getRemoteUser(),\n rslt);\n return rslt;\n }",
"@Override\n public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_wallpaper, container, false);\n folderTitle = view.findViewById(R.id.folder_title);\n isFavorite = view.findViewById(R.id.is_favorite);\n wallpaperGrid = view.findViewById(R.id.grid_view);\n addWallpaperButton = view.findViewById(R.id.add_wallpaper);\n\n //We take arguments passed to the fragment and set wallpaperDirectory Object for this fragment\n //and set title to whatever wallpaper Directory title is\n wallpaperDirectory = new WallpaperDirectory();\n wallpaperDirectory.Title = getArguments().getString(FOLDER_TITLE);\n wallpaperDirectory.PreviewUrl = getArguments().getString(FOLDER_PREVIEW);\n folderTitle.setText(wallpaperDirectory.Title);\n\n //we get sharedPreference Object for both settings and favorites\n sharedPreferences =getActivity().getSharedPreferences(PrefsKeys.SETTINGS,Context.MODE_PRIVATE);\n SharedPreferences favPreferences = getActivity().getSharedPreferences(PrefsKeys.FAVORITES,Context.MODE_PRIVATE);\n\n //we check if current folder is favorited then we set isFavorite to checked\n\n isFavorite.setChecked(favPreferences.contains(wallpaperDirectory.Title));\n isFavorite.setOnCheckedChangeListener((buttonView, isChecked) -> {\n isFavorite.setEnabled(false);\n //we update the value whether or not isFavorite is checked\n if(isChecked){\n favPreferences.edit().putString(wallpaperDirectory.Title,wallpaperDirectory.PreviewUrl).apply();\n }else{\n favPreferences.edit().remove(wallpaperDirectory.Title).apply();\n }\n isFavorite.setEnabled(true);\n });\n return view;\n }",
"public List<IUserLayoutNodeDescription> getFavoriteCollections(IUserLayout userLayout) {\n\n if (null == userLayout) {\n throw new IllegalArgumentException(\n \"Cannot get favorites collections from a null userLayout\");\n }\n\n logger.trace(\"Extracting favorites collections from layout [{}].\", userLayout);\n\n Enumeration<String> nodeIds = userLayout.getChildIds(userLayout.getRootId());\n\n List<IUserLayoutNodeDescription> results = new LinkedList<IUserLayoutNodeDescription>();\n\n while (nodeIds.hasMoreElements()) {\n String nodeId = nodeIds.nextElement();\n\n try {\n IUserLayoutNodeDescription nodeDescription = userLayout.getNodeDescription(nodeId);\n\n String parentId = userLayout.getParentId(nodeId);\n String nodeName = nodeDescription.getName();\n IUserLayoutNodeDescription.LayoutNodeType nodeType = nodeDescription.getType();\n\n if (FOLDER.equals(nodeType)\n && nodeDescription instanceof IUserLayoutFolderDescription) {\n\n IUserLayoutFolderDescription folderDescription =\n (IUserLayoutFolderDescription) nodeDescription;\n\n String folderType = folderDescription.getFolderType();\n\n if (FAVORITE_COLLECTION_TYPE.equals(folderType)) {\n\n results.add(nodeDescription);\n\n logger.trace(\n \"Selected node with id [{}] named [{}] with \"\n + \"folderType [{}] and type [{}] as a collection of favorites.\",\n nodeId,\n nodeName,\n folderType,\n nodeType);\n\n } else {\n\n logger.trace(\n \"Rejected node with id [{}] named [{}] with \"\n + \"folderType [{}] and type [{}] as not a collection of favorites.\",\n nodeId,\n nodeName,\n folderType,\n nodeType);\n }\n\n } else {\n logger.trace(\n \"Rejected non-folder node with id [{}] named [{}] \"\n + \"with parentId [{}] and type [{}] as not a collection of favorites.\",\n nodeId,\n nodeName,\n parentId,\n nodeType);\n }\n\n // if something goes wrong in processing a node, exclude it\n } catch (Exception e) {\n logger.error(\n \"Error determining whether to include layout node [{}]\"\n + \" as a collection of favorites. Excluding.\",\n nodeId,\n e);\n }\n }\n\n logger.debug(\"Extracted favorites collections [{}] from [{}]\", results, userLayout);\n\n return results;\n }",
"@Override\n public void onClick(View v) {\n FragmentTransaction ft = getFragmentManager().beginTransaction();\n Fragment fragment = new FavoriteFragment();\n ft.replace(R.id.layout_fragment, fragment, \"FavoriteFragment\");\n ft.commit();\n }",
"void setProjectFavourite(int accountId, int projectId, boolean favourite);",
"@Override\n public void onClick(View v) {\n for (BAActivityEntryFragmentGridItem item : entryItems) {\n BAActivityFavorited favoritedActivity = item.getActivityFavorited();\n //Log.i(TAG, item.getName() + \": \" + item.isEntered());\n BAActivityEntry entry = new BAActivityEntry();\n entry.setActivityType(favoritedActivity.getActivtyType());\n entry.setName(favoritedActivity.getName());\n entry.setTimeOfEntry(currentTime);\n entry.setDateInLong(formattedTime.getCurrentTimeInMilliSecs());\n if (item.isEntered()) {\n activityViewModel.addActivityEntry(entry, formattedTime.getCurrentDateAsYYYYMMDD());\n //activityRepository.insertFavoritedActivity(favoritedActivity);\n if (FirebaseAuth.getInstance().getCurrentUser() != null) {\n firebaseManager.getActivityTodayRef().\n child(getCurrentTimeInString())\n .child(favoritedActivity.getName())\n .child(\"numEntry\").setValue(1L);\n firebaseManager.getActivityTodayRef()\n .child(getCurrentTimeInString())\n .child(favoritedActivity.getName())\n .child(\"type\")\n .setValue(favoritedActivity.getActivtyType());\n }\n }\n }\n ViewPager viewPager = getActivity().findViewById(R.id.activity_make_entry_viewpager);\n int currentItem = viewPager.getCurrentItem();\n Log.i(TAG, \"# of fragments: \" + userInputsInUseList.size() + \", \" + \"current position: \" + currentItem);\n if (userInputsInUseList.size() == 1 || currentItem == userInputsInUseList.size() - 1) {\n Intent intent = new Intent(getActivity(), MainActivity.class);\n intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);\n startActivity(intent);\n } else {\n viewPager.setCurrentItem(currentItem + 1, true);\n }\n }",
"private void loadMovies() {\n try {\n SharedPreferences prefs = getActivity().getSharedPreferences(\n PREFS_NAME, 0);\n if (prefs.contains(SP_FEED)) {\n\n JSONObject jsonObject = new JSONObject(prefs.getString(SP_FEED,\n \"\"));\n\n JSONArray jsonMovieArray;\n jsonMovieArray = (JSONArray) ((JSONObject) jsonObject\n .get(\"feed\")).get(\"entry\");\n\n if (jsonMovieArray != null) {\n int len = jsonMovieArray.length();\n for (int i = 0; i < len; i++) {\n JSONObject jsonMovie = (JSONObject) jsonMovieArray\n .get(i);\n mList.add(new Movie(jsonMovie));\n }\n }\n }\n\n } catch (JSONException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\n // Update adapter\n mArrayAdapter.notifyDataSetChanged();\n }",
"public void favouriteUser() {\r\n\t\tif(favourited) {\r\n\t\t\tcurrentUser.unfavouriteUser(userToView.getUserID());\r\n\t\t\tfavouriteButton.setText(\"Favourite\");\r\n\t\t\tfavourited = false;\r\n\t\t} else if(currentUser.getUserID() != userToView.getUserID()){\r\n\t\t\tcurrentUser.favouriteUser(userToView.getUserID());\r\n\t\t\tfavouriteButton.setText(\"Unfavourite\");\r\n\t\t\tfavourited = true;\r\n\t\t} else {\r\n\t\t\tCONSTANTS.makeAlertWindow(\"warning\",\"You can not favorite yourself!\");\r\n\t\t}\r\n\t}",
"@Override\n public Fragment getItem(int position) {\n Fragment curFragment=null;\n Bundle bundle = new Bundle();\n switch (position){\n case 0:\n bundle.putParcelable(Constants.SHARE_DATA_KEYS.MAIN_RVIEW_OFFSET,mAlbumsMainState);\n bundle.putParcelableArray(Constants.SHARE_DATA_KEYS.CHILD_RVIEW_OFFSET,mAlbumsChildStates);\n mAlbums.setArguments(bundle);\n curFragment = mAlbums;\n break;\n case 1:\n bundle.putParcelable(Constants.SHARE_DATA_KEYS.MAIN_RVIEW_OFFSET,mPhotosState);\n mPhotos.setArguments(bundle);\n curFragment = mPhotos;\n break;\n case 2:\n bundle.putParcelable(Constants.SHARE_DATA_KEYS.MAIN_RVIEW_OFFSET,mTripListState);\n mTrips.setArguments(bundle);\n curFragment = mTrips;\n break;\n }\n return curFragment;\n }",
"private void addSelectedtoFavorites(){\n\t\t\n\t\tCursor c=getContentResolver().query(Uri.parse(Const.URI_STRING+\"/videolist/\"+mPlayListId), null, null, null, null);\n\t\tif(mCheckData==null || c==null){\n\t\t\tLogging.e(\"Error Data NULL\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(mCheckData.size()!=c.getCount()){\n\t\t\tLogging.e(\"Error Data and Cursor count has different value\");\n\t\t}\n\t\t\n\t\tif(c!=null){\n\t\t\tLogging.d(\"Insert Start\");\n\t\t \tfor(int i=0;i<c.getCount();i++){\n\t \t\tBoolean tagged=mCheckData.get(i);\n\t \t\tif(tagged){\n\t \t\t\tc.moveToPosition(i);\n\t \t\t\tContentValues cv=new ContentValues();\n\t \t\t\tcv.put(MyList.PRJ_TITLE, c.getString(c.getColumnIndex(PlayList.PRJ_TITLE)));\n\t \t\t\tcv.put(MyList.PRJ_PLAYLIST_ID, mTitle);\n\t \t\t\tcv.put(MyList.PRJ_DESCRIPTION, c.getString(c.getColumnIndex(PlayList.PRJ_DESCRIPTION)));\n\t \t\t\tcv.put(MyList.PRJ_DURATION, c.getString(c.getColumnIndex(PlayList.PRJ_DURATION)));\n\t \t\t\tcv.put(MyList.PRJ_THUMNAIL, c.getString(c.getColumnIndex(PlayList.PRJ_THUMNAIL)));\n\t \t\t\tcv.put(MyList.PRJ_VIDEO_ID, c.getString(c.getColumnIndex(PlayList.PRJ_VIDEO_ID)));\n\t \t\t\t\n\t \t\t\tgetContentResolver().insert(Uri.parse(\"content://\"+Const.MYLIST_AUTHORITY+\"/videolist\"), cv);\n\t \t\t\tLogging.d(\"Insert \"+i);\n\t \t\t}\n\t \t}\n\t\t \tc.close();\n\t\t \tLogging.d(\"Insert End\");\n\t\t}\n\t}",
"private boolean checkFavorite(User user, Product product) {\n for (Favorite favorite: favorites) {\n if (favorite.getProduct().getProductName().equals(product.getProductName())\n && favorite.getUser().getUserUID().equals(user.getUserUID())) {\n return true;\n }\n }\n\n return false;\n }",
"public void setFavSite(final String favSite){\n\t\tthis.favSite = favSite;\n\t}",
"public void addMovieToFavorites(Movie movie) {\n movie.setFavorite(true);\n isFavorite = true;\n //change the star from gray to yellow\n star.setImageResource(R.drawable.ic_grade_yellow_36px);\n //save the poster in local storage\n String imageName = saveMoviePoster();\n\n //load the necessary movie fields into the ContentValues object\n ContentValues values = new ContentValues();\n values.put(FavoriteMoviesContract.MovieEntry.MOVIEDB_ID, movie.getId());\n values.put(FavoriteMoviesContract.MovieEntry.AVERAGE_VOTE, movie.getVoteAverage());\n values.put(FavoriteMoviesContract.MovieEntry.ORIGINAL_TITLE, movie.getOriginalTitle());\n values.put(FavoriteMoviesContract.MovieEntry.RELEASE_YEAR, movie.getReleaseYear());\n values.put(FavoriteMoviesContract.MovieEntry.RUNTIME, movie.getRuntime());\n values.put(FavoriteMoviesContract.MovieEntry.SYNOPSIS, movie.getSynopsis());\n values.put(FavoriteMoviesContract.MovieEntry.POSTER_IMAGE_NAME, imageName);\n\n //insert the movie into the Favorites db\n Uri uri = getActivity().getContentResolver().\n insert(FavoriteMoviesContract.MovieEntry.CONTENT_URI, values);\n\n if (uri != null) {\n String successMessage = \"You have successfully added \" + movie.getOriginalTitle() +\n \" to the Favorites collection\";\n Toast.makeText(getActivity(), successMessage, Toast.LENGTH_LONG).show();\n }\n }",
"@Override\r\n\tpublic void onTabSelected(Tab tab, FragmentTransaction ft) {\n\t\t if (mFragment == null) {\r\n\t\t // If not, instantiate and add it to the activity\r\n\t\t mFragment = Fragment.instantiate(mActivity, mClass.getName());\r\n\t\t ft.add(android.R.id.content, mFragment, mTag);\r\n\t\t } else {\r\n\t\t // If it exists, simply attach it in order to show it\r\n\t\t ft.show(mFragment);//选择的时候,让之前隐藏的显示出来\r\n\t\t }\r\n\r\n\t}",
"private static boolean assetInfoIsInPersistentCache(Asset asset) {\n \t\treturn getAssetInfoFile(asset.getId()).exists();\n \t}",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_favorites, container, false);\n }",
"private List<Equipe> getFavoriteEquipes(List<Equipe> allEquipes) {\n\t\tList<Equipe> retain = new ArrayList<Equipe>(allEquipes.size());\n\t\tfor (Equipe equipe : allEquipes) {\n\t\t\tif (equipe.favorite) {\n\t\t\t\tretain.add(equipe);\n\t\t\t}\n\t\t}\n\t\treturn retain;\n\t}",
"@Override\n\tpublic Page<vacante> cargarvacante(Pageable page) {\n\t\treturn vacantesrepo.findAll(page);\n\t}",
"@Override\n public void onClick(View view) {\n\n FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();\n\n if (favorited) {\n unFavorite(mangaID, user);\n } else {\n favorite(mangaID, mangaDetails.getTitle(), user);\n }\n\n }",
"boolean hasAsset();"
] | [
"0.5514125",
"0.51570183",
"0.48480335",
"0.47219768",
"0.46772307",
"0.46452183",
"0.4614247",
"0.46121728",
"0.45823383",
"0.45184997",
"0.44629306",
"0.44595364",
"0.44413367",
"0.4429468",
"0.44195887",
"0.44176957",
"0.43791074",
"0.43719512",
"0.43359327",
"0.4332239",
"0.43298084",
"0.43248406",
"0.43133518",
"0.43076977",
"0.42957082",
"0.42901894",
"0.4281612",
"0.4273349",
"0.42669573",
"0.42669573",
"0.4262389",
"0.42619625",
"0.42456362",
"0.42401937",
"0.4225754",
"0.4213527",
"0.42042008",
"0.42011657",
"0.41965878",
"0.41923267",
"0.418942",
"0.41878542",
"0.41868526",
"0.41798717",
"0.41793466",
"0.4174559",
"0.41648933",
"0.4153643",
"0.4141496",
"0.41084656",
"0.41051006",
"0.41001862",
"0.40922984",
"0.4088665",
"0.40880793",
"0.4079393",
"0.40768677",
"0.40752414",
"0.405729",
"0.40405703",
"0.40282306",
"0.4021571",
"0.4021216",
"0.4016488",
"0.40104792",
"0.40026075",
"0.39955676",
"0.39872178",
"0.39814863",
"0.3973209",
"0.3971313",
"0.39711836",
"0.39542153",
"0.39479688",
"0.39473107",
"0.3940103",
"0.39364535",
"0.39360225",
"0.39317903",
"0.3920557",
"0.39066896",
"0.38987353",
"0.38942048",
"0.3892933",
"0.3881234",
"0.38742846",
"0.3873576",
"0.38709295",
"0.38683474",
"0.38654685",
"0.3857347",
"0.38554645",
"0.38529736",
"0.38494745",
"0.38492095",
"0.384885",
"0.38449672",
"0.38444802",
"0.38387784",
"0.3832975"
] | 0.62778324 | 0 |
Initialize a Map of List of PageViewVO based on the key types enum. | protected Map<String,List<PageViewVO>> initializePageMap() {
Map<String,List<PageViewVO>> pm = new HashMap<>();
for (Section sect : Section.values()) {
pm.put(sect.name(), new ArrayList<>());
}
return pm;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"InfiniteMap<K,V> build(MapTypes type);",
"private static void createTypeMap() {\n\n }",
"private void populateScreenViewMap() {\n\n log.debug(\"Populating the screens\");\n\n for (Screen screen : Screen.values()) {\n\n AbstractScreenView view = Screens.newScreen(screen);\n\n // Keep track of the view instances but don't initialise them\n screenViewMap.put(screen, view);\n\n }\n\n }",
"private static void initializeMap() {\n addressTypeToSerializerMap = new HashMap<>();\n addressTypeToSerializerMap.put(NoAddressAfi.VALUE, NoAddressSerializer.getInstance());\n addressTypeToSerializerMap.put(Ipv4Afi.VALUE, Ipv4Serializer.getInstance());\n addressTypeToSerializerMap.put(Ipv4BinaryAfi.VALUE, Ipv4BinarySerializer.getInstance());\n addressTypeToSerializerMap.put(Ipv4PrefixAfi.VALUE, Ipv4PrefixSerializer.getInstance());\n addressTypeToSerializerMap.put(Ipv4PrefixBinaryAfi.VALUE, Ipv4PrefixBinarySerializer.getInstance());\n addressTypeToSerializerMap.put(Ipv6Afi.VALUE, Ipv6Serializer.getInstance());\n addressTypeToSerializerMap.put(Ipv6BinaryAfi.VALUE, Ipv6BinarySerializer.getInstance());\n addressTypeToSerializerMap.put(Ipv6PrefixAfi.VALUE, Ipv6PrefixSerializer.getInstance());\n addressTypeToSerializerMap.put(Ipv6PrefixBinaryAfi.VALUE, Ipv6PrefixBinarySerializer.getInstance());\n addressTypeToSerializerMap.put(MacAfi.VALUE, MacSerializer.getInstance());\n addressTypeToSerializerMap.put(DistinguishedNameAfi.VALUE, DistinguishedNameSerializer.getInstance());\n addressTypeToSerializerMap.put(Lcaf.VALUE, LcafSerializer.getInstance());\n addressTypeToSerializerMap.put(AfiListLcaf.VALUE, AfiListSerializer.getInstance());\n addressTypeToSerializerMap.put(InstanceIdLcaf.VALUE, InstanceIdSerializer.getInstance());\n addressTypeToSerializerMap.put(ApplicationDataLcaf.VALUE, ApplicationDataSerializer.getInstance());\n addressTypeToSerializerMap.put(ExplicitLocatorPathLcaf.VALUE, ExplicitLocatorPathSerializer.getInstance());\n addressTypeToSerializerMap.put(SourceDestKeyLcaf.VALUE, SourceDestKeySerializer.getInstance());\n addressTypeToSerializerMap.put(KeyValueAddressLcaf.VALUE, KeyValueAddressSerializer.getInstance());\n addressTypeToSerializerMap.put(ServicePathLcaf.VALUE, ServicePathSerializer.getInstance());\n }",
"private static void initializeMap() {\n\t\tmap = new HashMap<String, MimeTransferEncoding>();\n\t\tfor (MimeTransferEncoding mte : MimeTransferEncoding.values()) {\n\t\t\tmap.put(mte.string, mte);\n\t\t}\n\t}",
"public static void fill_map(){\n\t\tcategory_links_map.put(\"Categories\", \"Movies\");\n\t\tcategory_links_map.put(\"Actors\", \"Movies\");\n\t\tcategory_links_map.put(\"Movies\", \"Actors\");\n\t\tcategory_links_map.put(\"Artists\", \"Creations\");\n\t\tcategory_links_map.put(\"Creations\", \"Artists\");\n\t\tcategory_links_map.put(\"Countries\", \"Locations\");\n\t\tcategory_links_map.put(\"Locations\", \"Countries\");\n\t\tcategory_links_map.put(\"NBA players\", \"NBA teams\");\n\t\tcategory_links_map.put(\"NBA teams\", \"NBA players\");\n\t\tcategory_links_map.put(\"Israeli soccer players\", \"Israeli soccer teams\");\n\t\tcategory_links_map.put(\"Israeli soccer teams\", \"Israeli soccer players\");\n\t\tcategory_links_map.put(\"World soccer players\", \"World soccer teams\");\n\t\tcategory_links_map.put(\"World soccer teams\", \"World soccer players\");\n\t}",
"private Map(int typeMap ) throws IllegalArgumentException\n {\n switch (typeMap){\n case 1:\n createMapOfFirstType();\n setAdjForFirstType();\n break;\n case 2:\n createMapOfSecondType();\n setAdjForSecondType();\n break;\n case 3:\n createMapOfThirdType();\n setAdjForThirdType();\n break;\n case 4:\n createMapOfFourthType();\n setAdjForFourthType();\n break;\n default:\n throw new IllegalArgumentException();\n }\n }",
"private void createVTables() {\n this.vTable = new HashMap<String, Map>();\n\n Map classes = this.declaredTypes.getClasses();\n Iterator cls_it = classes.entrySet().iterator();\n while(cls_it.hasNext()) {\n Map.Entry clsMapEntry = (Map.Entry)cls_it.next();\n\n String clsName = (String)clsMapEntry.getKey();\n ClassNode clsNode = (ClassNode)clsMapEntry.getValue();\n\n Map methods = collectVtableMethods(clsName, clsNode, classes);\n\n List<ClassNode> clsRel = createClsRelList(clsNode, classes);\n HashMap<String, Integer> clsVTable = constructTableEntry(clsName,\n methods,\n clsRel,\n clsNode);\n this.vTable.put(clsName, clsVTable);\n }\n }",
"static Map instanceOfMap(int typeMap)\n {\n if(instanceOfMap==null)\n instanceOfMap = new Map(typeMap);\n return instanceOfMap;\n }",
"private void initJavaType() { // FIXME move this logic to core module\n\t\tif (javaTypeMap == null) {\n\t\t\tjavaTypeMap = new TreeMap<String, List<String>>();\n\t\t}\n\t\tif (!javaTypeMap.containsKey(\"1\")) {\n\t\t\tList<String> list = new ArrayList<String>();\n\t\t\tlist.add(\"java.lang.String\");\n\t\t\tlist.add(\"java.sql.Date\");\n\t\t\tlist.add(\"java.sql.Time\");\n\t\t\tlist.add(\"java.sql.Timestamp\");\n\t\t\tlist.add(\"java.lang.Byte\");\n\t\t\tlist.add(\"java.lang.Short\");\n\t\t\tlist.add(\"java.lang.Integer\");\n\t\t\tlist.add(\"java.lang.Long\");\n\t\t\tlist.add(\"java.lang.Float\");\n\t\t\tlist.add(\"java.lang.Double\");\n\t\t\tlist.add(\"java.math.BigDecimal\");\n\t\t\tlist.add(\"byte\");\n\t\t\tlist.add(\"short\");\n\t\t\tlist.add(\"int\");\n\t\t\tlist.add(\"long\");\n\t\t\tlist.add(\"float\");\n\t\t\tlist.add(\"double\");\n\t\t\tjavaTypeMap.put(\"1\", list);\n\t\t}\n\t\tif (!javaTypeMap.containsKey(\"2\")) {\n\t\t\tList<String> list = new ArrayList<String>();\n\t\t\tlist.add(\"java.lang.Byte\");\n\t\t\tlist.add(\"java.lang.Short\");\n\t\t\tlist.add(\"java.lang.Integer\");\n\t\t\tlist.add(\"java.lang.Long\");\n\t\t\tlist.add(\"java.lang.Float\");\n\t\t\tlist.add(\"java.lang.Double\");\n\t\t\tlist.add(\"java.math.BigDecimal\");\n\t\t\tlist.add(\"java.lang.String\");\n\t\t\tlist.add(\"byte\");\n\t\t\tlist.add(\"short\");\n\t\t\tlist.add(\"int\");\n\t\t\tlist.add(\"long\");\n\t\t\tlist.add(\"float\");\n\t\t\tlist.add(\"double\");\n\t\t\tjavaTypeMap.put(\"2\", list);\n\t\t}\n\t\tif (!javaTypeMap.containsKey(\"3\")) {\n\t\t\tList<String> list = new ArrayList<String>();\n\t\t\tlist.add(\"java.sql.Date\");\n\t\t\tlist.add(\"java.sql.Time\");\n\t\t\tlist.add(\"java.sql.Timestamp\");\n\t\t\tlist.add(\"java.lang.String\");\n\t\t\tjavaTypeMap.put(\"3\", list);\n\t\t}\n\t\tif (!javaTypeMap.containsKey(\"4\")) {\n\t\t\tList<String> list = new ArrayList<String>();\n\t\t\tjavaTypeMap.put(\"4\", list);\n\t\t}\n\t\tif (!javaTypeMap.containsKey(\"5\")) {\n\t\t\tList<String> list = new ArrayList<String>();\n\t\t\tif (database != null) {\n\t\t\t\tString jdbcVersion = database.getDatabase().getServer().getJdbcDriverVersion();\n\t\t\t\tif (isAfterJdbc111(jdbcVersion)) {\n\t\t\t\t\tlist.add(\"cubrid.sql.CUBRIDOIDImpl\");\t\t\t\t\t\n\t\t\t\t} else { \n\t\t\t\t\tlist.add(\"cubrid.sql.CUBRIDOID\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlist.add(\"cubrid.sql.CUBRIDOID\");\n\t\t\t}\n\t\t\t\n\t\t\tjavaTypeMap.put(\"5\", list);\n\t\t}\n\t\tif (!javaTypeMap.containsKey(\"6\")) {\n\t\t\tList<String> list = new ArrayList<String>();\n\t\t\tlist.add(\"cubrid.jdbc.driver.CUBRIDResultSet\");\n\t\t\tjavaTypeMap.put(\"6\", list);\n\t\t}\n\t}",
"public ViewMap(String viewFolder) {\n\t\tthis.viewMap = new HashMap<String,View>();\n\t\tthis.viewFolder = viewFolder;\n\t}",
"private static Map<VOTableVersion,VersionDetail>\n createMap( VersionDetail[] vds ) {\n Map<VOTableVersion,VersionDetail> map =\n new LinkedHashMap<VOTableVersion,VersionDetail>();\n for ( int i = 0; i < vds.length; i++ ) {\n map.put( vds[ i ].version_, vds[ i ] );\n }\n return map;\n }",
"public void initMap()\r\n/* */ {\r\n///* 36 */ putHandler(\"vwkgcode\", PDWkHeadTailVWkgcodeHandler.class);\r\n///* 37 */ putHandler(\"fcapacitycalc\", PDWkHeadTailFcapacitycalcHandler.class);\r\n///* 38 */ putHandler(\"bprodline\", PDWkHeadTailBprodlineHandler.class);\r\n/* */ }",
"public PagePane(String strKey, String strEnum) {\n this.strKey = strKey;\n this.strEnum = strEnum;\n }",
"private static HashMap<String, String> initMapping()\n {\n HashMap<String, String> typeMapping = new HashMap<String, String>();\n\n typeMapping.put(\"boolean\", \"boolean\");\n typeMapping.put(\"float\", \"float\");\n typeMapping.put(\"double\", \"double\");\n typeMapping.put(\"byte\", \"byte\");\n typeMapping.put(\"unsignedByte\", \"short\");\n typeMapping.put(\"short\", \"short\");\n typeMapping.put(\"unsignedShort\", \"int\");\n typeMapping.put(\"int\", \"int\");\n typeMapping.put(\"integer\", \"java.math.BigDecimal\");\n typeMapping.put(\"positiveInteger\", \"java.math.BigInteger\");\n typeMapping.put(\"unsignedInt\", \"java.math.BigInteger\");\n typeMapping.put(\"long\", \"java.math.BigInteger\");\n typeMapping.put(\"unsignedLong\", \"java.math.BigDecimal\");\n typeMapping.put(\"decimal\", \"java.math.BigDecimal\");\n typeMapping.put(\"string\", \"String\");\n typeMapping.put(\"hexBinary\", \"byte[]\");\n typeMapping.put(\"base64Binary\", \"byte[]\");\n typeMapping.put(\"dateTime\", \"javax.xml.datatype.XMLGregorianCalendar\");\n typeMapping.put(\"time\", \"javax.xml.datatype.XMLGregorianCalendar\");\n typeMapping.put(\"date\", \"javax.xml.datatype.XMLGregorianCalendar\");\n typeMapping.put(\"gDay\", \"javax.xml.datatype.XMLGregorianCalendar\");\n typeMapping.put(\"gMonth\", \"javax.xml.datatype.XMLGregorianCalendar\");\n typeMapping.put(\"gMonthDay\", \"javax.xml.datatype.XMLGregorianCalendar\");\n typeMapping.put(\"gYear\", \"javax.xml.datatype.XMLGregorianCalendar\");\n typeMapping.put(\"gYearMonth\", \"javax.xml.datatype.XMLGregorianCalendar\");\n typeMapping.put(\"duration\", \"javax.xml.datatype.Duration\");\n typeMapping.put(\"NOTATION\", \"javax.xml.namespace.QName\");\n typeMapping.put(\"QName\", \"javax.xml.namespace.QName\");\n typeMapping.put(\"anyURI\", \"String\");\n typeMapping.put(\"Name\", \"String\");\n typeMapping.put(\"NCName\", \"String\");\n typeMapping.put(\"negativeInteger\", \"java.math.BigDecimal\");\n typeMapping.put(\"NMTOKEN\", \"String\");\n typeMapping.put(\"nonNegativeInteger\", \"java.math.BigDecimal\");\n typeMapping.put(\"nonPositiveInteger\", \"java.math.BigDecimal\");\n typeMapping.put(\"normalizedString\", \"String\");\n typeMapping.put(\"token\", \"String\");\n typeMapping.put(\"any\", \"Object\");\n\n return typeMapping;\n }",
"private void buildMap(int count, char type, String typeName) {\r\n\t\tfor (int i = 1; i <= count; i++) {\r\n\t\t\toriginalMaps.add(new MapType(\"map_\" + type + i, typeName, \"colony/map_\" + type + i));\r\n\t\t}\r\n\t}",
"public <T> Map<MDSKey, T> listKV(Set<MDSKey> keySet, Type typeOfT, int limit) {\n return listKV(keySet, typeOfT, limit, x -> true);\n }",
"private void setUpHashMap(int number)\n {\n switch (number)\n {\n case 1:\n {\n this.hourly.put(\"Today\",new ArrayList<HourlyForecast>());\n break;\n }\n case 2:\n {\n this.hourly.put(\"Today\",new ArrayList<HourlyForecast>());\n this.hourly.put(\"Tomorrow\", new ArrayList<HourlyForecast>());\n break;\n }\n case 3:\n {\n this.hourly.put(\"Today\", new ArrayList<HourlyForecast>());\n this.hourly.put(\"Tomorrow\", new ArrayList<HourlyForecast>());\n this.hourly.put(\"Day After Tomorrow\", new ArrayList<HourlyForecast>());\n break;\n }default:\n break;\n }\n }",
"public static Map<String,List<CustomItemDto>> createMap(List<CustomItemDto> items){\n\t\t\n\t\tMap<String,List<CustomItemDto>> map=new HashMap<>();\n\n\t\tfor(CustomItemDto item:items){\n\t\t\n\t \tif(!map.containsKey(item.getCardType())){\t\n\t \t\tList<CustomItemDto> c = new ArrayList<>();\n\t\t\tc.add(item);\n\t\t map.put(item.getCardType(),c);\n\t\t }else{\t\n\t\t\tList<CustomItemDto> c=map.get(item.getCardType());\n\t\t c.add(item);\t\t\n\t\t\t\t}//else\n\t\t\t}\n\t\treturn map;\n\t\t}",
"private HashMap<String,String> createQueryMap() {\n\t\t\n\t\tHashMap<String, String> map = new HashMap<String, String>();\n\t\t\n\t\t// Only include Pages with the CenterNet Event template\n\t\tmap.put(\"type\",\"cq:Page\");\n\t\tmap.put(\"path\", Constants.EVENTS);\n\t\tmap.put(\"property\",\"jcr:content/cq:template\");\n\t map.put(\"property.value\", Constants.EVENT_TEMPLATE);\n\n\t if (tags != null) {\n\t \tmap = addTagFilter(map);\n\t }\n\n\t // Only include Events whose start time is in the future\n\t map.put(\"relativedaterange.property\", PN_QUERY_START_TIME);\n\t map.put(\"relativedaterange.lowerBound\", \"-0d\");\n\t \n\t // Include all hits\n\t //map.put(\"p.limit\", maxNum.toString());\n\t map.put(\"p.limit\", maxNum);\n\t map.put(\"p.guessTotal\", \"true\");\n\t \n\t // Order by Start Time\n\t map.put(\"orderby\", PN_QUERY_START_TIME);\n\t map.put(\"orderby.sort\", \"asc\");\n\t \n\t\treturn map;\n\t\t\n\t}",
"private Map<Integer, MessageEncoder> initialiseMap() {\n Map<Integer, MessageEncoder> composerMap = new HashMap<>();\n composerMap.put(AC35MessageType.BOAT_ACTION.getCode(), new BoatActionEncoder());\n composerMap.put(AC35MessageType.REQUEST.getCode(), new RequestEncoder());\n composerMap.put(AC35MessageType.COLOUR.getCode(), new ColourEncoder());\n\n return Collections.unmodifiableMap(composerMap);\n }",
"public <T> Map<MDSKey, T> listKV(MDSKey id, Type typeOfT) {\n return listKV(id, typeOfT, Integer.MAX_VALUE);\n }",
"public Q706DesignHashMap() {\n keys = new ArrayList<>();\n values = new ArrayList<>();\n\n }",
"public Map<T, V> populateMap() {\n Map<T, V> map = new HashMap<>();\n for (int i = 0; i < entryNumber; i++) {\n cacheKeys[i] = (T) Integer.toString(random.nextInt(1000000000));\n String key = cacheKeys[i].toString();\n map.put((T) key, (V) Integer.toString(random.nextInt(1000000000)));\n }\n return map;\n }",
"private void initialize() {\n\t\tplayerMap = new HashMap<>();\n\t\ttypeMap = new HashMap<>();\n\t\tfor (ProductType type : ProductType.values()) {\n\t\t\tMap<ProductState, Map<Integer, Set<Product>>> stateMap = new HashMap<>();\n\t\t\tfor (ProductState state : ProductState.values()) {\n\t\t\t\tMap<Integer, Set<Product>> map = new HashMap<>();\n\t\t\t\tstateMap.put(state, map);\n\t\t\t}\n\t\t\ttypeMap.put(type, stateMap);\n\t\t}\n\t}",
"Plist()\n {\n m_dateFormat = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss'Z'\");\n m_dateFormat.setTimeZone(TimeZone.getTimeZone(\"Z\"));\n m_simpleTypes = new HashMap<Class<?>, ElementType>();\n m_simpleTypes.put(Integer.class, ElementType.INTEGER);\n m_simpleTypes.put(Byte.class, ElementType.INTEGER);\n m_simpleTypes.put(Short.class, ElementType.INTEGER);\n m_simpleTypes.put(Short.class, ElementType.INTEGER);\n m_simpleTypes.put(Long.class, ElementType.INTEGER);\n m_simpleTypes.put(String.class, ElementType.STRING);\n m_simpleTypes.put(Float.class, ElementType.REAL);\n m_simpleTypes.put(Double.class, ElementType.REAL);\n m_simpleTypes.put(byte[].class, ElementType.DATA);\n m_simpleTypes.put(Boolean.class, ElementType.TRUE);\n m_simpleTypes.put(Date.class, ElementType.DATE);\n }",
"public void initMap() {\n\t\tmap = new Map();\n\t\tmap.clear();\n\t\tphase = new Phase();\n\t\tmap.setPhase(phase);\n\t\tmapView = new MapView();\n\t\tphaseView = new PhaseView();\n\t\tworldDomiView = new WorldDominationView();\n\t\tcardExchangeView = new CardExchangeView();\n\t\tphase.addObserver(phaseView);\n\t\tphase.addObserver(cardExchangeView);\n\t\tmap.addObserver(worldDomiView);\n\t\tmap.addObserver(mapView);\n\t}",
"protected Map<String, Object> assertMap() {\n if (type == Type.LIST) {\n throw new FlexDataWrongTypeRuntimeException(type, Type.OBJECT); \n }\n if (entryCollectionMap == null) {\n entryCollectionMap = new LinkedHashMap<String, Object>();\n type = Type.OBJECT;\n }\n return entryCollectionMap;\n }",
"private static void initializeMaps()\n\t{\n\t\taddedPoints = new HashMap<String,String[][][]>();\n\t\tpopulatedList = new HashMap<String,Boolean>();\n\t\tloadedAndGenerated = new HashMap<String,Boolean>();\n\t}",
"private static synchronized void initializeMeasureMaps() {\n\t\tintensityMeasuresList=ExerciseIntensityMeasure.getAll();\n\t\tquantityMeasuresList=ExerciseQuantityMeasure.getAll();\n\t\tintensityCodesToNamesMap=new HashMap(intensityMeasuresList.size());\n\t\tquantityCodesToNamesMap=new HashMap(quantityMeasuresList.size());\n\n\t\t// these (and the lists above) come from the db, but they can be static \n\t\t// because they change so infrequently (haven't changed in five years and\n\t\t// counting), and only manually via the db.\n\t\tfor (int i=0; i<intensityMeasuresList.size(); i++) {\n\t\t\tfinal ExerciseIntensityMeasure m=(ExerciseIntensityMeasure)intensityMeasuresList.get(i);\n\t\t\tintensityCodesToNamesMap.put(m.getCode(),m.getName());\n\t\t}\n\t\tfor (int i=0; i<quantityMeasuresList.size(); i++) {\n\t\t\tfinal ExerciseQuantityMeasure m=(ExerciseQuantityMeasure)quantityMeasuresList.get(i);\n\t\t\tquantityCodesToNamesMap.put(m.getCode(),m.getName());\n\t\t}\n\t\tmeasureMapsInitialized=true;\n\t\t\n\t}",
"@Override\r\n\tpublic Page getTypeList(Map<String, String> param) {\n\t\treturn codeMasterService.getTypeList(param);\r\n\t}",
"public ScopedMap() {\n\t\tmap = new ArrayList<HashMap<K, V>>();\n\n\t}",
"@Override\n public Type visit(MapType mapType) {\n Type keyType = mapType.getKeyType().accept(this);\n Type valueType = mapType.getValueType().accept(this);\n if (mapType.getValueType().isNullable()) {\n return Types.MapType.ofOptional(getNextId(), getNextId(), keyType, valueType);\n } else {\n return Types.MapType.ofRequired(getNextId(), getNextId(), keyType, valueType);\n }\n }",
"Hashtable createTypeMapping()\n {\n Hashtable mapping = new Hashtable();\n \n mapping.put(TypeFactory.getType(\"Double\"), \n new ParameterFactory() \n {\n public Parameter getParameter(Object o) \n {\n StratmasDecimal sObj = (StratmasDecimal) o;\n if (isBadDecimal(sObj)) {\n return null;\n } else {\n return new StratmasDecimalParameter((StratmasDecimal) o);\n }\n }\n });\n mapping.put(TypeFactory.getType(\"double\", \"http://www.w3.org/2001/XMLSchema\"), \n new ParameterFactory() \n {\n public Parameter getParameter(Object o) \n {\n StratmasDecimal sObj = (StratmasDecimal) o;\n if (isBadDecimal(sObj)) {\n return null;\n } else {\n return new StratmasDecimalParameter((StratmasDecimal) o);\n }\n }\n });\n mapping.put(TypeFactory.getType(\"NonNegativeInteger\"), \n new ParameterFactory() \n {\n public Parameter getParameter(Object o) \n {\n return new StratmasIntegerParameter((StratmasInteger) o);\n }\n });\n // Ground type type hiearchy.\n mapping.put(TypeFactory.getType(\"anyType\", \"http://www.w3.org/2001/XMLSchema\"), \n new ParameterFactory() \n {\n public Parameter getParameter(Object o) \n {\n return null;\n }\n });\n\n return mapping;\n }",
"@Override\r\n\tpublic <T> Map<String, T> getMap(Class<T> clazz, List<String> keyList) throws CacheException {\n\t\treturn null;\r\n\t}",
"public void fillMap() {\n this.months.put(\"янв\", Month.JANUARY);\n this.months.put(\"фев\", Month.FEBRUARY);\n this.months.put(\"мар\", Month.MARCH);\n this.months.put(\"апр\", Month.APRIL);\n this.months.put(\"май\", Month.MAY);\n this.months.put(\"июн\", Month.JUNE);\n this.months.put(\"июл\", Month.JULY);\n this.months.put(\"авг\", Month.AUGUST);\n this.months.put(\"сен\", Month.SEPTEMBER);\n this.months.put(\"окт\", Month.OCTOBER);\n this.months.put(\"ноя\", Month.NOVEMBER);\n this.months.put(\"дек\", Month.DECEMBER);\n }",
"public static AdminPrivilages valueOf(int pageType) {\n return (AdminPrivilages) map.get(pageType);\n }",
"private void generateMaps() {\r\n\t\tthis.tablesLocksMap = new LinkedHashMap<>();\r\n\t\tthis.blocksLocksMap = new LinkedHashMap<>();\r\n\t\tthis.rowsLocksMap = new LinkedHashMap<>();\r\n\t\tthis.waitMap = new LinkedHashMap<>();\r\n\t}",
"protected Map<String, URL> createMap(Collection<? extends IconRecord> records)\n {\n Map<String, URL> map = New.map(records.size());\n for (IconRecord record : records)\n {\n map.put(getPublicUrl(record.imageURLProperty().get()), record.imageURLProperty().get());\n }\n return map;\n }",
"public <T> Map<MDSKey, T> listKV(MDSKey id, Type typeOfT, int limit) {\n return listKV(id, null, typeOfT, limit, x -> true);\n }",
"private void initMaps()\r\n\t{\r\n\t\tenergiesForCurrentKOppParity = new LinkedHashMap<Integer, Double>();\r\n\t\tinputBranchWithJ = new LinkedHashMap<Integer, Double>();\r\n\t\tassociatedR = new LinkedHashMap<Integer, Double>();\r\n\t\tassociatedP = new LinkedHashMap<Integer, Double>();\r\n\t\tassociatedQ = new LinkedHashMap<Integer, Double>();\r\n\t\ttriangularP = new LinkedHashMap<Integer, Double>();\r\n\t\ttriangularQ = new LinkedHashMap<Integer, Double>();\r\n\t\ttriangularR = new LinkedHashMap<Integer, Double>();\r\n\t\tupperEnergyValuesWithJ = new LinkedHashMap<Integer, Double>();\r\n\t}",
"public void init() {\n for (int i = 1; i <= 20; i++) {\n List<Data> dataList = new ArrayList<Data>();\n if (i % 2 == 0 || (1 + i % 10) == _siteIndex) {\n dataList.add(new Data(i, 10 * i));\n _dataMap.put(i, dataList);\n }\n }\n }",
"public Map<Integer,SelectValuesDto> getCodeListMap(List<SelectValuesDto> lstInsightTypesDto) throws Exception{\n\t\tMap<Integer,SelectValuesDto> map = new HashMap<Integer,SelectValuesDto>();\n\t\tif(lstInsightTypesDto!=null && lstInsightTypesDto.size()>0 ){\n\t\t\tfor(SelectValuesDto insightTypesDto :lstInsightTypesDto){\n\t\t\t\tmap.put(insightTypesDto.getCodeDecodedCode(), insightTypesDto);\n\t\t\t}\n\t\t}\t\t\n\t\treturn map;\n\t}",
"public List<KVRender> buildRender(KVType kvType);",
"private Map<String, Object> initializeModelForEntryForm() {\r\n\t\tMap<String, Object> myModel = new HashMap<String, Object>();\r\n\t\tCollection<Tag> primaryTags = tagService.getPrimaryTags();\r\n\t\tmyModel.put(\"primaryTags\", primaryTags);\r\n\r\n\t\tMap<String, Object> featured = new HashMap<String, Object>();\r\n\t\tfeatured.put(\"true\", \"featured\");\r\n\t\tmyModel.put(\"featured\", featured);\r\n\r\n\t\tList<Tag> secondaryTags = new ArrayList<Tag>();\r\n\r\n\t\tfor (Tag aTag : primaryTags) {\r\n\t\t\tsecondaryTags.addAll(tagService.getBelongingTags(aTag.getId()));\r\n\t\t}\r\n\r\n\t\tCollections.sort(secondaryTags, new Comparator<Tag>() {\r\n\t\t public int compare(Tag tag1, Tag tag2) {\r\n\t\t return tag1.getName().compareTo(tag2.getName());\r\n\t\t }\r\n\t\t});\r\n\r\n\t\tmyModel.put(\"secondaryTags\", secondaryTags);\r\n\t\tCollection<WebItemType> webItemTypes = webItemTypeService.getAllWebItemTypes();\r\n\t\tmyModel.put(\"allWebItemTypes\", webItemTypes);\r\n\r\n\t\treturn myModel;\r\n\t}",
"interface DownloadsMap extends PagerAdapterMap, InitViewMap, ContextMap\n {\n\n }",
"protected Map getKeyMethodMap() {\n\t\tHashMap<String, String> map = new HashMap<String, String>();\n\t\tmap.put(\"cmd.planilla.lista\", \"lista\");\n\t\tmap.put(\"cmd.planilla.buscar\", \"buscar\");\n\t\tmap.put(\"cmd.planilla.verificar\", \"verificar\");\n\t\tmap.put(\"cmd.planilla.cargar\", \"cargar\");\n\t\tmap.put(\"cmd.planilla.actualizar\", \"actualizar\");\n\t\tmap.put(\"cmd.planilla.generar\", \"generar\");\n\t\tmap.put(\"cmd.planilla.cargaFin\", \"cargaFin\");\n\t\tmap.put(\"cmd.planilla.descEmpleadoFiador\", \"descEmpleadoFiador\");\n\t\tmap.put(\"cmd.planilla.verReporte\", \"verReporte\");\n\t\treturn map;\n\t}",
"@SuppressWarnings(\"unchecked\")\n private <T> List<Binding<T>> getFromMap(TypeLiteral<T> type) {\n return (List<Binding<T>>) map.get(type);\n }",
"public TimeMap() {\n hashMap = new HashMap<String, List<Data>>();\n }",
"private void init() {\n\t\tmap = new LinkedHashMap<String, HeaderData>();\r\n\t\tList<HeaderData> list = config.getColumns();\r\n\t\tfor(HeaderData info: list){\r\n\t\t\tString id = info.getId();\r\n\t\t\tif(id == null) throw new IllegalArgumentException(\"Null id found for \"+info.getClass().getName());\r\n\t\t\t// Map the id to info\r\n\t\t\tmap.put(info.getId(), info);\r\n\t\t}\r\n\t}",
"public static MapType MAP(FieldType keyType, FieldType valueType) {\n return new MapType(keyType, valueType);\n }",
"@Override\n public HashMap<String, List<String>> initializeMapping(HashMap<String, List<String>> mapping) {\n mapping.put(\"xEncoder\", Arrays.asList(\"outtakeMotor1\", \"outtake1\"));\n mapping.put(\"yEncoder\", Arrays.asList(\"wobbleMotor\"));\n\n return mapping;\n }",
"public void init() {\n\t\tfor(int i = 0; i < 5; i++) {\n\t\t\tpageLists.add(new Page(i));\n\t\t}\n\t}",
"public Map<String, List<BaiduZhannei>> buildSitemap() {\r\n Map<String, List<BaiduZhannei>> map = new HashMap<String, List<BaiduZhannei>>();\r\n map.put(GlobalConfigHolder.DOMAIN_TYPE_QUESTION, buildQuestion());\r\n// map.put(GlobalConfigHolder.DOMAIN_TYPE_TOPIC, buildTopic(GlobalConfigHolder.SITEMAP_COUNT));\r\n// map.put(GlobalConfigHolder.DOMAIN_TYPE_BLOG, buildBlog());\r\n\r\n return map;\r\n }",
"private void initializeMaps(){\n\t\t\n\t\tsteps = new HashMap<Integer, Set<PlanGraphStep>>();\n\t\tfacts = new HashMap<Integer, Set<PlanGraphLiteral>>();\n\t\tinconsistencies = new HashMap<Integer, Set<LPGInconsistency>>();\n\t\t\n\t\tfor(int i = 0; i <= maxLevel; i++) {\n\t\t\tsteps.put(i, new HashSet<PlanGraphStep>());\n\t\t\tfacts.put(i, new HashSet<PlanGraphLiteral>());\n\t\t\tinconsistencies.put(i, new HashSet<LPGInconsistency>());\n\t\t}\n\t\t\n\t\t/* This level holds only the special action end which has the goals as preconditions */\n\t\tsteps.put(maxLevel + 1, new HashSet<PlanGraphStep>());\n\t}",
"private Map<String, Object> createDefaultMap() {\n Map<String, Object> result = new LinkedHashMap<>();\n result.put(\"stream_speed0\", 1);\n result.put(\"stream_start0\", 0);\n result.put(\"stream_end0\", 7);\n result.put(\"stream_speed1\", -2);\n result.put(\"stream_start1\", 15);\n result.put(\"stream_end1\", 19);\n\n result.put(\"fish_quantity\", numFishes);\n result.put(\"fish_reproduction\", 3);\n result.put(\"fish_live\", 10);\n result.put(\"fish_speed\", 2);\n result.put(\"fish_radius\", 4);\n\n result.put(\"shark_quantity\", numSharks);\n result.put(\"shark_live\", 20);\n result.put(\"shark_hungry\", 7);\n result.put(\"shark_speed\", 2);\n result.put(\"shark_radius\", 5);\n\n return result;\n }",
"public interface PageFields {\n String ATT_PAGE = \"page\";\n String ATT_PAGELIMIT = \"limit\";\n String ATT_PAGENUMBER = \"pageNb\";\n String ATT_SEARCH = \"search\";\n String ATT_DELETE = \"selection\";\n String ATT_COL = \"col\";\n String ATT_ORDER = \"order\";\n\n default String getAttPage() {\n return ATT_PAGE;\n }\n\n default String getAttPageLimit() {\n return ATT_PAGELIMIT;\n }\n\n default String getAttPageNumber() {\n return ATT_PAGENUMBER;\n }\n\n default String getAttSearch() {\n return ATT_SEARCH;\n }\n\n default String getAttDelete() {\n return ATT_DELETE;\n }\n\n default String getAttCol() {\n return ATT_COL;\n }\n\n default String getAttOrder() {\n return ATT_ORDER;\n }\n}",
"private void initSqlTypeMap() {\n\t\tif (sqlTypeMap == null) {\n\t\t\tsqlTypeMap = new TreeMap<String, String>();\n\t\t}\n\t\tsqlTypeMap.put(\"--void--\", \"0\");\n\t\tFieldHandlerUtils.initSqlTypeMap(sqlTypeMap);\n\t}",
"@Override\n\tprotected void generateParams(HashMap<String, String> map) {\n\t\tmap.put(\"vuid\", vUid);\n\t\tif(page>0)map.put(\"page\", \"\"+page);\n\t\tif(size>0)map.put(\"size\", \"\"+size);\n\t}",
"private static <N extends Node> SortedMap<ImmutableContextSet, SortedSet<N>> createMap() {\n return new ConcurrentSkipListMap<>(ContextSetComparator.reverse());\n }",
"public Map initMap(){\n\t\tif (map == null){\n\t\t\tmap = createMap();\n\t\t}\n\t\treturn map;\n\t}",
"public IdMap() {\n\t\tthis.add(new TextItems());\n\t\tthis.add(new DateTimeEntity());\n\t\tthis.add(EntityCreator.createJson(false));\n\t\tthis.add(EntityCreator.createJson(true));\n\t\tthis.add(new ObjectMapEntry());\n\t\tthis.add(EntityCreator.createXML());\n\t}",
"public MultiKeyMap() {\n this.map = new java.util.HashMap<String,V>();\n return;\n }",
"private void supplyLookupValues(ModelAndView modelAndView) throws PortalServiceException {\n modelAndView.addObject(\"requestTypesLookup\", lookupService.findAllLookups(RequestType.class));\n modelAndView.addObject(\"enrollmentStatusesLookup\", lookupService.findAllLookups(EnrollmentStatus.class));\n modelAndView.addObject(\"riskLevelsLookup\", lookupService.findAllLookups(RiskLevel.class));\n ProviderTypeSearchCriteria providerTypeSearchCriteria = new ProviderTypeSearchCriteria();\n providerTypeSearchCriteria.setAscending(true);\n providerTypeSearchCriteria.setSortColumn(\"description\");\n providerTypeSearchCriteria.setPageNumber(1);\n providerTypeSearchCriteria.setPageSize(-1);\n List<ProviderType> items = providerTypeService.search(providerTypeSearchCriteria).getItems();\n modelAndView.addObject(\"providerTypesLookup\", items);\n }",
"public EnumMap<?, SerializableString> internalMap()\n/* */ {\n/* 100 */ EnumMap<?, SerializableString> result = this._asMap;\n/* 101 */ if (result == null)\n/* */ {\n/* 103 */ Map<Enum<?>, SerializableString> map = new LinkedHashMap();\n/* 104 */ for (Enum<?> en : this._values) {\n/* 105 */ map.put(en, this._textual[en.ordinal()]);\n/* */ }\n/* 107 */ result = new EnumMap(map);\n/* */ }\n/* 109 */ return result;\n/* */ }",
"public void setUp()\n {\n map = new Map(5, 5, null);\n }",
"private Map<String, PermissionType> getPermissionTypeMapForLabelToMaskChange() {\n\t\tMap<String, PermissionType> permissionTypeMap = new LinkedHashMap<String, PermissionType>();\n\n\t\tList<PermissionType> permissionTypes = permissionTypeRepo.findAll();\n\t\tfor (int i = 0; i < permissionTypes.size(); i++) {\n\t\t\tpermissionTypeMap.put(permissionTypes.get(i).getName(), permissionTypes.get(i));\n\t\t}\n\t\treturn permissionTypeMap;\n\t}",
"private void initializeVetVisitsControllers() {\n trObtainAllVetVisits = VetVisitsControllersFactory.createTrObtainAllVetVisits();\n trNewVetVisit = VetVisitsControllersFactory.createTrNewVetVisit();\n trDeleteVetVisit = VetVisitsControllersFactory.createTrDeleteVetVisit();\n trUpdateVetVisit = VetVisitsControllersFactory.createTrUpdateVetVisit();\n }",
"private static Map<String, ViewManager> buildViewManagerMap(List<ViewManager> viewManagers) {\n Map<String, ViewManager> viewManagerMap = new HashMap<>();\n for (ViewManager viewManager : viewManagers) {\n viewManagerMap.put(viewManager.getName(), viewManager);\n }\n for (Map.Entry<String, Class<? extends ViewManager>> entry : flatManagerClassMap.entrySet()) {\n String name = entry.getKey();\n ViewManager maybeFlatViewManager = viewManagerMap.get(name);\n if (maybeFlatViewManager == null) {\n // We don't have a view manager for this name in the package, no need to add one.\n continue;\n }\n\n Class<? extends ViewManager> flatClazz = entry.getValue();\n if (maybeFlatViewManager.getClass() != flatClazz) {\n // If we have instances that have flat equivalents, override them.\n try {\n viewManagerMap.put(name, flatClazz.newInstance());\n } catch (IllegalAccessException e) {\n throw new RuntimeException(\"Unable to access flat class for \" + name, e);\n } catch (InstantiationException e) {\n throw new RuntimeException(\"Unable to instantiate flat class for \" + name, e);\n }\n }\n }\n return viewManagerMap;\n }",
"public interface SysDictionaryExtMapper {\n\n List<SysDictionary> listDictionary(@Param(\"dicClass\") String dicClass,\n @Param(\"dicValue\") String dicValue,\n Page<SysDictionary> page);\n\n}",
"public CaseInsensitiveElementList(Map<String, ? extends V> map) {\n this(map, null);\n }",
"public void setMapType(int type) {\n if(internalNative != null) {\n internalNative.setMapType(type);\n }\n }",
"public static void display(){\n EnumMap<Size, Integer> sizes1 = new EnumMap<>(Size.class);\n\n sizes1.put(Size.LARGE, 36);\n sizes1.put(Size.MEDIUM, 33);\n\n System.out.println(sizes1);\n\n\n\n// Second:\n EnumMap<Size, Integer> newNum = new EnumMap<>(sizes1);\n System.out.println(newNum);\n\n\n }",
"private void createHashtable()\n {\n int numLanguages = languages.length;\n mapping = new Hashtable(numLanguages, 1.0f);\n for (int i = 0; i < numLanguages; i++)\n mapping.put(languages[i], values[i]);\n }",
"public static <V extends Parcelable> Map<String, V> readMap(Parcel in,\n Class<? extends V> type) {\n\n Map<String, V> map = new HashMap<String, V>();\n if (in != null) {\n String[] keys = in.createStringArray();\n Bundle bundle = in.readBundle(type.getClassLoader());\n for (String key : keys)\n map.put(key, type.cast(bundle.getParcelable(key)));\n }\n return map;\n }",
"private void createMaps() {\r\n\t\tint SIZE = 100;\r\n\t\tint x = 0, y = -1;\r\n\t\tfor (int i = 0; i < SIZE; i++) {\r\n\t\t\tif (i % 10 == 0) {\r\n\t\t\t\tx = 0;\r\n\t\t\t\ty = y + 1;\r\n\t\t\t}\r\n\t\t\tshipStateMap.put(new Point(x, y), 0);\r\n\t\t\tshipTypeMap.put(new Point(x, y), 0);\r\n\t\t\tx++;\r\n\t\t}\r\n\t}",
"public void map(HashMap<String, Object> map) {\n String indexString = (String) map.get(\"serviceIndexes\");\n String[] arr = indexString.split(\",\");\n // Fill indexes from map's return value.\n for(int i = 0; i < arr.length; i++) {\n this.indexes.add(new Integer(arr[i]));\n }\n // Retrieve services from enum by index\n for(int i = 0; i < indexes.size(); i++) {\n String s = ServiceTypes.values()[indexes.get(i)].getKey();\n this.services.add(s);\n }\n }",
"private static void initializeDatafields(Class<AbstractNode> type) throws Exception {\r\n if (staticDatafieldMap == null) {\r\n staticDatafieldMap = new HashMap<Class<AbstractNode>, Set<String>>();\r\n }\r\n\r\n if (staticDatafieldMap.get(type) == null) {\r\n staticDatafieldMap.put(type, Information.getDatafieldsOfNode(type));\r\n }\r\n }",
"private void placesInit()\n {\n\n for(Map.Entry<String,Place> placeEntry: placesMap.entrySet())\n {\n addPlace(placeEntry.getKey(),placeEntry.getValue());\n }\n\n }",
"public static Map createUserViewMap(Map fieldsMap) {\n if (!fieldsMap.isEmpty() && fieldsMap != null) {\n Map userMap = new LinkedHashMap<>();\n\n fieldsMap.forEach((k, v) -> {\n if (!StringUtils.contains((String) k, \"tablename\")) {\n userMap.put(k, v);\n }\n });\n return userMap;\n\n } else {\n return new LinkedHashMap<>();\n }\n }",
"public static Map<String, Byte> genNameToTypeMap(){\n byte[] types = genAllTypes();\n String[] names = genAllTypeNames();\n Map<String, Byte> ret = new HashMap<String, Byte>();\n for(int i=0;i<types.length;i++){\n ret.put(names[i], types[i]);\n }\n return ret;\n }",
"@Override\r\n\tpublic List<LPMapdataDto> mapSelectType(String type) {\n\t\treturn sqlSession.selectList(\"days.map_SelectType\", type);\r\n\t}",
"public Map<String, Boolean> getIsTypeOptionValidMap() {\n if (typeOptionValidMap == null) {\n typeOptionValidMap = new HashMap<String, Boolean>() {\n @Override\n public Boolean get(Object key) {\n return !(key == null || \"\".equals(key.toString().trim()) || countKeyOccurence(typeOptions, (String) key) > 1);\n }\n };\n }\n return typeOptionValidMap;\n }",
"private void loadItemsMaps()\n {\n _icons=new HashMap<String,List<Item>>(); \n _names=new HashMap<String,List<Item>>(); \n List<Item> items=ItemsManager.getInstance().getAllItems();\n for(Item item : items)\n {\n String icon=item.getIcon();\n if (icon!=null)\n {\n registerMapping(_icons,icon,item);\n String mainIconId=icon.substring(0,icon.indexOf('-'));\n registerMapping(_icons,mainIconId,item);\n String name=item.getName();\n registerMapping(_names,name,item);\n }\n }\n }",
"public Map<EventKey, EventMethod> createEventMap() {\n\t\tfinal Map<EventKey, EventMethod> eventMap = new EnumMap<>(EventKey.class);\n\t\tfinal Pair<Map<String, Object>, Set<Class<?>>> eventPair = prepareEventPair();\n\n\t\tfor (Class<?> eventClass : eventPair.getSecond()) {\n\t\t\tfor (Method eventMethod : prepareEventMethods(eventClass)) {\n\t\t\t\teventMap.put(eventMethod.getAnnotation(EventMapping.class).key(),\n\t\t\t\t\t\tnew EventMethod(eventPair.getFirst().get(eventClass.getName()), eventMethod));\n\t\t\t}\n\t\t}\n\t\treturn eventMap;\n\t}",
"public List<Map> pageTest(Map map) {\n\t\treturn iSBookMapper.pageTest(map);\n\t}",
"private LinkedHashMap<String, Type> scalarMappingODU() {\r\n\t\tLinkedHashMap<String, Type> scalarMapping = new LinkedHashMap<String, Type>();\r\n\t\tscalarMapping.put(DaoConstants.MAP_ODUID, StandardBasicTypes.LONG); // 0\r\n\t\tscalarMapping.put(DaoConstants.MAP_SITE_GROUP,\r\n\t\t\t\tStandardBasicTypes.STRING); // 1\r\n\t\tscalarMapping.put(DaoConstants.MAP_PARENT_CHILD,\r\n\t\t\t\tStandardBasicTypes.STRING); // 2\r\n\t\tscalarMapping.put(DaoConstants.MAP_NAME, StandardBasicTypes.STRING); // 3\r\n\t\tscalarMapping.put(DaoConstants.MAP_CENTRAL_ADDRESS,\r\n\t\t\t\tStandardBasicTypes.STRING); // 4\r\n\t\tscalarMapping.put(DaoConstants.MAP_PARENT_ID, StandardBasicTypes.LONG); // 5\r\n\t\tscalarMapping.put(DaoConstants.MAP_TYPE, StandardBasicTypes.STRING); // 6\r\n\t\tscalarMapping.put(DaoConstants.MAP_SVGMAXLATITUDE,\r\n\t\t\t\tStandardBasicTypes.DOUBLE); // 7\r\n\t\tscalarMapping.put(DaoConstants.MAP_SVGMAXLONGITUDE,\r\n\t\t\t\tStandardBasicTypes.DOUBLE); // 8\r\n\t\tscalarMapping.put(DaoConstants.MAP_SVGMINLATITUDE,\r\n\t\t\t\tStandardBasicTypes.DOUBLE); // 9\r\n\t\tscalarMapping.put(DaoConstants.MAP_SVGMINLONGITUDE,\r\n\t\t\t\tStandardBasicTypes.DOUBLE); // 10\r\n\t\tscalarMapping.put(DaoConstants.MAP_ODU_SVG_PATH,\r\n\t\t\t\tStandardBasicTypes.STRING); // 11\r\n\t\tscalarMapping.put(DaoConstants.MAP_SEVERITY, StandardBasicTypes.STRING); // 12\r\n\t\tscalarMapping.put(DaoConstants.MAP_SLINKADD, StandardBasicTypes.STRING); // 13\r\n\t\tscalarMapping.put(DaoConstants.MAP_ALARM_CODE,\r\n\t\t\t\tStandardBasicTypes.STRING); // 14\r\n\t\tscalarMapping.put(DaoConstants.MAP_C2, StandardBasicTypes.DOUBLE); // 15\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Outdoor\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Temp\r\n\t\tscalarMapping\r\n\t\t\t\t.put(DaoConstants.MAP_THRESHOLD_1, StandardBasicTypes.LONG); // 16\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// CompressorWorkingHrs_1\r\n\t\tscalarMapping\r\n\t\t\t\t.put(DaoConstants.MAP_THRESHOLD_2, StandardBasicTypes.LONG); // 17\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// CompressorWorkingHrs_2\r\n\t\tscalarMapping\r\n\t\t\t\t.put(DaoConstants.MAP_THRESHOLD_3, StandardBasicTypes.LONG); // 18\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// CompressorWorkingHrs_3\r\n\t\tscalarMapping\r\n\t\t\t\t.put(DaoConstants.MAP_THRESHOLD_4, StandardBasicTypes.LONG); // 19\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// PAC\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// CompressorWorkingHrs\r\n\t\tscalarMapping\r\n\t\t\t\t.put(DaoConstants.MAP_THRESHOLD_5, StandardBasicTypes.LONG); // 20\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// EngineWorkingHrs\r\n\t\tscalarMapping\r\n\t\t\t\t.put(DaoConstants.MAP_THRESHOLD_6, StandardBasicTypes.LONG); // 21\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// NOT_IN_USE_EnginOilChange\r\n\t\tscalarMapping.put(DaoConstants.MAP_G44, StandardBasicTypes.STRING); // 22\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// GenerationPower\r\n\t\tscalarMapping.put(DaoConstants.MAP_SVGID, StandardBasicTypes.LONG); // 23\r\n\t\tscalarMapping.put(DaoConstants.MAP_SVGNAME, StandardBasicTypes.STRING); // 24\r\n\t\tscalarMapping.put(DaoConstants.MAP_VRFHRS1, StandardBasicTypes.DOUBLE); // 25\r\n\t\tscalarMapping.put(DaoConstants.MAP_VRFHRS2, StandardBasicTypes.DOUBLE); // 26\r\n\t\tscalarMapping.put(DaoConstants.MAP_VRFHRS3, StandardBasicTypes.DOUBLE); // 27\r\n\t\tscalarMapping.put(DaoConstants.MAP_PACHRS, StandardBasicTypes.DOUBLE); // 28\r\n\t\tscalarMapping.put(DaoConstants.MAP_GHPHRS, StandardBasicTypes.DOUBLE); // 29\r\n\t\tscalarMapping.put(DaoConstants.MAP_GHPOIL, StandardBasicTypes.DOUBLE); // 30\r\n\t\tscalarMapping.put(DaoConstants.MAP_SITEPATH, StandardBasicTypes.STRING); // 31\r\n\t\tscalarMapping.put(DaoConstants.MAP_COMPANYNAME,\r\n\t\t\t\tStandardBasicTypes.STRING); // 32\r\n\t\tscalarMapping.put(DaoConstants.MAP_CASTATUS, StandardBasicTypes.STRING); // 33\r\n\t\tscalarMapping.put(DaoConstants.MAP_V23, StandardBasicTypes.STRING); // 34\r\n\t\t// Demand\r\n\t\tscalarMapping.put(DaoConstants.MAP_COMPRESSOR1,\r\n\t\t\t\tStandardBasicTypes.BOOLEAN); // 35\r\n\t\tscalarMapping.put(DaoConstants.MAP_COMPRESSOR2,\r\n\t\t\t\tStandardBasicTypes.BOOLEAN); // 36\r\n\t\tscalarMapping.put(DaoConstants.MAP_COMPRESSOR3,\r\n\t\t\t\tStandardBasicTypes.BOOLEAN); // 37\r\n\t\t//add by shanf\r\n\t\tscalarMapping.put(DaoConstants.DEVICE_MODEL,\r\n\t\t\t\tStandardBasicTypes.STRING); // 38\r\n\r\n\t\treturn scalarMapping;\r\n\t}",
"@RequestMapping(value = \"/restful/referenceslist\", method = RequestMethod.GET)\n public SortedMap<Long,String> getReferencesByType(@RequestParam(value=\"referenceType\") String referenceType, Locale locale) {\n\t\tlogger.info(\"Inside getReferencesByType() method...\");\n\t\tSortedMap<Long,String> returnValue = new TreeMap<Long,String>();\n\t\t\n\t\tswitch (referenceType) {\n\t\t\n\t\t\tcase(\"IrelandCounty\"):\n\t\t\t\tMap<Long, String> irelandCountyMap = referenceStore.getIrelandCounty(); \n\t\t\t\tSortedMap<Long, String> localizedIrelandCountyMap = new TreeMap<Long, String>(irelandCountyMap);\n\t\t\t\tfor (Map.Entry<Long, String> entry : localizedIrelandCountyMap.entrySet()) {\n\t\t\t\t\tlocalizedIrelandCountyMap.replace(entry.getKey(), messageSource.getMessage(entry.getValue(), new String[0], locale));\n\t\t\t\t}\n\t\t\t\treturnValue = localizedIrelandCountyMap;\n\t\t\t\tbreak;\n\t\t \n\t\t\n\t\t\tcase(\"AccommodationType\"):\n\t\t\t\tMap<Long, String> accommodationTypeMap = referenceStore.getAccommodationType(); \n\t\t\t\tSortedMap<Long, String> localizedAccommodationTypeMap = new TreeMap<Long, String>(accommodationTypeMap);\n\t\t\t\tfor (Map.Entry<Long, String> entry : localizedAccommodationTypeMap.entrySet()) {\n\t\t\t\t\tlocalizedAccommodationTypeMap.replace(entry.getKey(), messageSource.getMessage(entry.getValue(), new String[0], locale));\n\t\t\t\t}\n\t\t\t\treturnValue = localizedAccommodationTypeMap;\n\t\t\t\tbreak;\n\t\t \n\t\t\n\t\t\tcase(\"AccommodationCondition\"):\n\t\t\t\tMap<Long, String> accommodationConditionMap = referenceStore.getAccommodationCondition(); \n\t\t\t\tSortedMap<Long, String> localizedAccommodationConditionMap = new TreeMap<Long, String>(accommodationConditionMap);\n\t\t\t\tfor (Map.Entry<Long, String> entry : localizedAccommodationConditionMap.entrySet()) {\n\t\t\t\t\tlocalizedAccommodationConditionMap.replace(entry.getKey(), messageSource.getMessage(entry.getValue(), new String[0], locale));\n\t\t\t\t}\n\t\t\t\treturnValue = localizedAccommodationConditionMap;\n\t\t\t\tbreak;\n\t\t \n\t\t\n\t\t\tcase(\"NumberOfBeds\"):\n\t\t\t\tMap<Long, String> numberOfBedsMap = referenceStore.getNumberOfBeds(); \n\t\t\t\tSortedMap<Long, String> localizedNumberOfBedsMap = new TreeMap<Long, String>(numberOfBedsMap);\n\t\t\t\tfor (Map.Entry<Long, String> entry : localizedNumberOfBedsMap.entrySet()) {\n\t\t\t\t\tlocalizedNumberOfBedsMap.replace(entry.getKey(), messageSource.getMessage(entry.getValue(), new String[0], locale));\n\t\t\t\t}\n\t\t\t\treturnValue = localizedNumberOfBedsMap;\n\t\t\t\tbreak;\n\t\t \n\t\t\n\t\t\tcase(\"VacantOrShared\"):\n\t\t\t\tMap<Long, String> vacantOrSharedMap = referenceStore.getVacantOrShared(); \n\t\t\t\tSortedMap<Long, String> localizedVacantOrSharedMap = new TreeMap<Long, String>(vacantOrSharedMap);\n\t\t\t\tfor (Map.Entry<Long, String> entry : localizedVacantOrSharedMap.entrySet()) {\n\t\t\t\t\tlocalizedVacantOrSharedMap.replace(entry.getKey(), messageSource.getMessage(entry.getValue(), new String[0], locale));\n\t\t\t\t}\n\t\t\t\treturnValue = localizedVacantOrSharedMap;\n\t\t\t\tbreak;\n\t\t \n\t\t\n\t\t\tcase(\"YouCanAccommodate\"):\n\t\t\t\tMap<Long, String> youCanAccommodateMap = referenceStore.getYouCanAccommodate(); \n\t\t\t\tSortedMap<Long, String> localizedYouCanAccommodateMap = new TreeMap<Long, String>(youCanAccommodateMap);\n\t\t\t\tfor (Map.Entry<Long, String> entry : localizedYouCanAccommodateMap.entrySet()) {\n\t\t\t\t\tlocalizedYouCanAccommodateMap.replace(entry.getKey(), messageSource.getMessage(entry.getValue(), new String[0], locale));\n\t\t\t\t}\n\t\t\t\treturnValue = localizedYouCanAccommodateMap;\n\t\t\t\tbreak;\n\t\t \n\t\t\n\t\t\tcase(\"LocalAmenity\"):\n\t\t\t\tMap<Long, String> localAmenityMap = referenceStore.getLocalAmenity(); \n\t\t\t\tSortedMap<Long, String> localizedLocalAmenityMap = new TreeMap<Long, String>(localAmenityMap);\n\t\t\t\tfor (Map.Entry<Long, String> entry : localizedLocalAmenityMap.entrySet()) {\n\t\t\t\t\tlocalizedLocalAmenityMap.replace(entry.getKey(), messageSource.getMessage(entry.getValue(), new String[0], locale));\n\t\t\t\t}\n\t\t\t\treturnValue = localizedLocalAmenityMap;\n\t\t\t\tbreak;\n\t\t \n\t\t\n\t\t\tcase(\"MonthRange\"):\n\t\t\t\tMap<Long, String> monthRangeMap = referenceStore.getMonthRange(); \n\t\t\t\tSortedMap<Long, String> localizedMonthRangeMap = new TreeMap<Long, String>(monthRangeMap);\n\t\t\t\tfor (Map.Entry<Long, String> entry : localizedMonthRangeMap.entrySet()) {\n\t\t\t\t\tlocalizedMonthRangeMap.replace(entry.getKey(), messageSource.getMessage(entry.getValue(), new String[0], locale));\n\t\t\t\t}\n\t\t\t\treturnValue = localizedMonthRangeMap;\n\t\t\t\tbreak;\n\t\t \n\t\t\n\t\t\tcase(\"Yes_No\"):\n\t\t\t\tMap<Long, String> yes_NoMap = referenceStore.getYes_No(); \n\t\t\t\tSortedMap<Long, String> localizedYes_NoMap = new TreeMap<Long, String>(yes_NoMap);\n\t\t\t\tfor (Map.Entry<Long, String> entry : localizedYes_NoMap.entrySet()) {\n\t\t\t\t\tlocalizedYes_NoMap.replace(entry.getKey(), messageSource.getMessage(entry.getValue(), new String[0], locale));\n\t\t\t\t}\n\t\t\t\treturnValue = localizedYes_NoMap;\n\t\t\t\tbreak;\n\t\t \n\t\t\n\t\t\tcase(\"EuropeCountry\"):\n\t\t\t\tMap<Long, String> europeCountryMap = referenceStore.getEuropeCountry(); \n\t\t\t\tSortedMap<Long, String> localizedEuropeCountryMap = new TreeMap<Long, String>(europeCountryMap);\n\t\t\t\tfor (Map.Entry<Long, String> entry : localizedEuropeCountryMap.entrySet()) {\n\t\t\t\t\tlocalizedEuropeCountryMap.replace(entry.getKey(), messageSource.getMessage(entry.getValue(), new String[0], locale));\n\t\t\t\t}\n\t\t\t\treturnValue = localizedEuropeCountryMap;\n\t\t\t\tbreak;\n\t\t \n\t\t\n\t\t\tcase(\"Facilities\"):\n\t\t\t\tMap<Long, String> facilitiesMap = referenceStore.getFacilities(); \n\t\t\t\tSortedMap<Long, String> localizedFacilitiesMap = new TreeMap<Long, String>(facilitiesMap);\n\t\t\t\tfor (Map.Entry<Long, String> entry : localizedFacilitiesMap.entrySet()) {\n\t\t\t\t\tlocalizedFacilitiesMap.replace(entry.getKey(), messageSource.getMessage(entry.getValue(), new String[0], locale));\n\t\t\t\t}\n\t\t\t\treturnValue = localizedFacilitiesMap;\n\t\t\t\tbreak;\n\t\t \n\t\t\n\t\t\tcase(\"IntegerCount1to40\"):\n\t\t\t\tMap<Long, String> integerCount1to40Map = referenceStore.getIntegerCount1to40(); \n\t\t\t\tSortedMap<Long, String> localizedIntegerCount1to40Map = new TreeMap<Long, String>(integerCount1to40Map);\n\t\t\t\tfor (Map.Entry<Long, String> entry : localizedIntegerCount1to40Map.entrySet()) {\n\t\t\t\t\tlocalizedIntegerCount1to40Map.replace(entry.getKey(), messageSource.getMessage(entry.getValue(), new String[0], locale));\n\t\t\t\t}\n\t\t\t\treturnValue = localizedIntegerCount1to40Map;\n\t\t\t\tbreak;\n\t\t \n\t\t\n\t\t\tcase(\"PledgeServiceLevelOne\"):\n\t\t\t\tMap<Long, String> pledgeServiceLevelOneMap = referenceStore.getPledgeServiceLevelOne(); \n\t\t\t\tSortedMap<Long, String> localizedPledgeServiceLevelOneMap = new TreeMap<Long, String>(pledgeServiceLevelOneMap);\n\t\t\t\tfor (Map.Entry<Long, String> entry : localizedPledgeServiceLevelOneMap.entrySet()) {\n\t\t\t\t\tlocalizedPledgeServiceLevelOneMap.replace(entry.getKey(), messageSource.getMessage(entry.getValue(), new String[0], locale));\n\t\t\t\t}\n\t\t\t\treturnValue = localizedPledgeServiceLevelOneMap;\n\t\t\t\tbreak;\n\t\t \n\t\t\n\t\t\tcase(\"PledgeServiceLevelTwo\"):\n\t\t\t\tMap<Long, String> pledgeServiceLevelTwoMap = referenceStore.getPledgeServiceLevelTwo(); \n\t\t\t\tSortedMap<Long, String> localizedPledgeServiceLevelTwoMap = new TreeMap<Long, String>(pledgeServiceLevelTwoMap);\n\t\t\t\tfor (Map.Entry<Long, String> entry : localizedPledgeServiceLevelTwoMap.entrySet()) {\n\t\t\t\t\tlocalizedPledgeServiceLevelTwoMap.replace(entry.getKey(), messageSource.getMessage(entry.getValue(), new String[0], locale));\n\t\t\t\t}\n\t\t\t\treturnValue = localizedPledgeServiceLevelTwoMap;\n\t\t\t\tbreak;\n\t\t \n\t\t\n\t\t\tcase(\"GoodsCategoryOne\"):\n\t\t\t\tMap<Long, String> goodsCategoryOneMap = referenceStore.getGoodsCategoryOne(); \n\t\t\t\tSortedMap<Long, String> localizedGoodsCategoryOneMap = new TreeMap<Long, String>(goodsCategoryOneMap);\n\t\t\t\tfor (Map.Entry<Long, String> entry : localizedGoodsCategoryOneMap.entrySet()) {\n\t\t\t\t\tlocalizedGoodsCategoryOneMap.replace(entry.getKey(), messageSource.getMessage(entry.getValue(), new String[0], locale));\n\t\t\t\t}\n\t\t\t\treturnValue = localizedGoodsCategoryOneMap;\n\t\t\t\tbreak;\n\t\t \n\t\t\n\t\t\tcase(\"GoodsCategoryTwo\"):\n\t\t\t\tMap<Long, String> goodsCategoryTwoMap = referenceStore.getGoodsCategoryTwo(); \n\t\t\t\tSortedMap<Long, String> localizedGoodsCategoryTwoMap = new TreeMap<Long, String>(goodsCategoryTwoMap);\n\t\t\t\tfor (Map.Entry<Long, String> entry : localizedGoodsCategoryTwoMap.entrySet()) {\n\t\t\t\t\tlocalizedGoodsCategoryTwoMap.replace(entry.getKey(), messageSource.getMessage(entry.getValue(), new String[0], locale));\n\t\t\t\t}\n\t\t\t\treturnValue = localizedGoodsCategoryTwoMap;\n\t\t\t\tbreak;\n\t\t \n\t\t\n\t\t\tcase(\"GoodsCondition\"):\n\t\t\t\tMap<Long, String> goodsConditionMap = referenceStore.getGoodsCondition(); \n\t\t\t\tSortedMap<Long, String> localizedGoodsConditionMap = new TreeMap<Long, String>(goodsConditionMap);\n\t\t\t\tfor (Map.Entry<Long, String> entry : localizedGoodsConditionMap.entrySet()) {\n\t\t\t\t\tlocalizedGoodsConditionMap.replace(entry.getKey(), messageSource.getMessage(entry.getValue(), new String[0], locale));\n\t\t\t\t}\n\t\t\t\treturnValue = localizedGoodsConditionMap;\n\t\t\t\tbreak;\n\t\t \n\t\t\n\t\t\tcase(\"OwnerOccupierType\"):\n\t\t\t\tMap<Long, String> ownerOccupierTypeMap = referenceStore.getOwnerOccupierType(); \n\t\t\t\tSortedMap<Long, String> localizedOwnerOccupierTypeMap = new TreeMap<Long, String>(ownerOccupierTypeMap);\n\t\t\t\tfor (Map.Entry<Long, String> entry : localizedOwnerOccupierTypeMap.entrySet()) {\n\t\t\t\t\tlocalizedOwnerOccupierTypeMap.replace(entry.getKey(), messageSource.getMessage(entry.getValue(), new String[0], locale));\n\t\t\t\t}\n\t\t\t\treturnValue = localizedOwnerOccupierTypeMap;\n\t\t\t\tbreak;\n\t\t \n\t\t\n\t\t\tcase(\"Locale\"):\n\t\t\t\tMap<Long, String> localeMap = referenceStore.getLocale(); \n\t\t\t\tSortedMap<Long, String> localizedLocaleMap = new TreeMap<Long, String>(localeMap);\n\t\t\t\tfor (Map.Entry<Long, String> entry : localizedLocaleMap.entrySet()) {\n\t\t\t\t\tlocalizedLocaleMap.replace(entry.getKey(), messageSource.getMessage(entry.getValue(), new String[0], locale));\n\t\t\t\t}\n\t\t\t\treturnValue = localizedLocaleMap;\n\t\t\t\tbreak;\n\t\t \n\t\t\n\t\t\tcase(\"UserRole\"):\n\t\t\t\tMap<Long, String> userRoleMap = referenceStore.getUserRole(); \n\t\t\t\tSortedMap<Long, String> localizedUserRoleMap = new TreeMap<Long, String>(userRoleMap);\n\t\t\t\tfor (Map.Entry<Long, String> entry : localizedUserRoleMap.entrySet()) {\n\t\t\t\t\tlocalizedUserRoleMap.replace(entry.getKey(), messageSource.getMessage(entry.getValue(), new String[0], locale));\n\t\t\t\t}\n\t\t\t\treturnValue = localizedUserRoleMap;\n\t\t\t\tbreak;\n\t\t \n\t\t\n\t\t\tcase(\"PledgeServiceLevelThree\"):\n\t\t\t\tMap<Long, String> pledgeServiceLevelThreeMap = referenceStore.getPledgeServiceLevelThree(); \n\t\t\t\tSortedMap<Long, String> localizedPledgeServiceLevelThreeMap = new TreeMap<Long, String>(pledgeServiceLevelThreeMap);\n\t\t\t\tfor (Map.Entry<Long, String> entry : localizedPledgeServiceLevelThreeMap.entrySet()) {\n\t\t\t\t\tlocalizedPledgeServiceLevelThreeMap.replace(entry.getKey(), messageSource.getMessage(entry.getValue(), new String[0], locale));\n\t\t\t\t}\n\t\t\t\treturnValue = localizedPledgeServiceLevelThreeMap;\n\t\t\t\tbreak;\n\t\t \n\t\t\n\t\t\tcase(\"GoodsCategoryThree\"):\n\t\t\t\tMap<Long, String> goodsCategoryThreeMap = referenceStore.getGoodsCategoryThree(); \n\t\t\t\tSortedMap<Long, String> localizedGoodsCategoryThreeMap = new TreeMap<Long, String>(goodsCategoryThreeMap);\n\t\t\t\tfor (Map.Entry<Long, String> entry : localizedGoodsCategoryThreeMap.entrySet()) {\n\t\t\t\t\tlocalizedGoodsCategoryThreeMap.replace(entry.getKey(), messageSource.getMessage(entry.getValue(), new String[0], locale));\n\t\t\t\t}\n\t\t\t\treturnValue = localizedGoodsCategoryThreeMap;\n\t\t\t\tbreak;\n\t\t \n\t\t\n\t\t\tcase(\"GoodsSize\"):\n\t\t\t\tMap<Long, String> goodsSizeMap = referenceStore.getGoodsSize(); \n\t\t\t\tSortedMap<Long, String> localizedGoodsSizeMap = new TreeMap<Long, String>(goodsSizeMap);\n\t\t\t\tfor (Map.Entry<Long, String> entry : localizedGoodsSizeMap.entrySet()) {\n\t\t\t\t\tlocalizedGoodsSizeMap.replace(entry.getKey(), messageSource.getMessage(entry.getValue(), new String[0], locale));\n\t\t\t\t}\n\t\t\t\treturnValue = localizedGoodsSizeMap;\n\t\t\t\tbreak;\n\t\t \n\t\t\n\t\t\tcase(\"GoodsQuantity\"):\n\t\t\t\tMap<Long, String> goodsQuantityMap = referenceStore.getGoodsQuantity(); \n\t\t\t\tSortedMap<Long, String> localizedGoodsQuantityMap = new TreeMap<Long, String>(goodsQuantityMap);\n\t\t\t\tfor (Map.Entry<Long, String> entry : localizedGoodsQuantityMap.entrySet()) {\n\t\t\t\t\tlocalizedGoodsQuantityMap.replace(entry.getKey(), messageSource.getMessage(entry.getValue(), new String[0], locale));\n\t\t\t\t}\n\t\t\t\treturnValue = localizedGoodsQuantityMap;\n\t\t\t\tbreak;\n\t\t \n\t\t\n\t\t\tcase(\"NewOrUsed\"):\n\t\t\t\tMap<Long, String> newOrUsedMap = referenceStore.getNewOrUsed(); \n\t\t\t\tSortedMap<Long, String> localizedNewOrUsedMap = new TreeMap<Long, String>(newOrUsedMap);\n\t\t\t\tfor (Map.Entry<Long, String> entry : localizedNewOrUsedMap.entrySet()) {\n\t\t\t\t\tlocalizedNewOrUsedMap.replace(entry.getKey(), messageSource.getMessage(entry.getValue(), new String[0], locale));\n\t\t\t\t}\n\t\t\t\treturnValue = localizedNewOrUsedMap;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase(\"TravelAbility\"):\n\t\t\t\tMap<Long, String> travelAbilityMap = referenceStore.getTravelAbilities(); \n\t\t\t\tSortedMap<Long, String> localizedTravelAbilityMap = new TreeMap<Long, String>(travelAbilityMap);\n\t\t\t\tfor (Map.Entry<Long, String> entry : localizedTravelAbilityMap.entrySet()) {\n\t\t\t\t\tlocalizedTravelAbilityMap.replace(entry.getKey(), messageSource.getMessage(entry.getValue(), new String[0], locale));\n\t\t\t\t}\n\t\t\t\treturnValue = localizedTravelAbilityMap;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase(\"PledgeStatus\"):\n\t\t\t\tMap<Long, String> sMap = referenceStore.getPledgeStatuses(); \n\t\t\t\tSortedMap<Long, String> localizedsMap = new TreeMap<Long, String>(sMap);\n\t\t\t\tfor (Map.Entry<Long, String> entry : localizedsMap.entrySet()) {\n\t\t\t\t\tlocalizedsMap.replace(entry.getKey(), messageSource.getMessage(entry.getValue(), new String[0], locale));\n\t\t\t\t}\n\t\t\t\treturnValue = localizedsMap;\n\t\t\t\tbreak;\n\t\t \n\t\t\n\t\t\tdefault:\n\t\t\t\treturnValue.put(Long.valueOf(-1), \"Internal Fault\");\n \t}\n\n \treturn returnValue;\n }",
"private void init_game_classes(){\n game_classes = new HashMap<Integer,Category_components>();\n game_classes.put(0,new Game_adverbs(game_class_init_context));\n game_classes.put(1,new Game_alphabets(game_class_init_context));\n game_classes.put(2,new Game_attachments(game_class_init_context));\n game_classes.put(3,new Game_numbers(game_class_init_context));\n game_classes.put(4,new Game_pronoun(game_class_init_context));\n\n\n }",
"public Map<String, List<Map<String, String>>> populateInnerPagesDataStructures(Map<Object, Object> map,XLS_Reader current_Suite_TC_Xls) {\n\n\t\tMap<String, List<Map<String, String>>> temp_Structure_of_InnerPagesMaps = new HashMap<>();\n\t\tList<String> innerDataIds = null;\n\t\tString sheet_name = null;\n\t\tint count;\n\t\t// Map<List<String>,List<List<String>>> map_of_list= new HashMap<>();\n\t\tinnerDataIds = new ArrayList<>();\n\t\tfor (Object key : map.keySet()) {\n\t\t\tif (((String) map.get(key)).contains(\";\")) {\n\t\t\t\tcount=0;\n\t\t\t\tString dataIds[] = ((String) map.get(key)).split(\";\");\n\t\t\t\tfor (String dataId : dataIds) {\n\t\t\t\t\tinnerDataIds.add(dataId);\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t\tString[] sheet_tokens = dataIds[0].split(\"_\");\n\t\t\t\tsheet_name = sheet_tokens[0];\n\t\t\t\tcommon.no_of_inner_data_sets.put(sheet_name, count);\n\t\t\t\t\n\t\t\t\t//populateListOfMaps(sheet_name, innerDataIds, current_Suite_TC_Xls);\n\t\t\t\t//Populate list of inner maps data\n\t\t\t\tList<Map<String, String>> list_of_Maps = new ArrayList<>();\n\t\t\t\tMap<String, String> temp_Map = new HashMap<String, String>();\n\t\t\t\tfor (String dataID : innerDataIds) {\n\t\t\t\t\ttemp_Map = TestUtil.getTestDataSetMap_Column_String_Map(current_Suite_TC_Xls, dataID);\n\t\t\t\t\tlist_of_Maps.add(temp_Map);\n\t\t\t\t}\n\t\t\t\ttemp_Structure_of_InnerPagesMaps.put(sheet_name, list_of_Maps);\n\t\t\n\t\t\t} else {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tinnerDataIds.clear();\n\t\t}\n\t\t//System.out.println(common.no_of_inner_data_sets);\n\t\treturn temp_Structure_of_InnerPagesMaps;\n\t}",
"protected Map createMapMatchingType(MappingContext mappingContext) {\n Class<?> mapType = mappingContext.getTypeInformation().getSafeToWriteClass();\n if (mapType.isAssignableFrom(LinkedHashMap.class)) {\n return new LinkedHashMap();\n } else if (mapType.isAssignableFrom(TreeMap.class)) {\n return new TreeMap();\n } else {\n throw new ConfigMeMapperException(mappingContext, \"Unsupported map type '\" + mapType + \"'\");\n }\n }",
"private void mapValues() {\n\t\tmap.put(1, \"I\");\r\n\t\tmap.put(5, \"V\");\r\n\t\tmap.put(10, \"X\");\r\n\t\tmap.put(50, \"L\");\r\n\t\tmap.put(100, \"C\");\r\n\t\tmap.put(500, \"D\");\r\n\t\tmap.put(1000, \"M\");\r\n\t}",
"synchronized public Map<String, Set<String>> getTypes() {\n return Collections.unmodifiableMap(\n new HashSet<>(types.entrySet()).stream()\n .collect(Collectors.toMap(\n Map.Entry::getKey,\n e -> Collections.unmodifiableSet(new HashSet<>(e.getValue()))\n ))\n );\n }",
"private void populateViewCollections() {\n\n\t}",
"private void initCountMap() {\n\t\tcountMap.put(\"cells.BlueSchellingCell\", 0);\n\t\tcountMap.put(\"cells.OrangeSchellingCell\", 0);\n\t\tcountMap.put(\"cells.LiveCell\", 0);\n\t\tcountMap.put(\"cells.DeadCell\", 0);\n\t\tcountMap.put(\"cells.TreeCell\", 0);\n\t\tcountMap.put(\"cells.BurningTreeCell\", 0);\n\t\tcountMap.put(\"cells.EmptyLandCell\", 0);\n\t\tcountMap.put(\"cells.EmptyCell\", 0);\n\t\tcountMap.put(\"cells.SharkCell\", 0);\n\t\tcountMap.put(\"cells.FishCell\", 0);\n\t\tcountMap.put(\"cells.AntGroupCell\", 0);\n\t\tcountMap.put(\"cells.BlueRPSCell\", 0);\n\t\tcountMap.put(\"cells.GreenRPSCell\", 0);\n\t\tcountMap.put(\"cells.RedRPSCell\", 0);\n\t\tcountMap.put(\"cells.WhiteRPSCell\", 0);\n\t}",
"public final List<TimeKey> mo13029a(Map<String, ? extends Map<String, String>> map) {\n ArrayList arrayList = new ArrayList(map.size());\n for (Map.Entry next : map.entrySet()) {\n Map map2 = (Map) next.getValue();\n Object obj = map2.get(\"encrypted_mobile_id\");\n if (obj != null) {\n String str = (String) obj;\n Object obj2 = map2.get(\"fromDate\");\n if (obj2 != null) {\n long roundToLong = MathKt.roundToLong(((Double) obj2).doubleValue());\n Object obj3 = map2.get(\"tillDate\");\n if (obj3 != null) {\n arrayList.add(new TimeKey((String) next.getKey(), str, TimeKey.DEFAULT_NAME, roundToLong, MathKt.roundToLong(((Double) obj3).doubleValue()), 0, 32, (DefaultConstructorMarker) null));\n } else {\n throw new NullPointerException(\"null cannot be cast to non-null type kotlin.Double\");\n }\n } else {\n throw new NullPointerException(\"null cannot be cast to non-null type kotlin.Double\");\n }\n } else {\n throw new NullPointerException(\"null cannot be cast to non-null type kotlin.String\");\n }\n }\n return arrayList;\n }",
"protected Map<String, DataFilter> getFilterMap(Collection<? extends String> keys)\r\n {\r\n Map<String, DataFilter> filterMap = New.map();\r\n for (String key : keys)\r\n {\r\n filterMap.put(key, myToolbox.getDataFilterRegistry().getLoadFilter(key));\r\n }\r\n return filterMap;\r\n }",
"protected List<Map<String, List<String>>> createDefaultBoxAceMapList() {\n List<Map<String, List<String>>> list = new ArrayList<Map<String, List<String>>>();\n\n // role2\n List<String> rolList = new ArrayList<String>();\n Map<String, List<String>> map = new HashMap<String, List<String>>();\n rolList.add(\"read\");\n map.put(UrlUtils.aclRelativePath(Box.MAIN_BOX_NAME, \"role2\"), rolList);\n list.add(map);\n\n // role3\n rolList = new ArrayList<String>();\n map = new HashMap<String, List<String>>();\n rolList.add(\"write\");\n map.put(UrlUtils.aclRelativePath(Box.MAIN_BOX_NAME, \"role3\"), rolList);\n list.add(map);\n\n // role4\n rolList = new ArrayList<String>();\n map = new HashMap<String, List<String>>();\n rolList.add(\"read\");\n rolList.add(\"write\");\n map.put(UrlUtils.aclRelativePath(Box.MAIN_BOX_NAME, \"role4\"), rolList);\n list.add(map);\n\n // role5\n rolList = new ArrayList<String>();\n map = new HashMap<String, List<String>>();\n rolList.add(\"exec\");\n map.put(UrlUtils.aclRelativePath(Box.MAIN_BOX_NAME, \"role5\"), rolList);\n list.add(map);\n\n // role6\n rolList = new ArrayList<String>();\n map = new HashMap<String, List<String>>();\n rolList.add(\"read-acl\");\n map.put(UrlUtils.aclRelativePath(Box.MAIN_BOX_NAME, \"role6\"), rolList);\n list.add(map);\n\n // role7\n rolList = new ArrayList<String>();\n map = new HashMap<String, List<String>>();\n rolList.add(\"write-acl\");\n map.put(UrlUtils.aclRelativePath(Box.MAIN_BOX_NAME, \"role7\"), rolList);\n list.add(map);\n\n // role8\n rolList = new ArrayList<String>();\n map = new HashMap<String, List<String>>();\n rolList.add(\"write-properties\");\n map.put(UrlUtils.aclRelativePath(Box.MAIN_BOX_NAME, \"role8\"), rolList);\n list.add(map);\n\n // role9\n rolList = new ArrayList<String>();\n map = new HashMap<String, List<String>>();\n rolList.add(\"read-properties\");\n map.put(UrlUtils.aclRelativePath(Box.MAIN_BOX_NAME, \"role9\"), rolList);\n list.add(map);\n\n return list;\n }",
"private void initializePermissionsMap() {\n }",
"@Override\n\tprotected Map getKeyMethodMap() {\n\t\treturn null;\n\t}"
] | [
"0.56517774",
"0.5625258",
"0.55136615",
"0.55048823",
"0.5482128",
"0.53983116",
"0.5363409",
"0.5351814",
"0.5334618",
"0.5320108",
"0.5304789",
"0.5262135",
"0.5258187",
"0.5227986",
"0.5223821",
"0.5189602",
"0.5173914",
"0.5156767",
"0.51258487",
"0.5122245",
"0.51208395",
"0.5107687",
"0.5100114",
"0.50963795",
"0.50947857",
"0.5093581",
"0.50746226",
"0.50597405",
"0.5055141",
"0.5047952",
"0.4990793",
"0.49593285",
"0.49534658",
"0.49329832",
"0.49241287",
"0.49204215",
"0.49018005",
"0.4881388",
"0.4879707",
"0.4869039",
"0.48571697",
"0.48563075",
"0.4843588",
"0.48421413",
"0.48407266",
"0.4806955",
"0.47951296",
"0.47894552",
"0.4788247",
"0.4788061",
"0.47876516",
"0.4785143",
"0.47804955",
"0.47769088",
"0.47737196",
"0.47720054",
"0.47686338",
"0.47676215",
"0.47624555",
"0.4758911",
"0.47534066",
"0.4752754",
"0.4750296",
"0.4743357",
"0.47424978",
"0.47361565",
"0.47256872",
"0.47222334",
"0.4721991",
"0.47205684",
"0.4718409",
"0.47183588",
"0.4717347",
"0.47161165",
"0.47152543",
"0.4700595",
"0.47003478",
"0.46984622",
"0.46942073",
"0.46940365",
"0.4692999",
"0.46837792",
"0.46735036",
"0.4672792",
"0.46668482",
"0.46565235",
"0.4640856",
"0.4638325",
"0.46352032",
"0.46325123",
"0.46315783",
"0.4630891",
"0.46283463",
"0.4622104",
"0.46192858",
"0.4617166",
"0.46152875",
"0.46119082",
"0.4609721",
"0.46056047"
] | 0.7403188 | 0 |
Created by L on 2016/10/7. | public interface JSONKeys {
String msgType = "msgType";// 消息类型
String userId = "userId";// 发送者Id
String friendId = "friendId";// 接收者Id
String friendName = "friendName";// 好友名
String sendTime = "sendTime";// 发送时间
String msgCotent = "msgCotent";// 聊天信息-文本信息
String voiceTime = "voiceTime";// 聊天信息-语音信息长度
String voicePath = "voicePath";// 聊天信息-语音文件路径
String imagePath = "imagePath";// 聊天信息-图片路径
String userEmail = "userEmail";// 用户注册邮箱,登录时用邮箱登录
String userName = "userName";// 用户名
String userSex = "userSex";// 用户性别
String userBirthday = "userBirthday";// 用户生日
String userPasswd = "userPasswd";// 登录密码
String personSignature = "personSignature";// 个性签名
String userHeadPath = "userHeadPath";// 用户头像路径
String loc_province = "loc_province";// 所处省份
String loc_Longitude = "loc_Longitude";// 经度
String loc_Latitude = "loc_Latitude";// 纬度
String distRange = "distRange";// 多少公里之内的
String strangerList = "strangerList";// 陌生人列表
String friendIdList = "friendIdList";// 好友Id列表
String groupId = "groupId";// 群组Id
String groupName = "groupName";// 群组名
String groupTopic = "groupTopic";// 群组主题
String groupCreator = "groupCreator";//创建者
String isGroupMsg = "isGroupMsg";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void perish() {\n \n }",
"private stendhal() {\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"private static void cajas() {\n\t\t\n\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"private void poetries() {\n\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\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}",
"public void mo38117a() {\n }",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n public void init() {\n\n }",
"protected boolean func_70814_o() { return true; }",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"private void kk12() {\n\n\t}",
"private void m50366E() {\n }",
"public void mo4359a() {\n }",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\n public int describeContents() { return 0; }",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"private void init() {\n\n\t}",
"@Override\n public void init() {\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\r\n\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 void init() {\n }",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\n\tpublic void jugar() {\n\t\t\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n public int retroceder() {\n return 0;\n }",
"@Override\r\n\tpublic void init() {}",
"@Override\n public void init() {\n\n }",
"@Override\n public void init() {\n\n }",
"@Override\n public void init() {}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n protected void init() {\n }",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\n\t}",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n\tprotected void initialize() {\n\n\t}",
"public void mo6081a() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tpublic void init() {\n\t}",
"@Override\n\tpublic void init()\n\t{\n\n\t}",
"private Rekenhulp()\n\t{\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"private void strin() {\n\n\t}",
"@Override\n public int getSize() {\n return 1;\n }",
"@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}",
"public void mo12628c() {\n }",
"public void mo21877s() {\n }",
"@Override\n public void memoria() {\n \n }",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\n\tprotected void initdata() {\n\n\t}",
"public void mo55254a() {\n }",
"private void init() {\n\n\n\n }"
] | [
"0.6002609",
"0.5784318",
"0.57816464",
"0.57742965",
"0.5743151",
"0.5743151",
"0.57384574",
"0.5701933",
"0.56781787",
"0.5644268",
"0.56320804",
"0.5606497",
"0.5598114",
"0.5593724",
"0.5590091",
"0.5583089",
"0.5576029",
"0.55754614",
"0.55698603",
"0.555478",
"0.55546284",
"0.55546284",
"0.55546284",
"0.55546284",
"0.55546284",
"0.555301",
"0.55434835",
"0.5534474",
"0.5526627",
"0.55055416",
"0.5502561",
"0.5495219",
"0.54909766",
"0.54718024",
"0.5471261",
"0.54659885",
"0.54436684",
"0.54398763",
"0.54392916",
"0.5434854",
"0.5427707",
"0.54203486",
"0.54203486",
"0.54140747",
"0.5413864",
"0.54095536",
"0.5407918",
"0.5407918",
"0.5407918",
"0.5400037",
"0.5400037",
"0.5400037",
"0.5399756",
"0.5395487",
"0.5395487",
"0.5395487",
"0.5379226",
"0.5377216",
"0.5377216",
"0.5377216",
"0.5377216",
"0.5377216",
"0.5377216",
"0.5377216",
"0.5368814",
"0.5367906",
"0.53649753",
"0.53649753",
"0.53585654",
"0.53584546",
"0.53584546",
"0.5350824",
"0.5346898",
"0.534319",
"0.53431034",
"0.53401005",
"0.5337483",
"0.53258044",
"0.53258044",
"0.53258044",
"0.53258044",
"0.53258044",
"0.53258044",
"0.5324046",
"0.53204685",
"0.53129065",
"0.5312536",
"0.5309382",
"0.5309155",
"0.5308078",
"0.5291874",
"0.52912515",
"0.5282187",
"0.52769697",
"0.5269512",
"0.52642465",
"0.5255149",
"0.5253058",
"0.5241515",
"0.524043",
"0.5231118"
] | 0.0 | -1 |
A comma and the value separator is a semicolon | @Test public void testEuropeanComma() {
char comma = ';';
int n = random.nextInt(10) + 10;
String[] src = new String[n];
for (int i = 0; i < n; i++) {
src[i] = randomString();
}
println(Arrays.toString(src));
try (CSVUtil.Writer writer = CSVUtil.newWriter(path, comma)) {
for (String s : src) {
writer.write(s);
}
} catch (IOException e) {
e.printStackTrace();
assert false;
}
try {
List<String[]> strings = CSVUtil.read(path, comma);
assert strings.size() == 1;
println(Arrays.toString(strings.get(0)));
assert Arrays.toString(src).equals(Arrays.toString(strings.get(0)));
} catch (IOException e) {
e.printStackTrace();
assert false;
}
try {
List<String[]> strings = CSVUtil.read(path);
assert strings.size() == 1;
println(Arrays.toString(strings.get(0)));
assert Arrays.toString(src).equals(Arrays.toString(strings.get(0)));
} catch (IOException e) {
e.printStackTrace();
assert false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Rule ListSeparator() {\n // No effect on value stack\n return Sequence(AnyOf(\",;\"), WhiteSpace());\n }",
"private String getCSVSeparator(){\n DecimalFormatSymbols s = new DecimalFormatSymbols(getLocale());\n if(s.getDecimalSeparator() == ',')\n return \";\";\n else\n return \",\";\n }",
"protected String getParameterSeparator() {\n return \", \";\n }",
"public String delimitValue(String value){\n\t\tif(value==null)\n\t\t\tvalue=\"\";\n\t\tvalue = csvEscapeString(value);\n\t\treturn \"\\\"\" + value + \"\\\"\";\n\t}",
"private boolean isCommaStatement() {\n return line.contains(\",\") && !line.contains(\"(\");\n }",
"@Override\n\tprotected void handleComma() {\n\t\tif (isInClearText()) {\n\t\t\tsaveToken();\n\t\t}\n\t}",
"@Test\n public final void whenSemicolonDelimiterIsSpecifiedThenItIsUsedToSeparateNumbers() {\n assertEquals(3+6+15, StringCalculator.add(\"//;\\n3;6;15\"));\n }",
"public final void mCOMMA() throws RecognitionException {\n try {\n int _type = COMMA;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // /Users/cbinnig/Workspace/DHBW_FirstDB_Loesung3/src/de/dhbw/db2/firstdb/sql/FirstSQL.g:32:7: ( ',' )\n // /Users/cbinnig/Workspace/DHBW_FirstDB_Loesung3/src/de/dhbw/db2/firstdb/sql/FirstSQL.g:32:9: ','\n {\n match(','); \n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }",
"private StringBuffer removeCommasAtEnd(StringBuffer sql) {\r\n int i=sql.length()-3;\r\n while(i>0 && (sql.charAt(i)==' ' || sql.charAt(i)==','))\r\n i--;\r\n sql = sql.replace(i+1,sql.length()-2,\" \");\r\n\r\n return sql;\r\n }",
"public final void mCOMMA() throws RecognitionException {\n\t\ttry {\n\t\t\tint _type = COMMA;\n\t\t\tint _channel = DEFAULT_TOKEN_CHANNEL;\n\t\t\t// /Users/Sarah/Projects/ontop/obdalib-core/src/main/java/it/unibz/krdb/obda/parser/Datalog.g:416:6: ( ',' )\n\t\t\t// /Users/Sarah/Projects/ontop/obdalib-core/src/main/java/it/unibz/krdb/obda/parser/Datalog.g:416:16: ','\n\t\t\t{\n\t\t\tmatch(','); \n\t\t\t}\n\n\t\t\tstate.type = _type;\n\t\t\tstate.channel = _channel;\n\t\t}\n\t\tfinally {\n\t\t\t// do for sure before leaving\n\t\t}\n\t}",
"@Override\n\tpublic Object visit(ASTRelComma node, Object data) {\n\t\tnode.jjtGetChild(0).jjtAccept(this, data);\n\t\tSystem.out.print(\", \");\n\t\tnode.jjtGetChild(1).jjtAccept(this, data);\n\t\treturn null;\n\t}",
"public final void mCOMMA() throws RecognitionException {\r\n try {\r\n int _type = COMMA;\r\n int _channel = DEFAULT_TOKEN_CHANNEL;\r\n // Satmc.g:6:7: ( ',' )\r\n // Satmc.g:6:9: ','\r\n {\r\n match(','); \r\n\r\n }\r\n\r\n state.type = _type;\r\n state.channel = _channel;\r\n }\r\n finally {\r\n \t// do for sure before leaving\r\n }\r\n }",
"public final void comma() throws RecognitionException {\r\n Token a=null;\r\n\r\n try {\r\n // D:\\\\entornotrabajo\\\\workspace-sgo\\\\persistance\\\\src\\\\main\\\\java\\\\es\\\\caser\\\\persistance\\\\sql\\\\antlr\\\\SQLGrammar.g:199:7: ( (a= COMMA ) )\r\n // D:\\\\entornotrabajo\\\\workspace-sgo\\\\persistance\\\\src\\\\main\\\\java\\\\es\\\\caser\\\\persistance\\\\sql\\\\antlr\\\\SQLGrammar.g:199:8: (a= COMMA )\r\n {\r\n // D:\\\\entornotrabajo\\\\workspace-sgo\\\\persistance\\\\src\\\\main\\\\java\\\\es\\\\caser\\\\persistance\\\\sql\\\\antlr\\\\SQLGrammar.g:199:8: (a= COMMA )\r\n // D:\\\\entornotrabajo\\\\workspace-sgo\\\\persistance\\\\src\\\\main\\\\java\\\\es\\\\caser\\\\persistance\\\\sql\\\\antlr\\\\SQLGrammar.g:199:9: a= COMMA\r\n {\r\n a=(Token)match(input,COMMA,FOLLOW_COMMA_in_comma1216); \r\n out(\",\");\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n finally {\r\n }\r\n return ;\r\n }",
"private Token consumeSemi() {\n return consume(SEMICOLON, \"Expect ';' after value.\");\n }",
"@Override\n\tpublic Object visit(ASTXQueryComma node, Object data) {\n\t\tnode.jjtGetChild(0).jjtAccept(this, data);\n\t\tSystem.out.println(\",\");\n\t\tnode.jjtGetChild(1).jjtAccept(this, data);\n\t\treturn null;\n\t}",
"public void setSeparator(String separator) {\n\t\tthis.separator = separator;\n\t}",
"private String getSeparator(String targetString) {\n return (targetString.indexOf(',') > -1 ? \",\" : (targetString.indexOf(';') > -1 ? \";\" : (targetString.contains(\"regex:\") ? \"\" : \":\")));\n }",
"public void splitter(String values) {\n\n\t\tfor(int i=0; i < values.length(); i++) {\n\t\t\tnewString += values.charAt(i);\n\n\t\t\tif(semi == values.charAt(i)) {\n\t\t\t\tnewString = newString.replaceAll(\";\", \"\");\n\t\t\t\tnewString = newString.replaceAll(\"\\n\", \"\");\n\t\t\t\tsplittedString.add(newString);\n\t\t\t\tnewString = \"\";\n\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i=0; i < splittedString.size()-1; i++) {\n\t\t\tsection = splittedString.get(i);\n\t\t\tString[] dev = section.split(\",\");\n\t\t\tboolean validValues = true;\n\t\t\tfor(int x1 = 0; x1 < dev.length; x1+=3) {\n\t\t\t\tString xx1 = dev[x1];\n\t\t\t\tif(isInteger(xx1) && validValues) {\n\t\t\t\t\tx.add(Integer.parseInt(xx1));\n\t\t\t\t} else {\n\t\t\t\t\tvalidValues = false;\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\tfor(int y1= 1; y1 <dev.length; y1+=3) {\n\t\t\t\tString yy1 = dev[y1];\n\t\t\t\tif(isInteger(yy1) && validValues) {\n\t\t\t\t\ty.add(Integer.parseInt(yy1));\n\t\t\t\t} else {\n\t\t\t\t\tvalidValues = false;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tfor(int z1= 2; z1 <dev.length; z1+=3) {\n\t\t\t\tString zz1 = dev[z1];\n\t\t\t\tif(isInteger(zz1) && validValues) {\n\t\t\t\t\tz.add(Integer.parseInt(zz1));\n\t\t\t\t} else {\n\t\t\t\t\tvalidValues = false;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}",
"public final void mCOMMA() throws RecognitionException {\n try {\n int _type = COMMA;\n // /Users/benjamincoe/HackWars/C.g:199:12: ( ',' )\n // /Users/benjamincoe/HackWars/C.g:199:14: ','\n {\n match(','); \n\n }\n\n this.type = _type;\n }\n finally {\n }\n }",
"private String formatCSV(String value){\r\n\t\treturn value.replaceAll(\"\\\"\",\"\\\"\\\"\");\r\n\t}",
"public void set_post_comma(int val)\n {\n if(val <= this.raw_value.length)\n {\n this.post_comma_digits = val;\n }\n }",
"private String findDelimiter(String line) {\n\t\tString d = null;\n\t\tif(line.indexOf(\",\") > 0) {\n\t\t\td = \",\";\n\t\t} else if(line.indexOf(\";\") > 0) {\n\t\t\td = \";\";\n\t\t} else if(line.indexOf(\" \") > 0) {\n\t\t\td = \" \";\n\t\t}\n\t\treturn d;\n\t}",
"public final void mRULE_COMMA() throws RecognitionException {\r\n try {\r\n int _type = RULE_COMMA;\r\n int _channel = DEFAULT_TOKEN_CHANNEL;\r\n // ../ooi.coi.bspl.ui/src-gen/ooi/coi/bspl/ui/contentassist/antlr/internal/InternalBSPL.g:2465:12: ( ',' )\r\n // ../ooi.coi.bspl.ui/src-gen/ooi/coi/bspl/ui/contentassist/antlr/internal/InternalBSPL.g:2465:14: ','\r\n {\r\n match(','); \r\n\r\n }\r\n\r\n state.type = _type;\r\n state.channel = _channel;\r\n }\r\n finally {\r\n }\r\n }",
"public static String[] splitSepValuesLine(String s, String delimiter, boolean remCommas) {\n\t\tLinkedList<String> output = new LinkedList<String>();\n\t\tString curVal = \"\";\n\t\tboolean inQuotes = false;\n\t\tfor (int i = 0; i < s.length(); i++) {\n\t\t\tchar curChar = s.charAt(i);\n\t\t\tif (curChar == '\\\"')\n\t\t\t\tinQuotes = !inQuotes;\n\t\t\telse if (curChar == delimiter.charAt(0) && !inQuotes) {\n\t\t\t\tString toAdd = curVal.trim();\n\t\t\t\tif (remCommas)\n\t\t\t\t\ttoAdd=removeCommas(toAdd);\n\t\t\t\toutput.add(toAdd);\n\t\t\t\tcurVal = \"\";\n\t\t\t} else {\n\t\t\t\tcurVal += curChar;\n\t\t\t}\n\t\t}\n\t\tif (curVal.length() > 0) {\n\t\t\tString toAdd = curVal.trim();\n\t\t\tif (remCommas)\n\t\t\t\ttoAdd=removeCommas(toAdd);\n\t\t\toutput.add(toAdd);\n\t\t}\n\t\tString[] outputArr = new String[output.size()];\n\t\toutput.toArray(outputArr);\n\t\treturn outputArr;\n\t}",
"public final void mRULE_COMMA() throws RecognitionException {\n try {\n int _type = RULE_COMMA;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // ../org.sqlproc.meta/src-gen/org/sqlproc/meta/parser/antlr/internal/InternalProcessorMeta.g:12801:12: ( ',' )\n // ../org.sqlproc.meta/src-gen/org/sqlproc/meta/parser/antlr/internal/InternalProcessorMeta.g:12801:14: ','\n {\n match(','); \n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }",
"public void setSep(Integer sep) {\n this.sep = sep;\n }",
"private String commaDelimited(String strs[]) {\n StringBuffer sb = new StringBuffer();\n if (strs.length > 0) {\n sb.append(Utils.encToURL(strs[0]));\n for (int i=1;i<strs.length;i++) sb.append(\",\" + Utils.encToURL(strs[i]));\n }\n return sb.toString();\n }",
"@Test\n public void testSetPropertyWithDelimiter() throws ConfigurationException {\n final DatabaseConfiguration config = helper.setUpMultiConfig();\n config.setListDelimiterHandler(new DefaultListDelimiterHandler(';'));\n config.setProperty(\"keyList\", \"1;2;3\");\n final String[] values = config.getStringArray(\"keyList\");\n assertArrayEquals(new String[] {\"1\", \"2\", \"3\"}, values);\n }",
"private String getValue(String s)\n {\n if(s.contains(\",\"))\n {\n return s.split(\",\")[0];\n }\n else\n {\n s = s.replaceAll(\"\\\\)\",\"\");\n return s;\n }\n }",
"public static String formatCommaString(String text){\r\n\t\tString[] arr = text.split(\",\");\r\n\t\tString result=\"\";\r\n\t\tfor(String s: arr){\r\n\t\t\tif(!\"\".equalsIgnoreCase(s.trim())){\r\n\t\t\t\tresult+=s+\",\";\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(result.endsWith(\",\")){\r\n\t\t\tresult=result.substring(0,result.length()-1);\r\n\t\t}\r\n\t\treturn result;\r\n\t}",
"public String toString() {\n/* 46 */ return ModelUtil.toCommaSeparatedList((Object[])getValue());\n/* */ }",
"static public String[] parseImport(String value) {\n \treturn value.split(\";\");\n }",
"public static String serialize( List<String> selectedValues, String delimiter )\n {\n return selectedValues == null ? \"\" : TextUtils.join( delimiter, selectedValues );\n }",
"public String toCsvRow() {\r\n\t return Stream.of(String.valueOf(TxnsRefNo),Description)\r\n\t .map(value -> value.replaceAll(\"\\\"\", \"\\\"\\\"\"))\r\n\t .map(value -> Stream.of(\"\\\"\", \",\").anyMatch(value::contains) ? \"\\\"\" + value + \"\\\"\" : value)\r\n\t .collect(Collectors.joining(\",\"));\r\n\t}",
"public InvalidCommaException(String message){\n super(\"Content should be without comma. Your input: \" + message);\n }",
"public String csvEscapeString(String value){\n\t\tif(value==null)\n\t\t\tvalue=\"\";\n\t\treturn value.replaceAll(\"\\\"\", \"'\");\n\t}",
"public int pre_comma()\n {\n return this.raw_value.length - this.post_comma_digits;\n }",
"public String getCSVString() {\n return getId() + \",\" + noOfRounds + \",\" + caliber + \",\" + manufacturer + \",\" + price;\n }",
"private String getValues()\n\t{\n\t\tString values = \"(\";\n\t\tfor(int spot = 0; spot < fieldList.size(); spot++)\n\t\t{\n\t\t\tvalues += \"'\" + fieldList.get(spot).getText() + \"'\";\n\t\t\tif(spot == fieldList.size()-1)\n\t\t\t{\n\t\t\t\tvalues += \");\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvalues += \", \";\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn values;\n\t}",
"public void setDelims(String delims)\n {\n _delims = delims;\n }",
"@Test(timeout=100)\r\n\tpublic void testSetDelimiter() {\r\n\t\tString [] r1 = {\"NAME\", \"ADDRESS\",\"EMAIL\"};\r\n\t\t// should not remove space inside of quotes\r\n\t\tString [] r2 = {\"Santa Claus\",\"North Pole\",\"santa@snowy.no\"};\r\n\t\tString [] r3 = {\"Obama\",\"1 Pennsylvania Ave\",\"pres@whitehouse.gov\"};\r\n\t\t// default delimiter\r\n\t\twriteArrayToLine(r1);\r\n\t\t// change delimiter\r\n\t\tdelim = ':';\r\n\t\twriteArrayToLine(r2);\r\n\t\twriteArrayToLine(r3);\r\n\t\tout.close();\r\n\t\t\r\n\t\tCSVReader csv = new CSVReader(getInstream());\r\n\t\tassertArrayEquals( r1, csv.next() );\r\n\t\tcsv.setDelimiter(delim);\r\n\t\tassertArrayEquals( r2, csv.next() );\r\n\t\tassertArrayEquals( r3, csv.next() );\r\n\t}",
"public void setFieldSeparator(String fieldSeparator)\n\t{\n\t\tthis.fieldSeparator = fieldSeparator;\n\t}",
"public static void exampleStringJoiner() {\n\t\tStringJoiner example1 = new StringJoiner(\",\"); // passing comma(,) as delimiter\r\n\r\n\t\t// Adding values to StringJoiner\r\n\t\texample1.add(\"Rohini Example1\");\r\n\t\texample1.add(\"Alex Example1\");\r\n\t\texample1.add(\"Peter Example1\");\r\n\r\n\t\tSystem.out.println(\"Example 1 - passing comma(,) as delimiter ... \\n\" + example1);\r\n\t\t\r\n\t\t// Example 2 - passing comma(,) and square-brackets (adding prefix and suffix) as delimiter\r\n\t\tStringJoiner example2 = new StringJoiner(\":\", \"[\", \"]\"); // passing comma(,) and square-brackets as delimiter\r\n\r\n\t\t// Adding values to StringJoiner\r\n\t\texample2.add(\"Rohini Example2\");\r\n\t\texample2.add(\"Raheem Example2\");\r\n\t\tSystem.out.println(\"\\nExample 2 - passing comma(:) and square-brackets (adding prefix and suffix) as delimiter ... \\n\" + example2);\r\n\r\n\t\t// Example 3 - Merge Two StringJoiner\r\n\t\tStringJoiner merge = example1.merge(example2);\r\n\t\tSystem.out.println(\"\\nExample 3 - Merge Two StringJoiner ... \\n\" + merge);\r\n\t}",
"public void setSeparator(String s) {\n\t\tseparator = s;\n\t}",
"public final void rule__LiteralValue__Group_2__1__Impl() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalGo.g:15055:1: ( ( ( ',' )? ) )\r\n // InternalGo.g:15056:1: ( ( ',' )? )\r\n {\r\n // InternalGo.g:15056:1: ( ( ',' )? )\r\n // InternalGo.g:15057:2: ( ',' )?\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getLiteralValueAccess().getCommaKeyword_2_1()); \r\n }\r\n // InternalGo.g:15058:2: ( ',' )?\r\n int alt116=2;\r\n int LA116_0 = input.LA(1);\r\n\r\n if ( (LA116_0==43) ) {\r\n alt116=1;\r\n }\r\n switch (alt116) {\r\n case 1 :\r\n // InternalGo.g:15058:3: ','\r\n {\r\n match(input,43,FOLLOW_2); if (state.failed) return ;\r\n\r\n }\r\n break;\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getLiteralValueAccess().getCommaKeyword_2_1()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }",
"public int post_comma()\n {\n return this.post_comma_digits;\n }",
"public void setDelimiter(String delimiter) {\n this.delimiter = delimiter;\n }",
"private String[] commaDelimited(String str) {\n StringTokenizer st = new StringTokenizer(str,\",\");\n String strs[] = new String[st.countTokens()];\n for (int i=0;i<strs.length;i++) strs[i] = Utils.decFmURL(st.nextToken());\n return strs;\n }",
"String toCSVString();",
"@Override\n\tpublic String getSeparator() {\n\t\treturn null;\n\t}",
"public final void mSEMICOLON() throws RecognitionException {\n try {\n int _type = SEMICOLON;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // C:\\\\Documents and Settings\\\\D043530\\\\runtime-workspace\\\\com.sap.ap.cts.editor\\\\generated\\\\generated\\\\Binding.g:2817:3: ( ';' )\n // C:\\\\Documents and Settings\\\\D043530\\\\runtime-workspace\\\\com.sap.ap.cts.editor\\\\generated\\\\generated\\\\Binding.g:2818:3: ';'\n {\n match(';'); if (state.failed) return ;\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }",
"public final void mSEMICOLON() throws RecognitionException {\n try {\n int _type = SEMICOLON;\n // /Users/benjamincoe/HackWars/C.g:220:2: ( ';' )\n // /Users/benjamincoe/HackWars/C.g:220:4: ';'\n {\n match(';'); \n\n }\n\n this.type = _type;\n }\n finally {\n }\n }",
"@Accessor(qualifier = \"fieldSeparator\", type = Accessor.Type.SETTER)\n\tpublic void setFieldSeparator(final Character value)\n\t{\n\t\tgetPersistenceContext().setPropertyValue(FIELDSEPARATOR, value);\n\t}",
"public Integer getSep() {\n return sep;\n }",
"public static List toListOfStringsDelimitedByCommaOrSemicolon(String s) {\n if (s == null) {\n return Collections.EMPTY_LIST;\n }\n\n List results = new ArrayList();\n // include empty last one, cft. http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#split%28java.lang.String,%20int%29\n String[] terms = s.split(SEPARATOR,-1);\n\n for (int i = 0; i < terms.length; i++) {\n //this has empty string if nothing is found\n String term = terms[i].trim();\n results.add(term);\n }\n\n return results;\n }",
"public static String toCommaSeparatedValues(final List<String> list) {\n if (list == null || list.isEmpty()) {\n return \"\";\n }\n final int listSize = list.size();\n final StringBuilder builder = new StringBuilder();\n for (int i=0; i<listSize; i++) {\n if (i>0) {\n builder.append(',');\n }\n builder.append(list.get(i));\n }\n return builder.toString();\n }",
"public static String buildCommaSeperatedValues(ArrayList input) throws Exception{\r\n\t\tString retString = \"\";\r\n\t\tif(input != null){\r\n\t\tfor(int i=0; i<input.size(); i++){\r\n\t\t\tretString = retString + \",\" +input.get(i);\r\n\t\t}\r\n\t\tretString = retString.substring(1);\r\n\t\t}\r\n\t\treturn retString;\t\t\r\n\t}",
"public List<String> splitCommaSepareatedValues(String commaSepareatedValues) {\n\t\treturn Arrays.asList(commaSepareatedValues.split(\",\"));\n\t}",
"public void setExtractLineSeparator (String linesep);",
"@Override\n\tpublic void parseCSV(String csv) {\n\t\t\n\t}",
"String getSeparator();",
"public final String getDelimiter() {\n return properties.get(DELIMITER_PROPERTY);\n }",
"public void setThousandsSeparator(char sep)\r\n {\r\n m_thousandsSeparator = sep;\r\n }",
"public void writeLine(List<String> values) throws Exception {\n boolean firstVal = true;\n for (String val : values) {\n if (!firstVal) {\n dataWriter.write(\",\");\n }\n //dataWriter.write(\"\\\"\");\n for (int i=0; i<val.length(); i++) {\n char ch = val.charAt(i);\n if (ch=='\\\"') {\n dataWriter.write(\"\\\"\"); //extra quote\n }\n dataWriter.write(ch);\n }\n //dataWriter.write(\"\\\"\");\n firstVal = false;\n }\n dataWriter.write(\"\\n\");\n dataWriter.flush();\n }",
"protected String getLastSeparator() {\n return \"and\";\n }",
"@Override\n protected String stringifySeparator() {\n return \" != \";\n }",
"public void fromCsv(String line, String separator, NumberFormat numberFormat) throws ParseException {\r\n\t\t\tString[] values = line.split(separator);\r\n\t\t\t\r\n\t\t\tid = values[0];\r\n\t\t\tdate = ZonedDateTime.parse(values[1]);\r\n\t\t\tresolution = values[2];\r\n\t\t\thypothesis = values[3];\r\n\t\t\tquality = (values[4].length() == 0 ? Integer.MIN_VALUE : Integer.parseInt(values[4]));\r\n\t\t\tvalue = numberFormat.parse(values[5]).doubleValue();\r\n\t\t\tunit = values[6];\r\n\t\t}",
"public final void rule__StatementList__Alternatives_1_1() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalGo.g:3428:1: ( ( ';' ) | ( ',' ) )\r\n int alt14=2;\r\n int LA14_0 = input.LA(1);\r\n\r\n if ( (LA14_0==42) ) {\r\n alt14=1;\r\n }\r\n else if ( (LA14_0==43) ) {\r\n alt14=2;\r\n }\r\n else {\r\n if (state.backtracking>0) {state.failed=true; return ;}\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 14, 0, input);\r\n\r\n throw nvae;\r\n }\r\n switch (alt14) {\r\n case 1 :\r\n // InternalGo.g:3429:2: ( ';' )\r\n {\r\n // InternalGo.g:3429:2: ( ';' )\r\n // InternalGo.g:3430:3: ';'\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getStatementListAccess().getSemicolonKeyword_1_1_0()); \r\n }\r\n match(input,42,FOLLOW_2); if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getStatementListAccess().getSemicolonKeyword_1_1_0()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n break;\r\n case 2 :\r\n // InternalGo.g:3435:2: ( ',' )\r\n {\r\n // InternalGo.g:3435:2: ( ',' )\r\n // InternalGo.g:3436:3: ','\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getStatementListAccess().getCommaKeyword_1_1_1()); \r\n }\r\n match(input,43,FOLLOW_2); if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getStatementListAccess().getCommaKeyword_1_1_1()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n break;\r\n\r\n }\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }",
"public JsonFactory setRootValueSeparator(String sep)\n/* */ {\n/* 696 */ this._rootValueSeparator = (sep == null ? null : new SerializedString(sep));\n/* 697 */ return this;\n/* */ }",
"private String removeLastComma(String str) {\n if (str.length() > 0 && str.charAt(str.length()-1)==',') {\n str = str.substring(0, str.length()-1);\n }\n return str;\n }",
"public void setDefaultExtractLineSeparator (String linesep);",
"public static String[] split(String value) {\r\n\t\tif(value == null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn value.trim().split(\",\");\r\n\t}",
"public void separator() {\n LOGGER_BASE.separator();\n }",
"public String getSeparator() {\n\t\treturn separator;\n\t}",
"Token fixLastComma( Token token)\r\n {\r\n \tif ( lastExprToken == null)\r\n \t\treturn token;\r\n \t\r\n \tint lastType = lastExprToken.getType();\r\n \tif ( lastType != MExprANTLRParserTokenTypes.COMMA)\r\n \t\treturn token;\r\n\r\n pushToken(token); \t\r\n \treturn makeToken(MExprANTLRParserTokenTypes.NULLID, \"Null\", lastExprToken);\r\n \t\r\n }",
"public void testTokenTypeStringConstructor(){\r\n assertTrue(Token.COMMA.getTokenType() == TokenType.COMMA);\r\n assertTrue(Token.COMMA.getValue().equals(\",\"));\r\n assertTrue(Token.COMMA.getLineNumber() == -1);\r\n }",
"private static void getRidOfComma(String individualLine, int index) {\n }",
"public String getValueConcatenator() {\n\t\treturn \":\";\n\t}",
"private static List<String> parseLine(String csvLine) {\n List<String> result = new ArrayList<>();\n if (Objects.isNull(csvLine) || csvLine.isEmpty()) {\n return result;\n }\n StringBuilder charSet = new StringBuilder();\n char[] chars = csvLine.toCharArray();\n for (char character : chars) {\n if (character == DEFAULT_SEPARATOR) {\n result.add(charSet.toString().trim());\n charSet = new StringBuilder();\n } else {\n charSet.append(character);\n }\n }\n result.add(charSet.toString().trim());\n return result;\n }",
"public String getValues() {\n\t\tString[] valStrArr = values.toArray(new String[values.size()]);\n\t\tlogInfo(String.join(\", \", valStrArr));\n\t\treturn \"\"+String.join(\", \", valStrArr);\n\t}",
"@Test\n public void testAddWithDelimiter() throws ConfigurationException {\n final DatabaseConfiguration config = setUpConfig();\n config.setListDelimiterHandler(new DefaultListDelimiterHandler(';'));\n config.addProperty(\"keyList\", \"1;2;3\");\n final String[] values = config.getStringArray(\"keyList\");\n assertArrayEquals(new String[] {\"1\", \"2\", \"3\"}, values);\n }",
"public void setSourceLineSeparator (String linesep);",
"protected String getSeparator() {\n return isNewLineParameters() ? NEW_LINE_SEPARATOR : ONE_LINE_SEPARATOR;\n }",
"public final void rule__JvmParameterizedTypeReference__Group_1_2__0__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalCsv.g:2449:1: ( ( ',' ) )\n // InternalCsv.g:2450:1: ( ',' )\n {\n // InternalCsv.g:2450:1: ( ',' )\n // InternalCsv.g:2451:2: ','\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getJvmParameterizedTypeReferenceAccess().getCommaKeyword_1_2_0()); \n }\n match(input,30,FOLLOW_2); if (state.failed) return ;\n if ( state.backtracking==0 ) {\n after(grammarAccess.getJvmParameterizedTypeReferenceAccess().getCommaKeyword_1_2_0()); \n }\n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public abstract char getCustomDelimiter();",
"public static void setFieldSeparator(char field) {\r\n\t\tfieldSep=\"\"+field;\r\n\t}",
"public static String toDotDecimalSeparator(String str) {\r\n return str.replaceAll(\",(?=[0-9]+,)\", \"\").replaceAll(\",\", \".\");\r\n }",
"public void setDecimalSeparator(char decSep)\r\n {\r\n m_decimalSeparator = decSep;\r\n }",
"public void setRowSeparator(String rowSeparator)\n\t{\n\t\tthis.rowSeparator = rowSeparator;\n\t}",
"private String[] separarCoordenadas(String pCasilla){\n\t\treturn pCasilla.split(\",\");\n\t}",
"public static String commas(Iterable<?> parts) {\n return join(\", \", parts);\n }",
"@Override\n\tpublic String getValue() {\n\t\tString temp = \"\";\n\t\tif(anotherExps.size() == 0)\n\t\t{\n\t\t\tif(exp == null) return \"\";\n\t\t}\n\t\telse if(anotherExps.size() == 1)temp += \",\"+anotherExps.get(0).getValue();\n\t\telse\n\t\t{\n\t\t\tfor(int i = 0 ; i < anotherExps.size() ; i++)\n\t\t\t{\n\t\t\t\ttemp += \",\" + anotherExps.get(i).getValue();\n\t\t\t}\n\t\t}\n\t\treturn exp.getValue() + temp;\n\t}",
"public final void rule__JvmParameterizedTypeReference__Group_1_4_2_2__0__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalCsv.g:2773:1: ( ( ',' ) )\n // InternalCsv.g:2774:1: ( ',' )\n {\n // InternalCsv.g:2774:1: ( ',' )\n // InternalCsv.g:2775:2: ','\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getJvmParameterizedTypeReferenceAccess().getCommaKeyword_1_4_2_2_0()); \n }\n match(input,30,FOLLOW_2); if (state.failed) return ;\n if ( state.backtracking==0 ) {\n after(grammarAccess.getJvmParameterizedTypeReferenceAccess().getCommaKeyword_1_4_2_2_0()); \n }\n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public CSVList()\n\t{\n\t\tsuper(sepReg, sep);\n\t}",
"public String getCSVData()\n {\n return (Integer.toString(this.getID()) + \",\" +\n this.getName());\n }",
"public String getFieldSeparator()\n\t{\n\t\treturn fieldSeparator;\n\t}",
"private List<String> splitCommaSeparatedString(String defaults) {\r\n\t\tString[] split = defaults.split(\",\");\r\n\t\tList<String> keyList = new LinkedList<String>();\r\n\t\tfor (int i = 0; i < split.length; i++) {\r\n\t\t\tkeyList.add(split[i].trim());\r\n\t\t}\r\n\t\treturn keyList;\r\n\t}",
"public final String semi_colon(int tab) throws RecognitionException {\n String value = null;\n\n\n\n \tvalue = null;\n\n try {\n // src\\\\calculator.g:379:2: ( ';' |)\n int alt23=2;\n int LA23_0 = input.LA(1);\n\n if ( (LA23_0==32) ) {\n alt23=1;\n }\n else if ( (LA23_0==EOF||LA23_0==COMMENT||LA23_0==11||(LA23_0 >= 47 && LA23_0 <= 48)||(LA23_0 >= 52 && LA23_0 <= 53)||(LA23_0 >= 58 && LA23_0 <= 60)||LA23_0==63||(LA23_0 >= 65 && LA23_0 <= 66)) ) {\n alt23=2;\n }\n else {\n NoViableAltException nvae =\n new NoViableAltException(\"\", 23, 0, input);\n\n throw nvae;\n\n }\n switch (alt23) {\n case 1 :\n // src\\\\calculator.g:379:4: ';'\n {\n match(input,32,FOLLOW_32_in_semi_colon1442); \n\n value = \";\";\n\n }\n break;\n case 2 :\n // src\\\\calculator.g:381:4: \n {\n value = \"\";\n\n }\n break;\n\n }\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n\n finally {\n \t// do for sure before leaving\n }\n return value;\n }",
"public void setRecordDelimiter(String recordDelimiter) {\n this.recordDelimiter = recordDelimiter;\n }",
"private static String asPropertyValue( List<?> values, boolean present ) {\n return values.isEmpty() ? String.valueOf( present ) : Joiner.on( \",\" ).join( values );\n }"
] | [
"0.7207538",
"0.7195648",
"0.66490614",
"0.65609497",
"0.6399377",
"0.62804914",
"0.62603444",
"0.62486595",
"0.62147945",
"0.61656386",
"0.6108721",
"0.60933226",
"0.6087169",
"0.6082392",
"0.606017",
"0.5939043",
"0.5912011",
"0.5907849",
"0.5890873",
"0.58670634",
"0.585933",
"0.582052",
"0.57991105",
"0.5758015",
"0.57277983",
"0.5648922",
"0.56374395",
"0.5632189",
"0.56134427",
"0.5585496",
"0.5574031",
"0.5535951",
"0.5531604",
"0.5527541",
"0.55151373",
"0.5509661",
"0.5503722",
"0.54928",
"0.54711485",
"0.54709166",
"0.5463379",
"0.5432041",
"0.54237586",
"0.5418252",
"0.54113245",
"0.53838813",
"0.5374279",
"0.5373745",
"0.5369633",
"0.53680974",
"0.53605795",
"0.5358222",
"0.5349958",
"0.53408325",
"0.53312206",
"0.5325853",
"0.5308174",
"0.5303347",
"0.52912813",
"0.52674174",
"0.52549994",
"0.52445805",
"0.5240241",
"0.5236858",
"0.5233378",
"0.5221833",
"0.52214426",
"0.5220299",
"0.5181798",
"0.5161054",
"0.5160232",
"0.5159706",
"0.51573",
"0.5154264",
"0.51479876",
"0.51461625",
"0.5143293",
"0.51345927",
"0.511649",
"0.5112047",
"0.51047635",
"0.50975025",
"0.50943",
"0.5092003",
"0.50688505",
"0.5067643",
"0.5061318",
"0.5058266",
"0.50538135",
"0.5048404",
"0.5047963",
"0.50437987",
"0.50408304",
"0.5037042",
"0.50366074",
"0.5027874",
"0.50246274",
"0.5021463",
"0.500141",
"0.49864152"
] | 0.54778403 | 38 |
gw: training set dir Location of the directory (the path) taken from the cmd line (first arg) | public static void classifyWithAllWords(String[] args)
throws IOException
{
File dir_location = new File( args[0] );
// Listing of the directory (should contain 2 subdirectories: ham/ and spam/)
File[] dir_listing = new File[0];
// Check if the cmd line arg is a directory and list it
if ( dir_location.isDirectory() )
{
dir_listing = dir_location.listFiles();
}
else
{
System.out.println( "- Error: cmd line arg not a directory.\n" );
Runtime.getRuntime().exit(0);
}
// Listings of the two sub-directories (ham/ and spam/)
File[] listing_ham = new File[0];
File[] listing_spam = new File[0];
// Check that there are 2 sub-directories
boolean hamFound = false; boolean spamFound = false;
for (int i=0; i<dir_listing.length; i++) {
if (dir_listing[i].getName().equals("ham")) { listing_ham = dir_listing[i].listFiles(); hamFound = true;}
else if (dir_listing[i].getName().equals("spam")) { listing_spam = dir_listing[i].listFiles(); spamFound = true;}
}
if (!hamFound || !spamFound) {
System.out.println( "- Error: specified directory does not contain ham and spam subdirectories.\n" );
Runtime.getRuntime().exit(0);
}
// Print out the number of messages in ham and in spam
//System.out.println( "\t number of ham messages is: " + listing_ham.length );
//System.out.println( "\t number of spam messages is: " + listing_spam.length );
//******************************
// Create a hash table for the vocabulary (word searching is very fast in a hash table)
Hashtable<String,Multiple_Counter> vocab = new Hashtable<String,Multiple_Counter>();
Multiple_Counter old_cnt = new Multiple_Counter();
// gw
Hashtable<String,WordStat> vocab_stat = new Hashtable<String,WordStat>();
int nWordsHam = 0;
int nWordsSpam = 0;
// Read the e-mail messages
// The ham mail
for ( int i = 0; i < listing_ham.length; i ++ )
{
FileInputStream i_s = new FileInputStream( listing_ham[i] );
BufferedReader in = new BufferedReader(new InputStreamReader(i_s));
String line;
String word;
while ((line = in.readLine()) != null) // read a line
{
StringTokenizer st = new StringTokenizer(line); // parse it into words
while (st.hasMoreTokens())
{
word = st.nextToken().replaceAll("[^a-zA-Z]","");
if ( !word.equals("") ) { // if string isn't empty
nWordsHam++;
if ( vocab.containsKey(word) ) // check if word exists already in the vocabulary
{
old_cnt = vocab.get(word); // get the counter from the hashtable
old_cnt.counterHam ++; // and increment it
vocab.put(word, old_cnt);
//gw
WordStat ws = vocab_stat.get(word);
ws.counterHam++;
// is this necessary?
vocab_stat.put(word, ws);
}
else
{
Multiple_Counter fresh_cnt = new Multiple_Counter();
fresh_cnt.counterHam = 1;
fresh_cnt.counterSpam = 0;
vocab.put(word, fresh_cnt); // put the new word with its new counter into the hashtable
//gw
WordStat ws = new WordStat();
ws.counterHam = 1;
ws.counterSpam = 0;
ws.p_w_given_ham_log = 0.0 ; //init
ws.p_w_given_spam_log = 0.0; //init
vocab_stat.put(word, ws);
}
}
}
}
in.close();
}
// The spam mail
for ( int i = 0; i < listing_spam.length; i ++ )
{
FileInputStream i_s = new FileInputStream( listing_spam[i] );
BufferedReader in = new BufferedReader(new InputStreamReader(i_s));
String line;
String word;
while ((line = in.readLine()) != null) // read a line
{
StringTokenizer st = new StringTokenizer(line); // parse it into words
while (st.hasMoreTokens())
{
word = st.nextToken().replaceAll("[^a-zA-Z]","");
if ( ! word.equals("") ) {
nWordsSpam ++;
if ( vocab.containsKey(word) ) // check if word exists already in the vocabulary
{
old_cnt = vocab.get(word); // get the counter from the hashtable
old_cnt.counterSpam ++; // and increment it
vocab.put(word, old_cnt);
//gw
WordStat ws = vocab_stat.get(word);
ws.counterSpam++;
// is this necessary?
vocab_stat.put(word, ws);
}
else
{
Multiple_Counter fresh_cnt = new Multiple_Counter();
fresh_cnt.counterHam = 0;
fresh_cnt.counterSpam = 1;
vocab.put(word, fresh_cnt); // put the new word with its new counter into the hashtable
//gw
WordStat ws = new WordStat();
ws.counterHam = 0;
ws.counterSpam = 1;
ws.p_w_given_ham_log = 0.0 ; //init
ws.p_w_given_spam_log = 0.0; //init
vocab_stat.put(word, ws);
}
}
}
}
in.close();
}
// Print out the hash table
// for (Enumeration<String> e = vocab.keys() ; e.hasMoreElements() ;)
// {
// String word;
//
// word = e.nextElement();
// old_cnt = vocab.get(word);
//
// System.out.println( word + " | in ham: " + old_cnt.counterHam +
// " in spam: " + old_cnt.counterSpam);
// }
// Now all students must continue from here
// Prior probabilities must be computed from the number of ham and spam messages
// Conditional probabilities must be computed for every unique word
// add-1 smoothing must be implemented
// Probabilities must be stored as log probabilities (log likelihoods).
// Bayes rule must be applied on new messages, followed by argmax classification (using log probabilities)
// Errors must be computed on the test set and a confusion matrix must be generated
// prior prob
int nMessagesHam = listing_ham.length;
int nMessagesSpam = listing_spam.length;
int nMessagesTotal = nMessagesHam + nMessagesSpam;
if(nMessagesHam == 0 || nMessagesSpam ==0)
System.out.println("Zero ham or spam messages");
double p_ham_log = Math.log((nMessagesHam* 1.0)/(nMessagesTotal));
double p_spam_log = Math.log((nMessagesSpam* 1.0)/(nMessagesTotal));
Iterator it = vocab_stat.entrySet().iterator();
WordStat ws = null;
while (it.hasNext()) {
Map.Entry pairs = (Map.Entry) it.next();
String is = (String) pairs.getKey();
ws = (WordStat) pairs.getValue();
ws.counterHam ++;
ws.counterSpam ++;
nWordsHam ++;
nWordsSpam ++;
}
//System.out.println("nWordsHam = " +nWordsHam);
//System.out.println("nWordsSpam = " + nWordsSpam);
// gw:
it = vocab_stat.entrySet().iterator();
ws = null;
while (it.hasNext()) {
Map.Entry pairs = (Map.Entry) it.next();
String is = (String) pairs.getKey();
ws = (WordStat) pairs.getValue();
ws.p_w_given_ham_log = Math.log(ws.counterHam *1.0 / nWordsHam);
ws.p_w_given_spam_log = Math.log(ws.counterSpam *1.0 / nWordsSpam);
//vocab_stat.put(is,ws);
}
// TODO: further confirm arg index
//test sets
File test_dir_location = new File( args[1] );
// TODO: verify below works
// Listing of the directory (should contain 2 subdirectories: ham/ and spam/)
File[] test_dir_listing = new File[0];
// Check if the cmd line arg is a directory and list it
if ( test_dir_location.isDirectory() )
{
test_dir_listing = test_dir_location.listFiles();
}
else
{
System.out.println( "- Error: cmd line arg not a directory.\n" );
Runtime.getRuntime().exit(0);
}
// TODO: verify File[0]
// Listings of the two sub-directories (ham/ and spam/)
File[] test_listing_ham = new File[0];
File[] test_listing_spam = new File[0];
// Check that there are 2 sub-directories
boolean test_hamFound = false; boolean test_spamFound = false;
for (int i=0; i<test_dir_listing.length; i++) {
if (test_dir_listing[i].getName().equals("ham")) { test_listing_ham = test_dir_listing[i].listFiles(); test_hamFound = true;}
else if (test_dir_listing[i].getName().equals("spam")) { test_listing_spam = test_dir_listing[i].listFiles(); test_spamFound = true;}
}
if (!test_hamFound || !test_spamFound) {
System.out.println( "- Error: specified test directory does not contain ham and spam subdirectories.\n" );
Runtime.getRuntime().exit(0);
}
// // Print out the number of messages in ham and in spam
// System.out.println( "\t number of test ham messages is: " + test_listing_ham.length );
// System.out.println( "\t number of test spam messages is: " + test_listing_spam.length );
// metrics
int true_positives = 0; //spam classified as spam
int true_negatives = 0; //ham classified as ham
int false_positives = 0; //ham ... as spam
int false_negatives = 0; //spam... as ham
// Test starts
// The ham mail
for ( int i = 0; i < test_listing_ham.length; i ++ )
{
FileInputStream i_s = new FileInputStream( test_listing_ham[i] );
BufferedReader in = new BufferedReader(new InputStreamReader(i_s));
String line;
String word;
// gw:
double p_msg_ham_log = 0.0;
double p_msg_spam_log = 0.0;
p_msg_ham_log += p_ham_log;
p_msg_spam_log += p_spam_log;
// gw:
while ((line = in.readLine()) != null) // read a line
{
StringTokenizer st = new StringTokenizer(line); // parse it into words
while (st.hasMoreTokens())
{
word = st.nextToken().replaceAll("[^a-zA-Z]","");
if ( !word.equals("") ) { // if string isn't empty
// gw:
if(vocab_stat.containsKey(word)){
WordStat iws = vocab_stat.get(word);
double ip_w_given_ham_log = iws.p_w_given_ham_log;
double ip_w_given_spam_log = iws.p_w_given_spam_log;
p_msg_ham_log += ip_w_given_ham_log ;
p_msg_spam_log += ip_w_given_spam_log ;
}
// gw:
}
}
}
in.close();
if (p_msg_spam_log > p_msg_ham_log) false_positives ++;
else true_negatives ++;
}
// The spam mail
for ( int i = 0; i < test_listing_spam.length; i ++ )
{
FileInputStream i_s = new FileInputStream( test_listing_spam[i] );
BufferedReader in = new BufferedReader(new InputStreamReader(i_s));
String line;
String word;
// gw:
double p_msg_ham_log = 0.0;
double p_msg_spam_log = 0.0;
p_msg_ham_log += p_ham_log;
p_msg_spam_log += p_spam_log;
// gw:
while ((line = in.readLine()) != null) // read a line
{
StringTokenizer st = new StringTokenizer(line); // parse it into words
while (st.hasMoreTokens())
{
word = st.nextToken().replaceAll("[^a-zA-Z]","");
if ( ! word.equals("") ) {
// gw:
if(vocab_stat.containsKey(word)){
WordStat iws = vocab_stat.get(word);
double ip_w_given_ham_log = iws.p_w_given_ham_log;
double ip_w_given_spam_log = iws.p_w_given_spam_log;
p_msg_ham_log += ip_w_given_ham_log ;
p_msg_spam_log += ip_w_given_spam_log ;
}
// gw:
}
}
}
in.close();
if (p_msg_spam_log > p_msg_ham_log) true_positives ++;
else false_negatives ++;
}
System.out.println("Result 1:");
System.out.println("All_Words\t\ttrue spam\ttrue ham");
System.out.println("Classified spam:\t"+true_positives+"\t\t"+false_positives);
System.out.println("Classified ham: \t"+false_negatives+"\t\t"+ true_negatives);
System.out.println("");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic String getGANModelDirectory() {\n\t\treturn GANProcess.PYTHON_BASE_PATH+\"LodeRunnerGAN\";\n\t}",
"void setDirectory(File dir);",
"@attribute(value = \"\", required = true)\t\r\n\tpublic void setDir(String dir) {\r\n\t\tthis.dir = new File(dir);\r\n\t}",
"public void startTrainingMode() {\n\t\t\r\n\t}",
"@Override\r\n\t\tpublic void setDir(String dir)\r\n\t\t\t{\n\t\t\t\t\r\n\t\t\t}",
"@Raw @Model\r\n\tvoid setDir(Directory dir) {\r\n\t\tthis.dir = dir;\r\n\t\tthis.move(dir);\r\n\t\t\r\n\t}",
"private void setupWorkingDir(Execute exe) {\r\n if (dir == null) {\r\n dir = getProject().getBaseDir();\r\n }\r\n else if (!dir.exists() || !dir.isDirectory()) {\r\n throw new BuildException(dir.getAbsolutePath() + \" is not a valid directory\", getLocation());\r\n }\r\n exe.setWorkingDirectory(dir);\r\n }",
"public IStatus prepareRuntimeDirectory(IPath baseDir);",
"public void setDir(File dir) {\n this.dir = dir;\n }",
"public void run(State state) throws IllegalNumberOfArgumentsException,\r\n InvalidPathException {\r\n String[] parameters = state.getParameters();\r\n if (parameters.length == 0) {\r\n throw new IllegalNumberOfArgumentsException(\r\n \"Mkdir requires a path to a directory to create.\");\r\n }\r\n // make a new directory for each path parameter\r\n for (String path : parameters) {\r\n path = State.cleanDirectoryPath(path);\r\n // get the name of the new directory and the path to its parent\r\n String[] separatedPath = state.separatePathName(path);\r\n String name = separatedPath[0];\r\n String parentPath = separatedPath[1];\r\n if (name.matches(\"/*\")) {\r\n throw new InvalidPathException(path);\r\n }\r\n try {\r\n // check that the name and parent's path are valid\r\n if (name.matches(State.ILLEGAL_CHARACTERS) || name\r\n .substring(0, name.length() - 1).contains(\"/\")) {\r\n throw new IllegalNameException(name);\r\n }\r\n // get the parent directory\r\n Directory parentDir = Navigate.navigateToDirectory(state, parentPath);\r\n //System.out.println(\"parent data: \" + parentDir.getData());\r\n //System.out.println(\"name: \" + name);\r\n String newPath = parentDir.getData() + name;\r\n // check that this file does not already exist\r\n if (parentDir.getChild(newPath) == null) {\r\n // create the new directory\r\n parentDir.addChild(name);\r\n state.addMessage(\"Created directory: \" + newPath + \"\\n\");\r\n } else {\r\n state.addMessage(newPath + \" already exists\\n\");\r\n }\r\n } catch (InvalidPathException e) {\r\n state.addMessage(\"Could not add directory \" + path + \" because \"\r\n + parentPath + \" does not exist.\\n\");\r\n } catch (IllegalNameException e) {\r\n state.addMessage(\"Could not add directory \" + path\r\n + \" because it contains illegal characters.\\n\");\r\n }\r\n }\r\n }",
"public static void main (String [] args) throws Exception { \n//\t\tconf.setMapperClass(DadaMapper.class);\n//\t\tconf.setReducerClass(DataReducer.class);\n\t\t\n//\t\tConfiguration conf = new Configuration(); \n//\t\tconf.set(\"fs.default.name\", \"hdfs://zli:9000\"); \n//\t\tconf.set(\"hadoop.job.user\", \"hadoop\"); \t\t \n//\t\tconf.set(\"mapred.job.tracker\", \"zli:9001\");\n\t\t\n\t\tJob job = new Job(); \n\t\tjob.setJarByClass(NBModelTestJob.class);\n\t\tjob.getConfiguration().set(\"fs.defaultFS\", \"hdfs://NYSJHL101-142.opi.com:8020\"); \n\t\tjob.getConfiguration().set(\"hadoop.job.user\", \"hdfs\"); \t\t \n\t\tjob.getConfiguration().set(\"mapred.job.tracker\", \"NYSJHL101-144.opi.com:8021\");\n\t\tjob.getConfiguration().set(\"trainpath\", args[0]);\n\t\tFileInputFormat.addInputPath(job, new Path(args[1]));\n\t\tFileOutputFormat.setOutputPath(job, new Path(args[2]));\n\t\tFileSystem hdfs = FileSystem.get(job.getConfiguration());\n\t\t\t\t\n\t\tjob.setMapperClass(DataMapper.class);\n\t\tjob.setReducerClass(DataReducer.class);\n\t\tjob.setCombinerClass(DataCombiner.class);\n\t\tjob.setOutputKeyClass(Text.class);\n\t\tjob.setOutputValueClass(Text.class);\n\t\tjob.setNumReduceTasks(10);\n\t\t\n\t\tSystem.exit(job.waitForCompletion(true) ? 0 : 1);\n\t\t\n\t}",
"public void setAndCreateDirPath(String dirname) {\r\n\t File newPath = new File(dirname); \r\n\t \r\n\t if(!newPath.isDirectory()) {\r\n\t\t newPath.mkdirs();\r\n\t }\r\n\t \r\n\t directory = newPath;\r\n }",
"private void setWorkDiretory() {\n\t\tthis.workDiretory = System.getProperty(\"user.dir\");\n\t}",
"public void setDir(File dir) {\n _sourceDir = dir;\n }",
"public void setDir(File dir)\n {\n this.dir = dir;\n }",
"private void processDir(){\n // get the location of ISAW code base\n String isaw_home=SharedData.getProperty(\"ISAW_HOME\");\n if(isaw_home==null)\n throw new InstantiationError(\"Could not find directory:ISAW_HOME is null\");\n isaw_home=FilenameUtil.setForwardSlash(isaw_home+\"/\");\n\n // get the name of the directory to check\n String dir=FilenameUtil.setForwardSlash(isaw_home\n +\"DataSetTools/parameter/\");\n\n // check that the directory is okay to work with\n if(DEBUG) System.out.println(\"Looking in \"+dir);\n File paramDir=new File(dir);\n if( !(paramDir.exists()) || !(paramDir.isDirectory()) )\n throw new InstantiationError(\"Could not find directory \" + dir);\n\n // get the list of all possible classes\n File[] files=paramDir.listFiles();\n String filename=null;\n for( int i=0 ; i<files.length ; i++ ){\n filename=checkName(files[i].toString(),isaw_home.length());\n if(filename!=null) addParameter(filename);\n }\n \n \n\n dir=FilenameUtil.setForwardSlash(isaw_home\n +\"gov/anl/ipns/Parameters/\");\n\n // check that the directory is okay to work with\n if(DEBUG) System.out.println(\"Looking in \"+dir);\n paramDir=new File(dir);\n if( !(paramDir.exists()) || !(paramDir.isDirectory()) )\n throw new InstantiationError(\"Could not find directory \" + dir);\n\n // get the list of all possible classes\n files=paramDir.listFiles();\n filename=null;\n for( int i=0 ; i<files.length ; i++ ){\n filename=checkName(files[i].toString(),isaw_home.length());\n if(filename!=null) addParameter(filename);\n }\n\n }",
"private void loadDataTraining(String location) throws IOException {\r\n\r\n File parentDir = new ClassPathResource(location).getFile();\r\n \ttrainWriter.write(\"Data folder found.\");\r\n\r\n // Divide all data to training and testing datasets\r\n FileSplit filesInDir = new FileSplit(parentDir, allowedExtensions, randNumGen);\r\n \r\n // Create ParentPathLabelGenerator, that will parse the parent dir and use the name of the subdirectories as label/class names\r\n ParentPathLabelGenerator labelMaker = new ParentPathLabelGenerator();\r\n BalancedPathFilter pathFilter = new BalancedPathFilter(randNumGen, allowedExtensions, labelMaker);\r\n trainWriter.write(\"Label generators created.\");\r\n \r\n // Split the image files into train and test. Specify the train test split as 80%,20%\r\n InputSplit[] filesInDirSplit = filesInDir.sample(pathFilter, 80, 20);\r\n InputSplit trainDataInputSplit = filesInDirSplit[0];\r\n InputSplit testDataInputSplit = filesInDirSplit[1];\r\n trainWriter.write(\"Data splited to train and test parts as 80% and 20%.\");\r\n \r\n /*\r\n * Specifying a new record reader (one for testing on dataset, one for testing on real data, one for training)\r\n * with the height and width you want the images to be resized to.\r\n * Note that the images in this example are all of different size\r\n * They will all be resized to the height and width specified below\r\n * */\r\n ImageRecordReader trainRecordReader = new ImageRecordReader(inputShape[1],inputShape[2],inputShape[0],labelMaker);\r\n trainRecordReader.initialize(trainDataInputSplit);\r\n\r\n ImageRecordReader testRecordReader = new ImageRecordReader(inputShape[1],inputShape[2],inputShape[0], labelMaker);\r\n testRecordReader.initialize(testDataInputSplit);\r\n trainWriter.write(\"Data iterators created successfully.\");\r\n \r\n // Get the number of labels, ImageRecordReader founded in dir and check it\r\n int outputNum = trainRecordReader.numLabels();\r\n\r\n // Init iterators with datasets\r\n trainIterator = new RecordReaderDataSetIterator(trainRecordReader, batchSizeTraining, labelIndex, outputNum);\r\n trainIterator.setCollectMetaData(true);\r\n testIterator = new RecordReaderDataSetIterator(testRecordReader, batchSizeTesting, labelIndex, outputNum);\r\n testIterator.setCollectMetaData(true);\r\n trainWriter.write(\"Data iterators setted to collect metadata.\");\r\n }",
"void setWorkingDirectory( String workingDirectory );",
"public void setOutputDirectory(String dir) {\n\t\tnew LabeledText(\"Output directory:\").setText(dir);\n\t}",
"public void createTestDir() {\n\t\tworkDir = new File(System.getProperty(\"test.dir\", \"target\"));\n\t}",
"private void makeDirectory() {\n String userHome = System.getProperty(\"user.home\");\n wnwData = new File(userHome + \"/.wnwdata\");\n wnwData.mkdirs();\n\n makeCampaignChallengesFile();\n makeCustomChallengesFile();\n makeProgressFile();\n makeSettingsFile();\n }",
"void setWorkingDirectory(String workingDirectory);",
"public static void setInputDir(Configuration conf, String path) {\n conf.set(\"mapred.input.dir\", path);\n }",
"public void trainTest(String template, int maxSize, int[] trainSet, int[] testSet, Reader examples, String directory, Algorithm mode) throws IOException {\n trainTest_impl(template, maxSize, trainSet, testSet, examples, new File(directory+\"/train.arff\"), new File(directory+\"/train.arff\"), mode);\n }",
"public void setupDrive(){\n // Place Dove/ into base of drive\n new File(drv.toString() + File.separator + folderName).mkdir();\n //upload preset content if required\n isSetup = true;\n }",
"void setTrainData(DataModel trainData);",
"public void setDir(int dir) {\n this.dir = dir;\n }",
"protected void setWorkingDirectory(File dir) {\n\t\tthis.dir = dir;\n\t}",
"public void updateLabtainersPath(){\n labsPath = new File(labtainerPath + File.separator + \"labs\");\n labChooser.setCurrentDirectory(labsPath); \n }",
"public abstract void setTrainParams(ClassificationMethod method,URL model,Map<String,Object> args) throws ClassificationException;",
"public static void main(String[] args) {\n int arg = 0;\n int seedNum = 100;\n int trainNum = 0;\n int testNum = 0;\n boolean treeFlag = false;\n boolean textFlag = false;\n //handle options\n while (args[arg].startsWith(\"-\")) {\n switch(args[arg]) {\n case (\"-tree\"):\n treeFlag = true;\n break;\n case (\"-text\"):\n textFlag = true;\n break;\n case (\"-seednum\"):\n arg++;\n seedNum = Integer.parseInt(args[arg]);\n break;\n case (\"-trainnum\"):\n arg++;\n trainNum = Integer.parseInt(args[arg]);\n break;\n case (\"-testnum\"):\n arg++;\n testNum = Integer.parseInt(args[arg]);\n break;\n case (\"-trainall\"):\n trainNum = Integer.MAX_VALUE;\n break;\n case (\"-testall\"):\n testNum = Integer.MAX_VALUE;\n break;\n default:\n throw new IllegalArgumentException(\"Unrecognized command: \" + args[arg]);\n }\n arg++;\n }\n File sourceDirectory = new File(args[arg]);\n arg++;\n File destinationDirectory = new File(args[arg]);\n\n if(treeFlag && textFlag) {\n System.err.println(\"Both text and tree flags detected, which one do you want?\");\n System.exit(2);\n }\n\n if (trainNum == Integer.MAX_VALUE && testNum == Integer.MAX_VALUE) {\n System.err.println(\"Can't max both train and test values!\");\n System.exit(3);\n }\n\n if (!sourceDirectory.isDirectory()) {\n System.err.println(\"ERROR: \" + sourceDirectory.getName() + \"is not a directory!\");\n System.exit(4);\n }\n if (!destinationDirectory.exists()) {\n destinationDirectory.mkdirs();\n } else if (!destinationDirectory.isDirectory()) {\n System.err.println(\"ERROR: \" + destinationDirectory.getName() + \"is not a directory!\");\n System.exit(5);\n }\n\n if (treeFlag) {\n createSeededFiles(\"tree\", seedNum, trainNum, testNum, sourceDirectory, destinationDirectory);\n } else if (textFlag) {\n createSeededFiles(\"text\", seedNum, trainNum, testNum, sourceDirectory, destinationDirectory);\n }\n }",
"protected void init()\r\n\t{\n\t\tif (ConfigManager.getInstance().getIsCrossClassify() && WekaTool.dataStageOn)\r\n\t\t{\r\n\t\t\t//System.out.println(\"in init for data stage\");\r\n\t\t\tsrcDirUrl = ConfigManager.getInstance().getTrainPath();\r\n\t\t\tdestDirUrl = ConfigManager.getInstance().getTrainPath() +\r\n\t\t\t File.separator + \"output\";\r\n\t\t\t//System.out.println(\"srcDirUrl = \" + srcDirUrl);\r\n\t\t\t//System.out.println(\"destDirUrl = \" + destDirUrl);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t//System.out.println(\"here, good\");\r\n\t\t\tsrcDirUrl = getSrcDirUrl();\r\n\t\t\tdestDirUrl = getDestDirUrl();\r\n\t\t}\r\n\t\tdatalibSVMUrl = getLibSVMDirUrl();\r\n\t\ttry {\r\n\t\t\tsrcDir = Utils.getDir(srcDirUrl);\r\n\t\t\tdestDir = Utils.getDir(destDirUrl);\r\n\t\t} catch (Exception e)\r\n\t\t{\r\n\t\t}\r\n\t}",
"public void train ()\t{\t}",
"public void setDir(File d) {\r\n this.dir = d;\r\n }",
"public void train()\n\t{\n\t\tdbiterator = DBInstanceIterator.getInstance();\n System.out.println(\"Start Training ..\");\n\n\t\ttry {\n\t\t\tSystem.out.println(\"Training Text %..\");\n\t\t\ttrainText();\n\n\t\t\tSystem.out.println(\"Training Complex %..\");\n\t\t\ttrainCombined();\n\n\t\t\tSystem.out.println(\"Training Feature %..\");\n\t\t\ttrainFeatures();\n\n\t\t\tSystem.out.println(\"Training Lexicon %..\");\n\t\t\t//trainLexicon();\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}",
"public void setBasedir( File basedir )\n {\n this.basedir = basedir;\n }",
"@Override\n\tpublic void setWorkingDir(String workingDir) {\n\t\tmodel.setWorkingDir(workingDir);\n\t}",
"public void setDir(String dir) {\n // Do this before setting the value\n boolean dirChanged = dir != null && !dir.equals(this.getDir());\n this.dir = Paths.get(dir);\n if(dirChanged) {\n this.dirChanged();\n }\n }",
"public void setHarvestedDataDir(String val) {\n\n\t\tthis.harvestedDataDir = val;\n\n\t}",
"public void setCurrentDirectory(File dir) {\r\n\tif (dir == null) dir = new File(System.getProperty(\"user.home\"));\r\n\r\n\tdir = makeAbsolute(dir);\r\n\r\n\t/**\r\n\t * Note that we compare literal paths, not canonical\r\n\t * paths. If they want the chooser to represent the\r\n\t * files at the end of a different route to the same\r\n\t * place, that's perfectly legitimate. See NextStep\r\n\t * for e.g.\r\n\t */\r\n\tif (curDir == null || !curDir.equals(dir)) {\r\n\t invalidateCache();\r\n\t File oldDir = curDir;\r\n\t curDir = dir;\r\n\t firePropertyChange(\"currentDirectory\", oldDir, dir);\r\n\t fireContentsChanged();\r\n\t}\r\n }",
"public void TrainDataset(){\n\t\ttry{\n\t\t\t//Testing delegate method\n\t\t\tMessageController.logToConsole(\"Hey, I'm from train button\");\n\t\t\t\n\t\t\t//Pass in the real training dataset\n\t\t\tfindSuitableK(new String[]{\"Hello\", \"World\"});\n\t\t\t\n\t\t\t//Pass in the 'k' and 'query string'\n\t\t\tfindKNN(2, \"anything\");\n\t\t}\n\t\tcatch(Exception ex){\n\t\t\tthrow ex;\n\t\t}\n\t\tfinally{\n\t\t\t\n\t\t}\n\t}",
"@Override\n public void initDefaultCommand() {\n setDefaultCommand(new DriveTrainDefault());\n }",
"public MkdirCommand() {\r\n // The name of the mkdir command\r\n name = \"mkdir\";\r\n\r\n // The description of the mkdir command\r\n description = \"Creates a directory ar the given path. The given path can\"\r\n + \" be a full path or a path relative to the working directory\";\r\n\r\n // The parameters for the mkdir command and their description\r\n parameters.put(\"DIR\", \"The path that points to where the new directory\"\r\n + \" should be created.\");\r\n }",
"public createDirectory_args setPath(String path) {\n this.path = path;\n return this;\n }",
"void setup(CommandLine cmd);",
"TrainingTest createTrainingTest();",
"public void dataConfig(String dir) {\n VersatileDataSource source = new CSVDataSource(new File(dir + \"trainData/iris.csv\"), false,\n CSVFormat.DECIMAL_POINT);\n VersatileMLDataSet data = new VersatileMLDataSet(source);\n data.defineSourceColumn(\"sepal-length\", 0, ColumnType.continuous);\n data.defineSourceColumn(\"sepal-width\", 1, ColumnType.continuous);\n data.defineSourceColumn(\"petal-length\", 2, ColumnType.continuous);\n data.defineSourceColumn(\"petal-width\", 3, ColumnType.continuous);\n\n // Define the column that we are trying to predict.\n ColumnDefinition outputColumn = data.defineSourceColumn(\"species\", 4,\n ColumnType.nominal);\n data.analyze();\n data.defineSingleOutputOthersInput(outputColumn);\n\n EncogModel model = new EncogModel(data);\n\n model.selectMethod(data, \"feedforward\");\n data.normalize();\n System.out.println(data.get(0).toString());\n NeuralUtils.dataToFile(data, dir + \"trainData/test.csv\");\n\n NormalizationHelper helper = data.getNormHelper();\n System.out.println(helper.toString());\n NeuralUtils.persistHelper(helper, dir + \"resources/Helper/helper.txt\");\n\n }",
"public static void setup(String[] args) {\n\t\tif (parametersContains(\"classpath\", args)) {\r\n\t\t\tRESOURCE_TYPE = RessourceType.CLASSPATH;\r\n\t\t\tCobra2DEngine.setupEnvironment(RESOURCE_TYPE);\r\n\t\t\tROOT_PATH_STR = \"./src/main/resources/\";\r\n\t\t} else if (parametersContains(\"currentDir\", args)) {\r\n\t\t\tRESOURCE_TYPE = RessourceType.INSTALL_DIR;\r\n\t\t\tCobra2DEngine.setupEnvironment(RESOURCE_TYPE);\r\n\t\t\tROOT_PATH_STR = \".\";\r\n\t\t} else {\r\n\t\t\tSystem.out\r\n\t\t\t\t\t.println(\"Start this runtime environment with option -classpath to load all resources from your classpath or with -currentDir to load all resources from current directory ./game-resources/.\");\r\n\t\t\tSystem.exit(1);\r\n\t\t}\r\n\r\n\t\tROOT_PATH = new File(ROOT_PATH_STR);\r\n\t\tRESOURCE_PATH = new File(ROOT_PATH_STR + File.separator\r\n\t\t\t\t+ RESOURCE_PATH_STR);\r\n\t\tIMAGE_RESOURCE_PATH = new File(ROOT_PATH_STR + File.separator\r\n\t\t\t\t+ RESOURCE_PATH_STR + File.separator + IMAGE_FOLDER_STR);\r\n\r\n\t\tlog.info(\"Setting up path settings for runtime.\");\r\n\t\tlog.info(\"Resource loading strategy : \" + RESOURCE_TYPE);\r\n\t\tlog.info(\"Root path (path): \" + ROOT_PATH.getPath());\r\n\t\tlog.info(\"Root path (absolute): \"\r\n\t\t\t\t+ ROOT_PATH.getAbsolutePath());\r\n\t\tlog.info(\"Resource path (path): \" + RESOURCE_PATH.getPath());\r\n\t\tlog.info(\"Resource path (absolute): \"\r\n\t\t\t\t+ RESOURCE_PATH.getAbsolutePath());\r\n\t\tlog.info(\"Image resource path (path): \"\r\n\t\t\t\t+ IMAGE_RESOURCE_PATH.getPath());\r\n\t\tlog.info(\"Image resource path (absolute): \"\r\n\t\t\t\t+ IMAGE_RESOURCE_PATH.getAbsolutePath());\r\n\t}",
"public static void main(String[] args) throws Exception {\n // TODO Auto-generated method stub\n if (args.length != 3) {\n System.err.println(\"Enter valid number of arguments <Inputdirectory> <Outputlocation>\");\n System.exit(0);\n }\n ToolRunner.run(new Configuration(), new MovieLensTopMovies(), args);\n }",
"public static void main(String[] args) { String dirname = \"/home/diego/IdeaProjects/JAVAStuff/src/tmp/dirTest.txt\";\n// File d = new File(dirname);\n// d.mkdirs();\n//\n File file = null;\n String[] paths;\n\n try {\n file = new File(\"/home/diego/IdeaProjects/JAVAStuff/src\");\n paths = file.list();\n\n for(String s: paths) {\n System.out.println(s);\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n\n }",
"public void setRootDir(String rootDir);",
"public void train(){\n recoApp.training(idsToTest);\n }",
"public void train(SieveDocuments trainingInfo) {\r\n\t\t// no training\r\n\t}",
"public static void main(String args[]){\n\t\t//parameters that can be modified\n\t\tint topicNum=100;\n\t\tString sourceID=\"1864252027/\";\n\t\tint subnetworkSize=1100;\n\t\tString dir=\"sampleTest/\"+sourceID+subnetworkSize+\"/\";\n\t\tString fileName=\"ldaInput.txt\";\n\t\tint iterationNum=1000;\n\t\t\n\t\t//read training data from file\n\t\tSystem.out.println(\"loading files\");\n\t\tGraph network=GraphOperator.getFromFile(dir+\"sample.network\");\n\t\tHashMap<String,Message>trainingStatusMap=MessageListOperator.readMessageFromFile(dir+\"trainingSet.status\");\n\t\tHashMap<String,Message>commentMap=MessageListOperator.readMessageFromFile(dir+\"samplePreDoc.comment\");\n\t\t\n\t\tDocumentAssign.relateMessageToNetwork(network,trainingStatusMap,commentMap);\n\t\tDocumentAssign.optimizedAssign(network,dir,fileName);\n\t\t\n\t\tSystem.out.println(\"Training\");\t\n\t\t//training with Optimized assignment\n\t\tLDA_InfluMax.estimationFromScratch(50/((double)topicNum),0.01,topicNum,\n\t\t\t\titerationNum,iterationNum/2,dir,fileName,50);\n\t}",
"protected String setPathToResourcesIfNotProvided(String[] args) {\n if (args.length == 0) {\n args = new String[1];\n args[0] = \"./src/main/resources/Code Test\";\n }\n return args[0];\n }",
"private static void checkArgsAndSetUp()\n {{\n File outDir= new File( arg_outDirname );\n\n if ( outDir.exists() ) {\n\t if ( !outDir.isDirectory() ) {\n\t System.err.println( PROGRAM_NAME+ \n\t\t\t\t\": output directory is not a directory; \"); \n\t System.err.println( \"\\t\"+ \"dir=\\\"\"+ arg_outDirname+ \"\\\", \" );\n\t System.err.println( \"\\t\"+ \"please specify an empty directory.\" );\n\t System.exit(-1);\n\t }\n\t if ( outDir.list().length > 0 ) {\n\t System.err.println( PROGRAM_NAME+ \n\t\t\t\t\": output directory is not empty; \"); \n\t System.err.println( \"\\t\"+ \"dir=\\\"\"+ arg_outDirname+ \"\\\", \" );\n\t System.err.println( \"\\t\"+ \"please specify an empty directory.\" );\n\t System.exit(-1);\n\t }\n } else {\n\t outDir.mkdir();\n }\n }}",
"@DataBoundSetter\n public void setDir(String dir) {\n this.dir = dir;\n }",
"public void setShHarvestedDataDir(String val) {\n\n\t\tthis.shHarvestedDataDir = val;\n\n\t}",
"private void trainNetwork(long iterations) {\n\t\ttrainer.startTraining(network, iterations);\r\n\r\n\t}",
"Path getBaseInputDir();",
"public void setSource(String sourceDir)\n {\n this.sourceDir = new File(sourceDir);\n }",
"public static void main(String[] args){\n File f = new File(System.getProperty(\"user.dir\"));\n if(os){\n path = f.toString()+\"\\\\YuuTubevideos\";\n }else{\n path = f.toString()+\"/YuuTubevideos\";\n }\n start_page();\n }",
"@BeforeClass\n\tpublic static void setUpClass() {\n\t\tString resourcesDir = System.getProperty(\"user.dir\") + File.separator + \"src\" +\n File.separator + \"test\" + File.separator + \"resources\";\n\n tsmResources = resourcesDir + File.separator + \"tsm\";\n //testDir = new File(resourcesDir, \"tsm-output\"); \n\t}",
"private void createTDenseDirectory() {\n File dense = new File(DenseLayerPath);\n dense.mkdir();\n }",
"public TestLearningAPI(String arg0) throws GateException,\n MalformedURLException {\n super(arg0);\n if(!initialized) {\n Gate.init();\n learningHome = new File(new File(Gate.getGateHome(), \"plugins\"),\n \"Learning\");\n Gate.getCreoleRegister().addDirectory(learningHome.toURI().toURL());\n initialized = true;\n }\n }",
"private void setTrainingData() throws IOException {\r\n\t\ttrainIdBodyMap = readInIdBodiesMap(new File(TRAIN_BODIES_CSV_LOCATION));\r\n\t\ttrainStances = readStances(new File(TRAIN_STANCES_CSV_LOCATION));\r\n\r\n\t}",
"public void getPredictions() throws IOException, InterruptedException{\n //splitColsDataFiles();\n for(String learner:listLearners){\n File modelsFolder = new File(\"models/\"+learner);\n File[] IPFolders = modelsFolder.listFiles();\n for (File nodeFolder : IPFolders) {\n if (nodeFolder.isDirectory()) {\n File[] filesInFolder = nodeFolder.listFiles();\n ArrayList<String> filesINFolderAL = new ArrayList<String>();\n for(int i=0;i<filesInFolder.length;i++){\n filesINFolderAL.add(filesInFolder[i].getName());\n }\n if(filesINFolderAL.contains(model) && filesINFolderAL.contains(\"data.properties\")){\n System.out.println(\"Generating data for: \" + nodeFolder.getPath());\n // read properties file\n // get indices of variables\n // paste appropriate cols in models/temp\n // change commands below with appropriate data\n Properties dataProps = loadProps(nodeFolder.getPath()+\"/data.properties\");\n ArrayList<Integer> indices = new ArrayList<Integer>();\n String featuresS = dataProps.getProperty(\"sampled_variables\");\n if(featuresS!=null){\n String[] featuresArray = featuresS.split(\" \");\n for(int i=0;i<featuresArray.length;i++){\n indices.add(i, Integer.parseInt(featuresArray[i]));\n }\n // the order of indices is important\n Collections.sort(indices);\n\n String pasteTrainTempCommand = \"paste -d',' \";\n for(int i=0;i<indices.size();i++){\n pasteTrainTempCommand += \" models/temp/tr_\" + (indices.get(i)+1) + \".csv\";\n }\n pasteTrainTempCommand += \" models/temp/tr_targets.csv > models/temp/tr_temp.csv\";\n System.out.println(pasteTrainTempCommand);\n Process pasteTrainTemp_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", pasteTrainTempCommand});\n pasteTrainTemp_process.waitFor();\n\n\n String pasteTestTempCommand = \"paste -d',' \";\n for(int i=0;i<indices.size();i++){\n pasteTestTempCommand += \" models/temp/te_\" + (indices.get(i)+1) + \".csv\";\n }\n pasteTestTempCommand += \" models/temp/te_targets.csv > models/temp/te_temp.csv\";\n System.out.println(pasteTestTempCommand);\n Process pasteTestTemp_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", pasteTestTempCommand});\n pasteTestTemp_process.waitFor();\n \n // Add a new case when adding a new learner\n if(learner.equals(\"gpfunction\") || learner.equals(\"ruletree\") || learner.equals(\"rulelist\")){ // JAVA\n String predictTrain_command = \"java -jar learners/\" + learner + \".jar -predict models/temp/tr_temp.csv\"\n + \" -model \" + nodeFolder + \"/\" + model \n + \" -o \" + nodeFolder + \"/predsTrain_\" + model ;\n Process predictTrain_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", predictTrain_command});\n predictTrain_process.waitFor();\n String predictTest_command = \"java -jar learners/\" + learner + \".jar -predict models/temp/te_temp.csv\"\n + \" -model \" + nodeFolder + \"/\" + model \n + \" -o \" + nodeFolder + \"/predsTest_\" + model ;\n Process predictTest_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", predictTest_command});\n predictTest_process.waitFor();\n }else if(learner.equals(\"mplcs\")){// C OR C++\n String predictTrain_command = \"learners/\" + learner + \" -predict models/temp/tr_temp.csv\"\n + \" -model \" + nodeFolder + \"/\" + model \n + \" -o \" + nodeFolder + \"/predsTrain_\" + model+\".csv\" ;\n Process predictTrain_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", predictTrain_command});\n predictTrain_process.waitFor();\n String predictTest_command = \"learners/\" + learner + \" -predict models/temp/te_temp.csv\"\n + \" -model \" + nodeFolder + \"/\" + model \n + \" -o \" + nodeFolder + \"/predsTest_\" + model+\".csv\" ;\n Process predictTest_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", predictTest_command});\n predictTest_process.waitFor();\n }if(learner.equals(\"lccb\")){ // Python\n String predictTrain_command = \"python learners/\" + learner + \".py -predict models/temp/tr_temp.csv\"\n + \" -model \" + nodeFolder + \"/\" + model \n + \" -o \" + nodeFolder + \"/predsTrain_\" + model+\".csv\" ;\n Process predictTrain_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", predictTrain_command});\n predictTrain_process.waitFor();\n String predictTest_command = \"python learners/\" + learner + \".py -predict models/temp/te_temp.csv\"\n + \" -model \" + nodeFolder + \"/\" + model \n + \" -o \" + nodeFolder + \"/predsTest_\" + model+\".csv\" ;\n System.out.println(predictTest_command);\n Process predictTest_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", predictTest_command});\n predictTest_process.waitFor();\n }if(learner.equals(\"SBBJ\")){ // JAVA\n String predictTrain_command = \"java -jar learners/\" + learner + \".jar -predict models/temp/tr_temp.csv\"\n + \" -model \" + nodeFolder + \"/\" + model \n + \" -o \" + nodeFolder + \"/predsTrain_\" + model+\".csv\" ;\n Process predictTrain_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", predictTrain_command});\n predictTrain_process.waitFor();\n String predictTest_command = \"java -jar learners/\" + learner + \".jar -predict models/temp/te_temp.csv\"\n + \" -model \" + nodeFolder + \"/\" + model \n + \" -o \" + nodeFolder + \"/predsTest_\" + model+\".csv\" ;\n Process predictTest_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", predictTest_command});\n predictTest_process.waitFor();\n }\n \n }\n }\n }\n }\n }\n }",
"public static void main(String[] args) {\n\t\tPerceptron p = new Perceptron(new TaruTrainingWrapper(args[0],null));\n\t\t\n\t\t// Training data\n//\t\tString srcTrainFile = \"train.src\"; // contains parses\n//\t\tString refTrainFile = \"train.ref\"; // contains plain text\n\t\tString srcTrainFile = \"test.src\"; // contains parses\n\t\tString refTrainFile = \"test.ref\"; // contains plain text\n\t\t\n\t\t// Read in the training data\n\t\tArrayList<String> srcData = new ArrayList<String>(5000);\n\t\tArrayList<String> refData = new ArrayList<String>(5000);\n\t\t\n\t\ttry{\n\t\t\tBufferedReader sbr = new BufferedReader(new FileReader(srcTrainFile));\n\t\t\tBufferedReader rbr = new BufferedReader(new FileReader(refTrainFile));\n\t\t\tString ref = \"\";\n\t\t\twhile((ref = rbr.readLine()) != null){\n\t\t\t\tString src = sbr.readLine();\n\t\t\t\tif(ref.split(\" +\").length < 31){\n\t\t\t\t\tsrcData.add(src);\n\t\t\t\t\trefData.add(ref.toLowerCase());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tsbr.close();\n\t\t\trbr.close();\n\t\t}catch(FileNotFoundException e){e.printStackTrace();} catch (IOException e) { e.printStackTrace();}\n\t\tSystem.out.println(\"Training on \" + srcData.size() + \" sentences.\");\n\t\t// run the training\n\t\tp.trainAverage(srcData, refData, 5);\n\t}",
"public void setDir( final File dir )\n {\n m_dir = dir;\n }",
"public static void main(String[] args) {\n\n if (args.length < 2 || args.length > 3) {\n System.out.println(\"Usage: BuildDemoData <dir> <file> [<jenaflag>]\");\n System.out.println(\"where <dir> is the output directory\");\n System.out.println(\"where <file> is a properties file\");\n System.out.println(\"where <jenaflag> is any value\");\n System.exit(0);\n }\n\n Properties dataProps = new Properties();\n\n try {\n File props = new File(args[1]);\n FileInputStream fis = new FileInputStream(props);\n dataProps.load((InputStream) fis);\n } catch (Exception e) {\n System.err.println(e.toString());\n e.printStackTrace();\n }\n\n \tModel model = ModelFactory.createDefaultModel();\n try {\n model = getModelFromFiles(dataProps);\n } catch (Exception e) {\n System.err.println(e.toString());\n e.printStackTrace();\n }\n \n System.out.println(\"Writing no inferencing model...\");\n writeModel(model, args[0] + \"simileDemoNoInference.rdf\");\n System.out.println(\"Uninferenced model contains \" + model.size() + \" statements\");\n\n System.out.println(\"Inferencing...\"); \t\n if (args.length == 2) {\n Reasoner reasoner = new SimileReasoner();\n writeModel(reasoner.process(model), args[0] + \"simileDemoMappingInference.rdf\");\n } else {\n Reasoner reasoner = new JenaReasoner();\n writeModel(reasoner.process(model), args[0] + \"simileDemoJenaInference.rdf\");\n }\n \n System.out.println(\"Inferenced model contains \" + model.size() + \" statements\");\n }",
"private static void createSeededFiles(String type, int seedNum, int trainNum, int testNum, File sourceDirectory,\n File destinationDirectory) {\n\n File trainDirectory = new File(destinationDirectory.getAbsolutePath() + \"/train\");\n if(trainNum > 0 && !trainDirectory.exists()) {\n trainDirectory.mkdir();\n }\n File testDirectory = new File(destinationDirectory.getAbsolutePath() + \"/test\");\n if(testNum > 0 && !testDirectory.exists()) {\n testDirectory.mkdir();\n }\n\n //for each language, we want to create a directory for that language, then parse trees/sentences through each of the novels listed there\n File[] languages = sourceDirectory.listFiles();\n File[] trainDirectoryLanguages = new File[languages.length];\n File[] testDirectoryLanguages = new File[languages.length];\n for (int i = 0; i < languages.length; i++) {\n if (languages[i].getName().startsWith(\".\")) {\n continue;\n }\n trainDirectoryLanguages[i] = new File(trainDirectory.getAbsolutePath() + \"/\" + languages[i].getName());\n testDirectoryLanguages[i] = new File(testDirectory.getAbsolutePath() + \"/\" + languages[i].getName());\n if (trainNum > 0)\n makeNewDirectoryIfNotExists(trainDirectoryLanguages[i]);\n if (testNum > 0)\n makeNewDirectoryIfNotExists(testDirectoryLanguages[i]);\n\n File[] novels = languages[i].listFiles();\n for (int j = 0; j < novels.length; j++) {\n if (novels[j].getName().startsWith(\".\")) {\n continue;\n }\n try {\n BufferedReader read = new BufferedReader(new FileReader(novels[j]));\n //name w/o .txt\n String fileShortName = novels[j].getName().substring(0, novels[j].getName().length()-4);\n String line;\n //max number of stuff we want to read is based on our inputs\n int maxFiles = testNum + trainNum;\n long maxLines = (long) maxFiles * (long) seedNum;\n int lineCount = 0;\n int fileCount = 1;\n //File currentFile = createNewNumberedFile(trainDirectoryLanguages[i].getAbsolutePath() + \"/\" + fileShortName, fileCount);\n String pathToUse = (fileCount <= trainNum) ? trainDirectoryLanguages[i].getAbsolutePath() :\n testDirectoryLanguages[i].getAbsolutePath();\n File currentFile = createNewNumberedFile(pathToUse + \"/\" + fileShortName, fileCount);\n PrintWriter pw = new PrintWriter(currentFile);\n\n //this is the part that varies based on calling for text or trees.\n switch (type) {\n case \"text\":\n while ((line = read.readLine()) != null && lineCount < maxLines ) {\n pw.println(line);\n lineCount++;\n //when our lineCount mod seedNum is 0, we want to create another PrintWriter\n if (lineCount % seedNum == 0) {\n fileCount++;\n //put in train or test, depending on our current file count.\n if (fileCount <= maxFiles) {\n pathToUse = (fileCount <= trainNum) ? trainDirectoryLanguages[i].getAbsolutePath() :\n testDirectoryLanguages[i].getAbsolutePath();\n currentFile = createNewNumberedFile(pathToUse + \"/\" + fileShortName, fileCount);\n pw.flush();\n pw.close();\n pw = new PrintWriter(currentFile);\n }\n }\n }\n break;\n case \"tree\":\n //need to build a Treebank... lifting code from HW 3 to aid in this.\n Options op = new Options();\n op.doDep = false;\n op.doPCFG = true;\n op.setOptions(\"-goodPCFG\", \"-evals\", \"tsv\");\n Treebank treeBank = op.tlpParams.diskTreebank();\n treeBank.loadPath(novels[j]);\n Iterator<Tree> it = treeBank.iterator();\n while((it.hasNext()) && lineCount < maxLines) {\n lineCount++;\n Tree t = it.next();\n t.pennPrint(pw);\n if (lineCount % seedNum == 0) {\n fileCount++;\n //put in train or test, depending on our current file count.\n if (fileCount <= maxFiles) {\n pathToUse = (fileCount <= trainNum) ? trainDirectoryLanguages[i].getAbsolutePath() :\n testDirectoryLanguages[i].getAbsolutePath();\n currentFile = createNewNumberedFile(pathToUse + \"/\" + fileShortName, fileCount);\n pw.flush();\n pw.close();\n pw = new PrintWriter(currentFile);\n }\n }\n }\n break;\n }\n pw.flush();\n pw.close();\n //if numlines is not equal to maxlines then we'll remove the last file.\n if (lineCount != maxLines) {\n currentFile = createNewNumberedFile(pathToUse + \"/\" + fileShortName, fileCount);\n currentFile.delete();\n }\n } catch (IOException e) {\n System.err.println(\"Exception caught while reading \" + novels[j] + \":\");\n e.printStackTrace();\n }\n }\n\n\n }\n\n\n }",
"static public void createClusterProfileDir() {\n if (new File(getClusterProfileDir()).exists() == true) {\n return;\n }\n\n String dir = IJ.getDirectory(\"home\") + File.separator + \".MosaicToolSuite\";\n try {\n ShellCommand.exeCmd(\"mkdir \" + dir);\n }\n catch (final IOException e) {\n e.printStackTrace();\n }\n catch (final InterruptedException e) {\n e.printStackTrace();\n }\n\n dir += File.separator + \"clusterProfile\";\n\n try {\n ShellCommand.exeCmd(\"mkdir \" + dir);\n }\n catch (final IOException e) {\n e.printStackTrace();\n }\n catch (final InterruptedException e) {\n e.printStackTrace();\n }\n }",
"public void setToDir(File dir) {\n _destDir = dir;\n }",
"public DecisionLearningTree(String training, String test) {\n\t\ttrainingFile = training;\n\t\ttestFile = test;\n\t\treadTrainingFile();\n\t\troot = readDataFile();\n\t}",
"public static void main (String[] args) throws IOException {\n if (args.length < 6 || args.length % 2 == 1) {\n System.err.println (\"MENameTagger requires 4 + 2n arguments for n training corpora:\");\n System.err.println (\" state-file feature-file model-file props-file directory1 filelist1 [directory2 filelist2] ...\");\n System.exit (1);\n }\n String stateFile = args[0];\n String featureFile = args[1];\n String modelFile = args[2];\n String configFile = args[3];\n\t\tJetTest.initializeFromConfig (configFile);\n MENameTagger nt = new MENameTagger();\n\t\tnt.initialize (stateFile, featureFile);\n\t\tfor (int pass=1; pass <= 2; pass++) {\n\t\t\tMaxEntNE.pass = pass;\n\t\t\tMaxEntNE.trainingDocCount = 0;\n \tfor (int iarg = 4; iarg<args.length; iarg+=2) {\n \tString directory = args[iarg];\n \tString fileList = args[iarg+1];\n \tnt.train (directory, fileList);\n\t\t\t}\n }\n\t\tnt.mene.createModel();\n nt.store(modelFile);\n\t}",
"public void setExtractDir(final String dir) {\n this.extractBaseDir = new File(dir);\n extractBaseDir.mkdirs();\n }",
"public void setDriveTrain(DriveTrain driveTrain) {\r\n this.driveTrain = driveTrain;\r\n }",
"private static void findPath()\r\n {\r\n String temp_path = System.getProperty(\"user.dir\");\r\n char last = temp_path.charAt(temp_path.length() - 1);\r\n if(last == 'g')\r\n {\r\n path = \".\";\r\n }\r\n else\r\n {\r\n path = \"./bag\";\r\n }\r\n \r\n }",
"public static void main(String [] argv) {\n// weka.gui.explorer.Explorer explorer=new weka.gui.explorer.Explorer();\n// String[] file={};\n// explorer.main(file);\n runClassifier(new ExtremeLearningMachine(), argv);\n }",
"@Override\n public void prepareRun(BatchSourceContext context) throws IOException {\n Map<String, String> arguments = new HashMap<>();\n FileSetArguments.setInputPaths(arguments, config.files);\n context.setInput(Input.ofDataset(config.fileSetName, arguments));\n }",
"public void open(){\n try {\n output = new BufferedWriter(new FileWriter(training_path, true));\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public Builder inputFileDir(String inputFileDir) {\n this.inputFileDir = inputFileDir;\n return this;\n }",
"public void setImageDir(File imageRepDir) {\n\t\tFileDataPersister.getInstance().put(\"gui.configuration\", \"image.repository\", imageRepDir.getPath());\n\t\tRepository.getInstance().setRepository(imageRepDir);\n\t\tthis.getSelectedGraphEditor().repaint();\n\t}",
"public Drivetrain() {\n // Use inches as unit for encoder distances\n m_leftEncoder.setDistancePerPulse(initialDistancePerPulse);\n m_rightEncoder.setDistancePerPulse(initialDistancePerPulse);\n resetEncoders();\n }",
"public Builder setDirName(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n dirName_ = value;\n onChanged();\n return this;\n }",
"public void setDirFlag(boolean dirFlag) { this.dirFlag = dirFlag; }",
"public static void main(String[] args) {\n\t\t\r\n\t\tFile f=new File(\"C:\\\\Users\\\\DELL\\\\Desktop\\\\\",\"CheckFolder\");\r\n\t\t\r\n\t\tf.mkdir();\r\n\t\t\r\n\t\tSystem.out.println(f.isDirectory());\r\n\t\t\r\n\t\tSystem.out.println(f.getName());\r\n\t\t\r\n\t\tSystem.out.println(f.getParent());\r\n\t\t\r\n\t\t\r\n\t\t\r\n\r\n\t}",
"public static void main(final String[] args) {\n \tString enginePath = engines[8];\n\t\tEngineParameter eparams = new EngineParameter(enginePath);\n\n\t\tString url = \"http://files.grouplens.org/datasets/movielens/ml-1m.zip\";\n String folder = \"src/resources/main/data/ml-1m\";\n String modelPath = \"src/resources/main/crossValid/ml-1m/model/\";\n String recPath = \"src/resources/main/crossValid/ml-1m/recommendations/\";\n String dataFile = eparams.getDataSouceParams().getSourceLocation().get(0);\n int nFolds = N_FOLDS;\n \t\t\n System.out.println(\"Preparing splits...\");\n prepareSplits(url, nFolds, dataFile, folder, modelPath);\n \n System.out.println(\"Gathering recomendations...\");\n //recommend(nFolds, modelPath, recPath); // RiVal's original step.\n //orbsRecommend(nFolds, eparams, modelPath); // Based on RiVal' step\n mixedRecommend(nFolds, eparams, modelPath); // Mixed step\n \n //System.out.println(\"Preparing strategy...\");\n // the strategy files are (currently) being ignored\n //prepareStrategy(nFolds, modelPath, recPath, modelPath);\n\n System.out.println(\"Evaluating...\");\n evaluate(nFolds, modelPath, recPath);\n }",
"protected void initialize() {\n Robot.m_drivetrain.resetPath();\n Robot.m_drivetrain.addPoint(0, 0);\n Robot.m_drivetrain.addPoint(3, 0);\n Robot.m_drivetrain.generatePath();\n \n\t}",
"File getTargetDirectory();",
"public void setBasedir( String basedir )\n {\n setBasedir( new File( basedir.replace( '/', File.separatorChar ).replace( '\\\\', File.separatorChar ) ) );\n }",
"private static File getTestDataDir() {\n File ancestor = new File(System.getProperty(\"protobuf.dir\", \".\"));\n String initialPath = ancestor.getAbsolutePath();\n try {\n ancestor = ancestor.getCanonicalFile();\n } catch (IOException e) {\n throw new RuntimeException(\n \"Couldn't get canonical name of working directory.\", e);\n }\n while (ancestor != null && ancestor.exists()) {\n if (new File(ancestor, \"src/google/protobuf\").exists()) {\n return new File(ancestor, \"src/google/protobuf/testdata\");\n }\n ancestor = ancestor.getParentFile();\n }\n\n throw new RuntimeException(\n \"Could not find golden files. This test must be run from within the \" +\n \"protobuf source package so that it can read test data files from the \" +\n \"C++ source tree: \" + initialPath);\n }",
"private void setLabtainersDir() throws IOException{\n String newLabtainersPath = LabtainersDirTextfield.getText();\n \n // check if labtainers path exist\n if(new File(newLabtainersPath).isDirectory()){\n pathValidLabel.setVisible(false);\n \n FileOutputStream out = new FileOutputStream(iniFile);\n writeValueToINI(out, \"labtainersPath\", newLabtainersPath);\n\n labtainerPath = newLabtainersPath;\n updateLabtainersPath();\n \n LabtainersDirDialog.setVisible(false);\n }\n else{\n pathValidLabel.setVisible(true);\n } \n }",
"public void setBasedir(String baseD) throws BuildException {\n setBaseDir(new File(baseD));\n }",
"public void setDir() throws FileNotFoundException, IOException{\r\n final JFileChooser jfc = new JFileChooser();\r\n jfc.setDialogTitle(\"Choose Workplace Dirtory\");\r\n FileSystemView fsv = FileSystemView.getFileSystemView();\r\n //wppath stores workplace location\r\n wppath = fsv.getDefaultDirectory();\r\n File rd = new File(wppath.getAbsolutePath() + \"/USQ_Reporter.txt\");\r\n int ext = 0;\r\n if(rd.exists())ext=1;\r\n if(!rd.exists())ext=2;\r\n FileReader fr; \r\n if(rd.exists()){\r\n fr= new FileReader(rd);\r\n if(fr.read()==-1)\r\n ext=2;\r\n }\r\n //System.out.println(ext);\r\n //workplace path\r\n if(ext==1) {\r\n BufferedReader br = new BufferedReader(new FileReader(rd));\r\n workplace = br.readLine();\r\n }else if (ext==2) {\r\n jfc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\r\n int returnVal = jfc.showOpenDialog(this);\r\n \r\n if(returnVal == JFileChooser.APPROVE_OPTION) {\r\n File file = jfc.getSelectedFile();\r\n if(!file.exists()) {\r\n JOptionPane.showMessageDialog(null, \"file doesn't exist.\", \"System Message\", JOptionPane.ERROR_MESSAGE);\r\n } else if(file.isDirectory()) {\r\n workplace = file.getAbsolutePath();\r\n }\r\n }\r\n BufferedWriter bw = new BufferedWriter(new FileWriter(rd));\r\n bw.write(workplace);\r\n bw.flush();\r\n bw.close();\r\n }\r\n }",
"public void createTrainingData(String dirName, String processName, int fold, ArrayList<FoldInstance> instances) throws FileNotFoundException {\n PrintWriter writer = new PrintWriter(dirName + \"/\" + processName + \".jointtrain.cv.\" + fold);\n for (int i = 0; i < instances.size(); i++) {\n FoldInstance inst = instances.get(i);\n if (inst.getName().equalsIgnoreCase(processName)) {\n if (inst.getFold() == fold) {\n writer.println(inst.getSentences());\n writer.flush();\n }\n } else {\n writer.println(inst.getSentences());\n writer.flush();\n }\n\n }\n writer.close();\n }",
"public void trainTest(String template, int maxSize, Reader trainReader, Reader testReader, String directory, Algorithm mode) throws IOException {\n List<Clause> clauses = new ArrayList<Clause>();\n List<String> classifications = new ArrayList<String>();\n readExamples(trainReader, clauses, classifications);\n int[] trainSetIndices = new int[clauses.size()];\n for (int i = 0; i < trainSetIndices.length; i++){\n trainSetIndices[i] = i;\n }\n readExamples(testReader, clauses, classifications);\n int[] testSetIndices = new int[clauses.size()-trainSetIndices.length];\n for (int i = 0; i < testSetIndices.length; i++){\n testSetIndices[i] = i + trainSetIndices.length;\n }\n Triple<List<Set<PredicateDefinition>>,List<PredicateDefinition>,Dataset> preprocessed = preprocessDataset(clauses, classifications, PredicateDefinition.parseDefinition(template), true);\n trainTest_impl(template, preprocessed.t, preprocessed.r, preprocessed.s, maxSize, trainSetIndices, testSetIndices, new File(directory+\"/train.arff\"), new File(directory+\"/test.arff\"), mode);\n }",
"private void initializeTargetDirectory()\n {\n if ( isFtpEnabled() )\n initializeRemoteTargetDirectory();\n else\n initializeLocalTargetDirectory(); \n }",
"public void train() throws Exception;",
"public void setTraining(String s){\n\t\tmyText = s.trim();\n\t}",
"public void saveTraining(File datum) throws IOException, FileNotFoundException {\n bp.writer(datum);\n }"
] | [
"0.60886186",
"0.57081735",
"0.5695157",
"0.557939",
"0.55348504",
"0.5515155",
"0.550602",
"0.54871064",
"0.5445602",
"0.541634",
"0.5414581",
"0.5380302",
"0.5357071",
"0.5353806",
"0.5324003",
"0.5305847",
"0.5305503",
"0.5300043",
"0.52864194",
"0.52773875",
"0.527617",
"0.5254208",
"0.52427983",
"0.5221836",
"0.52110213",
"0.52043366",
"0.5192074",
"0.5169769",
"0.5166663",
"0.5157326",
"0.5134557",
"0.5133915",
"0.5095699",
"0.50884014",
"0.5088125",
"0.5066896",
"0.5063618",
"0.5058258",
"0.5054353",
"0.50481427",
"0.50312364",
"0.5023027",
"0.5003501",
"0.49990022",
"0.49800783",
"0.49800754",
"0.49621204",
"0.4945178",
"0.4942666",
"0.49302417",
"0.49159124",
"0.49090037",
"0.49065295",
"0.4904773",
"0.49004993",
"0.48969778",
"0.48966601",
"0.48812494",
"0.4877588",
"0.48690403",
"0.48638245",
"0.48637986",
"0.48534647",
"0.4852397",
"0.48514473",
"0.4839721",
"0.48392737",
"0.48254508",
"0.482198",
"0.48079178",
"0.47947076",
"0.47901008",
"0.47869897",
"0.47850147",
"0.47849438",
"0.4784333",
"0.47780353",
"0.47702852",
"0.47484788",
"0.47454026",
"0.473907",
"0.47349513",
"0.47292438",
"0.4728092",
"0.47233433",
"0.4716728",
"0.47126096",
"0.4709292",
"0.470841",
"0.47014922",
"0.46966398",
"0.46911013",
"0.46905708",
"0.46897715",
"0.46885765",
"0.4685948",
"0.468539",
"0.46815452",
"0.4675011",
"0.4650061",
"0.46442896"
] | 0.0 | -1 |
gw: training set dir Location of the directory (the path) taken from the cmd line (first arg) | public static void classifyWithLowerCaseWords(String[] args)
throws IOException
{
File dir_location = new File( args[0] );
// Listing of the directory (should contain 2 subdirectories: ham/ and spam/)
File[] dir_listing = new File[0];
// Check if the cmd line arg is a directory and list it
if ( dir_location.isDirectory() )
{
dir_listing = dir_location.listFiles();
}
else
{
System.out.println( "- Error: cmd line arg not a directory.\n" );
Runtime.getRuntime().exit(0);
}
// Listings of the two sub-directories (ham/ and spam/)
File[] listing_ham = new File[0];
File[] listing_spam = new File[0];
// Check that there are 2 sub-directories
boolean hamFound = false; boolean spamFound = false;
for (int i=0; i<dir_listing.length; i++) {
if (dir_listing[i].getName().equals("ham")) { listing_ham = dir_listing[i].listFiles(); hamFound = true;}
else if (dir_listing[i].getName().equals("spam")) { listing_spam = dir_listing[i].listFiles(); spamFound = true;}
}
if (!hamFound || !spamFound) {
System.out.println( "- Error: specified directory does not contain ham and spam subdirectories.\n" );
Runtime.getRuntime().exit(0);
}
// Print out the number of messages in ham and in spam
//System.out.println( "\t number of ham messages is: " + listing_ham.length );
//System.out.println( "\t number of spam messages is: " + listing_spam.length );
//******************************
// Create a hash table for the vocabulary (word searching is very fast in a hash table)
Hashtable<String,Multiple_Counter> vocab = new Hashtable<String,Multiple_Counter>();
Multiple_Counter old_cnt = new Multiple_Counter();
// gw
Hashtable<String,WordStat> vocab_stat = new Hashtable<String,WordStat>();
int nWordsHam = 0;
int nWordsSpam = 0;
// Read the e-mail messages
// The ham mail
for ( int i = 0; i < listing_ham.length; i ++ )
{
FileInputStream i_s = new FileInputStream( listing_ham[i] );
BufferedReader in = new BufferedReader(new InputStreamReader(i_s));
String line;
String word;
while ((line = in.readLine()) != null) // read a line
{
StringTokenizer st = new StringTokenizer(line); // parse it into words
while (st.hasMoreTokens())
{
word = st.nextToken().replaceAll("[^a-zA-Z]","");
word = word.toLowerCase();
if ( !word.equals("") ) { // if string isn't empty
nWordsHam++;
if ( vocab.containsKey(word) ) // check if word exists already in the vocabulary
{
old_cnt = vocab.get(word); // get the counter from the hashtable
old_cnt.counterHam ++; // and increment it
vocab.put(word, old_cnt);
//gw
WordStat ws = vocab_stat.get(word);
ws.counterHam++;
// is this necessary?
vocab_stat.put(word, ws);
}
else
{
Multiple_Counter fresh_cnt = new Multiple_Counter();
fresh_cnt.counterHam = 1;
fresh_cnt.counterSpam = 0;
vocab.put(word, fresh_cnt); // put the new word with its new counter into the hashtable
//gw
WordStat ws = new WordStat();
ws.counterHam = 1;
ws.counterSpam = 0;
ws.p_w_given_ham_log = 0.0 ; //init
ws.p_w_given_spam_log = 0.0; //init
vocab_stat.put(word, ws);
}
}
}
}
in.close();
}
// The spam mail
for ( int i = 0; i < listing_spam.length; i ++ )
{
FileInputStream i_s = new FileInputStream( listing_spam[i] );
BufferedReader in = new BufferedReader(new InputStreamReader(i_s));
String line;
String word;
while ((line = in.readLine()) != null) // read a line
{
StringTokenizer st = new StringTokenizer(line); // parse it into words
while (st.hasMoreTokens())
{
word = st.nextToken().replaceAll("[^a-zA-Z]","");
word = word.toLowerCase();
if ( ! word.equals("") ) {
nWordsSpam ++;
if ( vocab.containsKey(word) ) // check if word exists already in the vocabulary
{
old_cnt = vocab.get(word); // get the counter from the hashtable
old_cnt.counterSpam ++; // and increment it
vocab.put(word, old_cnt);
//gw
WordStat ws = vocab_stat.get(word);
ws.counterSpam++;
// is this necessary?
vocab_stat.put(word, ws);
}
else
{
Multiple_Counter fresh_cnt = new Multiple_Counter();
fresh_cnt.counterHam = 0;
fresh_cnt.counterSpam = 1;
vocab.put(word, fresh_cnt); // put the new word with its new counter into the hashtable
//gw
WordStat ws = new WordStat();
ws.counterHam = 0;
ws.counterSpam = 1;
ws.p_w_given_ham_log = 0.0 ; //init
ws.p_w_given_spam_log = 0.0; //init
vocab_stat.put(word, ws);
}
}
}
}
in.close();
}
// Print out the hash table
// for (Enumeration<String> e = vocab.keys() ; e.hasMoreElements() ;)
// {
// String word;
//
// word = e.nextElement();
// old_cnt = vocab.get(word);
//
// System.out.println( word + " | in ham: " + old_cnt.counterHam +
// " in spam: " + old_cnt.counterSpam);
// }
// Now all students must continue from here
// Prior probabilities must be computed from the number of ham and spam messages
// Conditional probabilities must be computed for every unique word
// add-1 smoothing must be implemented
// Probabilities must be stored as log probabilities (log likelihoods).
// Bayes rule must be applied on new messages, followed by argmax classification (using log probabilities)
// Errors must be computed on the test set and a confusion matrix must be generated
// prior prob
int nMessagesHam = listing_ham.length;
int nMessagesSpam = listing_spam.length;
int nMessagesTotal = nMessagesHam + nMessagesSpam;
if(nMessagesHam == 0 || nMessagesSpam ==0)
System.out.println("Zero ham or spam messages");
double p_ham_log = Math.log((nMessagesHam* 1.0)/(nMessagesTotal));
double p_spam_log = Math.log((nMessagesSpam* 1.0)/(nMessagesTotal));
Iterator it = vocab_stat.entrySet().iterator();
WordStat ws = null;
while (it.hasNext()) {
Map.Entry pairs = (Map.Entry) it.next();
String is = (String) pairs.getKey();
ws = (WordStat) pairs.getValue();
ws.counterHam ++;
ws.counterSpam ++;
nWordsHam ++;
nWordsSpam ++;
}
//System.out.println("nWordsHam = " +nWordsHam);
//System.out.println("nWordsSpam = " + nWordsSpam);
// gw:
it = vocab_stat.entrySet().iterator();
ws = null;
while (it.hasNext()) {
Map.Entry pairs = (Map.Entry) it.next();
String is = (String) pairs.getKey();
ws = (WordStat) pairs.getValue();
ws.p_w_given_ham_log = Math.log(ws.counterHam *1.0 / nWordsHam);
ws.p_w_given_spam_log = Math.log(ws.counterSpam *1.0 / nWordsSpam);
//vocab_stat.put(is,ws);
}
// TODO: further confirm arg index
//test sets
File test_dir_location = new File( args[1] );
// TODO: verify below works
// Listing of the directory (should contain 2 subdirectories: ham/ and spam/)
File[] test_dir_listing = new File[0];
// Check if the cmd line arg is a directory and list it
if ( test_dir_location.isDirectory() )
{
test_dir_listing = test_dir_location.listFiles();
}
else
{
System.out.println( "- Error: cmd line arg not a directory.\n" );
Runtime.getRuntime().exit(0);
}
// TODO: verify File[0]
// Listings of the two sub-directories (ham/ and spam/)
File[] test_listing_ham = new File[0];
File[] test_listing_spam = new File[0];
// Check that there are 2 sub-directories
boolean test_hamFound = false; boolean test_spamFound = false;
for (int i=0; i<test_dir_listing.length; i++) {
if (test_dir_listing[i].getName().equals("ham")) { test_listing_ham = test_dir_listing[i].listFiles(); test_hamFound = true;}
else if (test_dir_listing[i].getName().equals("spam")) { test_listing_spam = test_dir_listing[i].listFiles(); test_spamFound = true;}
}
if (!test_hamFound || !test_spamFound) {
System.out.println( "- Error: specified test directory does not contain ham and spam subdirectories.\n" );
Runtime.getRuntime().exit(0);
}
// // Print out the number of messages in ham and in spam
// System.out.println( "\t number of test ham messages is: " + test_listing_ham.length );
// System.out.println( "\t number of test spam messages is: " + test_listing_spam.length );
// metrics
int true_positives = 0; //spam classified as spam
int true_negatives = 0; //ham classified as ham
int false_positives = 0; //ham ... as spam
int false_negatives = 0; //spam... as ham
// Test starts
// The ham mail
for ( int i = 0; i < test_listing_ham.length; i ++ )
{
FileInputStream i_s = new FileInputStream( test_listing_ham[i] );
BufferedReader in = new BufferedReader(new InputStreamReader(i_s));
String line;
String word;
// gw:
double p_msg_ham_log = 0.0;
double p_msg_spam_log = 0.0;
p_msg_ham_log += p_ham_log;
p_msg_spam_log += p_spam_log;
// gw:
while ((line = in.readLine()) != null) // read a line
{
StringTokenizer st = new StringTokenizer(line); // parse it into words
while (st.hasMoreTokens())
{
word = st.nextToken().replaceAll("[^a-zA-Z]","");
word = word.toLowerCase();
if ( !word.equals("") ) { // if string isn't empty
// gw:
if(vocab_stat.containsKey(word)){
WordStat iws = vocab_stat.get(word);
double ip_w_given_ham_log = iws.p_w_given_ham_log;
double ip_w_given_spam_log = iws.p_w_given_spam_log;
p_msg_ham_log += ip_w_given_ham_log ;
p_msg_spam_log += ip_w_given_spam_log ;
}
// gw:
}
}
}
in.close();
if (p_msg_spam_log > p_msg_ham_log) false_positives ++;
else true_negatives ++;
}
// The spam mail
for ( int i = 0; i < test_listing_spam.length; i ++ )
{
FileInputStream i_s = new FileInputStream( test_listing_spam[i] );
BufferedReader in = new BufferedReader(new InputStreamReader(i_s));
String line;
String word;
// gw:
double p_msg_ham_log = 0.0;
double p_msg_spam_log = 0.0;
p_msg_ham_log += p_ham_log;
p_msg_spam_log += p_spam_log;
// gw:
while ((line = in.readLine()) != null) // read a line
{
StringTokenizer st = new StringTokenizer(line); // parse it into words
while (st.hasMoreTokens())
{
word = st.nextToken().replaceAll("[^a-zA-Z]","");
word = word.toLowerCase();
if ( ! word.equals("") ) {
// gw:
if(vocab_stat.containsKey(word)){
WordStat iws = vocab_stat.get(word);
double ip_w_given_ham_log = iws.p_w_given_ham_log;
double ip_w_given_spam_log = iws.p_w_given_spam_log;
p_msg_ham_log += ip_w_given_ham_log ;
p_msg_spam_log += ip_w_given_spam_log ;
}
// gw:
}
}
}
in.close();
if (p_msg_spam_log > p_msg_ham_log) true_positives ++;
else false_negatives ++;
}
System.out.println("Result 2: ");
System.out.println("Lower-case\t\ttrue spam\ttrue ham");
System.out.println("Classified spam:\t"+true_positives+"\t\t"+false_positives);
System.out.println("Classified ham: \t"+false_negatives+"\t\t"+ true_negatives);
System.out.println("");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic String getGANModelDirectory() {\n\t\treturn GANProcess.PYTHON_BASE_PATH+\"LodeRunnerGAN\";\n\t}",
"void setDirectory(File dir);",
"@attribute(value = \"\", required = true)\t\r\n\tpublic void setDir(String dir) {\r\n\t\tthis.dir = new File(dir);\r\n\t}",
"public void startTrainingMode() {\n\t\t\r\n\t}",
"@Override\r\n\t\tpublic void setDir(String dir)\r\n\t\t\t{\n\t\t\t\t\r\n\t\t\t}",
"@Raw @Model\r\n\tvoid setDir(Directory dir) {\r\n\t\tthis.dir = dir;\r\n\t\tthis.move(dir);\r\n\t\t\r\n\t}",
"private void setupWorkingDir(Execute exe) {\r\n if (dir == null) {\r\n dir = getProject().getBaseDir();\r\n }\r\n else if (!dir.exists() || !dir.isDirectory()) {\r\n throw new BuildException(dir.getAbsolutePath() + \" is not a valid directory\", getLocation());\r\n }\r\n exe.setWorkingDirectory(dir);\r\n }",
"public IStatus prepareRuntimeDirectory(IPath baseDir);",
"public void setDir(File dir) {\n this.dir = dir;\n }",
"public void run(State state) throws IllegalNumberOfArgumentsException,\r\n InvalidPathException {\r\n String[] parameters = state.getParameters();\r\n if (parameters.length == 0) {\r\n throw new IllegalNumberOfArgumentsException(\r\n \"Mkdir requires a path to a directory to create.\");\r\n }\r\n // make a new directory for each path parameter\r\n for (String path : parameters) {\r\n path = State.cleanDirectoryPath(path);\r\n // get the name of the new directory and the path to its parent\r\n String[] separatedPath = state.separatePathName(path);\r\n String name = separatedPath[0];\r\n String parentPath = separatedPath[1];\r\n if (name.matches(\"/*\")) {\r\n throw new InvalidPathException(path);\r\n }\r\n try {\r\n // check that the name and parent's path are valid\r\n if (name.matches(State.ILLEGAL_CHARACTERS) || name\r\n .substring(0, name.length() - 1).contains(\"/\")) {\r\n throw new IllegalNameException(name);\r\n }\r\n // get the parent directory\r\n Directory parentDir = Navigate.navigateToDirectory(state, parentPath);\r\n //System.out.println(\"parent data: \" + parentDir.getData());\r\n //System.out.println(\"name: \" + name);\r\n String newPath = parentDir.getData() + name;\r\n // check that this file does not already exist\r\n if (parentDir.getChild(newPath) == null) {\r\n // create the new directory\r\n parentDir.addChild(name);\r\n state.addMessage(\"Created directory: \" + newPath + \"\\n\");\r\n } else {\r\n state.addMessage(newPath + \" already exists\\n\");\r\n }\r\n } catch (InvalidPathException e) {\r\n state.addMessage(\"Could not add directory \" + path + \" because \"\r\n + parentPath + \" does not exist.\\n\");\r\n } catch (IllegalNameException e) {\r\n state.addMessage(\"Could not add directory \" + path\r\n + \" because it contains illegal characters.\\n\");\r\n }\r\n }\r\n }",
"public static void main (String [] args) throws Exception { \n//\t\tconf.setMapperClass(DadaMapper.class);\n//\t\tconf.setReducerClass(DataReducer.class);\n\t\t\n//\t\tConfiguration conf = new Configuration(); \n//\t\tconf.set(\"fs.default.name\", \"hdfs://zli:9000\"); \n//\t\tconf.set(\"hadoop.job.user\", \"hadoop\"); \t\t \n//\t\tconf.set(\"mapred.job.tracker\", \"zli:9001\");\n\t\t\n\t\tJob job = new Job(); \n\t\tjob.setJarByClass(NBModelTestJob.class);\n\t\tjob.getConfiguration().set(\"fs.defaultFS\", \"hdfs://NYSJHL101-142.opi.com:8020\"); \n\t\tjob.getConfiguration().set(\"hadoop.job.user\", \"hdfs\"); \t\t \n\t\tjob.getConfiguration().set(\"mapred.job.tracker\", \"NYSJHL101-144.opi.com:8021\");\n\t\tjob.getConfiguration().set(\"trainpath\", args[0]);\n\t\tFileInputFormat.addInputPath(job, new Path(args[1]));\n\t\tFileOutputFormat.setOutputPath(job, new Path(args[2]));\n\t\tFileSystem hdfs = FileSystem.get(job.getConfiguration());\n\t\t\t\t\n\t\tjob.setMapperClass(DataMapper.class);\n\t\tjob.setReducerClass(DataReducer.class);\n\t\tjob.setCombinerClass(DataCombiner.class);\n\t\tjob.setOutputKeyClass(Text.class);\n\t\tjob.setOutputValueClass(Text.class);\n\t\tjob.setNumReduceTasks(10);\n\t\t\n\t\tSystem.exit(job.waitForCompletion(true) ? 0 : 1);\n\t\t\n\t}",
"public void setAndCreateDirPath(String dirname) {\r\n\t File newPath = new File(dirname); \r\n\t \r\n\t if(!newPath.isDirectory()) {\r\n\t\t newPath.mkdirs();\r\n\t }\r\n\t \r\n\t directory = newPath;\r\n }",
"private void setWorkDiretory() {\n\t\tthis.workDiretory = System.getProperty(\"user.dir\");\n\t}",
"public void setDir(File dir) {\n _sourceDir = dir;\n }",
"public void setDir(File dir)\n {\n this.dir = dir;\n }",
"private void processDir(){\n // get the location of ISAW code base\n String isaw_home=SharedData.getProperty(\"ISAW_HOME\");\n if(isaw_home==null)\n throw new InstantiationError(\"Could not find directory:ISAW_HOME is null\");\n isaw_home=FilenameUtil.setForwardSlash(isaw_home+\"/\");\n\n // get the name of the directory to check\n String dir=FilenameUtil.setForwardSlash(isaw_home\n +\"DataSetTools/parameter/\");\n\n // check that the directory is okay to work with\n if(DEBUG) System.out.println(\"Looking in \"+dir);\n File paramDir=new File(dir);\n if( !(paramDir.exists()) || !(paramDir.isDirectory()) )\n throw new InstantiationError(\"Could not find directory \" + dir);\n\n // get the list of all possible classes\n File[] files=paramDir.listFiles();\n String filename=null;\n for( int i=0 ; i<files.length ; i++ ){\n filename=checkName(files[i].toString(),isaw_home.length());\n if(filename!=null) addParameter(filename);\n }\n \n \n\n dir=FilenameUtil.setForwardSlash(isaw_home\n +\"gov/anl/ipns/Parameters/\");\n\n // check that the directory is okay to work with\n if(DEBUG) System.out.println(\"Looking in \"+dir);\n paramDir=new File(dir);\n if( !(paramDir.exists()) || !(paramDir.isDirectory()) )\n throw new InstantiationError(\"Could not find directory \" + dir);\n\n // get the list of all possible classes\n files=paramDir.listFiles();\n filename=null;\n for( int i=0 ; i<files.length ; i++ ){\n filename=checkName(files[i].toString(),isaw_home.length());\n if(filename!=null) addParameter(filename);\n }\n\n }",
"private void loadDataTraining(String location) throws IOException {\r\n\r\n File parentDir = new ClassPathResource(location).getFile();\r\n \ttrainWriter.write(\"Data folder found.\");\r\n\r\n // Divide all data to training and testing datasets\r\n FileSplit filesInDir = new FileSplit(parentDir, allowedExtensions, randNumGen);\r\n \r\n // Create ParentPathLabelGenerator, that will parse the parent dir and use the name of the subdirectories as label/class names\r\n ParentPathLabelGenerator labelMaker = new ParentPathLabelGenerator();\r\n BalancedPathFilter pathFilter = new BalancedPathFilter(randNumGen, allowedExtensions, labelMaker);\r\n trainWriter.write(\"Label generators created.\");\r\n \r\n // Split the image files into train and test. Specify the train test split as 80%,20%\r\n InputSplit[] filesInDirSplit = filesInDir.sample(pathFilter, 80, 20);\r\n InputSplit trainDataInputSplit = filesInDirSplit[0];\r\n InputSplit testDataInputSplit = filesInDirSplit[1];\r\n trainWriter.write(\"Data splited to train and test parts as 80% and 20%.\");\r\n \r\n /*\r\n * Specifying a new record reader (one for testing on dataset, one for testing on real data, one for training)\r\n * with the height and width you want the images to be resized to.\r\n * Note that the images in this example are all of different size\r\n * They will all be resized to the height and width specified below\r\n * */\r\n ImageRecordReader trainRecordReader = new ImageRecordReader(inputShape[1],inputShape[2],inputShape[0],labelMaker);\r\n trainRecordReader.initialize(trainDataInputSplit);\r\n\r\n ImageRecordReader testRecordReader = new ImageRecordReader(inputShape[1],inputShape[2],inputShape[0], labelMaker);\r\n testRecordReader.initialize(testDataInputSplit);\r\n trainWriter.write(\"Data iterators created successfully.\");\r\n \r\n // Get the number of labels, ImageRecordReader founded in dir and check it\r\n int outputNum = trainRecordReader.numLabels();\r\n\r\n // Init iterators with datasets\r\n trainIterator = new RecordReaderDataSetIterator(trainRecordReader, batchSizeTraining, labelIndex, outputNum);\r\n trainIterator.setCollectMetaData(true);\r\n testIterator = new RecordReaderDataSetIterator(testRecordReader, batchSizeTesting, labelIndex, outputNum);\r\n testIterator.setCollectMetaData(true);\r\n trainWriter.write(\"Data iterators setted to collect metadata.\");\r\n }",
"void setWorkingDirectory( String workingDirectory );",
"public void setOutputDirectory(String dir) {\n\t\tnew LabeledText(\"Output directory:\").setText(dir);\n\t}",
"public void createTestDir() {\n\t\tworkDir = new File(System.getProperty(\"test.dir\", \"target\"));\n\t}",
"private void makeDirectory() {\n String userHome = System.getProperty(\"user.home\");\n wnwData = new File(userHome + \"/.wnwdata\");\n wnwData.mkdirs();\n\n makeCampaignChallengesFile();\n makeCustomChallengesFile();\n makeProgressFile();\n makeSettingsFile();\n }",
"void setWorkingDirectory(String workingDirectory);",
"public static void setInputDir(Configuration conf, String path) {\n conf.set(\"mapred.input.dir\", path);\n }",
"public void trainTest(String template, int maxSize, int[] trainSet, int[] testSet, Reader examples, String directory, Algorithm mode) throws IOException {\n trainTest_impl(template, maxSize, trainSet, testSet, examples, new File(directory+\"/train.arff\"), new File(directory+\"/train.arff\"), mode);\n }",
"public void setupDrive(){\n // Place Dove/ into base of drive\n new File(drv.toString() + File.separator + folderName).mkdir();\n //upload preset content if required\n isSetup = true;\n }",
"void setTrainData(DataModel trainData);",
"public void setDir(int dir) {\n this.dir = dir;\n }",
"protected void setWorkingDirectory(File dir) {\n\t\tthis.dir = dir;\n\t}",
"public void updateLabtainersPath(){\n labsPath = new File(labtainerPath + File.separator + \"labs\");\n labChooser.setCurrentDirectory(labsPath); \n }",
"public abstract void setTrainParams(ClassificationMethod method,URL model,Map<String,Object> args) throws ClassificationException;",
"protected void init()\r\n\t{\n\t\tif (ConfigManager.getInstance().getIsCrossClassify() && WekaTool.dataStageOn)\r\n\t\t{\r\n\t\t\t//System.out.println(\"in init for data stage\");\r\n\t\t\tsrcDirUrl = ConfigManager.getInstance().getTrainPath();\r\n\t\t\tdestDirUrl = ConfigManager.getInstance().getTrainPath() +\r\n\t\t\t File.separator + \"output\";\r\n\t\t\t//System.out.println(\"srcDirUrl = \" + srcDirUrl);\r\n\t\t\t//System.out.println(\"destDirUrl = \" + destDirUrl);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t//System.out.println(\"here, good\");\r\n\t\t\tsrcDirUrl = getSrcDirUrl();\r\n\t\t\tdestDirUrl = getDestDirUrl();\r\n\t\t}\r\n\t\tdatalibSVMUrl = getLibSVMDirUrl();\r\n\t\ttry {\r\n\t\t\tsrcDir = Utils.getDir(srcDirUrl);\r\n\t\t\tdestDir = Utils.getDir(destDirUrl);\r\n\t\t} catch (Exception e)\r\n\t\t{\r\n\t\t}\r\n\t}",
"public static void main(String[] args) {\n int arg = 0;\n int seedNum = 100;\n int trainNum = 0;\n int testNum = 0;\n boolean treeFlag = false;\n boolean textFlag = false;\n //handle options\n while (args[arg].startsWith(\"-\")) {\n switch(args[arg]) {\n case (\"-tree\"):\n treeFlag = true;\n break;\n case (\"-text\"):\n textFlag = true;\n break;\n case (\"-seednum\"):\n arg++;\n seedNum = Integer.parseInt(args[arg]);\n break;\n case (\"-trainnum\"):\n arg++;\n trainNum = Integer.parseInt(args[arg]);\n break;\n case (\"-testnum\"):\n arg++;\n testNum = Integer.parseInt(args[arg]);\n break;\n case (\"-trainall\"):\n trainNum = Integer.MAX_VALUE;\n break;\n case (\"-testall\"):\n testNum = Integer.MAX_VALUE;\n break;\n default:\n throw new IllegalArgumentException(\"Unrecognized command: \" + args[arg]);\n }\n arg++;\n }\n File sourceDirectory = new File(args[arg]);\n arg++;\n File destinationDirectory = new File(args[arg]);\n\n if(treeFlag && textFlag) {\n System.err.println(\"Both text and tree flags detected, which one do you want?\");\n System.exit(2);\n }\n\n if (trainNum == Integer.MAX_VALUE && testNum == Integer.MAX_VALUE) {\n System.err.println(\"Can't max both train and test values!\");\n System.exit(3);\n }\n\n if (!sourceDirectory.isDirectory()) {\n System.err.println(\"ERROR: \" + sourceDirectory.getName() + \"is not a directory!\");\n System.exit(4);\n }\n if (!destinationDirectory.exists()) {\n destinationDirectory.mkdirs();\n } else if (!destinationDirectory.isDirectory()) {\n System.err.println(\"ERROR: \" + destinationDirectory.getName() + \"is not a directory!\");\n System.exit(5);\n }\n\n if (treeFlag) {\n createSeededFiles(\"tree\", seedNum, trainNum, testNum, sourceDirectory, destinationDirectory);\n } else if (textFlag) {\n createSeededFiles(\"text\", seedNum, trainNum, testNum, sourceDirectory, destinationDirectory);\n }\n }",
"public void train ()\t{\t}",
"public void setDir(File d) {\r\n this.dir = d;\r\n }",
"public void train()\n\t{\n\t\tdbiterator = DBInstanceIterator.getInstance();\n System.out.println(\"Start Training ..\");\n\n\t\ttry {\n\t\t\tSystem.out.println(\"Training Text %..\");\n\t\t\ttrainText();\n\n\t\t\tSystem.out.println(\"Training Complex %..\");\n\t\t\ttrainCombined();\n\n\t\t\tSystem.out.println(\"Training Feature %..\");\n\t\t\ttrainFeatures();\n\n\t\t\tSystem.out.println(\"Training Lexicon %..\");\n\t\t\t//trainLexicon();\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}",
"public void setBasedir( File basedir )\n {\n this.basedir = basedir;\n }",
"@Override\n\tpublic void setWorkingDir(String workingDir) {\n\t\tmodel.setWorkingDir(workingDir);\n\t}",
"public void setDir(String dir) {\n // Do this before setting the value\n boolean dirChanged = dir != null && !dir.equals(this.getDir());\n this.dir = Paths.get(dir);\n if(dirChanged) {\n this.dirChanged();\n }\n }",
"public void setHarvestedDataDir(String val) {\n\n\t\tthis.harvestedDataDir = val;\n\n\t}",
"public void setCurrentDirectory(File dir) {\r\n\tif (dir == null) dir = new File(System.getProperty(\"user.home\"));\r\n\r\n\tdir = makeAbsolute(dir);\r\n\r\n\t/**\r\n\t * Note that we compare literal paths, not canonical\r\n\t * paths. If they want the chooser to represent the\r\n\t * files at the end of a different route to the same\r\n\t * place, that's perfectly legitimate. See NextStep\r\n\t * for e.g.\r\n\t */\r\n\tif (curDir == null || !curDir.equals(dir)) {\r\n\t invalidateCache();\r\n\t File oldDir = curDir;\r\n\t curDir = dir;\r\n\t firePropertyChange(\"currentDirectory\", oldDir, dir);\r\n\t fireContentsChanged();\r\n\t}\r\n }",
"public void TrainDataset(){\n\t\ttry{\n\t\t\t//Testing delegate method\n\t\t\tMessageController.logToConsole(\"Hey, I'm from train button\");\n\t\t\t\n\t\t\t//Pass in the real training dataset\n\t\t\tfindSuitableK(new String[]{\"Hello\", \"World\"});\n\t\t\t\n\t\t\t//Pass in the 'k' and 'query string'\n\t\t\tfindKNN(2, \"anything\");\n\t\t}\n\t\tcatch(Exception ex){\n\t\t\tthrow ex;\n\t\t}\n\t\tfinally{\n\t\t\t\n\t\t}\n\t}",
"@Override\n public void initDefaultCommand() {\n setDefaultCommand(new DriveTrainDefault());\n }",
"public MkdirCommand() {\r\n // The name of the mkdir command\r\n name = \"mkdir\";\r\n\r\n // The description of the mkdir command\r\n description = \"Creates a directory ar the given path. The given path can\"\r\n + \" be a full path or a path relative to the working directory\";\r\n\r\n // The parameters for the mkdir command and their description\r\n parameters.put(\"DIR\", \"The path that points to where the new directory\"\r\n + \" should be created.\");\r\n }",
"public createDirectory_args setPath(String path) {\n this.path = path;\n return this;\n }",
"TrainingTest createTrainingTest();",
"void setup(CommandLine cmd);",
"public void dataConfig(String dir) {\n VersatileDataSource source = new CSVDataSource(new File(dir + \"trainData/iris.csv\"), false,\n CSVFormat.DECIMAL_POINT);\n VersatileMLDataSet data = new VersatileMLDataSet(source);\n data.defineSourceColumn(\"sepal-length\", 0, ColumnType.continuous);\n data.defineSourceColumn(\"sepal-width\", 1, ColumnType.continuous);\n data.defineSourceColumn(\"petal-length\", 2, ColumnType.continuous);\n data.defineSourceColumn(\"petal-width\", 3, ColumnType.continuous);\n\n // Define the column that we are trying to predict.\n ColumnDefinition outputColumn = data.defineSourceColumn(\"species\", 4,\n ColumnType.nominal);\n data.analyze();\n data.defineSingleOutputOthersInput(outputColumn);\n\n EncogModel model = new EncogModel(data);\n\n model.selectMethod(data, \"feedforward\");\n data.normalize();\n System.out.println(data.get(0).toString());\n NeuralUtils.dataToFile(data, dir + \"trainData/test.csv\");\n\n NormalizationHelper helper = data.getNormHelper();\n System.out.println(helper.toString());\n NeuralUtils.persistHelper(helper, dir + \"resources/Helper/helper.txt\");\n\n }",
"public static void setup(String[] args) {\n\t\tif (parametersContains(\"classpath\", args)) {\r\n\t\t\tRESOURCE_TYPE = RessourceType.CLASSPATH;\r\n\t\t\tCobra2DEngine.setupEnvironment(RESOURCE_TYPE);\r\n\t\t\tROOT_PATH_STR = \"./src/main/resources/\";\r\n\t\t} else if (parametersContains(\"currentDir\", args)) {\r\n\t\t\tRESOURCE_TYPE = RessourceType.INSTALL_DIR;\r\n\t\t\tCobra2DEngine.setupEnvironment(RESOURCE_TYPE);\r\n\t\t\tROOT_PATH_STR = \".\";\r\n\t\t} else {\r\n\t\t\tSystem.out\r\n\t\t\t\t\t.println(\"Start this runtime environment with option -classpath to load all resources from your classpath or with -currentDir to load all resources from current directory ./game-resources/.\");\r\n\t\t\tSystem.exit(1);\r\n\t\t}\r\n\r\n\t\tROOT_PATH = new File(ROOT_PATH_STR);\r\n\t\tRESOURCE_PATH = new File(ROOT_PATH_STR + File.separator\r\n\t\t\t\t+ RESOURCE_PATH_STR);\r\n\t\tIMAGE_RESOURCE_PATH = new File(ROOT_PATH_STR + File.separator\r\n\t\t\t\t+ RESOURCE_PATH_STR + File.separator + IMAGE_FOLDER_STR);\r\n\r\n\t\tlog.info(\"Setting up path settings for runtime.\");\r\n\t\tlog.info(\"Resource loading strategy : \" + RESOURCE_TYPE);\r\n\t\tlog.info(\"Root path (path): \" + ROOT_PATH.getPath());\r\n\t\tlog.info(\"Root path (absolute): \"\r\n\t\t\t\t+ ROOT_PATH.getAbsolutePath());\r\n\t\tlog.info(\"Resource path (path): \" + RESOURCE_PATH.getPath());\r\n\t\tlog.info(\"Resource path (absolute): \"\r\n\t\t\t\t+ RESOURCE_PATH.getAbsolutePath());\r\n\t\tlog.info(\"Image resource path (path): \"\r\n\t\t\t\t+ IMAGE_RESOURCE_PATH.getPath());\r\n\t\tlog.info(\"Image resource path (absolute): \"\r\n\t\t\t\t+ IMAGE_RESOURCE_PATH.getAbsolutePath());\r\n\t}",
"public static void main(String[] args) throws Exception {\n // TODO Auto-generated method stub\n if (args.length != 3) {\n System.err.println(\"Enter valid number of arguments <Inputdirectory> <Outputlocation>\");\n System.exit(0);\n }\n ToolRunner.run(new Configuration(), new MovieLensTopMovies(), args);\n }",
"public static void main(String[] args) { String dirname = \"/home/diego/IdeaProjects/JAVAStuff/src/tmp/dirTest.txt\";\n// File d = new File(dirname);\n// d.mkdirs();\n//\n File file = null;\n String[] paths;\n\n try {\n file = new File(\"/home/diego/IdeaProjects/JAVAStuff/src\");\n paths = file.list();\n\n for(String s: paths) {\n System.out.println(s);\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n\n }",
"public void setRootDir(String rootDir);",
"public void train(){\n recoApp.training(idsToTest);\n }",
"public void train(SieveDocuments trainingInfo) {\r\n\t\t// no training\r\n\t}",
"public static void main(String args[]){\n\t\t//parameters that can be modified\n\t\tint topicNum=100;\n\t\tString sourceID=\"1864252027/\";\n\t\tint subnetworkSize=1100;\n\t\tString dir=\"sampleTest/\"+sourceID+subnetworkSize+\"/\";\n\t\tString fileName=\"ldaInput.txt\";\n\t\tint iterationNum=1000;\n\t\t\n\t\t//read training data from file\n\t\tSystem.out.println(\"loading files\");\n\t\tGraph network=GraphOperator.getFromFile(dir+\"sample.network\");\n\t\tHashMap<String,Message>trainingStatusMap=MessageListOperator.readMessageFromFile(dir+\"trainingSet.status\");\n\t\tHashMap<String,Message>commentMap=MessageListOperator.readMessageFromFile(dir+\"samplePreDoc.comment\");\n\t\t\n\t\tDocumentAssign.relateMessageToNetwork(network,trainingStatusMap,commentMap);\n\t\tDocumentAssign.optimizedAssign(network,dir,fileName);\n\t\t\n\t\tSystem.out.println(\"Training\");\t\n\t\t//training with Optimized assignment\n\t\tLDA_InfluMax.estimationFromScratch(50/((double)topicNum),0.01,topicNum,\n\t\t\t\titerationNum,iterationNum/2,dir,fileName,50);\n\t}",
"protected String setPathToResourcesIfNotProvided(String[] args) {\n if (args.length == 0) {\n args = new String[1];\n args[0] = \"./src/main/resources/Code Test\";\n }\n return args[0];\n }",
"private static void checkArgsAndSetUp()\n {{\n File outDir= new File( arg_outDirname );\n\n if ( outDir.exists() ) {\n\t if ( !outDir.isDirectory() ) {\n\t System.err.println( PROGRAM_NAME+ \n\t\t\t\t\": output directory is not a directory; \"); \n\t System.err.println( \"\\t\"+ \"dir=\\\"\"+ arg_outDirname+ \"\\\", \" );\n\t System.err.println( \"\\t\"+ \"please specify an empty directory.\" );\n\t System.exit(-1);\n\t }\n\t if ( outDir.list().length > 0 ) {\n\t System.err.println( PROGRAM_NAME+ \n\t\t\t\t\": output directory is not empty; \"); \n\t System.err.println( \"\\t\"+ \"dir=\\\"\"+ arg_outDirname+ \"\\\", \" );\n\t System.err.println( \"\\t\"+ \"please specify an empty directory.\" );\n\t System.exit(-1);\n\t }\n } else {\n\t outDir.mkdir();\n }\n }}",
"@DataBoundSetter\n public void setDir(String dir) {\n this.dir = dir;\n }",
"public void setShHarvestedDataDir(String val) {\n\n\t\tthis.shHarvestedDataDir = val;\n\n\t}",
"private void trainNetwork(long iterations) {\n\t\ttrainer.startTraining(network, iterations);\r\n\r\n\t}",
"Path getBaseInputDir();",
"public void setSource(String sourceDir)\n {\n this.sourceDir = new File(sourceDir);\n }",
"public static void main(String[] args){\n File f = new File(System.getProperty(\"user.dir\"));\n if(os){\n path = f.toString()+\"\\\\YuuTubevideos\";\n }else{\n path = f.toString()+\"/YuuTubevideos\";\n }\n start_page();\n }",
"@BeforeClass\n\tpublic static void setUpClass() {\n\t\tString resourcesDir = System.getProperty(\"user.dir\") + File.separator + \"src\" +\n File.separator + \"test\" + File.separator + \"resources\";\n\n tsmResources = resourcesDir + File.separator + \"tsm\";\n //testDir = new File(resourcesDir, \"tsm-output\"); \n\t}",
"private void createTDenseDirectory() {\n File dense = new File(DenseLayerPath);\n dense.mkdir();\n }",
"public TestLearningAPI(String arg0) throws GateException,\n MalformedURLException {\n super(arg0);\n if(!initialized) {\n Gate.init();\n learningHome = new File(new File(Gate.getGateHome(), \"plugins\"),\n \"Learning\");\n Gate.getCreoleRegister().addDirectory(learningHome.toURI().toURL());\n initialized = true;\n }\n }",
"private void setTrainingData() throws IOException {\r\n\t\ttrainIdBodyMap = readInIdBodiesMap(new File(TRAIN_BODIES_CSV_LOCATION));\r\n\t\ttrainStances = readStances(new File(TRAIN_STANCES_CSV_LOCATION));\r\n\r\n\t}",
"public void getPredictions() throws IOException, InterruptedException{\n //splitColsDataFiles();\n for(String learner:listLearners){\n File modelsFolder = new File(\"models/\"+learner);\n File[] IPFolders = modelsFolder.listFiles();\n for (File nodeFolder : IPFolders) {\n if (nodeFolder.isDirectory()) {\n File[] filesInFolder = nodeFolder.listFiles();\n ArrayList<String> filesINFolderAL = new ArrayList<String>();\n for(int i=0;i<filesInFolder.length;i++){\n filesINFolderAL.add(filesInFolder[i].getName());\n }\n if(filesINFolderAL.contains(model) && filesINFolderAL.contains(\"data.properties\")){\n System.out.println(\"Generating data for: \" + nodeFolder.getPath());\n // read properties file\n // get indices of variables\n // paste appropriate cols in models/temp\n // change commands below with appropriate data\n Properties dataProps = loadProps(nodeFolder.getPath()+\"/data.properties\");\n ArrayList<Integer> indices = new ArrayList<Integer>();\n String featuresS = dataProps.getProperty(\"sampled_variables\");\n if(featuresS!=null){\n String[] featuresArray = featuresS.split(\" \");\n for(int i=0;i<featuresArray.length;i++){\n indices.add(i, Integer.parseInt(featuresArray[i]));\n }\n // the order of indices is important\n Collections.sort(indices);\n\n String pasteTrainTempCommand = \"paste -d',' \";\n for(int i=0;i<indices.size();i++){\n pasteTrainTempCommand += \" models/temp/tr_\" + (indices.get(i)+1) + \".csv\";\n }\n pasteTrainTempCommand += \" models/temp/tr_targets.csv > models/temp/tr_temp.csv\";\n System.out.println(pasteTrainTempCommand);\n Process pasteTrainTemp_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", pasteTrainTempCommand});\n pasteTrainTemp_process.waitFor();\n\n\n String pasteTestTempCommand = \"paste -d',' \";\n for(int i=0;i<indices.size();i++){\n pasteTestTempCommand += \" models/temp/te_\" + (indices.get(i)+1) + \".csv\";\n }\n pasteTestTempCommand += \" models/temp/te_targets.csv > models/temp/te_temp.csv\";\n System.out.println(pasteTestTempCommand);\n Process pasteTestTemp_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", pasteTestTempCommand});\n pasteTestTemp_process.waitFor();\n \n // Add a new case when adding a new learner\n if(learner.equals(\"gpfunction\") || learner.equals(\"ruletree\") || learner.equals(\"rulelist\")){ // JAVA\n String predictTrain_command = \"java -jar learners/\" + learner + \".jar -predict models/temp/tr_temp.csv\"\n + \" -model \" + nodeFolder + \"/\" + model \n + \" -o \" + nodeFolder + \"/predsTrain_\" + model ;\n Process predictTrain_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", predictTrain_command});\n predictTrain_process.waitFor();\n String predictTest_command = \"java -jar learners/\" + learner + \".jar -predict models/temp/te_temp.csv\"\n + \" -model \" + nodeFolder + \"/\" + model \n + \" -o \" + nodeFolder + \"/predsTest_\" + model ;\n Process predictTest_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", predictTest_command});\n predictTest_process.waitFor();\n }else if(learner.equals(\"mplcs\")){// C OR C++\n String predictTrain_command = \"learners/\" + learner + \" -predict models/temp/tr_temp.csv\"\n + \" -model \" + nodeFolder + \"/\" + model \n + \" -o \" + nodeFolder + \"/predsTrain_\" + model+\".csv\" ;\n Process predictTrain_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", predictTrain_command});\n predictTrain_process.waitFor();\n String predictTest_command = \"learners/\" + learner + \" -predict models/temp/te_temp.csv\"\n + \" -model \" + nodeFolder + \"/\" + model \n + \" -o \" + nodeFolder + \"/predsTest_\" + model+\".csv\" ;\n Process predictTest_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", predictTest_command});\n predictTest_process.waitFor();\n }if(learner.equals(\"lccb\")){ // Python\n String predictTrain_command = \"python learners/\" + learner + \".py -predict models/temp/tr_temp.csv\"\n + \" -model \" + nodeFolder + \"/\" + model \n + \" -o \" + nodeFolder + \"/predsTrain_\" + model+\".csv\" ;\n Process predictTrain_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", predictTrain_command});\n predictTrain_process.waitFor();\n String predictTest_command = \"python learners/\" + learner + \".py -predict models/temp/te_temp.csv\"\n + \" -model \" + nodeFolder + \"/\" + model \n + \" -o \" + nodeFolder + \"/predsTest_\" + model+\".csv\" ;\n System.out.println(predictTest_command);\n Process predictTest_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", predictTest_command});\n predictTest_process.waitFor();\n }if(learner.equals(\"SBBJ\")){ // JAVA\n String predictTrain_command = \"java -jar learners/\" + learner + \".jar -predict models/temp/tr_temp.csv\"\n + \" -model \" + nodeFolder + \"/\" + model \n + \" -o \" + nodeFolder + \"/predsTrain_\" + model+\".csv\" ;\n Process predictTrain_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", predictTrain_command});\n predictTrain_process.waitFor();\n String predictTest_command = \"java -jar learners/\" + learner + \".jar -predict models/temp/te_temp.csv\"\n + \" -model \" + nodeFolder + \"/\" + model \n + \" -o \" + nodeFolder + \"/predsTest_\" + model+\".csv\" ;\n Process predictTest_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", predictTest_command});\n predictTest_process.waitFor();\n }\n \n }\n }\n }\n }\n }\n }",
"public static void main(String[] args) {\n\t\tPerceptron p = new Perceptron(new TaruTrainingWrapper(args[0],null));\n\t\t\n\t\t// Training data\n//\t\tString srcTrainFile = \"train.src\"; // contains parses\n//\t\tString refTrainFile = \"train.ref\"; // contains plain text\n\t\tString srcTrainFile = \"test.src\"; // contains parses\n\t\tString refTrainFile = \"test.ref\"; // contains plain text\n\t\t\n\t\t// Read in the training data\n\t\tArrayList<String> srcData = new ArrayList<String>(5000);\n\t\tArrayList<String> refData = new ArrayList<String>(5000);\n\t\t\n\t\ttry{\n\t\t\tBufferedReader sbr = new BufferedReader(new FileReader(srcTrainFile));\n\t\t\tBufferedReader rbr = new BufferedReader(new FileReader(refTrainFile));\n\t\t\tString ref = \"\";\n\t\t\twhile((ref = rbr.readLine()) != null){\n\t\t\t\tString src = sbr.readLine();\n\t\t\t\tif(ref.split(\" +\").length < 31){\n\t\t\t\t\tsrcData.add(src);\n\t\t\t\t\trefData.add(ref.toLowerCase());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tsbr.close();\n\t\t\trbr.close();\n\t\t}catch(FileNotFoundException e){e.printStackTrace();} catch (IOException e) { e.printStackTrace();}\n\t\tSystem.out.println(\"Training on \" + srcData.size() + \" sentences.\");\n\t\t// run the training\n\t\tp.trainAverage(srcData, refData, 5);\n\t}",
"public void setDir( final File dir )\n {\n m_dir = dir;\n }",
"public static void main(String[] args) {\n\n if (args.length < 2 || args.length > 3) {\n System.out.println(\"Usage: BuildDemoData <dir> <file> [<jenaflag>]\");\n System.out.println(\"where <dir> is the output directory\");\n System.out.println(\"where <file> is a properties file\");\n System.out.println(\"where <jenaflag> is any value\");\n System.exit(0);\n }\n\n Properties dataProps = new Properties();\n\n try {\n File props = new File(args[1]);\n FileInputStream fis = new FileInputStream(props);\n dataProps.load((InputStream) fis);\n } catch (Exception e) {\n System.err.println(e.toString());\n e.printStackTrace();\n }\n\n \tModel model = ModelFactory.createDefaultModel();\n try {\n model = getModelFromFiles(dataProps);\n } catch (Exception e) {\n System.err.println(e.toString());\n e.printStackTrace();\n }\n \n System.out.println(\"Writing no inferencing model...\");\n writeModel(model, args[0] + \"simileDemoNoInference.rdf\");\n System.out.println(\"Uninferenced model contains \" + model.size() + \" statements\");\n\n System.out.println(\"Inferencing...\"); \t\n if (args.length == 2) {\n Reasoner reasoner = new SimileReasoner();\n writeModel(reasoner.process(model), args[0] + \"simileDemoMappingInference.rdf\");\n } else {\n Reasoner reasoner = new JenaReasoner();\n writeModel(reasoner.process(model), args[0] + \"simileDemoJenaInference.rdf\");\n }\n \n System.out.println(\"Inferenced model contains \" + model.size() + \" statements\");\n }",
"private static void createSeededFiles(String type, int seedNum, int trainNum, int testNum, File sourceDirectory,\n File destinationDirectory) {\n\n File trainDirectory = new File(destinationDirectory.getAbsolutePath() + \"/train\");\n if(trainNum > 0 && !trainDirectory.exists()) {\n trainDirectory.mkdir();\n }\n File testDirectory = new File(destinationDirectory.getAbsolutePath() + \"/test\");\n if(testNum > 0 && !testDirectory.exists()) {\n testDirectory.mkdir();\n }\n\n //for each language, we want to create a directory for that language, then parse trees/sentences through each of the novels listed there\n File[] languages = sourceDirectory.listFiles();\n File[] trainDirectoryLanguages = new File[languages.length];\n File[] testDirectoryLanguages = new File[languages.length];\n for (int i = 0; i < languages.length; i++) {\n if (languages[i].getName().startsWith(\".\")) {\n continue;\n }\n trainDirectoryLanguages[i] = new File(trainDirectory.getAbsolutePath() + \"/\" + languages[i].getName());\n testDirectoryLanguages[i] = new File(testDirectory.getAbsolutePath() + \"/\" + languages[i].getName());\n if (trainNum > 0)\n makeNewDirectoryIfNotExists(trainDirectoryLanguages[i]);\n if (testNum > 0)\n makeNewDirectoryIfNotExists(testDirectoryLanguages[i]);\n\n File[] novels = languages[i].listFiles();\n for (int j = 0; j < novels.length; j++) {\n if (novels[j].getName().startsWith(\".\")) {\n continue;\n }\n try {\n BufferedReader read = new BufferedReader(new FileReader(novels[j]));\n //name w/o .txt\n String fileShortName = novels[j].getName().substring(0, novels[j].getName().length()-4);\n String line;\n //max number of stuff we want to read is based on our inputs\n int maxFiles = testNum + trainNum;\n long maxLines = (long) maxFiles * (long) seedNum;\n int lineCount = 0;\n int fileCount = 1;\n //File currentFile = createNewNumberedFile(trainDirectoryLanguages[i].getAbsolutePath() + \"/\" + fileShortName, fileCount);\n String pathToUse = (fileCount <= trainNum) ? trainDirectoryLanguages[i].getAbsolutePath() :\n testDirectoryLanguages[i].getAbsolutePath();\n File currentFile = createNewNumberedFile(pathToUse + \"/\" + fileShortName, fileCount);\n PrintWriter pw = new PrintWriter(currentFile);\n\n //this is the part that varies based on calling for text or trees.\n switch (type) {\n case \"text\":\n while ((line = read.readLine()) != null && lineCount < maxLines ) {\n pw.println(line);\n lineCount++;\n //when our lineCount mod seedNum is 0, we want to create another PrintWriter\n if (lineCount % seedNum == 0) {\n fileCount++;\n //put in train or test, depending on our current file count.\n if (fileCount <= maxFiles) {\n pathToUse = (fileCount <= trainNum) ? trainDirectoryLanguages[i].getAbsolutePath() :\n testDirectoryLanguages[i].getAbsolutePath();\n currentFile = createNewNumberedFile(pathToUse + \"/\" + fileShortName, fileCount);\n pw.flush();\n pw.close();\n pw = new PrintWriter(currentFile);\n }\n }\n }\n break;\n case \"tree\":\n //need to build a Treebank... lifting code from HW 3 to aid in this.\n Options op = new Options();\n op.doDep = false;\n op.doPCFG = true;\n op.setOptions(\"-goodPCFG\", \"-evals\", \"tsv\");\n Treebank treeBank = op.tlpParams.diskTreebank();\n treeBank.loadPath(novels[j]);\n Iterator<Tree> it = treeBank.iterator();\n while((it.hasNext()) && lineCount < maxLines) {\n lineCount++;\n Tree t = it.next();\n t.pennPrint(pw);\n if (lineCount % seedNum == 0) {\n fileCount++;\n //put in train or test, depending on our current file count.\n if (fileCount <= maxFiles) {\n pathToUse = (fileCount <= trainNum) ? trainDirectoryLanguages[i].getAbsolutePath() :\n testDirectoryLanguages[i].getAbsolutePath();\n currentFile = createNewNumberedFile(pathToUse + \"/\" + fileShortName, fileCount);\n pw.flush();\n pw.close();\n pw = new PrintWriter(currentFile);\n }\n }\n }\n break;\n }\n pw.flush();\n pw.close();\n //if numlines is not equal to maxlines then we'll remove the last file.\n if (lineCount != maxLines) {\n currentFile = createNewNumberedFile(pathToUse + \"/\" + fileShortName, fileCount);\n currentFile.delete();\n }\n } catch (IOException e) {\n System.err.println(\"Exception caught while reading \" + novels[j] + \":\");\n e.printStackTrace();\n }\n }\n\n\n }\n\n\n }",
"static public void createClusterProfileDir() {\n if (new File(getClusterProfileDir()).exists() == true) {\n return;\n }\n\n String dir = IJ.getDirectory(\"home\") + File.separator + \".MosaicToolSuite\";\n try {\n ShellCommand.exeCmd(\"mkdir \" + dir);\n }\n catch (final IOException e) {\n e.printStackTrace();\n }\n catch (final InterruptedException e) {\n e.printStackTrace();\n }\n\n dir += File.separator + \"clusterProfile\";\n\n try {\n ShellCommand.exeCmd(\"mkdir \" + dir);\n }\n catch (final IOException e) {\n e.printStackTrace();\n }\n catch (final InterruptedException e) {\n e.printStackTrace();\n }\n }",
"public void setToDir(File dir) {\n _destDir = dir;\n }",
"public DecisionLearningTree(String training, String test) {\n\t\ttrainingFile = training;\n\t\ttestFile = test;\n\t\treadTrainingFile();\n\t\troot = readDataFile();\n\t}",
"public void setExtractDir(final String dir) {\n this.extractBaseDir = new File(dir);\n extractBaseDir.mkdirs();\n }",
"public static void main (String[] args) throws IOException {\n if (args.length < 6 || args.length % 2 == 1) {\n System.err.println (\"MENameTagger requires 4 + 2n arguments for n training corpora:\");\n System.err.println (\" state-file feature-file model-file props-file directory1 filelist1 [directory2 filelist2] ...\");\n System.exit (1);\n }\n String stateFile = args[0];\n String featureFile = args[1];\n String modelFile = args[2];\n String configFile = args[3];\n\t\tJetTest.initializeFromConfig (configFile);\n MENameTagger nt = new MENameTagger();\n\t\tnt.initialize (stateFile, featureFile);\n\t\tfor (int pass=1; pass <= 2; pass++) {\n\t\t\tMaxEntNE.pass = pass;\n\t\t\tMaxEntNE.trainingDocCount = 0;\n \tfor (int iarg = 4; iarg<args.length; iarg+=2) {\n \tString directory = args[iarg];\n \tString fileList = args[iarg+1];\n \tnt.train (directory, fileList);\n\t\t\t}\n }\n\t\tnt.mene.createModel();\n nt.store(modelFile);\n\t}",
"public void setDriveTrain(DriveTrain driveTrain) {\r\n this.driveTrain = driveTrain;\r\n }",
"private static void findPath()\r\n {\r\n String temp_path = System.getProperty(\"user.dir\");\r\n char last = temp_path.charAt(temp_path.length() - 1);\r\n if(last == 'g')\r\n {\r\n path = \".\";\r\n }\r\n else\r\n {\r\n path = \"./bag\";\r\n }\r\n \r\n }",
"public static void main(String [] argv) {\n// weka.gui.explorer.Explorer explorer=new weka.gui.explorer.Explorer();\n// String[] file={};\n// explorer.main(file);\n runClassifier(new ExtremeLearningMachine(), argv);\n }",
"@Override\n public void prepareRun(BatchSourceContext context) throws IOException {\n Map<String, String> arguments = new HashMap<>();\n FileSetArguments.setInputPaths(arguments, config.files);\n context.setInput(Input.ofDataset(config.fileSetName, arguments));\n }",
"public void open(){\n try {\n output = new BufferedWriter(new FileWriter(training_path, true));\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public Builder inputFileDir(String inputFileDir) {\n this.inputFileDir = inputFileDir;\n return this;\n }",
"public void setImageDir(File imageRepDir) {\n\t\tFileDataPersister.getInstance().put(\"gui.configuration\", \"image.repository\", imageRepDir.getPath());\n\t\tRepository.getInstance().setRepository(imageRepDir);\n\t\tthis.getSelectedGraphEditor().repaint();\n\t}",
"public Drivetrain() {\n // Use inches as unit for encoder distances\n m_leftEncoder.setDistancePerPulse(initialDistancePerPulse);\n m_rightEncoder.setDistancePerPulse(initialDistancePerPulse);\n resetEncoders();\n }",
"public Builder setDirName(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n dirName_ = value;\n onChanged();\n return this;\n }",
"public void setDirFlag(boolean dirFlag) { this.dirFlag = dirFlag; }",
"public static void main(String[] args) {\n\t\t\r\n\t\tFile f=new File(\"C:\\\\Users\\\\DELL\\\\Desktop\\\\\",\"CheckFolder\");\r\n\t\t\r\n\t\tf.mkdir();\r\n\t\t\r\n\t\tSystem.out.println(f.isDirectory());\r\n\t\t\r\n\t\tSystem.out.println(f.getName());\r\n\t\t\r\n\t\tSystem.out.println(f.getParent());\r\n\t\t\r\n\t\t\r\n\t\t\r\n\r\n\t}",
"protected void initialize() {\n Robot.m_drivetrain.resetPath();\n Robot.m_drivetrain.addPoint(0, 0);\n Robot.m_drivetrain.addPoint(3, 0);\n Robot.m_drivetrain.generatePath();\n \n\t}",
"public static void main(final String[] args) {\n \tString enginePath = engines[8];\n\t\tEngineParameter eparams = new EngineParameter(enginePath);\n\n\t\tString url = \"http://files.grouplens.org/datasets/movielens/ml-1m.zip\";\n String folder = \"src/resources/main/data/ml-1m\";\n String modelPath = \"src/resources/main/crossValid/ml-1m/model/\";\n String recPath = \"src/resources/main/crossValid/ml-1m/recommendations/\";\n String dataFile = eparams.getDataSouceParams().getSourceLocation().get(0);\n int nFolds = N_FOLDS;\n \t\t\n System.out.println(\"Preparing splits...\");\n prepareSplits(url, nFolds, dataFile, folder, modelPath);\n \n System.out.println(\"Gathering recomendations...\");\n //recommend(nFolds, modelPath, recPath); // RiVal's original step.\n //orbsRecommend(nFolds, eparams, modelPath); // Based on RiVal' step\n mixedRecommend(nFolds, eparams, modelPath); // Mixed step\n \n //System.out.println(\"Preparing strategy...\");\n // the strategy files are (currently) being ignored\n //prepareStrategy(nFolds, modelPath, recPath, modelPath);\n\n System.out.println(\"Evaluating...\");\n evaluate(nFolds, modelPath, recPath);\n }",
"File getTargetDirectory();",
"public void setBasedir( String basedir )\n {\n setBasedir( new File( basedir.replace( '/', File.separatorChar ).replace( '\\\\', File.separatorChar ) ) );\n }",
"private static File getTestDataDir() {\n File ancestor = new File(System.getProperty(\"protobuf.dir\", \".\"));\n String initialPath = ancestor.getAbsolutePath();\n try {\n ancestor = ancestor.getCanonicalFile();\n } catch (IOException e) {\n throw new RuntimeException(\n \"Couldn't get canonical name of working directory.\", e);\n }\n while (ancestor != null && ancestor.exists()) {\n if (new File(ancestor, \"src/google/protobuf\").exists()) {\n return new File(ancestor, \"src/google/protobuf/testdata\");\n }\n ancestor = ancestor.getParentFile();\n }\n\n throw new RuntimeException(\n \"Could not find golden files. This test must be run from within the \" +\n \"protobuf source package so that it can read test data files from the \" +\n \"C++ source tree: \" + initialPath);\n }",
"private void setLabtainersDir() throws IOException{\n String newLabtainersPath = LabtainersDirTextfield.getText();\n \n // check if labtainers path exist\n if(new File(newLabtainersPath).isDirectory()){\n pathValidLabel.setVisible(false);\n \n FileOutputStream out = new FileOutputStream(iniFile);\n writeValueToINI(out, \"labtainersPath\", newLabtainersPath);\n\n labtainerPath = newLabtainersPath;\n updateLabtainersPath();\n \n LabtainersDirDialog.setVisible(false);\n }\n else{\n pathValidLabel.setVisible(true);\n } \n }",
"public void setBasedir(String baseD) throws BuildException {\n setBaseDir(new File(baseD));\n }",
"public void setDir() throws FileNotFoundException, IOException{\r\n final JFileChooser jfc = new JFileChooser();\r\n jfc.setDialogTitle(\"Choose Workplace Dirtory\");\r\n FileSystemView fsv = FileSystemView.getFileSystemView();\r\n //wppath stores workplace location\r\n wppath = fsv.getDefaultDirectory();\r\n File rd = new File(wppath.getAbsolutePath() + \"/USQ_Reporter.txt\");\r\n int ext = 0;\r\n if(rd.exists())ext=1;\r\n if(!rd.exists())ext=2;\r\n FileReader fr; \r\n if(rd.exists()){\r\n fr= new FileReader(rd);\r\n if(fr.read()==-1)\r\n ext=2;\r\n }\r\n //System.out.println(ext);\r\n //workplace path\r\n if(ext==1) {\r\n BufferedReader br = new BufferedReader(new FileReader(rd));\r\n workplace = br.readLine();\r\n }else if (ext==2) {\r\n jfc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\r\n int returnVal = jfc.showOpenDialog(this);\r\n \r\n if(returnVal == JFileChooser.APPROVE_OPTION) {\r\n File file = jfc.getSelectedFile();\r\n if(!file.exists()) {\r\n JOptionPane.showMessageDialog(null, \"file doesn't exist.\", \"System Message\", JOptionPane.ERROR_MESSAGE);\r\n } else if(file.isDirectory()) {\r\n workplace = file.getAbsolutePath();\r\n }\r\n }\r\n BufferedWriter bw = new BufferedWriter(new FileWriter(rd));\r\n bw.write(workplace);\r\n bw.flush();\r\n bw.close();\r\n }\r\n }",
"public void createTrainingData(String dirName, String processName, int fold, ArrayList<FoldInstance> instances) throws FileNotFoundException {\n PrintWriter writer = new PrintWriter(dirName + \"/\" + processName + \".jointtrain.cv.\" + fold);\n for (int i = 0; i < instances.size(); i++) {\n FoldInstance inst = instances.get(i);\n if (inst.getName().equalsIgnoreCase(processName)) {\n if (inst.getFold() == fold) {\n writer.println(inst.getSentences());\n writer.flush();\n }\n } else {\n writer.println(inst.getSentences());\n writer.flush();\n }\n\n }\n writer.close();\n }",
"public void trainTest(String template, int maxSize, Reader trainReader, Reader testReader, String directory, Algorithm mode) throws IOException {\n List<Clause> clauses = new ArrayList<Clause>();\n List<String> classifications = new ArrayList<String>();\n readExamples(trainReader, clauses, classifications);\n int[] trainSetIndices = new int[clauses.size()];\n for (int i = 0; i < trainSetIndices.length; i++){\n trainSetIndices[i] = i;\n }\n readExamples(testReader, clauses, classifications);\n int[] testSetIndices = new int[clauses.size()-trainSetIndices.length];\n for (int i = 0; i < testSetIndices.length; i++){\n testSetIndices[i] = i + trainSetIndices.length;\n }\n Triple<List<Set<PredicateDefinition>>,List<PredicateDefinition>,Dataset> preprocessed = preprocessDataset(clauses, classifications, PredicateDefinition.parseDefinition(template), true);\n trainTest_impl(template, preprocessed.t, preprocessed.r, preprocessed.s, maxSize, trainSetIndices, testSetIndices, new File(directory+\"/train.arff\"), new File(directory+\"/test.arff\"), mode);\n }",
"private void initializeTargetDirectory()\n {\n if ( isFtpEnabled() )\n initializeRemoteTargetDirectory();\n else\n initializeLocalTargetDirectory(); \n }",
"public void train() throws Exception;",
"public void setTraining(String s){\n\t\tmyText = s.trim();\n\t}",
"public void saveTraining(File datum) throws IOException, FileNotFoundException {\n bp.writer(datum);\n }"
] | [
"0.60898656",
"0.5708507",
"0.56954443",
"0.55805063",
"0.5535233",
"0.55152196",
"0.5505709",
"0.54877776",
"0.5445995",
"0.5416349",
"0.54144853",
"0.5380339",
"0.5356971",
"0.53539616",
"0.5324363",
"0.53071207",
"0.5306036",
"0.52998805",
"0.5286256",
"0.52783",
"0.5277003",
"0.525402",
"0.5243505",
"0.52226156",
"0.52126694",
"0.5205107",
"0.51921713",
"0.5169669",
"0.51671207",
"0.5158128",
"0.5134444",
"0.5133132",
"0.509712",
"0.5088986",
"0.5088713",
"0.50676996",
"0.50640094",
"0.50588423",
"0.50552976",
"0.5047988",
"0.5032137",
"0.50233036",
"0.50030744",
"0.49990073",
"0.49811292",
"0.49792042",
"0.49621412",
"0.4944296",
"0.49407372",
"0.49294528",
"0.49161828",
"0.49100783",
"0.49077576",
"0.49039114",
"0.4899232",
"0.48970366",
"0.48966524",
"0.48820865",
"0.4878456",
"0.4869733",
"0.486345",
"0.4862929",
"0.48540315",
"0.4853914",
"0.48530966",
"0.48411834",
"0.48402384",
"0.4824626",
"0.48222387",
"0.48075613",
"0.4794874",
"0.47903255",
"0.4787577",
"0.47858486",
"0.47848868",
"0.47840416",
"0.4779137",
"0.47710663",
"0.4747683",
"0.4745218",
"0.474099",
"0.47351244",
"0.47293627",
"0.47290736",
"0.47229522",
"0.47171816",
"0.4712042",
"0.4709821",
"0.47093037",
"0.47023365",
"0.46969318",
"0.4692197",
"0.46910635",
"0.46907392",
"0.46901938",
"0.4686457",
"0.4685787",
"0.46828863",
"0.46761778",
"0.46507934",
"0.46468168"
] | 0.0 | -1 |
gw: training set dir Location of the directory (the path) taken from the cmd line (first arg) | public static void classifyWithHeaders(String[] args)
throws IOException
{
File dir_location = new File( args[0] );
// Listing of the directory (should contain 2 subdirectories: ham/ and spam/)
File[] dir_listing = new File[0];
// Check if the cmd line arg is a directory and list it
if ( dir_location.isDirectory() )
{
dir_listing = dir_location.listFiles();
}
else
{
System.out.println( "- Error: cmd line arg not a directory.\n" );
Runtime.getRuntime().exit(0);
}
// Listings of the two sub-directories (ham/ and spam/)
File[] listing_ham = new File[0];
File[] listing_spam = new File[0];
// Check that there are 2 sub-directories
boolean hamFound = false; boolean spamFound = false;
for (int i=0; i<dir_listing.length; i++) {
if (dir_listing[i].getName().equals("ham")) { listing_ham = dir_listing[i].listFiles(); hamFound = true;}
else if (dir_listing[i].getName().equals("spam")) { listing_spam = dir_listing[i].listFiles(); spamFound = true;}
}
if (!hamFound || !spamFound) {
System.out.println( "- Error: specified directory does not contain ham and spam subdirectories.\n" );
Runtime.getRuntime().exit(0);
}
// Print out the number of messages in ham and in spam
//System.out.println( "\t number of ham messages is: " + listing_ham.length );
//System.out.println( "\t number of spam messages is: " + listing_spam.length );
//******************************
// Create a hash table for the vocabulary (word searching is very fast in a hash table)
Hashtable<String,Multiple_Counter> vocab = new Hashtable<String,Multiple_Counter>();
Multiple_Counter old_cnt = new Multiple_Counter();
// gw
Hashtable<String,WordStat> vocab_stat = new Hashtable<String,WordStat>();
int nWordsHam = 0;
int nWordsSpam = 0;
// Read the e-mail messages
// The ham mail
for ( int i = 0; i < listing_ham.length; i ++ )
{
FileInputStream i_s = new FileInputStream( listing_ham[i] );
BufferedReader in = new BufferedReader(new InputStreamReader(i_s));
String line;
String word;
while ((line = in.readLine()) != null) // read a line
{
if(!(line.startsWith("From")||line.startsWith("To")||line.startsWith("Subject")||line.startsWith("Cc"))) continue;
StringTokenizer st = new StringTokenizer(line); // parse it into words
while (st.hasMoreTokens())
{
word = st.nextToken().replaceAll("[^a-zA-Z]","");
if ( !word.equals("") ) { // if string isn't empty
nWordsHam++;
if ( vocab.containsKey(word) ) // check if word exists already in the vocabulary
{
old_cnt = vocab.get(word); // get the counter from the hashtable
old_cnt.counterHam ++; // and increment it
vocab.put(word, old_cnt);
//gw
WordStat ws = vocab_stat.get(word);
ws.counterHam++;
// is this necessary?
vocab_stat.put(word, ws);
}
else
{
Multiple_Counter fresh_cnt = new Multiple_Counter();
fresh_cnt.counterHam = 1;
fresh_cnt.counterSpam = 0;
vocab.put(word, fresh_cnt); // put the new word with its new counter into the hashtable
//gw
WordStat ws = new WordStat();
ws.counterHam = 1;
ws.counterSpam = 0;
ws.p_w_given_ham_log = 0.0 ; //init
ws.p_w_given_spam_log = 0.0; //init
vocab_stat.put(word, ws);
}
}
}
}
in.close();
}
// The spam mail
for ( int i = 0; i < listing_spam.length; i ++ )
{
FileInputStream i_s = new FileInputStream( listing_spam[i] );
BufferedReader in = new BufferedReader(new InputStreamReader(i_s));
String line;
String word;
while ((line = in.readLine()) != null) // read a line
{
if(!(line.startsWith("From")||line.startsWith("To")||line.startsWith("Subject")||line.startsWith("Cc"))) continue;
StringTokenizer st = new StringTokenizer(line); // parse it into words
while (st.hasMoreTokens())
{
word = st.nextToken().replaceAll("[^a-zA-Z]","");
if ( ! word.equals("") ) {
nWordsSpam ++;
if ( vocab.containsKey(word) ) // check if word exists already in the vocabulary
{
old_cnt = vocab.get(word); // get the counter from the hashtable
old_cnt.counterSpam ++; // and increment it
vocab.put(word, old_cnt);
//gw
WordStat ws = vocab_stat.get(word);
ws.counterSpam++;
// is this necessary?
vocab_stat.put(word, ws);
}
else
{
Multiple_Counter fresh_cnt = new Multiple_Counter();
fresh_cnt.counterHam = 0;
fresh_cnt.counterSpam = 1;
vocab.put(word, fresh_cnt); // put the new word with its new counter into the hashtable
//gw
WordStat ws = new WordStat();
ws.counterHam = 0;
ws.counterSpam = 1;
ws.p_w_given_ham_log = 0.0 ; //init
ws.p_w_given_spam_log = 0.0; //init
vocab_stat.put(word, ws);
}
}
}
}
in.close();
}
// Print out the hash table
// for (Enumeration<String> e = vocab.keys() ; e.hasMoreElements() ;)
// {
// String word;
//
// word = e.nextElement();
// old_cnt = vocab.get(word);
//
// System.out.println( word + " | in ham: " + old_cnt.counterHam +
// " in spam: " + old_cnt.counterSpam);
// }
// Now all students must continue from here
// Prior probabilities must be computed from the number of ham and spam messages
// Conditional probabilities must be computed for every unique word
// add-1 smoothing must be implemented
// Probabilities must be stored as log probabilities (log likelihoods).
// Bayes rule must be applied on new messages, followed by argmax classification (using log probabilities)
// Errors must be computed on the test set and a confusion matrix must be generated
// prior prob
int nMessagesHam = listing_ham.length;
int nMessagesSpam = listing_spam.length;
int nMessagesTotal = nMessagesHam + nMessagesSpam;
if(nMessagesHam == 0 || nMessagesSpam ==0)
System.out.println("Zero ham or spam messages");
double p_ham_log = Math.log((nMessagesHam* 1.0)/(nMessagesTotal));
double p_spam_log = Math.log((nMessagesSpam* 1.0)/(nMessagesTotal));
Iterator it = vocab_stat.entrySet().iterator();
WordStat ws = null;
while (it.hasNext()) {
Map.Entry pairs = (Map.Entry) it.next();
String is = (String) pairs.getKey();
ws = (WordStat) pairs.getValue();
ws.counterHam ++;
ws.counterSpam ++;
nWordsHam ++;
nWordsSpam ++;
}
//System.out.println("nWordsHam = " +nWordsHam);
//System.out.println("nWordsSpam = " + nWordsSpam);
// gw:
it = vocab_stat.entrySet().iterator();
ws = null;
while (it.hasNext()) {
Map.Entry pairs = (Map.Entry) it.next();
String is = (String) pairs.getKey();
ws = (WordStat) pairs.getValue();
ws.p_w_given_ham_log = Math.log(ws.counterHam *1.0 / nWordsHam);
ws.p_w_given_spam_log = Math.log(ws.counterSpam *1.0 / nWordsSpam);
//vocab_stat.put(is,ws);
}
// TODO: further confirm arg index
//test sets
File test_dir_location = new File( args[1] );
// TODO: verify below works
// Listing of the directory (should contain 2 subdirectories: ham/ and spam/)
File[] test_dir_listing = new File[0];
// Check if the cmd line arg is a directory and list it
if ( test_dir_location.isDirectory() )
{
test_dir_listing = test_dir_location.listFiles();
}
else
{
System.out.println( "- Error: cmd line arg not a directory.\n" );
Runtime.getRuntime().exit(0);
}
// TODO: verify File[0]
// Listings of the two sub-directories (ham/ and spam/)
File[] test_listing_ham = new File[0];
File[] test_listing_spam = new File[0];
// Check that there are 2 sub-directories
boolean test_hamFound = false; boolean test_spamFound = false;
for (int i=0; i<test_dir_listing.length; i++) {
if (test_dir_listing[i].getName().equals("ham")) { test_listing_ham = test_dir_listing[i].listFiles(); test_hamFound = true;}
else if (test_dir_listing[i].getName().equals("spam")) { test_listing_spam = test_dir_listing[i].listFiles(); test_spamFound = true;}
}
if (!test_hamFound || !test_spamFound) {
System.out.println( "- Error: specified test directory does not contain ham and spam subdirectories.\n" );
Runtime.getRuntime().exit(0);
}
// // Print out the number of messages in ham and in spam
// System.out.println( "\t number of test ham messages is: " + test_listing_ham.length );
// System.out.println( "\t number of test spam messages is: " + test_listing_spam.length );
// metrics
int true_positives = 0; //spam classified as spam
int true_negatives = 0; //ham classified as ham
int false_positives = 0; //ham ... as spam
int false_negatives = 0; //spam... as ham
// Test starts
// The ham mail
for ( int i = 0; i < test_listing_ham.length; i ++ )
{
FileInputStream i_s = new FileInputStream( test_listing_ham[i] );
BufferedReader in = new BufferedReader(new InputStreamReader(i_s));
String line;
String word;
// gw:
double p_msg_ham_log = 0.0;
double p_msg_spam_log = 0.0;
p_msg_ham_log += p_ham_log;
p_msg_spam_log += p_spam_log;
// gw:
while ((line = in.readLine()) != null) // read a line
{
if(!(line.startsWith("From")||line.startsWith("To")||line.startsWith("Subject")||line.startsWith("Cc"))) continue;
StringTokenizer st = new StringTokenizer(line); // parse it into words
while (st.hasMoreTokens())
{
word = st.nextToken().replaceAll("[^a-zA-Z]","");
if ( !word.equals("") ) { // if string isn't empty
// gw:
if(vocab_stat.containsKey(word)){
WordStat iws = vocab_stat.get(word);
double ip_w_given_ham_log = iws.p_w_given_ham_log;
double ip_w_given_spam_log = iws.p_w_given_spam_log;
p_msg_ham_log += ip_w_given_ham_log ;
p_msg_spam_log += ip_w_given_spam_log ;
}
// gw:
}
}
}
in.close();
if (p_msg_spam_log > p_msg_ham_log) false_positives ++;
else true_negatives ++;
}
// The spam mail
for ( int i = 0; i < test_listing_spam.length; i ++ )
{
FileInputStream i_s = new FileInputStream( test_listing_spam[i] );
BufferedReader in = new BufferedReader(new InputStreamReader(i_s));
String line;
String word;
// gw:
double p_msg_ham_log = 0.0;
double p_msg_spam_log = 0.0;
p_msg_ham_log += p_ham_log;
p_msg_spam_log += p_spam_log;
// gw:
while ((line = in.readLine()) != null) // read a line
{
if(!(line.startsWith("From")||line.startsWith("To")||line.startsWith("Subject")||line.startsWith("Cc"))) continue;
StringTokenizer st = new StringTokenizer(line); // parse it into words
while (st.hasMoreTokens())
{
word = st.nextToken().replaceAll("[^a-zA-Z]","");
if ( ! word.equals("") ) {
// gw:
if(vocab_stat.containsKey(word)){
WordStat iws = vocab_stat.get(word);
double ip_w_given_ham_log = iws.p_w_given_ham_log;
double ip_w_given_spam_log = iws.p_w_given_spam_log;
p_msg_ham_log += ip_w_given_ham_log ;
p_msg_spam_log += ip_w_given_spam_log ;
}
// gw:
}
}
}
in.close();
if (p_msg_spam_log > p_msg_ham_log) true_positives ++;
else false_negatives ++;
}
System.out.println("Result 3: ");
System.out.println("Header_Only\t\ttrue spam\ttrue ham");
System.out.println("Classified spam:\t"+true_positives+"\t\t"+false_positives);
System.out.println("Classified ham: \t"+false_negatives+"\t\t"+ true_negatives);
System.out.println("");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic String getGANModelDirectory() {\n\t\treturn GANProcess.PYTHON_BASE_PATH+\"LodeRunnerGAN\";\n\t}",
"void setDirectory(File dir);",
"@attribute(value = \"\", required = true)\t\r\n\tpublic void setDir(String dir) {\r\n\t\tthis.dir = new File(dir);\r\n\t}",
"public void startTrainingMode() {\n\t\t\r\n\t}",
"@Override\r\n\t\tpublic void setDir(String dir)\r\n\t\t\t{\n\t\t\t\t\r\n\t\t\t}",
"@Raw @Model\r\n\tvoid setDir(Directory dir) {\r\n\t\tthis.dir = dir;\r\n\t\tthis.move(dir);\r\n\t\t\r\n\t}",
"private void setupWorkingDir(Execute exe) {\r\n if (dir == null) {\r\n dir = getProject().getBaseDir();\r\n }\r\n else if (!dir.exists() || !dir.isDirectory()) {\r\n throw new BuildException(dir.getAbsolutePath() + \" is not a valid directory\", getLocation());\r\n }\r\n exe.setWorkingDirectory(dir);\r\n }",
"public IStatus prepareRuntimeDirectory(IPath baseDir);",
"public void setDir(File dir) {\n this.dir = dir;\n }",
"public void run(State state) throws IllegalNumberOfArgumentsException,\r\n InvalidPathException {\r\n String[] parameters = state.getParameters();\r\n if (parameters.length == 0) {\r\n throw new IllegalNumberOfArgumentsException(\r\n \"Mkdir requires a path to a directory to create.\");\r\n }\r\n // make a new directory for each path parameter\r\n for (String path : parameters) {\r\n path = State.cleanDirectoryPath(path);\r\n // get the name of the new directory and the path to its parent\r\n String[] separatedPath = state.separatePathName(path);\r\n String name = separatedPath[0];\r\n String parentPath = separatedPath[1];\r\n if (name.matches(\"/*\")) {\r\n throw new InvalidPathException(path);\r\n }\r\n try {\r\n // check that the name and parent's path are valid\r\n if (name.matches(State.ILLEGAL_CHARACTERS) || name\r\n .substring(0, name.length() - 1).contains(\"/\")) {\r\n throw new IllegalNameException(name);\r\n }\r\n // get the parent directory\r\n Directory parentDir = Navigate.navigateToDirectory(state, parentPath);\r\n //System.out.println(\"parent data: \" + parentDir.getData());\r\n //System.out.println(\"name: \" + name);\r\n String newPath = parentDir.getData() + name;\r\n // check that this file does not already exist\r\n if (parentDir.getChild(newPath) == null) {\r\n // create the new directory\r\n parentDir.addChild(name);\r\n state.addMessage(\"Created directory: \" + newPath + \"\\n\");\r\n } else {\r\n state.addMessage(newPath + \" already exists\\n\");\r\n }\r\n } catch (InvalidPathException e) {\r\n state.addMessage(\"Could not add directory \" + path + \" because \"\r\n + parentPath + \" does not exist.\\n\");\r\n } catch (IllegalNameException e) {\r\n state.addMessage(\"Could not add directory \" + path\r\n + \" because it contains illegal characters.\\n\");\r\n }\r\n }\r\n }",
"public static void main (String [] args) throws Exception { \n//\t\tconf.setMapperClass(DadaMapper.class);\n//\t\tconf.setReducerClass(DataReducer.class);\n\t\t\n//\t\tConfiguration conf = new Configuration(); \n//\t\tconf.set(\"fs.default.name\", \"hdfs://zli:9000\"); \n//\t\tconf.set(\"hadoop.job.user\", \"hadoop\"); \t\t \n//\t\tconf.set(\"mapred.job.tracker\", \"zli:9001\");\n\t\t\n\t\tJob job = new Job(); \n\t\tjob.setJarByClass(NBModelTestJob.class);\n\t\tjob.getConfiguration().set(\"fs.defaultFS\", \"hdfs://NYSJHL101-142.opi.com:8020\"); \n\t\tjob.getConfiguration().set(\"hadoop.job.user\", \"hdfs\"); \t\t \n\t\tjob.getConfiguration().set(\"mapred.job.tracker\", \"NYSJHL101-144.opi.com:8021\");\n\t\tjob.getConfiguration().set(\"trainpath\", args[0]);\n\t\tFileInputFormat.addInputPath(job, new Path(args[1]));\n\t\tFileOutputFormat.setOutputPath(job, new Path(args[2]));\n\t\tFileSystem hdfs = FileSystem.get(job.getConfiguration());\n\t\t\t\t\n\t\tjob.setMapperClass(DataMapper.class);\n\t\tjob.setReducerClass(DataReducer.class);\n\t\tjob.setCombinerClass(DataCombiner.class);\n\t\tjob.setOutputKeyClass(Text.class);\n\t\tjob.setOutputValueClass(Text.class);\n\t\tjob.setNumReduceTasks(10);\n\t\t\n\t\tSystem.exit(job.waitForCompletion(true) ? 0 : 1);\n\t\t\n\t}",
"public void setAndCreateDirPath(String dirname) {\r\n\t File newPath = new File(dirname); \r\n\t \r\n\t if(!newPath.isDirectory()) {\r\n\t\t newPath.mkdirs();\r\n\t }\r\n\t \r\n\t directory = newPath;\r\n }",
"private void setWorkDiretory() {\n\t\tthis.workDiretory = System.getProperty(\"user.dir\");\n\t}",
"public void setDir(File dir) {\n _sourceDir = dir;\n }",
"public void setDir(File dir)\n {\n this.dir = dir;\n }",
"private void processDir(){\n // get the location of ISAW code base\n String isaw_home=SharedData.getProperty(\"ISAW_HOME\");\n if(isaw_home==null)\n throw new InstantiationError(\"Could not find directory:ISAW_HOME is null\");\n isaw_home=FilenameUtil.setForwardSlash(isaw_home+\"/\");\n\n // get the name of the directory to check\n String dir=FilenameUtil.setForwardSlash(isaw_home\n +\"DataSetTools/parameter/\");\n\n // check that the directory is okay to work with\n if(DEBUG) System.out.println(\"Looking in \"+dir);\n File paramDir=new File(dir);\n if( !(paramDir.exists()) || !(paramDir.isDirectory()) )\n throw new InstantiationError(\"Could not find directory \" + dir);\n\n // get the list of all possible classes\n File[] files=paramDir.listFiles();\n String filename=null;\n for( int i=0 ; i<files.length ; i++ ){\n filename=checkName(files[i].toString(),isaw_home.length());\n if(filename!=null) addParameter(filename);\n }\n \n \n\n dir=FilenameUtil.setForwardSlash(isaw_home\n +\"gov/anl/ipns/Parameters/\");\n\n // check that the directory is okay to work with\n if(DEBUG) System.out.println(\"Looking in \"+dir);\n paramDir=new File(dir);\n if( !(paramDir.exists()) || !(paramDir.isDirectory()) )\n throw new InstantiationError(\"Could not find directory \" + dir);\n\n // get the list of all possible classes\n files=paramDir.listFiles();\n filename=null;\n for( int i=0 ; i<files.length ; i++ ){\n filename=checkName(files[i].toString(),isaw_home.length());\n if(filename!=null) addParameter(filename);\n }\n\n }",
"private void loadDataTraining(String location) throws IOException {\r\n\r\n File parentDir = new ClassPathResource(location).getFile();\r\n \ttrainWriter.write(\"Data folder found.\");\r\n\r\n // Divide all data to training and testing datasets\r\n FileSplit filesInDir = new FileSplit(parentDir, allowedExtensions, randNumGen);\r\n \r\n // Create ParentPathLabelGenerator, that will parse the parent dir and use the name of the subdirectories as label/class names\r\n ParentPathLabelGenerator labelMaker = new ParentPathLabelGenerator();\r\n BalancedPathFilter pathFilter = new BalancedPathFilter(randNumGen, allowedExtensions, labelMaker);\r\n trainWriter.write(\"Label generators created.\");\r\n \r\n // Split the image files into train and test. Specify the train test split as 80%,20%\r\n InputSplit[] filesInDirSplit = filesInDir.sample(pathFilter, 80, 20);\r\n InputSplit trainDataInputSplit = filesInDirSplit[0];\r\n InputSplit testDataInputSplit = filesInDirSplit[1];\r\n trainWriter.write(\"Data splited to train and test parts as 80% and 20%.\");\r\n \r\n /*\r\n * Specifying a new record reader (one for testing on dataset, one for testing on real data, one for training)\r\n * with the height and width you want the images to be resized to.\r\n * Note that the images in this example are all of different size\r\n * They will all be resized to the height and width specified below\r\n * */\r\n ImageRecordReader trainRecordReader = new ImageRecordReader(inputShape[1],inputShape[2],inputShape[0],labelMaker);\r\n trainRecordReader.initialize(trainDataInputSplit);\r\n\r\n ImageRecordReader testRecordReader = new ImageRecordReader(inputShape[1],inputShape[2],inputShape[0], labelMaker);\r\n testRecordReader.initialize(testDataInputSplit);\r\n trainWriter.write(\"Data iterators created successfully.\");\r\n \r\n // Get the number of labels, ImageRecordReader founded in dir and check it\r\n int outputNum = trainRecordReader.numLabels();\r\n\r\n // Init iterators with datasets\r\n trainIterator = new RecordReaderDataSetIterator(trainRecordReader, batchSizeTraining, labelIndex, outputNum);\r\n trainIterator.setCollectMetaData(true);\r\n testIterator = new RecordReaderDataSetIterator(testRecordReader, batchSizeTesting, labelIndex, outputNum);\r\n testIterator.setCollectMetaData(true);\r\n trainWriter.write(\"Data iterators setted to collect metadata.\");\r\n }",
"void setWorkingDirectory( String workingDirectory );",
"public void setOutputDirectory(String dir) {\n\t\tnew LabeledText(\"Output directory:\").setText(dir);\n\t}",
"public void createTestDir() {\n\t\tworkDir = new File(System.getProperty(\"test.dir\", \"target\"));\n\t}",
"private void makeDirectory() {\n String userHome = System.getProperty(\"user.home\");\n wnwData = new File(userHome + \"/.wnwdata\");\n wnwData.mkdirs();\n\n makeCampaignChallengesFile();\n makeCustomChallengesFile();\n makeProgressFile();\n makeSettingsFile();\n }",
"void setWorkingDirectory(String workingDirectory);",
"public static void setInputDir(Configuration conf, String path) {\n conf.set(\"mapred.input.dir\", path);\n }",
"public void trainTest(String template, int maxSize, int[] trainSet, int[] testSet, Reader examples, String directory, Algorithm mode) throws IOException {\n trainTest_impl(template, maxSize, trainSet, testSet, examples, new File(directory+\"/train.arff\"), new File(directory+\"/train.arff\"), mode);\n }",
"public void setupDrive(){\n // Place Dove/ into base of drive\n new File(drv.toString() + File.separator + folderName).mkdir();\n //upload preset content if required\n isSetup = true;\n }",
"void setTrainData(DataModel trainData);",
"public void setDir(int dir) {\n this.dir = dir;\n }",
"protected void setWorkingDirectory(File dir) {\n\t\tthis.dir = dir;\n\t}",
"public void updateLabtainersPath(){\n labsPath = new File(labtainerPath + File.separator + \"labs\");\n labChooser.setCurrentDirectory(labsPath); \n }",
"public abstract void setTrainParams(ClassificationMethod method,URL model,Map<String,Object> args) throws ClassificationException;",
"public static void main(String[] args) {\n int arg = 0;\n int seedNum = 100;\n int trainNum = 0;\n int testNum = 0;\n boolean treeFlag = false;\n boolean textFlag = false;\n //handle options\n while (args[arg].startsWith(\"-\")) {\n switch(args[arg]) {\n case (\"-tree\"):\n treeFlag = true;\n break;\n case (\"-text\"):\n textFlag = true;\n break;\n case (\"-seednum\"):\n arg++;\n seedNum = Integer.parseInt(args[arg]);\n break;\n case (\"-trainnum\"):\n arg++;\n trainNum = Integer.parseInt(args[arg]);\n break;\n case (\"-testnum\"):\n arg++;\n testNum = Integer.parseInt(args[arg]);\n break;\n case (\"-trainall\"):\n trainNum = Integer.MAX_VALUE;\n break;\n case (\"-testall\"):\n testNum = Integer.MAX_VALUE;\n break;\n default:\n throw new IllegalArgumentException(\"Unrecognized command: \" + args[arg]);\n }\n arg++;\n }\n File sourceDirectory = new File(args[arg]);\n arg++;\n File destinationDirectory = new File(args[arg]);\n\n if(treeFlag && textFlag) {\n System.err.println(\"Both text and tree flags detected, which one do you want?\");\n System.exit(2);\n }\n\n if (trainNum == Integer.MAX_VALUE && testNum == Integer.MAX_VALUE) {\n System.err.println(\"Can't max both train and test values!\");\n System.exit(3);\n }\n\n if (!sourceDirectory.isDirectory()) {\n System.err.println(\"ERROR: \" + sourceDirectory.getName() + \"is not a directory!\");\n System.exit(4);\n }\n if (!destinationDirectory.exists()) {\n destinationDirectory.mkdirs();\n } else if (!destinationDirectory.isDirectory()) {\n System.err.println(\"ERROR: \" + destinationDirectory.getName() + \"is not a directory!\");\n System.exit(5);\n }\n\n if (treeFlag) {\n createSeededFiles(\"tree\", seedNum, trainNum, testNum, sourceDirectory, destinationDirectory);\n } else if (textFlag) {\n createSeededFiles(\"text\", seedNum, trainNum, testNum, sourceDirectory, destinationDirectory);\n }\n }",
"protected void init()\r\n\t{\n\t\tif (ConfigManager.getInstance().getIsCrossClassify() && WekaTool.dataStageOn)\r\n\t\t{\r\n\t\t\t//System.out.println(\"in init for data stage\");\r\n\t\t\tsrcDirUrl = ConfigManager.getInstance().getTrainPath();\r\n\t\t\tdestDirUrl = ConfigManager.getInstance().getTrainPath() +\r\n\t\t\t File.separator + \"output\";\r\n\t\t\t//System.out.println(\"srcDirUrl = \" + srcDirUrl);\r\n\t\t\t//System.out.println(\"destDirUrl = \" + destDirUrl);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t//System.out.println(\"here, good\");\r\n\t\t\tsrcDirUrl = getSrcDirUrl();\r\n\t\t\tdestDirUrl = getDestDirUrl();\r\n\t\t}\r\n\t\tdatalibSVMUrl = getLibSVMDirUrl();\r\n\t\ttry {\r\n\t\t\tsrcDir = Utils.getDir(srcDirUrl);\r\n\t\t\tdestDir = Utils.getDir(destDirUrl);\r\n\t\t} catch (Exception e)\r\n\t\t{\r\n\t\t}\r\n\t}",
"public void train ()\t{\t}",
"public void setDir(File d) {\r\n this.dir = d;\r\n }",
"public void train()\n\t{\n\t\tdbiterator = DBInstanceIterator.getInstance();\n System.out.println(\"Start Training ..\");\n\n\t\ttry {\n\t\t\tSystem.out.println(\"Training Text %..\");\n\t\t\ttrainText();\n\n\t\t\tSystem.out.println(\"Training Complex %..\");\n\t\t\ttrainCombined();\n\n\t\t\tSystem.out.println(\"Training Feature %..\");\n\t\t\ttrainFeatures();\n\n\t\t\tSystem.out.println(\"Training Lexicon %..\");\n\t\t\t//trainLexicon();\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}",
"public void setBasedir( File basedir )\n {\n this.basedir = basedir;\n }",
"@Override\n\tpublic void setWorkingDir(String workingDir) {\n\t\tmodel.setWorkingDir(workingDir);\n\t}",
"public void setDir(String dir) {\n // Do this before setting the value\n boolean dirChanged = dir != null && !dir.equals(this.getDir());\n this.dir = Paths.get(dir);\n if(dirChanged) {\n this.dirChanged();\n }\n }",
"public void setHarvestedDataDir(String val) {\n\n\t\tthis.harvestedDataDir = val;\n\n\t}",
"public void setCurrentDirectory(File dir) {\r\n\tif (dir == null) dir = new File(System.getProperty(\"user.home\"));\r\n\r\n\tdir = makeAbsolute(dir);\r\n\r\n\t/**\r\n\t * Note that we compare literal paths, not canonical\r\n\t * paths. If they want the chooser to represent the\r\n\t * files at the end of a different route to the same\r\n\t * place, that's perfectly legitimate. See NextStep\r\n\t * for e.g.\r\n\t */\r\n\tif (curDir == null || !curDir.equals(dir)) {\r\n\t invalidateCache();\r\n\t File oldDir = curDir;\r\n\t curDir = dir;\r\n\t firePropertyChange(\"currentDirectory\", oldDir, dir);\r\n\t fireContentsChanged();\r\n\t}\r\n }",
"public void TrainDataset(){\n\t\ttry{\n\t\t\t//Testing delegate method\n\t\t\tMessageController.logToConsole(\"Hey, I'm from train button\");\n\t\t\t\n\t\t\t//Pass in the real training dataset\n\t\t\tfindSuitableK(new String[]{\"Hello\", \"World\"});\n\t\t\t\n\t\t\t//Pass in the 'k' and 'query string'\n\t\t\tfindKNN(2, \"anything\");\n\t\t}\n\t\tcatch(Exception ex){\n\t\t\tthrow ex;\n\t\t}\n\t\tfinally{\n\t\t\t\n\t\t}\n\t}",
"@Override\n public void initDefaultCommand() {\n setDefaultCommand(new DriveTrainDefault());\n }",
"public MkdirCommand() {\r\n // The name of the mkdir command\r\n name = \"mkdir\";\r\n\r\n // The description of the mkdir command\r\n description = \"Creates a directory ar the given path. The given path can\"\r\n + \" be a full path or a path relative to the working directory\";\r\n\r\n // The parameters for the mkdir command and their description\r\n parameters.put(\"DIR\", \"The path that points to where the new directory\"\r\n + \" should be created.\");\r\n }",
"public createDirectory_args setPath(String path) {\n this.path = path;\n return this;\n }",
"void setup(CommandLine cmd);",
"TrainingTest createTrainingTest();",
"public void dataConfig(String dir) {\n VersatileDataSource source = new CSVDataSource(new File(dir + \"trainData/iris.csv\"), false,\n CSVFormat.DECIMAL_POINT);\n VersatileMLDataSet data = new VersatileMLDataSet(source);\n data.defineSourceColumn(\"sepal-length\", 0, ColumnType.continuous);\n data.defineSourceColumn(\"sepal-width\", 1, ColumnType.continuous);\n data.defineSourceColumn(\"petal-length\", 2, ColumnType.continuous);\n data.defineSourceColumn(\"petal-width\", 3, ColumnType.continuous);\n\n // Define the column that we are trying to predict.\n ColumnDefinition outputColumn = data.defineSourceColumn(\"species\", 4,\n ColumnType.nominal);\n data.analyze();\n data.defineSingleOutputOthersInput(outputColumn);\n\n EncogModel model = new EncogModel(data);\n\n model.selectMethod(data, \"feedforward\");\n data.normalize();\n System.out.println(data.get(0).toString());\n NeuralUtils.dataToFile(data, dir + \"trainData/test.csv\");\n\n NormalizationHelper helper = data.getNormHelper();\n System.out.println(helper.toString());\n NeuralUtils.persistHelper(helper, dir + \"resources/Helper/helper.txt\");\n\n }",
"public static void setup(String[] args) {\n\t\tif (parametersContains(\"classpath\", args)) {\r\n\t\t\tRESOURCE_TYPE = RessourceType.CLASSPATH;\r\n\t\t\tCobra2DEngine.setupEnvironment(RESOURCE_TYPE);\r\n\t\t\tROOT_PATH_STR = \"./src/main/resources/\";\r\n\t\t} else if (parametersContains(\"currentDir\", args)) {\r\n\t\t\tRESOURCE_TYPE = RessourceType.INSTALL_DIR;\r\n\t\t\tCobra2DEngine.setupEnvironment(RESOURCE_TYPE);\r\n\t\t\tROOT_PATH_STR = \".\";\r\n\t\t} else {\r\n\t\t\tSystem.out\r\n\t\t\t\t\t.println(\"Start this runtime environment with option -classpath to load all resources from your classpath or with -currentDir to load all resources from current directory ./game-resources/.\");\r\n\t\t\tSystem.exit(1);\r\n\t\t}\r\n\r\n\t\tROOT_PATH = new File(ROOT_PATH_STR);\r\n\t\tRESOURCE_PATH = new File(ROOT_PATH_STR + File.separator\r\n\t\t\t\t+ RESOURCE_PATH_STR);\r\n\t\tIMAGE_RESOURCE_PATH = new File(ROOT_PATH_STR + File.separator\r\n\t\t\t\t+ RESOURCE_PATH_STR + File.separator + IMAGE_FOLDER_STR);\r\n\r\n\t\tlog.info(\"Setting up path settings for runtime.\");\r\n\t\tlog.info(\"Resource loading strategy : \" + RESOURCE_TYPE);\r\n\t\tlog.info(\"Root path (path): \" + ROOT_PATH.getPath());\r\n\t\tlog.info(\"Root path (absolute): \"\r\n\t\t\t\t+ ROOT_PATH.getAbsolutePath());\r\n\t\tlog.info(\"Resource path (path): \" + RESOURCE_PATH.getPath());\r\n\t\tlog.info(\"Resource path (absolute): \"\r\n\t\t\t\t+ RESOURCE_PATH.getAbsolutePath());\r\n\t\tlog.info(\"Image resource path (path): \"\r\n\t\t\t\t+ IMAGE_RESOURCE_PATH.getPath());\r\n\t\tlog.info(\"Image resource path (absolute): \"\r\n\t\t\t\t+ IMAGE_RESOURCE_PATH.getAbsolutePath());\r\n\t}",
"public static void main(String[] args) throws Exception {\n // TODO Auto-generated method stub\n if (args.length != 3) {\n System.err.println(\"Enter valid number of arguments <Inputdirectory> <Outputlocation>\");\n System.exit(0);\n }\n ToolRunner.run(new Configuration(), new MovieLensTopMovies(), args);\n }",
"public static void main(String[] args) { String dirname = \"/home/diego/IdeaProjects/JAVAStuff/src/tmp/dirTest.txt\";\n// File d = new File(dirname);\n// d.mkdirs();\n//\n File file = null;\n String[] paths;\n\n try {\n file = new File(\"/home/diego/IdeaProjects/JAVAStuff/src\");\n paths = file.list();\n\n for(String s: paths) {\n System.out.println(s);\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n\n }",
"public void setRootDir(String rootDir);",
"public void train(){\n recoApp.training(idsToTest);\n }",
"public void train(SieveDocuments trainingInfo) {\r\n\t\t// no training\r\n\t}",
"public static void main(String args[]){\n\t\t//parameters that can be modified\n\t\tint topicNum=100;\n\t\tString sourceID=\"1864252027/\";\n\t\tint subnetworkSize=1100;\n\t\tString dir=\"sampleTest/\"+sourceID+subnetworkSize+\"/\";\n\t\tString fileName=\"ldaInput.txt\";\n\t\tint iterationNum=1000;\n\t\t\n\t\t//read training data from file\n\t\tSystem.out.println(\"loading files\");\n\t\tGraph network=GraphOperator.getFromFile(dir+\"sample.network\");\n\t\tHashMap<String,Message>trainingStatusMap=MessageListOperator.readMessageFromFile(dir+\"trainingSet.status\");\n\t\tHashMap<String,Message>commentMap=MessageListOperator.readMessageFromFile(dir+\"samplePreDoc.comment\");\n\t\t\n\t\tDocumentAssign.relateMessageToNetwork(network,trainingStatusMap,commentMap);\n\t\tDocumentAssign.optimizedAssign(network,dir,fileName);\n\t\t\n\t\tSystem.out.println(\"Training\");\t\n\t\t//training with Optimized assignment\n\t\tLDA_InfluMax.estimationFromScratch(50/((double)topicNum),0.01,topicNum,\n\t\t\t\titerationNum,iterationNum/2,dir,fileName,50);\n\t}",
"protected String setPathToResourcesIfNotProvided(String[] args) {\n if (args.length == 0) {\n args = new String[1];\n args[0] = \"./src/main/resources/Code Test\";\n }\n return args[0];\n }",
"private static void checkArgsAndSetUp()\n {{\n File outDir= new File( arg_outDirname );\n\n if ( outDir.exists() ) {\n\t if ( !outDir.isDirectory() ) {\n\t System.err.println( PROGRAM_NAME+ \n\t\t\t\t\": output directory is not a directory; \"); \n\t System.err.println( \"\\t\"+ \"dir=\\\"\"+ arg_outDirname+ \"\\\", \" );\n\t System.err.println( \"\\t\"+ \"please specify an empty directory.\" );\n\t System.exit(-1);\n\t }\n\t if ( outDir.list().length > 0 ) {\n\t System.err.println( PROGRAM_NAME+ \n\t\t\t\t\": output directory is not empty; \"); \n\t System.err.println( \"\\t\"+ \"dir=\\\"\"+ arg_outDirname+ \"\\\", \" );\n\t System.err.println( \"\\t\"+ \"please specify an empty directory.\" );\n\t System.exit(-1);\n\t }\n } else {\n\t outDir.mkdir();\n }\n }}",
"@DataBoundSetter\n public void setDir(String dir) {\n this.dir = dir;\n }",
"public void setShHarvestedDataDir(String val) {\n\n\t\tthis.shHarvestedDataDir = val;\n\n\t}",
"private void trainNetwork(long iterations) {\n\t\ttrainer.startTraining(network, iterations);\r\n\r\n\t}",
"Path getBaseInputDir();",
"public void setSource(String sourceDir)\n {\n this.sourceDir = new File(sourceDir);\n }",
"public static void main(String[] args){\n File f = new File(System.getProperty(\"user.dir\"));\n if(os){\n path = f.toString()+\"\\\\YuuTubevideos\";\n }else{\n path = f.toString()+\"/YuuTubevideos\";\n }\n start_page();\n }",
"@BeforeClass\n\tpublic static void setUpClass() {\n\t\tString resourcesDir = System.getProperty(\"user.dir\") + File.separator + \"src\" +\n File.separator + \"test\" + File.separator + \"resources\";\n\n tsmResources = resourcesDir + File.separator + \"tsm\";\n //testDir = new File(resourcesDir, \"tsm-output\"); \n\t}",
"private void createTDenseDirectory() {\n File dense = new File(DenseLayerPath);\n dense.mkdir();\n }",
"public TestLearningAPI(String arg0) throws GateException,\n MalformedURLException {\n super(arg0);\n if(!initialized) {\n Gate.init();\n learningHome = new File(new File(Gate.getGateHome(), \"plugins\"),\n \"Learning\");\n Gate.getCreoleRegister().addDirectory(learningHome.toURI().toURL());\n initialized = true;\n }\n }",
"private void setTrainingData() throws IOException {\r\n\t\ttrainIdBodyMap = readInIdBodiesMap(new File(TRAIN_BODIES_CSV_LOCATION));\r\n\t\ttrainStances = readStances(new File(TRAIN_STANCES_CSV_LOCATION));\r\n\r\n\t}",
"public void getPredictions() throws IOException, InterruptedException{\n //splitColsDataFiles();\n for(String learner:listLearners){\n File modelsFolder = new File(\"models/\"+learner);\n File[] IPFolders = modelsFolder.listFiles();\n for (File nodeFolder : IPFolders) {\n if (nodeFolder.isDirectory()) {\n File[] filesInFolder = nodeFolder.listFiles();\n ArrayList<String> filesINFolderAL = new ArrayList<String>();\n for(int i=0;i<filesInFolder.length;i++){\n filesINFolderAL.add(filesInFolder[i].getName());\n }\n if(filesINFolderAL.contains(model) && filesINFolderAL.contains(\"data.properties\")){\n System.out.println(\"Generating data for: \" + nodeFolder.getPath());\n // read properties file\n // get indices of variables\n // paste appropriate cols in models/temp\n // change commands below with appropriate data\n Properties dataProps = loadProps(nodeFolder.getPath()+\"/data.properties\");\n ArrayList<Integer> indices = new ArrayList<Integer>();\n String featuresS = dataProps.getProperty(\"sampled_variables\");\n if(featuresS!=null){\n String[] featuresArray = featuresS.split(\" \");\n for(int i=0;i<featuresArray.length;i++){\n indices.add(i, Integer.parseInt(featuresArray[i]));\n }\n // the order of indices is important\n Collections.sort(indices);\n\n String pasteTrainTempCommand = \"paste -d',' \";\n for(int i=0;i<indices.size();i++){\n pasteTrainTempCommand += \" models/temp/tr_\" + (indices.get(i)+1) + \".csv\";\n }\n pasteTrainTempCommand += \" models/temp/tr_targets.csv > models/temp/tr_temp.csv\";\n System.out.println(pasteTrainTempCommand);\n Process pasteTrainTemp_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", pasteTrainTempCommand});\n pasteTrainTemp_process.waitFor();\n\n\n String pasteTestTempCommand = \"paste -d',' \";\n for(int i=0;i<indices.size();i++){\n pasteTestTempCommand += \" models/temp/te_\" + (indices.get(i)+1) + \".csv\";\n }\n pasteTestTempCommand += \" models/temp/te_targets.csv > models/temp/te_temp.csv\";\n System.out.println(pasteTestTempCommand);\n Process pasteTestTemp_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", pasteTestTempCommand});\n pasteTestTemp_process.waitFor();\n \n // Add a new case when adding a new learner\n if(learner.equals(\"gpfunction\") || learner.equals(\"ruletree\") || learner.equals(\"rulelist\")){ // JAVA\n String predictTrain_command = \"java -jar learners/\" + learner + \".jar -predict models/temp/tr_temp.csv\"\n + \" -model \" + nodeFolder + \"/\" + model \n + \" -o \" + nodeFolder + \"/predsTrain_\" + model ;\n Process predictTrain_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", predictTrain_command});\n predictTrain_process.waitFor();\n String predictTest_command = \"java -jar learners/\" + learner + \".jar -predict models/temp/te_temp.csv\"\n + \" -model \" + nodeFolder + \"/\" + model \n + \" -o \" + nodeFolder + \"/predsTest_\" + model ;\n Process predictTest_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", predictTest_command});\n predictTest_process.waitFor();\n }else if(learner.equals(\"mplcs\")){// C OR C++\n String predictTrain_command = \"learners/\" + learner + \" -predict models/temp/tr_temp.csv\"\n + \" -model \" + nodeFolder + \"/\" + model \n + \" -o \" + nodeFolder + \"/predsTrain_\" + model+\".csv\" ;\n Process predictTrain_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", predictTrain_command});\n predictTrain_process.waitFor();\n String predictTest_command = \"learners/\" + learner + \" -predict models/temp/te_temp.csv\"\n + \" -model \" + nodeFolder + \"/\" + model \n + \" -o \" + nodeFolder + \"/predsTest_\" + model+\".csv\" ;\n Process predictTest_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", predictTest_command});\n predictTest_process.waitFor();\n }if(learner.equals(\"lccb\")){ // Python\n String predictTrain_command = \"python learners/\" + learner + \".py -predict models/temp/tr_temp.csv\"\n + \" -model \" + nodeFolder + \"/\" + model \n + \" -o \" + nodeFolder + \"/predsTrain_\" + model+\".csv\" ;\n Process predictTrain_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", predictTrain_command});\n predictTrain_process.waitFor();\n String predictTest_command = \"python learners/\" + learner + \".py -predict models/temp/te_temp.csv\"\n + \" -model \" + nodeFolder + \"/\" + model \n + \" -o \" + nodeFolder + \"/predsTest_\" + model+\".csv\" ;\n System.out.println(predictTest_command);\n Process predictTest_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", predictTest_command});\n predictTest_process.waitFor();\n }if(learner.equals(\"SBBJ\")){ // JAVA\n String predictTrain_command = \"java -jar learners/\" + learner + \".jar -predict models/temp/tr_temp.csv\"\n + \" -model \" + nodeFolder + \"/\" + model \n + \" -o \" + nodeFolder + \"/predsTrain_\" + model+\".csv\" ;\n Process predictTrain_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", predictTrain_command});\n predictTrain_process.waitFor();\n String predictTest_command = \"java -jar learners/\" + learner + \".jar -predict models/temp/te_temp.csv\"\n + \" -model \" + nodeFolder + \"/\" + model \n + \" -o \" + nodeFolder + \"/predsTest_\" + model+\".csv\" ;\n Process predictTest_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", predictTest_command});\n predictTest_process.waitFor();\n }\n \n }\n }\n }\n }\n }\n }",
"public static void main(String[] args) {\n\t\tPerceptron p = new Perceptron(new TaruTrainingWrapper(args[0],null));\n\t\t\n\t\t// Training data\n//\t\tString srcTrainFile = \"train.src\"; // contains parses\n//\t\tString refTrainFile = \"train.ref\"; // contains plain text\n\t\tString srcTrainFile = \"test.src\"; // contains parses\n\t\tString refTrainFile = \"test.ref\"; // contains plain text\n\t\t\n\t\t// Read in the training data\n\t\tArrayList<String> srcData = new ArrayList<String>(5000);\n\t\tArrayList<String> refData = new ArrayList<String>(5000);\n\t\t\n\t\ttry{\n\t\t\tBufferedReader sbr = new BufferedReader(new FileReader(srcTrainFile));\n\t\t\tBufferedReader rbr = new BufferedReader(new FileReader(refTrainFile));\n\t\t\tString ref = \"\";\n\t\t\twhile((ref = rbr.readLine()) != null){\n\t\t\t\tString src = sbr.readLine();\n\t\t\t\tif(ref.split(\" +\").length < 31){\n\t\t\t\t\tsrcData.add(src);\n\t\t\t\t\trefData.add(ref.toLowerCase());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tsbr.close();\n\t\t\trbr.close();\n\t\t}catch(FileNotFoundException e){e.printStackTrace();} catch (IOException e) { e.printStackTrace();}\n\t\tSystem.out.println(\"Training on \" + srcData.size() + \" sentences.\");\n\t\t// run the training\n\t\tp.trainAverage(srcData, refData, 5);\n\t}",
"public void setDir( final File dir )\n {\n m_dir = dir;\n }",
"public static void main(String[] args) {\n\n if (args.length < 2 || args.length > 3) {\n System.out.println(\"Usage: BuildDemoData <dir> <file> [<jenaflag>]\");\n System.out.println(\"where <dir> is the output directory\");\n System.out.println(\"where <file> is a properties file\");\n System.out.println(\"where <jenaflag> is any value\");\n System.exit(0);\n }\n\n Properties dataProps = new Properties();\n\n try {\n File props = new File(args[1]);\n FileInputStream fis = new FileInputStream(props);\n dataProps.load((InputStream) fis);\n } catch (Exception e) {\n System.err.println(e.toString());\n e.printStackTrace();\n }\n\n \tModel model = ModelFactory.createDefaultModel();\n try {\n model = getModelFromFiles(dataProps);\n } catch (Exception e) {\n System.err.println(e.toString());\n e.printStackTrace();\n }\n \n System.out.println(\"Writing no inferencing model...\");\n writeModel(model, args[0] + \"simileDemoNoInference.rdf\");\n System.out.println(\"Uninferenced model contains \" + model.size() + \" statements\");\n\n System.out.println(\"Inferencing...\"); \t\n if (args.length == 2) {\n Reasoner reasoner = new SimileReasoner();\n writeModel(reasoner.process(model), args[0] + \"simileDemoMappingInference.rdf\");\n } else {\n Reasoner reasoner = new JenaReasoner();\n writeModel(reasoner.process(model), args[0] + \"simileDemoJenaInference.rdf\");\n }\n \n System.out.println(\"Inferenced model contains \" + model.size() + \" statements\");\n }",
"private static void createSeededFiles(String type, int seedNum, int trainNum, int testNum, File sourceDirectory,\n File destinationDirectory) {\n\n File trainDirectory = new File(destinationDirectory.getAbsolutePath() + \"/train\");\n if(trainNum > 0 && !trainDirectory.exists()) {\n trainDirectory.mkdir();\n }\n File testDirectory = new File(destinationDirectory.getAbsolutePath() + \"/test\");\n if(testNum > 0 && !testDirectory.exists()) {\n testDirectory.mkdir();\n }\n\n //for each language, we want to create a directory for that language, then parse trees/sentences through each of the novels listed there\n File[] languages = sourceDirectory.listFiles();\n File[] trainDirectoryLanguages = new File[languages.length];\n File[] testDirectoryLanguages = new File[languages.length];\n for (int i = 0; i < languages.length; i++) {\n if (languages[i].getName().startsWith(\".\")) {\n continue;\n }\n trainDirectoryLanguages[i] = new File(trainDirectory.getAbsolutePath() + \"/\" + languages[i].getName());\n testDirectoryLanguages[i] = new File(testDirectory.getAbsolutePath() + \"/\" + languages[i].getName());\n if (trainNum > 0)\n makeNewDirectoryIfNotExists(trainDirectoryLanguages[i]);\n if (testNum > 0)\n makeNewDirectoryIfNotExists(testDirectoryLanguages[i]);\n\n File[] novels = languages[i].listFiles();\n for (int j = 0; j < novels.length; j++) {\n if (novels[j].getName().startsWith(\".\")) {\n continue;\n }\n try {\n BufferedReader read = new BufferedReader(new FileReader(novels[j]));\n //name w/o .txt\n String fileShortName = novels[j].getName().substring(0, novels[j].getName().length()-4);\n String line;\n //max number of stuff we want to read is based on our inputs\n int maxFiles = testNum + trainNum;\n long maxLines = (long) maxFiles * (long) seedNum;\n int lineCount = 0;\n int fileCount = 1;\n //File currentFile = createNewNumberedFile(trainDirectoryLanguages[i].getAbsolutePath() + \"/\" + fileShortName, fileCount);\n String pathToUse = (fileCount <= trainNum) ? trainDirectoryLanguages[i].getAbsolutePath() :\n testDirectoryLanguages[i].getAbsolutePath();\n File currentFile = createNewNumberedFile(pathToUse + \"/\" + fileShortName, fileCount);\n PrintWriter pw = new PrintWriter(currentFile);\n\n //this is the part that varies based on calling for text or trees.\n switch (type) {\n case \"text\":\n while ((line = read.readLine()) != null && lineCount < maxLines ) {\n pw.println(line);\n lineCount++;\n //when our lineCount mod seedNum is 0, we want to create another PrintWriter\n if (lineCount % seedNum == 0) {\n fileCount++;\n //put in train or test, depending on our current file count.\n if (fileCount <= maxFiles) {\n pathToUse = (fileCount <= trainNum) ? trainDirectoryLanguages[i].getAbsolutePath() :\n testDirectoryLanguages[i].getAbsolutePath();\n currentFile = createNewNumberedFile(pathToUse + \"/\" + fileShortName, fileCount);\n pw.flush();\n pw.close();\n pw = new PrintWriter(currentFile);\n }\n }\n }\n break;\n case \"tree\":\n //need to build a Treebank... lifting code from HW 3 to aid in this.\n Options op = new Options();\n op.doDep = false;\n op.doPCFG = true;\n op.setOptions(\"-goodPCFG\", \"-evals\", \"tsv\");\n Treebank treeBank = op.tlpParams.diskTreebank();\n treeBank.loadPath(novels[j]);\n Iterator<Tree> it = treeBank.iterator();\n while((it.hasNext()) && lineCount < maxLines) {\n lineCount++;\n Tree t = it.next();\n t.pennPrint(pw);\n if (lineCount % seedNum == 0) {\n fileCount++;\n //put in train or test, depending on our current file count.\n if (fileCount <= maxFiles) {\n pathToUse = (fileCount <= trainNum) ? trainDirectoryLanguages[i].getAbsolutePath() :\n testDirectoryLanguages[i].getAbsolutePath();\n currentFile = createNewNumberedFile(pathToUse + \"/\" + fileShortName, fileCount);\n pw.flush();\n pw.close();\n pw = new PrintWriter(currentFile);\n }\n }\n }\n break;\n }\n pw.flush();\n pw.close();\n //if numlines is not equal to maxlines then we'll remove the last file.\n if (lineCount != maxLines) {\n currentFile = createNewNumberedFile(pathToUse + \"/\" + fileShortName, fileCount);\n currentFile.delete();\n }\n } catch (IOException e) {\n System.err.println(\"Exception caught while reading \" + novels[j] + \":\");\n e.printStackTrace();\n }\n }\n\n\n }\n\n\n }",
"static public void createClusterProfileDir() {\n if (new File(getClusterProfileDir()).exists() == true) {\n return;\n }\n\n String dir = IJ.getDirectory(\"home\") + File.separator + \".MosaicToolSuite\";\n try {\n ShellCommand.exeCmd(\"mkdir \" + dir);\n }\n catch (final IOException e) {\n e.printStackTrace();\n }\n catch (final InterruptedException e) {\n e.printStackTrace();\n }\n\n dir += File.separator + \"clusterProfile\";\n\n try {\n ShellCommand.exeCmd(\"mkdir \" + dir);\n }\n catch (final IOException e) {\n e.printStackTrace();\n }\n catch (final InterruptedException e) {\n e.printStackTrace();\n }\n }",
"public void setToDir(File dir) {\n _destDir = dir;\n }",
"public DecisionLearningTree(String training, String test) {\n\t\ttrainingFile = training;\n\t\ttestFile = test;\n\t\treadTrainingFile();\n\t\troot = readDataFile();\n\t}",
"public static void main (String[] args) throws IOException {\n if (args.length < 6 || args.length % 2 == 1) {\n System.err.println (\"MENameTagger requires 4 + 2n arguments for n training corpora:\");\n System.err.println (\" state-file feature-file model-file props-file directory1 filelist1 [directory2 filelist2] ...\");\n System.exit (1);\n }\n String stateFile = args[0];\n String featureFile = args[1];\n String modelFile = args[2];\n String configFile = args[3];\n\t\tJetTest.initializeFromConfig (configFile);\n MENameTagger nt = new MENameTagger();\n\t\tnt.initialize (stateFile, featureFile);\n\t\tfor (int pass=1; pass <= 2; pass++) {\n\t\t\tMaxEntNE.pass = pass;\n\t\t\tMaxEntNE.trainingDocCount = 0;\n \tfor (int iarg = 4; iarg<args.length; iarg+=2) {\n \tString directory = args[iarg];\n \tString fileList = args[iarg+1];\n \tnt.train (directory, fileList);\n\t\t\t}\n }\n\t\tnt.mene.createModel();\n nt.store(modelFile);\n\t}",
"public void setExtractDir(final String dir) {\n this.extractBaseDir = new File(dir);\n extractBaseDir.mkdirs();\n }",
"public void setDriveTrain(DriveTrain driveTrain) {\r\n this.driveTrain = driveTrain;\r\n }",
"private static void findPath()\r\n {\r\n String temp_path = System.getProperty(\"user.dir\");\r\n char last = temp_path.charAt(temp_path.length() - 1);\r\n if(last == 'g')\r\n {\r\n path = \".\";\r\n }\r\n else\r\n {\r\n path = \"./bag\";\r\n }\r\n \r\n }",
"public static void main(String [] argv) {\n// weka.gui.explorer.Explorer explorer=new weka.gui.explorer.Explorer();\n// String[] file={};\n// explorer.main(file);\n runClassifier(new ExtremeLearningMachine(), argv);\n }",
"@Override\n public void prepareRun(BatchSourceContext context) throws IOException {\n Map<String, String> arguments = new HashMap<>();\n FileSetArguments.setInputPaths(arguments, config.files);\n context.setInput(Input.ofDataset(config.fileSetName, arguments));\n }",
"public void open(){\n try {\n output = new BufferedWriter(new FileWriter(training_path, true));\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public Builder inputFileDir(String inputFileDir) {\n this.inputFileDir = inputFileDir;\n return this;\n }",
"public void setImageDir(File imageRepDir) {\n\t\tFileDataPersister.getInstance().put(\"gui.configuration\", \"image.repository\", imageRepDir.getPath());\n\t\tRepository.getInstance().setRepository(imageRepDir);\n\t\tthis.getSelectedGraphEditor().repaint();\n\t}",
"public Drivetrain() {\n // Use inches as unit for encoder distances\n m_leftEncoder.setDistancePerPulse(initialDistancePerPulse);\n m_rightEncoder.setDistancePerPulse(initialDistancePerPulse);\n resetEncoders();\n }",
"public Builder setDirName(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n dirName_ = value;\n onChanged();\n return this;\n }",
"public void setDirFlag(boolean dirFlag) { this.dirFlag = dirFlag; }",
"public static void main(String[] args) {\n\t\t\r\n\t\tFile f=new File(\"C:\\\\Users\\\\DELL\\\\Desktop\\\\\",\"CheckFolder\");\r\n\t\t\r\n\t\tf.mkdir();\r\n\t\t\r\n\t\tSystem.out.println(f.isDirectory());\r\n\t\t\r\n\t\tSystem.out.println(f.getName());\r\n\t\t\r\n\t\tSystem.out.println(f.getParent());\r\n\t\t\r\n\t\t\r\n\t\t\r\n\r\n\t}",
"public static void main(final String[] args) {\n \tString enginePath = engines[8];\n\t\tEngineParameter eparams = new EngineParameter(enginePath);\n\n\t\tString url = \"http://files.grouplens.org/datasets/movielens/ml-1m.zip\";\n String folder = \"src/resources/main/data/ml-1m\";\n String modelPath = \"src/resources/main/crossValid/ml-1m/model/\";\n String recPath = \"src/resources/main/crossValid/ml-1m/recommendations/\";\n String dataFile = eparams.getDataSouceParams().getSourceLocation().get(0);\n int nFolds = N_FOLDS;\n \t\t\n System.out.println(\"Preparing splits...\");\n prepareSplits(url, nFolds, dataFile, folder, modelPath);\n \n System.out.println(\"Gathering recomendations...\");\n //recommend(nFolds, modelPath, recPath); // RiVal's original step.\n //orbsRecommend(nFolds, eparams, modelPath); // Based on RiVal' step\n mixedRecommend(nFolds, eparams, modelPath); // Mixed step\n \n //System.out.println(\"Preparing strategy...\");\n // the strategy files are (currently) being ignored\n //prepareStrategy(nFolds, modelPath, recPath, modelPath);\n\n System.out.println(\"Evaluating...\");\n evaluate(nFolds, modelPath, recPath);\n }",
"protected void initialize() {\n Robot.m_drivetrain.resetPath();\n Robot.m_drivetrain.addPoint(0, 0);\n Robot.m_drivetrain.addPoint(3, 0);\n Robot.m_drivetrain.generatePath();\n \n\t}",
"File getTargetDirectory();",
"public void setBasedir( String basedir )\n {\n setBasedir( new File( basedir.replace( '/', File.separatorChar ).replace( '\\\\', File.separatorChar ) ) );\n }",
"private static File getTestDataDir() {\n File ancestor = new File(System.getProperty(\"protobuf.dir\", \".\"));\n String initialPath = ancestor.getAbsolutePath();\n try {\n ancestor = ancestor.getCanonicalFile();\n } catch (IOException e) {\n throw new RuntimeException(\n \"Couldn't get canonical name of working directory.\", e);\n }\n while (ancestor != null && ancestor.exists()) {\n if (new File(ancestor, \"src/google/protobuf\").exists()) {\n return new File(ancestor, \"src/google/protobuf/testdata\");\n }\n ancestor = ancestor.getParentFile();\n }\n\n throw new RuntimeException(\n \"Could not find golden files. This test must be run from within the \" +\n \"protobuf source package so that it can read test data files from the \" +\n \"C++ source tree: \" + initialPath);\n }",
"private void setLabtainersDir() throws IOException{\n String newLabtainersPath = LabtainersDirTextfield.getText();\n \n // check if labtainers path exist\n if(new File(newLabtainersPath).isDirectory()){\n pathValidLabel.setVisible(false);\n \n FileOutputStream out = new FileOutputStream(iniFile);\n writeValueToINI(out, \"labtainersPath\", newLabtainersPath);\n\n labtainerPath = newLabtainersPath;\n updateLabtainersPath();\n \n LabtainersDirDialog.setVisible(false);\n }\n else{\n pathValidLabel.setVisible(true);\n } \n }",
"public void setBasedir(String baseD) throws BuildException {\n setBaseDir(new File(baseD));\n }",
"public void setDir() throws FileNotFoundException, IOException{\r\n final JFileChooser jfc = new JFileChooser();\r\n jfc.setDialogTitle(\"Choose Workplace Dirtory\");\r\n FileSystemView fsv = FileSystemView.getFileSystemView();\r\n //wppath stores workplace location\r\n wppath = fsv.getDefaultDirectory();\r\n File rd = new File(wppath.getAbsolutePath() + \"/USQ_Reporter.txt\");\r\n int ext = 0;\r\n if(rd.exists())ext=1;\r\n if(!rd.exists())ext=2;\r\n FileReader fr; \r\n if(rd.exists()){\r\n fr= new FileReader(rd);\r\n if(fr.read()==-1)\r\n ext=2;\r\n }\r\n //System.out.println(ext);\r\n //workplace path\r\n if(ext==1) {\r\n BufferedReader br = new BufferedReader(new FileReader(rd));\r\n workplace = br.readLine();\r\n }else if (ext==2) {\r\n jfc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\r\n int returnVal = jfc.showOpenDialog(this);\r\n \r\n if(returnVal == JFileChooser.APPROVE_OPTION) {\r\n File file = jfc.getSelectedFile();\r\n if(!file.exists()) {\r\n JOptionPane.showMessageDialog(null, \"file doesn't exist.\", \"System Message\", JOptionPane.ERROR_MESSAGE);\r\n } else if(file.isDirectory()) {\r\n workplace = file.getAbsolutePath();\r\n }\r\n }\r\n BufferedWriter bw = new BufferedWriter(new FileWriter(rd));\r\n bw.write(workplace);\r\n bw.flush();\r\n bw.close();\r\n }\r\n }",
"public void createTrainingData(String dirName, String processName, int fold, ArrayList<FoldInstance> instances) throws FileNotFoundException {\n PrintWriter writer = new PrintWriter(dirName + \"/\" + processName + \".jointtrain.cv.\" + fold);\n for (int i = 0; i < instances.size(); i++) {\n FoldInstance inst = instances.get(i);\n if (inst.getName().equalsIgnoreCase(processName)) {\n if (inst.getFold() == fold) {\n writer.println(inst.getSentences());\n writer.flush();\n }\n } else {\n writer.println(inst.getSentences());\n writer.flush();\n }\n\n }\n writer.close();\n }",
"public void trainTest(String template, int maxSize, Reader trainReader, Reader testReader, String directory, Algorithm mode) throws IOException {\n List<Clause> clauses = new ArrayList<Clause>();\n List<String> classifications = new ArrayList<String>();\n readExamples(trainReader, clauses, classifications);\n int[] trainSetIndices = new int[clauses.size()];\n for (int i = 0; i < trainSetIndices.length; i++){\n trainSetIndices[i] = i;\n }\n readExamples(testReader, clauses, classifications);\n int[] testSetIndices = new int[clauses.size()-trainSetIndices.length];\n for (int i = 0; i < testSetIndices.length; i++){\n testSetIndices[i] = i + trainSetIndices.length;\n }\n Triple<List<Set<PredicateDefinition>>,List<PredicateDefinition>,Dataset> preprocessed = preprocessDataset(clauses, classifications, PredicateDefinition.parseDefinition(template), true);\n trainTest_impl(template, preprocessed.t, preprocessed.r, preprocessed.s, maxSize, trainSetIndices, testSetIndices, new File(directory+\"/train.arff\"), new File(directory+\"/test.arff\"), mode);\n }",
"private void initializeTargetDirectory()\n {\n if ( isFtpEnabled() )\n initializeRemoteTargetDirectory();\n else\n initializeLocalTargetDirectory(); \n }",
"public void train() throws Exception;",
"public void setTraining(String s){\n\t\tmyText = s.trim();\n\t}",
"public void saveTraining(File datum) throws IOException, FileNotFoundException {\n bp.writer(datum);\n }"
] | [
"0.60886186",
"0.57081735",
"0.5695157",
"0.557939",
"0.55348504",
"0.5515155",
"0.550602",
"0.54871064",
"0.5445602",
"0.541634",
"0.5414581",
"0.5380302",
"0.5357071",
"0.5353806",
"0.5324003",
"0.5305847",
"0.5305503",
"0.5300043",
"0.52864194",
"0.52773875",
"0.527617",
"0.5254208",
"0.52427983",
"0.5221836",
"0.52110213",
"0.52043366",
"0.5192074",
"0.5169769",
"0.5166663",
"0.5157326",
"0.5134557",
"0.5133915",
"0.5095699",
"0.50884014",
"0.5088125",
"0.5066896",
"0.5063618",
"0.5058258",
"0.5054353",
"0.50481427",
"0.50312364",
"0.5023027",
"0.5003501",
"0.49990022",
"0.49800783",
"0.49800754",
"0.49621204",
"0.4945178",
"0.4942666",
"0.49302417",
"0.49159124",
"0.49090037",
"0.49065295",
"0.4904773",
"0.49004993",
"0.48969778",
"0.48966601",
"0.48812494",
"0.4877588",
"0.48690403",
"0.48638245",
"0.48637986",
"0.48534647",
"0.4852397",
"0.48514473",
"0.4839721",
"0.48392737",
"0.48254508",
"0.482198",
"0.48079178",
"0.47947076",
"0.47901008",
"0.47869897",
"0.47850147",
"0.47849438",
"0.4784333",
"0.47780353",
"0.47702852",
"0.47484788",
"0.47454026",
"0.473907",
"0.47349513",
"0.47292438",
"0.4728092",
"0.47233433",
"0.4716728",
"0.47126096",
"0.4709292",
"0.470841",
"0.47014922",
"0.46966398",
"0.46911013",
"0.46905708",
"0.46897715",
"0.46885765",
"0.4685948",
"0.468539",
"0.46815452",
"0.4675011",
"0.4650061",
"0.46442896"
] | 0.0 | -1 |
TODO Autogenerated method stub | public static void main(String[] args) throws FileNotFoundException {
File inFile = new File("result/in.txt");
File outFile = new File("result/out.txt");
int begin = 4;
Scanner cs = new Scanner(inFile);
PrintWriter out = new PrintWriter(outFile);
while(cs.hasNextLine())
{
String line = cs.nextLine();
line = line.substring(begin);
out.println(line);
}
cs.close();
out.close();
} | {
"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 wyrzuca wyjatek, pobrac z query liczbe i obsluzyc | public boolean checkIfUserHadCheckedAttendanceToday(int userID, String date) {
connect();
boolean bool;
try {
ResultSet result = statement.executeQuery("SELECT EXISTS (SELECT date FROM Attendance" +
"WHERE studentID LIKE '" + userID + "" +
"AND date LIKE '" + date + "'');");
// tutaj if obslugujacy wynik query
result.close();
statement.close();
connection.close();
return true;
} catch (SQLException e) {
// e.printStackTrace();
return false;
}
// return bool;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void montaQuery(Publicacao object, Query q) {\t\t\n\t}",
"@Override\n\tpublic void queryData() {\n\t\t\n\t}",
"Query query();",
"public List<Object[]> getRetencionesAnuladas(int mes, int anio, int idOrganizacion, Sucursal sucursalFP, Sucursal sucursalRetencion, PuntoDeVenta puntoVentaRetencion, String orden, TipoComprobanteSRI tipoComprobante)\r\n/* 125: */ {\r\n/* 126:175 */ StringBuilder sql = new StringBuilder();\r\n/* 127: */ \r\n/* 128:177 */ sql.append(\" SELECT a.fechaEmisionDocumento, f.fechaRegistro, f.fechaEmision, CONCAT(f.establecimiento,'-',f.puntoEmision,'-',f.numero), f.identificacionProveedor, \");\r\n/* 129: */ \r\n/* 130:179 */ sql.append(\" \\t'', f.montoIva*0, f.montoIva*0, f.montoIva*0, '', '', \");\r\n/* 131: */ \r\n/* 132:181 */ sql.append(\" \\tCONCAT(a.establecimiento,'-',a.puntoEmision,'-',a.numeroDesde), f.montoIva*0, f.montoIva*0, f.montoIva*0, f.nombreProveedor, \");\r\n/* 133: */ \r\n/* 134:183 */ sql.append(\"\\tf.montoIva*0, f.montoIva*0, '', a.autorizacion, f.fechaRegistro, f.autorizacion, '', 'ANULADO', f.idFacturaProveedorSRI,'' \");\r\n/* 135:184 */ sql.append(\" FROM AnuladoSRI a, FacturaProveedorSRI f \");\r\n/* 136:185 */ sql.append(\" WHERE a.documentoRelacionado = f.idFacturaProveedorSRI \");\r\n/* 137:186 */ sql.append(\" AND a.tipoComprobanteSRI = :tipoComprobante \");\r\n/* 138:187 */ sql.append(\" AND a.anio = :anio AND a.mes = :mes \");\r\n/* 139:188 */ sql.append(\" AND a.idOrganizacion = :idOrganizacion \");\r\n/* 140:189 */ if (sucursalFP != null) {\r\n/* 141:190 */ sql.append(\" AND f.idSucursal = :idSucursal \");\r\n/* 142: */ }\r\n/* 143:192 */ if (sucursalRetencion != null) {\r\n/* 144:193 */ sql.append(\" AND a.establecimiento = :sucursalRetencion \");\r\n/* 145: */ }\r\n/* 146:195 */ if (puntoVentaRetencion != null) {\r\n/* 147:196 */ sql.append(\" AND a.puntoEmision = :puntoVentaRetencion \");\r\n/* 148: */ }\r\n/* 149:198 */ Query query = this.em.createQuery(sql.toString());\r\n/* 150:199 */ query.setParameter(\"mes\", Integer.valueOf(mes));\r\n/* 151:200 */ query.setParameter(\"anio\", Integer.valueOf(anio));\r\n/* 152:201 */ query.setParameter(\"idOrganizacion\", Integer.valueOf(idOrganizacion));\r\n/* 153:202 */ query.setParameter(\"tipoComprobante\", tipoComprobante);\r\n/* 154:203 */ if (sucursalFP != null) {\r\n/* 155:204 */ query.setParameter(\"idSucursal\", Integer.valueOf(sucursalFP.getId()));\r\n/* 156: */ }\r\n/* 157:206 */ if (sucursalRetencion != null) {\r\n/* 158:207 */ query.setParameter(\"sucursalRetencion\", sucursalRetencion.getCodigo());\r\n/* 159: */ }\r\n/* 160:209 */ if (puntoVentaRetencion != null) {\r\n/* 161:210 */ query.setParameter(\"puntoVentaRetencion\", puntoVentaRetencion.getCodigo());\r\n/* 162: */ }\r\n/* 163:213 */ return query.getResultList();\r\n/* 164: */ }",
"@Test\n public void test4() throws Exception {\n String jpql = \"SELECT c FROM Course c where SQL('course_mapped ->> ''?'' LIKE ''%i%''', c.name) AND \" +\n \"SQL('json_array_length(course_mapped #> ''{levels}'') > 0')\";\n Query q = em.createQuery(jpql, Course.class);\n List<Course> courses = q.getResultList();\n Assert.assertEquals(1,courses.size());\n Assert.assertEquals(\"First one\", courses.get(0).getCourseMapped().getName());\n }",
"@Test\n public void test3() throws Exception {\n String jpql = \"SELECT c FROM Course c where SQL('course_mapped ->> ''?'' = ''Second one''',c.name) \";\n Query q = em.createQuery(jpql, Course.class);\n List<Course> courses = q.getResultList();\n Assert.assertEquals(1, courses.size());\n Assert.assertEquals(\"Second one\", courses.get(0).getCourseMapped().getName());\n\n }",
"public List<ReporteRetencionesResumido> getRetencionSRIResumido(int mes, int anio, int idOrganizacion)\r\n/* 27: */ {\r\n/* 28: 58 */ String sql = \"SELECT new ReporteRetencionesResumido(f.fechaEmisionRetencion,f.fechaRegistro,f.fechaEmision, CONCAT(f.establecimiento,'-',f.puntoEmision,'-',f.numero),\\tf.identificacionProveedor,c.descripcion,CASE WHEN c.tipoConceptoRetencion = :tipoConceptoFUENTE then (SUM(COALESCE(dfp.baseImponibleRetencion, 0)+COALESCE(dfp.baseImponibleTarifaCero, 0) +COALESCE(dfp.baseImponibleDiferenteCero, 0)+COALESCE(dfp.baseImponibleNoObjetoIva, 0))) else COALESCE(dfp.baseImponibleRetencion, 0) end,dfp.porcentajeRetencion,dfp.valorRetencion,\\tc.codigo,CASE WHEN c.tipoConceptoRetencion = :tipoConceptoIVA then 'IVA' WHEN c.tipoConceptoRetencion = :tipoConceptoFUENTE then 'FUENTE' WHEN c.tipoConceptoRetencion = :tipoConceptoISD then 'ISD' else '' end,f.numeroRetencion) FROM DetalleFacturaProveedorSRI dfp INNER JOIN dfp.facturaProveedorSRI f INNER JOIN dfp.conceptoRetencionSRI c WHERE MONTH(f.fechaRegistro) =:mes\\tAND YEAR(f.fechaRegistro) =:anio AND f.estado!=:estadoAnulado AND f.indicadorSaldoInicial!=true AND f.idOrganizacion = :idOrganizacion\\tGROUP BY c.codigo,f.numero,f.puntoEmision,\\tf.establecimiento, f.identificacionProveedor,\\tc.descripcion,dfp.baseImponibleRetencion,dfp.porcentajeRetencion,dfp.valorRetencion,f.fechaEmisionRetencion,f.fechaRegistro,f.fechaEmision,f.numeroRetencion, c.tipoConceptoRetencion ORDER BY c.tipoConceptoRetencion, c.codigo \";\r\n/* 29: */ \r\n/* 30: */ \r\n/* 31: */ \r\n/* 32: */ \r\n/* 33: */ \r\n/* 34: */ \r\n/* 35: */ \r\n/* 36: */ \r\n/* 37: */ \r\n/* 38: */ \r\n/* 39: */ \r\n/* 40: */ \r\n/* 41: */ \r\n/* 42: */ \r\n/* 43: */ \r\n/* 44: */ \r\n/* 45: 75 */ Query query = this.em.createQuery(sql);\r\n/* 46: 76 */ query.setParameter(\"mes\", Integer.valueOf(mes));\r\n/* 47: 77 */ query.setParameter(\"anio\", Integer.valueOf(anio));\r\n/* 48: 78 */ query.setParameter(\"estadoAnulado\", Estado.ANULADO);\r\n/* 49: 79 */ query.setParameter(\"idOrganizacion\", Integer.valueOf(idOrganizacion));\r\n/* 50: 80 */ query.setParameter(\"tipoConceptoIVA\", TipoConceptoRetencion.IVA);\r\n/* 51: 81 */ query.setParameter(\"tipoConceptoFUENTE\", TipoConceptoRetencion.FUENTE);\r\n/* 52: 82 */ query.setParameter(\"tipoConceptoISD\", TipoConceptoRetencion.ISD);\r\n/* 53: 83 */ List<ReporteRetencionesResumido> lista = query.getResultList();\r\n/* 54: */ \r\n/* 55: 85 */ return lista;\r\n/* 56: */ }",
"@Override\n\tpublic List<Object> query(QueryUtil queryUtil) {\n\t\treturn null;\n\t}",
"SelectQuery createSelectQuery();",
"public void Query() {\n }",
"public List<ReporteComprasVentasRetenciones> getReporteRetencionClientes(int mes, int anio, int idOrganizacion)\r\n/* 231: */ {\r\n/* 232:307 */ StringBuffer sql = new StringBuffer();\r\n/* 233:308 */ sql.append(\"SELECT new ReporteComprasVentasRetenciones(fp.codigo, fp.nombre, COUNT(fp.codigo),\");\r\n/* 234:309 */ sql.append(\" (CASE WHEN fp.indicadorRetencionIva = true OR fp.indicadorRetencionFuente = true THEN SUM(dcfc.valor) END),\");\r\n/* 235:310 */ sql.append(\" 'Ventas', '' )\");\r\n/* 236:311 */ sql.append(\" FROM DetalleCobroFormaCobro dcfc\");\r\n/* 237:312 */ sql.append(\" JOIN dcfc.detalleFormaCobro dfc\");\r\n/* 238:313 */ sql.append(\" LEFT JOIN dfc.cobro c\");\r\n/* 239:314 */ sql.append(\" LEFT OUTER JOIN dfc.formaPago fp\");\r\n/* 240:315 */ sql.append(\" LEFT OUTER JOIN dcfc.detalleCobro dc\");\r\n/* 241:316 */ sql.append(\" LEFT OUTER JOIN dc.cuentaPorCobrar cpc\");\r\n/* 242:317 */ sql.append(\" LEFT OUTER JOIN cpc.facturaCliente fc\");\r\n/* 243:318 */ sql.append(\" WHERE MONTH(c.fecha) =:mes\");\r\n/* 244:319 */ sql.append(\" AND YEAR(c.fecha) =:anio\");\r\n/* 245:320 */ sql.append(\" AND fc.estado!=:estadoAnulado\");\r\n/* 246:321 */ sql.append(\" AND c.estado!=:estadoAnulado\");\r\n/* 247:322 */ sql.append(\" AND (fp.indicadorRetencionIva=true OR fp.indicadorRetencionFuente=true)\");\r\n/* 248:323 */ sql.append(\" AND fc.idOrganizacion = :idOrganizacion\");\r\n/* 249:324 */ sql.append(\" GROUP BY fp.codigo, fp.nombre, fp.indicadorRetencionIva, fp.indicadorRetencionFuente\");\r\n/* 250:325 */ sql.append(\" ORDER BY fp.codigo, fp.nombre\");\r\n/* 251:326 */ Query query = this.em.createQuery(sql.toString());\r\n/* 252:327 */ query.setParameter(\"mes\", Integer.valueOf(mes));\r\n/* 253:328 */ query.setParameter(\"anio\", Integer.valueOf(anio));\r\n/* 254:329 */ query.setParameter(\"estadoAnulado\", Estado.ANULADO);\r\n/* 255:330 */ query.setParameter(\"idOrganizacion\", Integer.valueOf(idOrganizacion));\r\n/* 256:331 */ return query.getResultList();\r\n/* 257: */ }",
"public List<ReporteComprasVentasRetenciones> getReporteCompras(int mes, int anio, int idOrganizacion)\r\n/* 167: */ {\r\n/* 168:227 */ StringBuffer sql = new StringBuffer();\r\n/* 169: */ \r\n/* 170:229 */ sql.append(\" SELECT new ReporteComprasVentasRetenciones(tc.codigo, tc.nombre, COUNT(tc.codigo), \");\r\n/* 171:230 */ sql.append(\" (CASE WHEN tc.codigo = '04' THEN -SUM(fps.baseImponibleTarifaCero) ELSE SUM(fps.baseImponibleTarifaCero) END), \");\r\n/* 172:231 */ sql.append(\" (CASE WHEN tc.codigo = '04' THEN -SUM(fps.baseImponibleDiferenteCero) ELSE SUM(fps.baseImponibleDiferenteCero) END), \");\r\n/* 173:232 */ sql.append(\" (CASE WHEN tc.codigo = '04' THEN -SUM(fps.baseImponibleNoObjetoIva) ELSE SUM(fps.baseImponibleNoObjetoIva) END), \");\r\n/* 174:233 */ sql.append(\" (CASE WHEN tc.codigo = '04' THEN -SUM(fps.montoIva) ELSE SUM(fps.montoIva) END), 'Compras',ct.codigo,ct.nombre) \");\r\n/* 175:234 */ sql.append(\" FROM FacturaProveedorSRI fps \");\r\n/* 176:235 */ sql.append(\" LEFT OUTER JOIN fps.tipoComprobanteSRI tc \");\r\n/* 177:236 */ sql.append(\" LEFT OUTER JOIN fps.creditoTributarioSRI ct\");\r\n/* 178:237 */ sql.append(\" WHERE MONTH(fps.fechaRegistro) =:mes \");\r\n/* 179:238 */ sql.append(\" AND YEAR(fps.fechaRegistro) =:anio \");\r\n/* 180:239 */ sql.append(\" AND fps.estado!=:estadoAnulado \");\r\n/* 181:240 */ sql.append(\" AND fps.indicadorSaldoInicial!=true \");\r\n/* 182:241 */ sql.append(\" AND fps.idOrganizacion = :idOrganizacion \");\r\n/* 183:242 */ sql.append(\" GROUP BY tc.codigo, tc.nombre,ct.codigo,ct.nombre\");\r\n/* 184:243 */ sql.append(\" ORDER BY tc.codigo, tc.nombre \");\r\n/* 185: */ \r\n/* 186:245 */ Query query = this.em.createQuery(sql.toString());\r\n/* 187:246 */ query.setParameter(\"mes\", Integer.valueOf(mes));\r\n/* 188:247 */ query.setParameter(\"anio\", Integer.valueOf(anio));\r\n/* 189:248 */ query.setParameter(\"estadoAnulado\", Estado.ANULADO);\r\n/* 190:249 */ query.setParameter(\"idOrganizacion\", Integer.valueOf(idOrganizacion));\r\n/* 191: */ \r\n/* 192:251 */ return query.getResultList();\r\n/* 193: */ }",
"private static HashSet<String> simpleExecution(Query query, OntModel ontologie) {\n HashSet<String> propertySet = new HashSet<>();\n try (QueryExecution qexec = QueryExecutionFactory.create(query, ontologie)) {\n ResultSet results = qexec.execSelect();\n int i = 0;\n while (results.hasNext()) {\n propertySet.add(results.next().getResource(\"prop\").getURI());\n\n i++;\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n return propertySet;\n }",
"public CalMetasDTO cargarRegistro(int codigoCiclo, int codigoPlan, int codigoMeta) {\n/* */ try {\n/* 416 */ String s = \"select m.*,\";\n/* 417 */ s = s + \"tm.descripcion as nombreTipoMedicion,\";\n/* 418 */ s = s + \"est.descripcion as nombreEstado,\";\n/* 419 */ s = s + \"Um.Descripcion as nombre_unidad_medida\";\n/* 420 */ s = s + \" from cal_plan_metas m,sis_multivalores tm,sis_multivalores est,Sis_Multivalores Um\";\n/* 421 */ s = s + \" where \";\n/* 422 */ s = s + \" m.tipo_medicion =tm.valor\";\n/* 423 */ s = s + \" and tm.tabla='CAL_TIPO_MEDICION'\";\n/* 424 */ s = s + \" and m.estado =est.valor\";\n/* 425 */ s = s + \" and est.tabla='CAL_ESTADO_META'\";\n/* 426 */ s = s + \" and m.Unidad_Medida = Um.Valor\";\n/* 427 */ s = s + \" and Um.Tabla = 'CAL_UNIDAD_MEDIDA_META'\";\n/* 428 */ s = s + \" and m.codigo_ciclo=\" + codigoCiclo;\n/* 429 */ s = s + \" and m.codigo_plan=\" + codigoPlan;\n/* 430 */ s = s + \" and m.codigo_meta=\" + codigoMeta;\n/* 431 */ boolean rtaDB = this.dat.parseSql(s);\n/* 432 */ if (!rtaDB) {\n/* 433 */ return null;\n/* */ }\n/* */ \n/* 436 */ this.rs = this.dat.getResultSet();\n/* 437 */ if (this.rs.next()) {\n/* 438 */ return leerRegistro();\n/* */ }\n/* */ }\n/* 441 */ catch (Exception e) {\n/* 442 */ e.printStackTrace();\n/* 443 */ Utilidades.writeError(\"CalPlanMetasFactory:cargarCalMetas \", e);\n/* */ } \n/* 445 */ return null;\n/* */ }",
"private DbQuery() {}",
"@Override\n public List<BaseLog> query(String realname) {\n BaseLogExample example = new BaseLogExample();\n if(realname!=null){\n example.createCriteria().andRealnameLike(\"%\"+realname+\"%\");\n }\n List<BaseLog> list = baseLogMapper.selectByExample(example);\n return list;\n }",
"private void addQueries(String query){\n ArrayList <String> idsFullSet = new ArrayList <String>(searchIDs);\n while(idsFullSet.size() > 0){\n ArrayList <String> idsSmallSet = new ArrayList <String>(); \n if(debugMode) {\n System.out.println(\"\\t Pmids not used in query available : \" + idsFullSet.size());\n }\n idsSmallSet.addAll(idsFullSet.subList(0,Math.min(getSearchIdsLimit(), idsFullSet.size())));\n idsFullSet.removeAll(idsSmallSet);\n String idsConstrain =\"\";\n idsConstrain = idsConstrain(idsSmallSet);\n addQuery(query,idsConstrain);\n }\n }",
"Object executeSelectQuery(String sql) { return null;}",
"ObstacleQuery createObstacleQuery();",
"@Test\n public void test2(){\n String sql = \"select order_id orderID, order_name orderName, order_date orderDate from order_table where order_id = ?\";\n Order order = getOrder(sql, 4);\n System.out.println(order);\n }",
"public abstract String createQuery();",
"public abstract Statement queryToRetrieveData();",
"public List<Object[]> getRetencionSRI(int mes, int anio, int idOrganizacion, Sucursal sucursalFP, Sucursal sucursalRetencion, PuntoDeVenta puntoVentaRetencion, String orden)\r\n/* 59: */ {\r\n/* 60:107 */ StringBuilder sql = new StringBuilder();\r\n/* 61: */ \r\n/* 62:109 */ sql.append(\" SELECT f.fechaEmisionRetencion, f.fechaRegistro, f.fechaEmision, \");\r\n/* 63:110 */ sql.append(\" CONCAT(f.establecimiento,'-',f.puntoEmision,'-',f.numero), \");\r\n/* 64:111 */ sql.append(\" f.identificacionProveedor, c.descripcion, \");\r\n/* 65:112 */ sql.append(\" coalesce(CASE WHEN c.tipoConceptoRetencion = :tipoConceptoFUENTE THEN (SUM(COALESCE(dfp.baseImponibleRetencion, 0)+COALESCE(dfp.baseImponibleTarifaCero, 0) \");\r\n/* 66:113 */ sql.append(\" \\t+COALESCE(dfp.baseImponibleDiferenteCero, 0)+COALESCE(dfp.baseImponibleNoObjetoIva, 0))) ELSE COALESCE(dfp.baseImponibleRetencion, 0) END,0), \");\r\n/* 67:114 */ sql.append(\" coalesce(dfp.porcentajeRetencion, 0), coalesce(dfp.valorRetencion, 0), coalesce(c.codigo, 'NA'), \");\r\n/* 68:115 */ sql.append(\" coalesce(CASE WHEN c.tipoConceptoRetencion = :tipoConceptoIVA THEN 'IVA' WHEN c.tipoConceptoRetencion = :tipoConceptoFUENTE THEN 'FUENTE' WHEN c.tipoConceptoRetencion = :tipoConceptoISD THEN 'ISD' ELSE '' END,'NA'), \");\r\n/* 69:116 */ sql.append(\" CONCAT(f.establecimientoRetencion,'-',f.puntoEmisionRetencion,'-',f.numeroRetencion), \");\r\n/* 70:117 */ sql.append(\" f.baseImponibleTarifaCero, f.baseImponibleDiferenteCero, f.baseImponibleNoObjetoIva, f.nombreProveedor, f.montoIva, \");\r\n/* 71:118 */ sql.append(\" f.montoIce, ct.codigo, f.autorizacionRetencion, f.fechaRegistro, f.autorizacion, f.claveAcceso, f.estado,f.idFacturaProveedorSRI, fp.descripcion \");\r\n/* 72:119 */ sql.append(\" FROM DetalleFacturaProveedorSRI dfp \");\r\n/* 73:120 */ sql.append(\" RIGHT OUTER JOIN dfp.conceptoRetencionSRI c \");\r\n/* 74:121 */ sql.append(\" RIGHT OUTER JOIN dfp.facturaProveedorSRI f \");\r\n/* 75:122 */ sql.append(\" LEFT OUTER JOIN f.facturaProveedor fp \");\r\n/* 76:123 */ sql.append(\" LEFT JOIN f.creditoTributarioSRI ct \");\r\n/* 77:124 */ sql.append(\" WHERE MONTH(f.fechaRegistro) =:mes AND f.documentoModificado IS NULL \");\r\n/* 78:125 */ sql.append(\" AND YEAR(f.fechaRegistro) =:anio \");\r\n/* 79:126 */ sql.append(\" AND f.estado!=:estadoAnulado \");\r\n/* 80:127 */ sql.append(\" AND f.indicadorSaldoInicial!=true \");\r\n/* 81:128 */ sql.append(\" AND f.idOrganizacion = :idOrganizacion \");\r\n/* 82:129 */ if (sucursalFP != null) {\r\n/* 83:130 */ sql.append(\" AND f.idSucursal = :idSucursal \");\r\n/* 84: */ }\r\n/* 85:132 */ if (sucursalRetencion != null) {\r\n/* 86:133 */ sql.append(\" AND f.establecimientoRetencion = :sucursalRetencion \");\r\n/* 87: */ }\r\n/* 88:135 */ if (puntoVentaRetencion != null) {\r\n/* 89:136 */ sql.append(\" AND f.puntoEmisionRetencion = :puntoVentaRetencion \");\r\n/* 90: */ }\r\n/* 91:138 */ sql.append(\" GROUP BY f.idFacturaProveedorSRI, c.codigo, f.numero, f.puntoEmision, \");\r\n/* 92:139 */ sql.append(\" f.establecimiento, f.identificacionProveedor, \");\r\n/* 93:140 */ sql.append(\" c.descripcion, dfp.baseImponibleRetencion, dfp.porcentajeRetencion, dfp.valorRetencion, f.fechaEmisionRetencion, f.fechaRegistro, f.fechaEmision, f.numeroRetencion, \");\r\n/* 94:141 */ sql.append(\" f.baseImponibleTarifaCero, f.baseImponibleDiferenteCero, f.baseImponibleNoObjetoIva, f.nombreProveedor, f.montoIva, \");\r\n/* 95:142 */ sql.append(\" f.montoIce, ct.codigo, f.autorizacionRetencion, f.fechaRegistro, c.tipoConceptoRetencion, f.autorizacion, f.claveAcceso, f.estado, \");\r\n/* 96:143 */ sql.append(\" f.establecimientoRetencion, f.puntoEmisionRetencion, f.numeroRetencion, fp.descripcion \");\r\n/* 97:144 */ if ((orden != null) && (orden.equals(\"POR_RETENCION\"))) {\r\n/* 98:145 */ sql.append(\" ORDER BY f.establecimientoRetencion, f.puntoEmisionRetencion, f.numeroRetencion \");\r\n/* 99:146 */ } else if ((orden != null) && (orden.equals(\"POR_FACTURA\"))) {\r\n/* 100:147 */ sql.append(\" ORDER BY f.establecimiento, f.puntoEmision, f.numero \");\r\n/* 101:148 */ } else if ((orden != null) && (orden.equals(\"POR_CONCEPTO\"))) {\r\n/* 102:149 */ sql.append(\" ORDER BY c.descripcion \");\r\n/* 103: */ }\r\n/* 104:151 */ Query query = this.em.createQuery(sql.toString());\r\n/* 105:152 */ query.setParameter(\"mes\", Integer.valueOf(mes));\r\n/* 106:153 */ query.setParameter(\"anio\", Integer.valueOf(anio));\r\n/* 107:154 */ query.setParameter(\"estadoAnulado\", Estado.ANULADO);\r\n/* 108:155 */ query.setParameter(\"idOrganizacion\", Integer.valueOf(idOrganizacion));\r\n/* 109:156 */ query.setParameter(\"tipoConceptoIVA\", TipoConceptoRetencion.IVA);\r\n/* 110:157 */ query.setParameter(\"tipoConceptoFUENTE\", TipoConceptoRetencion.FUENTE);\r\n/* 111:158 */ query.setParameter(\"tipoConceptoISD\", TipoConceptoRetencion.ISD);\r\n/* 112:159 */ if (sucursalFP != null) {\r\n/* 113:160 */ query.setParameter(\"idSucursal\", Integer.valueOf(sucursalFP.getId()));\r\n/* 114: */ }\r\n/* 115:162 */ if (sucursalRetencion != null) {\r\n/* 116:163 */ query.setParameter(\"sucursalRetencion\", sucursalRetencion.getCodigo());\r\n/* 117: */ }\r\n/* 118:165 */ if (puntoVentaRetencion != null) {\r\n/* 119:166 */ query.setParameter(\"puntoVentaRetencion\", puntoVentaRetencion.getCodigo());\r\n/* 120: */ }\r\n/* 121:169 */ return query.getResultList();\r\n/* 122: */ }",
"public interface TopicoRepository extends JpaRepository<Topico, Long> {\n Page<Topico> findByCursoNome(String nomeCurso, Pageable pageable); //Gera a query\n\n //criando minha própria Query sem usar o padrão do JpaRepository\n @Query(\"SELECT t FROM Topico t WHERE t.curso.nome = :nomeCurso\") //JPQL\n List<Topico> carregandoCursoNome(@Param(\"nomeCurso\") String nomeCurso);\n}",
"@Override\n\tpublic Query objectQuery(String query) throws Exception {\n\t\treturn null;\n\t}",
"private void armarQuery(String filtro) throws DatabaseErrorException {\n String query = null;\n if (filtro != null && filtro.length() > 0) {\n query = \"SELECT * FROM \" + CLASS_NAME + \" o WHERE o.nombre ILIKE '\" + filtro + \"%' ORDER BY o.nombre\";\n }\n cargarContenedorTabla(query);\n }",
"@SuppressWarnings(\"unused\")\n\t\tprivate String querySingleValue(String query, String field){\n\t\t\treturn field;\n\n\t\t/*\tJdbcTemplate jdt = new JdbcTemplate(getDataSource());\n\t \tList queryList;\n\t \tString result = \"\";\n\n\t \t queryList = jdt.queryForList(query);\n\t \t Iterator i = queryList.iterator();\n\t \t i = queryList.iterator();\n\t \t if (i.hasNext()) {\n\t\t\t\t ListOrderedMap data = (ListOrderedMap) i.next();\n\t\t\t\t if (data.get(field) == null){\n\t\t\t\t } else {\n\t\t\t\t\t result = data.get(field).toString();\n\t\t\t\t }\n\t \t }\n\t \t return result;*/\n\t\t}",
"public void jpqlFiltri() {\n em.getTransaction().begin();\n Query q = em.createQuery(\"SELECT c FROM Customer c WHERE c.customer_id between 340 and 345\");\n\n List<Customer> listF = q.getResultList();\n\n System.out.println(\"I Customer con id tra 340 e 345 sono:\");\n\n for (Customer c : listF) {\n System.out.println(c.getCustomerId() + c.getFirstName() + c.getLastName());\n\n }\n\n Query q1 = em.createQuery(\"SELECT c FROM Customer c WHERE c.first_name like 'S%'\");\n\n List<Customer> listF2 = q1.getResultList();\n\n System.out.println(\"I Customer con nome che inizia per la lettera S sono:\");\n\n for (Customer c : listF2) {\n System.out.println(c.getCustomerId() + c.getFirstName() + c.getLastName());\n\n }\n\n em.getTransaction().commit();\n em.close();\n emf.close();\n }",
"@Override\n\tpublic List queryAll() throws Exception {\n\t\treturn null;\n\t}",
"private List<Produto> retornaProduto (Long cod){\n \n Query q = entityManager.createNamedQuery(\"Produto.findByCodigo\");\n q.setParameter(\"codigo\", cod);\n List <Produto> p = q.getResultList();\n return p; \n}",
"@Query(value = \"SELECT concat(e.nombreempleado,' ',e.apellidoempleado),p.nombrepuesto,ca.duracionhoracapacitacion,ca.nombrecapacitacion,\\n\" +\n\"ca.departamentoresponsable,DATE_FORMAT(ca.fechacapacitaciondesde, '%d/%m/%Y'), DATE_FORMAT(ca.fechacapacitacionhasta, '%d/%m/%Y') from empleado e \\n\" +\n\"\\n\" +\n\" inner join puesto p on e.codigopuesto=p.codigopuesto \\n\" +\n\" inner join empleadocapacitacion ec on e.codigoempleado=ec.codigoempleado\\n\" +\n\" INNER JOIN capacitacion ca on ec.codigocapacitacion=ca.codigocapacitacion\" \n+ \" where \" \n+ \" ca.fechacapacitaciondesde >= STR_TO_DATE(:FINICIAL, '%d/%m/%Y') \" \n+ \" and ca.fechacapacitaciondesde <= STR_TO_DATE(:FFINAL, '%d/%m/%Y') \", \n nativeQuery = true)\n\n public List<Object[]> findByCapacitacionesR(@Param(\"FINICIAL\") String finicial, \n @Param(\"FFINAL\") String ffinal);",
"public List<ReporteComprasVentasRetenciones> getReporteVentas(int mes, int anio, int idOrganizacion, boolean electronicas)\r\n/* 196: */ {\r\n/* 197:264 */ StringBuffer sql = new StringBuffer();\r\n/* 198: */ \r\n/* 199:266 */ sql.append(\" SELECT new ReporteComprasVentasRetenciones(tc.codigo, tc.nombre, COUNT(tc.codigo), \");\r\n/* 200:267 */ sql.append(\" (CASE WHEN tc.codigo = '04' THEN -SUM(fcs.baseImponibleTarifaCero) ELSE SUM(fcs.baseImponibleTarifaCero) END), \");\r\n/* 201:268 */ sql.append(\" (CASE WHEN tc.codigo = '04' THEN -SUM(fcs.baseImponibleDiferenteCero) ELSE SUM(fcs.baseImponibleDiferenteCero) END), \");\r\n/* 202:269 */ sql.append(\" (CASE WHEN tc.codigo = '04' THEN -SUM(fcs.baseImponibleNoObjetoIva) ELSE SUM(fcs.baseImponibleNoObjetoIva) END), \");\r\n/* 203:270 */ sql.append(\" (CASE WHEN tc.codigo = '04' THEN -SUM(fcs.montoIva) ELSE SUM(fcs.montoIva) END), 'Ventas', (CASE WHEN tc.codigo = '41' THEN '02' ELSE '01' END),\");\r\n/* 204:271 */ sql.append(\" (CASE WHEN tc.codigo = '04' THEN -SUM(fc.descuentoImpuesto) ELSE SUM(fc.descuentoImpuesto) END))\");\r\n/* 205:272 */ sql.append(\" FROM FacturaClienteSRI fcs \");\r\n/* 206:273 */ sql.append(\" JOIN fcs.facturaCliente fc \");\r\n/* 207:274 */ sql.append(\" LEFT OUTER JOIN fcs.tipoComprobanteSRI tc \");\r\n/* 208:275 */ sql.append(\" LEFT OUTER JOIN fc.documento d \");\r\n/* 209:276 */ sql.append(\" LEFT OUTER JOIN fc.facturaClientePadre fcpadre \");\r\n/* 210:277 */ sql.append(\" LEFT OUTER JOIN fcpadre.documento dpadre \");\r\n/* 211:278 */ sql.append(\" WHERE MONTH(fcs.fechaEmision) =:mes \");\r\n/* 212:279 */ sql.append(\" AND YEAR(fcs.fechaEmision) =:anio \");\r\n/* 213:280 */ sql.append(\" AND fc.estado!=:estadoAnulado \");\r\n/* 214:281 */ sql.append(\" AND fcs.indicadorSaldoInicial!=true \");\r\n/* 215:282 */ sql.append(\" AND fcs.idOrganizacion = :idOrganizacion \");\r\n/* 216:283 */ sql.append(\" AND COALESCE(dpadre.indicadorDocumentoExterior, d.indicadorDocumentoExterior) = false \");\r\n/* 217:284 */ sql.append(\" AND fcs.indicadorDocumentoElectronico = :fisicas \");\r\n/* 218:285 */ sql.append(\" GROUP BY tc.codigo, tc.nombre \");\r\n/* 219:286 */ sql.append(\" ORDER BY tc.codigo, tc.nombre \");\r\n/* 220: */ \r\n/* 221:288 */ Query query = this.em.createQuery(sql.toString());\r\n/* 222:289 */ query.setParameter(\"mes\", Integer.valueOf(mes));\r\n/* 223:290 */ query.setParameter(\"anio\", Integer.valueOf(anio));\r\n/* 224:291 */ query.setParameter(\"estadoAnulado\", Estado.ANULADO);\r\n/* 225:292 */ query.setParameter(\"idOrganizacion\", Integer.valueOf(idOrganizacion));\r\n/* 226:293 */ query.setParameter(\"fisicas\", Boolean.valueOf(electronicas));\r\n/* 227:294 */ return query.getResultList();\r\n/* 228: */ }",
"public List<ReporteComprasVentasRetenciones> getNumeroComprobantesAnulados(int mes, int anio, int idOrganizacion)\r\n/* 289: */ {\r\n/* 290:381 */ StringBuffer sql = new StringBuffer();\r\n/* 291:382 */ sql.append(\" SELECT new ReporteComprasVentasRetenciones(tc.codigo, tc.nombre, SUM(CASE WHEN a.numeroRegistrosAnulados IS NULL THEN 0 ELSE a.numeroRegistrosAnulados END), \");\r\n/* 292:383 */ sql.append(\" 'Anulados' ) \");\r\n/* 293:384 */ sql.append(\" FROM AnuladoSRI a \");\r\n/* 294:385 */ sql.append(\" LEFT JOIN a.tipoComprobanteSRI tc \");\r\n/* 295:386 */ sql.append(\" WHERE a.mes = :mes \");\r\n/* 296:387 */ sql.append(\" AND a.anio = :anio \");\r\n/* 297:388 */ sql.append(\" AND a.idOrganizacion = :idOrganizacion \");\r\n/* 298:389 */ sql.append(\" GROUP BY tc.codigo, tc.nombre \");\r\n/* 299: */ \r\n/* 300:391 */ Query query = this.em.createQuery(sql.toString());\r\n/* 301:392 */ query.setParameter(\"mes\", Integer.valueOf(mes));\r\n/* 302:393 */ query.setParameter(\"anio\", Integer.valueOf(anio));\r\n/* 303:394 */ query.setParameter(\"idOrganizacion\", Integer.valueOf(idOrganizacion));\r\n/* 304: */ \r\n/* 305:396 */ return query.getResultList();\r\n/* 306: */ }",
"List<Prueba> selectByExample(PruebaExample example);",
"private String doQueryById(HttpServletRequest request,\n HttpServletResponse response) {\n return null;\n }",
"public void iniciarProduccion(){\n try {\n Connection conn = Conectar.conectar();\n Statement st = conn.createStatement();\n ResultSet rs = st.executeQuery(\"select nick from usuarios where nick in(select usuario from construcciones) or nick \"\n +\"in(select usuario from investigaciones) or nick in(select usuario from movimientos)\");\n\n while(rs.next()){\n produccion.add(new Construcciones(rs.getString(1)));\n System.out.println(rs.getString(1));\n }\n\n st.close();\n rs.close();\n conn.close();\n\n }catch(SQLException e){\n System.out.println(\"Fallo actualizacion de produccion.\");\n }\n}",
"public Institucion buscarInstitucionDeSolicitud(String cod_solicitud){\n\tString sql=\"select * from institucion where cod_institucion='\"+cod_solicitud+\"';\";\n\t\n\treturn db.queryForObject(sql, new InstitucionRowMapper());\n}",
"String limitSubquery();",
"@Query(\"Select * from Asignatura\")\n LiveData<List<Asignatura>> obtenerAsignaturas();",
"public void refresh() {\n String sql = \"\";\n sql += \"select m.id\"\n + \", m.data\"\n + \", CAST(CONCAT(dep.nome, ' [', dep.id, ']') AS CHAR(50)) as deposito\"\n + \", cau.descrizione as causale\"\n + \", m.articolo\"\n + \", if (cau.segno = -1 , -m.quantita, m.quantita) as quantita\"\n + \", m.note\"\n + \", cast(concat(IF(m.da_tipo_fattura = 7, 'Scontr.', \"\n + \" IF(m.da_tabella = 'test_fatt', 'Fatt. Vend.', \"\n + \" IF(m.da_tabella = 'test_ddt', 'DDT Vend.',\"\n + \" IF(m.da_tabella = 'test_fatt_acquisto', 'Fatt. Acq.',\"\n + \" IF(m.da_tabella = 'test_ddt_acquisto', 'DDT Acq.', m.da_tabella)))))\"\n + \" , da_serie, ' ', da_numero, '/', da_anno, ' - [ID ', da_id, ']') as CHAR)as origine\"\n // + \", m.da_tabella\"\n // + \", m.da_anno\"\n // + \", m.da_serie\"\n // + \", m.da_numero\"\n // + \", m.da_id\"\n + \", m.matricola\"\n + \", m.lotto\"\n + \", a.codice_fornitore, a.codice_a_barre from movimenti_magazzino m left join articoli a on m.articolo = a.codice\"\n + \" left join tipi_causali_magazzino cau on m.causale = cau.codice\"\n + \" left join depositi dep ON m.deposito = dep.id\";\n sql += \" where 1 = 1\";\n System.out.println(\"articolo_selezionato_filtro_ref = \" + articolo_selezionato_filtro_ref);\n System.out.println(\"articolo_selezionato_filtro_ref get = \" + articolo_selezionato_filtro_ref.get());\n if (articolo_selezionato_filtro_ref.get() != null && StringUtils.isNotBlank(articolo_selezionato_filtro_ref.get().codice)) {\n sql += \" and m.articolo like '\" + Db.aa(articolo_selezionato_filtro_ref.get().codice) + \"'\";\n }\n if (filtro_barre.getText().length() > 0) {\n sql += \" and a.codice_a_barre like '%\" + Db.aa(filtro_barre.getText()) + \"%'\";\n }\n if (filtro_lotto.getText().length() > 0) {\n sql += \" and m.lotto like '%\" + Db.aa(filtro_lotto.getText()) + \"%'\";\n }\n if (filtro_matricola.getText().length() > 0) {\n sql += \" and m.matricola like '%\" + Db.aa(filtro_matricola.getText()) + \"%'\";\n }\n if (filtro_fornitore.getText().length() > 0) {\n sql += \" and a.codice_fornitore like '%\" + Db.aa(filtro_fornitore.getText()) + \"%'\";\n }\n if (filtro_deposito.getSelectedIndex() >= 0) {\n sql += \" and m.deposito = \" + cu.s(filtro_deposito.getSelectedKey());\n }\n sql += \" order by m.data desc, id desc\";\n System.out.println(\"sql movimenti: \" + sql);\n griglia.dbOpen(Db.getConn(), sql, Db.INSTANCE, true);\n griglia.dbSelezionaRiga();\n }",
"private Query queryAllCourses() {\n // Test performance de l'update d'user en bdd\n final Trace myTrace2 = FirebasePerformance.getInstance().newTrace(\"coursesSupervisorsActivityAllCoursesQuerys_trace\");\n myTrace2.start();\n\n Query mQuery = setupDb().collection(\"courses\")\n .orderBy(\"horaireDuCours\", Query.Direction.ASCENDING)\n .whereGreaterThanOrEqualTo(\"horaireDuCours\", Calendar.getInstance().getTime());\n mQuery.addSnapshotListener(this, new EventListener<QuerySnapshot>() {\n @Override\n public void onEvent(QuerySnapshot documentSnapshots, FirebaseFirestoreException e) {\n if (documentSnapshots != null && documentSnapshots.size() != 0) {\n Log.e(\"TAG\", \"Le document existe !\");\n // liste des docs\n readDataInList(documentSnapshots.getDocuments());\n\n myTrace2.stop();\n }\n }\n });\n return mQuery;\n }",
"public Query advancedQuery() \n {\n return null;\n }",
"@Test\n\tpublic void testQuery1() {\n\t}",
"private Object query(JSONObject jo, String query) {\r\n try {\r\n String[] keys = query.split(\"\\\\.\");\r\n Object r = queryHelper(jo, keys[0]);\r\n for (int i = 1; i < keys.length; i++) {\r\n r = queryHelper(jo.fromObject(r), keys[i]);\r\n }\r\n return r;\r\n } catch (JSONException e) {\r\n return \"\";\r\n }\r\n }",
"private String getSelectQuery() {\n String query = null;\n try {\n query = crudQueryComposer.composeReadQuery();\n } catch (MissingPropertyException e) {\n logger.error(e);\n }\n return query;\n }",
"public static ru.terralink.mvideo.sap.Orders findByPrimaryKey(java.lang.String IV_FO_TOR_ID\n ,java.lang.String IV_FU_TOR_ID)\n {\n String intervalName = null;\n if(com.sybase.mobile.util.perf.impl.PerformanceAgentServiceImpl.isEnabled)\n {\n intervalName = \"Orders.findByPrimaryKey\";\n com.sybase.mobile.util.perf.impl.PerformanceAgentServiceImpl.getInstance().startInterval(intervalName, com.sybase.mobile.util.perf.impl.PerformanceAgentServiceImpl.PersistenceRead);\n }\n try\n {\n \n \n String _selectSQL = \"SELECT x.\\\"a\\\",x.\\\"b\\\",x.\\\"c\\\",x.\\\"d\\\",x.\\\"e\\\",x.\\\"f\\\",x.\\\"g\\\",x.\\\"h\\\",x.\\\"i\\\",x.\\\"j\\\",x.\\\"l\\\",x.\\\"m\\\",x.\\\"n\\\",x.\\\"o\\\",x.\\\"p\\\",x.\\\"q\\\",x.\\\"r\\\",x.\\\"s\\\",x.\\\"t\\\",x.\\\"u\\\",x.\\\"v\\\",x.\\\"w\\\",x.\\\"x\\\",x.\\\"y\\\",x.\\\"z\\\",x.\\\"ba\\\",x.\\\"bb\\\",x.\\\"bc\\\",x.\\\"bd\\\",x.\\\"be\\\",x.\\\"bf\\\",x.\\\"bg\\\",x.\\\"bh\\\",x.\\\"bi\\\",x.\\\"bj\\\",x.\\\"bl\\\",x.\\\"bm\\\",x.\\\"pending\\\",x.\\\"_pc\\\",x.\\\"_rp\\\",x\"\n + \".\\\"_rf\\\",x.\\\"relationsFK\\\",x.\\\"bn\\\",x.\\\"_rc\\\",x.\\\"_ds\\\",x.\\\"cvpOperation_length\\\",x.\\\"cvpOperationLobs_length\\\" FROM \\\"mvideo5_1_0_orders\\\" x WHERE (((x.\\\"pending\\\" = 1 or not exists (select x_os.\\\"bn\\\" from \\\"mvideo5_1_0_orders_os\\\" x_os where x_os.\\\"bn\\\" = x.\\\"bn\\\")))) and ( x.\\\"bl\\\" = ? AND x.\\\"bm\\\" = ?)\";\n String[] ids = new String[0];\n com.sybase.reflection.DataType[] dts = new com.sybase.reflection.DataType[]{ \n com.sybase.reflection.DataType.forName(\"string\"),\n com.sybase.reflection.DataType.forName(\"string\"),\n };\n Object[] values = new Object[] { \n IV_FO_TOR_ID,\n IV_FU_TOR_ID,\n };\n Object res = DELEGATE.findWithSQL(_selectSQL, dts, values, ids, ru.terralink.mvideo.sap.Orders.class);\n return (ru.terralink.mvideo.sap.Orders)res;\n }\n finally\n {\n if(com.sybase.mobile.util.perf.impl.PerformanceAgentServiceImpl.isEnabled)\n {\n com.sybase.mobile.util.perf.impl.PerformanceAgentServiceImpl.getInstance().stopInterval(intervalName);\n }\n }\n }",
"@Override\n public Collection<KlantBedrijf> select() {\n return null;\n }",
"private FechaCierreXModulo queryData() {\n\t\ttry {\n\n\t\t\tSystem.out.println(\"Los filtros son \"\n\t\t\t\t\t+ this.filterBI.getBean().toString());\n\n\t\t\t// Notification.show(\"Los filtros son \"\n\t\t\t// + this.filterBI.getBean().toString());\n\n\t\t\tFechaCierreXModulo item = mockData(this.filterBI.getBean());\n\n\t\t\treturn item;\n\n\t\t} catch (Exception e) {\n\t\t\tLogAndNotification.print(e);\n\t\t}\n\n\t\treturn new FechaCierreXModulo();\n\t}",
"@Test\n public void testWhere_withValidQuery() {\n String column0 = \"user_id\";\n String column1 = \"age\";\n int idValue0 = 0;\n int ageValue0 = 23;\n int idValue1 = 1;\n int ageValue1 = 22;\n int idValue2 = 2;\n int ageValue2 = 18;\n\n try {\n String sql = \"CREATE TABLE ModelExtension (\" +\n column0 + \" int, \" +\n column1 + \" int)\";\n PreparedStatement pstmt = Setup.getConnection().prepareStatement(sql);\n pstmt.execute();\n sql = \"INSERT INTO ModelExtension (\" +\n column0 + \", \" +\n column1 + \") VALUES (\" +\n idValue0 + \", \" +\n ageValue0 + \"), (\" +\n idValue1 + \", \" +\n ageValue1 + \"), (\" +\n idValue2 + \", \" +\n ageValue2 + \")\";\n pstmt = Setup.getConnection().prepareStatement(sql);\n pstmt.executeUpdate();\n } catch (SQLException e) {\n e.printStackTrace();\n assertTrue(false);\n }\n\n List<ModelExtension> models = child.findAll().where(column1 + \">20\").execute(ModelExtension.class);\n\n assertEquals(2, models.size());\n assertEquals(idValue0, models.get(0).get(column0));\n assertEquals(ageValue0, models.get(0).get(column1));\n assertEquals(idValue1, models.get(1).get(column0));\n assertEquals(ageValue1, models.get(1).get(column1));\n }",
"@SqlQuery(\"SELECT gid, name AS text from sby\")\n List<OptionKecamatanO> option();",
"@Select({\n \"select\",\n \"id_soggetto, codice_fiscale, id_asr, cognome, nome, data_nascita_str, comune_residenza_istat, \",\n \"comune_domicilio_istat, indirizzo_domicilio, telefono_recapito, data_nascita, id_soggetto_fk,\",\n \"asl_residenza, asl_domicilio, email, lat, lng, id_tipo_soggetto, utente_operazione, \",\n \"data_creazione, data_modifica, data_cancellazione, id_medico\",\n \"from soggetto_personale_scolastico\",\n \"where id_soggetto = #{idSoggetto,jdbcType=BIGINT}\"\n })\n @Results({\n @Result(column=\"id_soggetto\", property=\"idSoggetto\", jdbcType=JdbcType.BIGINT, id=true),\n @Result(column=\"codice_fiscale\", property=\"codiceFiscale\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"id_asr\", property=\"idAsr\", jdbcType=JdbcType.BIGINT),\n @Result(column=\"cognome\", property=\"cognome\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"nome\", property=\"nome\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"data_nascita_str\", property=\"dataNascitaStr\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"comune_residenza_istat\", property=\"comuneResidenzaIstat\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"comune_domicilio_istat\", property=\"comuneDomicilioIstat\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"indirizzo_domicilio\", property=\"indirizzoDomicilio\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"telefono_recapito\", property=\"telefonoRecapito\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"data_nascita\", property=\"dataNascita\", jdbcType=JdbcType.DATE),\n @Result(column=\"asl_residenza\", property=\"aslResidenza\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"asl_domicilio\", property=\"aslDomicilio\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"email\", property=\"email\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"lat\", property=\"lat\", jdbcType=JdbcType.NUMERIC),\n @Result(column=\"lng\", property=\"lng\", jdbcType=JdbcType.NUMERIC),\n @Result(column=\"id_tipo_soggetto\", property=\"idTipoSoggetto\", jdbcType=JdbcType.INTEGER),\n @Result(column = \"id_soggetto_fk\", property = \"idSoggettoFk\", jdbcType = JdbcType.BIGINT),\n @Result(column=\"utente_operazione\", property=\"utenteOperazione\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"data_creazione\", property=\"dataCreazione\", jdbcType=JdbcType.TIMESTAMP),\n @Result(column=\"data_modifica\", property=\"dataModifica\", jdbcType=JdbcType.TIMESTAMP),\n @Result(column=\"data_cancellazione\", property=\"dataCancellazione\", jdbcType=JdbcType.TIMESTAMP),\n @Result(column=\"id_medico\", property=\"idMedico\", jdbcType=JdbcType.BIGINT)\n })\n SoggettoPersonaleScolastico selectByPrimaryKey(Long idSoggetto);",
"public void testFindByEstado() {\n// Iterable<Servico> servicos = repo.findByEstado(EstadoEspecificacao.INCOMPLETO, NrMecanografico.valueOf(\"1001\"));\n// servicos.forEach(s -> System.out.println(s.identity()));\n }",
"public List<T> query(QueryObject qo) {\n\t\treturn null;\n\t}",
"Jugador consultarGanador();",
"@Repository\npublic interface IPrestamoRepo extends JpaRepository<Prestamo, Long> {\n\n\t@Query(value = \"select distinct u.zone from prestamo pres join usuario u on pres.usuario=u.id\", nativeQuery = true)\n\tList<String> obtenerZonasPrestamo();\n\n\t@Query(value = \"select count(*) from prestamo pres join usuario u on pres.usuario=u.id where u.zone=?1\", nativeQuery = true)\n\tLong obtenerZonasNum(String zona);\n\n}",
"@Query(\"SELECT * FROM unit WHERE name = :nama AND sync_delete = 1\")\n public List<Unit> cekNamaUnit(String nama);",
"private List<FollowItem> query(String sql)\r\n {\r\n DbManager db=new DbManager();\r\n ResultSet rs=null;\r\n List<FollowItem> list=new ArrayList<FollowItem>();\r\n rs = db.getRs(sql);\r\n try {\r\n while(rs.next())\r\n {\r\n FollowItem followItem = new FollowItem();\r\n followItem.setUserId(rs.getInt(\"UserID\"));\r\n followItem.setListingId(rs.getInt(\"ListingID\"));\r\n \r\n list.add(followItem);\r\n }\r\n } catch (SQLException e) {\r\n // TODO Auto-generated catch block\r\n e.printStackTrace();\r\n } finally{\r\n db.destory();\r\n }\r\n return list;\r\n }",
"@Test\n public void testGetReporteCantComponentesXVisualizaciones() {\n System.out.println(\"getReporteCantComponentesXVisualizaciones\");\n query = mock(Query.class);\n String namedQuery = \"SELECT c.nombre,c.visualizaciones \"\n + \" FROM componente c,peticionSubida p,estado e \"\n + \" WHERE p.componente_idComponente = c.idComponente and p.estado_idestado = e.idestado and e.estado='Aprobado' \"\n + \" ORDER BY c.visualizaciones ASC limit 10\";\n List<Object[]> expected = new ArrayList<>();\n when(this.em.createNamedQuery(namedQuery)).thenReturn(query);\n when(cDao.getReporteCantComponentesXVisualizaciones()).thenReturn(expected);\n List<Object[]> result = cDao.getReporteCantComponentesXVisualizaciones();\n assertThat(result, is(expected));\n }",
"@Test\n public void testFindComponentsLikeNombreAprobados() {\n System.out.println(\"findComponentsLikeNombreAprobados\");\n query = mock(Query.class);\n String namedQuery = \"Componente.findComponentsLikeNombreAprobados\";\n List<Componente> expected = new ArrayList<>();\n when(this.em.createNamedQuery(namedQuery)).thenReturn(query);\n when(cDao.findComponentsLikeNombreAprobados(anyString(), (Componente) any())).thenReturn(expected);\n List<Componente> result = cDao.findComponentsLikeNombreAprobados(anyString(), (Componente) any());\n assertThat(result, is(expected));\n }",
"static DbQuery createValueQuery() {\n DbQuery query = new DbQuery();\n query.order = OrderBy.VALUE;\n return query;\n }",
"public List listaCarneMensalidadesAgrupado(String id_pessoa, String datas) {\n String and = \"\";\n\n if (id_pessoa != null) {\n and = \" AND func_titular_da_pessoa(M.id_beneficiario) IN (\" + id_pessoa + \") \\n \";\n }\n\n// String text\n// = \" -- CarneMensalidadesDao->listaCarneMensalidadesAgrupado(new Pessoa(), new Date()) \\n\\n\"\n// + \" SELECT P.ds_nome AS titular, \\n \"\n// + \" S.matricula, \\n \"\n// + \" S.categoria, \\n \"\n// + \" M.id_pessoa AS id_responsavel, \\n \"\n// + \" sum(nr_valor - nr_desconto_ate_vencimento) AS valor, \\n\"\n// + \" M.dt_vencimento AS vencimento \\n\"\n// + \" FROM fin_movimento AS M \\n\"\n// + \" INNER JOIN pes_pessoa AS P ON P.id = M.id_pessoa \\n\"\n// + \" INNER JOIN pes_pessoa AS B ON B.id = M.id_beneficiario \\n\"\n// + \" LEFT JOIN soc_socios_vw AS S ON S.codsocio = M.id_pessoa \\n\"\n// + \" WHERE is_ativo = true \\n\"\n// + \" AND id_baixa IS NULL \\n\"\n// + \" AND to_char(M.dt_vencimento, 'MM/YYYY') IN (\" + datas + \")\\n\"\n// + \" AND M.id_servicos NOT IN (SELECT id_servicos \\n\"\n// + \" FROM fin_servico_rotina \\n\"\n// + \" WHERE id_rotina = 4 \\n\"\n// + \") \\n\"\n// + and\n// + \" GROUP BY P.ds_nome, \\n\"\n// + \" S.matricula, \\n\"\n// + \" S.categoria, \\n\"\n// + \" M.id_pessoa, \\n\"\n// + \" M.dt_vencimento \\n\"\n// + \" ORDER BY P.ds_nome, \\n\"\n// + \" M.id_pessoa\";\n String queryString = \"\"\n + \"( \\n\"\n + \" -- CarneMensalidadesDao->listaCarneMensalidadesAgrupado(new Pessoa(), new Date()) \\n\"\n + \" \\n\"\n + \" SELECT P.ds_nome AS titular, \\n\"\n + \" S.matricula AS matricula, \\n\"\n + \" S.categoria AS categoria, \\n\"\n + \" M.id_pessoa AS id_responsavel, \\n\"\n + \" sum(nr_valor - nr_desconto_ate_vencimento) AS valor, \\n\"\n + \" M.dt_vencimento AS vencimento, \\n\"\n + \" '' AS servico , \\n\"\n + \" 0 AS quantidade \\n\"\n + \" FROM fin_movimento AS M \\n\"\n + \" INNER JOIN pes_pessoa AS P ON P.id = M.id_pessoa \\n\"\n + \" INNER JOIN pes_pessoa AS B ON B.id = M.id_beneficiario \\n\"\n + \" LEFT JOIN soc_socios_vw AS S ON S.codsocio = M.id_pessoa \\n\"\n + \" WHERE is_ativo = true \\n\"\n + \" AND id_baixa IS NULL \\n\"\n + \" AND to_char(M.dt_vencimento, 'MM/YYYY') IN (\" + datas + \") \\n\"\n + \" AND M.id_servicos NOT IN (SELECT id_servicos \\n\"\n + \" FROM fin_servico_rotina \\n\"\n + \" WHERE id_rotina = 4 \\n\"\n + \") \\n\"\n + and\n + \" GROUP BY P.ds_nome, \\n\"\n + \" S.matricula, \\n\"\n + \" S.categoria, \\n\"\n + \" M.id_pessoa, \\n\"\n + \" M.dt_vencimento \\n\"\n + \") \\n\"\n + \" \\n\"\n + \" \\n\"\n + \"UNION \\n\"\n + \" \\n\"\n + \" \\n\"\n + \" \\n\"\n + \"( \\n\"\n + \" SELECT P.ds_nome AS titular, \\n\"\n + \" S.matricula AS matricula, \\n\"\n + \" S.categoria AS categoria, \\n\"\n + \" M.id_pessoa AS id_responsavel, \\n\"\n + \" sum(nr_valor - nr_desconto_ate_vencimento) AS valor,\\n\"\n + \" '01/01/1900' AS vencimento, \\n\"\n + \" SE.ds_descricao AS servico, \\n\"\n + \" count(*) AS quantidade \\n\"\n + \" FROM fin_movimento AS M \\n\"\n + \" INNER JOIN fin_servicos AS SE ON SE.id = M.id_servicos \\n\"\n + \" INNER JOIN pes_pessoa AS P ON P.id = M.id_pessoa \\n\"\n + \" INNER JOIN pes_pessoa AS B ON B.id = M.id_beneficiario \\n\"\n + \" LEFT JOIN soc_socios_vw AS S ON S.codsocio = M.id_pessoa \\n\"\n + \" WHERE is_ativo = true \\n\"\n + \" AND id_baixa IS NULL \\n\"\n + \" AND to_char(M.dt_vencimento, 'MM/YYYY') IN (\" + datas + \")\\n\"\n + \" AND M.id_servicos NOT IN (SELECT id_servicos \\n\"\n + \" FROM fin_servico_rotina \\n\"\n + \" WHERE id_rotina = 4 \\n\"\n + \") \\n\"\n + and\n + \" GROUP BY P.ds_nome, \\n\"\n + \" S.matricula, \\n\"\n + \" S.categoria, \\n\"\n + \" M.id_pessoa, \\n\"\n + \" SE.ds_descricao\\n\"\n + \") \\n\"\n + \" ORDER BY 1,4,6\";\n try {\n Query query = getEntityManager().createNativeQuery(queryString);\n return query.getResultList();\n } catch (Exception e) {\n e.getMessage();\n }\n return new ArrayList();\n }",
"static ResultSet dataOphalen(String querry) {\n //declaratie anders kan er niks worden gereturnt\n ResultSet rs = null;\n try {\n Statement stmt = connectieMaken().createStatement(); //\n rs = stmt.executeQuery(querry);\n } catch (SQLException se) {\n se.printStackTrace();\n }\n return rs;\n }",
"private StringBuilder getSqlSelectContadorDocProrroga() {\n StringBuilder query = new StringBuilder();\n\n query.append(\" \");\n query.append(\" SELECT \\n\");\n query.append(\" PRO.ID_PRORROGA_ORDEN, \\n\");\n query.append(\" PRO.ID_ORDEN, \\n\");\n query.append(\" PRO.FECHA_CARGA, \\n\");\n query.append(\" PRO.RUTA_ACUSE,\\n\");\n query.append(\" PRO.CADENA_CONTRIBUYENTE, \\n\");\n query.append(\" PRO.FIRMA_CONTRIBUYENTE, \\n\");\n query.append(\" PRO.APROBADA, \\n\");\n query.append(\" PRO.ID_ASOCIADO_CARGA, \\n\");\n query.append(\" PRO.ID_AUDITOR, \\n\");\n query.append(\" PRO.ID_FIRMANTE, \\n\");\n query.append(\" PRO.RUTA_RESOLUCION, \\n\");\n query.append(\" PRO.CADENA_FIRMANTE, \\n\");\n query.append(\" PRO.FIRMA_FIRMANTE,\\n\");\n query.append(\" PRO.FECHA_FIRMA, \\n\");\n query.append(\" PRO.ID_ESTATUS, \\n\");\n query.append(\" PRO.FOLIO_NYV, \\n\");\n query.append(\" PRO.FECHA_NOTIF_NYV, \\n\");\n query.append(\" PRO.FECHA_NOTIF_CONT, \\n\");\n query.append(\" PRO.FECHA_SURTE_EFECTOS, \\n\");\n query.append(\" PRO.ID_NYV, \\n\");\n query.append(\" (SELECT COUNT(0) FROM \");\n query.append(FecetDocProrrogaOrdenDaoImpl.getTableName());\n query.append(\" DOCPRO WHERE PRO.ID_PRORROGA_ORDEN = DOCPRO.ID_PRORROGA_ORDEN) TOTAL_DOC_PRORROGA, \\n\");\n query.append(\" ASOCIADO.ID_ASOCIADO, \\n\");\n query.append(\" ASOCIADO.RFC_CONTRIBUYENTE, \\n\");\n query.append(\" ASOCIADO.RFC, \\n\");\n query.append(\" ASOCIADO.ID_ORDEN, \\n\");\n query.append(\" ASOCIADO.ID_TIPO_ASOCIADO, \\n\");\n query.append(\" ASOCIADO.NOMBRE, \\n\");\n query.append(\" ASOCIADO.CORREO, \\n\");\n query.append(\" ASOCIADO.TIPO_ASOCIADO, \\n\");\n query.append(\" ASOCIADO.FECHA_BAJA, \\n\");\n query.append(\" ASOCIADO.FECHA_ULTIMA_MOD, \\n\");\n query.append(\" ASOCIADO.FECHA_ULTIMA_MOD_IDC, \\n\");\n query.append(\" ASOCIADO.MEDIO_CONTACTO, \\n\");\n query.append(\" ASOCIADO.ESTATUS, \\n\");\n query.append(\" ESTATUS.ID_ESTATUS, \\n\");\n query.append(\" ESTATUS.DESCRIPCION, \\n\");\n query.append(\" ESTATUS.MODULO, \\n\");\n query.append(\" ESTATUS.ID_MODULO \\n\");\n\n query.append(\"FROM \");\n query.append(getTableName());\n query.append(\" PRO \\n\");\n query.append(\" INNER JOIN FECEC_ESTATUS ESTATUS \\n\");\n query.append(\" ON PRO.ID_ESTATUS = ESTATUS.ID_ESTATUS \\n\");\n query.append(\" LEFT JOIN FECET_ASOCIADO ASOCIADO \\n\");\n query.append(\" ON PRO.ID_ASOCIADO_CARGA = ASOCIADO.ID_ASOCIADO \\n\");\n return query;\n }",
"@Test\n public void testFindComponentsLikeNombre() {\n System.out.println(\"findComponentsLikeNombre\");\n query = mock(Query.class);\n String namedQuery = \"Componente.findComponentsLikeNombre\";\n List<Componente> expected = new ArrayList<>();\n when(this.em.createNamedQuery(namedQuery)).thenReturn(query);\n when(cDao.findComponentsLikeNombre(anyString(), (Usuario) any())).thenReturn(expected);\n List<Componente> result = cDao.findComponentsLikeNombre(anyString(), (Usuario) any());\n assertThat(result, is(expected));\n }",
"public void customerQuery(){\n }",
"String query();",
"@Test\n public void queryTest() {\n // TODO: test query\n }",
"public static String todosLosEmpleados(){\n String query=\"SELECT empleado.idEmpleado, persona.nombre, persona.apePaterno, persona.apeMaterno, empleado.codigo, empleado.fechaIngreso,persona.codigoPostal,persona.domicilio,\" +\n\"empleado.puesto, empleado.salario from persona inner join empleado on persona.idPersona=empleado.idPersona where activo=1;\";\n return query;\n }",
"public java.util.List<String> dinoConflictivo(){\n java.util.List<String> resultado = new java.util.ArrayList<String>();\n Connection con;\n PreparedStatement stmDinos=null;\n ResultSet rsDinos;\n con=this.getConexion();\n try {\n stmDinos = con.prepareStatement(\"select d.nombre \" +\n \"from incidencias i, dinosaurios d where responsable = d.id \" +\n \"group by responsable, d.nombre \" +\n \"having count(*) >= \" +\n \"(select count(*) as c \" +\n \" from incidencias group by responsable order by c desc limit 1)\");\n rsDinos = stmDinos.executeQuery();\n while (rsDinos.next()){resultado.add(rsDinos.getString(\"nombre\"));}\n } catch (SQLException e){\n System.out.println(e.getMessage());\n this.getFachadaAplicacion().muestraExcepcion(e.getMessage());\n }finally{\n try {stmDinos.close();} catch (SQLException e){System.out.println(\"Imposible cerrar cursores\");}\n }\n return resultado;\n }",
"public Query() {\n\n// oriToRwt = new HashMap();\n// oriToRwt.put(); // TODO\n }",
"@Query(\"select p from Pedido p where p.desc =?1\")\n public Pedido buscarPedidoPorDescricao(String desc);",
"public Page page(Page page, String hql,Object[] objWhere){\r\n if(hql==null || \"\".equals(hql))\r\n {\r\n hql = \" from SearchMessageDTO Z\";\r\n }\r\n return searchMessageDAO.findPage(page, hql, objWhere);\r\n}",
"private void getScholsFromDatabase() {\n schols = new Select().all().from(Scholarship.class).execute();\n }",
"@Override\n\tpublic List<Item> findItemListByQuery() {\n\t\tCriteriaBuilder cb=entityManager.getCriteriaBuilder();\n\t//\tCriteriaQuery<Item> query = cb.createQuery(Item.class); \n // Root<Item> item = query.from(Item.class);\n TypedQuery<Item> iquery=entityManager.createQuery(\"select i from Item i\", Item.class);\n\t\treturn iquery.getResultList();\n\t\t\n\t}",
"@Override\r\npublic List<Possalesdetail> selectByExample(PossalesdetailExample example) {\n\treturn possalesdetail.selectByExample(example);\r\n}",
"public void testUsingQueriesFromQueryManger(){\n\t\tSet<String> names = testDataMap.keySet();\n\t\tUtils.prtObMess(this.getClass(), \"atm query\");\n\t\tDseInputQuery<BigDecimal> atmq = \n\t\t\t\tqm.getQuery(new AtmDiot());\n\t\tMap<String, ComplexQueryResult<BigDecimal>> bdResult = \n\t\t\t\tatmq.get(names, 1, TimeUnit.SECONDS);\n\t\tCollectionsStaticMethods.prtMapItems(bdResult);\n\n\t\tUtils.prtObMess(this.getClass(), \"vol query\");\n\t\tDseInputQuery<BigDecimal> volq = \n\t\t\t\tqm.getQuery(new VolDiotForTest());\n\t\tMap<String, ComplexQueryResult<BigDecimal>> dbResult = \n\t\t\t\tvolq.get(names, 1, TimeUnit.SECONDS);\n\t\tCollectionsStaticMethods.prtMapItems(dbResult);\n\t\n\t\tUtils.prtObMess(this.getClass(), \"integer query\");\n\t\tDseInputQuery<BigDecimal> strikeq = \n\t\t\t\tqm.getQuery(new StrikeDiotForTest());\n\t\tMap<String, ComplexQueryResult<BigDecimal>> strikeResult = \n\t\t\t\tstrikeq.get(names, 1, TimeUnit.SECONDS);\n\t\tCollectionsStaticMethods.prtMapItems(strikeResult);\n\t\n\t}",
"@Override\n public Criteria getCriteria() {\n //region your codes 2\n return null;\n //endregion your codes 2\n }",
"@Test\n public void queryUserList() {\n\n User user = new User();\n user.setName(\"lin\");\n\n List<User> users = userDao.queryUserList(user, 0, 5);\n assertEquals(1, users.size());\n\n }",
"String getBarcharDataQuery();",
"public static String todosLosEmpleados_baja(){\n String query=\"SELECT empleado.idEmpleado, persona.nombre, persona.apePaterno, persona.apeMaterno, empleado.codigo, empleado.fechaIngreso,persona.codigoPostal,persona.domicilio,\" +\n\"empleado.puesto, empleado.salario from persona inner join empleado on persona.idPersona=empleado.idPersona where activo=0;\";\n return query;\n }",
"boolean hasQuery();",
"@Repository\npublic interface LongueurRepository extends CrudRepository<Longueur, Long>, QuerydslPredicateExecutor<Longueur> {\n @Query(value = \"SELECT id FROM longueur WHERE voie_id = ?1\", nativeQuery = true)\n List<Long> findAllByVoieId(Long voieId);\n}",
"@Test\n public void twoColumns_and_projection() {\n for (Tuple row : query().from(Constants.survey).select(Constants.survey.id, Constants.survey.name, new QIdName(Constants.survey.id, Constants.survey.name)).fetch()) {\n Assert.assertEquals(3, row.size());\n Assert.assertEquals(Integer.class, row.get(0, Object.class).getClass());\n Assert.assertEquals(String.class, row.get(1, Object.class).getClass());\n Assert.assertEquals(IdName.class, row.get(2, Object.class).getClass());\n }\n }",
"public Collection cargarDeObjetivo(int codigoCiclo, int codigoPlan, int objetivo, int periodo, String estado) {\n/* 121 */ Collection resultados = new ArrayList();\n/* */ try {\n/* 123 */ String s = \"select m.Codigo_Ciclo, m.Codigo_Plan, m.Codigo_Meta, m.Codigo_Objetivo, m.Descripcion, m.Valor_Meta, m.Tipo_Medicion, m.Frecuencia_Medicion, m.Justificacion, m.Estado, m.Fecha_Insercion, m.Usuario_Insercion, m.Fecha_Modificacion, m.Usuario_Modificacion, m.Mes01, m.Mes02, m.Mes03, m.Mes04, m.Mes05, m.Mes06, m.Mes07, m.Mes08, m.Mes09, m.Mes10, m.Mes11, m.Mes12, m.Fuente_Dato, m.Aplica_En, m.Unidad_Medida, m.Valor_Minimo, m.Valor_Maximo, m.Tipo_Grafica, Tm.Descripcion as Nombretipomedicion, Est.Descripcion as Nombreestado, Um.Descripcion as Nombre_Unidad_Medida, SUM(CASE WHEN ac.NUMERO IS NOT NULL THEN 1 ELSE 0 END) acciones from Cal_Plan_Metas m left join Am_Acciones Ac on( m.Codigo_Ciclo = Ac.Codigo_Ciclo and m.Codigo_Plan = Ac.Codigo_Plan and m.Codigo_Meta = Ac.Codigo_Meta and Ac.Asociado = 'P'), \\t\\t Sis_Multivalores Tm, \\t\\t Sis_Multivalores Est, \\t\\t Sis_Multivalores Um where m.Tipo_Medicion = Tm.Valor and Tm.Tabla = 'CAL_TIPO_MEDICION' and m.Estado = Est.Valor and Est.Tabla = 'CAL_ESTADO_META' and m.Unidad_Medida = Um.Valor and Um.Tabla = 'CAL_UNIDAD_MEDIDA_META' and m.codigo_ciclo=\" + codigoCiclo + \" and m.codigo_plan=\" + codigoPlan + \" and m.codigo_objetivo=\" + objetivo;\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 180 */ if (estado.length() > 0) {\n/* 181 */ s = s + \" and m.estado='A'\";\n/* */ }\n/* */ \n/* 184 */ if (periodo == 1) {\n/* 185 */ s = s + \" and m.mes01='S'\";\n/* */ }\n/* 187 */ else if (periodo == 2) {\n/* 188 */ s = s + \" and m.mes02='S'\";\n/* */ }\n/* 190 */ else if (periodo == 3) {\n/* 191 */ s = s + \" and m.mes03='S'\";\n/* */ }\n/* 193 */ else if (periodo == 4) {\n/* 194 */ s = s + \" and m.mes04='S'\";\n/* */ }\n/* 196 */ else if (periodo == 5) {\n/* 197 */ s = s + \" and m.mes05='S'\";\n/* */ }\n/* 199 */ else if (periodo == 6) {\n/* 200 */ s = s + \" and m.mes06='S'\";\n/* */ }\n/* 202 */ else if (periodo == 7) {\n/* 203 */ s = s + \" and m.mes07='S'\";\n/* */ }\n/* 205 */ else if (periodo == 8) {\n/* 206 */ s = s + \" and m.mes08='S'\";\n/* */ }\n/* 208 */ else if (periodo == 9) {\n/* 209 */ s = s + \" and m.mes09='S'\";\n/* */ }\n/* 211 */ else if (periodo == 10) {\n/* 212 */ s = s + \" and m.mes10='S'\";\n/* */ }\n/* 214 */ else if (periodo == 11) {\n/* 215 */ s = s + \" and m.mes11='S'\";\n/* */ }\n/* 217 */ else if (periodo == 12) {\n/* 218 */ s = s + \" and m.mes12='S'\";\n/* */ } \n/* */ \n/* 221 */ s = s + \" GROUP BY m.Codigo_Ciclo, m.Codigo_Plan, m.Codigo_Meta, m.Codigo_Objetivo, m.Descripcion, m.Valor_Meta, m.Tipo_Medicion, m.Frecuencia_Medicion, m.Justificacion, m.Estado, m.Fecha_Insercion, m.Usuario_Insercion, m.Fecha_Modificacion, m.Usuario_Modificacion, m.Mes01, m.Mes02, m.Mes03, m.Mes04, m.Mes05, m.Mes06, m.Mes07, m.Mes08, m.Mes09, m.Mes10, m.Mes11, m.Mes12, m.Fuente_Dato, m.Aplica_En, m.Unidad_Medida, m.Valor_Minimo, m.Valor_Maximo, m.Tipo_Grafica, Tm.Descripcion, Est.Descripcion, Um.Descripcion order by m.descripcion\";\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 259 */ boolean rtaDB = this.dat.parseSql(s);\n/* 260 */ if (!rtaDB) {\n/* 261 */ return resultados;\n/* */ }\n/* */ \n/* 264 */ this.rs = this.dat.getResultSet();\n/* 265 */ while (this.rs.next()) {\n/* 266 */ resultados.add(leerRegistro());\n/* */ }\n/* */ }\n/* 269 */ catch (Exception e) {\n/* 270 */ e.printStackTrace();\n/* 271 */ Utilidades.writeError(\"CalPlanMetasFactory:cargarTodos \", e);\n/* */ } \n/* 273 */ return resultados;\n/* */ }",
"@Override\n\tpublic String getQueryDeExiste(Onibus entidade) {\n\t\treturn null;\n\t}",
"public List<Object> queryByWhere(String col_name, String dto, List<List<Triple>> filter, List<String> keys) {\n\t\tList<Object> res = new ArrayList<Object>();\n\t\tDBCollection dbc = db.getCollection(col_name);\n\t\t// filter\n\t\tBasicDBObject all_ref = new BasicDBObject();\n\t\tDBObject _keys = new BasicDBObject();\n\t\t\n\t\tif(keys != null)\n\t\t\tfor(String key : keys) \n\t\t\t\t_keys.put(key, true);\n\t\t\n\t\tBasicDBList list = new BasicDBList();\n\t\tfor(List<Triple> and : filter) {\n\t\t\tBasicDBObject ref = new BasicDBObject();\n\t\t\tfor(Triple tri : and) {\n\t\t\t\tif(!ref.containsField(tri.key_name)) {\n\t\t\t\t\tif(tri.condition.equals(Condition.EQUAL)) \n\t\t\t\t\t\tref.put(tri.key_name, tri.value);\n\t\t\t\t\t\n\t\t\t\t\telse \n\t\t\t\t\t\tref.put(tri.key_name, new BasicDBObject(tri.condition, tri.value));\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif(tri.condition.equals(Condition.EQUAL)) {\n\t\t\t\t\t\t// TODO It is impossible\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tBasicDBObject bo = (BasicDBObject)ref.get(tri.key_name);\n\t\t\t\t\t\tbo.append(tri.condition, tri.value);\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} // end an \"and\" query\n\t\t\tlist.add(ref);\n\t\t}\n\t\t\n\t\tall_ref.put(\"$or\", list);\n\t\t\n\t\ttry {\n\t DBCursor cur = dbc.find(all_ref, _keys);\n\t \twhile (cur.hasNext()) {\n\t \t\tDBObject doc = cur.next();\n\t \t\ttry {\n\t \t\t\tres.add(Util.deserialize(doc, dto));\n\t \t\t} catch(InvocationTargetException ite) {\n\t \t\t\tite.printStackTrace();\n\t \t\t} \t\t\n\t \t\t//System.out.println(doc);\n\t }\n\n\t\t} catch(ClassNotFoundException cnfe) {\n \tcnfe.printStackTrace();\n } catch(InstantiationException ie) {\n \tie.printStackTrace();\n } catch(IllegalAccessException iae) {\n \tiae.printStackTrace();\n }\n\n \treturn res;\n\t}",
"CampusSearchQuery generateQuery();",
"public Collection<FlujoDetalleDTO> cargarTodos(int codigoFlujo) {\n/* 138 */ Collection<FlujoDetalleDTO> resultados = new ArrayList<FlujoDetalleDTO>();\n/* */ try {\n/* 140 */ String s = \"select t.codigo_flujo,t.secuencia,t.servicio_inicio,r1.descripcion as nombre_servicio_inicio,t.accion,t.codigo_estado,r3.descripcion as nombre_codigo_estado,t.servicio_destino,r4.descripcion as nombre_servicio_destino,t.nombre_procedimiento,t.correo_destino,t.enviar_solicitud,t.ind_mismo_proveedor,t.ind_mismo_cliente,t.estado,t.caracteristica,t.valor_caracteristica,t.caracteristica_correo,m5.descripcion as nombre_estado,c.DESCRIPCION nombre_caracteristica,cv.DESCRIPCION descripcion_valor,t.metodo_seleccion_proveedor,t.ind_correo_clientes,t.usuario_insercion,t.fecha_insercion,t.usuario_modificacion,t.fecha_modificacion from wkf_detalle t left join SERVICIOS r1 on (r1.CODIGO=t.servicio_inicio) left join ESTADOS r3 on (r3.codigo=t.codigo_estado) left join SERVICIOS r4 on (r4.CODIGO=t.servicio_destino) left join sis_multivalores m5 on (m5.tabla='ESTADO_REGISTRO' and m5.valor=t.estado) LEFT JOIN CARACTERISTICAS c ON (t.Caracteristica = c.CODIGO) LEFT JOIN CARACTERISTICAS_VALOR cv ON (t.CARACTERISTICA=cv.CARACTERISTICA AND t.VALOR_CARACTERISTICA = cv.VALOR) where t.codigo_flujo=\" + codigoFlujo + \" order by t.secuencia\";\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 178 */ boolean rtaDB = this.dat.parseSql(s);\n/* 179 */ if (!rtaDB) {\n/* 180 */ return resultados;\n/* */ }\n/* 182 */ this.rs = this.dat.getResultSet();\n/* 183 */ while (this.rs.next()) {\n/* 184 */ resultados.add(leerRegistro());\n/* */ }\n/* */ }\n/* 187 */ catch (Exception e) {\n/* 188 */ e.printStackTrace();\n/* 189 */ Utilidades.writeError(\"FlujoDetalleDAO:cargarTodos \", e);\n/* */ } \n/* 191 */ return resultados;\n/* */ }",
"@Override\n\tprotected Cursor query()\n\t{\n\t\treturn null;\n\t}",
"public void testProductInstanceAttributeQuery() {\n\n String\tsql\t= \"SELECT p.M_Product_ID, p.Discontinued, p.Value, p.Name, BOM_Qty_Available(p.M_Product_ID,?) AS QtyAvailable, bomQtyList(p.M_Product_ID, pr.M_PriceList_Version_ID) AS PriceList, bomQtyStd(p.M_Product_ID, pr.M_PriceList_Version_ID) AS PriceStd, BOM_Qty_OnHand(p.M_Product_ID,?) AS QtyOnHand, BOM_Qty_Reserved(p.M_Product_ID,?) AS QtyReserved, BOM_Qty_Ordered(p.M_Product_ID,?) AS QtyOrdered, bomQtyStd(p.M_Product_ID, pr.M_PriceList_Version_ID)-bomQtyLimit(p.M_Product_ID, pr.M_PriceList_Version_ID) AS Margin, bomQtyLimit(p.M_Product_ID, pr.M_PriceList_Version_ID) AS PriceLimit, pa.IsInstanceAttribute FROM M_Product p INNER JOIN M_ProductPrice pr ON (p.M_Product_ID=pr.M_Product_ID) LEFT OUTER JOIN M_AttributeSet pa ON (p.M_AttributeSet_ID=pa.M_AttributeSet_ID) WHERE p.IsSummary='N' AND p.IsActive='Y' AND pr.IsActive='Y' AND pr.M_PriceList_Version_ID=? AND EXISTS (SELECT * FROM M_Storage s INNER JOIN M_AttributeSetInstance asi ON (s.M_AttributeSetInstance_ID=asi.M_AttributeSetInstance_ID) WHERE s.M_Product_ID=p.M_Product_ID AND asi.SerNo LIKE '33' AND asi.Lot LIKE '33' AND asi.M_Lot_ID=101 AND TRUNC(asi.GuaranteeDate)<TO_DATE('2003-10-16','YYYY-MM-DD') AND asi.M_AttributeSetInstance_ID IN (SELECT M_AttributeSetInstance_ID FROM M_AttributeInstance WHERE (M_Attribute_ID=103 AND Value LIKE '33') AND (M_Attribute_ID=102 AND M_AttributeValue_ID=106))) AND p.M_AttributeSetInstance_ID IN (SELECT M_AttributeSetInstance_ID FROM M_AttributeInstance WHERE (M_Attribute_ID=101 AND M_AttributeValue_ID=105) AND (M_Attribute_ID=100 AND M_AttributeValue_ID=102)) AND p.AD_Client_ID IN(0,11) AND p.AD_Org_ID IN(0,11,12) ORDER BY QtyAvailable DESC, Margin DESC\";\n AccessSqlParser\tfixture\t= new AccessSqlParser(sql);\n\n assertEquals(\"AccessSqlParser[M_AttributeInstance|M_Storage=s,M_AttributeSetInstance=asi|M_AttributeInstance|M_Product=p,M_ProductPrice=pr,M_AttributeSet=pa|3]\", fixture.toString());\n }",
"@Test\n public void testQueryMore4() throws Exception {\n testQueryMore(true, false);\n }",
"List<Basicinfo> selectByExample(BasicinfoCriteria example);",
"@Test\n public void testGetComponentesByNombreYDescripcion() {\n System.out.println(\"getComponentesByNombreYDescripcion\");\n query = mock(Query.class);\n String nativeQuery = \"Componente.findByString\";\n List<Componente> expected = new ArrayList<>();\n when(this.em.createNativeQuery(nativeQuery)).thenReturn(query);\n when(cDao.getComponentesByNombreYDescripcion(Matchers.anyString(), anyInt())).thenReturn(expected);\n List<Componente> result = cDao.getComponentesByNombreYDescripcion(Matchers.anyString(), anyInt());\n assertThat(result, is(expected));\n }",
"private ArrayList<WordDocument> executeAdvancedQuery(){\n ArrayList<WordDocument> documents = customDijkstrasTwoStack(this.query.split(\" \"));\n ArrayList<WordDocument> result = new ArrayList<WordDocument>();\n\n try{\n String[] orderByPart = query.substring(query.indexOf(\"ORDERBY\")).trim().toLowerCase().split(\" \");\n if(isOrderByCommand(orderByPart[0]))\n result = orderBy(documents, orderByPart[1], orderByPart[2]);\n }catch (StringIndexOutOfBoundsException ex){\n result = documents;\n }\n\n return result;\n }",
"@Query(\"SELECT * FROM \"+Usuario.TABLE_NAME+\" WHERE nombre_usuario\" +\" = :nombre_u\")\n Usuario getUsuarioNombreUsuario(String nombre_u);",
"List<Movimiento> selectByExample(MovimientoExample example);",
"public Collection cargarMasivo(int codigoCiclo, String proceso, String subproceso, int periodo) {\n/* 287 */ Collection resultados = new ArrayList();\n/* */ try {\n/* 289 */ String s = \"select m.Codigo_Ciclo, m.Codigo_Plan, m.Codigo_Meta, m.Codigo_Objetivo, u.Descripcion Nombre_Area, Um.Descripcion as Nombre_Unidad_Medida, to_char(m.Codigo_Objetivo,'9999999999') ||' - ' || o.Descripcion Nombre_Objetivo, to_char(m.Codigo_Meta,'9999999999') ||' - ' || m.Descripcion Nombre_Meta, m.Unidad_Medida, m.Valor_Minimo, m.Valor_Maximo, l.Valor_Logro, case when l.Valor_Logro is not null then 'A' else 'N' end Existe from Cal_Planes p, Cal_Plan_Objetivos o, Cal_Plan_Metas m left join Cal_Logros l on( m.Codigo_Ciclo = l.Codigo_Ciclo and m.Codigo_Plan = l.Codigo_Plan and m.Codigo_Meta = l.Codigo_Meta and m.Codigo_Objetivo = l.Codigo_Objetivo and \" + periodo + \" = l.Periodo),\" + \" Unidades_Dependencia u,\" + \" Sis_Multivalores Um\" + \" where p.Ciclo = o.Codigo_Ciclo\" + \" and p.Codigo_Plan = o.Codigo_Plan\" + \" and o.Codigo_Ciclo = m.Codigo_Ciclo\" + \" and o.Codigo_Plan = m.Codigo_Plan\" + \" and o.Codigo_Objetivo = m.Codigo_Objetivo\" + \" and p.Codigo_Area = u.Codigo\" + \" and m.Unidad_Medida = Um.Valor\" + \" and Um.Tabla = 'CAL_UNIDAD_MEDIDA_META'\" + \" and o.Proceso = '\" + proceso + \"'\" + \" and o.Subproceso = '\" + subproceso + \"'\" + \" and p.Ciclo = \" + codigoCiclo + \" and m.Estado = 'A'\" + \" and o.Estado = 'A'\" + \" and o.Tipo_Objetivo in ('G', 'M')\";\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 333 */ if (periodo == 1) {\n/* 334 */ s = s + \" and m.mes01='S'\";\n/* */ }\n/* 336 */ else if (periodo == 2) {\n/* 337 */ s = s + \" and m.mes02='S'\";\n/* */ }\n/* 339 */ else if (periodo == 3) {\n/* 340 */ s = s + \" and m.mes03='S'\";\n/* */ }\n/* 342 */ else if (periodo == 4) {\n/* 343 */ s = s + \" and m.mes04='S'\";\n/* */ }\n/* 345 */ else if (periodo == 5) {\n/* 346 */ s = s + \" and m.mes05='S'\";\n/* */ }\n/* 348 */ else if (periodo == 6) {\n/* 349 */ s = s + \" and m.mes06='S'\";\n/* */ }\n/* 351 */ else if (periodo == 7) {\n/* 352 */ s = s + \" and m.mes07='S'\";\n/* */ }\n/* 354 */ else if (periodo == 8) {\n/* 355 */ s = s + \" and m.mes08='S'\";\n/* */ }\n/* 357 */ else if (periodo == 9) {\n/* 358 */ s = s + \" and m.mes09='S'\";\n/* */ }\n/* 360 */ else if (periodo == 10) {\n/* 361 */ s = s + \" and m.mes10='S'\";\n/* */ }\n/* 363 */ else if (periodo == 11) {\n/* 364 */ s = s + \" and m.mes11='S'\";\n/* */ }\n/* 366 */ else if (periodo == 12) {\n/* 367 */ s = s + \" and m.mes12='S'\";\n/* */ } \n/* */ \n/* 370 */ s = s + \" order by m.Codigo_Ciclo, m.Codigo_Objetivo, m.Codigo_Meta, u.Descripcion\";\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 377 */ boolean rtaDB = this.dat.parseSql(s);\n/* 378 */ if (!rtaDB) {\n/* 379 */ return resultados;\n/* */ }\n/* */ \n/* 382 */ this.rs = this.dat.getResultSet();\n/* 383 */ while (this.rs.next()) {\n/* 384 */ CalMetasDTO reg = new CalMetasDTO();\n/* 385 */ reg.setCodigoCiclo(codigoCiclo);\n/* 386 */ reg.setCodigoPlan(this.rs.getInt(\"codigo_plan\"));\n/* 387 */ reg.setCodigoMeta(this.rs.getInt(\"codigo_meta\"));\n/* 388 */ reg.setCodigoObjetivo(this.rs.getInt(\"codigo_objetivo\"));\n/* 389 */ reg.setNombreArea(this.rs.getString(\"Nombre_Area\"));\n/* 390 */ reg.setNombreMeta(this.rs.getString(\"Nombre_meta\"));\n/* 391 */ reg.setNombreObjetivo(this.rs.getString(\"Nombre_Objetivo\"));\n/* 392 */ reg.setUnidadMedida(this.rs.getString(\"unidad_medida\"));\n/* 393 */ reg.setValorMinimo(this.rs.getDouble(\"valor_minimo\"));\n/* 394 */ reg.setValorMaximo(this.rs.getDouble(\"valor_maximo\"));\n/* 395 */ reg.setValorLogro(this.rs.getDouble(\"Valor_Logro\"));\n/* 396 */ reg.setNombreUnidadMedida(this.rs.getString(\"nombre_unidad_medida\"));\n/* 397 */ reg.setEstado(this.rs.getString(\"existe\"));\n/* 398 */ resultados.add(reg);\n/* */ }\n/* */ \n/* 401 */ } catch (Exception e) {\n/* 402 */ e.printStackTrace();\n/* 403 */ Utilidades.writeError(\"CalPlanMetasFactory:cargarTodos \", e);\n/* */ } \n/* 405 */ return resultados;\n/* */ }",
"private String armarWhere(DTOBusquedaRapidaCliente dto) {\n UtilidadesLog.info(\" DAOMAEMaestroClientes.armarWhere(DTOBusquedaRapidaCliente): Entrada\");\n StringBuffer query = new StringBuffer();\n String[] camposWhere = new String[] {\n \"c.PAIS_OID_PAIS\", \"c.COD_CLIE\", \"c.VAL_CRIT_BUS1\",\n \"c.VAL_CRIT_BUS2\", \"i.NUM_DOCU_IDEN\"\n };\n\n Object[] valoresWhere = new Object[] {\n dto.getOidPais(), dto.getCodigoCliente(), dto.getCriterioBusqueda1(),\n dto.getCriterioBusqueda2(), dto.getDocumentoIdentidad()\n };\n\n boolean[] operadores = new boolean[] { false, false, false, false, false };\n UtilidadesLog.info(\" DAOMAEMaestroClientes.armarWhere(DTOBusquedaRapidaCliente): Salida\"); \n return UtilidadesBD.armarSQLWhere(camposWhere, valoresWhere, operadores);\n }",
"List<NjProductTaticsRelation> selectByExample(NjProductTaticsRelationExample example);",
"IQuery getQuery();",
"protected String createFindBy(String nume) {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"SELECT \");\n\t\tsb.append(\" * \");\n\t\tsb.append(\" FROM \");\n\t\tsb.append(type.getSimpleName());\n\t\tsb.append(\" WHERE \");\n\t\treturn sb.toString();\n\t}"
] | [
"0.6110861",
"0.5901131",
"0.5768644",
"0.5706819",
"0.56891173",
"0.56691283",
"0.56579715",
"0.5572155",
"0.5567278",
"0.5542833",
"0.5510534",
"0.54471296",
"0.5428283",
"0.54253703",
"0.54212725",
"0.5415825",
"0.5408793",
"0.5407665",
"0.5405594",
"0.53999203",
"0.5393685",
"0.5385636",
"0.536711",
"0.53655875",
"0.5362889",
"0.5356888",
"0.5340051",
"0.53388685",
"0.5337788",
"0.5333073",
"0.5330158",
"0.53232336",
"0.53205884",
"0.5320149",
"0.5308419",
"0.5303122",
"0.52977556",
"0.5296041",
"0.5284577",
"0.52830714",
"0.52825564",
"0.5282326",
"0.5279936",
"0.52789843",
"0.5274947",
"0.52722347",
"0.526869",
"0.5263973",
"0.52589744",
"0.52564645",
"0.5250429",
"0.52451396",
"0.5237194",
"0.52363914",
"0.52320474",
"0.5229777",
"0.5224429",
"0.5220895",
"0.521829",
"0.5218124",
"0.5217528",
"0.5216658",
"0.52133673",
"0.5213251",
"0.5212817",
"0.52074444",
"0.5203203",
"0.5202233",
"0.5194404",
"0.5187769",
"0.5187095",
"0.5182356",
"0.5172839",
"0.51712704",
"0.5168637",
"0.51665556",
"0.5165357",
"0.5162541",
"0.51624",
"0.51613235",
"0.5159858",
"0.51585084",
"0.5157446",
"0.5156275",
"0.5154624",
"0.5153957",
"0.5137303",
"0.513627",
"0.5133411",
"0.5130403",
"0.5130018",
"0.5127538",
"0.5126544",
"0.5126477",
"0.5126266",
"0.51255345",
"0.5122652",
"0.5121167",
"0.5117828",
"0.5117209",
"0.51132214"
] | 0.0 | -1 |
Constructor to assign the class name to global variable | public VerifyCsoLogin()
{
testName_javaClass = this.getClass().getSimpleName();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void initialize(){\r\n\t\tinitialize(new CurrentClassGetter().getClassName());\r\n\t}",
"public GlobalVariable() {\n }",
"Object getClass_();",
"Object getClass_();",
"private Globals(){}",
"java.lang.String getClass_();",
"java.lang.String getClass_();",
"public Global() {\r\n }",
"public Global() {\n }",
"ByCicle(int weight, String name) {\r\n //super keyword can be used to access the instance variables of superclass\r\n //\"super\" can also be used to invoke parent class constructor and method\r\n super(weight);//Accessign Superclass constructor and its variable\r\n //Global Variable=Local variable\r\n this.name = name;\r\n }",
"private Globals() {}",
"abstract String getClassName();",
"@Override\n public String simpleName() {\n if (this == class_) {\n return \"class\";\n }\n return name();\n }",
"private MainConst() {\n super(\"\");\n }",
"private Globals() {\n\n\t}",
"public EngineClass()\n {\n cyl = 10;\n fuel = new String( BATT );\n }",
"public Foret(){\n super(\"Foret\");\n }",
"public void setObjectName(java.lang.String param){\n localObjectNameTracker = true;\n \n this.localObjectName=param;\n \n\n }",
"private NameUtil() {\n }",
"public abstract String getClassName();",
"String getClassName();",
"String getClassName();",
"String getClassName();",
"private ClassUtil() {}",
"public String getClassname() {\n return classname;\n }",
"String getSingletonName();",
"public String getClassName () { return _className; }",
"private void initInstanceVars() {\n\t\tglobalSymTab = new Hashtable<String,ClassDecl>();\n\t\tcurrentClass = null;\n\t}",
"public JmxLogLevel(RunTimeSingleton glob) {\n this.glob = glob;\n log.debug(\"Constructor created\");\n }",
"NamedClass createNamedClass();",
"public static void __init() {\r\n\t\t__name__ = new str(\"code\");\r\n\r\n\t\t/**\r\n\t\t copyright Sean McCarthy, license GPL v2 or later\r\n\t\t*/\r\n\t\tdefault_0 = null;\r\n\t\tcl_Code = new class_(\"Code\");\r\n\t}",
"public String getClassname()\r\n {\r\n return m_classname;\r\n }",
"public String getClassName(){\n\t\treturn classname;\n\t}",
"public ControlClass(String expID){\r\n \tinitialize(expID,null,null,null); \t\r\n }",
"java.lang.String getInstanceName();",
"public BaseObject()\n\t {\n\t className=\"BaseObject\";\n\t objectName=\"default object\";\n\t }",
"public String toString() {return classSimpleName+\"#\"+name;}",
"public static void main(String[] args) \r\n\t{\r\n\t\tVariable_Types obj=new Variable_Types();\r\n\t\tString tname=obj.toolname;\r\n\t\tSystem.out.println(\"Instant Variable name is => \"+tname);\r\n\r\n\t\t\r\n\t\t/*\r\n\t\t * Calling Class variables [Variable with static specifier]\r\n\t\t * \t\t\r\n\t\t */\r\n\t\tString mail=email;\r\n\t\tSystem.out.println(\"static variable value is => \"+mail);\r\n\t}",
"void createLocalClass()\n\t{\n\t\tfinal int localVar = 10;\n\t\t\n\t\t//this is to create local class\n\t\tclass LocalClass{\n\t\t\tpublic void print(){\n\t\t\t\tSystem.out.println(\"THis is local class with Id:\");\n\t\t\t\tSystem.out.println(\"THis is local class with num:\"+nums);\n\t\t\t\tSystem.out.println(\"THis is local class with num:\"+localVar); // localVar must be final. scope is different. the value might change inside local method.\n\t\t\t}\n\t\t}\n\t\t\n\t\tLocalClass l = new LocalClass();\n\t\tl.print();\n\t}",
"public String getClassName();",
"private SingletonClass()\n {\n s = \"Hello I am a string part of Singleton class\";\n }",
"public String getClassname() {\n\t\treturn classname;\n\t}",
"@Override\r\n\t\tpublic String getClassName()\r\n\t\t\t{\n\t\t\t\treturn null;\r\n\t\t\t}",
"public void initializeClass();",
"public void setName(String s) {\n\t\tclassName = s;\n\t}",
"public String getName_Class() {\n\t\treturn name;\n\t}",
"java.lang.String getClassName();",
"private String getClassname() {\r\n\t\tString classname = this.getClass().getName();\r\n\t\tint index = classname.lastIndexOf('.');\r\n\t\tif (index >= 0)\r\n\t\t\tclassname = classname.substring(index + 1);\r\n\t\treturn classname;\r\n\t}",
"public String getClassName() { return className; }",
"ClassVariable getClassVariable();",
"public void setName(String name) {\n this.name = name; // assigning a local variable value to a global variable\r\n }",
"public String getClassConstruct() {\n return super.getClassConstruct();\n }",
"private Instantiation(){}",
"public Country (String instanceName)\n {\n name = instanceName;\n }",
"protected SDB_ServiceClass( String s )\n {\n name = s;\n nameHash.put( s, this );\n intValue = index;\n intHash.put( new Integer( intValue ), this );\n }",
"public String mo12985l_() {\n return getClass().getName();\n }",
"public TestClass(String className)\n\t{\n\t\tthis.className = className;\n\t}",
"public static String getCurrentClassName(){\n\t\tString s2 = Thread.currentThread().getStackTrace()[2].getClassName();\n// System.out.println(\"s0=\"+s0+\" s1=\"+s1+\" s2=\"+s2);\n\t\t//s0=java.lang.Thread s1=g1.tool.Tool s2=g1.TRocketmq1Application\n\t\treturn s2;\n\t}",
"public OOP_207(){\n\n }",
"public MyClass1(String name) {\n\t\tsuper();\n\t\tthis.name = name;\n\t}",
"protected String getName() {\n\t\tfinal String tmpName = getClass().getSimpleName();\n\t\tif (tmpName.length() == 0) {\n\t\t\t// anonymous class\n\t\t\treturn \"???\";//createAlgorithm(replanningContext).getClass().getSimpleName();\n\t\t}\n\n\t\treturn tmpName;\n\t}",
"public void setClassName(String className) { this.className=className; }",
"String getMainClass();",
"protected ClassHolder(String name, ClassHolder context, boolean simple) {\n super(context.getFullName() + '.' + name, context.getBindingName() + '$' + name, simple);\n m_package = context.m_package;\n m_holder = context.m_holder;\n m_nameConverter = context.m_nameConverter;\n m_name = name;\n m_baseName = null;\n m_decorators = context.m_decorators;\n m_useInnerClasses = true;\n m_importsTracker = context.m_importsTracker;\n m_outerClass = context;\n m_inners = new LazyList();\n m_nameSet = new UniqueNameSet();\n ClassHolder scan = this;\n while (scan != null) {\n m_nameSet.add(scan.getName());\n scan = scan.m_outerClass;\n }\n m_importsTracker.addLocalType(name, getFullName());\n m_package.addInnerClass(this);\n }",
"ClassInstanceCreationExpression getClass_();",
"public void setClassName(String name)\n {\n _className = name;\n }",
"private UtilityKlasse() {\n\n }",
"Constructor() {\r\n\t\t \r\n\t }",
"public Core(String name) {\r\n\t\tsuper(name);\r\n\t}",
"public Factory() {\n\t\tclassMap = new TreeMap<String,Class<T> >();\n\t}",
"protected void initialize() {\n \tP.println(Tt.extractClassName(this) + \" initializing\");\n }",
"@Override\n public Void visitTypeVariable(TypeVariable t, Void aVoid) {\n reflectClass.setName(t.asElement().getSimpleName().toString());\n return super.visitTypeVariable(t, aVoid);\n }",
"private String name() {\r\n return cls.getSimpleName() + '.' + mth;\r\n }",
"public String getConstructorName() {\n v8.checkThread();\n v8.checkReleased();\n return v8.getConstructorName(v8.getV8RuntimePtr(), objectHandle);\n }",
"Variable(Object names[]) {\n _vname = makeName(names).intern();\n _names = names;\n \n }",
"public static String getClassName() {\n return CLASS_NAME;\n }",
"public Variable(String name){\n this.name = name;\n }",
"public static void main(String[] args) {\n\t\tthisconstructor rv = new thisconstructor();\n\t\n\t\n\t}",
"public String getBaseClassName() {\n return className;\n }",
"defaultConstructor(){}",
"public MockClass(String arg) {\n\t}",
"public Constructor(){\n\t\t\n\t}",
"public Class(String v, String h, String n) {\n\n\t\tclassName = n;\n\t\tvisability = v;\n\t\thierarchy = h;\n\t\tmain = false;\n\t\tisFinished = false;\n\t\tHighestMethod = 1;\n\t\tHighestVariable = 1;\n\t}",
"Reproducible newInstance();",
"@Override\n\t/**\n\t * sets the class ID for the created class, the class ID is the\n\t * primary method for identifying a class's name and all of its methods,\n\t * variables, and comments \n\t * \n\t * @param s \n\t */\n\tpublic void setClassID(int s) {\n\t\tID = s;\n\t}",
"private ClassInstance resolveInstanceName(ParseTreeNode instanceNameNode) {\r\n \r\n //For the comments in this method we use the following prototype instance declaration:\r\n //\"instance (C1 a1, C2 a2, ..., Cn an) => C (T b1 ... bm) where ...\"\r\n //where Ci = (Ci1, Ci2, .. Cij) where j is a function of i, and the ai are distinct.\r\n //This is called a C-T instance declaration because it declares that the type T is an instance of the class C. \r\n \r\n instanceNameNode.verifyType(CALTreeParserTokenTypes.INSTANCE_NAME);\r\n \r\n ParseTreeNode contextListNode = instanceNameNode.firstChild();\r\n contextListNode.verifyType(CALTreeParserTokenTypes.CLASS_CONTEXT_LIST, CALTreeParserTokenTypes.CLASS_CONTEXT_SINGLETON, CALTreeParserTokenTypes.CLASS_CONTEXT_NOTHING);\r\n \r\n ParseTreeNode classNameNode = contextListNode.nextSibling(); \r\n //resolve the class C i.e. make sure it is visible within the current module, and give it a fully qualified name if\r\n //it was referenced without the module qualifier. \r\n TypeClass typeClass = typeClassChecker.resolveClassName(classNameNode); \r\n \r\n ParseTreeNode instanceTypeConsNameNode = classNameNode.nextSibling();\r\n \r\n TypeConstructor typeCons = null;\r\n //the number of type variables appearing in the CAL source (may be incorrect for the type constructor, in which case we\r\n //produce a compilation error.\r\n int nTypeVariables = -1;\r\n ParseTreeNode firstTypeVarNode = null; \r\n \r\n switch (instanceTypeConsNameNode.getType()) {\r\n \r\n case CALTreeParserTokenTypes.GENERAL_TYPE_CONSTRUCTOR:\r\n case CALTreeParserTokenTypes.UNPARENTHESIZED_TYPE_CONSTRUCTOR:\r\n {\r\n ParseTreeNode typeConsNameNode = instanceTypeConsNameNode.firstChild();\r\n //resolve the type (constructor) T.\r\n typeCons = dataDeclarationChecker.resolveTypeConsName(typeConsNameNode);\r\n nTypeVariables = instanceTypeConsNameNode.getNumberOfChildren() - 1;\r\n firstTypeVarNode = typeConsNameNode.nextSibling();\r\n break;\r\n }\r\n \r\n case CALTreeParserTokenTypes.FUNCTION_TYPE_CONSTRUCTOR:\r\n {\r\n typeCons = TypeConstructor.FUNCTION;\r\n nTypeVariables = 2; //guaranteed by the parser\r\n firstTypeVarNode = instanceTypeConsNameNode.firstChild();\r\n break;\r\n }\r\n \r\n case CALTreeParserTokenTypes.UNIT_TYPE_CONSTRUCTOR:\r\n { \r\n nTypeVariables = 0;\r\n typeCons = compiler.getTypeChecker().getTypeConstants().getUnitType().rootTypeConsApp().getRoot(); \r\n firstTypeVarNode = instanceTypeConsNameNode.firstChild();\r\n break;\r\n }\r\n \r\n case CALTreeParserTokenTypes.LIST_TYPE_CONSTRUCTOR:\r\n {\r\n typeCons = compiler.getTypeChecker().getTypeConstants().getListTypeCons();\r\n nTypeVariables = 1; //guaranteed by the parser\r\n firstTypeVarNode = instanceTypeConsNameNode.firstChild();\r\n break;\r\n }\r\n \r\n case CALTreeParserTokenTypes.RECORD_TYPE_CONSTRUCTOR:\r\n {\r\n //for \"instance (constraints) => C {r} where ...\" check that kind (C) == *. \r\n try {\r\n //after kind inference the kinds of type classes have no kind variables (they are grounded)\r\n //so they will not be mutated by the unification below. \r\n KindExpr.unifyKind(typeClass.getKindExpr(), KindExpr.STAR);\r\n } catch (TypeException typeException) {\r\n \r\n //\"Invalid record instance declaration; the kind of the type class {0} (i.e. {1}) is not equal to the kind *.\"\r\n compiler.logMessage(\r\n new CompilerMessage(\r\n instanceTypeConsNameNode,\r\n new MessageKind.Error.RecordInstanceDeclarationKindClash(\r\n typeClass))); \r\n }\r\n \r\n String recordVarName = instanceTypeConsNameNode.firstChild().getText();\r\n RecordType instanceRecordType = checkConstrainedRecordVar(contextListNode, recordVarName);\r\n return addCurrentClassInstance(instanceNameNode, instanceRecordType, typeClass); \r\n }\r\n \r\n default:\r\n {\r\n instanceTypeConsNameNode.unexpectedParseTreeNode();\r\n break;\r\n }\r\n \r\n } \r\n \r\n //Type constructor instance declarations for the Typeable type class are automatically generated by the compiler\r\n //whenever possible. However, for types whose type variable arguments are not of kind *, such\r\n //an instance declaration is invalid. Thus a user could theoretically create an instance declaration\r\n //for the type, causing a security violation since the Typeable instances are used for Dynamic support.\r\n //\r\n //In addition, even for the instances where an explicit declaration would create an overlapping instance\r\n //error, this message is easier to understand.\r\n if (typeClass.getName().equals(CAL_Prelude.TypeClasses.Typeable) &&\r\n instanceTypeConsNameNode.getType() != CALTreeParserTokenTypes.RECORD_TYPE_CONSTRUCTOR) {\r\n //\"Explicit instance declarations for the Cal.Core.Prelude.Typeable type class are not allowed.\"\r\n compiler.logMessage(\r\n new CompilerMessage(\r\n classNameNode,\r\n new MessageKind.Error.ExplicitTypeableInstance())); \r\n \r\n }\r\n \r\n //check that the type (T b1 ... bm) and the typeClass C have the same kind. \r\n \r\n //First we do a simple check that m is not too big. In essence this is a kind-checking error, but we \r\n //we can give a friendlier error message than a kind-checking error in the case of over-saturation.\r\n //note that we cannot assume that the type constructor is fully saturated\r\n //i.e. this may correctly be an undersaturated application. \r\n final int maxNTypeVariables = typeCons.getTypeArity();\r\n if (nTypeVariables > maxNTypeVariables) {\r\n // \"The type constructor {0} expects at most {1} type argument(s). {2} supplied.\"\r\n compiler.logMessage(\r\n new CompilerMessage(\r\n instanceTypeConsNameNode,\r\n new MessageKind.Error.TypeConstructorAppliedToOverlyManyArgs(typeCons.getName(), maxNTypeVariables, nTypeVariables))); \r\n } \r\n \r\n // the kind of T b1 ... bm where m <= typeCons.getTypeArity is the last element of the kindPieces array\r\n KindExpr[] kindPieces = typeCons.getKindExpr().getKindPieces(nTypeVariables); \r\n KindExpr appliedTypeConsKind = kindPieces[nTypeVariables];\r\n \r\n //now do the general check that kind (T b1 ... bm) == kind (type class C).\r\n \r\n try {\r\n //after kind inference the kinds of type classes and type constructors have no kind variables (they are grounded)\r\n //so they will not be mutated by the unification below. \r\n \r\n KindExpr.unifyKind(appliedTypeConsKind, typeClass.getKindExpr());\r\n \r\n } catch (TypeException typeException) {\r\n \r\n //\"Invalid instance declaration; the kind of the type class {0} (i.e. {1}) is not the same as the kind of the application of the type constructor {2} to {3} type arguments (i.e. {4}).\" \r\n compiler.logMessage(\r\n new CompilerMessage(\r\n instanceTypeConsNameNode,\r\n new MessageKind.Error.InstanceDeclarationKindClash(\r\n typeClass, typeCons, nTypeVariables, appliedTypeConsKind))); \r\n }\r\n \r\n \r\n //Now check that there are no repeated type variables bi and set up some data structures for later checks.\r\n \r\n //(String -> Integer) For example, for an instance for Tuple3 d a b then the map is {(d, 0), (a, 1), (b, 2)}.\r\n Map<String, Integer> varNameToArgNumberMap = new HashMap<String, Integer>();\r\n \r\n int argNumber = 0;\r\n for (ParseTreeNode varNameNode = firstTypeVarNode; varNameNode != null; varNameNode = varNameNode.nextSibling()) {\r\n \r\n varNameNode.verifyType(CALTreeParserTokenTypes.VAR_ID);\r\n String varName = varNameNode.getText();\r\n if (varNameToArgNumberMap.put(varName, Integer.valueOf(argNumber)) != null) { \r\n //Can't have repeated type variables such as instance Eq a => Foo a a\r\n compiler.logMessage(new CompilerMessage(varNameNode, new MessageKind.Error.RepeatedTypeVariableInInstanceDeclaration(varName)));\r\n }\r\n \r\n ++argNumber; \r\n }\r\n \r\n TypeExpr [] argTypes = checkConstrainedTypeVars(contextListNode, varNameToArgNumberMap, kindPieces);\r\n TypeConsApp instanceType = new TypeConsApp(typeCons, argTypes);\r\n \r\n return addCurrentClassInstance(instanceNameNode, instanceType, typeClass); \r\n }",
"private String replaceFullNameWithConstructor(String typeName) {\r\n\t\tint pos = typeName.lastIndexOf('.');\r\n\t\treturn JavascriptKeywords.CONSTRUCTOR + typeName.substring(pos);\r\n\t}",
"public String getClassName()\n {\n return _className;\n }",
"@Override\n public String getClassName() {\n return kelas;\n }",
"@Override\n public String getClassName() {\n return kelas;\n }",
"ClassC initClassC(ClassC iClassC)\n {\n iClassC.updateElementValue(\"ClassC\");\n return iClassC;\n }",
"protected String getClassName() {\r\n return newName.getText();\r\n }",
"public Variable(String name) {\r\n\tthis.name = name;\r\n }",
"final public void ClassName() throws ParseException {\n jj_consume_token(IDENTIFIER);\n label_24:\n while (true) {\n switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\n case 88:\n case 98:\n ;\n break;\n default:\n jj_la1[104] = jj_gen;\n break label_24;\n }\n switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\n case 88:\n jj_consume_token(88);\n jj_consume_token(IDENTIFIER);\n break;\n case 98:\n jj_consume_token(98);\n jj_consume_token(IDENTIFIER);\n break;\n default:\n jj_la1[105] = jj_gen;\n jj_consume_token(-1);\n throw new ParseException();\n }\n }\n }",
"public GlobalScope() {\n super(null);\n }",
"public ClassTemplate() {\n\t}",
"public _355() {\n\n }",
"public static void\ninitClass()\n//\n////////////////////////////////////////////////////////////////////////\n{\n}",
"public ClassNode(Ontology o) {\n\t\tname = o.getName();\n\t}",
"public void setClassName(String name) {\n\t\tlines.append(\".class public l2j/generated/\");\n\t\tlines.append(name);\n\t\tclassName = \"l2j/generated/\" + name;\n\t\tlines.append(\"\\n\");\n\n\t\t// stupid check\n\t\tif (dest.indexOf(name) == -1)\n\t\t\tthrow new IllegalStateException(\"Bad class name\");\n\t}"
] | [
"0.67528313",
"0.6262188",
"0.6101105",
"0.6101105",
"0.59649616",
"0.59537023",
"0.59537023",
"0.5941932",
"0.5931315",
"0.5860962",
"0.57985324",
"0.5782554",
"0.5774951",
"0.57673657",
"0.57565373",
"0.5750908",
"0.5715387",
"0.5708157",
"0.5701948",
"0.5700796",
"0.569477",
"0.569477",
"0.569477",
"0.56911975",
"0.5686039",
"0.56799746",
"0.56719357",
"0.5667534",
"0.5667187",
"0.56664985",
"0.5664056",
"0.5653795",
"0.56323034",
"0.5632047",
"0.56241673",
"0.56126827",
"0.5594644",
"0.55855674",
"0.5582938",
"0.55574465",
"0.55545545",
"0.5551654",
"0.555079",
"0.55444866",
"0.5539471",
"0.5515325",
"0.55139804",
"0.55126005",
"0.5505735",
"0.5500371",
"0.5499083",
"0.5479907",
"0.54777384",
"0.5470757",
"0.54627424",
"0.5457055",
"0.545124",
"0.54486245",
"0.54483306",
"0.54479754",
"0.54373276",
"0.54346454",
"0.54345393",
"0.54306597",
"0.54250526",
"0.54156095",
"0.5410969",
"0.54101735",
"0.5403605",
"0.539648",
"0.5392742",
"0.5388245",
"0.5378203",
"0.53670263",
"0.536683",
"0.53491664",
"0.534721",
"0.5332032",
"0.5326432",
"0.5307192",
"0.5306147",
"0.52990526",
"0.5298049",
"0.52974737",
"0.52933884",
"0.52906454",
"0.5281587",
"0.52676165",
"0.52667844",
"0.5266774",
"0.52609676",
"0.5260321",
"0.52545017",
"0.5248934",
"0.5245867",
"0.5242223",
"0.5237928",
"0.5236624",
"0.52312225",
"0.52279997"
] | 0.54837966 | 51 |
Assigning Input, Output, Test data to entire test execution | @BeforeClass
public void beforeTestClass()
{
fBase.driver = driver;
fBase.testdataHashMap = testdataHashMap;
fBase.eTest = eTest;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n void execute_testingLotsOfBoundaryValues () {\n ihd2.initialize(sensor);\n ihd1.initialize(sensor);\n iad.initialize(ihd1, ihd2);\n\n\n// here i create array with data that i send in to test\n int testData[] = {0, -23, 45, 290, 50, -123, 200, 199, 201, -200, 5, 1, -1, 29};\n\n // in this test the output is two booleans, the output might change for each loop, so i must create an array of arrays that i\n // store the expected results in. so here for example when value zero which is the first value in the testData array is sent\n // to the for loop, once it passed the system and analyze has given it two booleans,\n // it will be compared to the test0 array in the array of arrays called expectedResults.\n boolean test0[] = {false, false};\n boolean test1[] = {false, false};\n boolean test2[] = {true, true};\n boolean test3[] = {true, true};\n boolean test4[] = {true, true};\n boolean test5[] = {false, false};\n boolean test6[] = {true, true};\n boolean test7[] = {true, true};\n boolean test8[] = {true, true};\n boolean test9[] = {false, false};\n boolean test10[] = {false, false};\n boolean test11[] = {false, false};\n boolean test12[] = {false, false};\n boolean test13[] = {true, true};\n\n\n boolean[] expectedResult[] = {test0,test1, test2, test3, test4, test5, test6, test7, test8, test9, test10, test11, test12, test13};\n\n\n\n\n\n // after initialize inputs are set to zero, here inputs is changed with array content at index t\n for (int t = 0; t < testData.length; t++) {\n sensor.safetyOutput = testData[t];\n sensor.originalOutput = testData[t];\n\n // then i must run both ihd so that the safety and original output is transferred to read1 and read2 which is used in\n // iad execute that does the analyze\n ihd1.execute();\n ihd2.execute();\n\n // then i run the execute which analyze the data\n iad.execute();\n\n\n\n // then i take the result and store it in an array.\n boolean[] booleansProducedByAnalyzeMethod = iad.getData();\n// here i store the expectedResultvalue on position t in the testet array\n boolean testet[] = expectedResult[t];\n// and last but not the least i compare both arrays and print out result.\n\n if (Arrays.equals(testet, booleansProducedByAnalyzeMethod))\n System.out.println(\"Pass boundaryvaluestest\"+ t);\n else\n System.out.println(\"Fail boundaryvaluestest\"+ t);\n\n\n }\n }",
"private void setTestData() {\n\t\tCollections.shuffle(input);\n\t\ttestData = new LinkedList<>();\n\t\tfor (int i = 0; i < TEST_DATA_SIZE; i++) {\n\t\t\ttestData.add(input.remove(0));\n\t\t}\n\t}",
"private void test() {\r\n \ttry {\r\n\t\t\ttestWriter.write(\"Testing started...\");\r\n\t\t\r\n\t\t\tpredictions = new HashMap<>();\r\n \trightAnswers = new HashMap<>();\r\n\r\n\r\n \t// Get results and check them\r\n \tEvaluation eval = new Evaluation(numLabels);\r\n \tfinalTestIterator.reset();\r\n\r\n \tint metaDataCounter = 0;\r\n \tint addrCounter = 0;\r\n\r\n \twhile(finalTestIterator.hasNext()) {\r\n \t// If iterator has next dataset\r\n \tfinalTestData = finalTestIterator.next();\r\n \t// Get meta-data from this dataset\r\n\r\n \t@SuppressWarnings(\"rawtypes\")\r\n \tList<?> exampleMetaData = finalTestData.getExampleMetaData();\r\n \tIterator<?> exampleMetaDataIterator = exampleMetaData.iterator();\r\n \ttestWriter.write(\"\\n Metadata from dataset #\" + metaDataCounter + \":\\n\");\r\n \tSystem.out.println(\"\\n Metadata from dataset #\" + metaDataCounter + \":\\n\");\r\n\r\n \t// Normalize data\r\n \tnormalizer.fit(finalTestData);\r\n\r\n \t// Count processed images\r\n \tnumProcessed = (metaDataCounter + 1) * batchSizeTesting;\r\n \tloaded.setText(\"Loaded and processed: \" + numProcessed + \" pictures\");\r\n\r\n \tINDArray features = finalTestData.getFeatures();\r\n \tINDArray labels = finalTestData.getLabels();\r\n \tSystem.out.println(\"\\n Right labels #\" + metaDataCounter + \":\\n\");\r\n \ttestWriter.write(\"\\n Right labels #\" + metaDataCounter + \":\\n\");\r\n \t// Get right answers of NN for every input object\r\n \tint[][] rightLabels = labels.toIntMatrix();\r\n \tfor (int i = 0; i < rightLabels.length; i++) {\r\n \tRecordMetaDataURI metaDataUri = (RecordMetaDataURI) exampleMetaDataIterator.next();\r\n \t// Print address of image\r\n \tSystem.out.println(metaDataUri.getLocation());\r\n \tfor (int j = 0; j < rightLabels[i].length; j++) {\r\n \tif(rightLabels[i][j] == 1) {\r\n \t//public V put(K key, V value) -> key=address, value=right class label\r\n \trightAnswers.put(metaDataUri.getLocation(), j);\r\n \tthis.addresses.add(metaDataUri.getLocation());\r\n \t}\r\n \t}\r\n \t}\r\n \tSystem.out.println(\"\\nRight answers:\");\r\n \ttestWriter.write(\"\\nRight answers:\");\r\n \t// Print right answers\r\n \tfor(Map.Entry<String, Integer> answer : predictions.entrySet()){\r\n \t\ttestWriter.write(String.format(\"Address: %s Right answer: %s \\n\", answer.getKey(), answer.getValue().toString()));\r\n \tSystem.out.printf(String.format(\"Address: %s Right answer: %s \\n\", answer.getKey(), answer.getValue().toString()));\r\n \t}\r\n\r\n \t// Evaluate on the test data\r\n \tINDArray predicted = vgg16Transfer.outputSingle(features);\r\n \tint predFoundCounter = 0;\r\n \tSystem.out.println(\"\\n Labels predicted #\" + metaDataCounter + \":\\n\");\r\n \ttestWriter.write(\"\\n Labels predicted #\" + metaDataCounter + \":\\n\");\r\n \t// Get predictions of NN for every input object\r\n \tint[][] labelsPredicted = predicted.toIntMatrix();\r\n \tfor (int i = 0; i < labelsPredicted.length; i++) {\r\n \tfor (int j = 0; j < labelsPredicted[i].length; j++) {\r\n \tpredFoundCounter++;\r\n \tif(labelsPredicted[i][j] == 1) {\r\n \t//public V put(K key, V value) -> key=address, value=predicted class label\r\n \tpredFoundCounter = 0;\r\n \tthis.predictions.put(this.addresses.get(addrCounter), j);\r\n \t}\r\n \telse {\r\n \tif (predFoundCounter == 3) {\r\n \t// To fix bug when searching positive predictions\r\n \tthis.predictions.put(this.addresses.get(addrCounter), 2);\r\n \t}\r\n \t}\r\n \t}\r\n \taddrCounter++;\r\n \t}\r\n \tSystem.out.println(\"\\nPredicted:\");\r\n \ttestWriter.write(\"\\nPredicted:\");\r\n \t// Print predictions\r\n \tfor(Map.Entry<String, Integer> pred : rightAnswers.entrySet()){\r\n \tSystem.out.printf(\"Address: %s Predicted answer: %s \\n\", pred.getKey(), pred.getValue().toString());\r\n \ttestWriter.write(String.format(\"Address: %s Predicted answer: %s \\n\", pred.getKey(), pred.getValue().toString()));\r\n \t}\r\n \tmetaDataCounter++;\r\n\r\n \teval.eval(labels, predicted);\r\n \t}\r\n\r\n \tSystem.out.println(\"\\n\\n Cheack loaded model on test data...\");\r\n \tSystem.out.println(String.format(\"Evaluation on test data - [Accuracy: %.3f, P: %.3f, R: %.3f, F1: %.3f] \",\r\n \t\t\teval.accuracy(), eval.precision(), eval.recall(), eval.f1()));\r\n \tSystem.out.println(eval.stats());\r\n \tSystem.out.println(eval.confusionToString());\r\n \ttestWriter.write(\"\\n\\n Cheack loaded model on test data...\");\r\n \ttestWriter.write(String.format(\"Evaluation on test data - [Accuracy: %.3f, P: %.3f, R: %.3f, F1: %.3f] \",\r\n \t\t\teval.accuracy(), eval.precision(), eval.recall(), eval.f1()));\r\n \ttestWriter.write(eval.stats());\r\n \ttestWriter.write(eval.confusionToString());\r\n\r\n \t// Save test rates\r\n \tthis.f1_score = eval.f1();\r\n \tthis.recall_score = eval.recall();\r\n \tthis.accuracy_score = eval.accuracy();\r\n \tthis.precision_score = eval.precision();\r\n \tthis.falseNegativeRate_score = eval.falseNegativeRate();\r\n \tthis.falsePositiveRate_score = eval.falsePositiveRate();\r\n\r\n \tthis.f1.setText(\"F1 = \" + String.format(\"%.4f\", f1_score));\r\n \tthis.recall.setText(\"Recall = \" + String.format(\"%.4f\", recall_score));\r\n \tthis.accuracy.setText(\"Accuracy = \" + String.format(\"%.4f\", accuracy_score));\r\n \tthis.precision.setText(\"Precision = \" + String.format(\"%.4f\", precision_score));\r\n \tthis.falseNegativeRate.setText(\"False Negative Rate = \" + String.format(\"%.4f\", falseNegativeRate_score));\r\n \tthis.falsePositiveRate.setText(\"False Positive Rate = \" + String.format(\"%.4f\", falsePositiveRate_score));\r\n \r\n \ttestWriter.write(\"F1 = \" + String.format(\"%.4f\", f1_score));\r\n \ttestWriter.write(\"Recall = \" + String.format(\"%.4f\", recall_score));\r\n \ttestWriter.write(\"Accuracy = \" + String.format(\"%.4f\", accuracy_score));\r\n \ttestWriter.write(\"Precision = \" + String.format(\"%.4f\", precision_score));\r\n \ttestWriter.write(\"False Negative Rate = \" + String.format(\"%.4f\", falseNegativeRate_score));\r\n \ttestWriter.write(\"False Positive Rate = \" + String.format(\"%.4f\", falsePositiveRate_score));\r\n\r\n \tshowBarChart();\r\n \t} catch (IOException e) {\r\n \t\tSystem.err.println(\"Error while writing to log file\");\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n }",
"@Before\n public void setup(){\n output = new TestingOutputInterface();\n mLogic = new Logic(output);\n \n System.err.flush();\n System.out.flush();\n myOut = new ByteArrayOutputStream();\n myErr = new ByteArrayOutputStream();\n System.setOut(new PrintStream(myOut));\n System.setErr(new PrintStream(myErr));\n }",
"protected void runTest() {\n\t\trunTest(getIterations());\n\t}",
"public ResultatTest() {\n\t\tthis.nbTests = 0;\n\t\tthis.echecs = new ArrayList<TestExecute>();\n\t\tthis.erreurs = new ArrayList<TestExecute>();\n\t}",
"@Override\r\n public void runTests() {\r\n getTemperature();\r\n }",
"@Test\n\tpublic void addTaskOutput(){\n\t}",
"private void runAllTests(){\n System.out.println(\"------ RUNNING TESTS ------\\n\");\n testAdd(); // call tests for add(int element)\n testGet(); // tests if the values were inserted correctly\n testSize(); // call tests for size()\n testRemove(); // call tests for remove(int index)\n testAddAtIndex(); // call tests for add(int index, int element)\n\n // This code below will test that the program can read the file\n // and store the values into an array. This array will then be sorted\n // by the insertionSort and it should write the sorted data back into the file\n\n testReadFile(); // call tests for readFile(String filename)\n testInsertionSort(); // call tests for insertionSort()\n testSaveFile(); // call tests for saveFile(String filename)\n System.out.println(\"\\n----- TESTING COMPLETE ----- \");\n }",
"public void runIndividualSpreadsheetTests() {\r\n\r\n\t\t// Make a list of files to be analyzed\r\n\t\tString[] inputFiles = new String[] {\r\n//\t\t\t\t\"salesforecast_TC_IBB.xml\",\r\n//\t\t\t\t\"salesforecast_TC_2Faults.xml\",\r\n//\t\t\t\t\t\t\t\"salesforecast_TC_2FaultsHeavy.xml\",\r\n\t\t\t\t\"SemUnitEx1_DJ.xml\",\r\n\t\t\t\t\"SemUnitEx2_1fault.xml\",\r\n\t\t\t\t\"SemUnitEx2_2fault.xml\",\r\n//\t\t\t\t\"VDEPPreserve_1fault.xml\",\r\n//\t\t\t\t\"VDEPPreserve_2fault.xml\",\r\n//\t\t\t\t\t\t\t\"VDEPPreserve_3fault.xml\",\r\n//\t\t\t\t\"AZA4.xml\",\r\n//\t\t\t\t\"Consultant_form.xml\",\r\n//\t\t\t\t\"Hospital_Payment_Calculation.xml\",\r\n//\t\t\t\t\"Hospital_Payment_Calculation_v2.xml\",\r\n//\t\t\t\t\"Hospital_Payment_Calculation_C3.xml\",\r\n//\t\t\t\t\"11_or_12_diagnoses.xml\",\r\n//\t\t\t\t\"choco_loop.xml\",\r\n//\t\t\t\t\"Paper2.xml\",\r\n//\t\t\t\t\"Test_If.xml\",\r\n//\t\t\t\t\"Test_If2.xml\",\r\n\r\n\t\t};\r\n\r\n\t\tscenarios.add(new Scenario(executionMode.singlethreaded, pruningMode.on, PARALLEL_THREADS, CHOCO3));\r\n//\t\tscenarios.add(new Scenario(executionMode.levelparallel, pruningMode.on, 2, CHOCO3));\r\n//\t\tscenarios.add(new Scenario(executionMode.fullparallel, pruningMode.on, 1, CHOCO3));\r\n\t\tscenarios.add(new Scenario(executionMode.fullparallel, pruningMode.on, 2, CHOCO3));\r\n//\t\tscenarios.add(new Scenario(executionMode.fullparallel, pruningMode.on, 4, CHOCO3));\r\n//\t\tscenarios.add(new Scenario(executionMode.heuristic, pruningMode.on, 1, CHOCO3));\r\n\t\tscenarios.add(new Scenario(executionMode.heuristic, pruningMode.on, 2, CHOCO3));\r\n//\t\tscenarios.add(new Scenario(executionMode.heuristic, pruningMode.on, 4, CHOCO3));\r\n//\t\tscenarios.add(new Scenario(executionMode.heuristic, pruningMode.on, PARALLEL_THREADS, true));\r\n//\t\tscenarios.add(new Scenario(executionMode.hybrid, pruningMode.on, 1, CHOCO3));\r\n\t\tscenarios.add(new Scenario(executionMode.hybrid, pruningMode.on, 2, CHOCO3));\r\n//\t\tscenarios.add(new Scenario(executionMode.hybrid, pruningMode.on, 4, CHOCO3));\r\n//\t\tscenarios.add(new Scenario(executionMode.levelparallel, pruningMode.on, PARALLEL_THREADS, false));\r\n//\t\tscenarios.add(new Scenario(executionMode.fullparallel, pruningMode.on, PARALLEL_THREADS, false));\r\n//\t\tscenarios.add(new Scenario(executionMode.fullparallel, pruningMode.on, PARALLEL_THREADS, false));\r\n//\t\tscenarios.add(new Scenario(executionMode.heuristic,pruningMode.on,PARALLEL_THREADS*2));\r\n//\t\tscenarios.add(new Scenario(executionMode.heuristic,pruningMode.on,0));\r\n\r\n//\t\tinputFiles = new String[]{\"VDEPPreserve_3fault.xml\"};\r\n\r\n\r\n\t\t// Go through the files and run them in different scenarios\r\n\t\tfor (String inputfilename : inputFiles) {\r\n\t\t\trunScenarios(inputFileDirectory, inputfilename, logFileDirectory, scenarios);\r\n\t\t}\r\n\t}",
"@Before\r\n\tpublic void setUp() throws Exception {\n\t\tunitTestInputs = new ArrayList<TestInput>(50);\r\n\t\t\r\n\t\t// Iterate over all input files\r\n\t\tFile directory = new File(\"Inputs\");\r\n\t\tFile[] inputFiles = directory.listFiles();\r\n\t\tif (inputFiles != null)\r\n\t\t{\r\n\t\t\t// Iterate over each input file\r\n\t\t\tfor (File inputFile : inputFiles)\r\n\t\t\t{\r\n\t\t\t\t// Parse file to create test input objects\t\r\n\t\t\t\tString fileName = inputFile.getName();\r\n\t\t\t\tif (fileName.startsWith(\"INPUT\"))\r\n\t\t\t\t{\r\n\t\t\t\t\tString[] fileNameSplit = fileName.split(\"[_.]\");\r\n\t\t\t\t\tlong numberInversions = Long.parseLong(fileNameSplit[1]);\r\n\t\t\t\t\t\r\n\t\t\t\t\tArrayList<Integer> inputValues = Common.ParseInputFile(inputFile.getPath());\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Add test input\r\n\t\t\t\t\tunitTestInputs.add(new TestInput(inputValues, numberInversions));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"@BeforeClass\n public static void setUpClass() throws IOException {\n // Set logging output level\n org.apache.log4j.Logger.getRootLogger().setLevel(Level.ERROR);\n\n // DO THIS BY HAND! Set the output file for the results of triplifying classInput.txt\n // User-interface output\n classOutputFileName = \"classOutputUserInterface.ttl\";\n // DO THIS BY HAND! Set the output file for the results of triplifying propertyInput.txt\n // User-interface output\n propertyOutputFileName = \"propertyOutputUserInterface.ttl\";\n\n // The base URI for all input and output for these tests\n baseuri = System.getProperty(\"user.dir\");\n baseuri = \"file://\" + baseuri + \"/testdata/\";\n\n // A model for the class tests. The MeasuringStick is the output that we expect\n classMeasuringStick = ModelFactory.createOntologyModel(OntModelSpec.OWL_LITE_MEM_RULES_INF);\n classMeasuringStick.read(baseuri + \"classMeasuringStick.n3\", \"urn:\", FileUtils.langN3);\n\n // A model for the class tests output (coming out of the triplifier)\n classOutput = ModelFactory.createOntologyModel(OntModelSpec.OWL_LITE_MEM_RULES_INF);\n classOutput.read(baseuri + classOutputFileName, \"urn:\", FileUtils.langTurtle);\n\n // A model for the property tests. The MeasuringStick is the output that we expect\n propertyMeasuringStick = ModelFactory.createOntologyModel(OntModelSpec.OWL_LITE_MEM_RULES_INF);\n propertyMeasuringStick.read(baseuri + \"propertyMeasuringStick.n3\", \"urn:\", FileUtils.langN3);\n\n // A model for the property tests output (coming out of the triplifier)\n propertyOutput = ModelFactory.createOntologyModel(OntModelSpec.OWL_LITE_MEM_RULES_INF);\n propertyOutput.read(baseuri + propertyOutputFileName, \"urn:\", FileUtils.langTurtle);\n }",
"@Override\n\tpublic void saveTestingData() {\n\t\t\n\t}",
"public void execute() {\n TestOrchestratorContext context = factory.createContext(this);\n\n PipelinesManager pipelinesManager = context.getPipelinesManager();\n ReportsManager reportsManager = context.getReportsManager();\n TestDetectionOrchestrator testDetectionOrchestrator = context.getTestDetectionOrchestrator();\n TestPipelineSplitOrchestrator pipelineSplitOrchestrator = context.getPipelineSplitOrchestrator();\n\n pipelinesManager.initialize(testTask.getPipelineConfigs());\n reportsManager.start(testTask.getReportConfigs(), testTask.getTestFramework());\n pipelineSplitOrchestrator.start(pipelinesManager);\n\n testDetectionOrchestrator.startDetection();\n testDetectionOrchestrator.waitForDetectionEnd();\n LOGGER.debug(\"test - detection - ended\");\n\n pipelineSplitOrchestrator.waitForPipelineSplittingEnded();\n pipelinesManager.pipelineSplittingEnded();\n LOGGER.debug(\"test - pipeline splitting - ended\");\n\n pipelinesManager.waitForExecutionEnd();\n reportsManager.waitForReportEnd();\n\n LOGGER.debug(\"test - execution - ended\");\n }",
"@Test\n public void testRun() {\n System.out.println(\"run\");\n FluorescenceImporter importer = null;\n try {\n FluorescenceFixture tf = new FluorescenceFixture();\n importer = new FluorescenceImporter(tf.testData());\n ProgressHandle ph = ProgressHandleFactory.createHandle(\"Importing dataset\");\n importer.setProgressHandle(ph);\n \n importer.run();\n } catch (IOException ex) {\n Exceptions.printStackTrace(ex);\n }\n \n //FluorescenceDataset dataset = importer.getDataset();\n Dataset<? extends Instance> plate = importer.getDataset();\n System.out.println(\"inst A1 \"+ plate.instance(0).toString());\n System.out.println(\"plate \"+plate.toString());\n Dataset<Instance> output = new SampleDataset<Instance>();\n output.setParent((Dataset<Instance>) plate);\n ProgressHandle ph = ProgressHandleFactory.createHandle(\"Analyzing dataset\");\n // AnalyzeRunner instance = new AnalyzeRunner((Timeseries<ContinuousInstance>) plate, output, ph);\n // instance.run();\n \n }",
"public static void run()\n {\n String[] testInput = FileIO.readAsStrings(\"2020/src/day17/Day17TestInput.txt\");\n String[] realInput = FileIO.readAsStrings(\"2020/src/day17/Day17Input.txt\");\n\n Test.assertEqual(\"Day 17 - Part A - Test input\", partA(testInput), 112);\n Test.assertEqual(\"Day 17 - Part A - Challenge input\", partA(realInput), 384);\n Test.assertEqual(\"Day 17 - Part B - Test input\", partB(testInput), 848);\n Test.assertEqual(\"Day 17 - Part B - Challenge input\", partB(realInput), 2012);\n }",
"@BeforeClass\n public static void setUpTestData() throws Exception {\n String unwFileName = \"9192_6687.uint\";\n String hghtFileName = \"heights.raw.ORIGINAL\";\n\n unwrappedPhase = castToDouble(512, 512, readFloatFile(512, 512, testDataDir + unwFileName));\n heights = castToDouble(512, 512, readFloatFile(512, 512, testDataDir + hghtFileName));\n\n File masterResFile = new File(testResDir + \"9192.res\");\n File slaveResFile = new File(testResDir + \"6687.res\");\n\n /** Construct metadata classes */\n master = new SLCImage();\n slave = new SLCImage();\n\n master.parseResFile(masterResFile);\n slave.parseResFile(slaveResFile);\n\n masterOrbit = new Orbit();\n\n masterOrbit.parseOrbit(masterResFile);\n masterOrbit.computeCoefficients(3);\n masterOrbit.computeCoefficients(ORBIT_DEGREE);\n\n slaveOrbit = new Orbit();\n\n slaveOrbit.parseOrbit(slaveResFile);\n slaveOrbit.computeCoefficients(3);\n slaveOrbit.computeCoefficients(ORBIT_DEGREE);\n\n dataWindow = new Window(1, 26897, 1, 5167);\n\n tileWindow = new Window(15000, 15511, 3000, 3511);\n\n }",
"public TestDriverProgram(){\n iTestList = new SortableArray(iSize); // tests if parameterized constructor works\n iTestFileList = new SortableArray(); // tests if default constructor works\n runAllTests(); // run all of the tests\n }",
"public void setOutput(TestOut output) {\n\tthis.output = output;\n\tsuper.setOutput(output);\n }",
"public interface ITestDataAnalyzer {\n List<INameValue> getAllTestInputs();\n INameValue getTestInput(String name);\n List<INameValue> getAllExpectedValues();\n INameValue getExpectedValue(String name);\n List<TestValueResult> getValueResults(List<INameValue> actualValues);\n}",
"private void initiliaze() {\r\n\t\tthis.inputFile = cd.getInputFile();\r\n\t\tthis.flowcell = cd.getFlowcell();\r\n\t\tthis.totalNumberOfTicks = cd.getOptions().getTotalNumberOfTicks();\r\n\t\tthis.outputFile = cd.getOutputFile();\r\n\t\tthis.statistics = cd.getStatistic();\r\n\t}",
"@Before\n public void setUp()\n {\n summary = \"\";\n allPassed = true;\n firstFailExpected = null;\n firstFailRun = null;\n captureSummary = \"\";\n captureRun = null;\n }",
"public void setUpData() {\n generalStatsCalculator.calculateOffsetTrees();\n this.MostEmissionsRouteString =\n RoutesArrayToString(routeStatsCalculator.getMostEmissionsRoutes());\n this.LeastEmissionsRouteString =\n RoutesArrayToString(routeStatsCalculator.getLeastEmissionsRoutes());\n this.MostDistanceRouteString =\n RoutesArrayToString(routeStatsCalculator.getMostDistanceRoutes());\n this.LeastDistanceRouteString =\n RoutesArrayToString(routeStatsCalculator.getLeastDistanceRoutes());\n this.MostVisitedSourceAirportString =\n CombineAirportsToOneString(airportStatsCalculator.getMostVisitedSrcAirports());\n this.LeastVisitedSourceAirportString =\n CombineAirportsToOneString(airportStatsCalculator.getLeastVisitedSrcAirports());\n this.MostVisitedDestAirportString =\n CombineAirportsToOneString(airportStatsCalculator.getMostVisitedDestAirports());\n this.LeastVisitedDestAirportString =\n CombineAirportsToOneString(airportStatsCalculator.getLeastVisitedDestAirports());\n numOfTreesToString(generalStatsCalculator.getTreesToGrow());\n generalStatsCalculator.createCarbonEmissionsComment();\n }",
"@Before\n public void setup() {\n Helpers.fillData();\n }",
"@Override\n public void runTest() {\n }",
"void populateObjects(UnitTestDescriptor unitTestDescriptor) {\n if (!unitTestDescriptor.isExternalTcesEnabled()) {\n PipelineTask tpsPipelineTask = createPipelineTask(TPS_TASK_ID, TPS_INSTANCE_ID);\n tpsDbResults = DvMockUtils.mockTpsResult(dvJMockTest,\n tpsOperations, FluxType.SAP,\n unitTestDescriptor.getStartCadence(),\n unitTestDescriptor.getEndCadence(),\n tpsPipelineTask,\n unitTestDescriptor.getSkyGroupId(),\n unitTestDescriptor.getStartKeplerId(),\n unitTestDescriptor.getEndKeplerId(),\n unitTestDescriptor.getTargetsPerTable(),\n unitTestDescriptor.getPlanetaryCandidatesFilterParameters());\n keplerIds.clear();\n List<FsId> fsIdList = new ArrayList<FsId>(tpsDbResults.size());\n for (TpsDbResult tpsDbResult : tpsDbResults) {\n fsIdList.add(TpsFsIdFactory.getDeemphasizedNormalizationTimeSeriesId(\n TPS_INSTANCE_ID,\n tpsDbResult.getKeplerId(),\n tpsDbResult.getTrialTransitPulseInHours()));\n keplerIds.add(tpsDbResult.getKeplerId());\n }\n if (tpsDbResults.size() > 0) {\n producerTaskIds.add(TPS_TASK_ID);\n MockUtils.mockReadFloatTimeSeries(dvJMockTest, getFsClient(),\n unitTestDescriptor.getStartCadence(),\n unitTestDescriptor.getEndCadence(), TPS_TASK_ID,\n fsIdList.toArray(new FsId[fsIdList.size()]), false);\n }\n dvJMockTest.allowing(tpsCrud).retrieveLatestTpsRun(TpsType.TPS_FULL);\n dvJMockTest.will(returnValue(tpsPipelineTask.getPipelineInstance()));\n } else {\n externalTceModel = DvMockUtils.mockExternalTceModel(dvJMockTest,\n externalTceModelOperations,\n unitTestDescriptor.getStartCadence(),\n unitTestDescriptor.getEndCadence(),\n unitTestDescriptor.getSkyGroupId(),\n unitTestDescriptor.getStartKeplerId(),\n unitTestDescriptor.getEndKeplerId(),\n unitTestDescriptor.getTargetsPerTable(),\n unitTestDescriptor.getPlanetaryCandidatesFilterParameters());\n keplerIds.clear();\n for (ExternalTce tce : externalTceModel.getExternalTces()) {\n if (!keplerIds.contains(tce.getKeplerId())) {\n keplerIds.add(tce.getKeplerId());\n }\n }\n DvMockUtils.mockSkyGroupIdsForKeplerIds(dvJMockTest,\n celestialObjectOperations, keplerIds,\n unitTestDescriptor.getSkyGroupId());\n }\n celestialObjectParametersListByKeplerId = DvMockUtils.mockCelestialObjectParameterLists(\n dvJMockTest, celestialObjectOperations, keplerIds,\n unitTestDescriptor.getSkyGroupId(),\n unitTestDescriptor.getBoundedBoxWidth());\n targetTableLogs = DvMockUtils.mockTargetTables(dvJMockTest, targetCrud,\n TargetType.LONG_CADENCE, unitTestDescriptor.getStartCadence(),\n unitTestDescriptor.getEndCadence(),\n unitTestDescriptor.getTargetTableCount());\n cadenceTimes = MockUtils.mockCadenceTimes(dvJMockTest, mjdToCadence,\n CadenceType.LONG, unitTestDescriptor.getStartCadence(),\n unitTestDescriptor.getEndCadence(), true, false);\n quarters = new ArrayList<Integer>(targetTableLogs.size());\n for (int i = 0; i < targetTableLogs.size(); i++) {\n quarters.add(i + 1);\n }\n skyGroups = DvMockUtils.mockSkyGroups(dvJMockTest, kicCrud,\n unitTestDescriptor.getSkyGroupId());\n observedTargetsList = DvMockUtils.mockTargets(dvJMockTest, targetCrud,\n targetTableLogs, keplerIds, allTargetFsIds);\n\n ancillaryPipelineDataByTargetTableLog = DvMockUtils.mockAncillaryPipelineData(\n dvJMockTest, mjdToCadence, rollTimeOperations, ancillaryOperations,\n unitTestDescriptor.getAncillaryPipelineMnemonics(),\n targetTableLogs, quarters, ANCILLARY_TASK_ID);\n if (unitTestDescriptor.getAncillaryPipelineMnemonics().length > 0) {\n producerTaskIds.add(ANCILLARY_TASK_ID);\n }\n DvMockUtils.mockArgabrighteningIndices(dvJMockTest, fsClient,\n targetTableLogs, ARGABRIGHTENING_TASK_ID);\n producerTaskIds.add(ARGABRIGHTENING_TASK_ID);\n backgroundBlobFileSeriesList = DvMockUtils.mockBackgroundBlobFileSeries(\n dvJMockTest, blobOperations, targetTableLogs,\n BACKGROUND_BLOB_TASK_ID);\n if (backgroundBlobFileSeriesList.size() > 0) {\n producerTaskIds.add(BACKGROUND_BLOB_TASK_ID);\n }\n motionBlobFileSeriesList = DvMockUtils.mockMotionBlobFileSeries(\n dvJMockTest, blobOperations, targetTableLogs, MOTION_BLOB_TASK_ID);\n if (motionBlobFileSeriesList.size() > 0) {\n producerTaskIds.add(MOTION_BLOB_TASK_ID);\n }\n cbvBlobFileSeriesList = DvMockUtils.mockCbvBlobFileSeries(dvJMockTest,\n blobOperations, targetTableLogs, CBV_BLOB_TASK_ID);\n if (cbvBlobFileSeriesList.size() > 0) {\n producerTaskIds.add(CBV_BLOB_TASK_ID);\n }\n\n DvMockUtils.mockUkirtImages(dvJMockTest, blobOperations,\n AbstractDvPipelineModuleTest.MATLAB_WORKING_DIR, keplerIds);\n\n DvMockUtils.mockPlannedTargets(dvJMockTest, targetSelectionCrud,\n new HashSet<Integer>(keplerIds));\n }",
"@Test public void testWithExternalDataSet() throws IOException\n {\n final String homeDir = System.getProperty(\"user.home\");\n assumeNotNull(null != homeDir);\n final File inDir = new File(new File(homeDir), fixedDataSetDir);\n assumeTrue(inDir.isDirectory());\n final File outDir = new File(new File(homeDir), fixedDataSetOutDir);\n assertTrue(outDir.isDirectory());\n assertTrue(outDir.canWrite());\n // Ensure no old result files hanging around...\n final File basicResultFile = new File(outDir, ETVSimpleDriverNBulkInputs.OUTPUT_STATS_FILE_BASIC);\n basicResultFile.delete(); // Make sure no output file.\n assertFalse(\"output file should not yet exist\", basicResultFile.isFile());\n final File basicFilteredResultFile = new File(outDir, ETVSimpleDriverNBulkInputs.OUTPUT_STATS_FILE_FILTERED_BASIC);\n basicFilteredResultFile.delete(); // Make sure no output file.\n assertFalse(\"output filtered file should not yet exist\", basicFilteredResultFile.isFile());\n // Do the computation.\n ETVSimpleDriverNBulkInputs.doComputation(inDir, outDir);\n // Check results.\n assertTrue(\"output file should now exist\", basicResultFile.isFile());\n assertTrue(\"output filtered file should now exist\", basicFilteredResultFile.isFile());\n System.out.println(\"Written to \" + outDir);\n }",
"protected void TestProcess() {\n\t\tchangeCPUWDStatus(false);\n\t\twhile (testIsNotDoneStatus) {\n\t\t\tresetParams();\n\t\t\ttry {\n\t\t\t\tif (!startTrafficAndSample()) {\n\t\t\t\t\ttestIsNotDoneStatus = false;\n\t\t\t\t\tresetTestBol = false;\n\t\t\t\t\texceptionThrown = true;\n\t\t\t\t\tGeneralUtils.stopAllLevels();\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\treport.report(\"Stopping Parallel Commands From Java Exception\" + e.getMessage());\t\t\t\t\n\t\t\t\ttestIsNotDoneStatus = false;\n\t\t\t\tresetTestBol = false;\n\t\t\t\texceptionThrown = true;\n\t\t\t\treason = \"network connection Error\";\n\t\t\t\treport.report(e.getMessage() + \" caused Test to stop\", Reporter.FAIL);\n\t\t\t\te.printStackTrace();\n\t\t\t\tGeneralUtils.stopAllLevels();\n\t\t\t}\n\t\t\tif (resetTestBol) {\n\t\t\t\tnumberOfResets++;\n\t\t\t\tif (syncCommands != null) {\n\t\t\t\t\treport.report(\"Stopping Parallel Commands\");\n\t\t\t\t\tsyncCommands.stopCommands();\n\t\t\t\t}\n\t\t\t\tmakeThreadObjectFinish();\n\t\t\t\tif (syncCommands != null) {\n\t\t\t\t\treport.report(\"Commands File Path: \" + syncCommands.getFile());\n\t\t\t\t}\n\t\t\t\ttestIsNotDoneStatus = true;\n\t\t\t\t// stop level\n\t\t\t\ttry {\n\t\t\t\t\tif (syncCommands != null) {\n\t\t\t\t\t\tsyncCommands.moveFileToReporterAndAddLink();\n\t\t\t\t\t}\n\t\t\t\t\treport.report(\"Stopping Traffic\");\n\t\t\t\t\ttrafficSTC.stopTraffic();\n\t\t\t\t\ttrafficSTC.addResultFilesToReport(String.valueOf(numberOfResets));\n\t\t\t\t\treport.report(\"Resetting test\", Reporter.WARNING);\n\t\t\t\t\treason = \"reset Test because of stream halt\";\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\t\t}\n\n\t\tif (numberOfResets >= 3) {\n\t\t\t// using this flag in order to NOT print results.\n\t\t\ttestIsNotDoneStatus = false;\n\t\t\tprintResultsForTest = false;\n\t\t\treport.report(\"Test Was Reseted Too many times because of more then \" + PRECENT_OF_UE_RESET + \"%\"\n\t\t\t\t\t+ \" Of the Streams are in Halt - check Setup\", Reporter.FAIL);\n\t\t\treason = \"Test Was Restarted Too many Times due to Traffic halt\";\n\t\t}\n\t\ttry {\n\t\t\tif (syncCommands != null) {\n\t\t\t\tsyncCommands.stopCommands();\n\t\t\t}\n\t\t} catch (Exception e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\tmakeThreadObjectFinish();\n\t\ttry {\n\t\t\tif (syncCommands != null) {\n\t\t\t\tsyncCommands.moveFileToReporterAndAddLink();\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\treport.report(\"Exception in ReporterHelper.copyFileToReporterAndAddLink could not attach Command File\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\tchangeCPUWDStatus(true);\n\t}",
"public static void main(String[] args) throws Exception {\n DataSet houseVotes = DataParser.parseData(HouseVotes.filename, HouseVotes.columnNames, HouseVotes.dataTypes, HouseVotes.ignoreColumns, HouseVotes.classColumn, HouseVotes.discretizeColumns);\n DataSet breastCancer = DataParser.parseData(BreastCancer.filename, BreastCancer.columnNames, BreastCancer.dataTypes, BreastCancer.ignoreColumns, BreastCancer.classColumn, HouseVotes.discretizeColumns);\n DataSet glass = DataParser.parseData(Glass.filename, Glass.columnNames, Glass.dataTypes, Glass.ignoreColumns, Glass.classColumn, Glass.discretizeColumns);\n DataSet iris = DataParser.parseData(Iris.filename, Iris.columnNames, Iris.dataTypes, Iris.ignoreColumns, Iris.classColumn, Iris.discretizeColumns);\n DataSet soybean = DataParser.parseData(Soybean.filename, Soybean.columnNames, Soybean.dataTypes, Soybean.ignoreColumns, Soybean.classColumn, Soybean.discretizeColumns);\n \n /*\n * The contents of the DataSet are not always random.\n * You can shuffle them using Collections.shuffle()\n */\n \n Collections.shuffle(houseVotes);\n Collections.shuffle(breastCancer);\n Collections.shuffle(glass);\n Collections.shuffle(iris);\n Collections.shuffle(soybean);\n /*\n * Lastly, you want to split the data into a regular dataset and a testing set.\n * DataSet has a function for this, since it gets a little weird.\n * This grabs 10% of the data in the dataset and sets pulls it out to make the testing set.\n * This also means that the remaining 90% in DataSet can serve as our training set.\n */\n\n DataSet houseVotesTestingSet = houseVotes.getTestingSet(.1);\n DataSet breastCancerTestingSet = breastCancer.getTestingSet(.1);\n DataSet glassTestingSet = glass.getTestingSet(.1);\n DataSet irisTestingSet = iris.getTestingSet(.1);\n DataSet soybeanTestingSet = soybean.getTestingSet(.1);\n \n //KNN\n //House Votes\n System.out.println(HouseVotes.class.getSimpleName());\n KNN knn = new KNN(houseVotes, houseVotesTestingSet, HouseVotes.classColumn, 3);\n String[] knnHouseVotes = new String[houseVotesTestingSet.size()];\n for(int i = 0; i < houseVotesTestingSet.size(); i++) {\n knnHouseVotes[i] = knn.classify(houseVotesTestingSet.get(i));\n }\n for(int i = 0; i < houseVotesTestingSet.size(); i++) {\n if(knnHouseVotes[i].equals(houseVotesTestingSet.get(i)[HouseVotes.classColumn].value())) {\n System.out.println(\"KNN: Correct (\" + knnHouseVotes[i] + \")\");\n } else {\n System.out.println(\"KNN: Incorrect (\" + knnHouseVotes[i] + \", actually \" + houseVotesTestingSet.get(i)[HouseVotes.classColumn].value() + \")\");\n }\n }\n \n //Breast Cancer\n System.out.println(BreastCancer.class.getSimpleName());\n knn = new KNN(breastCancer, breastCancerTestingSet, BreastCancer.classColumn, 3);\n String[] knnBreastCancer = new String[breastCancerTestingSet.size()];\n for(int i = 0; i < breastCancerTestingSet.size(); i++) {\n knnBreastCancer[i] = knn.classify(breastCancerTestingSet.get(i));\n }\n for(int i = 0; i < breastCancerTestingSet.size(); i++) {\n if(knnBreastCancer[i].equals(breastCancerTestingSet.get(i)[BreastCancer.classColumn].value())) {\n System.out.println(\"KNN: Correct (\" + knnBreastCancer[i] + \")\");\n } else {\n System.out.println(\"KNN: Incorrect (\" + knnBreastCancer[i] + \", actually \" + breastCancerTestingSet.get(i)[BreastCancer.classColumn].value() + \")\");\n }\n }\n \n //Glass\n System.out.println(Glass.class.getSimpleName());\n knn = new KNN(glass, glassTestingSet, Glass.classColumn, 3);\n String[] knnGlass = new String[glassTestingSet.size()];\n for(int i = 0; i < glassTestingSet.size(); i++) {\n knnGlass[i] = knn.classify(glassTestingSet.get(i));\n }\n for(int i = 0; i < glassTestingSet.size(); i++) {\n if(knnGlass[i].equals(glassTestingSet.get(i)[Glass.classColumn].value())) {\n System.out.println(\"KNN: Correct (\" + knnGlass[i] + \")\");\n } else {\n System.out.println(\"KNN: Incorrect (\" + knnGlass[i] + \", actually \" + glassTestingSet.get(i)[Glass.classColumn].value() + \")\");\n }\n }\n \n //Iris\n System.out.println(Iris.class.getSimpleName());\n knn = new KNN(iris, irisTestingSet, Iris.classColumn, 3);\n String[] knnIris = new String[irisTestingSet.size()];\n for(int i = 0; i < irisTestingSet.size(); i++) {\n knnIris[i] = knn.classify(irisTestingSet.get(i));\n }\n for(int i = 0; i < irisTestingSet.size(); i++) {\n if(knnIris[i].equals(irisTestingSet.get(i)[Iris.classColumn].value())) {\n System.out.println(\"KNN: Correct (\" + knnIris[i] + \")\");\n } else {\n System.out.println(\"KNN: Incorrect (\" + knnIris[i] + \", actually \" + irisTestingSet.get(i)[Iris.classColumn].value() + \")\");\n }\n }\n \n //Soybean\n System.out.println(Soybean.class.getSimpleName());\n knn = new KNN(soybean, soybeanTestingSet, Soybean.classColumn, 3);\n String[] knnSoybean = new String[soybeanTestingSet.size()];\n for(int i = 0; i < soybeanTestingSet.size(); i++) {\n knnSoybean[i] = knn.classify(soybeanTestingSet.get(i));\n }\n for(int i = 0; i < soybeanTestingSet.size(); i++) {\n if(knnSoybean[i].equals(soybeanTestingSet.get(i)[Soybean.classColumn].value())) {\n System.out.println(\"KNN: Correct (\" + knnSoybean[i] + \")\");\n } else {\n System.out.println(\"KNN: Incorrect (\" + knnSoybean[i] + \", actually \" + soybeanTestingSet.get(i)[Soybean.classColumn].value() + \")\");\n }\n }\n \n \n /*\n * Lets setup ID3:\n * DataSet, TestSet, column with the class categorization. (republican, democrat in this case)\n */\n\n System.out.println(HouseVotes.class.getSimpleName());\n ID3 id3 = new ID3(houseVotes, houseVotesTestingSet, HouseVotes.classColumn);\n String[] id3HouseVotes = new String[houseVotesTestingSet.size()];\n for(int i = 0; i < houseVotesTestingSet.size(); i++) {\n id3HouseVotes[i] = id3.classify(houseVotesTestingSet.get(i));\n }\n for(int i = 0; i < houseVotesTestingSet.size(); i++) {\n if(id3HouseVotes[i].equals(houseVotesTestingSet.get(i)[HouseVotes.classColumn].value())) {\n System.out.println(\"ID3: Correct (\" + id3HouseVotes[i] + \")\");\n } else {\n System.out.println(\"ID3: Incorrect (\" + id3HouseVotes[i] + \", actually \" + houseVotesTestingSet.get(i)[HouseVotes.classColumn].value() + \")\");\n }\n }\n\n System.out.println(BreastCancer.class.getSimpleName());\n id3 = new ID3(breastCancer, breastCancerTestingSet, BreastCancer.classColumn);\n String[] id3BreastCancer = new String[breastCancerTestingSet.size()];\n for(int i = 0; i < breastCancerTestingSet.size(); i++) {\n id3BreastCancer[i] = id3.classify(breastCancerTestingSet.get(i));\n }\n for(int i = 0; i < breastCancerTestingSet.size(); i++) {\n if(id3BreastCancer[i].equals(breastCancerTestingSet.get(i)[BreastCancer.classColumn].value())) {\n System.out.println(\"ID3: Correct (\" + id3BreastCancer[i] + \")\");\n } else {\n System.out.println(\"ID3: Incorrect (\" + id3BreastCancer[i] + \", actually \" + breastCancerTestingSet.get(i)[BreastCancer.classColumn].value() + \")\");\n }\n }\n\n System.out.println(Glass.class.getSimpleName());\n id3 = new ID3(glass, glassTestingSet, Glass.classColumn);\n String[] id3Glass = new String[glassTestingSet.size()];\n for(int i = 0; i < glassTestingSet.size(); i++) {\n id3Glass[i] = id3.classify(glassTestingSet.get(i));\n }\n for(int i = 0; i < glassTestingSet.size(); i++) {\n if(id3Glass[i].equals(glassTestingSet.get(i)[Glass.classColumn].value())) {\n System.out.println(\"ID3: Correct (\" + id3Glass[i] + \")\");\n } else {\n System.out.println(\"ID3: Incorrect (\" + id3Glass[i] + \", actually \" + glassTestingSet.get(i)[Glass.classColumn].value() + \")\");\n }\n }\n\n System.out.println(Iris.class.getSimpleName());\n id3 = new ID3(iris, irisTestingSet, Iris.classColumn);\n String[] id3Iris = new String[irisTestingSet.size()];\n for(int i = 0; i < irisTestingSet.size(); i++) {\n id3Iris[i] = id3.classify(irisTestingSet.get(i));\n }\n for(int i = 0; i < irisTestingSet.size(); i++) {\n if(id3Iris[i].equals(irisTestingSet.get(i)[Iris.classColumn].value())) {\n System.out.println(\"ID3: Correct (\" + id3Iris[i] + \")\");\n } else {\n System.out.println(\"ID3: Incorrect (\" + id3Iris[i] + \", actually \" + irisTestingSet.get(i)[Iris.classColumn].value() + \")\");\n }\n }\n\n System.out.println(Soybean.class.getSimpleName());\n id3 = new ID3(soybean, soybeanTestingSet, Soybean.classColumn);\n String[] id3Soybean = new String[soybeanTestingSet.size()];\n for(int i = 0; i < soybeanTestingSet.size(); i++) {\n id3Soybean[i] = id3.classify(soybeanTestingSet.get(i));\n }\n for(int i = 0; i < soybeanTestingSet.size(); i++) {\n if(id3Soybean[i].equals(soybeanTestingSet.get(i)[Soybean.classColumn].value())) {\n System.out.println(\"ID3: Correct (\" + id3Soybean[i] + \")\");\n } else {\n System.out.println(\"ID3: Incorrect (\" + id3Soybean[i] + \", actually \" + soybeanTestingSet.get(i)[Soybean.classColumn].value() + \")\");\n }\n }\n }",
"private void inputHandle(String[] arguments) {\n\t\tif (arguments.length != 1)\n\t\t\tSystem.err.println(\"There needs to be one argument:\\n\"\n\t\t\t\t\t+ \"directory of training data set, and test file name.\");\n\t\telse {\t\t\t\n\t\t\tinputTestFile = arguments[0];\n\t\t}\n\t}",
"public static void main(String[] args) {\n\t\tTestingPerformanceCalculator obj= new TestingPerformanceCalculator(\"./data/gitInfoNew.txt\", \"data/Results/FinalResultSidTest1.txt\");\n\t\t//Read Gold set\n\t\tobj.goldStMap=obj.LoadGoldSet();\n\t\t//MiscUtility.showResult(10, obj.goldStMap);\n\t\t//Resd output file/ test result file\n\t\tobj.finalResult=obj.LoadTestingResult();\n\t\t//MiscUtility.showResult(20, obj.finalResult);\n\t\t\n\t\t\n\t\t//Create a ranked list\n\t\t//obj.produceRankedResult(10);\n\t\tArrayList<String> rankedFinalTestingResult=obj.produceRankedResult(10);\n\t\tContentWriter.writeContent(\"./data/testing1RankedResult.txt\", rankedFinalTestingResult);\n\t\t//call another class BLPerformanceCalc to compute\n\t\t\n\t\t\n\t}",
"static void initializeData() {\n\n if (timeLimitInHour != -1) {\n endTime = startTime + timeLimitInHour * 60 * 60 * 1000;\n }\n\n // Read the data file.\n data = new Data(dataFileName);\n\n // Build all variables.\n allVariable = data.buildAllVariable();\n\n // Read the target gene set.\n GeneSet geneSet = new GeneSet(allVariable, targetGeneSetFileName, minGeneSetSize, maxGeneSetSize, selectedCollections);\n listOfTargetGeneSets = geneSet.buildListOfGeneSets();\n\n // Read sample class labels.\n readSampleClass();\n\n // Initialize remaining fields.\n if (numberOfThreads == 0)\n numberOfThreads = getRuntime().availableProcessors();\n\n // Initialize BufferedWriter with preliminary info for log file.\n String fileInfo = \"EDDY OUTPUT FILE\\n\";\n fileInfo += (\"Data File: \" + dataFileName + \"\\n\");\n fileInfo += (\"Target Gene Set(s) File: \" + targetGeneSetFileName + \"\\n\");\n fileInfo += (\"Class Label File: \" + sampleClassInformationFileName + \"\\n\");\n fileInfo += (\"Number of Gene Sets: \" + listOfTargetGeneSets.size() + \"\\n\");\n fileInfo += (\"Number of Threads: \" + numberOfThreads + \"\\n\\n\");\n \n // log command line options, in verbatim \n fileInfo += concatStrings(commandLine) + \"\\n\\n\";\n \n fileInfo += (\"Name: \\tCollection: \\tSize: \\tURL: \\tJS Divergence: \\tP-Value: \\t#Permutations: \\tGenes: \\n\");\n try {\n \t// TODO: need to come up with a better way to assign the output file name.\n String fileName = targetGeneSetFileName.substring(0, targetGeneSetFileName.indexOf(\".gmt\")) + \"_output.txt\";\n \n File file = new File(fileName);\n \n output = new BufferedWriter(new FileWriter(file));\n output.write(fileInfo);\n } catch ( IOException e ) {\n e.printStackTrace();\n }\n\n }",
"@Test\n public void shouldProcessData() throws Exception {\n }",
"@Test\n public void run_main(){\n\n String resource_folder = (new File(\"src/test/resources/\")).getAbsolutePath()+ File.separator ;\n\n String[] args = new String[7];\n args[0] = \"-run\";\n args[1] = resource_folder + \"test_configs/line_ctm.xml\";\n args[2] = \"mytest\";\n args[3] = resource_folder+\"sample_output_request.xml\";\n args[4] = \"temp\";\n args[5] = \"0\";\n args[6] = \"100\";\n\n OTM.main(args);\n\n }",
"@Before\r\n\tpublic void setUp() { timeslots = new ArrayList<Timeslot>(); timetable = new Timetable(); System.setOut(new PrintStream(outContent)); }",
"void executionOver() {\n this.reporter = null;\n this.options = null;\n this.executorEngine = null;\n this.progressSuppressingEventHandler = null;\n this.outputService = null;\n this.buildActionMap = null;\n this.completedAndResetActions = null;\n this.lostDiscoveredInputsMap = null;\n this.actionCacheChecker = null;\n this.outputDirectoryHelper = null;\n }",
"public UnitTestData() throws Exception {\n String[] runsData = {\n \"1,1,A,1,No,No,4\", // 0 (a No before first yes Security Violation)\n \"2,1,A,1,No,No,2\", // 0 (a No before first yes Compilation Error)\n \"3,1,A,1,No,No,1\", // 20 (a No before first yes)\n \"4,1,A,3,Yes,No,0\", // 3 (first yes counts Minute points but never Run Penalty points)\n \"5,1,A,5,No,No,1\", // zero -- after Yes\n \"6,1,A,7,Yes,No,0\", // zero -- after Yes\n \"7,1,A,9,No,No,1\", // zero -- after Yes\n \"8,1,B,11,No,No,1\", // zero -- not solved\n \"9,2,A,48,No,No,4\", // 0 (a No before first yes Security Violation)\n \"10,2,A,50,Yes,No,0\", // 50 (minute points; no Run points on first Yes)\n \"11,2,B,35,No,No,1\", // zero -- not solved\n \"12,2,B,40,No,No,1\", // zero -- not solved\n };\n\n // Assign half eams random team member names\n addTeamMembers(contest, getTeamAccounts(contest).length / 2, 5);\n\n assertEquals(\"Expectig team member names\", 5, getFirstAccount(contest, Type.TEAM).getMemberNames().length);\n\n assertEquals(\"team count\", 120, contest.getAccounts(Type.TEAM).size());\n\n for (String runInfoLine : runsData) {\n SampleContest.addRunFromInfo(contest, runInfoLine);\n }\n\n Problem problem = contest.getProblems()[0];\n Account judge = getFirstAccount(contest, Type.JUDGE);\n generateClarifications(contest, 20, problem, judge.getClientId(), false, false);\n generateClarifications(contest, 20, problem, judge.getClientId(), true, false);\n generateClarifications(contest, 20, problem, judge.getClientId(), true, true);\n\n sampleContest.assignSampleGroups(contest, \"North Group\", \"South Group\");\n\n assertEquals(\"Runs\", 12, contest.getRuns().length);\n\n }",
"public static void UnitTests() {\n System.out.println(\"---\");\n\n int input = 0;\n boolean running = true;\n\n while(running) {\n System.out.println(\"1. Test Layer Class\\n2. Test NeuralNetwork Class\\n3. Go Back\\n\");\n input = getInput();\n switch (input) {\n case 1:\n UnitTests.testLayers();\n break;\n case 2:\n UnitTests.testNeuralNetwork();\n break;\n case 3:\n running = false;\n break;\n default:\n System.out.println(\"That's not an option.\");\n }\n }\n\n System.out.println(\"---\\n\");\n }",
"Test convert(TestData testData);",
"public static void main(String[] args) {\n final int t = SYS_IN.nextInt(); // total test cases\n SYS_IN.nextLine();\n for (int ti = 0; ti < t; ti++) {\n evaluateCase();\n }\n SYS_IN.close();\n }",
"void createdOutput(TestResult tr, Section section, String outputName);",
"@Test (dataProvider= \"My data provider\")\r\n\tpublic void TestCalcParamitarized(String in1,String Op, String in2,String Expec){ //.... 1- Parameterized test method -Define method input parameters-\r\n\t\tCalc(in1, Op, in2);\r\n\t\tassertResult(Expec);\t\t\r\n\t}",
"public TestInfo runTest() throws Exception {\n\t\tMap<List<Integer>, String[]> pathMap = getImplementation().getSymbolicExecutionCost(cfg);\n\t\t//begin with random testing\n\t\tList<Integer> path = getImplementation().randomTesting(cfg); //start with a random testing\n\t\tremoveVisitedNode(path);\n\t\ttestInfo.rm_number++;\n\t\ttestInfo.totalCost = testInfo.totalCost + path.size() - 1;\n\t\tPath inputSeed = new Path(path, 0);\n\t\t\n\t\tList<Path> workList = new ArrayList<>();\n\t\tworkList.add(inputSeed);\n\t\t\n\t\t//if there is unvisited nodes\n\t\twhile(!workList.isEmpty() && !unvisited.isEmpty()){\n\t\t\tPath input = workList.get(0);\n\t\t\tworkList.remove(0);\n\t\t\tList<Path> childInputs = expandExecution(input);\n\t\t\tif(!childInputs.isEmpty()){\n\t\t\t\tfor(int i = 0; i < childInputs.size(); i++){\n\t\t\t\t\tPath newInput = childInputs.get(i);\n\t\t\t\t\tList<Integer> newPath = newInput.path;\n\t\t\t\t\t\n\t\t\t\t\t//update the test information\n\t\t\t\t\tnewPath = getImplementation().symbolicExecution(cfg, testInfo, newPath);\n\t\t\t\t\ttestInfo.totalCost = testInfo.totalCost + newPath.size() - 1;\n\t\t\t\t\t\n\t\t\t\t\t//remove nodes are visited in this testcase\n\t\t\t\t\tremoveVisitedNode(newPath);\n\t\t\t\t\tnewInput.path = newPath;\n\t\t\t\t\t\n\t\t\t\t\tworkList.add(newInput);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\ttestInfo.coverageRatio = 1 - (double)unvisited.size() / node_number;\n\t\t//print the test information\n\t\treturn testInfo;\n\t}",
"public MLTableJobInput testData() {\n return this.testData;\n }",
"private void runTest(final Node me) {\n if (!initialized) {\n initStressTest();\n }\n\n List<Row> runs = engine.getSqlTemplate().query(selectControlSql);\n\n for (Row run : runs) {\n int runId = run.getInt(\"RUN_ID\");\n int payloadColumns = run.getInt(\"PAYLOAD_COLUMNS\");\n int initialSeedSize = run.getInt(\"INITIAL_SEED_SIZE\");\n long duration = run.getLong(\"DURATION_MINUTES\");\n\n String status = engine.getSqlTemplate().queryForString(selectStatusSql, runId, me.getNodeId());\n\n if (isMasterNode(me) && StringUtils.isBlank(status)) {\n initStressTestRowOutgoing(payloadColumns, runId, initialSeedSize);\n initStressTestRowIncoming(payloadColumns);\n long commitRows = run.getLong(\"SERVER_COMMIT_ROWS\");\n long sleepMs = run.getLong(\"SERVER_COMMIT_SLEEP_MS\");\n\n engine.getSqlTemplate().update(insertStatusSql, runId, me.getNodeId(), \"RUNNING\");\n for (Node client : engine.getNodeService().findTargetNodesFor(NodeGroupLinkAction.W)) {\n engine.getSqlTemplate().update(insertStatusSql, runId, client.getNodeId(), \"RUNNING\");\n }\n\n fillOutgoing(runId, duration, commitRows, sleepMs, payloadColumns);\n\n engine.getSqlTemplate().update(updateStatusSql, \"COMPLETE\", runId, me.getNodeId());\n\n } else if (!isMasterNode(me) && !StringUtils.isBlank(status) && status.equals(\"RUNNING\")) {\n long commitRows = run.getLong(\"CLIENT_COMMIT_ROWS\");\n long sleepMs = run.getLong(\"CLIENT_COMMIT_SLEEP_MS\");\n\n fillIncoming(runId, duration, commitRows, sleepMs, payloadColumns);\n\n engine.getSqlTemplate().update(updateStatusSql, \"COMPLETE\", runId, me.getNodeId());\n }\n }\n }",
"@Ignore\n @Test\n public void run_RL() {\n String configfile = \"C:\\\\Users\\\\gomes\\\\Desktop\\\\traffic_master\\\\n_Capstone_0426_9000.xml\";\n\n float duration = 3600f;\n float outdt = 300f;\n\n // Load ..............................\n api.OTM otm = null;\n\n try {\n otm = new api.OTM(configfile);\n\n// // Output requests .....................\n// List<Long> list_orig_link_ids = otm.scenario.get_link_ids();\n// otm.output.request_links_flow(null, list_orig_link_ids, outdt);\n// otm.output.request_links_veh(null, list_orig_link_ids, outdt);\n//\n// List<Long> ramp_ids = new ArrayList<>();\n// for(ActuatorInfo act_info : otm.scenario.get_actuators())\n// ramp_ids.add(act_info.target.getId());\n\n// ControllerCapacity controller = (ControllerCapacity) otm.scenario.get_actual_controller_with_id(1);\n\n // Qtable loop\n\n double[] sum_vehicles = new double[6];\n double[] sum_flow = new double[6];\n\n// for( int i=0 ; i<6 ; i++){\n//\n// // update control\n// for(Long ramp_id : ramp_ids) {\n// float rate_ramp = i*300f;\n// controller.set_rate_vph_for_actuator(ramp_id, rate_ramp);\n// }\n//\n// System.out.println(\"i=\" + i);\n//\n// otm.run(0,duration);\n//\n// // extract output .........................\n// sum_vehicles[i] = 0d;\n// sum_flow[i] = 0d;\n//\n// for(AbstractOutput output : otm.output.get_data()){\n//\n// if (output instanceof LinkFlow){\n//\n// for(Long link_id : list_orig_link_ids) {\n// Profile1D profile = ((LinkFlow) output).get_flow_profile_for_link_in_vph(link_id);\n// List<Double> values = profile.get_values();\n// // System.out.println(String.format(\"LinkFlow: id=%d num_values=%d\",link_id,values.size()));\n//\n// sum_flow[i] += values.stream().mapToDouble(x->x).sum();\n// }\n// }\n//\n//\n// if (output instanceof LinkVehicles) {\n// for(Long link_id : list_orig_link_ids) {\n// Profile1D profile = ((LinkVehicles) output).get_profile_for_linkid(link_id);\n// List<Double> values = profile.get_values();\n// // System.out.println(String.format(\"LinkVehicles: id=%d num_values=%d\",link_id,values.size()));\n//\n// sum_vehicles[i] += values.stream().mapToDouble(x->x).sum();\n// }\n// }\n//\n// }\n//\n// System.out.println(i + \"\\t\" + sum_flow[i] + \"\\t\" + sum_vehicles[i]);\n//\n// // do some Qtable calculation\n\n\n\n// }\n } catch (OTMException e) {\n e.printStackTrace();\n }\n\n }",
"public TestResult run() {\n TestResult result= createResult();\n run(result);\n return result;\n }",
"public void TestMain(){\n SampleStatements();\n TestMyPow();\n }",
"@Setup\n public void setup() {\n randomInput = new RandomComplexGenerator(inputLength).randomInputs();\n }",
"@Test //This is integration test\r\n\tpublic void testCalculatePrice01() throws Exception\r\n\t{\n\t\tImportInformation information = new ImportInformation();\r\n\t\tinformation.importMenu(\"Food_Data_Test1\");\r\n\t\tinformation.importUserInput();\t\r\n\t\tCalculation calcPrice = new Calculation();\r\n\t\tcalcPrice.calculatePrice(information.getMenu(),information.getUserInput());\r\n\t\t// compare the object itself and its side effects instead of String output, the string output can be done in main.\r\n\t\tArrayList<Food> exspectedFoodList = new ArrayList<Food>();\r\n\t\tArrayList<Combination> exspectedCombinationList = new ArrayList<Combination>();\r\n\t\tassertEquals(exspectedCombinationList, calcPrice.getResult());\r\n\t}",
"public void TrainDataset(){\n\t\ttry{\n\t\t\t//Testing delegate method\n\t\t\tMessageController.logToConsole(\"Hey, I'm from train button\");\n\t\t\t\n\t\t\t//Pass in the real training dataset\n\t\t\tfindSuitableK(new String[]{\"Hello\", \"World\"});\n\t\t\t\n\t\t\t//Pass in the 'k' and 'query string'\n\t\t\tfindKNN(2, \"anything\");\n\t\t}\n\t\tcatch(Exception ex){\n\t\t\tthrow ex;\n\t\t}\n\t\tfinally{\n\t\t\t\n\t\t}\n\t}",
"@Test\n public void test_read_input_and_sort() {\n\n }",
"public static void main(String[] args) {\n\t\tUtility utility = new Utility();\n\t\t\n\t\t// build trainingset\n\t\tSystem.out.println(\"Training System....\");\n\t\tArrayList<Student> trainingSet = utility.readStudentfile(\"porto_math_train.csv\");\n\t\tArrayList<Variable> variableSets = Student.getAllVar();\n\n\t\tTree tree = new Tree();\n\t\tNode decisionTree = tree.buildTree2(trainingSet, variableSets);\n\n\t\tutility .printNode(decisionTree);\n\n\t\t// testing DT\n\t\tSystem.out.println(\"\\tTesting System (trainingSet)....\");\n\t\tutility.testTree2(trainingSet, decisionTree);\n\t\t\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"\\tTesting System (testSet)....\");\n\t\tArrayList<Student> testSet = utility.readStudentfile(\"porto_math_test.csv\");\n\t\tutility.testTree2(testSet, decisionTree);\t\t\n\t}",
"public static void main(String[] args) throws IOException {\n\n\t\t\n\t\tdouble[] columnwise = {1.,2.,3.,4.,5.,6.,7.,8.,9.,10.,11.,12.};\n\t\tdouble[] condmat = {1.,3.,7.,9.};\n\t\tint[] matrixDimension = new int[10]; // dont except to ever use more than 4 cells. would by 99x99\n\n\tString[] inputARGNull = null ;\n\t\tArrayList<Integer> inputTestData = new ArrayList<>(Arrays.asList(11,2,3,6,11,18,45,88));\n\n//\t\tSystem.out.println();\n//\t\tSystem.out.println(inputTestData.toString());\n//\t\tSystem.out.println(\"Test Running Class: \" +this.getClass() ) ;\t\n//\t\tMatrix testRunMatrix = new Matrix(2, 3, inputTestData );\n\n\t\tMatrix testRunMatrix = new Matrix();\n\t\ttestRunMatrix.setName(\"testRunMatrix\");\n\t\ttestRunMatrix.displayCompact();\n//\t\tclearScreen();\n\n\t\tMatrix firstRunMatrixParams = new Matrix(3,3, inputTestData);\n\t\tfirstRunMatrixParams.setName(\"firstRunMatrixParams\");\n\t\tfirstRunMatrixParams.displayCompact();\n//\t\tclearScreen();\n\t\t\n\t\tMatrix secondRunMatrixParams = new Matrix(3,3, columnwise); // or condmat\n\t\tsecondRunMatrixParams.setName(\"secondRunMatrixParams\");\n\t\tsecondRunMatrixParams.displayCompact();\n//\t\tclearScreen();\n\t\t\n\t//\tfirstRunMatrixParams.displayDeepString();\n\t//\tsecondRunMatrixParams.displayDeepString();\n\t\tmatrixDimension[0]=2;\n\t\tmatrixDimension[1]=3;\n\t\n\t\tMatrix outOfSeqTestMatrix = new Matrix(matrixDimension, columnwise);\n\t\tsecondRunMatrixParams.setName(\"outOfSeqTestMatrix\");\n\t\tsecondRunMatrixParams.displayCompact();\n\t\t\n\t\tMatrix addResult = firstRunMatrixParams.Add(secondRunMatrixParams);\n\t\taddResult.setName(\"addResult\");\n\t\t\n\t\taddResult.displayCompact();\n//\t\tclearScreen();\n\t\t\n//\t\taddResult = addResult.Multiply((22/7));\n\t\taddResult = addResult.Multiply(3.623);\n\t\taddResult.displayMore();\n\t\t\n\t\t\n\t\tString[] testInput1 = new String[]{\"-c\",\"5x4\",\"12\", \"32\", \"43\", \"44\", \"5\",\"5\",\"5\",\"4\",\"4\",\".999999999\",\"0\",\"0\",\"0\",\"9\",\"4\",\"2.71826\",\"3.14159\",\"33\",\"11\",\"0.1136\",\"888\",\"7\",\"6\",\"5\"};\n\t\tInputStringObj myTestCase = new InputStringObj(\"-c\", testInput1);\n\t\tInputNumericObj myNumTest = new InputNumericObj(myTestCase);\n\t\t\n\t\tSystem.out.println(\"And Now a Matrix from a Numeric Object\");\n\n\t\tMatrix numObjBasedMatrix = new Matrix(myNumTest,\"TestMatrix.java_string\");\n\t\tnumObjBasedMatrix.setName(\"numObjBasedMatrix\");\n\t\tnumObjBasedMatrix.displayCompact();\n\tSystem.out.println(\"\");\n\tSystem.out.println(\"\");\n\t\tnumObjBasedMatrix.displayMore();\n\t\t\n\t\t\n//\t\tclearScreen();\n\t\t\n\t}",
"public void setUpTestdata() {\n\t\tsetDefaultUserName(Config.getProperty(\"defaultUserName\"));\r\n\t\tsetDefaultPassword(Config.getProperty(\"defaultPassword\"));\r\n\t\tsetTestsiteurl(Config.getProperty(\"testsiteurl\"));\r\n\t\tsetChromeDriverPath(Config.getProperty(\"chromeDriverPath\"));\r\n\t\tsetGeckoDriverPath(Config.getProperty(\"geckoDriverPath\"));\r\n\t\tsetIeDriverPath(Config.getProperty(\"ieDriverPath\"));\r\n\t}",
"public void generateOutputData() {\n\t\tArrayList<String> inputDataArray = new ArrayList<String>();\n\t\tif (removeDuplicates) {\n\t\t\tinputDataArray = removeDuplicates();\n\t\t} else {\n\t\t\tinputDataArray = inputDataValues;\n\t\t}\n\t\t\n\t\toutputDataValues.clear();\n\t\tString outputDataValue = \"\";\n\t\tif (inputDataArray.isEmpty()) {\n\t\t\toutputDataValue = getOutputDataValue(\"\");\n\t\t\toutputDataValues.add(outputDataValue);\n\t\t} else {\n\t\t\tfor (String inputDataValue: inputDataArray) {\n\t\t\t\toutputDataValue = getOutputDataValue(inputDataValue);\n\t\t\t\toutputDataValues.add(outputDataValue);\n\t\t\t}\n\t\t}\n\t}",
"private ArrayList<Record> test() {\n\t\t\t\tfor (int i = 0; i < numberOfIterations; i++) {\n\t\t\t\t\t// for each training record\n\t\t\t\t\tfor (int j = 0; j < numberOfRecords; j++) {\n\t\t\t\t\t\t// calculate inputs and outputs\n\t\t\t\t\t\tforwardCalculation(records.get(j).input);\n\t\t\t\t\t}\n\t\t\t\t}\n//\t\t\t\tpostprocessOutputs();\n\t\t// forward pass\n\t\t// back pass\n\t\treturn records;\n\t}",
"public List<Object[]> gatherData() {\n String testDir = System.getProperty(\"test.dir\");\n logger.info(\"Data from: \" + testDir);\n String testFilter = System.getProperty(\"test.filter\");\n List<Object[]> result = new ArrayList<Object[]>();\n File testDirFile = new File(testDir);\n File rootConfigFile = new File(testDirFile, \"config.properties\");\n Properties rootProp = new Properties();\n InputStream rootIn = null;\n try {\n rootIn = new FileInputStream(rootConfigFile);\n rootProp.load(rootIn);\n } catch (IOException e) {\n // if we can't get root properties, we just take empty root\n // properties\n rootProp = new Properties();\n } finally {\n IOUtils.closeQuietly(rootIn);\n }\n\n File[] childFiles = null;\n if (testFilter == null) {\n childFiles = testDirFile.listFiles();\n } else {\n String[] wildcards = testFilter.split(\";\");\n childFiles = testDirFile\n .listFiles((FilenameFilter) new WildcardFileFilter(\n wildcards));\n }\n int idx = 0;\n for (File child : childFiles) {\n if (child.isDirectory() && directoryContainsConfig(child)) {\n File configFile = new File(child, \"config.properties\");\n Properties prop = new Properties();\n InputStream in = null;\n try {\n in = new FileInputStream(configFile);\n prop.load(in);\n \n String parent = prop.getProperty(PARENT_CFG);\n if(parent != null) {\n \tFile parentFile = new File(child, parent);\n \tif(parentFile.exists()) {\n \t\tprop.clear();\n \t\tprop.load(new FileInputStream(parentFile));\n \t\tprop.load(new FileInputStream(configFile));\n \t}\n }\n \n if (isSupportedTestType(prop)) {\n Object[] data = extractDataFromConfig(configFile,\n rootProp, prop);\n result.add(data);\n String testName = idx + \"-\" + data[1].toString();\n ((BaseSignatureTestData)data[2]).setUniqueUnitTestName(testName);\n idx++;\n }\n } catch (IOException e) {\n logger.warn(\n \"Could not run test with config:\"\n + configFile.getAbsolutePath(), e);\n } finally {\n if (in != null)\n IOUtils.closeQuietly(in);\n }\n }\n }\n return result;\n }",
"@Test\n public void MyTest() {\n System.out.println(\"Parameterized Number is : \" + inputNumber);\n System.out.println(\"Expected Result is : \" + expectedResult);\n }",
"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 runAllTheTests() {\n\t\ttestConstructorAndGetters();\n\t}",
"public static void runAllTheTests() {\n\t\ttestConstructorAndGetters();\n\t}",
"@Test\r\n public void testDataBuilder_Init(){\r\n \tdataBuild.initAllData();\r\n \tassertTrue(dataBuild.getCPUList().size() > 0);\r\n \tSystem.out.println(\"Total # of CPUs: \" + dataBuild.getCPUList().size());\r\n \tassertTrue(dataBuild.getGPUList().size() > 0);\r\n \tSystem.out.println(\"Total # of GPUs: \" + dataBuild.getGPUList().size());\r\n \tassertTrue(dataBuild.getMBList().size() > 0);\r\n \tSystem.out.println(\"Total # of Motherboards: \" + dataBuild.getMBList().size());\r\n \tassertTrue(dataBuild.getMEMList().size() > 0);\r\n \tSystem.out.println(\"Total # of Memory Units: \" + dataBuild.getMEMList().size());\r\n \tassertTrue(dataBuild.getPSUList().size() > 0);\r\n \tSystem.out.println(\"Total # of PSUs: \" + dataBuild.getPSUList().size());\r\n \tassertTrue(dataBuild.getDISKList().size() > 0);\r\n \tSystem.out.println(\"Total # of Disks: \" + dataBuild.getDISKList().size());\r\n }",
"public static void main(String[] args) {\n\n\n for (int i = 0; i < 3; i++) {\n System.out.println(\"\\n********* TEST \" + (i+1) + \" *********\");\n experimentOne(false);\n experimentOne(true);\n\n experimentTwo(false);\n experimentTwo(true);\n\n experimentThree(false);\n experimentThree(true);\n }\n }",
"public static void main(String[] args){\n //Variables\n Scanner scnr = new Scanner(System.in);\n //Custom test case\n if(scnr.hasNext()){\n String testInput = \"\";\n while(scnr.hasNext()){\n testInput = scnr.nextLine();\n System.out.println(testInput + \" : \" + evaluate(testInput));\n }\n }\n //Default test case\n else{\n String [] sampletests = {\"(1+(2*3))\", \"(2*(4*(6/3)))\",\"(3+(4*2))\"};\n double [] sampleoutput = {7.0, 16.0, 11.0};\n for(int i = 0; i < sampletests.length; i++){\n if(evaluate(sampletests[i]) != sampleoutput[i]){\n System.out.println(\"Failed sample tests\");\n return;\n }\n }\n System.out.println(\"Passed sample tests\");\n }\n }",
"public void testRead_Insert() throws Exception {\n\n\t\tfinal boolean DEBUG = true;\n\n\t\t//DataGenerator dg = new DataGenerator();\n\t\t\n\t\tif (DEBUG) System.out.println(\"Inside testReadFile()...\");\n\n\t\t//ER\n \t\tdg.buildDataFile(maxrecs,inFile1,newFile1);\n \t\tdataarr1=dg.ReadFile(maxrecs,newFile1);\n\t\t\n\t\tif (DEBUG){\n\t\t\tfor (int row=0; row<dataarr1.length; row++) {\n\t\t\t\tSystem.out.println(\"\\t\\t\\tER: \" + dataarr1[row]);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//PR\n \t\tdg.buildDataFile(maxrecs,inFile2,newFile2);\n \t\tdataarr2=dg.ReadFile(maxrecs,newFile2);\n\t\t\n\t\tif (DEBUG){\n\t\t\tfor (int row=0; row<dataarr2.length; row++) {\n\t\t\t\tSystem.out.println(\"\\t\\t\\tPR: \" + dataarr2[row]);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//HER2status\n \t\tdg.buildDataFile(maxrecs,inFile3,newFile3);\n \t\tdataarr3=dg.ReadFile(maxrecs,newFile3);\n\t\t\n\t\tif (DEBUG){\n\t\t\tfor (int row=0; row<dataarr3.length; row++) {\n\t\t\t\tSystem.out.println(\"\\t\\t\\tHER2status: \" + dataarr3[row]);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//HER2testtype\n \t\tdg.buildDataFile(maxrecs,inFile4,newFile4);\n \t\tdataarr4=dg.ReadFile(maxrecs,newFile4);\n\t\t\n\t\tif (DEBUG){\n\t\t\tfor (int row=0; row<dataarr4.length; row++) {\n\t\t\t\tSystem.out.println(\"\\t\\t\\tHER2testtype: \" + dataarr4[row]);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//EGFRstatus\n \t\tdg.buildDataFile(maxrecs,inFile5,newFile5);\n \t\tdataarr5=dg.ReadFile(maxrecs,newFile5);\n\t\t\n\t\tif (DEBUG){\n\t\t\tfor (int row=0; row<dataarr5.length; row++) {\n\t\t\t\tSystem.out.println(\"\\t\\t\\tEGFRstatus: \" + dataarr5[row]);\n\t\t\t}\n\t\t}\n\t\t\n\t\tdg.buildBreastCancerBiomarkers(maxrecs,dataarr1,dataarr2,dataarr3,dataarr4,dataarr5);\n\t\t\n\t\tif (DEBUG) System.out.println(\"\\tEnd Of testReadFile...\");\n\t\t\n\t}",
"@BeforeAll\n\tstatic void beforeAll() {\n\t\tinOut = new InOutMimic();\n\t}",
"@Test\n public void run () {\n\t \n\t System.out.println(\"---------->\");\n\t //System.out.println(md5list.getResult());\n\t //System.out.println(hashsearch.getResult());\n\t \n\t \n\t \n\t // System.out.println(samples.Testing());\n\t //System.out.println(\"getserult: \"+samples.getResult());\n\t \n }",
"@BeforeAll\n public static void oneTimeSetUp() {\n\n frontend.ctrlClear();\n\n String camName1 = \"Vale das Mos\";\n String camName2 = \"Alcobaca\";\n String id1 = \"12DL12\";\n String id2 = \"12AR12\";\n String id3 = \"151212\";\n String id4 = \"1512345\";\n String date1 = \"1999-03-12 12:12:12\";\n String date2 = \"2020-03-12 12:12:12\";\n String date3 = \"2015-09-12 12:12:12\";\n String date4 = \"2010-09-12 12:12:12\";\n\n\n frontend.camJoin(camName1, 13.3, 51.2);\n frontend.camJoin(camName2, 15.3, 53.2);\n\n List<List<String>> observations1 = new ArrayList<>();\n List<List<String>> observations2 = new ArrayList<>();\n List<List<String>> observations3 = new ArrayList<>();\n List<List<String>> observations4 = new ArrayList<>();\n\n\n List<String> observationMessage1 = new ArrayList<>();\n observationMessage1.add(\"CAR\");\n observationMessage1.add(id1);\n observationMessage1.add(date1);\n\n List<String> observationMessage2 = new ArrayList<>();\n observationMessage2.add(\"CAR\");\n observationMessage2.add(id2);\n observationMessage2.add(date2);\n\n List<String> observationMessage3 = new ArrayList<>();\n observationMessage3.add(\"PERSON\");\n observationMessage3.add(id3);\n observationMessage3.add(date3);\n\n List<String> observationMessage4 = new ArrayList<>();\n observationMessage4.add(\"PERSON\");\n observationMessage4.add(id4);\n observationMessage4.add(date4);\n\n\n observations1.add(observationMessage1);\n observations2.add(observationMessage2);\n observations3.add(observationMessage3);\n observations4.add(observationMessage4);\n\n frontend.reportObs(camName1, observations1);\n frontend.reportObs(camName2, observations2);\n frontend.reportObs(camName1, observations3);\n frontend.reportObs(camName2, observations4);\n }",
"public static void run() {\n testAlgorithmOptimality();\n// BenchmarkGraphSets.testMapLoading();\n //testAgainstReferenceAlgorithm();\n //countTautPaths();\n// other();\n// testLOSScan();\n //testRPSScan();\n }",
"private static void processEachTestCase(InputFormat input) {\n for (InputFormat.PileOfFlut pileOfFluts : input.getPileOfFluts()) {\n processEachLine(pileOfFluts);\n }\n\n }",
"void setInput(com.indosat.eai.catalist.standardInputOutput.DummyInputType input);",
"public void persistAllTestResult(String env);",
"public void main(String args[]) throws IOException{\n\t\tMetricData metric = new MetricData();\n\t\tMethodData method = new MethodData();\n\t\tFanOutTest fot = new FanOutTest();\n\t\t\n\t\tUtility.Test();\n\t\t\n\t\tfot.start();\n\t\t\n\t\tFileData fileData = new FileData();\n\t\t\n\t\tmetric.getName();\n\t\tmetric.getValue();\n\t\t\n\t}",
"public TestCase(TestBattery battery, TestProcedure testProcedure,\r\n\t\t\tLinkedList<Input> inputs, Output expectedOutput) {\r\n\t\tsetTestProcedure(testProcedure);\r\n\t\tsetInputs(inputs);\r\n\t\tsetExpectedOutput(expectedOutput);\t\t\r\n\t}",
"private void setUp() {\r\n\tvariables = new Vector();\r\n\tstatements = new Vector();\r\n\tconstraints = new Vector();\r\n\tvariableGenerator = new SimpleVariableGenerator(\"v_\");\r\n }",
"public void selfTest() {\n \n \n \n /**\n * TESTING CONFIGURATION RIGHT HERE:\n */\n int total = 1; //How many tests should we run\n int start = 0; //The first test to run\n //TestStubs.storePrints(); //store prints until the end\n TestStubs.displayDebugWhileTesting(false); //shows all the debug prints (with context switches) if set to true\n \n \n //MemoryMap.selfTest();\n //Swap.selfTest();\n \n UserProcess.testing = true;\n TestStubs.debugPrint(\"SELF TESTING VMKERNEL!\");\n \n int passed = 0;\n \n for (int i = 0; i < total; i++) {\n if (runTest(i+start))\n passed += 1;\n }\n \n if (passed != total) {\n TestStubs.debugPrint(\"SOME TESTS FAILED! \" + passed + \"/\" + total + \" passed.\");\n } else {\n TestStubs.debugPrint(\"ALL TESTS PASSED! \" + passed + \"/\" + total + \" passed.\");\n }\n \n UserProcess.testing = false;\n \n\n \n //System.out.println(TestStubs.getStoredPrints());\n //TestStubs.clearAndDontStorePrints();\n \n if (passed != total) {\n System.out.flush();\n /// kernel.terminate();\n }\n \n TestStubs.disable();\n \n }",
"@BeforeClass\r\n\tpublic static void setupTestData() throws IOException {\r\n\r\n\t\tfinal FileOutputStream fos = new FileOutputStream(TESTFILE);\r\n\t\tbyte[] testsequence = new byte[BUFFERSIZE];\r\n\t\tfor (int i=0xF0; i<0xFA; i++) {\r\n\t\t\tArrays.fill(testsequence, (byte)i);\r\n\t\t\tfos.write(testsequence);\r\n\t\t}\r\n\t\tfos.close();\r\n\t}",
"@Test\n public void testRun_Complex_Execution() {\n // TODO: TBD - Exactly as done in Javascript\n }",
"public void testParFileReading() {\n GUIManager oManager = null;\n String sFileName = null;\n try {\n\n oManager = new GUIManager(null);\n \n //Valid file 1\n oManager.clearCurrentData();\n sFileName = writeFile1();\n oManager.inputXMLParameterFile(sFileName);\n SeedPredationBehaviors oPredBeh = oManager.getSeedPredationBehaviors();\n ArrayList<Behavior> p_oBehs = oPredBeh.getBehaviorByParameterFileTag(\"DensDepRodentSeedPredation\");\n assertEquals(1, p_oBehs.size());\n DensDepRodentSeedPredation oPred = (DensDepRodentSeedPredation) p_oBehs.get(0);\n double SMALL_VAL = 0.00001;\n \n assertEquals(oPred.m_fDensDepDensDepCoeff.getValue(), 0.07, SMALL_VAL);\n assertEquals(oPred.m_fDensDepFuncRespExpA.getValue(), 0.02, SMALL_VAL);\n\n assertEquals( ( (Float) oPred.mp_fDensDepFuncRespSlope.getValue().get(0)).\n floatValue(), 0.9, SMALL_VAL);\n assertEquals( ( (Float) oPred.mp_fDensDepFuncRespSlope.getValue().get(1)).\n floatValue(), 0.05, SMALL_VAL);\n\n //Test grid setup\n assertEquals(1, oPred.getNumberOfGrids());\n Grid oGrid = oManager.getGridByName(\"Rodent Lambda\");\n assertEquals(1, oGrid.getDataMembers().length);\n assertTrue(-1 < oGrid.getFloatCode(\"rodent_lambda\")); \n \n }\n catch (ModelException oErr) {\n fail(\"Seed predation validation failed with message \" + oErr.getMessage());\n }\n catch (java.io.IOException oE) {\n fail(\"Caught IOException. Message: \" + oE.getMessage());\n }\n finally {\n new File(sFileName).delete();\n }\n }",
"@Test\n\tpublic void testMain() {\n\t\t// TODO: test output streams for various IO methods, emulating a user's\n\t\t// input - kinda like Joel did for CSSE2310\n\t\tAssert.fail();\n\t}",
"public static void main (String[] args){\n\t\tincPieceCountTest();\n\t\tdecPieceCountTest();\n\t\tsetPieceTest();\n\t\tmoveTest();\n\t\tanyMoveTest();\n\t\tgetPiecesTest();\n\t\tsetPieceTest2();\n\t}",
"@Test\n public void testWriteThenRead() {\n PipelineResult writeResult = runWrite();\n writeResult.waitUntilFinish();\n PipelineResult readResult = runRead();\n readResult.waitUntilFinish();\n gatherAndPublishMetrics(writeResult, readResult);\n }",
"Test update(TestData testData, Test test);",
"public void setInputData(String[] inputData) {\r\n // separate input into command and parameters\r\n String command = inputData[0];\r\n String[] parameters = Arrays.copyOfRange(inputData, 1, inputData.length);\r\n this.command = command;\r\n this.parameters = parameters;\r\n }",
"public void trainData() throws IOException {\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\ttestingFold = i;\n\n\t\t\tif (testingFold == writingFold) {\n\t\t\t\tlogger.append(\"Training Tree-Augmented Naive Bayes for writing Fold\");\n\t\t\t}\n\n\t\t\tif (testingFold == writingFold) {\n\t\t\t\tlogger.append(\"Calculating Class Priors across Data set.\\n\");\n\t\t\t}\n\t\t\tbuildPriors();\n\n\t\t\tif (testingFold == writingFold) {\n\t\t\t\tlogger.append(\"Priors built.\\n Discretizing data into Naive Bin Estimator...\\n\" +\n\t\t\t\t\t\t\"Generating Completed Graph...\\nWeighting Edges...\\n\");\n\t\t\t}\n\t\t\tdiscretizeData();\n\t\t\ttest();\n\t\t}\n\n\t}",
"public void setup() {\n }",
"@Test\n public void Day5BExample2() {\n intCodeProcessorService = new IntCodeProcessorService(\"data/day05/example2.txt\");\n\n final Integer[][] testVectors = {\n {-2, 999}, // output 999 if the input value is below 8,\n {7, 999}, // output 999 if the input value is below 8,\n {8, 1000}, // output 1000 if the input value is equal to 8, or\n {9, 1001}, // output 1001 if the input value is greater than 8.\n {9999, 1001} // output 1001 if the input value is greater than 8.\n };\n\n for (Integer[] testVector : testVectors) {\n intCodeProcessorService.reset();\n intCodeProcessorService.setCpuInputValue(testVector[0].longValue());\n intCodeProcessorService.runToCompletion();\n int result = intCodeProcessorService.getProgramOutput().intValue();\n Assert.assertEquals(testVector[1].intValue(), result);\n }\n }",
"@Test\n public void testSetValue() throws Exception {\n\n Map<String, IMetaData<SampleMark>> name2MetaData;\n name2MetaData = factory.class2MetaDataByFullPath(Person.class);\n\n for (Person p : persons) {\n\n float weight = SampleDataGenerator.getSampleWeight(random, p.weight);\n int age = p.getAge();\n String lastName = p.getLastname();\n\n IMetaData<SampleMark> metaData =\n name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Person|weight\");\n metaData.setValue(p, weight);\n Person.assertPerson(p, lastName, weight, age);\n }\n\n for (Person p : persons) {\n\n float weight = p.weight;\n int age = p.getAge();\n String lastName =\n SampleDataGenerator.getSampleLastName(random, p.getLastname());\n IMetaData<SampleMark> metaData =\n name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Person|lastname\");\n metaData.setValue(p, lastName);\n Person.assertPerson(p, lastName, weight, age);\n }\n\n name2MetaData = factory.class2MetaDataByFullPath(Car.class);\n for (Car c : cars) {\n\n Driver driver = c.getDriver();\n String lastName = driver.getLastname();\n float weight = SampleDataGenerator.getSampleWeight(random, driver.weight);\n int age = driver.getAge();\n boolean hasDrivingLicense = driver.hasDrivingLicense;\n\n Engine engine = c.getEngine();\n String productName =\n SampleDataGenerator.getSampleProductName(random, engine.productName);\n\n Oil oil = engine.oil;\n String producentName = oil.producentName;\n String vendorName = oil.vendorName;\n\n IMetaData<SampleMark> metaData =\n name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|driver|weight\");\n\n metaData.setValue(c, weight);\n\n metaData =\n name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|engine|productName\");\n\n metaData.setValue(c, productName);\n\n Driver.assertDriver(driver, lastName, weight, age,\n hasDrivingLicense);\n\n Engine.assertEngine(engine, productName);\n\n Oil.assertOil(oil, vendorName, producentName);\n\n }\n\n }",
"protected TestBench() {}",
"private static void testgen(String[] args) {\n JSONParser parser = new JSONParser();\n TestgenOptions options = parseTestgenOptions(args);\n CLI.setVerbosity(options);\n if (options.numTasks < 1) {\n API.throwCLIError(\"Invalid number of tasks provided (-n): \" + options.numTasks);\n }\n\n Map<String, Object> objects;\n if (!options.inFile.isEmpty()) {\n objects = parser.parse(options.inFile, true);\n } else if (!options.inString.isEmpty()) {\n objects = parser.parse(options.inString, false);\n } else {\n API.throwCLIError(\"No input JSON provided (-i)\");\n return;\n }\n\n if (objects.get(\"initialState\") == null || objects.get(\"goalState\") == null) {\n API.throwCLIError(\"Both an initial state and a goal state must be provided.\");\n }\n\n TestCaseGenerator generator = new TestCaseGenerator(\n (SystemState) objects.get(\"initialState\"),\n (GoalState) objects.get(\"goalState\"),\n options.numTasks,\n options.optimalPlan,\n options.output\n );\n\n ArrayList<Task> tasks = generator.generateTestCase();\n ArrayList<Optimization> ops = generator.generateOptimizations();\n try{\n generator.testCaseToJSON(tasks, ops, options.perturbations);\n } catch (IOException e){\n API.throwCLIError(\"Failed to write testCase to JSON\");\n }\n\n }",
"protected void setUp() {\r\n File cleanDir = new File(this.clean);\r\n dest = new File(root + \"\\\\field\");\r\n if (!dest.exists()) {\r\n dest.mkdirs();\r\n }\r\n\r\n (new FileCopy(\r\n new File(cleanDir, \"field_RenameFieldTest.java\"),\r\n new File(dest, \"RenameFieldTest.java\"),\r\n false)).run();\r\n (new FileCopy(\r\n new File(cleanDir, \"field_UsesFieldTest.java\"),\r\n new File(dest, \"UsesFieldTest.java\"),\r\n false)).run();\r\n (new FileCopy(\r\n new File(cleanDir, \"field_InheritFieldTest.java\"),\r\n new File(dest, \"InheritFieldTest.java\"),\r\n false)).run();\r\n (new FileCopy(\r\n new File(cleanDir, \"XDateChooser.java\"),\r\n new File(root + \"\\\\XDateChooser.java\"),\r\n false)).run();\r\n\r\n (new SummaryTraversal(root)).run();\r\n }",
"public void testData(String inputFile, String outputFile) throws IOException {\n\t\tScanner inFile = new Scanner(new File(inputFile));\n\t\tPrintWriter outfile = new PrintWriter(new FileWriter(outputFile));\n\n\t\tint numberOfRecords = inFile.nextInt();\n\n\t\t// for each record\n\t\tfor (int i = 0; i < numberOfRecords; i++) {\n\t\t\tdouble[] input = new double[numberOfInputs];\n\n\t\t\t// read input from input file\n\t\t\tfor (int j = 0; j < numberOfInputs; j++) {\n\t\t\t\tinput[j] = inFile.nextDouble();\n\t\t\t}\n\n\t\t\t// find output using the neural net\n\t\t\tArrayList<Record> testRecords = test();\n\n\t\t\tfor (int j = 0; j < numberOfOutputs; j++) {\n\t\t\t\toutfile.print(testRecords.get(i).output[j] + \" \");\n\t\t\t}\n\t\t\toutfile.println();\n\t\t}\n\t\tinFile.close();\n\t\toutfile.close();\n\t}",
"protected void setUp() throws Exception {\n String workingDir = getWorkDirPath();\n new File(workingDir).mkdirs();\n File outputFile = new File(workingDir + \"/output.txt\");\n outputFile.createNewFile();\n File errorFile = new File(workingDir + \"/error.txt\");\n errorFile.createNewFile();\n PrintWriter outputWriter = new PrintWriter(new FileWriter(outputFile));\n PrintWriter errorWriter = new PrintWriter(new FileWriter(errorFile));\n org.netbeans.jemmy.JemmyProperties.setCurrentOutput(new org.netbeans.jemmy.TestOut(System.in, outputWriter, errorWriter));\n }",
"@BeforeClass\n\tpublic static void setup() {\n\t\tdataMunger = new DataMunger();\n\n\t}",
"@Test //This is integration test\r\n\tpublic void testCalculatePrice02() throws Exception\r\n\t{\n\t\tImportInformation information = new ImportInformation();\r\n\t\tinformation.importMenu(\"Food_Data_Test1\");\r\n\t\tinformation.importUserInput();\t\r\n\t\tCalculation calcPrice = new Calculation();\r\n\t\tcalcPrice.calculatePrice(information.getMenu(),information.getUserInput());\r\n\t\t// compare the object itself and its side effects instead of String output, the string output can be done in main.\r\n\t\tArrayList<Food> exspectedFoodList = new ArrayList<Food>();\r\n\t\texspectedFoodList.add(new Appetizer(\"Salad\",Food.foodType.APPETIZER, \"55\"));\r\n\t\tArrayList<Combination> exspectedCombinationList = new ArrayList<Combination>();\r\n\t\texspectedCombinationList.add(new Combination(exspectedFoodList));\r\n\t\t\r\n\t\tint combinationCounter = 0;\r\n\t\tint foodCounter = 0;\r\n\t\tfor(Combination actualCombination : calcPrice.getResult())\r\n\t\t{\r\n\t\t\tfor(Food actualFood : actualCombination.getFoodCombination())\r\n\t\t\t{\r\n\t\t\t\tassertEquals(exspectedCombinationList.get(combinationCounter).getFoodCombination().get(foodCounter).getFoodName(), actualFood.getFoodName());\r\n\t\t\t\tfoodCounter++;\r\n\t\t\t}\r\n\t\t\tcombinationCounter++;\r\n\t\t}\r\n\t}",
"public static void main(String[] args) throws IOException {\n String dataName = \"Dianping\";\n String fileName = \"checkin_pitf\";\n int coreNum = 1;\n// List<Post> trainPosts = DataReader.readPosts(\"./demo/data/\" + dataName + \"/all_id_core\"+coreNum+\"_train\");\n// List<Post> testPosts = DataReader.readPosts(\"./demo/data/\" + dataName + \"/all_id_core\"+coreNum+\"_test\");\n List<Post> trainPosts = DataReader.readPosts(\"./demo/data/\" + dataName + \"/\"+fileName+\"_train\");\n List<Post> testPosts = DataReader.readPosts(\"./demo/data/\" + dataName + \"/\"+fileName+\"_test\");\n\n System.out.println(\"PITFTest\");\n System.out.println(dataName+\" \"+coreNum);\n int dim = 64;\n double initStdev = 0.01;\n int iter = 20;//100\n double learnRate = 0.05;\n double regU = 0.00005;\n double regI = regU, regT = regU;\n int numSample = 100;\n int randomSeed = 1;\n\n PITF pitf = new PITF(trainPosts, testPosts, dim, initStdev, iter, learnRate, regU, regI, regT, randomSeed, numSample);\n pitf.run();//这个函数会调用model的初始化及创建函数\n System.out.println(\"dataName:\\t\" + dataName);\n System.out.println(\"coreNum:\\t\" + coreNum);\n }",
"@Test\r\n public void test() {\n assertEquals(JShell.getWorkingDir().toString(), \"MASTER\");\r\n\r\n // Test setWorkingDir\r\n ArrayList<String> testMKDIR = new ArrayList<String>();\r\n // Directories made for testCase1 \"a\"\r\n String[] testCasesMKDIR1 = {\"mkdir\", \"a\"};\r\n testMKDIR.addAll(Arrays.asList(testCasesMKDIR1));\r\n MKDIR.execute(testMKDIR);\r\n // CD changes sets the working directory to \"a\"\r\n ArrayList<String> testCD2 = new ArrayList<String>();\r\n String[] testCasesCD2 = {\"cd\", \"a\"};\r\n testCD2.addAll(Arrays.asList(testCasesCD2));\r\n CD.execute(testCD2);\r\n // See if the directory has been changed\r\n assertEquals(JShell.getWorkingDir().toString(), \"a\");\r\n\r\n // Test getInputs and setInputs is shown in HISTORYTest - redundant code\r\n // Test getDirHistory and setDirHistory is shown in POPDTest and PUSHDTest -\r\n // redundant code\r\n }",
"public static void main(String[] args) throws IOException{\n\t\tBufferedReader in = new BufferedReader (new InputStreamReader(System.in));\n\t\tint num_tests = Integer.parseInt(in.readLine());\n\t\tBufferedWriter out = new BufferedWriter (new OutputStreamWriter(System.out));\n\n\t\tStringBuilder buf = new StringBuilder();\n\t\tfor(int j=0; j<num_tests; ++j)\n\t\t{\n\t\t\tString[] data_overview = in.readLine().split(\" \");\n\n\t\t\t// the variables\n\t\t\tint d = Integer.parseInt(data_overview[0]);\n\t\t\tint p = Integer.parseInt(data_overview[1]);\n\t\t\tint u = Integer.parseInt(data_overview[2]);\n\t\t\tint v = Integer.parseInt(data_overview[3]);\n\t\t\t\n\t\t\tdouble left = 0, right = d/(p-1);\n\t\t\twhile(right-left>0.0001){\n\t\t\t\tdouble middle = (left+right)/2;\n\t\t\t\tif(putPosts(d, u, v, p, middle)){\n\t\t\t\t\tleft = middle;\n\t\t\t\t} else {\n\t\t\t\t\tright = middle;\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\t// print\n\t\t\tbuf.append(\"Case #\");\n\t\t\tbuf.append(j+1);\n\t\t\tbuf.append(\": \");\n\t\t\tbuf.append(right);\n\t\t\tbuf.append(\"\\n\");\n\t\t}\n\t\tSystem.out.println(buf);\t\n\t}",
"private void populateData() {\n\t\tList<TrafficRecord> l = TestHelper.getSampleData();\r\n\t\tfor(TrafficRecord tr: l){\r\n\t\t\tput(tr);\r\n\t\t}\r\n\t\t \r\n\t}",
"public static void runTests(Preferences p) throws InvalidTagFormatException, FileNotFoundException, IOException {\n \n String testCaseFile = p.getTestFile();\n String testingPath = p.getTestPath();\n String resultsFormat = p.getFormat();\n boolean ignoreSpaCap = p.getIgnoreSpaCap();\n boolean removeBlankLines= p.getRemoveBlankLines();\n boolean debug = p.getDebug();\n JTextArea statusTextArea = p.getStatusTextArea();\n ProgramSettings settings= p.getSettings();\n\n // ultimately we need to figure actual OS\n OperatingSystem opSys = new OperatingSystemWindows(); \n \n String tempProgramFileName = settings.getTempProgramFileName();\n String tempInputFileName = settings.getTempInputFileName();\n String tempOutputFileName = settings.getTempOutputFileName();\n // TODO Replace this with actual storage of name in settings\n String tempErrorFileName = settings.getTempOutputFileName();\n int lastPeriod = tempErrorFileName.lastIndexOf(\".\");\n tempErrorFileName = tempErrorFileName.substring(0, lastPeriod) + \"Error$\"\n + tempErrorFileName.substring(lastPeriod);\n String resultsFileName = settings.getResultsFileName();\n \n \n //Ty Carpenter\n //From issue #89, added a new statistic variable to see if the test passes or fails\n //NOCOMP tests don't keep track of statistics, only if the test runs, therefore a variable is need to see if that run fails\n //nocompInTests keeps track to see if there is a single nocomp test so the results prints ALL TESTS RAN\n boolean testsSuccessful = true;\n boolean nocompInTests = false;\n \n int incorrectValues = 0;\n int incorrectText = 0;\n int incorrectSpacing = 0;\n int extraBlankLines = 0;\n int missingBlankLines = 0;\n int canNotRun = 0;\n int executionErrors = 0;\n\n //Brendan Villnave lines 48-51\n //From issue #111 I added the time of testing in military format\n //also tells you the day you tested the file\n Date current = new Date();\n statusTextArea.append(\"Date and time tested: \"+ current + \"\\n\");\n statusTextArea.update(statusTextArea.getGraphics());\n testingPath = testingPath + \"/\";\n statusTextArea.append(\"Test Case File: \" + p.getTestFile() + \"\\n\");\n statusTextArea.update(statusTextArea.getGraphics());\n statusTextArea.append(\"Testing path: \" + testingPath + \"\\n\");\n statusTextArea.update(statusTextArea.getGraphics());\n\n\n List<String> tests = new LinkedList<>();\n List<String> includes = new ArrayList<>();\n //Define Lists for storing information about files tested and whether\n //testes passed or failed.\n List<String> fileNames = new ArrayList<>();\n List<Integer> testsPassed = new ArrayList<>();\n List<Integer> testsApproximate = new ArrayList<>();\n List<Integer> testsRun = new ArrayList<>();\n //new list that stores information about nocompFiles run\n List<Integer> nocompTestsRun = new ArrayList<>();\n \n //Ty Carpenter Issue #89\n //boolean variable if NOCOMP tag is present\n boolean noComp = false;\n \n try {\n PytestFileReader testFile = new PytestFileReader(testCaseFile);\n tests = testFile.getText();\n includes = testFile.getIncludedFiles();\n } catch (Exception ex) {\n statusTextArea.append(\"Can't read test file: \" + testCaseFile + \"\\n\");\n }\n \n //Ty Carpenter Issue #94\n //Finds a Run tag in tests and transforms it into a NOCOMP test tag\n \n for(int i = 0; i < tests.size(); i++)\n {\n \n String possibleRunTag = tests.get(i);\n String upperPossibleRunTag = possibleRunTag.toUpperCase();\n String keepFile = \"\";\n if(upperPossibleRunTag.length() > 10)\n {\n \n String t = upperPossibleRunTag.substring(0, 10);\n \n if(t.equals(\"<RUN CODE=\"))\n {\n \n if(upperPossibleRunTag.substring(upperPossibleRunTag.length()-1,upperPossibleRunTag.length()).equals(\">\") && upperPossibleRunTag.substring(upperPossibleRunTag.length()-2,upperPossibleRunTag.length()-1).equals(\"/\"))\n {\n \n keepFile = possibleRunTag.substring(10, possibleRunTag.length() - 2);\n String newTag = \"<test code=\" + keepFile + \"nocomp>\";\n tests.set(i, newTag);\n tests.add(i+1, \"</test>\");\n }\n }\n }\n \n }\n \n // Process any COPY tags to copy files from the test case folder to\n // the folder under test\n \n String testCasePath = testCaseFile.substring( 0, testCaseFile.lastIndexOf( \"/\"));\n //testCaseFile.substring( 0, testCaseFile.lastIndexOf( \"/\"));\n \n \n for( String line : tests )\n {\n String upper = line.toUpperCase();\n // TODO: Not sure if the test for length is necessary\n // TODO: This is very demanding for spacing, etc.\n if( upper.length() > 13 && upper.startsWith( \"<COPY FILE=\") && upper.endsWith( \"/>\" ) )\n {\n String fileName = line.substring( line.indexOf( \"\\\"\" )+1, line.lastIndexOf( \"\\\"\" ) );\n String sourceFile = testCasePath + \"/\" + fileName;\n String destFile = testingPath + fileName;\n \n if( opSys.copy( sourceFile, destFile ) )\n {\n statusTextArea.append( \"COPIED: \" + fileName + \"\\n\" );\n \n }\n else\n {\n statusTextArea.append( \"*** NOT COPIED ***: \" + fileName + \"\\n\" );\n \n // might want to do something else\n } \n }\n } \n \n FileNameMapper fileNameMapper = \n new FileNameMapper( null, true, tests, testingPath );\n \n if( 0 < fileNameMapper.unknownCount() )\n {\n fileNameMapper.setVisible( true );\n if( !fileNameMapper.okClicked() )\n {\n statusTextArea.append(\"Testing cancelled by user.\");\n return;\n }\n }\n \n List<String> results = new LinkedList<>();\n \n if (!testCaseFile.endsWith(\".pytest\")) {\n statusTextArea.append(\"No tests were run because the Test Case File was not a PYTEST file.\");\n // ?? : statusTextArea.update(statusTextArea.getGraphics()); \n return;\n }\n \n for (String str : includes) {\n if (str.endsWith(\".py\")) {\n statusTextArea.append(\"The tag to include \" + str + \" was ignored because its argument was not a .pytest file.\\n\");\n }\n }\n \n TestTagParser testParser = new TestTagParser(tests);\n RUN_TESTS:\n while (testParser.hasNext()) {\n\n // Step #1 - Read the test case from the file\n TagBlock block = testParser.next();\n String pythonFileName = parseFileArg(block.getArgs(), statusTextArea );\n String userFileName = fileNameMapper.map( pythonFileName ); \n List<String> testData = block.getData();\n //Find out if the file is currently in the List of tested files and\n //if so where.\n int positionInNameList = fileNames.indexOf(pythonFileName);\n if(positionInNameList==-1)\n {\n //Initialize a new element in the Lists for this new .py file.\n fileNames.add(pythonFileName);\n positionInNameList = fileNames.size()-1;\n testsPassed.add(0);\n testsApproximate.add(0);\n nocompTestsRun.add(0);\n testsRun.add(0);\n }\n //Ty Carpenter Issue #89\n //Wherever a statistic is counted (like canNotRun, missingBlankLines, etc>)\n // check to see if there is a NOCOMP tag is present so that statistics are NOT counted in the test results\n //Either way, if there is an error, testsSuccessful becomes false\n try {\n //testPassed start out true and is set to false if the test fails.\n if( userFileName.equals( \"(none)\") )\n {\n boolean testPassed = false;\n if(!hasNoCompArg(block.getArgs()))\n {\n canNotRun++;\n testsSuccessful = false;\n }\n else\n {\n testsSuccessful = false;\n }\n results.add(\"Skipped \" + pythonFileName + \" - NO USER FILE\" );\n results.add( \"\" );\n statusTextArea.append(\"Skipped \" + pythonFileName + \" - NO USER FILE\\n\" );\n statusTextArea.update(statusTextArea.getGraphics());\n }\n else\n {\n boolean testPassed = true;\n boolean testApproximate = true;\n \n if( userFileName.equals( pythonFileName ) )\n {\n results.add(\"Testing \" + pythonFileName + \"...\");\n }\n else\n {\n results.add(\"Testing \" + pythonFileName + \n \" >>> \" + userFileName + \"...\");\n }\n if (true) // TODO should be if (verbose)\n {\n if( userFileName.equals( pythonFileName ) )\n {\n statusTextArea.append(\"Testing \" + pythonFileName + \"...\\n\");\n }\n else\n {\n statusTextArea.append(\"Testing \" + pythonFileName + \" (\" + userFileName + \")...\\n\");\n }\n statusTextArea.update(statusTextArea.getGraphics());\n }\n\n // Step #2 - Modify the student's code\n createModifiedProgram(testingPath, userFileName, tempProgramFileName);\n\n // Step #3 - Create the file with the inputs to the program\n createProgramInputs(testingPath, testData, tempInputFileName);\n\n // Step #4 - Run the student's program\n int rc = PythonExecutor.run(testingPath, tempProgramFileName,\n tempInputFileName,\n tempOutputFileName,\n tempErrorFileName,\n statusTextArea,\n settings);\n\n if( true ) // 0 == rc )\n {\n // Step #5 - Read the results from the output file\n TextFileReader fileIn = new TextFileReader(testingPath + tempOutputFileName);\n List<String> programOutput = fileIn.getText();\n\n if( 0 != rc && !hasNoCompArg(block.getArgs()))\n {\n // programOutput.add( \"EXECUTION ERROR RC=\" + rc );\n // TextFileReader errorIn = new TextFileReader(testingPath + tempErrorFileName);\n // List<String> errorText = errorIn.getText();\n // // Add the last two lines to the program output file, if present\n // if( errorText.size() >= 2 )\n // {\n // programOutput.add( errorText.get( errorText.size() - 2 ) );\n // }\n // if( errorText.size() >= 1 )\n // {\n // programOutput.add( errorText.get( errorText.size() - 1 ) );\n // } \n\n executionErrors++;\n testPassed = false;\n testsSuccessful = false;\n }\n if(0 != rc && hasNoCompArg(block.getArgs()))\n {\n testsSuccessful = false;\n \n }\n\n TextUtilities.removeTrailingBlanks( programOutput );\n\n // Step #6 - Compare the results to the expected values\n // TODO: move these inside the comparitor ??\n testData = InputTagParser.removeInputTags(testData);\n // List<String> outputText = ValueTagParser.removeValueTags( testData );\n \n int width = TextUtilities.maximumLength( programOutput );\n\n \n if (removeBlankLines) {\n while (testData.remove(\"\")) { /*\n * Do Nothing\n */ }\n while (programOutput.remove(\"\")) { /*\n * Do Nothing\n */ }\n }\n \n if (!hasNoCompArg(block.getArgs())) {\n // TODO: Convert to use iterators\n while (0 != testData.size() && 0 != programOutput.size()) {\n String testLine = testData.get(0);\n String progLine = programOutput.get(0);\n\n if (testLine.equals(\"\") && !progLine.equals(\"\")) {\n results.add(\"! missing blank line !\");\n testData.remove(0);\n missingBlankLines++;\n testsSuccessful = false;\n testPassed = false;\n } else if (!testLine.equals(\"\") && progLine.equals(\"\")) {\n results.add(\"! extra blank line !\");\n programOutput.remove(0);\n extraBlankLines++;\n testsSuccessful = false;\n testPassed = false;\n } else {\n TextLineComparator comp =\n new TextLineComparator(testLine, progLine);\n //TODO: Count multiple errors on one line?\n boolean exact = comp.equalsExact();\n boolean approx = comp.equalsSomeWhat();\n\n if (exact) {\n results.add(\"= \" + testLine);\n } else if (approx) {\n if (ignoreSpaCap) {\n results.add(\"~ \" + testLine);\n } else {\n testPassed=false;\n incorrectText++;\n incorrectSpacing++;\n testsSuccessful = false;\n\n if (resultsFormat.equals(\"Sequential\")) {\n results.add(\"~ \" + progLine);\n results.add(\"> \" + ValueTagParser.removeValueTags(testLine));\n } else {\n results.add(\"~ \" + TextUtilities.adjustLength( progLine, width ) + \" >-SHOULD BE-> \"\n + ValueTagParser.removeValueTags(testLine));\n }\n }\n } // else if( comp.equalValues() )\n // {\n // \tresults.add( \"# \" + programOutput.get(i) );\n // results.add( \"> \" + ValueTagParser.removeValueTags(testData.get(i)) );\n // }\n else {\n incorrectText++;\n testsSuccessful = false;\n testPassed = false;\n testApproximate = false;\n if (resultsFormat.equals(\"Sequential\")) {\n results.add(\"X \" + progLine);\n results.add(\"> \" + ValueTagParser.removeValueTags(testLine));\n } else {\n results.add(\"X \" + TextUtilities.adjustLength( progLine, width ) + \" >-SHOULD BE-> \"\n + ValueTagParser.removeValueTags(testLine));\n }\n }\n testData.remove(0);\n programOutput.remove(0);\n }\n }\n while (0 != testData.size()) {\n testApproximate = false;\n testPassed = false;\n if( 0 == rc )\n {\n // Only add this if there was not a python error\n incorrectText++;\n testsSuccessful = false;\n if (resultsFormat.equals(\"Sequential\")) {\n results.add(\"X **NO*OUTPUT*LINE**\");\n results.add(\"> \" + ValueTagParser.removeValueTags(testData.get(0)));\n } else {\n results.add(\"X \" + TextUtilities.adjustLength( \"**NO*OUTPUT*LINE**\", width) + \" >-SHOULD BE-> \"\n + ValueTagParser.removeValueTags(testData.get(0)));\n }\n }\n testData.remove(0);\n }\n while (0 != programOutput.size()) {\n testApproximate = false;\n testPassed = false;\n incorrectText++;\n testsSuccessful = false;\n if (resultsFormat.equals(\"Sequential\")) {\n results.add(\"X \" + programOutput.get(0));\n results.add(\"> **NO*OUTPUT*LINE**\");\n } else {\n results.add(\"X \" + TextUtilities.adjustLength( programOutput.get(0), width )\n + \" >-SHOULD BE-> **NO*OUTPUT*LINE**\");\n }\n programOutput.remove(0);\n }\n } else {\n \n \n //Ty Carpenter Issue #89\n //Variable when NOCOMP tag is found becomes true\n // NoComp argument present\n //nocompInTests is true so now will print ALL TESTS RUN if they all pass\n nocompInTests = true;\n noComp = true;\n for (int i = 0; i < programOutput.size(); i++) {\n results.add(\" \" + programOutput.get(i));\n }\n }\n }\n else\n {\n if(!hasNoCompArg(block.getArgs()))\n {\n executionErrors++;\n testsSuccessful = false;\n }\n else\n {\n testsSuccessful = false;\n }\n testPassed = false;\n testApproximate = false;\n if (debug) {\n break RUN_TESTS;\n }\n }\n //Ty Carpenter Issue #89\n //If there is no NOCOMP tag, testPassed and testApproximate are counted\n if(noComp == false)\n {\n\n TextFileReader errorIn = new TextFileReader(testingPath + tempErrorFileName);\n List<String> errorOutput = errorIn.getText();\n for( String line : errorOutput )\n {\n line = line.replace( testingPath+tempProgramFileName, userFileName );\n results.add( \"E \" + line );\n }\n\n results.add(\"\");\n\n\n if( testPassed )\n {\n testsPassed.set(positionInNameList,\n testsPassed.get(positionInNameList)+1);\n }\n \n if( testApproximate )\n {\n testsApproximate.set(positionInNameList,\n testsApproximate.get(positionInNameList)+1);\n }\n }\n //Ty Carpenter Issue #89\n //Resets NOCOMP argument for future tests\n else\n {\n //nocompTestsRun is counted\n nocompTestsRun.set(positionInNameList,\n testsRun.get(positionInNameList)+1);\n noComp = false;\n }\n testsRun.set(positionInNameList,\n testsRun.get(positionInNameList)+1);\n\n } \n } \n catch (Exception ex) \n {\n results.add(\"Exception: \" + ex.getMessage() + \"\\n\");\n statusTextArea.append(\"Can't run test: \" + pythonFileName + ex.getMessage() + \"\\n\");\n statusTextArea.update(statusTextArea.getGraphics());\n if(!hasNoCompArg(block.getArgs()))\n {\n canNotRun++;\n testsSuccessful = false;\n }\n else\n {\n testsSuccessful = false;\n }\n if (debug) \n {\n break RUN_TESTS;\n }\n }\n }\n //Brendan Villnave\n //Edited the following lines so everything after \"Run Completed!\"\n //gets added to the $TEST$RESULTS$.txt file as well\n TextFileWriter outFile = new TextFileWriter(testingPath + resultsFileName);\n if (!debug) {\n deleteFile(testingPath + tempProgramFileName);\n deleteFile(testingPath + tempInputFileName);\n deleteFile(testingPath + tempOutputFileName);\n deleteFile(testingPath + tempErrorFileName);\n }\n statusTextArea.append(\"Run completed!\\n\\n\");\n //Ty Carpenter Issue #89\n //testsSuccessful variable is now counted in overal statistics of the tests\n \n if (incorrectValues == 0\n && incorrectText == 0\n && incorrectSpacing == 0\n && extraBlankLines == 0\n && missingBlankLines == 0\n && canNotRun == 0\n && executionErrors == 0\n && testsSuccessful == true) {\n // TODO - in debug mode, this gets printed sometimes when it shouldn't\n //Determines ALL TESTS RUN vs ALL TESTS RUN EXACTLY CORRECTLY\n if(nocompInTests==true)\n {\n statusTextArea.append(\"ALL TESTS RAN\\n\");\n results.add(\"ALL TESTS RUN EXACTLY CORRECTLY\\n\");\n }\n else\n {\n statusTextArea.append(\"ALL TESTS EXACTLY CORRECT\\n\");\n results.add(\"ALL TESTS RUN EXACTLY CORRECTLY\\n\");\n }\n } else {\n // TODO - give option to open student's code\n statusTextArea.append(\"Incorrect values ............ \" \n + incorrectValues + \"\\n\");\n results.add(\"Incorrect values ............ \" \n + incorrectValues + \"\\n\");\n statusTextArea.append(\"Lines with errors ........... \" \n + incorrectText + \"\\n\");\n results.add(\"Lines with errors ........... \" \n + incorrectText + \"\\n\");\n statusTextArea.append(\"Bad spacing/capitalization .. \" \n + incorrectSpacing + \"\\n\");\n results.add(\"Bad spacing/capitalization .. \" \n + incorrectSpacing + \"\\n\");\n statusTextArea.append(\"Extra/missing blank lines ... \"\n + (extraBlankLines + missingBlankLines) + \"\\n\");\n results.add(\"Extra/missing blank lines ... \"\n + (extraBlankLines + missingBlankLines) + \"\\n\");\n statusTextArea.append(\"Python errors ............... \" \n + (executionErrors)+\"\\n\");\n results.add(\"Python errors ............... \" \n + (executionErrors)+\"\\n\");\n statusTextArea.append(\"Can't run test .............. \" \n + canNotRun +\"\\n\");\n results.add(\"Can't run test .............. \" \n + canNotRun +\"\\n\");\n statusTextArea.append(\"Code was successful .............. \" \n + testsSuccessful +\"\\n\");\n results.add(\"Code was successful .............. \" \n + testsSuccessful +\"\\n\");\n }\n statusTextArea.append(\"\\n\");\n \n for(int i=0; i<fileNames.size(); i++)\n {\n int passes = testsPassed.get(i);\n int approximate = testsApproximate.get(i);\n int run = testsRun.get(i);\n int nocompRun = nocompTestsRun.get(i);\n \n String dots = \" ................................................\";\n statusTextArea.append( ( fileNames.get(i)+dots).substring(0,41)+\" \");\n results.add(( fileNames.get(i)+dots).substring(0,41)+\" \");\n \n \n if(run == 0 )\n \n {\n statusTextArea.append(\"NO TESTS RUN\\n\");\n results.add(\"NO TESTS RUN\\n\");\n }\n //new results output All Tests Ran (check output)\n else if(nocompRun == run)\n {\n statusTextArea.append(\"All Tests Ran (check output)\\n\");\n results.add(\"All Tests Ran (check output)\\n\");\n }\n else if(passes == run)\n {\n statusTextArea.append(\"All Tests Passed\\n\");\n results.add(\"All Tests Passed\\n\");\n }\n else{\n \n statusTextArea.append( passes + \"/\" + approximate + \"/\" + \n run + \" tests passed/approximate/run\\n\");\n results.add(passes + \"/\" + approximate + \"/\" + \n run + \" tests passed/approximate/run\\n\");\n }\n }\n\n statusTextArea.update(statusTextArea.getGraphics());\n outFile.writeLines(results);\n outFile.close();\n \n }"
] | [
"0.646767",
"0.6432612",
"0.6146421",
"0.61364573",
"0.6064798",
"0.605918",
"0.5939869",
"0.58722067",
"0.58279866",
"0.5815542",
"0.5808052",
"0.5779042",
"0.57530373",
"0.5752195",
"0.5728132",
"0.5718736",
"0.57149965",
"0.570902",
"0.57021856",
"0.56778485",
"0.56629425",
"0.56545776",
"0.56507707",
"0.5630013",
"0.56127423",
"0.56114405",
"0.5600958",
"0.5595309",
"0.5593192",
"0.55862653",
"0.5573008",
"0.55474794",
"0.5542705",
"0.5522782",
"0.55213106",
"0.5508672",
"0.5508483",
"0.54909265",
"0.54870296",
"0.54823035",
"0.548215",
"0.54683197",
"0.5449347",
"0.54440695",
"0.54401004",
"0.54369974",
"0.5435694",
"0.5427293",
"0.5414212",
"0.54138213",
"0.5399642",
"0.5398721",
"0.5393853",
"0.5391549",
"0.53872895",
"0.5384486",
"0.5378018",
"0.53749496",
"0.53730136",
"0.53720856",
"0.5371462",
"0.5371462",
"0.5364468",
"0.53560174",
"0.53535926",
"0.5351921",
"0.5349152",
"0.5345218",
"0.5340704",
"0.53282624",
"0.5324329",
"0.5317806",
"0.53151584",
"0.5310697",
"0.5308905",
"0.5307106",
"0.53062886",
"0.53003335",
"0.52995604",
"0.529855",
"0.5297459",
"0.5295037",
"0.5287159",
"0.52799183",
"0.52765626",
"0.5265826",
"0.5259377",
"0.5256689",
"0.52566606",
"0.525092",
"0.5248593",
"0.52458435",
"0.5242214",
"0.5241568",
"0.5237866",
"0.5233462",
"0.5228442",
"0.5226961",
"0.5224463",
"0.5198953",
"0.51945937"
] | 0.0 | -1 |
creates a water report and sets values | public PurityReport(ZonedDateTime date, int reportID, String reporterName,
Location location, OverallCondition condition,
int virusPPM, int contaminantPPM) {
this.date = date;
this.reportID = reportID;
this.reporterName = reporterName;
this.location = location;
this.condition = condition;
this.virusPPM = virusPPM;
this.contaminantPPM = contaminantPPM;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public WaterReport() {\n virusPPM = -1;\n contaminantPPM = -1;\n }",
"void createReport(Report report);",
"public static void CreateReport() {\n\t\tString fileName = new SimpleDateFormat(\"'Rest_Country_Report_'YYYYMMddHHmm'.html'\").format(new Date());\n\t\tString path = \"Report/\" + fileName;\n\t\treport = new ExtentReports(path);\n\t}",
"void createReport() {\n\n // report about purple flowers\n println(\"\\nPurple flower distribution: \");\n for (int i = 0; i < 6; i++) {\n println(i + (i==5?\"+\":\"\") + \": \" + numPurpleFlowers[i]);\n }\n // report about missing treasures\n println(\"Missing treasure count: \" + missingTreasureCount);\n\n println(\"\\nGenerated \" + caveGenCount + \" sublevels.\");\n println(\"Total run time: \" + (System.currentTimeMillis()-startTime)/1000.0 + \"s\");\n\n out.close();\n }",
"Report createReport();",
"public void makeReport()\n\t{\n\t\tif (currentStage[currentSlice-1] > 1)\n\t\t{\n\t\t\tResultsTable rt = new ResultsTable();\n\t\t\tfor (int j=0;j<popSequence.N;j++)\n\t\t\t{\n\t\t\t\tpop = popSequence.PopList[j];\n\t\t\t\tint N = pop.N;\n\t\t\t\tfor (int i=0;i<N;i++)\n\t\t\t\t{\n\t\t\t\t\trt.incrementCounter();\n\t\t\t\t\tBalloon bal;\n\t\t\t\t\tbal = (Balloon)(pop.BallList.get(i));\n\t\t\t\t\tbal.mass_geometry();\n\t\t\t\t\trt.addValue(\"X\",bal.x0);\n\t\t\t\t\trt.addValue(\"Y\",bal.y0);\n\t\t\t\t\trt.addValue(\"Z\",j);\n\t\t\t\t\trt.addValue(\"ID\",bal.id);\n\t\t\t\t\trt.addValue(\"AREA\",bal.area);\n\t\t\t\t\trt.addValue(\"Ixx\",bal.Ixx);\n\t\t\t\t\trt.addValue(\"Iyy\",bal.Iyy);\n\t\t\t\t\trt.addValue(\"Ixy\",bal.Ixy);\n\t\t\t\t\trt.addValue(\"Lx\",bal.lx);\n\t\t\t\t\trt.addValue(\"Ly\",bal.ly);\n\t\t\t\t}\n\t\t\t}\n\t\t\trt.show(\"Report\");\n\t\t\tcurrentSlice = i1.getCurrentSlice();\n\t\t\tipWallSegment = (i1.getStack()).getProcessor(i1.getCurrentSlice());\n\t\t\tpop = popSequence.PopList[currentSlice-1];\n\t\t}\n\t}",
"void genReport() {\n\n current_part.save_state(); \n\n JTextArea ta = text;\n\n ta.setText(\"\");\n\n if (!t_foil_name.equals(\"Test\"))\n ta.append(\"Hydrofoil: \" + t_foil_name);\n\n java.util.Date date = new java.util.Date();\n ta.append(\"\\n Date: \" + date);\n \n wing.print( \"Main Wing\", ta);\n stab.print( \"Stabilizer Wing\", ta);\n strut.print(\"Mast (a.k.a. Strut)\", ta);\n fuse.print( \"Fuselage\", ta);\n\n ta.append( \"\\n\\n\");\n // tail volume is LAElev * AreaElev / (MACWing * AreaWing)\n // LAElev : The elevator's Lever Arm measured at the wing's and elevator's quarter chord point\n double LAElev = stab.xpos + stab.chord_xoffs + 0.25*stab.chord - (wing.xpos + wing.chord_xoffs + 0.25*wing.chord);\n // MAC : The main wing's Mean Aerodynamic Chord\n // AreaWing : The main wing's area\n // AreaElev : The elevator's area\n \n ta.append( \"\\nTail Voulume: \" + LAElev*stab.span*stab.chord/(wing.chord*wing.chord*wing.span));\n \n\n ta.append( \"\\n\\n\");\n switch (planet) {\n case 0: { \n ta.append( \"\\n Standard Earth Atmosphere\" );\n break;\n }\n case 1: { \n ta.append( \"\\n Martian Atmosphere\" );\n break;\n }\n case 2: { \n ta.append( \"\\n Water\" );\n break;\n }\n case 3: { \n ta.append( \"\\n Specified Conditions\" );\n break;\n }\n case 4: { \n ta.append( \"\\n Specified Conditions\" );\n break;\n }\n }\n\n // ta.append( \"\\n Altitude = \" + filter0(alt_val) );\n // if (lunits == IMPERIAL) ta.append( \" ft ,\" );\n // else /*METRIC*/ ta.append( \" m ,\" );\n \n switch (lunits) {\n case 0: { /* English */\n ta.append( \"\\n Density = \" + filter5(rho_EN) );\n ta.append( \"slug/cu ft\" );\n ta.append( \"\\n Pressure = \" + filter3(ps0/144.) );\n ta.append( \"lb/sq in,\" );\n ta.append( \" Temperature = \" + filter0(ts0 - 460.) );\n ta.append( \"F,\" );\n break;\n }\n case 1: { /* Metric */\n ta.append( \" Density = \" + filter3(rho_EN*515.4) );\n ta.append( \"kg/cu m\" );\n ta.append( \"\\n Pressure = \" + filter3(101.3/14.7*ps0/144.) );\n ta.append( \"kPa,\" );\n ta.append( \" Temperature = \" + filter0(ts0*5.0/9.0 - 273.1) );\n ta.append( \"C,\" );\n break;\n }\n }\n\n ta.append( \"\\n Speed = \" + filter1(velocity * (lunits==IMPERIAL? 0.868976 : 0.539957 )) + \"Kts, or\" );\n ta.append( \" \" + filter1(velocity) );\n if (lunits == IMPERIAL) ta.append( \" mph ,\" );\n else /*METRIC*/ ta.append( \" km/hr ,\" );\n\n // if (out_aux_idx == 1)\n // ta.append( \"\\n Lift Coefficient = \" + filter3(current_part.cl) );\n // if (out_aux_idx == 0) {\n // if (Math.abs(lift) <= 10.0) ta.append( \"\\n Lift = \" + filter3(lift) );\n // if (Math.abs(lift) > 10.0) ta.append( \"\\n Lift = \" + filter0(lift) );\n // if (lunits == IMPERIAL) ta.append( \" lbs \" );\n // else /*METRIC*/ ta.append( \" Newtons \" );\n // }\n // if ( polarOut == 1)\n // ta.append( \"\\n Drag Coefficient = \" + filter3(current_part.cd) );\n // if (out_aux_idx == 0) {\n // ta.append( \"\\n Drag = \" + filter0(drag) );\n // if (lunits == IMPERIAL) ta.append( \" lbs \" );\n // else /*METRIC*/ ta.append( \" Newtons \" );\n // }\n\n ta.append( \"\\n Lift = \" + dash.outTotalLift.getText());\n ta.append( \"\\n Drag = \" + dash.outTotalDrag.getText());\n\n if (min_takeoff_speed_info != null) \n ta.append( \"\\n\\n\" + min_takeoff_speed_info);\n\n if (cruising_info != null) \n ta.append( \"\\n\\n\" + cruising_info);\n\n if (max_speed_info != null) \n ta.append( \"\\n\\n\" + max_speed_info);\n\n // ensure end ta.setCaretPosition(ta.getText().length());\n // ensure start\n ta.setCaretPosition(0);\n }",
"public void generateReport()\r\n {\r\n ProfilerGUI reportGUI = new ProfilerGUI(map,mapCountTracker);\r\n //reportGUI.\r\n }",
"public GenerateReport() {\n initComponents();\n displayLogs();\n }",
"public static void generateReport()\n\t{\n\t\tlong time=System.currentTimeMillis();\n\t\tString reportPath=System.getProperty(\"user.dir\")+\"//automationReport//Report\"+time+\".html\";\n\t\t\n\t\thtmlreporter=new ExtentHtmlReporter(reportPath);\n\t\textent=new ExtentReports();\n\t\textent.attachReporter(htmlreporter);\n\t\t\n\t\tString username=System.getProperty(\"user.name\");\n\t\tString osname=System.getProperty(\"os.name\");\n\t\tString browsername=CommonFunction.readPropertyFile(\"Browser\");\n\t\tString env=CommonFunction.readPropertyFile(\"Enviornment\");\n\t\t\n\t\t\n\t\textent.setSystemInfo(\"User Name\", username);\n\t\textent.setSystemInfo(\"OS Name\", osname);\n\t\textent.setSystemInfo(\"Browser Name\", browsername);\n\t\textent.setSystemInfo(\"Enviornment\", env);\n\t\t\n\t\t\n\t\thtmlreporter.config().setDocumentTitle(\"Automation Report\");\n\t\thtmlreporter.config().setTheme(Theme.STANDARD);\n\t\thtmlreporter.config().setChartVisibilityOnOpen(true);\n \n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}",
"public static void setReport()\n {\n ExtentHtmlReporter htmlReporter = new ExtentHtmlReporter(\"\\\\C:\\\\Users\\\\shir halevi\\\\Desktop\\\\qaexpert\\\\buyMe\\\\reports\\\\extent.html\");\n htmlReporter.setAppendExisting(true);\n extent = new ExtentReports();\n extent.attachReporter(htmlReporter);\n test = extent.createTest(\"BuyMeSanityTestWeb\", \"This is a BuyMe Sanity Test Web\");\n extent.setSystemInfo(\"Tester\", \"Shir\");\n test.log(Status.INFO, \"@Before class\");\n }",
"@Test\n\tpublic void driverCreateReport() {\n\t\tfinal Object testingData[][] = {\n\t\t\t{\n\t\t\t\t\"2019/04/23\", \"example\", \"player1\", null\n\t\t\t},//1. All fine\n\t\t\t{\n\t\t\t\t\"2019/04/23\", \"\t\t\", \"player1\", ConstraintViolationException.class\n\t\t\t},//2. Description = blank\n\t\t\t{\n\t\t\t\t\"2019/04/23\", null, \"player1\", ConstraintViolationException.class\n\t\t\t},//3. Description = null\n\n\t\t};\n\n\t\tfor (int i = 0; i < testingData.length; i++)\n\t\t\tthis.templateCreateReport(this.convertStringToDate((String) testingData[i][0]), (String) testingData[i][1], (String) testingData[i][2], (Class<?>) testingData[i][3]);\n\t}",
"public void generateReportPluviometer() {\r\n\t\tReportsController reportsController = ControladorContexto\r\n\t\t\t\t.getContextBean(ReportsController.class);\r\n\t\ttry {\r\n\t\t\tconsultPluviometer();\r\n\t\t\treportsController.generateReportPluviometer(pluviometerPojoList,\r\n\t\t\t\t\tyear);\r\n\t\t\tsetStartDateReport(null);\r\n\t\t\tsetEndDateReport(null);\r\n\t\t} catch (Exception e) {\r\n\t\t\tControladorContexto.mensajeError(e);\r\n\t\t}\r\n\t}",
"public void generateReport(ReportGenerationData data)throws ChangeApplicationException;",
"public static Report createEntity() {\n\t\tReport report = new Report()\n\t\t\t\t.fromIsoCode(DEFAULT_FROM_ISO_CODE)\n\t\t\t\t.toIsoCode(DEFAULT_TO_ISO_CODE)\n\t\t\t\t.total(DEFAULT_TOTAL)\n\t\t\t\t.lastUpdated(DEFAULT_LAST_UPDATED);\n\t\treturn report;\n\t}",
"public void setReport(Report report);",
"private void initReportWriter() {\n\t\tfinal XMLOutputFactory xmlof = XMLOutputFactory.newInstance();\r\n\r\n\t\t// Create an XML stream writer\r\n\t\tfinal File reportFile = new File(getOutputDirectory(), \"report.xml\");\r\n\t\ttry {\r\n\t\t\treportWriter = xmlof.createXMLStreamWriter(new FileWriter(reportFile));\r\n\r\n\t\t} catch (final XMLStreamException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (final IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"public StubReport() {\n\t\t\thashMapDB = new HashMap<String, HashMap<Integer, String>>();\n\t\t\tparkReportData = new HashMap<Integer, String>();\n\n\t\t\tparkReportData = new HashMap<Integer, String>();\n\t\t\tparkReportData.put(1, \"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\");\n\t\t\tparkReportData.put(2,\n\t\t\t\t\t\"12 88 28 60 28 0 76 40 20 32 76 0 16 96 0 96 0 0 60 56 28 56 28 0 60 28 0 56 0 0 92 28 0 44 28 0\");\n\t\t\tparkReportData.put(3, \"1 2 3 4 5 6 1 23 2 8 9 2 3 2 4 3 2 2 1 1 1 5 32 6 12 7 23 8 12 5 32 6 12 5 23 7\");\n\t\t\thashMapDB.put(\"Haifa Park\", parkReportData);\n\t\t\tparkReportData = new HashMap<Integer, String>();\n\t\t\tparkReportData.put(4, \"1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 1\");\n\t\t\tparkReportData.put(5, \"1 2 7 4 7 6 7 7 0 8 7 0 7 7 7 0 7 0 7 5 7 5 7 6 7 7 7 8 7 5 7 6 7 5 7 7\");\n\t\t\tparkReportData.put(6,\n\t\t\t\t\t\"11 22 33 44 55 66 17 23 5 8 4 2 3 2 54 34 2 32 1 61 1 75 32 46 12 67 23 82 12 56 32 36 12 85 232 7\");\n\t\t\thashMapDB.put(\"Tel-Aviv Park\", parkReportData);\n\n\t\t\tparkReportData = new HashMap<Integer, String>();\n\t\t\tparkReportData.put(7, \"1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 1\");\n\t\t\tparkReportData.put(8, \"1 2 3 4 5 6 0 0 0 8 9 0 3 0 4 0 6 0 0 5 5 5 0 6 0 7 0 8 0 5 0 6 0 5 0 7\");\n\t\t\tparkReportData.put(9, \"1 2 3 4 5 6 1 23 2 8 9 2 3 2 4 3 2 2 1 1 1 5 32 6 12 7 23 8 12 5 32 6 12 5 23 7\");\n\t\t\thashMapDB.put(\"Safed Park\", parkReportData);\n\t\t}",
"@Override\n void createReport(final Format reportFormat,\n final long start, final long end) {\n makeBriefReport(reportFormat, \"Informe breu\", start, end);\n writeToFile();\n getFormat().finishPrinting();\n }",
"public void setup_report() {\n try {\n output = new PrintWriter(new FileWriter(filename));\n } catch (IOException ioe) {}\n }",
"@FXML\n private void generateReportData() {\n\n if (storage.getHistory().size() == 0) {\n Alert ErrorAlert = new Alert(Alert.AlertType.NONE);\n ErrorAlert.setAlertType(Alert.AlertType.ERROR);\n ErrorAlert.setContentText(\"You have not selected any data to be in your Flight History\");\n ErrorAlert.show();\n } else {\n updateTravelledAndVisited();\n setUpData();\n\n try {\n displayCarbonEmissionGoalField.setText(String.valueOf(Double.parseDouble(carbonEmissionGoalField.getText())));\n generalStatsCalculator.setCarbonEmissionsGoal(Double.parseDouble(carbonEmissionGoalField.getText()));\n\n displayTotalEmissionsField.setText(\n String.format(\"%.2f\", generalStatsCalculator.getTotalCarbonEmissions()));\n displayTotalDistanceTravelledField.setText(\n String.format(\"%.2f\", generalStatsCalculator.getTotalDistanceTravelled()));\n displayMostEmissionsRouteField.setText(MostEmissionsRouteString);\n displayLeastEmissionsRouteField.setText(LeastEmissionsRouteString);\n displayMostDistanceRouteField.setText(MostDistanceRouteString);\n displayLeastDistanceRouteField.setText(LeastDistanceRouteString);\n displayMostVisitedSourceAirportField.setText(MostVisitedSourceAirportString);\n displayLeastVisitedSourceAirportField.setText(LeastVisitedSourceAirportString);\n displayMostVisitedDestinationAirportField.setText(MostVisitedDestAirportString);\n displayLeastVisitedDestinationAirportField.setText(LeastVisitedDestAirportString);\n displayTreeOffsetField.setText(numOfTreesString);\n generalStatsCalculator.createCarbonEmissionsComment();\n displayStatusCommentField.setText(generalStatsCalculator.getCarbonEmissionsComment());\n } catch (NumberFormatException e) {\n carbonEmissionGoalField.setText(\"\");\n carbonEmissionGoalField.setPromptText(\n \"NO GOAL WAS ENTERED. PLEASE ENTER A GOAL AS A DOUBLE.\");\n }\n }\n }",
"public void createReport(Report report) {\n view.onProgress(true);\n apiInterface.newReport(report.getNumber(), report.isNo_telp(), report.isNo_rek())\n .subscribeOn(Schedulers.io())\n .observeOn(AndroidSchedulers.mainThread())\n .subscribe(new SingleObserver<ReportItem>() {\n @Override\n public void onSubscribe(Disposable d) {\n\n }\n\n @Override\n public void onSuccess(ReportItem reportItem) {\n if (reportItem != null) {\n view.onReportResult(reportItem.toReportparcel(), true);\n }\n view.onProgress(false);\n }\n\n @Override\n public void onError(Throwable e) {\n view.onError(e.getMessage());\n view.onProgress(false);\n }\n });\n }",
"public Report() {\n\t\tsuper();\n\t}",
"public void generateReport() {\n ReportGenerator rg = ui.getReportGenerator();\n if (rg == null || !rg.isVisible()) {\n ui.openReportGenerator();\n rg = ui.getReportGenerator();\n }\n Image img = getImage();\n if (img == null) {\n return;\n }\n rg.addImage(img, \"Plot\");\n }",
"@Override\n\t//Start, end, headache count, average severity, duration\n\tpublic String buildReport() {\n\t\tsetHeadacheInfo(); \n\t\tStringBuilder hsReport = new StringBuilder(); \n\t\thsReport.append(\"\\nReport Start Date: \"); \n\t\thsReport.append(getStartDate().toString() + \"\\n\"); \n\t\thsReport.append(\"Report End Date: \"); \n\t\thsReport.append(getEndDate().toString() + \"\\n\"); \n\t\thsReport.append(\"Headache Count: \"); \n\t\thsReport.append(getHeadacheList().size() + \"\\n\"); \n\t\thsReport.append(\"Average Severty: \"); \n\t\thsReport.append(getAverageSeverity() + \"\\n\"); \n\t\thsReport.append(\"Average Duration (hours): \"); \n\t\thsReport.append(getAverageDuration() + \"\\n\"); \n\t\treturn hsReport.toString(); \n\t}",
"public static void generateReport() {\n PrintImpl printer = new PrintImpl(realtorLogImpl, propertyLogImpl);\n printer.generateReport(REQUESTS_FILE);\n }",
"public void generateReport(){\n String fileOutput = \"\";\n fileOutput += allCustomers()+\"\\n\";\n fileOutput += getNoAccounts()+\"\\n\";\n fileOutput += getTotalDeposits()+\"\\n\";\n fileOutput += accountsOfferingLoans()+\"\\n\";\n fileOutput += accountsReceivingLoans()+\"\\n\";\n fileOutput += customersOfferingLoans()+\"\\n\";\n fileOutput += customersReceivingLoans()+\"\\n\";\n System.out.println(fileOutput);\n writeToFile(fileOutput);\n }",
"@Override\n \t\t\t\tpublic void doCreateProjectedWater() {\n \n \t\t\t\t}",
"public void createTemplate(ReportContent reportContent, String fileName) {\n\n ArrayList<Detail> detailList = reportContent.getDetails();\n\n // create Test Data\n HashMap<String, Object> parameter = createBasicParameters(reportContent);\n\n // read and modify file\n \n \n File file = Main_Gui.openFile(\"report_template.jrxml\", \"report template\", \".jrxml\");\n\n try {\n // define namespace of the jrxml-file and document\n Namespace ns = Namespace\n .getNamespace(\"http://jasperreports.sourceforge.net/jasperreports\");\n Document doc = new SAXBuilder(false).build(file);\n\n // set Color of the result conistency ratio (red, if Cr is higher than\n // the critical CR --> else: black)\n @SuppressWarnings(\"unchecked\")\n List<Element> list = doc.getRootElement().getChild(\"detail\", ns)\n .getChild(\"band\", ns).getChildren();\n\n \n for (Element element : list) {\n\n if (element.getName().equals(\"textField\")\n && element.getChild(\"textFieldExpression\", ns)\n .getText()\n .equals(\"$P{RESULT_CONSISTENCY_RATIO}\")) {\n\n setConsistencyRatioColor(\n reportContent.getResultConsistencyRatio(), element,\n ns);\n }\n }\n\n // addDetail band(s)\n for (Detail detail : detailList) {\n this.addDetailFrame(doc, ns, parameter, detail);\n\n }\n\n // remove detail pattern band (last band under \"detail\" in \"report_template.jrxml\")\n doc.getRootElement().getChild(\"detail\", ns).getChildren().remove(4);\n\n // create output of the modified template \n XMLOutputter out = new XMLOutputter();\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n out.output(doc, baos);\n\n ByteArrayInputStream bais = new ByteArrayInputStream(\n baos.toByteArray());\n\n // -----------\n // --JASPER\n // ----------\n \n // compile, fill and export the report as PDF-file to the given path\n JasperReport jasperReport = JasperCompileManager\n .compileReport(bais);\n\n JasperPrint jasperPrint = JasperFillManager.fillReport(\n jasperReport, parameter,\n new net.sf.jasperreports.engine.JREmptyDataSource(1));\n\n JasperExportManager.exportReportToPdfFile(jasperPrint, fileName);\n\n } catch (JRException e) {\n // print out standard exception\n e.printStackTrace();\n } catch (JDOMException e1) {\n // print out standard exception\n e1.printStackTrace();\n } catch (IOException e1) {\n // print out standard exception\n \n //!!NOT YET IMPLEMENTED!!:\n //show user dialog, if file which shall be overwritten is still opened.\n \n e1.printStackTrace();\n }\n\n }",
"@BeforeTest\n\tpublic void startReport() {\n\t\t// ExtentReports(String filePath,Boolean replaceExisting)\n\t\t// filepath - path of the file, in .htm or .html format - path where your report\n\t\t// needs to generate.\n\t\t// replaceExisting - Setting to overwrite (TRUE) the existing file or append to\n\t\t// it\n\t\t// True (default): the file will be replaced with brand new markup, and all\n\t\t// existing data will be lost. Use this option to create a brand new report\n\t\t// False: existing data will remain, new tests will be appended to the existing\n\t\t// report. If the the supplied path does not exist, a new file will be created.\n\t\textent = new ExtentReports(System.getProperty(\"user.dir\") + \"/test-output/ExtentReport.html\", true);\n\t\t// extent.addSystemInfo(\"Environment\",\"Environment Name\")\n\t\textent.addSystemInfo(\"Host Name\", \"SoftwareTestingMaterial\").addSystemInfo(\"Environment\", \"Automation Testing\")\n\t\t\t\t.addSystemInfo(\"User Name\", \"Rajkumar SM\");\n\t}",
"private void populateStationaryReport() {\n\t\tLRNumberRangeDTO[] stationaryReportDTO = null;\n\t\tint len = 0;\n\t\tint value = 0;\n\t\ttry {\n\t\t\ttblStationaryReport.removeAll();\n\t\t\tstationaryReportDTO = handler.getStationaryReport();\n\n\t\t\tif (stationaryReportDTO != null) {\n\t\t\t\tlen = stationaryReportDTO.length;\n\t\t\t\tfor (int i = 0; i < len; i++) {\n\t\t\t\t\tTableItem item = new TableItem(tblStationaryReport,\n\t\t\t\t\t\t\tSWT.NONE);\n\n\t\t\t\t\titem.setText(0, String.valueOf(i + 1));\n\t\t\t\t\titem.setText(1, stationaryReportDTO[i].getStationCode());\n\t\t\t\t\tvalue = stationaryReportDTO[i].getTopay();\n\t\t\t\t\tif (value == 1) {\n\t\t\t\t\t\titem.setText(2, \"Assign\");\n\t\t\t\t\t\titem.setForeground(2, Display.getCurrent()\n\t\t\t\t\t\t\t\t.getSystemColor(SWT.COLOR_RED));\n\t\t\t\t\t} else {\n\t\t\t\t\t\titem.setText(2, EMPTY_STRING);\n\t\t\t\t\t}\n\t\t\t\t\tvalue = stationaryReportDTO[i].getPaid();\n\t\t\t\t\tif (value == 1) {\n\t\t\t\t\t\titem.setText(3, \"Assign\");\n\t\t\t\t\t\titem.setForeground(3, Display.getCurrent()\n\t\t\t\t\t\t\t\t.getSystemColor(SWT.COLOR_RED));\n\t\t\t\t\t} else {\n\t\t\t\t\t\titem.setText(3, EMPTY_STRING);\n\t\t\t\t\t}\n\n\t\t\t\t\tvalue = stationaryReportDTO[i].getBilling();\n\t\t\t\t\tif (value == 1) {\n\t\t\t\t\t\titem.setText(4, \"Assign\");\n\t\t\t\t\t\titem.setForeground(4, Display.getCurrent()\n\t\t\t\t\t\t\t\t.getSystemColor(SWT.COLOR_RED));\n\t\t\t\t\t} else {\n\t\t\t\t\t\titem.setText(4, EMPTY_STRING);\n\t\t\t\t\t}\n\n\t\t\t\t\tvalue = stationaryReportDTO[i].getCr();\n\t\t\t\t\tif (value == 1) {\n\t\t\t\t\t\titem.setText(5, \"Assign\");\n\t\t\t\t\t\titem.setForeground(5, Display.getCurrent()\n\t\t\t\t\t\t\t\t.getSystemColor(SWT.COLOR_RED));\n\t\t\t\t\t} else {\n\t\t\t\t\t\titem.setText(5, EMPTY_STRING);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t} catch (Exception exception) {\n\t\t\texception.printStackTrace();\n\t\t}\n\n\t}",
"private void initExcelReport() {\n DocumentItem documentItem = new DocumentItem(\"Source Node ID\", \"File Name\", \"Target Destination Folder\", \"Target Node ID\", null, \"Target Node Status\", \"Message\", null, null);\n ExcelUtil.addMigrationRow(jobParameters.getMigrationReport(), \"Date Time\", \"Source Node Status\", \"Source Destination Folder\", documentItem);\n ExcelUtil.addErrorRow(jobParameters.getErrorReport(), \"Date Time\", \"Source Node Status\", \"Source Destination Folder\", documentItem);\n }",
"private void todayReport() {\n\t\tListSeries dollarEarning = new ListSeries();\n\t\tString[] dates = new String[1];\n\t\t/* Create a DateField with the default style. */\n Calendar calendar=Calendar.getInstance();\n\t\t\n\t\tvReportDisplayLayout.removeAllComponents();\n\t\tdates[0] = String.valueOf(calendar.get(Calendar.MONTH)+1) + \"/\" + \n\t\t\t\tString.valueOf(calendar.get(Calendar.DATE)) + \"/\" + \n\t\t\t\tString.valueOf(calendar.get(Calendar.YEAR));\n\t\tdollarEarning = getTodayData();\n\t\t\n\t\tdisplayChart chart = new displayChart();\n\t\t\n\t\tdReportPanel.setContent(chart.getDisplayChart(dates, dollarEarning));\n\t\tvReportDisplayLayout.addComponent(dReportPanel);\n\t}",
"private void generateIncomingReport() {\r\n\r\n\t\tStringBuilder stringBuilder = new StringBuilder();\r\n\t\tstringBuilder.append(\"\\n----------------------------------------\\n\")\r\n\t\t\t\t.append(\" Incoming Daily Amount \\n\")\r\n\t\t\t\t.append(\"----------------------------------------\\n\")\r\n\t\t\t\t.append(\" Date | Trade Amount \\n\")\r\n\t\t\t\t.append(\"-----------------+----------------------\\n\");\r\n\t\tallIncomings.entrySet().forEach(\r\n\t\t\t\tkey -> stringBuilder.append(key.getKey() + \" | \" + key.getValue().get() + \"\\n\"));\r\n\t\tdataWriter.write(stringBuilder.toString());\r\n\t}",
"@Override\n public ResponseEntity<?> createReport(OutputReport report) throws IOException, MessagingException {\n Date endDate = midnight();\n Date startDate = midnight();\n if (report.getReportType() == 0) {\n endDate = midnight();\n startDate = setDateBefore(1);\n } else if (report.getReportType() == 1) {\n endDate = midnight();\n startDate = setDateBefore(7);\n } else if (report.getReportType() == 2) {\n endDate = midnight();\n startDate = setDateBefore(30);\n } else if (report.getReportType() == 3) {\n endDate = new Date(report.getEndDate());\n startDate = new Date(report.getStartDate());\n }\n ExcelHelper.writeExcel(report.getReportItemList(), \"NiceJavaBooks.xls\", report.getTotalRevenue());\n Place place = placeRepository.findById(report.getPlaceId()).get();\n String content = \"\";\n if(report.getReportType() == 0){\n content = \"Daily sales report\";\n }else if(report.getReportType() == 1){\n content = \"Weekly sales report\";\n }else if(report.getReportType() == 2){\n content = \"Monthly sales report\";\n }else if(report.getReportType() == 3){\n SimpleDateFormat formatter = new SimpleDateFormat(\"dd/MM/yyyy\");\n content = \"Sales report from \"+formatter.format(startDate)+\" to \"+formatter.format(endDate);\n }\n sendEmail(new File(\"NiceJavaBooks.xls\"), place.getMail(), content);\n return ResponseEntity.ok(\"OK\");\n }",
"public void summaryReport() {\r\n\r\n\t\tString strTimeStamp = new SimpleDateFormat(\"yyyy-MM-dd-HH-mm-ss\").format(new Date());\r\n\t\tString reportPath = new File(\"Report\").getAbsolutePath();\r\n\t\tint stepPassed = 0;\r\n\t\tint stepFailed = 0;\r\n\t\tString cssData = \"\";\r\n\r\n\t\ttry {\r\n\t\t\tString cssPath = new File(\"Report\\\\Style\\\\style.css\").getAbsolutePath();\r\n\t\t\tbufferedReader = new BufferedReader(new FileReader(cssPath));\r\n\r\n\t\t\tStringBuilder stringBuilder = new StringBuilder();\r\n\t\t\tString line = bufferedReader.readLine();\r\n\t\t\twhile (line != null) {\r\n\t\t\t\tstringBuilder.append(line);\r\n\t\t\t\tstringBuilder.append(System.lineSeparator());\r\n\t\t\t\tline = bufferedReader.readLine();\r\n\t\t\t}\r\n\t\t\tcssData = stringBuilder.toString();\r\n\t\t} catch (Exception ex) {\r\n\t\t\tLog.error(\"Exception occure in reading file\" + ex.getMessage());\r\n\t\t\tex.printStackTrace();\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tbufferedReader.close();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tLog.error(\"Exception occure in reading file\");\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\tFile HTMLDir = new File(reportPath + \"\\\\HTMLReport\");\r\n\t\tif (!HTMLDir.exists()) {\r\n\t\t\ttry {\r\n\t\t\t\tHTMLDir.mkdir();\r\n\t\t\t} catch (SecurityException ex) {\r\n\t\t\t\tLog.error(\"Error in creating HTMLReport directory\" + ex.getMessage());\r\n\t\t\t\t// log.error(\"Error in creating Detail directory\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tString htmlname = HTMLDir + \"\\\\\" + strTimeStamp + \".html\";\r\n\t\tString logoPath = new File(\"Report\\\\Style\\\\logo.png\").getAbsolutePath();\r\n\t\tfor (ReportBean reportValue : GlobalVariables.getReportList()) {\r\n\t\t\tif (reportValue.getStatus().equalsIgnoreCase(\"Failed\")) {\r\n\t\t\t\tstepFailed++;\r\n\t\t\t} else if (reportValue.getStatus().equalsIgnoreCase(\"Passed\")) {\r\n\t\t\t\tstepPassed++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tstrBufferReportAppend = new StringBuffer();\r\n\t\ttry {\r\n\t\t\tbufferedWriter = new BufferedWriter(new FileWriter(htmlname));\r\n\t\t} catch (IOException e) {\r\n\t\t\tLog.error(\"Error in wrinting the file\" + e.getMessage());\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tstrBufferReportAppend.append(\r\n\t\t\t\t\"<html><head><script type=\\\"text/javascript\\\" src=\\\"https://www.gstatic.com/charts/loader.js\\\"></script>\");\r\n\t\tstrBufferReportAppend.append(\"<script src=\\\"https://www.google.com/jsapi\\\"></script>\");\r\n\t\tstrBufferReportAppend.append(\"<style>\" + cssData);\r\n\t\tstrBufferReportAppend.append(\"</style>\");\r\n\t\tstrBufferReportAppend.append(\"</head><body>\");\r\n\t\tstrBufferReportAppend.append(\"<table class=\\\"width100\\\">\");\r\n\t\tstrBufferReportAppend.append(\"<tr><td>\");\r\n\t\tstrBufferReportAppend.append(\"<table class=\\\"width100\\\">\");\r\n\t\tstrBufferReportAppend.append(\"<tr><td><img src=file:\\\\\\\\\" + logoPath + \"></td>\" + \"<td class=\\\"headertext\\\">\"\r\n\t\t\t\t+ reportHeader + \"</td>\");\r\n\r\n\t\tstrBufferReportAppend.append(\"</tr></table><hr></hr>\");\r\n\t\tstrBufferReportAppend.append(\"</td></tr>\");\r\n\t\tstrBufferReportAppend.append(\"<tr><td>\");\r\n\t\tstrBufferReportAppend.append(\"<table class=\\\"width100\\\">\");\r\n\t\tstrBufferReportAppend.append(\"<tr><td class=\\\"width50\\\">\");\r\n\t\tstrBufferReportAppend.append(\"<table cellpadding=3 cellspacing=1>\");\r\n\t\tstrBufferReportAppend\r\n\t\t.append(\"<tr><td class=\\\"width50 bold\\\">Execution Start Time</td><td class=\\\"width50 bold\\\">\"\r\n\t\t\t\t+ GlobalVariables.getStrStartTime() + \"</td></tr>\");\r\n\t\tstrBufferReportAppend\r\n\t\t.append(\"<tr><td class=\\\"width50 bold\\\">Execution End Time</td><td class=\\\"width50 bold\\\">\"\r\n\t\t\t\t+ GlobalVariables.getStrEndTime() + \"</td></tr>\");\r\n\t\tstrBufferReportAppend\r\n\t\t\t\t.append(\"<tr><td class=\\\"width50 bold\\\">Total TestSteps Executed</td><td class=\\\"width50 bold\\\">\"\r\n\t\t\t\t\t\t+ (stepFailed + stepPassed) + \"</td></tr>\");\r\n\t\tstrBufferReportAppend.append(\r\n\t\t\t\t\"<tr><td class=\\\"width50 green\\\">Passed</td><td class=\\\"width50 green\\\">\" + stepPassed + \"</td></tr>\");\r\n\t\tstrBufferReportAppend.append(\r\n\t\t\t\t\"<tr><td class=\\\"width50 red\\\">Failed</td><td class=\\\"width50 red\\\">\" + stepFailed + \"</td></tr>\");\r\n\t\tstrBufferReportAppend.append(\"</table></td>\");\r\n\t\tstrBufferReportAppend.append(\"<td class=\\\"width50\\\">\");\r\n\t\tstrBufferReportAppend.append(\"<table>\");\r\n\t\tstrBufferReportAppend.append(\"<tr><td class=\\\"width25\\\">\");\r\n\t\tstrBufferReportAppend.append(\"</td>\");\r\n\t\tstrBufferReportAppend.append(\"<td class=\\\"width25\\\">\");\r\n\t\tstrBufferReportAppend.append(\"<script type=\\\"text/javascript\\\">\");\r\n\t\tstrBufferReportAppend.append(\"google.charts.load('current', {'packages':['corechart']});\");\r\n\t\tstrBufferReportAppend.append(\"google.charts.setOnLoadCallback(drawDetailsChart);\");\r\n\t\tstrBufferReportAppend.append(\"function drawDetailsChart() {\");\r\n\t\tstrBufferReportAppend.append(\"var data = new google.visualization.DataTable();\");\r\n\t\tstrBufferReportAppend.append(\"data.addColumn('string', 'Test Execution Detail Graph');\");\r\n\t\tstrBufferReportAppend.append(\"data.addColumn('number', 'Count');\");\r\n\t\tstrBufferReportAppend.append(\"data.addRows([\");\r\n\t\tstrBufferReportAppend.append(\"['Passed',\" + stepPassed + \"],\");\r\n\t\tstrBufferReportAppend.append(\"['Failed',\" + stepFailed + \"]]);\");\r\n\t\tstrBufferReportAppend\r\n\t\t\t\t.append(\"var options = {'title':'Test Step Details Graph',colors: ['#12C909', '#C3100A'],pieHole: 0.3,\");\r\n\t\tstrBufferReportAppend.append(\"'width':300,\");\r\n\t\tstrBufferReportAppend.append(\"'height':170};\");\r\n\t\tstrBufferReportAppend\r\n\t\t\t\t.append(\"var chart = new google.visualization.PieChart(document.getElementById('detailsChart_div'));\");\r\n\t\tstrBufferReportAppend.append(\"chart.draw(data, options); } </script>\");\r\n\t\tstrBufferReportAppend.append(\"<div id=\\\"detailsChart_div\\\"></div>\");\r\n\t\tstrBufferReportAppend.append(\"</td></tr></table>\");\r\n\t\tstrBufferReportAppend.append(\"</td></tr></table><hr></hr></td></tr>\");\r\n\t}",
"protected Report()\n {\n super();\n }",
"private void startReport() {\r\n // initialize the HtmlReporter\r\n htmlReporter = new ExtentHtmlReporter(System.getProperty(\"user.dir\")\r\n + jsonConfig.get(\"extentReportPath\") + \"testReport.html\");\r\n\r\n //initialize ExtentReports and attach the HtmlReporter\r\n extent = new ExtentReports();\r\n extent.attachReporter(htmlReporter);\r\n\r\n //To add system or environment info by using the setSystemInfo method.\r\n extent.setSystemInfo(\"OS\", (String) jsonConfig.get(\"osValue\"));\r\n switch ((String) jsonConfig.get(\"browserToBeUsed\")) {\r\n case \"FF\":\r\n extent.setSystemInfo(\"Browser\", \"Firefox\");\r\n break;\r\n case \"CH\":\r\n extent.setSystemInfo(\"Browser\", \"Chrome\");\r\n break;\r\n case \"IE\":\r\n extent.setSystemInfo(\"Browser\", \"Internet Explorer\");\r\n break;\r\n }\r\n\r\n //configuration items to change the look and feel\r\n //add content, manage tests etc\r\n htmlReporter.config().setChartVisibilityOnOpen(true);\r\n htmlReporter.config().setDocumentTitle(\"Test Report\");\r\n htmlReporter.config().setReportName(\"Test Report\");\r\n htmlReporter.config().setTestViewChartLocation(ChartLocation.TOP);\r\n htmlReporter.config().setTheme(Theme.STANDARD);\r\n htmlReporter.config().setTimeStampFormat(\"EEEE, MMMM dd, yyyy, hh:mm a '('zzz')'\");\r\n }",
"public void create_crystal() {\n\t\tcrystalQuantity[1] += (1+create_modifier);\n\t\tautomerge();\n\t\tcollection();\n\t}",
"public void setWaterFee(Integer waterFee) {\n this.waterFee = waterFee;\n }",
"@BeforeTest\n\tpublic void startReport() {\n\t\textent = new ExtentReports(System.getProperty(\"user.dir\")+\"//extent-reports//myreport.html\",true);\n\t\textent.addSystemInfo(\"Host Name\", \"LocalHost\");\n\t\textent.addSystemInfo(\"Environment\", \"QA\");\n\t\textent.addSystemInfo(\"User Name\", \"Prasanta\");\n\t\textent.loadConfig(new File(System.getProperty(\"user.dir\")+\"//ReportsConfig.xml\"));\n\t}",
"private void pump_water() {\n\t\t\r\n\t}",
"private void generateReports() {\r\n\t\tLOGGER.debug(\"Report generation trigerred\");\r\n\t\tgenerateIncomingReport();\r\n\t\tgenerateOutgoingReport();\r\n\t\tgenerateIncomingRankingReport();\r\n\t\tgenerateOutgoingRankingReport();\r\n\t\tLOGGER.debug(\"Report generation completed\");\r\n\t}",
"public void generateReport(TaxChallan bean, HttpServletRequest request, HttpServletResponse response, String reportPath) {\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tReportDataSet rds = new ReportDataSet();\r\n\t\t\tString type = bean.getReportType();\r\n\t\t\trds.setReportType(type);\r\n\t\t\tString fileName = \"T.D.S.-TCS TAX CHALLAN\"+Utility.getRandomNumber(1000);\r\n\t\t\tString reportPathName=reportPath+fileName+\".\"+type;\r\n\t\t\trds.setFileName(fileName);\r\n\t\t\trds.setPageSize(\"A4\");\r\n\t\t\trds.setReportHeaderRequired(false);\r\n\t\t\trds.setShowPageNo(true);\r\n\t\t\torg.paradyne.lib.ireportV2.ReportGenerator rg=null;\r\n\t\t\t/* Added by Prashant*/\r\n\t\t\tif(reportPath.equals(\"\")){\r\n\t\t\t\trg = new org.paradyne.lib.ireportV2.ReportGenerator(rds, session, context, request);\r\n\t\t\t}else{\r\n\t\t\t\tlogger.info(\"################# ATTACHMENT PATH #############\"+reportPath+fileName+\".\"+type);\r\n\t\t\t\trg = new org.paradyne.lib.ireportV2.ReportGenerator(rds, reportPath ,session, context, request);\r\n\t\t\t\trequest.setAttribute(\"reportPath\", reportPath+fileName+\".\"+type);\r\n\t\t\t\trequest.setAttribute(\"fileName\", fileName+\".\"+type);\r\n\t\t\t\trequest.setAttribute(\"action\", \"TaxChallan_input.action\");\r\n\t\t\t}\r\n\t\t\trg = getReport(rg, bean);\r\n\t\t\trg.process();\r\n\t\t\tif(reportPath.equals(\"\")){\r\n\t\t\t\trg.createReport(response);\r\n\t\t\t}else{\r\n\t\t\t\t/* Generates the report as attachment*/\r\n\t\t\t\trg.saveReport(response);\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"public Report() {\r\n }",
"public void getSettledTransactionReport(HashMap<String, String> params) {\n\t\tQUERY_BY_SETTLEMENT = \"1\";\n\t\tREPORT_START = params.get(\"reportStart\");\n\t\tREPORT_END = params.get(\"reportEnd\");\n\t\tQUERY_BY_HIERARCHY = params.get(\"subaccountsSearched\");\n\t\tDO_NOT_ESCAPE = params.get(\"doNotEscape\");\n\t\tEXCLUDE_ERRORS = params.get(\"excludeErrors\");\n\t\tAPI = \"bpdailyreport2\";\n\t}",
"public abstract void temperatureReport();",
"private void setDailyValues(){\n //set updateTime\n SimpleDateFormat t = new SimpleDateFormat(\"h:mm:ss a\");\n updatedTime = \"Last updated: \" + t.format(new Date(System.currentTimeMillis()));\n \n //set maxTemp and minTemp\n maxTemp = Integer.toString(weather.getMaxTemp());\n minTemp = Integer.toString(weather.getMinTemp());\n \n //set sunriseTime and sunsetTime\n SimpleDateFormat sr = new SimpleDateFormat(\"h:mm a\");\n sunriseTime = sr.format(new Date(weather.getSunrise()*1000));\n SimpleDateFormat ss = new SimpleDateFormat(\"h:mm a\");\n sunsetTime = sr.format(new Date(weather.getSunset()*1000));\n }",
"private void setAndWriteFiles()\n\t{\n\t\tSensorConfiguration config = new SensorConfiguration();\n\t\tString versionMajor = ConfigurationInterface_v1_0.VERSION.substring(0,\n\t\t\t\tConfigurationInterface_v1_0.VERSION.indexOf('.'));\n\t\tString versionMinor = ConfigurationInterface_v1_0.VERSION\n\t\t\t\t.substring(ConfigurationInterface_v1_0.VERSION.indexOf('.') + 1);\n\t\tconfig.setConfigurationInterfaceVersion(versionMajor, versionMinor);\n\n\t\tStartModes startModes = new StartModes();\n\t\t// set startMode for sensorConfiguration\n\t\tfor (StartMode element : startModes.getStartModeList())\n\t\t{\n\t\t\tif (element.getName().equals(\"DEFINED_TIME\"))\n\t\t\t{\n\t\t\t\tconfig.setStartMode(element);\n\t\t\t}\n\t\t}\n\n\t\tConfigurationSets configSets = new ConfigurationSets();\n\t\t// set configurationSet for sensorConfiguration\n\t\tfor (ConfigurationSet element : configSets.getConfigSetList())\n\t\t{\n\t\t\tif (element.getName().equals(\"mesana\"))\n\t\t\t{\n\n\t\t\t\tconfig.setConfigurationSet(element);\n\t\t\t}\n\t\t}\n\n\t\tif (config.getStartMode().getName().equals(\"DEFINED_TIME\"))\n\t\t{\n\n\t\t\tCalendar calendar = Calendar.getInstance();\n\t\t\tcalendar.set(Calendar.DAY_OF_MONTH, 10);\n\t\t\tcalendar.set(Calendar.HOUR_OF_DAY, 5);\n\t\t\tcalendar.set(Calendar.MINUTE, 11);\n\t\t\tDate date = calendar.getTime();\n\t\t\tconfig.setRecordingStartTime(date);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tconfig.setRecordingStartTime(null);\n\t\t}\n\t\t\n\t\tconfig.setRecordingDuration(12000);\n\t\t\n\t\ttry\n\t\t{\n\t\t\tConnectionManager.getInstance().currentSensor(0).setSensorConfiguration(config);\n\t\t\t\n\t\t\tConnectionManager.getInstance().currentSensor(0).writeConfigFile();\n\t\t\t\n\t\t\t// write Encrypted data to sensor\n\t\t\tConnectionManager.getInstance().currentSensor(0).writeEncryptedParameters(\"123456789abcd12\");\n\t\t\t\n\t\t\tint index = customerList.getSelectionIndex();\n\t\t\tif (index >= 0 && index <= mCollect.getList().size())\n\t\t\t{\n\t\t\t\tString linkId = mCollect.getList().get(index).getLinkId();\n\t\t\t\tconfig.addParameter(\"LinkId\", linkId);\n\t\t\t}\n\t\t\t// write custom data to additional file in sensor\n\t\t\tConnectionManager.getInstance().currentSensor(0).writeCustomFile();\n\t\t}\n\t\tcatch (SensorNotFoundException e)\n\t\t{\n\t\t\tstatusBar.setText(e.getMessage());\n\t\t}\n\t}",
"public abstract void getReport(java.io.Writer writer);",
"public TimeStampReport toTimeStampReport(){\t\t\n\t\tMap<Integer,PlayerWealthDataReport> wData = new HashMap<>();\n\t\tfor(PlayerWealthDataAccumulator w : _wealthData.values()){\n\t\t\twData.put(w.ownerID, w.toPlayerWealthDataReport());\n\t\t}\n\n\t\treturn new TimeStampReport(_time,wData);\n\t}",
"boolean generateReport();",
"public WaterMeter()\r\n\t{\r\n\t\tsuper(DeviceTypeEnum.WATER_METER);\r\n\t}",
"public HotelReport(Hotel myHotel) {\n\t\t/*\n\t\t * Constructor method which sets the hotel to be reported\n\t\t */\n\t\tsetHotel(myHotel);\n\t}",
"public void setBoreholeWaterSupplyPerDay(double w) {\n\n this.waterCapacityBorehole = w;\n }",
"public Report(Employee employee, int numberOfReports){\n this.employee=employee;\n this.numberOfReports=numberOfReports;\n }",
"@Test\n public void testAddingReport() {\n Assert.assertEquals(\"Incorrect initial water report list size\", 0,\n theModel.getReportList().size());\n try {\n Account holder = new Account(1, \"bills\", \"bills\", Credential.ADMIN);\n WaterReport a = new WaterReport(holder, \"Bottled\", \"Waste\",\n \"Today\", new Location(45, 50));\n WaterReport b = new WaterReport(holder, \"Well\",\n \"Potable\", \"Today\", new Location(30, 25));\n WaterReport c = new WaterReport(holder, \"Stream\",\n \"Treatable - Muddy\", \"Today\", new Location(20, 65));\n theModel.addReport(a);\n theModel.addReport(b);\n theModel.addReport(c);\n Assert.assertEquals(\"WaterReport list size incorrect after adding\", 3,\n theModel.getReportList().size());\n } catch (Exception e) {\n Assert.fail(\"adding water reports should not have failed here\");\n e.printStackTrace();\n }\n }",
"public final void createReporter(){\n\n buildWriter();\n buildReporter();\n buildCloser();\n\n Validate.notNull(writer,\"Writer can not be null\");\n Validate.notNull(reporter,\"Reporter can not be null\");\n Validate.notNull(closer,\"Closer can not be null\");\n }",
"public BeansReportWrittenExamination() {\n\t\tsuper();\n\t}",
"private void buildReport() {\n StringBuilder stringBuilder = new StringBuilder();\n\n // Header of report\n stringBuilder.append(\"Games\\tCPU wins\\t\"\n + \"Human wins\\tDraw avg\\tMax rounds\\n\");\n stringBuilder.append(\"=============================================\\n\");\n\n // shows the number of overall games\n stringBuilder.append(dbConnection.executeQuery(\"SELECT COUNT(game_id) FROM game\", \"count\"));\n stringBuilder.append(\"\\t\");\n // shows the number of times the computer won\n stringBuilder.append(dbConnection.executeQuery(\"SELECT COUNT(game_id) FROM game WHERE winner = 'CPU'\", \"count\"));\n stringBuilder.append(\"\\t\");\n // shows the number of times the human player won\n stringBuilder.append(dbConnection.executeQuery(\"SELECT COUNT(game_id) FROM game WHERE winner = 'human'\", \"count\"));\n stringBuilder.append(\"\\t\");\n // shows the average number of draws per game\n stringBuilder.append((int)Float.parseFloat(dbConnection.executeQuery(\"SELECT AVG(draws) FROM game\", \"avg\")));\n stringBuilder.append(\"\\t\");\n // shows the maximum number of rounds played\n stringBuilder.append(dbConnection.executeQuery(\"SELECT MAX(rounds) FROM game\", \"max\"));\n\n // Converts stringBuilder to a String\n reportContent = stringBuilder.toString();\n }",
"@AfterClass\n\tpublic static void generateReport() {\n\t\tCucumberReportingConfig.reportConfig();\n\t\n\t}",
"abstract public void report();",
"public void getReportData(WalkInReport report) {\n\t\tnewReport2 = report;\n\t\tnewReport2.clearConclusions();\n\t\tfor(int i=0;i<newReport2.table.size();i++) {\n\t\t\tSample newBacteroidesSample = newReport2.table.get(i);\n\t\t\ttable.getItems().add(newBacteroidesSample);\n\t\t\taddConclusionNumber(newBacteroidesSample);\n\t\t}\n\t}",
"private WeatherReport getReport(WeatherReport report, JSONObject reportObject) {\n\t\tJSONObject mainObject;\n\t\tJSONObject sysObject;\n\t\tJSONArray weatherArray;\n\t\ttry {\n\t\t\tmainObject = reportObject.getJSONObject(\"main\");\n\t\t\t\n\t\t\treport.setCurrentTemperature(convertToCelsius(mainObject.getString(\"temp\")));\n\t\t\treport.setHumidity(mainObject.getString(\"humidity\"));\n\t\t\treport.setMinTemperature(convertToCelsius(mainObject.getString(\"temp_min\")));\n\t\t\treport.setMaxTemperature(convertToCelsius(mainObject.getString(\"temp_max\")));\n\t\t\t\n\t\t\tsysObject = reportObject.getJSONObject(\"sys\");\n\t\t\treport.setCountry(sysObject.getString(\"country\"));\n\t\t\t\n\t\t\tweatherArray = reportObject.getJSONArray(\"weather\");\n\t\t\treport.setDescription(weatherArray.getJSONObject(0).getString(\"description\"));\n\t\t\t\n\t\t} catch (JSONException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t\n\t\treturn report;\n\t}",
"public static ExtentReports createInstance() {\n\n\t\tExtentHtmlReporter htmlReporter = new ExtentHtmlReporter(Constants.EXTENTREPORT_PATH+\"---\"+ScreenShot.timeStamp()+\".html\");\n\t\thtmlReporter.config().setTestViewChartLocation(ChartLocation.BOTTOM);\n\t\thtmlReporter.config().setChartVisibilityOnOpen(true);\n\t\thtmlReporter.config().setTheme(Theme.DARK);\n\t\thtmlReporter.config().setReportName(\"Functional Report\");\n\t\thtmlReporter.config().setEncoding(\"utf-8\");\n\t\thtmlReporter.config().setDocumentTitle(\"AutoMation Report\");\n\n\t\thtmlReporter.config().setTimeStampFormat(\"EEEE, MMMM dd, yyyy, hh:mm a '('zzz')'\");\n\n\t\textent = new ExtentReports();\n\t\textent.attachReporter(htmlReporter);\n\t\textent.setSystemInfo(\"OS\", \"Windows\");\n\t\textent.setSystemInfo(\"AUT\", \"QA\");\n\n\t\treturn extent;\n\t}",
"private void report() {\n\t\t\n\t}",
"public void getTransactionReport(HashMap<String, String> params) {\n\t\tQUERY_BY_SETTLEMENT = \"0\";\n\t\tREPORT_START = params.get(\"reportStart\");\n\t\tREPORT_END = params.get(\"reportEnd\");\n\t\tQUERY_BY_HIERARCHY = params.get(\"subaccountsSearched\");\n\t\tDO_NOT_ESCAPE = params.get(\"doNotEscape\");\n\t\tEXCLUDE_ERRORS = params.get(\"excludeErrors\");\n\t\tAPI = \"bpdailyreport2\";\n\t}",
"public void writeReport() {\n\t\tint gridSize = 55; // Total character spaces between the borders\n\t\tprint(\"+-------------------------------------------------------+\");\n\t\tprint(String.format(\"|%s|\", centerName(gridSize)));\n\t\tprint(\"+---------------+---------------------------------------+\");\n\t\t/*\n\t\t * Loops through each room in the hotel and prints out the relevant\n\t\t * information on a new line And draws southern, eastern and western\n\t\t * borders to allow it to connect up to the main table.\n\t\t */\n\t\tfor (int i = 0; i < myHotel.getSize(); i++) {\n\t\t\tprint(formatRooms(i).toUpperCase());\n\t\t\tprint(formatAmount(i).toUpperCase());\n\t\t\tprint(formatSleepAmount(i).toUpperCase());\n\t\t\tprint(formatOccupied(i).toUpperCase());\n\t\t\tprint(\"+---------------+---------------------------------------+\");\n\t\t}\n\t\t/*\n\t\t * After every hotel room's information has been displayed The overall\n\t\t * hotel information is displayed such as total occupancy, if there is a\n\t\t * vacancy. And if there is a vacancy, the total amount of free rooms\n\t\t * and beds.\n\t\t */\n\t\tprint(String.format(\"| Hotel\\t\\t|\\tTotal Occupancy:\\t%s\\t|\", getHotel().getTotalOccupancy()).toUpperCase());\n\t\tprint(String.format(\"| information:\\t|\\tHas Vacancies:\\t\\t%s\\t|\", convertBoolean(getHotel().getVacancies()))\n\t\t\t\t.toUpperCase());\n\t\tif (getHotel().getVacancies()) {\n\t\t\tprint(String.format(\"|\\t\\t|\\tVacant Rooms:\\t\\t%s\\t|\", getHotel().getEmptyRooms()).toUpperCase());\n\t\t\tprint(String.format(\"|\\t\\t|\\tVacant Beds:\\t\\t%s\\t|\", getHotel().getTotalVacancy()).toUpperCase());\n\t\t}\n\t\t/*\n\t\t * Draws a final southern border to close the table\n\t\t */\n\t\tprint(\"+---------------+---------------------------------------+\");\n\t}",
"private void reportType() {\n\t\tVerticalLayout vReportLayout = new VerticalLayout();\n\t\tvReportLayout.addStyleName(Reindeer.PANEL_LIGHT);\n\t\tvReportLayout.setWidth(\"150px\");\n\t\tVerticalLayout bSpace = new VerticalLayout();\n\t\tbSpace.setHeight(\"25px\");\n\t\troot.addComponent(bSpace);\n\t\t\n\t\tButton todayButton = new Button(\"TODAY\");\n\t\ttodayButton.setWidth(\"100%\");\n\t\ttodayButton.addClickListener(new Button.ClickListener() {\n\t\t /**\n\t\t\t * \n\t\t\t */\n\t\t\tprivate static final long serialVersionUID = 1L;\n\n\t\t\tpublic void buttonClick(ClickEvent event) {\n\t\t //Notification.show(event.getButton().getCaption());\n\t\t \tif (event.getButton().getCaption() != null) {\n\t\t\t\t\tupdateReportLayout(event.getButton().getCaption());\n\t\t\t\t}\n\t\t \n\t\t }\n\t\t \n\t\t});\n\t\tvReportLayout.addComponent(todayButton);\n\t\t\n\t\tButton last30DaysButton = new Button(\"LAST 30 DAYS\");\n\t\tlast30DaysButton.setWidth(\"100%\");\n\t\tlast30DaysButton.addClickListener(new Button.ClickListener() {\n\t\t /**\n\t\t\t * \n\t\t\t */\n\t\t\tprivate static final long serialVersionUID = 1L;\n\n\t\t\tpublic void buttonClick(ClickEvent event) {\n\t\t \tif (event.getButton().getCaption() != null) {\n\t\t\t\t\tupdateReportLayout(event.getButton().getCaption());\n\t\t\t\t}\n\t\t \n\t\t }\n\t\t \n\t\t});\n\t\tvReportLayout.addComponent(last30DaysButton);\n\t\t\n\t\ttReportPanel.setContent(vReportLayout);\n\t\ttReportPanel.addStyleName(Reindeer.PANEL_LIGHT);\n\t\thorLayout.addComponent(tReportPanel);\n\t\troot.addComponent(horLayout);\n\t}",
"public WaterMeter(List<Alarm> alarmParam)\r\n\t{\r\n\t\tthis();\r\n\t\tsetAlarms(alarmParam);\r\n\t}",
"public org.paradyne.lib.ireportV2.ReportGenerator getReport(org.paradyne.lib.ireportV2.ReportGenerator rg, TaxChallan bean){\r\n\t\ttry {\r\n\t\t\tint toYear=Integer.parseInt(bean.getYear().substring(2))+1;\r\n\t\t\tString toYearStr =\"\";\r\n\t\t\tif(toYear < 10){\r\n\t\t\t\ttoYearStr = \"0\"+toYear;\r\n\t\t\t}else {\r\n\t\t\t\ttoYearStr =\"\"+toYear;\r\n\t\t\t}\r\n\t\t\tString assesmentYear = bean.getYear()+ \"-\"+ toYearStr;\r\n\t\t\tTableDataSet subtitleName = new TableDataSet();\r\n\t\t\tObject obj[][] = new Object[1][3];\r\n\t\t\t\r\n\t\t\tobj[0][0] = \"* Important : Please see notes \\noverleaf before filling up the challan\";\r\n\t\t\tobj[0][1] = \"T.D.S./TCS TAX CHALLAN\";\r\n\t\t\tobj[0][2] = \"Single Copy (to be sent to the ZAO)\";\r\n\t\t\tsubtitleName.setData(obj);\r\n\t\t\tsubtitleName.setCellAlignment(new int[] { 0, 1, 0 });\r\n\t\t\tsubtitleName.setCellWidth(new int[] { 30, 40, 30 });\r\n\t\t\tsubtitleName.setBorderDetail(3);\r\n\t\t\tsubtitleName.setHeaderTable(true);\r\n\t\t\trg.addTableToDoc(subtitleName);\r\n\t\t\t\r\n\t\t\tTableDataSet heading1 = new TableDataSet();\r\n\t\t\theading1.setData(new Object[][] { {\r\n\t\t\t\t\t\t\t\"CHALLAN NO./ \\nITNS \\n281\\n\\n\"+bean.getChallanNo(),\r\n\t\t\t\t\t\t\t\"Tax Applicable (Tick One)*\\nTAX DEDUCTED/COLLECTED AT SOURCE FROM\\n\\n(0020) COMPANY [__] \\t\\t\\t\\t(0021) NON-COMPANY [__] \\n\\n DEDUCTEES \\t\\t\\t\\t\\t\\t\\t DEDUCTEES\",\r\n\t\t\t\t\t\t\t\"Assesment Year \\n\\n\"+assesmentYear }});\r\n\t\t\theading1.setCellAlignment(new int[] { 1, 1, 1 });\r\n\t\t\theading1.setCellWidth(new int[] { 20, 60, 20 });\r\n\t\t\theading1.setBorderDetail(3);\r\n\t\t\trg.addTableToDoc(heading1);\r\n\t\t\t\r\n\t\t\tObject divAddress[][]=getSqlModel().getSingleResult(\"SELECT HRMS_DIVISION.DIV_NAME, NVL(HRMS_DIVISION.DIV_ADDRESS1,' '), NVL(HRMS_DIVISION.DIV_ADDRESS2,' '), NVL(HRMS_DIVISION.DIV_ADDRESS3,' '), NVL(HRMS_DIVISION.DIV_TANNO,' '), \"\r\n\t\t\t\t\t+\" HRMS_DIVISION.DIV_TELEPHONE, HRMS_DIVISION.DIV_PINCODE FROM HRMS_DIVISION WHERE HRMS_DIVISION.DIV_ID=\"+bean.getDivId());\r\n\t\t\t\r\n\t\t\tObject [][] empDataObj = new Object[4][1];\r\n \t\tempDataObj[0][0] = \"Tax Deduction Account No. (T.A.N.)\\n\"+divAddress[0][4];;\r\n \t\tempDataObj[1][0] = \"Full Name\\n\"+divAddress[0][0];\r\n \t\tempDataObj[2][0] = \"Complete Address with City & State\\n\"+divAddress[0][1]+\"\\n\"+\"\"+divAddress[0][2]+\"\\n\"+\"\"+divAddress[0][3];\r\n \t\tempDataObj[3][0] = \"Tel. No. : \"+checkNull(\"\"+divAddress[0][5])+\"\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\" +\r\n \t\t\t\t\"\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t Pin : \"+checkNull(\"\"+divAddress[0][6]);\r\n \t\t\r\n \t\t\r\n \t\tTableDataSet empData = new TableDataSet();\r\n\t\t\tempData.setData(empDataObj);\r\n\t\t\tempData.setCellAlignment(new int[] { 0 });\r\n\t\t\tempData.setCellWidth(new int[] { 100 });\r\n\t\t\tempData.setBorderDetail(3);\r\n\t\t\trg.addTableToDoc(empData);\r\n \t\t\r\n \t\tTableDataSet table1 = new TableDataSet();\r\n \t\ttable1.setData(new Object[][] { { \"Type of Payment\", \"Code * \" } });\r\n \t\ttable1.setCellAlignment(new int[] { 0, 2});\r\n \t\ttable1.setCellWidth(new int[] { 50, 50 });\r\n \t\ttable1.setBorderDetail(3);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tTableDataSet table2 = new TableDataSet();\r\n\t\t\ttable2.setData(new Object[][] { {\"(Tick One)\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\" +\r\n\t\t\t\t\t\"\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t(Please see overleaf)\" +\r\n\t\t\t\t\t\"\\n\\n\\n \\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tTDS/TCS Payable by Taxpayer\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t (200)\" +\r\n\t\t\t\t\t\"\\n\\n\\n \\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t TDS/TCS Regular Assessment (Raised by I.T. Deptt.)\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t(400)\\n\"}});\r\n\t\t\ttable2.setCellAlignment(new int[] {0});\r\n\t\t\ttable2.setCellWidth(new int[] { 100 });\r\n\t\t\ttable2.setBorderDetail(3);\r\n\t\t\t\r\n\t\t\tHashMap<String ,Object> map2 = rg.joinTableDataSet(table1, table2, false, 100);\r\n\t\t\t\r\n\t\t\tTableDataSet table3 = new TableDataSet();\r\n\t\t\ttable3.setData(new Object[][] { { \"DETAILS OF PAYMENTS\",\"Amount (in Rs. Only)\" }});\r\n\t\t\ttable3.setCellAlignment(new int[] { 0, 0});\r\n\t\t\ttable3.setCellWidth(new int[] { 50, 50});\r\n\t\t\ttable3.setBorderDetail(3);\r\n\t\t\t\r\n\t\t\tHashMap<String ,Object> map3 = rg.joinTableDataSet(map2, table3, false, 100);\r\n\t\t\t\r\n\t\t\tTableDataSet table4 = new TableDataSet();\r\n\t\t\ttable4.setData(new Object[][] { {\"Income Tax\",bean.getTax()},\r\n\t\t\t\t\t{\"Surcharge\",bean.getSurcharge()},\r\n\t\t\t\t\t{\"Education Cess\",bean.getEduCess()},\r\n\t\t\t\t\t{\"Interest\",bean.getIntAmt()},\r\n\t\t\t\t\t{\"Penalty\",bean.getOthrAmt()},\r\n\t\t\t\t\t{\"Total\",bean.getTotalTax()},\r\n\t\t\t\t\t{\"Total (in words)\",\"\"}});\r\n\t\t\ttable4.setCellAlignment(new int[] { 0, 0});\r\n\t\t\ttable4.setCellWidth(new int[] { 30, 70});\r\n\t\t\ttable4.setBorderDetail(3);\r\n\t\t\t\r\n\t\t\tHashMap<String ,Object> map4 = rg.joinTableDataSet(map3, table4, false, 100);\r\n\t\t\t\r\n\t\t\tString numberString [] = convert(Integer.parseInt(bean.getTotalTax().trim().replace(\".00\",\"\"))).split(\",\");\r\n\t\t\t\r\n\t\t\tObject totalInWord [][]= new Object [2][6];\r\n\t\t\ttotalInWord [0][0] = \"CRORE\";\r\n\t\t\ttotalInWord [0][1] = \"LACS\";\r\n\t\t\ttotalInWord [0][2] = \"THOUSAND\";\r\n\t\t\ttotalInWord [0][3] = \"HUNDRED\";\r\n\t\t\ttotalInWord [0][4] = \"TENS\";\r\n\t\t\ttotalInWord [0][5] = \"UNITS\";\r\n\t\t\t\r\n\t\t\tfor (int i = 0; i < numberString.length; i++) {\r\n\t\t\t\tif(numberString[i].equalsIgnoreCase(\"zero\")){\r\n\t\t\t\t\ttotalInWord [1][i] = \"Nil\";\r\n\t\t\t\t} else { \r\n\t\t\t\t\ttotalInWord [1][i] = numberString[i];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tTableDataSet table5 = new TableDataSet();\r\n\t\t\ttable5.setData(totalInWord);\r\n\t\t\ttable5.setCellAlignment(new int[] { 1, 1, 1, 1, 1, 1});\r\n\t\t\ttable5.setCellWidth(new int[] { 15, 15, 15, 15, 15, 15});\r\n\t\t\ttable5.setBorderDetail(3);\r\n\t\t\t\r\n\t\t\tHashMap<String ,Object> map5 = rg.joinTableDataSet(map4, table5, false, 100);\r\n\t\t\t\r\n\t\t\tTableDataSet table6 = new TableDataSet();\r\n\t\t\ttable6.setData(new Object[][] { {\"Paid in Cash/Debit to A/c /Cheque No.\"+bean.getChequeNo(), \"\", \"Dated\", bean.getChequeDate() }});\r\n\t\t\ttable6.setCellAlignment(new int[] { 1, 1, 1, 1});\r\n\t\t\ttable6.setCellWidth(new int[] { 50, 15, 20, 15});\r\n\t\t\ttable6.setBorderDetail(3);\r\n\t\t\t\r\n\t\t\tHashMap<String ,Object> map6 = rg.joinTableDataSet(map5, table6, false, 100);\r\n\t\t\t\r\n\t\t\tTableDataSet table7 = new TableDataSet();\r\n\t\t\ttable7.setData(new Object[][] { {\"Drawn on\", bean.getBank()}});\r\n\t\t\ttable7.setCellAlignment(new int[] { 0, 0});\r\n\t\t\ttable7.setCellWidth(new int[] { 50,50});\r\n\t\t\ttable7.setBorderDetail(3);\r\n\t\t\t\r\n\t\t\tHashMap<String ,Object> map7 = rg.joinTableDataSet(map6, table7, false, 100);\r\n\t\t\t\r\n\t\t\tTableDataSet table8 = new TableDataSet();\r\n\t\t\ttable8.setData(new Object[][] { {\"(Name of the Bank and Branch)\"}});\r\n\t\t\ttable8.setCellAlignment(new int[] { 2});\r\n\t\t\ttable8.setCellWidth(new int[] { 100 });\r\n\t\t\ttable8.setBorderDetail(3);\r\n\t\t\t\r\n\t\t\tHashMap<String ,Object> map8 = rg.joinTableDataSet(map7, table8, false, 100);\r\n\t\t\t\r\n\t\t\tTableDataSet table9 = new TableDataSet();\r\n\t\t\ttable9.setData(new Object[][] { {\"Date\", \"\"}});\r\n\t\t\ttable9.setCellAlignment(new int[] { 0, 0});\r\n\t\t\ttable9.setCellWidth(new int[] { 60, 40});\r\n\t\t\ttable9.setBorderDetail(3);\r\n\t\t\t\r\n\t\t\tHashMap<String ,Object> map9 = rg.joinTableDataSet(map8, table9, false, 100);\r\n\t\t\t\r\n\t\t\tTableDataSet table10 = new TableDataSet();\r\n\t\t\ttable10.setData(new Object[][] { {\"Signature of person making payment\"}});\r\n\t\t\ttable10.setCellAlignment(new int[] { 2 });\r\n\t\t\ttable10.setCellWidth(new int[] { 100});\r\n\t\t\ttable10.setBorderDetail(3);\r\n\t\t\t\r\n\t\t\tHashMap<String ,Object> map10 = rg.joinTableDataSet(map9, table10, false, 100);\r\n\t\t\t\r\n\t\t\tTableDataSet table11 = new TableDataSet();\r\n\t\t\ttable11.setData(new Object[][] { {\"Taxpayers Counterfoil (To be filled up by taxpayer)\"}});\r\n\t\t\ttable11.setCellAlignment(new int[] { 1 });\r\n\t\t\ttable11.setCellWidth(new int[] { 100});\r\n\t\t\ttable11.setBodyFontDetails(Font.FontFamily.HELVETICA, 8, Font.BOLD, new BaseColor(0, 0, 0));\r\n\t\t\ttable11.setBorderDetail(3);\r\n\t\t\t\r\n\t\t\tHashMap<String ,Object> map11 = rg.joinTableDataSet(map10, table11, false, 100);\r\n\t\t\t\r\n\t\t\tTableDataSet table12 = new TableDataSet();\r\n\t\t\ttable12.setData(new Object[][] { {\"TAN \"+divAddress[0][4]+\"\\n\\nReceived from \"+divAddress[0][0]}});\r\n\t\t\ttable12.setCellAlignment(new int[] { 0 });\r\n\t\t\ttable12.setCellWidth(new int[] { 100});\r\n\t\t\ttable12.setBorderDetail(3);\r\n\t\t\t\r\n\t\t\tHashMap<String ,Object> map12 = rg.joinTableDataSet(map11, table12, false, 100);\r\n\t\t\t\r\n\t\t\tTableDataSet table13 = new TableDataSet();\r\n\t\t\ttable13.setData(new Object[][] { {\"(Name)\"}});\r\n\t\t\ttable13.setCellAlignment(new int[] { 1 });\r\n\t\t\ttable13.setCellWidth(new int[] { 100 });\r\n\t\t\ttable13.setBorderDetail(3);\r\n\t\t\t\r\n\t\t\tHashMap<String ,Object> map13 = rg.joinTableDataSet(map12, table13, false, 100);\r\n\t\t\t\r\n\t\t\tTableDataSet table14 = new TableDataSet();\r\n\t\t\ttable14.setData(new Object[][] { {\"Cash/ Debit to A/c /Cheque No. :\"+bean.getChequeNo()+\"For Rs.\"+bean.getTotalTax().replace(\".00\", \"\")+\"/-\"}});\r\n\t\t\ttable14.setCellAlignment(new int[] { 1 });\r\n\t\t\ttable14.setCellWidth(new int[] { 100 });\r\n\t\t\ttable14.setBorderDetail(3);\r\n\t\t\t\r\n\t\t\tHashMap<String ,Object> map14 = rg.joinTableDataSet(map13, table14, false, 100);\r\n\t\t\t\r\n\t\t\tTableDataSet table15 = new TableDataSet();\r\n\t\t\ttable15.setData(new Object[][] { {\"Rs. (in words)\", Utility.convert(Integer.parseInt(bean.getTotalTax().trim().replace(\".00\", \"\")))}, {\"Drawn on\", bean.getBank()}});\r\n\t\t\ttable15.setCellAlignment(new int[] { 0, 1 });\r\n\t\t\ttable15.setCellWidth(new int[] { 30, 70 });\r\n\t\t\ttable15.setBorderDetail(3);\r\n\t\t\t\r\n\t\t\tHashMap<String ,Object> map15 = rg.joinTableDataSet(map14, table15, false, 100);\r\n\t\t\t\r\n\t\t\tTableDataSet table16 = new TableDataSet();\r\n\t\t\ttable16.setData(new Object[][] { {\"(Name of the Bank and Branch)\"}, \r\n\t\t\t\t\t{\"Company/Non-Company Deductees\"}, \r\n\t\t\t\t\t{\"on account of Tax Deducted at Source (TDS)/Tax Collected at Source (TCS) from____(Fill up Code)\"},\r\n\t\t\t\t\t{\"(Strike out whichever is not applicable)\"}});\r\n\t\t\ttable16.setCellAlignment(new int[] { 1 });\r\n\t\t\ttable16.setCellWidth(new int[] { 100 });\r\n\t\t\ttable16.setBorderDetail(3);\r\n\t\t\t\r\n\t\t\tHashMap<String ,Object> map16 = rg.joinTableDataSet(map15, table16, false, 100);\r\n\t\t\t\r\n\t\t\tTableDataSet table17 = new TableDataSet();\r\n\t\t\ttable17.setData(new Object[][] { {\"\\nfor the Assessment Year : \"+assesmentYear}});\r\n\t\t\ttable17.setCellAlignment(new int[] { 0});\r\n\t\t\ttable17.setCellWidth(new int[] { 100 });\r\n\t\t\ttable17.setBorderDetail(3);\r\n\t\t\t\r\n\t\t\tHashMap<String ,Object> map17 = rg.joinTableDataSet(map16, table17, false, 100);\r\n\t\t\t\r\n\t\t\tTableDataSet table18 = new TableDataSet();\r\n\t\t\ttable18.setData(new Object[][] { {\"\\n\\n\\n\\n\\n\\t\\t\\t\\t\\t\\t\\t\\tFOR USE IN RECEIVING BANK \\n\\n\\n\\n\\n\\n\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tDebit to A/c/Cheque credited on\\n\\n\\n\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tDD-MM-YY\\n\\n\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tSPACE FOR BANK SEAL\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nRs.\"}});\r\n\t\t\ttable18.setCellAlignment(new int[] { 0 });\r\n\t\t\ttable18.setCellWidth(new int[] {100});\r\n\t\t\ttable18.setBorderDetail(3);\r\n\r\n\t\t\tTableDataSet table19 = new TableDataSet();\r\n\t\t\ttable19.setData(new Object[][] { {\"\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tSPACE FOR BANK SEAL\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nRs.\"}});\r\n\t\t\ttable19.setCellAlignment(new int[] { 0 });\r\n\t\t\ttable19.setCellWidth(new int[] {100});\r\n\t\t\ttable19.setBorderDetail(3);\r\n\t\t\t//rg.addTableToDoc(table11);\r\n\t\t\t\r\n\t\t\tHashMap<String ,Object> map18 = rg.joinTableDataSet(table18, table19, false, 100);\r\n\t\t\t\r\n\t\t\tHashMap<String ,Object> map19 = rg.joinTableDataSet(map17, map18, true, 70);\r\n\t\t\t\r\n\t\t\trg.addTableToDoc(map19);\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn rg;\r\n\t}",
"public WaterMeter(Radio radio)\r\n\t{\r\n\t\tsuper(radio, DeviceTypeEnum.WATER_METER);\r\n\t}",
"public DefaultValidationReport()\r\n {\r\n factory = new DefaultReportFactory();\r\n }",
"public void calculateWaterSupply(String supplyZonesFilePath, String supplyValuesFilePath) {\r\n\t\tparseZones(new File(supplyZonesFilePath)); //fills the supplyZoneLines list.\r\n\r\n\t\tfillZoneNodeMap();\r\n\r\n\t\tbuildHirarchyTree();\r\n\r\n\t\tparseValues(new File(supplyValuesFilePath));\r\n\r\n\t\tfillMissingValues();\r\n\r\n\r\n\t}",
"public ReportGenerator(AccessibilityTester at, TestSettings set){\n tester = at;\n testSettings = set;\n printName = set.report_name;\n printDescription = set.report_description;\n printPosition = set.report_position;\n }",
"public void detailReport() {\r\n\t\tint testStepId = 1;\r\n\t\tstrBufferReportAppend.append(\r\n\t\t\t\t\"<tr><td><table class=\\\"width100\\\"><tr><td><div class=\\\"headertext1 bold\\\">Test Execution Detail Report</div></td></tr>\");\r\n\t\tstrBufferReportAppend.append(\r\n\t\t\t\t\"<tr><td><div class=\\\"headertext1 bold\\\">Execution Browser Name: \"+ GlobalVariables.getBrowserName() + \"</div></td></tr>\");\r\n\t\tstrBufferReportAppend.append(\r\n\t\t\t\t\"<tr><td><div class=\\\"headertext1 bold\\\">Test Case Name: \"+ GlobalVariables.getTestCaseName() + \"</div></td></tr>\");\r\n\t\t\r\n\t\t\r\n\t\tstrBufferReportAppend.append(\"<tr><td>\");\r\n\t\tstrBufferReportAppend\r\n\t\t\t\t.append(\"<table colspan=3 border=0 cellpadding=3 cellspacing=1 class=\\\"reporttable width100\\\">\");\r\n\t\tstrBufferReportAppend.append(\"<tr><th class=\\\"auto-style1\\\">Test Step No</th>\" + \"<th class=\\\"auto-style2\\\">Action</th>\"\r\n\t\t\t\t+ \"<th class=\\\"auto-style3\\\">Actual Result</th>\" + \"<th class=\\\"auto-style4\\\">Status</th></tr>\");\r\n\t\tfor (ReportBean reportValue : GlobalVariables.getReportList()) {\r\n\r\n\t\t\tif (reportValue.getStatus().equalsIgnoreCase(\"Passed\")) {\r\n\r\n\t\t\t\tstrBufferReportAppend.append(\"<tr>\" + \"<td class=\\\"auto-style1 blue\\\">\" + testStepId++ + \"</td>\"// teststepid\r\n\t\t\t\t\t\t+ \"<td class=\\\"auto-style2 blue\\\">\" + reportValue.getStrAction() + \"</td>\"\r\n\t\t\t\t\t\t+ \"<td class=\\\"auto-style3 blue\\\">\" + reportValue.getResult() + \"</td>\"\r\n\t\t\t\t\t\t+ \"<td class=\\\"auto-style4 green\\\">\" + reportValue.getStatus() + \"</td></tr>\");\r\n\t\t\t} else if (reportValue.getStatus().equalsIgnoreCase(\"Failed\")) {\r\n\t\t\t\tstrBufferReportAppend.append(\"<tr>\" + \"<td class=\\\"auto-style1 blue\\\">\" + testStepId++ + \"</td>\"// teststepid\r\n\t\t\t\t\t\t+ \"<td class=\\\"auto-style2 blue\\\">\" + reportValue.getStrAction() + \"</td>\"\r\n\t\t\t\t\t\t+ \"<td class=\\\"auto-style3 blue\\\">\" + reportValue.getResult() + \"</td>\"\r\n\t\t\t\t\t\t+ \"<td class=\\\"auto-style4 red\\\">\" + reportValue.getStatus() + \"</td></tr>\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tstrBufferReportAppend.append(\"</table>\");\r\n\t\tstrBufferReportAppend.append(\"</td></tr>\");\r\n\t\tstrBufferReportAppend.append(\"</table></td></tr></table></body></html>\");\r\n\t}",
"public static JasperReportBuilder generateReport(ExportData metaData,HttpServletRequest request){\n session = request.getSession(false);\n report = report(); // Creer le rapport\n \n //Logo\n// logoImg = cmp.image(inImg).setStyle(DynamicReports.stl.style().setHorizontalAlignment(HorizontalAlignment.LEFT)); \n //logoImg.setDimension(80,80); \n \n //Definit le style des colonnes d'entàte\n report.setColumnTitleStyle(getHeaderStyle(metaData));\n \n \n \n LinkedHashMap <String,String> criteria = metaData.getCriteria(); \n //Ajout la date d'àdition au critere d'impression\n String valDateProperty = getDateTxt(metaData.getLang()) ;\n String keyDateProperty = \"\" ;\n if ( session.getAttribute(\"activedLocale\").equals(\"fr\") ) {\n keyDateProperty = \"Edité le \" ;\n }\n else {\n keyDateProperty = \"Printed on \" ;\n }\n criteria.put(keyDateProperty,valDateProperty);\n \n StyleBuilder titleStyle = stl.style(boldStyle).setFontSize(16).setForegroundColor(new Color(0, 0, 0)).setHorizontalAlignment(HorizontalAlignment.RIGHT).setRightIndent(20);\n ComponentBuilder<?, ?> logoComponent = cmp.horizontalList(\n //cmp.image(Templates.class.getResource(\"/logopalm.png\")).setFixedDimension(150, 50).setStyle(stl.style().setLeftIndent(20)),\n cmp.verticalList(\n cmp.text(metaData.getTitle()).setStyle(titleStyle)\n )\n ).newRow()\n .add(cmp.horizontalList().add(cmp.hListCell(createCriteriaComponent(criteria,metaData)).heightFixedOnTop()))\n .newRow(); \n \n report.noData(logoComponent, cmp.text(\"Aucun enregistrement trouvà\").setStyle(stl.style().setHorizontalAlignment(HorizontalAlignment.CENTER).setTopPadding(30)));\n\n \n \n lblStyle = stl.style(Templates.columnStyle).setForegroundColor(new Color(60, 91, 31)); // Couleur du text \n colStyle = stl.style(Templates.columnStyle).setHorizontalAlignment(HorizontalAlignment.CENTER);\n \n groupStyle = stl.style().setForegroundColor(new Color(60, 91, 31)) \n .setBold(Boolean.TRUE)\n .setPadding(5)\n .setFontSize(13)\n .setHorizontalAlignment(HorizontalAlignment.CENTER); \n \n\n \n if(metaData.getTitle().equals(ITitle.PARCEL)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PARCEL_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SECTOR)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SECTOR_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BLOCK)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BLOCK_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ATTACK_PHYTO)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TREATMENT)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TREATMENT_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVEST)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVEST_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SERVICING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SERVICING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_PLANTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_PLANTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.FERTILIZATION)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.FERTILIZATION_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.CONTROL_PHYTO)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.CONTROL_PHYTO_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_FOLDING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_FOLDING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.MORTALITY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.MORTALITY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVESTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVESTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BUDGET)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.REPLACEMENT)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.REPLACEMENT_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.METEOROLOGY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.METEOROLOGY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_MATERIAL)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_MATERIAL_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLUVIOMETRY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLUVIOMETRY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ETP)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ETP_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HYGROMETRY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HYGROMETRY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TEMPERATURE)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TEMPERATURE_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.INSULATION)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.INSULATION_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.WORK)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.WORK_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }\n \n \n drColumns = new HashMap<String, TextColumnBuilder>(); \n groups = new ArrayList<String>();\n subtotals = new ArrayList<String>();\n \n //Definit la liste des colonnes du rapport\n ExportGenerator.getColumns(metaData); \n //Definit la liste des sous-totaux du rapport\n ExportGenerator.getSubTotals(metaData);\n \n \n //Genration des sous totaux\n for (String group : groups) {\n ColumnGroupBuilder group2 = grp.group(drColumns.get(group));\n report.groupBy(group2);\n for (String subtotal : subtotals) {\n report.subtotalsAtGroupFooter(group2,sbt.sum(drColumns.get(subtotal)));\n }\n }\n\n for (String subtotal : subtotals) {\n report.subtotalsAtSummary(sbt.sum(drColumns.get(subtotal))); \n }\n \n /*if(ExportGenerator.getColumnByNameField(\"plantingName\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL \"), ExportGenerator.getColumnByNameField(\"plantingName\"), Calculation.NOTHING));\n }*//*else if(ExportGenerator.getColumnByNameField(\"invoiceCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"invoiceCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"planterCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL\"), ExportGenerator.getColumnByNameField(\"planterCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"transportTicket\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"transportTicket\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"deliveryDate\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"deliveryDate\"), Calculation.NOTHING));\n }\n else if(ExportGenerator.getColumnByNameField(\"arroundPlantingTicketNumber\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"arroundPlantingTicketNumber\"), Calculation.NOTHING));\n }\n else if(ExportGenerator.getColumnByNameField(\"planterNumber\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"planterNumber\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"startPaymentDate\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"startPaymentDate\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"sectorCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"sectorCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"month\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL \"), ExportGenerator.getColumnByNameField(\"month\"), Calculation.NOTHING));\n }*/\n \n\n \n \n //Genere la source de donnàes du rapport\n report.setDataSource(metaData.getData());\n \n report.highlightDetailEvenRows(); \n \n \n // Definition de l'entete : valable uniquement pour la 1ere page\n HorizontalListBuilder hlb= null;\n \n hlb = cmp.horizontalList().add(\n cmp.hListCell(createCriteriaComponent(criteria,metaData)).heightFixedOnTop()\n );\n\n \n report.title(\n createCustomTitleComponent(metaData.getTitle()), // Titre\n hlb,// Liste Horizontal des Critàres \n cmp.verticalGap(12) // Marge de 12 px entre chaque critàre\n ); \n \n \n \n report.setPageMargin(DynamicReports.margin().setLeft(15).setTop(30).setRight(15).setBottom(30));\n report.setPageFormat(PageType.A3, PageOrientation.LANDSCAPE);\n report.pageFooter(DynamicReports.cmp.pageXslashY());\n return report;\n \n }",
"@Override\n public Map<String, OEEReport> build() {\n return generators.entrySet().stream().collect(Collectors.toMap(\n entry -> entry.getKey(),\n entry -> entry.getValue().getReport()\n ));\n }",
"public WaterMeter(String deviceIdParam, Radio radio)\r\n\t{\r\n\t\tsuper(deviceIdParam, radio, DeviceTypeEnum.WATER_METER);\r\n\t}",
"@Override public void generateReport(IvyXmlWriter xw,DyviseDatabase db,List<TraceLockLocation> used)\n{\n if (xw != null) {\n xw.begin(\"TYPE\");\n xw.field(\"KIND\",\"JOIN\");\n xw.field(\"ID\",++item_counter);\n for (TraceLockLocation tll : location_set) {\n\t tll.outputXml(xw,false);\n }\n xw.end(\"TYPE\");\n }\n\n used.addAll(location_set);\n}",
"@Override\n\tpublic void setWaterBill(int waterBill) {\n\t}",
"public void setMaximumWaterRequirement(double w) {\n this.Maximum_Water_Requirement = w;\n }",
"@Override\n public ReportDesign buildReportDesign(ReportDefinition reportDefinition) {\n ReportDesign rd = createExcelTemplateDesign(getExcelDesignUuid(), reportDefinition, \"SMCRegister.xls\");\n Properties props = new Properties();\n props.put(\"repeatingSections\", \"sheet:1,row:10-12,dataset:SMC\");\n props.put(\"sortWeight\", \"5000\");\n rd.setProperties(props);\n return rd;\n }",
"private void setDataSecondReport() {\r\n\t\tguiControl.sendToServer(new ClientMessage(ClientMessageType.INCOME_REPORT, reportDate));\r\n\t\tMap<Integer, VisitorReport> parkReportMap = (Map<Integer, VisitorReport>) guiControl.getServerMsg()\r\n\t\t\t\t.getMessage();\r\n\t\tlineCharSecond.getData().clear();\r\n\t\tXYChart.Series<String, Integer> price = new XYChart.Series<>();\r\n\t\tint total_price = 0;\r\n\t\tint i = 1;\r\n\t\tfor (VisitorReport vr : parkReportMap.values()) {\r\n\t\t\tprice.getData().add(new XYChart.Data<>(String.valueOf(i), new Integer(vr.getPrice())));\r\n\t\t\ti++;\r\n\t\t\ttotal_price = total_price + vr.getPrice();\r\n\t\t}\r\n\t\tlineCharSecond.getData().add(price);\r\n\t\tString totalP = String.valueOf(total_price);\r\n\t\ttotalSecond.setText(totalP + \" \" + \"NIS\");\r\n\t}",
"public void setMinimumWaterRequirement(double w) {\n this.Minimum_Water_Requirement = w;\n }",
"protected ReportGenerator()\r\n {\r\n helperObjects = new HashMap();\r\n }",
"private void inicializar() {\n\t\treporte = new Jasperreport();\n\t\tdiv = new Div();\n\t}",
"public WaterMeter(Alarm alarmParam)\r\n\t{\r\n\t\tthis();\r\n\t\taddAlarm(alarmParam);\r\n\t}",
"public ReportRunner() \n\t{\n\t\treports = new HashMap<String, Report>();\n\t\tresults =Collections.synchronizedMap(new HashMap<String, ArrayList<String[]>>());\n\t}",
"private Report(Modello _mod, TestSuite _ts) {\r\n\t\tmod = _mod;\r\n\t\tts = _ts;\r\n\t\tdiag = ts.getDiagnosi();\r\n\t\telencoProb1 = ts.getElencoProb1();\r\n\t\telencoProb2 = ts.getElencoProb2();\r\n\t\tdist = ts.getDistanze();\r\n\t}",
"public abstract void generateReport(Date from, Date to, String objectCode);",
"public void report(){\n outTime = ElevatorControl.getTick();\n Report.addToReport(this);\n }",
"public static void main(String[] args) {\n Module module = ActivatorToolBox.simpleLink(new BaseDBActivator(),\n new ConfigurationActivator(),\n new StandaloneModeActivator(),\n new ModuleHealActivator(),\n new StateServiceActivator(),\n new ChartBaseActivator(),\n new SchedulerActivator(),\n new ReportBaseActivator(),\n new RestrictionActivator(),\n new ReportActivator(),\n new WriteActivator());\n SimpleWork.supply(CommonOperator.class, new CommonOperatorImpl());\n String envpath = \"//Applications//FineReport10_325//webapps//webroot//WEB-INF\";\n SimpleWork.checkIn(envpath);\n I18nResource.getInstance();\n module.start();\n\n\n ResultWorkBook rworkbook = null;\n try {\n // read the workbook\n TemplateWorkBook workbook = TemplateWorkBookIO.readTemplateWorkBook(\"//doc//Primary//Parameter//Parameter.cpt\");\n // get the parameters and set value\n Parameter[] parameters = workbook.getParameters();\n parameters[0].setValue(\"华东\");\n // define a parameter map to execute the workbook\n java.util.Map parameterMap = new java.util.HashMap();\n for (int i = 0; i < parameters.length; i++) {\n parameterMap.put(parameters[i].getName(), parameters[i]\n .getValue());\n }\n\n FileOutputStream outputStream;\n\n // unaltered export to xls\n outputStream = new FileOutputStream(new File(\"//Users//susie//Downloads//ExcelExport.xls\"));\n ExcelExporter excel = new ExcelExporter();\n excel.setVersion(true);\n excel.export(outputStream, workbook.execute(parameterMap,new WriteActor()));\n\n // unaltered export to xlsx\n outputStream = new FileOutputStream(new File(\"//Users//susie//Downloads//ExcelExport.xlsx\"));\n StreamExcel2007Exporter excel1 = new StreamExcel2007Exporter();\n excel.export(outputStream, workbook.execute(parameterMap,new WriteActor()));\n\n // full page export to xls\n outputStream = new FileOutputStream(new File(\"//Users//susie//Downloads//PageExcelExport.xls\"));\n PageExcelExporter page = new PageExcelExporter(ReportUtils.getPaperSettingListFromWorkBook(workbook.execute(parameterMap,new WriteActor())));\n page.setVersion(true);\n page.export(outputStream, workbook.execute(parameterMap,new WriteActor()));\n\n // full page export to xlsx\n outputStream = new FileOutputStream(new File(\"//Users//susie//Downloads//PageExcelExport.xlsx\"));\n PageExcel2007Exporter page1 = new PageExcel2007Exporter(ReportUtils.getPaperSettingListFromWorkBook(rworkbook));\n page1.export(outputStream, workbook.execute(parameterMap,new WriteActor()));\n\n // page to sheet export to xls\n outputStream = new FileOutputStream(new File(\"//Users//susie//Downloads//PageSheetExcelExport.xls\"));\n PageToSheetExcelExporter sheet = new PageToSheetExcelExporter(ReportUtils.getPaperSettingListFromWorkBook(workbook.execute(parameterMap,new WriteActor())));\n sheet.setVersion(true);\n sheet.export(outputStream, workbook.execute(parameterMap,new WriteActor()));\n\n // page to sheet export to xlsx\n outputStream = new FileOutputStream(new File(\"//Users//susie//Downloads//PageSheetExcelExport.xlsx\"));\n PageToSheetExcel2007Exporter sheet1 = new PageToSheetExcel2007Exporter(ReportUtils.getPaperSettingListFromWorkBook(rworkbook));\n sheet1.export(outputStream, workbook.execute(parameterMap,new WriteActor()));\n\n // Large data volume export to xls\n outputStream = new FileOutputStream(new File(\"//Users//susie//Downloads//LargeExcelExport.zip\"));\n LargeDataPageExcelExporter large = new LargeDataPageExcelExporter(ReportUtils.getPaperSettingListFromWorkBook(workbook.execute(parameterMap,new WriteActor())), true);\n\n // Large data volume export to xlsx\n // outputStream = new FileOutputStream(new File(\"//Users//susie//Downloads//LargeExcelExport.xlsx\"));\n // LargeDataPageExcel2007Exporter large = new LargeDataPageExcel2007Exporter(ReportUtils.getPaperSettingListFromWorkBook(rworkbook), true);\n large.export(outputStream, workbook.execute(parameterMap,new WriteActor()));\n\n outputStream.close();\n module.stop();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"@Test\n\tpublic void testCreateReport() throws DatabaseException\n\t{\n\t\tPlayer john = PlayerManager.getSingleton().addPlayer(1);\n\t\tLevelRecord expected = LevelManager.getSingleton().getLevelForPoints(john.getExperiencePoints());\n\t\tExperienceChangedReport report = new ExperienceChangedReport(john.getPlayerID(), john.getExperiencePoints(),\n\t\t\t\texpected);\n\t\tassertEquals(john.getExperiencePoints(), report.getExperiencePoints());\n\t\tassertEquals(expected, report.getRecord());\n\t}",
"public static ExtentReports extentReportGenerator() \n\t{\n\tString path=System.getProperty(\"user.dir\")+\"\\\\reports\\\\index.html\";\n//\tExtentSparkReporter reporter=new ExtentSparkReporter(path);\n//\t\treporter.config().setEncoding(\"utf-8\");\n//\t\treporter.config().setReportName(\"Automation Test Results\");\n//\t\treporter.config().setDocumentTitle(\"Automation Reports\");\n//\t\treporter.config().setTheme(Theme.STANDARD);\n\t\t\n\t\tExtentHtmlReporter htmlReporter = new ExtentHtmlReporter(path);\t\n\t\thtmlReporter.setAppendExisting(true);\n\t\thtmlReporter.config().setEncoding(\"utf-8\");\n\t\thtmlReporter.config().setDocumentTitle(\"Automation Reports\");\n\t\thtmlReporter.config().setReportName(\"Automation Test Results\");\n\t\thtmlReporter.config().setTheme(Theme.STANDARD);\n\t\tLocale.setDefault(Locale.ENGLISH);\n\t\t\n\t\textent=new ExtentReports();\n\t\textent.attachReporter(htmlReporter);\n\t\textent.setSystemInfo(\"Tester\", \"Sonu\");\n\t\t\n\t\t\n\t\t\n\t\treturn extent;\n\t}",
"public void setToStructure() {\n workbookStudy.setStudy(studyView);\n workbookStudy.setConditions(conditions);\n workbookStudy.setStudyConditions(studyConditions);\n workbookStudy.setFactors(factorsView);\n workbookStudy.setConstants(constants);\n workbookStudy.setVariates(variates);\n workbookStudy.setGermplasmData(germplasmData);\n }",
"boolean createReport(String lang, String reportId, String fileName, Object... params) throws Exception;",
"@LogMethod\r\n private void publishDataToDateBasedStudy()\r\n {\r\n log(\"Prepare visit map to check PTID counts in study navigator.\");\r\n\r\n navigateToFolder(getProjectName(), TEST_ASSAY_FLDR_STUDY3);\r\n\r\n clickAndWait(Locator.linkWithText(\"Manage\"));\r\n clickAndWait(Locator.linkWithText(\"Manage Timepoints\"));\r\n clickAndWait(Locator.linkWithText(\"Create New Timepoint\"));\r\n setFormElement(Locator.name(\"label\"), \"Preexisting Timepoint\");\r\n setFormElement(Locator.name(\"sequenceNumMin\"), \"50\");\r\n setFormElement(Locator.name(\"sequenceNumMax\"), \"89\");\r\n selectOptionByText(Locator.name(\"typeCode\"), \"Screening\");\r\n\r\n clickButton(\"Save\");\r\n assertElementPresent(Locator.tagWithAttribute(\"a\", \"data-original-title\", \"edit\"), 1);\r\n\r\n //select the Lab1 folder and view all the data for the test assay\r\n navigateToFolder(getProjectName(), TEST_ASSAY_FLDR_LAB1);\r\n clickAndWait(Locator.linkWithText(TEST_ASSAY));\r\n clickAndWait(Locator.linkWithText(\"view results\"));\r\n\r\n //select all the data rows and click publish\r\n DataRegionTable table = new DataRegionTable(\"Data\", getDriver());\r\n table.checkAll();\r\n table.clickHeaderButton(\"Copy to Study\");\r\n\r\n checkCheckbox(Locator.xpath(\"//input[@id='chooseStudy']\"));\r\n\r\n // Make sure the selected study is Study3\r\n selectOptionByText(Locator.xpath(\"//select[@name='targetStudy']\"), getTargetStudyOptionText(TEST_ASSAY_FLDR_STUDY3));\r\n\r\n clickButton(\"Next\");\r\n assertTextPresent(\"Copy to \" + TEST_ASSAY_FLDR_STUDY3 + \" Study: Verify Results\");\r\n\r\n //populate initial set of values and verify the timepoint preview column\r\n String[] dates = new String[]{\"2000-02-02\", \"2000-03-03\", \"2000-04-04\", \"2000-05-05\", \"2000-06-06\", \"2001-01-01\", \"2000-01-01\", \"2000-02-02\", \"2000-03-03\"};\r\n int idx = 1;\r\n for (String d : dates)\r\n {\r\n setFormElement(Locator.xpath(\"(//input[@name='date'])[\" + idx + \"]\"), d);\r\n idx++;\r\n }\r\n\r\n setFormElement(Locator.xpath(\"(//input[@name='participantId'])[1]\"), \"new1\");\r\n setFormElement(Locator.xpath(\"(//input[@name='participantId'])[2]\"), \"new2\");\r\n setFormElement(Locator.xpath(\"(//input[@name='participantId'])[3]\"), \"new3\");\r\n setFormElement(Locator.xpath(\"(//input[@name='participantId'])[4]\"), \"new4\");\r\n\r\n DataRegionTable copyStudy = new DataRegionTable(\"Data\", getDriver());\r\n copyStudy.clickHeaderButton(\"Re-Validate\");\r\n\r\n //validate timepoints:\r\n assertElementPresent(Locator.xpath(\"//td[text()='Day 32 - 39' and following-sibling::td/a[text()='AAA07XMC-02'] and following-sibling::td[text()='301.0']]\"));\r\n assertElementPresent(Locator.xpath(\"//td[text()='Preexisting Timepoint' and following-sibling::td/a[text()='AAA07XMC-04'] and following-sibling::td[not(text())]]\"));\r\n assertElementPresent(Locator.xpath(\"//td[text()='Day 90 - 95' and following-sibling::td/a[text()='AAA07XSF-02'] and following-sibling::td[not(text())]]\"));\r\n\r\n assertElementPresent(Locator.xpath(\"//td[text()='Day 120 - 127' and following-sibling::td/a[text()='AssayTestControl1'] and following-sibling::td[text()='5.0']]\"));\r\n assertElementPresent(Locator.xpath(\"//td[text()='Day 152 - 159' and following-sibling::td/a[text()='AssayTestControl2'] and following-sibling::td[text()='6.0']]\"));\r\n assertElementPresent(Locator.xpath(\"//td[text()='Day 0 - 7' and following-sibling::td/a[text()='BAQ00051-09'] and following-sibling::td[text()='7.0']]\"));\r\n assertElementPresent(Locator.xpath(\"//td[text()='Day 32 - 39' and following-sibling::td/a[text()='BAQ00051-08'] and following-sibling::td[text()='8.0']]\"));\r\n assertElementPresent(Locator.xpath(\"//td[text()='Preexisting Timepoint' and following-sibling::td/a[text()='BAQ00051-11'] and following-sibling::td[text()='9.0']]\"));\r\n\r\n copyStudy.clickHeaderButton(\"Copy to Study\");\r\n\r\n log(\"Verifying that the data was published\");\r\n assertTextPresent(\r\n TEST_RUN1_COMMENTS,\r\n \"2000-01-01\");\r\n clickTab(\"Overview\");\r\n clickAndWait(Locator.linkWithText(\"Study Navigator\"));\r\n\r\n log(\"Test participant counts and row counts in study overview\");\r\n String[] row2 = new String[]{TEST_ASSAY, \"9\", \"1\", \"2\", \"2\", \"1\", \"1\", \"1\"};\r\n assertTableRowsEqual(\"studyOverview\", 1, new String[][]{row2});\r\n // Manually click the checkbox -- normal checkCheckbox() method doesn't seem to work for checkbox that reloads using onchange event\r\n clickAndWait(Locator.checkboxByNameAndValue(\"visitStatistic\", \"RowCount\"));\r\n row2 = new String[]{TEST_ASSAY, \"9 / 9\", \"1 / 1\", \"2 / 2\", \"2 / 2\", \"1 / 1\", \"1 / 1\", \"1 / 1\"};\r\n assertTableRowsEqual(\"studyOverview\", 1, new String[][]{row2});\r\n\r\n log(\"Test that correct timepoints were created\");\r\n\r\n clickTab(\"Overview\");\r\n clickAndWait(Locator.linkWithText(\"Manage Study\"));\r\n clickAndWait(Locator.linkWithText(\"Manage Timepoints\"));\r\n assertTextPresent(\r\n \"Day 0 - 7\",\r\n \"Day 32 - 39\",\r\n \"Day 90 - 95\",\r\n \"Day 120 - 127\",\r\n \"Day 152 - 159\");\r\n }",
"private void setData() {\n LineDataSet set1 = new LineDataSet(valuesTemperature, \"Temperature\");\n\n set1.setColor(Color.RED);\n set1.setLineWidth(1.0f);\n set1.setDrawValues(false);\n set1.setDrawCircles(false);\n set1.setMode(LineDataSet.Mode.LINEAR);\n set1.setDrawFilled(false);\n\n // create a data object with the data sets\n LineData data = new LineData(set1);\n\n // set data\n chartTemperature.setData(data);\n\n // get the legend (only possible after setting data)\n Legend l = chartTemperature.getLegend();\n l.setEnabled(true);\n\n\n // create a dataset and give it a type\n set1 = new LineDataSet(valuesPressure, \"Pressure\");\n\n set1.setColor(Color.GREEN);\n set1.setLineWidth(1.0f);\n set1.setDrawValues(false);\n set1.setDrawCircles(false);\n set1.setMode(LineDataSet.Mode.LINEAR);\n set1.setDrawFilled(false);\n\n // create a data object with the data sets\n data = new LineData(set1);\n\n // set data\n chartPressure.setData(data);\n\n // get the legend (only possible after setting data)\n l = chartPressure.getLegend();\n l.setEnabled(true);\n\n\n\n // create a dataset and give it a type\n set1 = new LineDataSet(valuesAltitude, \"Altitude\");\n\n set1.setColor(Color.BLUE);\n set1.setLineWidth(1.0f);\n set1.setDrawValues(false);\n set1.setDrawCircles(false);\n set1.setMode(LineDataSet.Mode.LINEAR);\n set1.setDrawFilled(false);\n\n // create a data object with the data sets\n data = new LineData(set1);\n\n // set data\n chartAltitude.setData(data);\n\n // get the legend (only possible after setting data)\n l = chartAltitude.getLegend();\n l.setEnabled(true);\n }",
"public void generateReport(List<XmlSuite> xmlSuites, List<ISuite>suites, \r\n\t\tString outputDirectory){//creating a method that takes three arguments,\r\n\t//to generate a report, arguments list requirements, \r\n\t//using a mechanism called List, which gets the array input\r\n\t//script will go back to xml suites, and look for \"suites\" which are the classes we created\r\n\t//we will create an xml file to contain all the classes within our test cases\r\n\t//PASS, FAIL, or SKIP will be string outputs; String outputDirectory\r\n\t//XML Suite: big time testing based on testing type\r\n\t//ISuite: pages we are working on; classes created to perform action; under test folder\r\n\t\r\n\textent = new ExtentReports(outputDirectory + File.separator\r\n\t\t\t+ \"Extent.html\", true);\r\n\t//creating an object for extent report, creating a virtual object to save all output to save all results\r\n\t//as a string, file seperator is not needed, it doesn't matter how u received the result\r\n\t//seperate them and consolidate the results\r\n\t//telling you how to save the file name, html is easy to open on any device and lightweight\r\n\t//outputDirectory: SKIP, PASS, FAIL\r\n\t//the reason for boolean option: if yu receive results, generate report//if yu dont then dont generate\r\n\tfor(ISuite suite : suites){//for loop is created\r\n\t\t//map obtains a key value, not duplicate, and then maps it to one location, which is the\r\n\t\t//extent report\r\n\t\t//an interface in java, between key value and location (between status and extent report)\r\n\t\t//will make sure how to map and seperate results under each class\r\n\t\tMap<String, ISuiteResult>result = suite.getResults();\r\n\t\r\n\tfor(ISuiteResult r : result.values()){\r\n\t\tITestContext context =r.getTestContext();//for each of the classes, create log status\r\n\t\t//test context: script that we are running, results from it\r\n\t\t//: is a conditional operator, which lists the conditions, which lists out the conditions\r\n\t\t//script should be able to run \r\n\t\t//one suite, or multiple suites in one shot\r\n\t\t//making context\r\n\t\t\r\n\t\t\r\n\t\tbuildTestNo(context.getPassedTests(), LogStatus.PASS);\r\n\t\tbuildTestNo(context.getFailedTests(), LogStatus.FAIL);\r\n\t\t//retrieving status using results/context\r\n\t\tbuildTestNo(context.getSkippedTests(), LogStatus.SKIP);\r\n\t\t\t\r\n\t}\r\n}\r\nextent.flush();//take results and place on html file\r\nextent.close();\r\n\r\n}",
"private void crearReporte() {\n medirTiempoDeEnvio();\n SimpleDateFormat variableFecha = new SimpleDateFormat(\"dd-MM-yyyy\");\n Calendar cal = Calendar.getInstance();\n String dia = String.valueOf(cal.get(cal.DATE));\n String mes = String.valueOf(cal.get(cal.MONTH) + 1);\n String año = String.valueOf(cal.get(cal.YEAR));\n String fechainicio;\n String fechafin;\n Map parametro = new HashMap();\n cargando.setVisible(true);\n try {\n JasperViewer v;\n switch (listaTipoReporte.getSelectedIndex()) {\n case 0:\n if (rb_diario.isSelected() || this.reporte.getSelectedIndex() == 1) {\n if (this.reporte.getSelectedIndex() == 1) {\n fechafin = u.fechaCorrecta(variableFecha.format(this.fin.getDate()));\n fechainicio = u.fechaCorrecta(variableFecha.format(this.inicio.getDate()));\n parametro.put(\"fecha\",fechainicio+\" al \"+fechafin);\n } else {\n fechainicio = u.fechaCorrecta(variableFecha.format(this.dia.getDate()));\n fechafin = fechainicio;\n parametro.put(\"fecha\",\" dia \"+fechainicio);\n }\n \n String p = \"('\" + fechainicio + \"','\" + fechafin + \"')\";\n if (u.ejecutarSP(p, \"ordenes_procesadas_diarias\")) {\n v = u.runReporte(\"reporte_ordenes_procesadas_diario\", parametro);\n v.setTitle(\"Reporte de ordenes procesadas\");\n v.setVisible(true);\n } else {\n System.out.println(\"mal\");\n }\n } else {\n int mess = cb_mes.getSelectedIndex();\n mess = mess + 1;\n if (rb_mensual.isSelected()) {\n int dia2 = u.numero(mess);\n String fechanueva1 = año + \"-\" + mess + \"-\" + \"01\";\n String fechai1 = año + \"-\" + mess + \"-\" + \"15\";\n String fechai2 = año + \"-\" + mess + \"-\" + \"16\";\n String fechaf1 = año + \"-\" + mess + \"-\" + dia2;\n //----------------------------- ojo son 4 fechas finico-ffinal1 y fechafinal2 -a fechafinal2\n // String fechainicio = u.fechaCorrecta(variableFecha.format(jDateChooser1.getDate()));\n // String f = u.fechaCorrecta(variableFecha.format(jDateChooser2.getDate()));\n // String fechafin =fechainicio;\n String p = \"('\" + fechanueva1 + \"','\" + fechai1 + \"','\" + fechai2 + \"','\" + fechaf1 + \"')\";\n if (u.ejecutarSP(p, \"ordenes_procesadas_mensual\")) {\n v = u.runReporte(\"reporte_ordenes_procesadas_mensual\", parametro);\n v.setTitle(\"Reporte mensual de ordenes procesadas\");\n v.setVisible(true);\n } else {\n System.out.println(\"mal\");\n }\n } else {\n Reporte r = new Reporte();\n String nombreReporte = \"\";\n if (this.primera.isSelected()) {\n r.reporteQuincena(Integer.toString(mess), \"2014\", 1);\n parametro.put(\"periodo\", \"De la primera quincena del mes de \" + u.obtenerMes(mess));\n nombreReporte = \"procesadasQuincena\";\n } else {\n if (this.segunda.isSelected()) {\n r.reporteQuincena(Integer.toString(mess), \"2014\", 2);\n parametro.put(\"periodo\", \"De la segunda quincena del mes de \" + u.obtenerMes(mess));\n nombreReporte = \"procesadasQuincenaSegunda\";\n }\n }\n v = u.runReporte(nombreReporte, parametro);\n v.setTitle(\"Reporte quincenal de ordenes procesadas\");\n v.setVisible(true);\n u.ejecutarSQL(\"DROP TABLE IF EXISTS temporal1\");\n }\n }\n break;\n case 1:\n //RordeAuditada\n if (rb_mensual.isSelected()) {\n int mess = cb_mes.getSelectedIndex();\n mess = mess + 1;\n int dia2 = u.numero(mess);\n String fechanueva = año + \"-\" + mess + \"-\" + \"01\"; //calcular el anho\n String fechai = año + \"-\" + mess + \"-\" + \"15\";\n String fechaf = año + \"-\" + mess + \"-\" + dia2;\n String p1 = \"('\" + fechanueva + \"','\" + fechai + \"','\" + fechaf + \"')\";\n if (u.ejecutarSP(p1, \"Raudita_mensual\")) {\n parametro.put(\"fecha\", fechanueva);\n parametro.put(\"fecha_p\", fechai);\n parametro.put(\"fecha_s\", fechaf);\n parametro.put(\"año\", año);\n parametro.put(\"mes\", mes);\n v = u.runReporte(\"report7\", parametro);\n v.setTitle(\"Reporte mensual de ordenes auditadas\");\n v.setVisible(true);\n } else {\n System.out.println(\"mal\");\n }\n\n }\n if (rb_diario.isSelected() || this.reporte.getSelectedIndex() == 1) {\n if (this.reporte.getSelectedIndex() == 1) {\n fechafin = u.fechaCorrecta(variableFecha.format(this.fin.getDate()));\n fechainicio = u.fechaCorrecta(variableFecha.format(this.inicio.getDate()));\n } else {\n fechainicio = u.fechaCorrecta(variableFecha.format(this.dia.getDate()));\n fechafin = fechainicio;\n parametro.put(\"fecha1\", \"Del dia \" + fechainicio);\n }\n String p = \"('\" + fechainicio + \"','\" + fechafin + \"')\";\n if (u.ejecutarSP(p, \"reporteJoel\")) {\n v = u.runReporte(\"RordeAuditada\", parametro);\n v.setTitle(\"Reporte diario de ordenes auditadas\");\n v.setVisible(true);\n } else {\n System.out.println(\"mal\");\n }\n }\n if (rb_quincenal.isSelected()) {\n int mess = cb_mes.getSelectedIndex();\n mess = mess + 1;\n String ms = u.obtenerMes(mess);\n if (this.primera.isSelected()) {\n q = \"Primera\";\n String p = \"('\" + (año + \"-\" + mess + \"-\" + \"01\") + \"','\" + (año + \"-\" + mess + \"-\" + \"02\") + \"','\" + (año + \"-\" + mess + \"-\" + \"03\") + \"','\" + (año + \"-\" + mess + \"-\" + \"04\") + \"','\" + (año + \"-\" + mess + \"-\" + \"05\") + \"','\" + (año + \"-\" + mess + \"-\" + \"06\") + \"','\" + (año + \"-\" + mess + \"-\" + \"07\") + \"','\" + (año + \"-\" + mess + \"-\" + \"08\") + \"','\" + (año + \"-\" + mess + \"-\" + \"09\") + \"','\" + (año + \"-\" + mess + \"-\" + \"10\") + \"','\" + (año + \"-\" + mess + \"-\" + \"01\") + \"','\" + (año + \"-\" + mess + \"-\" + \"11\") + \"','\" + (año + \"-\" + mess + \"-\" + \"12\") + \"','\" + (año + \"-\" + mess + \"-\" + \"13\") + \"','\" + (año + \"-\" + mess + \"-\" + \"14\") + \"','\" + (año + \"-\" + mess + \"-\" + \"15\") + \"')\";\n if (u.ejecutarSP(p, \"Rauditada_quincenal\")) {\n parametro.put(\"d1\", ms);\n parametro.put(\"d2\", año);\n parametro.put(\"q\", q);\n v = u.runReporte(\"Raudita_quincenal\", parametro);\n v.setTitle(\"Reporte quincenal de ordenes auditadas\");\n v.setVisible(true);\n } else {\n System.out.println(\"mal\");\n }\n } else {\n if (this.segunda.isSelected()) {\n q = \"Segunda\";\n if (mess == 2) {\n String p = \"('\" + (año + \"-\" + mess + \"-\" + \"16\") + \"','\" + (año + \"-\" + mess + \"-\" + \"17\") + \"','\" + (año + \"-\" + mess + \"-\" + \"18\") + \"','\" + (año + \"-\" + mess + \"-\" + \"19\") + \"','\" + (año + \"-\" + mess + \"-\" + \"20\") + \"','\" + (año + \"-\" + mess + \"-\" + \"21\") + \"','\" + (año + \"-\" + mess + \"-\" + \"22\") + \"','\" + (año + \"-\" + mess + \"-\" + \"23\") + \"','\" + (año + \"-\" + mess + \"-\" + \"24\") + \"','\" + (año + \"-\" + mess + \"-\" + \"25\") + \"','\" + (año + \"-\" + mess + \"-\" + \"16\") + \"','\" + (año + \"-\" + mess + \"-\" + \"26\") + \"','\" + (año + \"-\" + mess + \"-\" + \"27\") + \"','\" + (año + \"-\" + mess + \"-\" + \"28\") + \"','\" + (año + \"-\" + mess + \"-\" + \"28\") + \"','\" + (año + \"-\" + mess + \"-\" + \"28\") + \"')\";\n if (u.ejecutarSP(p, \"Rauditada_quincenal\")) {\n\n parametro.put(\"d1\", ms);\n parametro.put(\"d2\", año);\n\n parametro.put(\"q\", q);\n v = u.runReporte(\"Raudita_quincenal\", parametro);\n v.setTitle(\"Reporte quincenal de ordenes auditadas\");\n v.setVisible(true);\n } else {\n System.out.println(\"mal\");\n }\n } else {\n String p = \"('\" + (año + \"-\" + mess + \"-\" + \"16\") + \"','\" + (año + \"-\" + mess + \"-\" + \"17\") + \"','\" + (año + \"-\" + mess + \"-\" + \"18\") + \"','\" + (año + \"-\" + mess + \"-\" + \"19\") + \"','\" + (año + \"-\" + mess + \"-\" + \"20\") + \"','\" + (año + \"-\" + mess + \"-\" + \"21\") + \"','\" + (año + \"-\" + mess + \"-\" + \"22\") + \"','\" + (año + \"-\" + mess + \"-\" + \"23\") + \"','\" + (año + \"-\" + mess + \"-\" + \"24\") + \"','\" + (año + \"-\" + mess + \"-\" + \"25\") + \"','\" + (año + \"-\" + mess + \"-\" + \"16\") + \"','\" + (año + \"-\" + mess + \"-\" + \"26\") + \"','\" + (año + \"-\" + mess + \"-\" + \"27\") + \"','\" + (año + \"-\" + mess + \"-\" + \"28\") + \"','\" + (año + \"-\" + mess + \"-\" + \"29\") + \"','\" + (año + \"-\" + mess + \"-\" + \"30\") + \"')\";\n if (u.ejecutarSP(p, \"Rauditada_quincenal\")) {\n parametro.put(\"d1\", ms);\n parametro.put(\"d2\", año);\n parametro.put(\"q\", q);\n v = u.runReporte(\"Raudita_quincenal\", parametro);\n v.setTitle(\"Reporte quincenal de ordenes auditadas\");\n v.setVisible(true);\n } else {\n System.out.println(\"mal\");\n }\n\n }\n }\n }\n }\n break;\n case 2:\n try {\n fechainicio = u.fechaCorrecta(variableFecha.format(this.inicio.getDate()));\n fechafin = u.fechaCorrecta(variableFecha.format(this.fin.getDate()));\n parametro.put(\"fechaInicio\", fechainicio);\n parametro.put(\"fechaFin\", fechafin);\n v = u.runReporte(\"reporte_errores_diarios\", parametro);\n v.setTitle(\"Reporte de Errores\");\n v.setVisible(true);\n } catch (Exception ex) {\n JOptionPane.showMessageDialog(null, \"No se pudo generar el reporte\", \"Reporte\", JOptionPane.ERROR_MESSAGE);\n ErroresSiapo.agregar(ex, \"codigo 39\");\n }\n break;\n case 3:\n \n if (this.reporte.getSelectedIndex() == 1) {\n fechafin = u.fechaCorrecta(variableFecha.format(this.fin.getDate()));\n fechainicio = u.fechaCorrecta(variableFecha.format(this.inicio.getDate()));\n parametro.put(\"PERIODO\", \"Del \" + u.fechaReves(fechainicio) + \" al \" + u.fechaReves(fechafin));\n } else {\n String m = Integer.toString(this.cb_mes.getSelectedIndex() + 1);\n fechafin = año + \"-\" + m + \"-\" + u.numero(this.cb_mes.getSelectedIndex() + 1);\n fechainicio = año + \"-\" + m + \"-01\";\n parametro.put(\"PERIODO\", \"Del mes de \" + u.obtenerMes(this.cb_mes.getSelectedIndex() + 1) + \" del año \" + año);\n }\n String p = \"('\" + fechainicio + \"','\" + fechafin + \"')\";\n if (u.ejecutarSP(p, \"ERRORES\")) {\n v = u.runReporte(\"analisisDeEficiencia\", parametro);\n v.setTitle(\"Reporte de Analisis de Eficiencia\");\n v.setVisible(true);\n } else {\n ErroresSiapo.agregar(null, \"codigo 39\");\n System.out.println(\"mal\");\n }\n break;\n case 4: \n try {\n fechainicio = u.fechaCorrecta(variableFecha.format(this.inicio.getDate()));\n fechafin = u.fechaCorrecta(variableFecha.format(this.fin.getDate()));\n parametro.put(\"fecha\", fechainicio);\n parametro.put(\"fechaFin\", fechafin);\n v = u.runReporte(\"reporteDiarioOrdenesRegreso\", parametro);\n v.setTitle(\"Reporte de Razones\");\n v.setVisible(true);\n } catch (Exception e) {\n ErroresSiapo.agregar(e, \"codigo 38\");\n JOptionPane.showMessageDialog(null, \"No se pudo generar el reporte\", \"Reporte\", JOptionPane.ERROR_MESSAGE);\n }\n break;\n }\n } catch (Exception e) {\n }\n\n }"
] | [
"0.7284618",
"0.6626934",
"0.64101803",
"0.635651",
"0.62996536",
"0.6210082",
"0.61869144",
"0.6029457",
"0.59988683",
"0.59094554",
"0.5828778",
"0.5794138",
"0.57675797",
"0.5741706",
"0.56769574",
"0.5673391",
"0.5667794",
"0.5663752",
"0.5637273",
"0.5628635",
"0.5622857",
"0.5621307",
"0.5618607",
"0.55522",
"0.5525015",
"0.5472052",
"0.54586923",
"0.54490095",
"0.5401853",
"0.5399426",
"0.5378784",
"0.5366385",
"0.5339993",
"0.53374934",
"0.53280133",
"0.52971005",
"0.5289258",
"0.52817494",
"0.5279446",
"0.52760434",
"0.5263874",
"0.5262651",
"0.5225606",
"0.52209926",
"0.5209029",
"0.5198987",
"0.51842386",
"0.51817864",
"0.51809835",
"0.51792026",
"0.5176909",
"0.516915",
"0.5154171",
"0.51527286",
"0.51506954",
"0.5149248",
"0.51475084",
"0.51386106",
"0.5133951",
"0.5131592",
"0.5128071",
"0.51274824",
"0.5118433",
"0.5117546",
"0.50961363",
"0.5091077",
"0.5089099",
"0.50794137",
"0.5068025",
"0.50483817",
"0.5042058",
"0.504053",
"0.5026845",
"0.50209314",
"0.50191087",
"0.500766",
"0.50031066",
"0.49881083",
"0.49797451",
"0.4977753",
"0.49770582",
"0.49689797",
"0.49653453",
"0.49631545",
"0.4960077",
"0.49594846",
"0.49578494",
"0.49540558",
"0.4950263",
"0.494974",
"0.49324906",
"0.49315867",
"0.4918253",
"0.49104774",
"0.49099493",
"0.49074152",
"0.49062556",
"0.49021477",
"0.49015024",
"0.48956445",
"0.489536"
] | 0.0 | -1 |
a getter for the date of the report | public ZonedDateTime getDate() {
return date;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Date getReportDate() {\r\n return reportDate;\r\n }",
"public String Get_date() \n {\n \n return date;\n }",
"public String getDate(){\n\t\t\n\t\treturn this.date;\n\t}",
"public String getDate()\r\n\t{\r\n\t\treturn date;\r\n\t}",
"public String getDate()\r\n\t{\r\n\t\treturn date;\r\n\t}",
"public String getDate() {\r\n\t\treturn this.date;\r\n\t}",
"public String getDate() {\n return this.date;\n }",
"public String getDate() {\n return this.date;\n }",
"public String getdate() {\n\t\treturn date;\n\t}",
"public String getDate(){\n\n return this.date;\n }",
"public String getDate() {\r\n return date;\r\n }",
"public String getDate() {\n\t\treturn this.date;\n\t}",
"public String getDate()\n\t\t{\n\t\t\treturn date;\n\t\t}",
"public String getDate() {\r\n\t\treturn date;\r\n\t}",
"public java.lang.String getDate() {\n return date;\n }",
"java.lang.String getDate();",
"public String getDate() {\n return date;\n }",
"public String getDate() {\n return date;\n }",
"public String getDate() {\n return date;\n }",
"public String getDate() {\n return date;\n }",
"public String getDate() {\n return date;\n }",
"public String getDate() {\n return date;\n }",
"public String getDate() {\n\t\treturn date;\n\t}",
"public String getDate() {\n\t\treturn date;\n\t}",
"public Date getDate(){\n\t\treturn date;\n\t}",
"public Date getDate()\n {\n return this.date;\n }",
"public Date getDate()\n\t{\n\t\treturn date;\n\t}",
"public Date getDate() {\r\n\t\treturn this.date;\r\n\t}",
"public java.util.Date getDate() {\n\t}",
"public Date date()\n\t{\n\t\treturn this.date;\n\t}",
"public String getDate(){\n return date;\n }",
"public Date getDate() {\n return this.date;\n }",
"public Date getDate() {\r\n return date;\r\n }",
"public Date getDate() {\r\n return date;\r\n }",
"public Date getDate() {\r\n return date;\r\n }",
"public String getDate(){\n return date;\n }",
"public Date getDate()\n {\n return date;\n }",
"public String getDate() {\n\t\treturn this.mDate;\n\t}",
"public Date getDate() {\r\n\t\treturn date;\r\n\t}",
"public Date getDate() {\r\n\t\treturn date;\r\n\t}",
"public Date getDate() {\n\t\n\t\treturn date;\n\t\n\t}",
"@Override\n public Date getDate() {\n return date;\n }",
"@NotNull\r\n public String getDate() {\r\n return date;\r\n }",
"public Date getDate() {\n return date;\n }",
"public Date getDate() {\n return date;\n }",
"public Date getDate() {\n return date;\n }",
"public Date getDate() {\n return date;\n }",
"public Date getDate() {\n return date;\n }",
"public Date getDate() {\n return date;\n }",
"public Date getDate() {\n return date;\n }",
"public Date getDate() {\n return date;\n }",
"public Date getDate() {\n return date;\n }",
"public Date getDate() {\n return date;\n }",
"public Date getDate() {\n return date;\n }",
"public Date getDate() {\n return date;\n }",
"public Date getDate() {\n return date;\n }",
"public Date getDate() {\n return date;\n }",
"public Date getDate() {\n return date;\n }",
"public Date getDate() {\n\t\treturn date;\n\t}",
"public Date getDate() {\n\t\treturn date;\n\t}",
"public int getDate() {\n return date ;\n }",
"public int getDate() {\n return date;\n }",
"public int getDate() {\n return date;\n }",
"public String getReturnDate();",
"public String getDate()\n {\n return day + \"/\" + month + \"/\" + year;\n }",
"public Date getDate() {\n\t\treturn _date;\n\t}",
"public LocalDate getDate() {\n\t\treturn this.date;\n\t}",
"public String getDate(){\n\t\treturn toString();\n\t}",
"java.lang.String getToDate();",
"public Date getDate() {\n\t\treturn date_;\n\t}",
"public Date date() {\r\n\t\treturn date;\r\n\t}",
"Date getDateField();",
"public String getDate() {\t\n\t\treturn mDate;\n\t}",
"@Override\n\tpublic Date getDate() {\n\t\treturn this.description.getDate();\n\t}",
"public DateInfo getDate() {\r\n\t\treturn new DateInfo(super.getDate());\r\n\t\t//return new DateInfo(maturityDate);\r\n\t}",
"Date getDate();",
"Date getDate();",
"Date getDate();",
"public int getDate(){\n return date;\n }",
"public int getDate() {\n\t\treturn date;\n\t}",
"public Date getdate() {\n\t\treturn new Date(date.getTime());\n\t}",
"@HippoEssentialsGenerated(internalName = \"katharsisexampleshippo:date\")\n public Calendar getDate() {\n return getProperty(DATE);\n }",
"public String getDate() {\n\t\treturn mDate;\n\t}",
"public Date getDate(){\n\t\treturn day.date;\n\t}",
"public Date date (){\r\n\t\t\treturn _date;\r\n\t\t}",
"public String getEventDate() {\n\t\treturn date;\n\t}",
"public long getDate() {\n return date;\n }",
"@Override\n\tpublic Calendar getDate(){\n\t\treturn date;\n\t}",
"public LocalDate getDate() {\n return date;\n }",
"public LocalDate getDate() {\n return date;\n }",
"public LocalDate getDate() {\n return date;\n }",
"public long getDate() {\n return date;\n }",
"public String getDate(){\n return mDate;\n }",
"public String getDate() {\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\treturn sdf.format(txtDate.getDate());\n\t}",
"@Override\n public final Date getDocumentDate() {\n return this.manufacture.getItsDate();\n }",
"public long getDate() {\n\t\treturn date;\n\t}",
"public long getDate() {\n\t\treturn date;\n\t}",
"String getDate();",
"String getDate();",
"public Date getDate() {\n return mDate;\n }",
"java.lang.String getFoundingDate();"
] | [
"0.8207308",
"0.79830736",
"0.782665",
"0.78118324",
"0.78118324",
"0.78044724",
"0.77809757",
"0.77809757",
"0.77667665",
"0.7763302",
"0.7755",
"0.7748339",
"0.77131766",
"0.7708946",
"0.7705779",
"0.7696468",
"0.76921314",
"0.7687183",
"0.7687183",
"0.7687183",
"0.7687183",
"0.7687183",
"0.7659548",
"0.7659548",
"0.76290804",
"0.7624143",
"0.7609148",
"0.75937295",
"0.75899714",
"0.7580913",
"0.7563159",
"0.7562071",
"0.75516516",
"0.75516516",
"0.75516516",
"0.7545568",
"0.7542229",
"0.75281703",
"0.75213414",
"0.75213414",
"0.7518427",
"0.7505532",
"0.7488027",
"0.7482786",
"0.7482786",
"0.7482786",
"0.7482786",
"0.7482786",
"0.7482786",
"0.7482786",
"0.7482786",
"0.7482786",
"0.7482786",
"0.7482786",
"0.7482786",
"0.7482786",
"0.7482786",
"0.7471105",
"0.7466314",
"0.7466314",
"0.74542415",
"0.7453454",
"0.7453454",
"0.7433715",
"0.74279344",
"0.74202114",
"0.74100167",
"0.7399282",
"0.73869836",
"0.73707294",
"0.7369387",
"0.7367206",
"0.7351395",
"0.73435515",
"0.73399246",
"0.7338218",
"0.7338218",
"0.7338218",
"0.73302436",
"0.7301246",
"0.7300267",
"0.72888815",
"0.72825587",
"0.72767526",
"0.72508603",
"0.72459775",
"0.7232715",
"0.72186786",
"0.72131896",
"0.72131896",
"0.71983886",
"0.719691",
"0.71918494",
"0.7184571",
"0.71824133",
"0.7171154",
"0.7171154",
"0.71649414",
"0.71649414",
"0.71609837",
"0.7156523"
] | 0.0 | -1 |
a getter for the ID of the report | public int getID() {
return reportID;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Integer getReportId() {\n return reportId;\n }",
"public String getReportID() {\r\n\t\treturn lookupValue(Params.REPORT_ID);\r\n\t}",
"public String getReportId() {\r\n return reportId;\r\n }",
"public Long getReportId() {\n return reportId;\n }",
"public long getReportID() {\n //reportID++;\n return reportID++;\n }",
"public BigDecimal getREPORT_ID() {\r\n return REPORT_ID;\r\n }",
"java.lang.String getID();",
"public String getID() {\n return (id);\n }",
"public String getReportno() {\r\n return reportno;\r\n }",
"public String getID();",
"public String getID();",
"public String getID();",
"public String getID();",
"public String getID();",
"public String getID();",
"public String getID();",
"String getID();",
"String getID();",
"String getID();",
"String getID();",
"public final int getId() {\n\t\treturn this.accessor.getId();\n\t}",
"@Schema(description = \"The ID of the worklog record.\")\n public String getId() {\n return id;\n }",
"public Number getID();",
"protected String getReportId( HttpServletRequest request )\n {\n return (String) request.getParameter( REPORT_ID_HTTP_PARAM );\n }",
"public int getID() {\n return(this.id);\n }",
"public String getId()\n\t{\n\t\treturn this.id;\n\t}",
"public String getId() {\r\n\t\treturn this.id;\r\n\t}",
"public String getId() {\r\n\t\treturn this.id;\r\n\t}",
"public String getId() {\r\n\t\treturn this.id;\r\n\t}",
"public Integer getId() {\n\t\treturn getPatientId();\n\t}",
"@Override\n\tpublic Number getId() {\n\t\treturn this.id;\n\t}",
"String getId() {\r\n return this.id;\r\n }",
"public String getId() {\n\t\treturn this.id;\n\t}",
"public String getId() {\n\t\treturn this.id;\n\t}",
"public long getID();",
"Integer getID();",
"Integer getID();",
"public java.lang.String getId() {\r\n return this._id;\r\n }",
"public java.lang.String getId() {\n return this.id;\n }",
"public String getId ()\n {\n return id;\n }",
"public java.lang.String getId() {\n return this._id;\n }",
"public String getId() {\r\n return this.id;\r\n }",
"@Override\r\n\tpublic String getId() {\n\t\treturn this.id;\r\n\t}",
"@Override\r\n\tpublic String getId() {\n\t\treturn this.id;\r\n\t}",
"public String getPropertyID()\n {\n String v = (String)this.getFieldValue(FLD_propertyID);\n return StringTools.trim(v);\n }",
"public String getID() {\r\n return id;\r\n }",
"public String getId () {\n return id;\n }",
"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();",
"public long getId() {\r\n \treturn this.id;\r\n }",
"public String id() {\n return definition.getString(ID);\n }",
"public java.lang.String getId() {\n return _id;\n }",
"public String getId () {\n return id;\n }",
"public String getId () {\n return id;\n }",
"public String getID()\r\n {\r\n return id;\r\n }",
"public long getPurityReportID() {\n //purityReportID++;\n return purityReportID++;\n }",
"public java.lang.String getId () {\r\n\t\treturn id;\r\n\t}",
"public String getId() {\r\n return this.id;\r\n }",
"public String getId() {\r\n return this.id;\r\n }",
"public java.lang.String getId() {\r\n return id;\r\n }",
"public java.lang.String getId() {\r\n return id;\r\n }",
"public java.lang.String getId() {\r\n return id;\r\n }",
"public String getId() {\n\t\treturn _id;\n\t}",
"public String getId() {\n\t\treturn _id;\n\t}",
"public String getId() {\n\t\treturn _id;\n\t}",
"public String getId() {\n return this.id;\n }",
"public String getId() {\n return this.id;\n }",
"public String getId() {\n return this.id;\n }",
"public String getId() {\n return this.id;\n }",
"public String getId() {\n return this.id;\n }",
"public String getId() {\n return this.id;\n }",
"public String getId() {\n return this.id;\n }",
"public String getId() {\n return this.id;\n }",
"public String getId() {\n return this.id;\n }",
"public String getId() {\n return this.id;\n }",
"public String getId() {\n return this.id;\n }",
"public String getId() {\n return this.id;\n }",
"public String getID() {\r\n \t\treturn _id;\r\n \t}",
"public String getId() {\r\n \t\treturn id;\r\n \t}",
"public String getID() {\n return id;\n }",
"public java.lang.String getId() {\n return id;\n }",
"public java.lang.String getId() {\n return id;\n }",
"public java.lang.String getId() {\n return id;\n }"
] | [
"0.80822456",
"0.80753815",
"0.8034053",
"0.7996062",
"0.77603745",
"0.74913454",
"0.7136687",
"0.7008749",
"0.6981863",
"0.6972835",
"0.6972835",
"0.6972835",
"0.6972835",
"0.6972835",
"0.6972835",
"0.6972835",
"0.69598776",
"0.69598776",
"0.69598776",
"0.69598776",
"0.69051814",
"0.6902671",
"0.6881643",
"0.6872452",
"0.68635756",
"0.6852153",
"0.6840827",
"0.6840827",
"0.6840827",
"0.6833032",
"0.6821128",
"0.68167377",
"0.6816509",
"0.6816509",
"0.6813955",
"0.68086743",
"0.68086743",
"0.68060607",
"0.68022054",
"0.6797783",
"0.67917585",
"0.67882705",
"0.67841285",
"0.67841285",
"0.6783281",
"0.6772956",
"0.6771555",
"0.6767353",
"0.6767353",
"0.6767353",
"0.6767353",
"0.6767353",
"0.6767353",
"0.6767353",
"0.6767353",
"0.6767353",
"0.6767353",
"0.6767353",
"0.6767353",
"0.6767353",
"0.6767353",
"0.6767353",
"0.6767353",
"0.6767353",
"0.6767353",
"0.6767353",
"0.6766761",
"0.6763455",
"0.6757553",
"0.6756807",
"0.6756807",
"0.6746802",
"0.67446405",
"0.6739984",
"0.67368335",
"0.67368335",
"0.67357075",
"0.67357075",
"0.67357075",
"0.67353714",
"0.67353714",
"0.67353714",
"0.6729313",
"0.6729313",
"0.6729313",
"0.6729313",
"0.6729313",
"0.6729313",
"0.6729313",
"0.6729313",
"0.6729313",
"0.6729313",
"0.6729313",
"0.6729313",
"0.6726855",
"0.67246956",
"0.6720394",
"0.6719794",
"0.6719794",
"0.6719794"
] | 0.8614304 | 0 |
a getter for the name of the user who submitted the report | public String getReporterName() {
return reporterName;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getName() {\n return user.getName();\n }",
"@Override\n\tpublic String getUserName() {\n\t\treturn model.getUserName();\n\t}",
"@Override\n\tpublic String getUserName() {\n\t\treturn model.getUserName();\n\t}",
"@Override\n\tpublic java.lang.String getUserName() {\n\t\treturn _paper.getUserName();\n\t}",
"@Override\n\tpublic String getUsername() {\n\t\treturn user.getUserName();\n\t}",
"@Override\n\tpublic java.lang.String getUserName() {\n\t\treturn _employee.getUserName();\n\t}",
"public String getName() {\r\n\t\treturn this.userName;\r\n\t}",
"@Override\n\tpublic String getUserName() {\n\t\treturn _changesetEntry.getUserName();\n\t}",
"public Object userName() {\n return this.userName;\n }",
"@Override\n public String getUserName() {\n return name;\n }",
"public String getName() {\n return (String) getObject(\"username\");\n }",
"@Override\n public java.lang.String getUserName() {\n return _partido.getUserName();\n }",
"@Override\n\tpublic String getUsername() {\n\t\treturn user.getUsername();\n\t}",
"@Override\n\tpublic java.lang.String getUserName() {\n\t\treturn _second.getUserName();\n\t}",
"public String getUser_name() {\n return user_name;\n }",
"@Override\n\tpublic String getUserName() {\n\t\treturn super.getUserName();\n\t}",
"@Override\n\tpublic String getUserName() {\n\t\treturn super.getUserName();\n\t}",
"java.lang.String getUserName();",
"java.lang.String getUserName();",
"java.lang.String getUserName();",
"public String getName() {\n\t\treturn this.username;\n\t}",
"public String getUserName() {\n\t\t\treturn name;\n\t\t}",
"public String getUserName(){\n\t\treturn this.userName;\n\t}",
"public String getUserName()\n\t{\n\t\treturn this.userName;\n\t}",
"@Override\n\tpublic String getUserName() {\n\t\t\n\t\ttry {\n\t\t\treturn UserLocalServiceUtil.getUser(_dataset.getUserId()).getScreenName();\n\t\t} catch (PortalException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (SystemException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\treturn \"ERROR\";\n\t\t}\n\t}",
"public String getName() {\r\n\t\treturn username;\r\n\t}",
"public String getUser() {\r\n\t\treturn _userName;\r\n\t}",
"public String getUserName() {\n return sessionData.getUserName();\n }",
"public String getName(){\n return username;\n\t}",
"public String getUserName() {\r\n return userName;\r\n }",
"public String getUserName() {\r\n return userName;\r\n }",
"public String getUserName() {\r\n return userName;\r\n }",
"public String getUserName() {\r\n return userName;\r\n }",
"private String getLoggedUser() {\n\t\torg.springframework.security.core.userdetails.User user2 = \n\t\t\t\t(org.springframework.security.core.userdetails.User) \n\t\t\t\tSecurityContextHolder.getContext().getAuthentication().getPrincipal();\n\t\tString name = user2.getUsername();\n\t\treturn name;\n\t}",
"public String getUserName()\n {\n return userName;\n }",
"public String getUserName() {\n return userName;\n }",
"public String getUserName() {\n return this.userName;\n }",
"public String getUserName() {\n return this.userName;\n }",
"public String getUserName() {\n return this.userName;\n }",
"String getUserName() {\r\n\t\t\treturn username;\r\n\t\t}",
"@Override\n\tpublic java.lang.String getUserName() {\n\t\treturn _esfTournament.getUserName();\n\t}",
"public java.lang.String getUserName() {\r\n return userName;\r\n }",
"public String getUserName() {\n return userName;\n }",
"public String getUserName() {\n return userName;\n }",
"public String getUserName() {\n return userName;\n }",
"public String getUserName() {\n return userName;\n }",
"public String getUserName() {\n return userName;\n }",
"public String getUserName() {\n return userName;\n }",
"public String getUserName() {\n return userName;\n }",
"public String getUserName() {\n return userName;\n }",
"public String getUserName() {\n return userName;\n }",
"public String getUserName() {\n return userName;\n }",
"public String getUserName() {\n return userName;\n }",
"public String getUserName() {\n return userName;\n }",
"public String getUserName() {\n return userName;\n }",
"public String getUserName() {\n return userName;\n }",
"public String getUserName() {\n return userName;\n }",
"public String getUserName() {\n return userName;\n }",
"public String getUserName() {\n return userName;\n }",
"public String getUserName() {\n return userName;\n }",
"public String getUserName() {\n return userName;\n }",
"public String getUserName() {\n return userName;\n }",
"public String getUserName() {\n return userName;\n }",
"public java.lang.String getUserName() {\n return userName;\n }",
"public String getUserName() {\n\t\treturn this.userName;\n\t}",
"public String getUserName() {\n return order.getUser().getUsername();\n }",
"String getUserName();",
"String getUserName();",
"protected final String getUserName() {\n return this.userName;\n }",
"@Override\n\tpublic String getUsername() {\n\t\treturn getInnerObject().getUsername();\n\t}",
"public String getUserName();",
"public String getUserName() {\n return userName;\n }",
"public String getUserName() {\r\n\t\treturn userName;\r\n\t}",
"public String getUserName() {\r\n\t\treturn userName;\r\n\t}",
"public String getUserName() {\r\n\t\treturn userName;\r\n\t}",
"public String getUserName() {\r\n\t\treturn userName;\r\n\t}",
"public String getUserName() {\n\t\treturn this.username;\r\n\t}",
"@Override\n\tpublic String getGivenName() {\n\t\treturn user.getUserInfo().getGivenName();\n\t}",
"public String getCurrentUserUsername(){\n Subject subject = org.apache.shiro.SecurityUtils.getSubject();\n if(subject!=null){\n return subject.getPrincipal().toString();\n }else{\n return \"User\";\n }\n }",
"java.lang.String getUsername();",
"java.lang.String getUsername();",
"java.lang.String getUsername();",
"java.lang.String getUsername();",
"java.lang.String getUsername();",
"java.lang.String getUsername();",
"java.lang.String getUsername();",
"java.lang.String getUsername();",
"java.lang.String getUsername();",
"public String getUserName() {\n return txtUserName().getText();\n }",
"public static String getUserName() {\n\t\treturn readTestData.getkeyData(\"SignUpDetails\", \"Key\", \"Value\", \"userName\");\n\t}",
"public static String getUserName() {\r\n\t\tHttpSession session = (HttpSession) FacesContext.getCurrentInstance()\r\n\t\t\t\t.getExternalContext().getSession(false);\r\n\t\treturn session.getAttribute(\"username\").toString();\r\n\t}",
"public static String getUserName() {\r\n\t\tHttpSession session = (HttpSession) FacesContext.getCurrentInstance()\r\n\t\t\t\t.getExternalContext().getSession(false);\r\n\t\treturn session.getAttribute(\"username\").toString();\r\n\t}",
"public static String getUserDisplayName() {\r\n return getUsername();\r\n }",
"public String getUserName() {\n\t\treturn userName;\n\t}",
"public String getUserName() {\n\t\treturn userName;\n\t}",
"public String getUserName() {\n\t\treturn userName;\n\t}",
"public String getUserName() {\n\t\treturn userName;\n\t}",
"public String getUserName() {\n\t\treturn userName;\n\t}",
"public String getUserName() {\n\t\treturn userName;\n\t}",
"public String getUserName() {\n\t\treturn userName;\n\t}",
"public String getUserName() {\n\t\treturn userName;\n\t}"
] | [
"0.78325397",
"0.775247",
"0.775247",
"0.7603613",
"0.75428593",
"0.7519756",
"0.75157136",
"0.748428",
"0.74788123",
"0.7474604",
"0.7456671",
"0.741772",
"0.7409019",
"0.7386693",
"0.7377525",
"0.7355634",
"0.7355634",
"0.7323497",
"0.7323497",
"0.7323497",
"0.7317891",
"0.7310837",
"0.72963446",
"0.7268614",
"0.72620875",
"0.7249547",
"0.7239036",
"0.7216864",
"0.7213197",
"0.7191932",
"0.7191932",
"0.7191932",
"0.7191932",
"0.7173538",
"0.71724844",
"0.71697384",
"0.71685416",
"0.71685416",
"0.71685416",
"0.7167913",
"0.7165635",
"0.7153596",
"0.7146633",
"0.7146633",
"0.7146633",
"0.7146633",
"0.7146633",
"0.7146633",
"0.7146633",
"0.7146633",
"0.7146633",
"0.7146633",
"0.7146633",
"0.7146633",
"0.7146633",
"0.7146633",
"0.7146633",
"0.7146633",
"0.7146633",
"0.7146633",
"0.7146633",
"0.7146633",
"0.7146633",
"0.7135344",
"0.71172076",
"0.71076566",
"0.7104591",
"0.7104591",
"0.70995504",
"0.7094824",
"0.70876664",
"0.7080724",
"0.7079156",
"0.7079156",
"0.7079156",
"0.7079156",
"0.7078482",
"0.70722675",
"0.70675325",
"0.7063473",
"0.7063473",
"0.7063473",
"0.7063473",
"0.7063473",
"0.7063473",
"0.7063473",
"0.7063473",
"0.7063473",
"0.70599085",
"0.7057175",
"0.7039065",
"0.7039065",
"0.7008287",
"0.7006442",
"0.7006442",
"0.7006442",
"0.7006442",
"0.7006442",
"0.7006442",
"0.7006442",
"0.7006442"
] | 0.0 | -1 |
a getter for the location the water report is referring to | public Location getLocation() {
return location;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Reference location() {\n return getObject(Reference.class, FhirPropertyNames.PROPERTY_LOCATION);\n }",
"public String getLocation() {\n return this.location;\n }",
"public String getLocation() {\n return this.location;\n }",
"public String getLocation() {\n return this.location;\n }",
"public String getLocation() {\n return this.location;\n }",
"public String getLocation() {\n return this.location;\n }",
"public String getLocation() {\n return this.location;\n }",
"@Override\n\tpublic String getLocation() {\n\t\treturn this.location;\n\t}",
"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 this.location;\n }",
"public String getLocation() {\n return location;\n }",
"public String getLocation() { return location; }",
"public String getLocation() { return location; }",
"public String getLocation()\n {\n return location;\n }",
"public String location() {\n return this.location;\n }",
"public String location() {\n return this.location;\n }",
"public String getLocation() {\r\n\t\treturn location;\r\n\t}",
"public int getLocation()\r\n {\r\n return location;\r\n }",
"public String getLocation() {\r\n return location;\r\n }",
"public double getLocation(){\n\t\treturn location;\n\t}",
"public String getLocation() {\n\t\treturn location;\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 String getLocation(){\r\n return Location;\r\n }",
"public String getLocation() {\n return location;\n }",
"public int getLocation()\r\n {\n }",
"public java.lang.String getLocation() {\n return location;\n }",
"public String getLocation() {\n\t\t\treturn location;\n\t\t}",
"public Location getLocation() \n\t{\n\t\treturn location;\n\t}",
"public String getLocation(){\r\n return location;\r\n }",
"public java.lang.String getLocation() {\n return location;\n }",
"protected String getLocation(){\r\n return this.location;\r\n }",
"public final String getLocation() {\n return location;\n }",
"public String getLocation(){\n return location;\n }",
"@HippoEssentialsGenerated(internalName = \"katharsisexampleshippo:location\")\n public String getLocation() {\n return getProperty(LOCATION);\n }",
"public int getLocation() {\n\t\tint location=super.getLocation();\n\t\treturn location;\n\t}",
"public String getLocation() {\n\t\treturn mLocation;\n\t}",
"public FrillLoc getLocation() {\n return MyLocation;\n }",
"@Override\n\tpublic String getLocation() {\n\t\treturn location;\n\t}",
"public Location getLocation() {\n\t\treturn loc;\n\t}",
"public Location getLocation() {\r\n\t\treturn location;\r\n\t}",
"public Location getLocation() {\r\n\t\treturn location;\r\n\t}",
"public Location getLocation() {\n\t\treturn location;\n\t}",
"public Location getLocation() {\n return loc;\n }",
"public Location getLocation() {\n return loc;\n }",
"public String getLocation() {\n return mLocation;\n }",
"public Location getLocation() {\n return getLocation(null);\n }",
"String getLocation();",
"String getLocation();",
"String getLocation();",
"public BwLocation getLocation() {\n if (location == null) {\n location = BwLocation.makeLocation();\n }\n\n return location;\n }",
"java.lang.String getLocation();",
"public Location location()\n {\n return myLoc;\n }",
"public ConfigDataLocation getLocation() {\n\t\treturn this.location;\n\t}",
"SiteLocation getLocatedAt();",
"public String getLocationName(){\n return myLoc;\n }",
"public final Point getLocation() {\n return this.location ;\n }",
"public final Coord getLocation() {\n return location;\n }",
"public Location getLocation() {\n return name.getLocation();\n }",
"public Point getLocation() {\n\t\treturn location;\n\t}",
"public Location getLocation(){\n return location;\n }",
"@Override\n public String getLocation() {\n return location;\n }",
"public Location getLocation ( ) {\n\t\treturn extract ( handle -> handle.getLocation ( ) );\n\t}",
"public Location getLocation()\n\t{\n\t\treturn l;\n\t}",
"public String getLocation() {\n\t\treturn \"-12.9990189,-38.5140298\";\n\t}",
"String location();",
"String location();",
"String location();",
"String location();",
"String location();",
"String location();",
"String location();",
"String location();",
"public String getLocation() throws ServiceLocalException {\n\t\treturn (String) this.getPropertyBag().getObjectFromPropertyDefinition(\n\t\t\t\tAppointmentSchema.Location);\n\t}",
"public byte[] getLocation() {\r\n return location;\r\n }",
"public Point getLocation() { return loc; }",
"public int getLocation() {\n\t\treturn 0;\n\t}",
"public Location getBedLocation ( ) {\n\t\treturn extract ( handle -> handle.getBedLocation ( ) );\n\t}",
"public Point getLocation() {\n\t\treturn location.getCopy();\n\t}",
"com.google.ads.googleads.v14.common.LocationInfo getLocation();",
"public Point getLocation() {\n return location;\n }",
"public native final String location() /*-{\n\t\treturn this[\"location\"];\n\t}-*/;",
"@Override\r\n\tpublic String toString() {\r\n\t\treturn getLocation();\r\n\t}",
"public Location getLocation() {\n\t\treturn location.clone();\n\t}",
"public double[] getLocation()\n\t{\n\t\treturn location;\n\t}",
"public PVector getLocation()\n\t{\n\t\treturn location;\n\t}"
] | [
"0.7689381",
"0.7633527",
"0.7633527",
"0.7633527",
"0.7633527",
"0.7633527",
"0.7628163",
"0.76021916",
"0.7549259",
"0.75487137",
"0.7536592",
"0.7525693",
"0.7523668",
"0.7523668",
"0.7521927",
"0.7505146",
"0.7505146",
"0.7503537",
"0.74914044",
"0.7487336",
"0.74801534",
"0.7472472",
"0.74681854",
"0.74681854",
"0.74681854",
"0.74681854",
"0.74681854",
"0.74681854",
"0.74681854",
"0.74681854",
"0.74681854",
"0.74681854",
"0.74681854",
"0.74681854",
"0.7462862",
"0.7453911",
"0.7449425",
"0.7442864",
"0.7442305",
"0.7437699",
"0.74298966",
"0.740653",
"0.7396251",
"0.7381852",
"0.73674375",
"0.73625815",
"0.7353724",
"0.73370045",
"0.7322003",
"0.7320864",
"0.73137337",
"0.7296373",
"0.7296373",
"0.7296257",
"0.7291085",
"0.7291085",
"0.7276262",
"0.72356606",
"0.7217496",
"0.7217496",
"0.7217496",
"0.7204433",
"0.72007954",
"0.7192293",
"0.71695465",
"0.71691823",
"0.7168682",
"0.7166224",
"0.71536165",
"0.7141628",
"0.7131592",
"0.7126115",
"0.71204484",
"0.7120309",
"0.711948",
"0.71042454",
"0.7100825",
"0.7100825",
"0.7100825",
"0.7100825",
"0.7100825",
"0.7100825",
"0.7100825",
"0.7100825",
"0.70969546",
"0.7091473",
"0.7063283",
"0.70401007",
"0.702938",
"0.70163655",
"0.701317",
"0.700679",
"0.70023644",
"0.7000938",
"0.69860375",
"0.6985109",
"0.69844013"
] | 0.7180938 | 65 |
a getter for the Enum condition of the water | public OverallCondition getCondition() {
return condition;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"String getCondition();",
"public Object getCondition();",
"int getConditionValue();",
"public WeatherCondition getCondition() {\n return condition;\n }",
"com.google.protobuf.ByteString getConditionBytes();",
"cn.infinivision.dataforce.busybee.pb.meta.Expr getCondition();",
"java.lang.String getCondition();",
"io.grpc.user.task.PriceCondition getCondition();",
"public Condition getCondition(){\n\t\treturn this.cond;\n\t}",
"Event getCondition();",
"OclExpression getCondition();",
"@Override\n\tpublic VehicleCondition getCondition() {\n\t\treturn condition;\n\t}",
"public Condition getCondition() {\n return condition;\n }",
"public int getCondition() {\r\n\t\tif(this.condition == null){\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\treturn this.condition.ordinal();\r\n\t}",
"public Integer getWaterMeterTypeEnumValue()\r\n\t{\r\n\t\tif (getWaterMeterTypeEnum() != null)\r\n\t\t{\r\n\t\t\treturn getWaterMeterTypeEnum().getValue();\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}",
"public Reference condition() {\n return getObject(Reference.class, FhirPropertyNames.PROPERTY_CONDITION);\n }",
"public Getter reqGetWaterHeaterStatus() {\n\t\t\taddProperty(EPC_WATER_HEATER_STATUS);\n\t\t\treturn this;\n\t\t}",
"Conditions getConditions();",
"public String getCondition() {\n return condition;\n }",
"public String getCondition() {\n\treturn condition;\n}",
"public Expression getCondition()\n {\n return this.condition;\n }",
"public int getAviodCondition() {\n\t\t\treturn aviodCondition;\n\t\t}",
"public int[] getConditions() { return conditional; }",
"ICDICondition getCondition() throws CDIException;",
"public ExpressionNode getCondition();",
"@Override\n public ConditionType getConditionType() {\n return typeLookup.get(_cfRule.getType());\n }",
"org.landxml.schema.landXML11.TrafficControlType.Enum getControlType();",
"public ASTNode getCondition() {\n \treturn (ASTNode)getChildNode(ChooseRulePlugin.GUARD_NAME);\n }",
"public String getCondition() {\n\t\treturn condition;\n\t}",
"int getWinCondition();",
"public WaterMeterTypeEnum getWaterMeterTypeEnum()\r\n\t{\r\n\t\treturn waterMeterTypeEnum;\r\n\t}",
"@Override\n\tpublic String getcond() {\n\t\treturn null;\n\t}",
"public EnumVar getStatus() {\n return status;\n }",
"public java.util.List<IdDt> getCondition() { \n\t\tif (myCondition == null) {\n\t\t\tmyCondition = new java.util.ArrayList<IdDt>();\n\t\t}\n\t\treturn myCondition;\n\t}",
"org.landxml.schema.landXML11.RoadTerrainType.Enum getRoadTerrain();",
"int getSatOff(){\n return getPercentageValue(\"satOff\");\n }",
"int getStatusValue();",
"int getStatusValue();",
"int getStatusValue();",
"int getStatusValue();",
"int getStatusValue();",
"int getStatusValue();",
"int getStatusValue();",
"int getStatusValue();",
"int getStatusValue();",
"int getStatusValue();",
"int getStatusValue();",
"int getStatusValue();",
"int getStatusValue();",
"int getStatusValue();",
"int getStatusValue();",
"int getStatusValue();",
"int getStatusValue();",
"int getStatusValue();",
"int getStatusValue();",
"int getStatusValue();",
"cn.infinivision.dataforce.busybee.pb.meta.ExprOrBuilder getConditionOrBuilder();",
"public RequestCondition<?> getCustomCondition()\n/* */ {\n/* 164 */ return this.customConditionHolder.getCondition();\n/* */ }",
"public String getUiStatus() {\n\t\tif (switchInfo.getType().compareTo(\"thermostat\") == 0) {\r\n\t\t\ttry {\r\n\t\t\t\tDouble tmp = new Double((String) myISY.getCurrValue(myISY.getNodes().get(switchInfo.getSwitchAddress()),\r\n\t\t\t\t\t\tInsteonConstants.DEVICE_STATUS));\r\n\t\t\t\ttmp = tmp / 2;\r\n\t\t\t\treturn tmp.toString();\r\n\t\t\t} catch (NoDeviceException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (NullPointerException e) {\r\n\t\t\t}\r\n\t\t} else if ((switchInfo.getType().compareTo(\"light\") == 0)\r\n\t\t\t\t|| (switchInfo.getType().compareTo(\"circulator\") == 0)) {\r\n\t\t\ttry {\r\n\t\t\t\tDouble tmp = new Double((String) myISY.getCurrValue(myISY.getNodes().get(switchInfo.getSwitchAddress()),\r\n\t\t\t\t\t\tInsteonConstants.DEVICE_STATUS));\r\n\t\t\t\ttmp = tmp / 255 * 100;\r\n\t\t\t\tif (tmp == 0)\r\n\t\t\t\t\treturn \"OFF\";\r\n\t\t\t\telse if (tmp == 100)\r\n\t\t\t\t\treturn \"ON\";\r\n\t\t\t\treturn \"ON \" + tmp + \"%\";\r\n\t\t\t} catch (NoDeviceException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (NullPointerException e) {\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn \"\";\r\n\t}",
"public String getSkyCondition() {\n\t\treturn skyCondition;\n\t}",
"LogicCondition createLogicCondition();",
"public BoundCodeDt<InstanceAvailabilityEnum> getAvailabilityElement() { \n\t\tif (myAvailability == null) {\n\t\t\tmyAvailability = new BoundCodeDt<InstanceAvailabilityEnum>(InstanceAvailabilityEnum.VALUESET_BINDER);\n\t\t}\n\t\treturn myAvailability;\n\t}",
"public BoundCodeDt<InstanceAvailabilityEnum> getAvailabilityElement() { \n\t\tif (myAvailability == null) {\n\t\t\tmyAvailability = new BoundCodeDt<InstanceAvailabilityEnum>(InstanceAvailabilityEnum.VALUESET_BINDER);\n\t\t}\n\t\treturn myAvailability;\n\t}",
"Integer getStatus();",
"public int getConditionCode() {\n\t\t\treturn conditionCode;\n\t\t}",
"public BoundCodeDt<InstanceAvailabilityEnum> getAvailability() { \n\t\tif (myAvailability == null) {\n\t\t\tmyAvailability = new BoundCodeDt<InstanceAvailabilityEnum>(InstanceAvailabilityEnum.VALUESET_BINDER);\n\t\t}\n\t\treturn myAvailability;\n\t}",
"public BoundCodeDt<InstanceAvailabilityEnum> getAvailability() { \n\t\tif (myAvailability == null) {\n\t\t\tmyAvailability = new BoundCodeDt<InstanceAvailabilityEnum>(InstanceAvailabilityEnum.VALUESET_BINDER);\n\t\t}\n\t\treturn myAvailability;\n\t}",
"com.unitedtote.schema.totelink._2008._06.program.ExchangeWagers.Enum getExchange();",
"public int getLevel() {\n if ( air != null )\n return air.sampleRSSI(CC1000Radio.this);\n else return ADC.VBG_LEVEL; // return a default value of some sort\n }",
"Condition createCondition();",
"public EventCondition [] getEventConditions() {\n return this.EventConditions;\n }",
"@Override UpodCondition getConditionTest(UpodProgram pgm) {\n return null;\n }",
"EDataType getReactivePower();",
"public List<ConditionalRequirement> getConditions() {\r\n return conditions;\r\n }",
"boolean isEstConditionne();",
"gov.nih.nlm.ncbi.www.MedlineSiDocument.MedlineSi.Type.Value.Enum getValue();",
"public String getElement()\n {\n return \"enum\";\n }",
"protected byte[] getWaterHeaterStatus() {return null;}",
"public Condition [] getConditions() {\n return this.Conditions;\n }",
"org.hl7.fhir.ObservationStatus getStatus();",
"@Override\n\tpublic String getCondition() {\n\t\treturn \"\";\n\t}",
"@Nullable\n // Safe as we want to provide all getters being public for POJOs\n @SuppressWarnings({\"unused\", \"WeakerAccess\"})\n public final String getConditionName() {\n return conditionName;\n }",
"Float getStatus();",
"@Field(5) \n\tpublic byte ConditionalOrderStatus() {\n\t\treturn this.io.getByteField(this, 5);\n\t}",
"private JComboBox getCondition() {\n\t\tif (condition == null) {\n\t\t\tcondition = new JComboBox();\n\t\t\tcondition.setModel(new DefaultComboBoxModel(new String [] {\"<\", \"=\", \">\"}));\n\t\t\tcondition.setSelectedIndex(1);\n\t\t\t\n\t\t}\n\t\treturn condition;\n\t}",
"String getLiquidityIndicator();",
"public TamagotchiMood statusEnum() {\n if (isTired()) {\n return TamagotchiMood.TIRED;\n } else if (isHungry()) {\n return TamagotchiMood.HUNGRY;\n } else if (isHappy()) {\n return TamagotchiMood.HAPPY;\n } else {\n return TamagotchiMood.INDIFFERENT;\n }\n }",
"ConditionFactory getConditionFactory();",
"Expression getCond();",
"public StatusEnum getStatus()\n {\n return status;\n }",
"public EdgeStatus getStatus() {\n return ioStatus.get();\n }",
"public Integer getEwStatus() {\n return ewStatus;\n }",
"public Integer getEwStatus() {\n return ewStatus;\n }",
"java.lang.String getStatus();",
"java.lang.String getStatus();",
"java.lang.String getStatus();",
"java.lang.String getStatus();",
"public Condition getCondition() {\n\t\treturn new MoveDistanceCondition(5,5);\n\t}",
"public Filter condition();",
"public OperatorEnum getOperator() {\n return operator;\n }"
] | [
"0.72968566",
"0.7106371",
"0.70816875",
"0.68728757",
"0.68547934",
"0.67757255",
"0.6761149",
"0.66573787",
"0.6563028",
"0.64729446",
"0.64624643",
"0.64566517",
"0.6433613",
"0.64180243",
"0.6378178",
"0.6326323",
"0.61971587",
"0.61897707",
"0.6164995",
"0.6162999",
"0.61601645",
"0.6132825",
"0.6116765",
"0.6104482",
"0.6083163",
"0.60691243",
"0.60495853",
"0.6019343",
"0.6016101",
"0.5997396",
"0.598089",
"0.5935047",
"0.59184754",
"0.5894696",
"0.5880352",
"0.5870074",
"0.58593714",
"0.58593714",
"0.58593714",
"0.58593714",
"0.58593714",
"0.58593714",
"0.58593714",
"0.58593714",
"0.58593714",
"0.58593714",
"0.58593714",
"0.58593714",
"0.58593714",
"0.58593714",
"0.58593714",
"0.58593714",
"0.58593714",
"0.58593714",
"0.58593714",
"0.58593714",
"0.5815316",
"0.5810409",
"0.5778198",
"0.57673454",
"0.57549113",
"0.575477",
"0.575477",
"0.5754613",
"0.575319",
"0.57227045",
"0.57227045",
"0.57193214",
"0.570043",
"0.5700237",
"0.56835985",
"0.568098",
"0.56629664",
"0.5655238",
"0.5643997",
"0.5637325",
"0.56346744",
"0.5626461",
"0.5623486",
"0.56109405",
"0.5607212",
"0.5599213",
"0.5589905",
"0.558934",
"0.55891067",
"0.5587808",
"0.558667",
"0.5581214",
"0.5577794",
"0.55771875",
"0.5573435",
"0.557166",
"0.557166",
"0.5553559",
"0.5553559",
"0.5553559",
"0.5553559",
"0.5547414",
"0.55415326",
"0.55154055"
] | 0.6671009 | 7 |
a getter for the virus PPM of the water | public int getVirusPPM() {
return virusPPM;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getPressure() {\n\t\treturn pressure;\n\t}",
"public String getPressure() {\n\t\treturn pressure;\n\t}",
"public float getPressure() {\n pressure = calculatePressure();\n return pressure;\n }",
"public byte[] getP() {\n return p;\n }",
"public static PVProperty getPVProperty() {\n return pvProperty;\n }",
"double getPressure();",
"public String getPn() { return this.pn; }",
"public float getPressure() {\n return pm.pen.getLevelValue(PLevel.Type.PRESSURE);\n }",
"public Long getPps() {\n return this.Pps;\n }",
"public float getPressure() {\n\t\treturn (float) getRawPressure() / 100f;\n\t}",
"public ProductionPowers getProductionPowers() {\n return pp;\n }",
"double getPValue();",
"public int getP() {\r\n\t\treturn this.p;\r\n\t}",
"public Unit<Dimensionless> ppm() {return ppm;}",
"public int getPower() {\n return PA_POW_reg.getPower();\n }",
"public IPV getPV(){\n return pvMap.get(IPVWidgetModel.PROP_PVNAME);\n }",
"public Pit getPit();",
"public int getPlat()\n {\n return plat;\n }",
"public Z getP() {\n return mP;\n }",
"public double getPressure() {\n\t\treturn 1000+(int)(Math.random()*1001);//模拟一个随机气压数\n\t}",
"public int getMPValue() {\n return mPValue_;\n }",
"public String getPs() {\n return ps;\n }",
"public int getMPValue() {\n return mPValue_;\n }",
"int getMPValue();",
"public int getPotion() {\n return getStat(potion);\n }",
"private PiattoModulo getModuloPiatto() {\n return (PiattoModulo)Progetto.getModulo(Ristorante.MODULO_PIATTO);\n }",
"public BigInteger getP() {return(p);}",
"protected double getHPM() {\n\t\t\treturn this.getHealing() / this.getCost();\n\t\t}",
"public double getPUtilization() {\n return pUtilization;\n }",
"@java.lang.Override\n public double getPValue() {\n return pValue_;\n }",
"public int getMpen(){\n\t\treturn mpen;\n\t}",
"@java.lang.Override\n public double getPValue() {\n return pValue_;\n }",
"public String getPav() {\r\n\t\treturn pav;\r\n\t}",
"public String viewPluviometer() {\r\n\t\tconsultPluviometer();\r\n\t\treturn \"gesPluviometer\";\r\n\t}",
"public double getProbabilityP() {\n return this.mProbabilityP;\n }",
"public double getCoPpm()\n\t{\n\t\treturn coPpm;\n\t}",
"public String getPMText()\r\n {\r\n return (m_pmText);\r\n }",
"public int getProgeny() {\n return this.progeny;\n }",
"private String getPais()\n throws Exception,MareException\n\t{\n\t\tLong pais = UtilidadesSession.getPais(this);\n\t\treturn pais.toString();\n\t}",
"public String getTipePotongan() {\n return (String)getAttributeInternal(TIPEPOTONGAN);\n }",
"public String getPowerRPM() {\r\n return powerRPM;\r\n }",
"public int getPower() {\n\t\treturn aerodynamics.getPower()+engine.getPower()+suspension.getPower()+breaks.getPower()+tires.getPower();\n\t}",
"public Long getPiid() {\n return piid;\n }",
"public int getCurrentPlayerPokemon()\r\n {\r\n return currentPlayerPokemon;\r\n }",
"public ReporteProblema getProb() {\n return prob;\n }",
"public String getWaterMeterCode() {\n return waterMeterCode;\n }",
"public MPPS getMppsI() {\n\t\treturn mppsI;\n\t}",
"String getPrecio();",
"protected double getEnginePower(){\n return enginePower;\n }",
"public String getProptel() {\r\n\t\treturn proptel;\r\n\t}",
"public String getNo_hp_pelanggan(){\r\n \r\n return no_hp_pelanggan;\r\n }",
"public double getReadPressure(){\n return this.mFarm.getReadPressure();\n }",
"public String getPERatio() {\n\t\treturn peRatio;\n\t}",
"public int getMp() \n\t{\n\t\treturn mp;\n\t}",
"public double getPowerUpProbabilityPillar() {\n \t\treturn 0.15;\n \t}",
"public double getPH() {\n return pH;\n }",
"public double getPvpExpLoss() \r\n\t{\treturn this.pvpExpLoss;\t}",
"public String getPokemonHP() {\n\t\treturn pokemon.getCurHP() + \"/\" + pokemon.getMaxHP();\n\t}",
"public int getNumberPoney() {\n return numberPoney;\n }",
"double getPheromonesLevel() {\n return pheromones_level;\n }",
"public HugeInt getPrime()\r\n\t{\r\n\t\treturn p;\r\n\t}",
"public String getPaCode() {\n\t\treturn paCode;\n\t}",
"public int getContaminantPPM() {\n return contaminantPPM;\n }",
"public int getPais() {\n return pais;\n }",
"public String getPId() {\n return (String)getAttributeInternal(PID);\n }",
"POGOProtos.Rpc.PokemonProto getPokemon();",
"public byte[] getPgenCounter() {\n return pgenCounter;\n }",
"public java.lang.String getPon() {\n return pon;\n }",
"public float getSavedPressure() {\n return savedPen.getLevelValue(PLevel.Type.PRESSURE);\n }",
"public long getPropertyVolumeUnity();",
"public int getVoltage ()\n {\n return _voltage;\n }",
"public double getEnginePower(){\n return enginePower;\n }",
"public Map<Resource, Integer> getProductionPowerInput() {\n return productionPowerInput;\n }",
"public int getRRPP(){\n return RRPP; \n }",
"public P primeiro() {\n\t\treturn this.primeiro;\n\t}",
"private double readPressureSample() {\n return 6 * randomPressureSampleSimulator.nextDouble() * randomPressureSampleSimulator.nextDouble();\n }",
"public int getProteksi(){\n\t\treturn (getTotal() - getPromo()) * protectionCost / 100;\n\t}",
"public Point2D.Float getVelocityPPS() {\n return velocityPPS;\n /* old method for velocity estimation is as follows\n * The velocity is instantaneously\n * computed from the movement of the cluster caused by the last event, then this velocity is mixed\n * with the the old velocity by the mixing factor. Thus the mixing factor is appplied twice: once for moving\n * the cluster and again for changing the velocity.\n * */\n }",
"public long getPropertyVolume()\n {\n return iPropertyVolume.getValue();\n }",
"public int getPeptidesNumber() {\n return peptidesNumber;\n }",
"public int getPuntos() {\n return puntos;\n }",
"int getLumMod(){\n return getPercentageValue(\"lumMod\");\n }",
"public double getPilotDpad() {\n return pilot.getPOV();\n }",
"public IPV getPV(String pvPropId){\n return pvMap.get(pvPropId);\n }",
"public Image getP(){\n\t\treturn a;\n\t}",
"public Integer getPourcentage() {\n\t\treturn this.pourcentage;\n\t}",
"public long getPropertyVolumeUnity()\n {\n return iPropertyVolumeUnity.getValue();\n }",
"public Peg getPeg(int i) {\r\n\t\treturn pegs[i];\r\n\t}",
"public int getPower(){\n\t\treturn this.power;\n\t}",
"public int getPuntos() {\n return puntos;\n }",
"public int getActivePens(){\n return this.mFarm.getActivePens();\n }",
"public Peg getPeg(int n) { return pegs[n]; }",
"public double fpp() {\n return config().getP();\n }",
"public int getNPI() {\r\n return npi;\r\n }",
"public NM getInternalScalingFactorPP() { \r\n\t\tNM retVal = this.getTypedField(36, 0);\r\n\t\treturn retVal;\r\n }",
"public double getRoadwayPI()\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_attribute_user(ROADWAYPI$18);\r\n if (target == null)\r\n {\r\n return 0.0;\r\n }\r\n return target.getDoubleValue();\r\n }\r\n }",
"public String getSpu() {\n return spu;\n }",
"public int getBasePProtection()\r\n {\r\n return mBasePProtection;\r\n }",
"public Number getPesocont()\n {\n return (Number)getAttributeInternal(PESOCONT);\n }",
"public String getPass_pelanggan(){\r\n \r\n return pass_pelanggan;\r\n }"
] | [
"0.65687585",
"0.65687585",
"0.65673417",
"0.64955145",
"0.6479177",
"0.64682245",
"0.6450313",
"0.64326817",
"0.63870394",
"0.6366085",
"0.63580316",
"0.63505507",
"0.6336024",
"0.6297107",
"0.6295837",
"0.62852925",
"0.62838984",
"0.62210274",
"0.62167716",
"0.62044555",
"0.6174052",
"0.6137193",
"0.6129707",
"0.61220235",
"0.61114645",
"0.6078187",
"0.60712284",
"0.6058433",
"0.6049693",
"0.6038711",
"0.602266",
"0.60057193",
"0.60020703",
"0.5973116",
"0.5972255",
"0.59466493",
"0.5933861",
"0.59075445",
"0.5875565",
"0.58484167",
"0.58417445",
"0.5839227",
"0.5837726",
"0.5837005",
"0.58266073",
"0.5818186",
"0.58125377",
"0.5812514",
"0.5806552",
"0.58063644",
"0.5804077",
"0.57983994",
"0.57912326",
"0.57880574",
"0.5783089",
"0.57803124",
"0.57759726",
"0.57713646",
"0.5770916",
"0.57649493",
"0.5763653",
"0.57582057",
"0.57578546",
"0.5757073",
"0.5754904",
"0.57504916",
"0.575012",
"0.57472146",
"0.57447416",
"0.57344645",
"0.5723203",
"0.57178885",
"0.5713845",
"0.5710533",
"0.5708161",
"0.57009125",
"0.5697301",
"0.56956744",
"0.56934094",
"0.56800723",
"0.5677431",
"0.56764466",
"0.5675874",
"0.56703097",
"0.5662712",
"0.5656754",
"0.5652924",
"0.5648597",
"0.5645852",
"0.56446904",
"0.56436634",
"0.56322026",
"0.56314707",
"0.56253994",
"0.5625001",
"0.5624776",
"0.5622037",
"0.5620339",
"0.5616654",
"0.5615139"
] | 0.7669082 | 0 |
a getter for the contaminant PPM of the water | public int getContaminantPPM() {
return contaminantPPM;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public double getCoPpm()\n\t{\n\t\treturn coPpm;\n\t}",
"public Double getCpm() {\n return cpm;\n }",
"public int getMPValue() {\n return mPValue_;\n }",
"public int getMPValue() {\n return mPValue_;\n }",
"public float getPressure() {\n pressure = calculatePressure();\n return pressure;\n }",
"int getMPValue();",
"public Unit<Dimensionless> ppm() {return ppm;}",
"double getPressure();",
"public int getMps() {\n return (int) (80d * this.getCondition() / 100d);\n }",
"protected double getHPM() {\n\t\t\treturn this.getHealing() / this.getCost();\n\t\t}",
"public float getPressure() {\n\t\treturn (float) getRawPressure() / 100f;\n\t}",
"double getPValue();",
"public float getCabinPressure() {\n\t\treturn cabinPressure;\n\t}",
"protected double getMPS() {\n\t\t\treturn this.getCost() / this.castPeriod;\n\t\t}",
"public Number getPesocont()\n {\n return (Number)getAttributeInternal(PESOCONT);\n }",
"public double getPressure() {\n\t\treturn 1000+(int)(Math.random()*1001);//模拟一个随机气压数\n\t}",
"public int getMp() \n\t{\n\t\treturn mp;\n\t}",
"public Z getP() {\n return mP;\n }",
"public double getProbabilityP() {\n return this.mProbabilityP;\n }",
"public double fpp() {\n return config().getP();\n }",
"public int getP() {\r\n\t\treturn this.p;\r\n\t}",
"public CP getAmountPP() { \r\n\t\tCP retVal = this.getTypedField(38, 0);\r\n\t\treturn retVal;\r\n }",
"public CP getTPValuePP() { \r\n\t\tCP retVal = this.getTypedField(35, 0);\r\n\t\treturn retVal;\r\n }",
"public Integer getPourcentage() {\n\t\treturn this.pourcentage;\n\t}",
"public BigDecimal getAverageCpm() {\r\n return averageCpm;\r\n }",
"public int getProteksi(){\n\t\treturn (getTotal() - getPromo()) * protectionCost / 100;\n\t}",
"public BigInteger getP() {return(p);}",
"public int getMpen(){\n\t\treturn mpen;\n\t}",
"public int getPrecipitation() {\n return precipitation;\n }",
"private double calcuCMetric() {\n\t\treturn (p-1)/fcost;\n\t}",
"public double getPUtilization() {\n return pUtilization;\n }",
"public int getChanPerPen(){\n return this.mFarm.getChanPerPen();\n }",
"public String getPressure() {\n\t\treturn pressure;\n\t}",
"public String getPressure() {\n\t\treturn pressure;\n\t}",
"public double obtenerPrecio() {\n\t\t\n\t\treturn this.precio;\n\t}",
"public double prom () {\n return this.sum()/this.size();\n }",
"double getPerimetro();",
"public int getWMC(){\r\n\t\t \r\n\t\treturn mccabe.getWMC();\t\t\r\n\t}",
"@java.lang.Override\n public double getPValue() {\n return pValue_;\n }",
"@java.lang.Override\n public double getPValue() {\n return pValue_;\n }",
"public int getPontosTimeMandante() {\r\n return pontosTimeMandante;\r\n }",
"public double getPCapacity() {\n\t\treturn pCapacity;\n }",
"public TreeSet<String> getPcsMet() {\n return pcsMet;\n }",
"@Override\r\n\tpublic Double getPropensity_pension_score() {\n\t\treturn super.getPropensity_pension_score();\r\n\t}",
"public int getPais() {\n return pais;\n }",
"public int getPrecio(){\n return precio;\n }",
"public float getPressure() {\n return pm.pen.getLevelValue(PLevel.Type.PRESSURE);\n }",
"public int getPromo() {\n\t\tif (getDistance() <= N*1000) {\n\t\t\treturn 0;\n\t\t} else if (getDistance() > (promoKm + N) * 1000){\n\t\t\treturn promoKm * costPerKm * promo / 100;\n\t\t} else {\n\t\t\treturn getTotal() * promo / 100;\n\t\t}\n\t}",
"public float getminP() {\n Reading minPressureReading = null;\n float minPressure = 0;\n if (readings.size() >= 1) {\n minPressure = readings.get(0).pressure;\n for (int i = 1; i < readings.size(); i++) {\n if (readings.get(i).pressure < minPressure) {\n minPressure = readings.get(i).pressure;\n }\n }\n } else {\n minPressure = 0;\n }\n return minPressure;\n }",
"public float getmaxP() {\n Reading maxPressureReading = null;\n float maxPressure = 0;\n if (readings.size() >= 1) {\n maxPressure = readings.get(0).pressure;\n for (int i = 1; i < readings.size(); i++) {\n if (readings.get(i).pressure > maxPressure) {\n maxPressure = readings.get(i).pressure;\n }\n }\n } else {\n maxPressure = 0;\n }\n return maxPressure;\n }",
"public double getPauseFraction()\r\n {\r\n return pauseFraction;\r\n }",
"public double getMargeParProduit(Produit p) {\n\t\tdouble m;\n\t\tif (p.getNomProduit()==\"50%\") {\n\t\t\tm = 0.1;\t\n\t\t}\n\t\telse {\n\t\t\tif (p.getNomProduit()==\"60%\") {\n\t\t\t\tm = 0.05;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tm = 0.2;\n\t\t\t}\n\t\t} return m;\n\t}",
"public double obtenerPrecio() {\n return precio;\n }",
"public double getPrecio() {\n return precio;\n }",
"private PiattoModulo getModuloPiatto() {\n return (PiattoModulo)Progetto.getModulo(Ristorante.MODULO_PIATTO);\n }",
"public double findTopPressure() {\n\t\tdouble constant = .5 *1.225* Math.pow(Controller.window.flowVelocity, 2) + Controller.window.atmoPressure;\n\t\tdouble neoConstantnotDone = .5 *1.225* Math.pow(Controller.window.flowVelocity, 2)\n\t\t\t\t* (findSurfaceArea(1, xs.length / 2) / getChordLength());\n\t\treturn constant - neoConstantnotDone;\n\t}",
"public double getPromedio() {\r\n return promedio;\r\n }",
"public BigDecimal getGRACE_PRD_CMPND_PROFIT_AMT() {\r\n return GRACE_PRD_CMPND_PROFIT_AMT;\r\n }",
"public static long mass () { return mass;}",
"public int getMPPerSecond() {\n return mPPerSecond_;\n }",
"public double getPrecio() {\n\t\treturn precio;\n\t}",
"public Pit getPit();",
"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 void calcP() {\r\n\t\tthis.setP(sick/people.size());\r\n\t}",
"public int getActivePens(){\n return this.mFarm.getActivePens();\n }",
"int getCurMP();",
"int getCurMP();",
"int getCurMP();",
"int getCurMP();",
"int getCurMP();",
"int getCurMP();",
"public Double getPrecio() {\n return precio;\n }",
"public Number getGroundPricePerMeter() {\n return (Number) getAttributeInternal(GROUNDPRICEPERMETER);\n }",
"public BigDecimal getCpmPaid() {\n return cpmPaid;\n }",
"public double getReadPressure(){\n return this.mFarm.getReadPressure();\n }",
"String getPrecio();",
"public int getMPPerSecond() {\n return mPPerSecond_;\n }",
"int getMaxMP();",
"int getMaxMP();",
"int getMaxMP();",
"int getMaxMP();",
"int getMaxMP();",
"int getMaxMP();",
"@Override\n\tpublic float getPrecio() {\n\t\treturn 60.2f;\n\t}",
"public Long getPps() {\n return this.Pps;\n }",
"public static PVProperty getPVProperty() {\n return pvProperty;\n }",
"private double readPressureSample() {\n return 6 * randomPressureSampleSimulator.nextDouble() * randomPressureSampleSimulator.nextDouble();\n }",
"public int getPotion() {\n return getStat(potion);\n }",
"public int getPresencaPolicial() {\n return presencaPolicial;\n }",
"public double getPDPTotalCurrent() { return totalCurrent; }",
"public int getNumMP(){\n\t\treturn numMP;\n\t}",
"public BigDecimal getACTUAL_PROFIT_AMT() {\r\n return ACTUAL_PROFIT_AMT;\r\n }",
"public ReporteProblema getProb() {\n return prob;\n }",
"public BigDecimal getCpMoney() {\n return cpMoney;\n }",
"public int getTempoPatrulha() {\n return tempoPatrulha;\n }",
"public int getMaxMP() {\n return maxMP_;\n }",
"public int getMaxMP() {\n return maxMP_;\n }",
"public int getMaxMP() {\n return maxMP_;\n }",
"public int getMaxMP() {\n return maxMP_;\n }",
"public int getMaxMP() {\n return maxMP_;\n }"
] | [
"0.7139246",
"0.69397956",
"0.6640086",
"0.6610957",
"0.65901166",
"0.65538156",
"0.6469151",
"0.6443226",
"0.64094925",
"0.63562834",
"0.6349852",
"0.6333374",
"0.6283403",
"0.62365675",
"0.62355435",
"0.6233365",
"0.623132",
"0.62219906",
"0.62084186",
"0.6191361",
"0.61678773",
"0.6151448",
"0.6148578",
"0.6134205",
"0.6132761",
"0.61104715",
"0.6013226",
"0.6003014",
"0.6000623",
"0.59832925",
"0.5966258",
"0.5966088",
"0.59651816",
"0.59651816",
"0.59602845",
"0.595278",
"0.5952416",
"0.5946422",
"0.59399086",
"0.59373885",
"0.59274554",
"0.59034055",
"0.58982474",
"0.5890278",
"0.58739674",
"0.5864761",
"0.5858433",
"0.58537316",
"0.584877",
"0.584805",
"0.58480024",
"0.58389777",
"0.5836612",
"0.58349967",
"0.5831628",
"0.58236265",
"0.5818664",
"0.580442",
"0.5799928",
"0.57984567",
"0.5798078",
"0.5793581",
"0.5777509",
"0.57721645",
"0.5770297",
"0.5764514",
"0.5764514",
"0.5764514",
"0.5764514",
"0.5764514",
"0.5764514",
"0.5764198",
"0.5758608",
"0.5752291",
"0.5751404",
"0.57453734",
"0.57400084",
"0.5734829",
"0.5734829",
"0.5734829",
"0.5734829",
"0.5734829",
"0.5734829",
"0.5728856",
"0.5723985",
"0.5720367",
"0.57140106",
"0.5712864",
"0.57111645",
"0.570502",
"0.5700298",
"0.5700235",
"0.56955236",
"0.5692773",
"0.5682205",
"0.56808513",
"0.5680796",
"0.5680796",
"0.5680796",
"0.5680678"
] | 0.7932244 | 0 |
/ Checks the existance of the header 'xrequestedwith' | public boolean isAjaxRequest() {
return ERXAjaxApplication.isAjaxRequest(context().request());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean hasReqHeaders() {\n return fieldSetFlags()[5];\n }",
"default boolean hasHeader() {\n return true;\n }",
"@Override\n public boolean containsHeader(String arg0) {\n return false;\n }",
"boolean hasRequest();",
"boolean hasRequest();",
"boolean hasRequest();",
"boolean hasRequest();",
"boolean hasRequest();",
"boolean hasRequest();",
"boolean hasRequest();",
"boolean hasRequest();",
"boolean hasRequest();",
"boolean hasRequest();",
"boolean hasHeader();",
"@Override\n\tpublic boolean containsHeader(String name) {\n\t\treturn false;\n\t}",
"boolean isSetHeader();",
"@Override\n public boolean containsHeader(String name) {\n return this._getHttpServletResponse().containsHeader(name);\n }",
"protected boolean isXARequester()\n {\n return (getManagerLevel(CodePoint.XAMGR) >= 7);\n \n }",
"private boolean inspectHeader() throws UrlCacheException {\n\n\t\tif(header.contains(\"HTTP/1.1 2\")){\n\t\t\treturn true;\n\t\t}\n\t\telse if(header.contains(\"HTTP/1.1 304\"))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tthrow new UrlCacheException();\n\t\t\n\t}",
"boolean hasSystemRequest();",
"public boolean hasRequests(){\n return (tradeRequests.size() > 0 || userRequests.size() > 0);\n }",
"public boolean hasRequest() {\n return request_ != null;\n }",
"public boolean hasRequest() {\n return request_ != null;\n }",
"public boolean hasRequest() {\n return request_ != null;\n }",
"public boolean hasRequest (String name)\n {\n org.omg.CORBA.portable.InputStream $in = null;\n try {\n org.omg.CORBA.portable.OutputStream $out = _request (\"hasRequest\", true);\n $out.write_string (name);\n $in = _invoke ($out);\n boolean $result = $in.read_boolean ();\n return $result;\n } catch (org.omg.CORBA.portable.ApplicationException $ex) {\n $in = $ex.getInputStream ();\n String _id = $ex.getId ();\n throw new org.omg.CORBA.MARSHAL (_id);\n } catch (org.omg.CORBA.portable.RemarshalException $rm) {\n return hasRequest (name );\n } finally {\n _releaseReply ($in);\n }\n }",
"boolean hasClientRequest();",
"boolean hasRequestId();",
"boolean containsHeader(String name);",
"boolean hasDownloadRequest();",
"@Test(priority=5)\r\n\tpublic void validateHeader()\r\n\t{\r\n\t\tgiven()\r\n\t\t.get(\"https://reqres.in/api/users/2\")\r\n\t\t.then() \r\n\t \t.header(\"Content-Type\", containsString(\"application/json\")); \r\n\t\t//application/json; charset=utf-8 \r\n\t}",
"boolean hasTxnrequest();",
"public boolean hasRequest() {\n return ((bitField0_ & 0x00000080) == 0x00000080);\n }",
"public boolean hasRequest() {\n return ((bitField0_ & 0x00000080) == 0x00000080);\n }",
"public boolean hasRequest() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }",
"public boolean hasRequest() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }",
"public boolean hasRequest() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }",
"public boolean hasRequest() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }",
"public boolean hasRequest() {\n return requestBuilder_ != null || request_ != null;\n }",
"public boolean hasRequest() {\n return requestBuilder_ != null || request_ != null;\n }",
"public Boolean checkAJAX(HttpServletRequest request) {\n\t\tBoolean flgXhr = false;\n\t\tString strXhr = (String) request.getHeader(\"X-Requested-With\");\n\t\tif (strXhr == null) {\n\t\t\tstrXhr = (String) request.getAttribute(\"xhr\");\n\t\t\tif (strXhr == null || !strXhr.equalsIgnoreCase(\"true\"))\n\t\t\t\tstrXhr = null;\n\t\t}\n\t\tflgXhr = (strXhr != null && !strXhr.equals(\"com.android.browser\"));\n\t\treturn (flgXhr);\n\t}",
"boolean isSetRequestID();",
"public boolean hasHeader() {\n return hasHeader;\n }",
"protected boolean isHeadRequest(ActionInvocation actionInvocation) {\n return actionInvocation.method != null && HTTPMethod.HEAD.is(actionInvocation.method.httpMethod);\n }",
"public synchronized boolean hasFriendRequest(FriendRequest req) {\n \t\treturn indexOfFriendRequest(req) != -1;\n \t}",
"@java.lang.Override\n public boolean hasHttpRequest() {\n return httpRequest_ != null;\n }",
"public boolean hasRequest() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }",
"public boolean hasRequest() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }",
"public boolean hasRequest() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }",
"public boolean hasRequest() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }",
"public boolean hasReqRemoteAddr() {\n return fieldSetFlags()[3];\n }",
"public boolean hasReqMessage() {\n return fieldSetFlags()[1];\n }",
"private void checkHeaderGeneration() {\r\n\t\tif (headerGenerated) {\r\n\t\t\tthrow new RuntimeException(\"Header already generated using previous value.\");\r\n\t\t}\r\n\t}",
"public boolean isIssrReq() {\n return issrReq;\n }",
"private final boolean checkHeader(int paramInt) {\n/* 406 */ if (paramInt != 1416784229) {\n/* 407 */ return false;\n/* */ }\n/* */ \n/* 410 */ if ((this.m_options_ & 0xF) != 5 || (this.m_options_ >> 4 & 0xF) != 2)\n/* */ {\n/* */ \n/* */ \n/* */ \n/* 415 */ return false;\n/* */ }\n/* 417 */ return true;\n/* */ }",
"public static boolean isRequestHeader(SIPHeader sipHeader) {\n return sipHeader instanceof AlertInfo ||\n sipHeader instanceof InReplyTo ||\n sipHeader instanceof Authorization ||\n sipHeader instanceof MaxForwards ||\n \tsipHeader instanceof UserAgent ||\n sipHeader instanceof Priority ||\n sipHeader instanceof ProxyAuthorization ||\n sipHeader instanceof ProxyRequire ||\n sipHeader instanceof ProxyRequireList ||\n sipHeader instanceof Route ||\n sipHeader instanceof RouteList ||\n sipHeader instanceof Subject ;\n \n }",
"public boolean isSetHeaders() {\n return this.headers != null;\n }",
"private void validatePreferHeader(ODataRequest request) throws ODataHandlerException {\n List<String> returnPreference = request.getHeaders(PREFER);\n if (null != returnPreference) {\n for (String preference : returnPreference) {\n if (preference.equals(RETURN_MINIMAL) || preference.equals(RETURN_REPRESENTATION)) {\n throw new ODataHandlerException(\"Prefer Header not supported: \" + preference,\n ODataHandlerException.MessageKeys.INVALID_PREFER_HEADER, preference);\n } \n }\n }\n }",
"public boolean hasHeaders() {\n return (mHeaders != null);\n }",
"public boolean isSetReq() {\n return this.req != null;\n }",
"public boolean isSetReq() {\n return this.req != null;\n }",
"public boolean isSetReq() {\n return this.req != null;\n }",
"public boolean isSetReq() {\n return this.req != null;\n }",
"public boolean hasReqUri() {\n return fieldSetFlags()[4];\n }",
"public boolean hasRequest() {\n return instance.hasRequest();\n }",
"public boolean hasReqCustid() {\n return fieldSetFlags()[0];\n }",
"@Test\n public void sending_request_headers() {\n given()\n .baseUri(\"http://data.fixer.io/api\")\n .queryParam(\"access_key\", \"b406c5d0bd55d77d592af69a930f4feb\")\n .queryParam(\"Symbols\", \"USD\")\n .header(\"If-None-Match\", \"03a4545f530000f3491fbca200000001\")\n .header(\"If-Modified-Since\", \"Tue, 30 Jun 2020 01:01:25 GMT\").\n when()\n .get(\"/latest\").\n then()\n .log().all()\n .statusCode(200);\n }",
"public boolean containsKey(Object key)\r\n/* 386: */ {\r\n/* 387:556 */ return this.headers.containsKey(key);\r\n/* 388: */ }",
"@Test\n void httpEntityHasHeader() {\n assertEquals(expectedKeyValue, nsClient.getHttpEntity()\n .getHeaders().getFirst(expectedKeyName));\n }",
"@Override\n\tprotected Boolean isHeader(String[] fields) {\n\t\t//check\n return (isValid(fields) && fields[0].equals(\"event\") && fields[1].equals(\"yes\") && fields[2].equals(\"maybe\") && fields[3].equals(\"invited\") && fields[4].equals(\"no\"));\n\t}",
"public boolean hasTxnrequest() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }",
"public boolean hasRequestType() {\n return result.hasRequestType();\n }",
"public boolean hasTxnrequest() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }",
"private void validateRequest( DownloadRequest dreq )\n throws ErrorResponseException\n {\n String path = dreq.getPath();\n if ( path.endsWith( ResourceCatalog.VERSION_XML_FILENAME ) || path.indexOf( \"__\" ) != -1 )\n {\n throw new ErrorResponseException( DownloadResponse.getNoContentResponse() );\n }\n }",
"public boolean containsHeader(String s) {\n\t\treturn false;\n\t}",
"boolean hasJsonReqMsg();",
"public boolean isSetRequestID() {\n return EncodingUtils.testBit(__isset_bitfield, __REQUESTID_ISSET_ID);\n }",
"public static void trySendReqOSS()\n {\n Auth auth = new Auth();\n String authorization = generateOSSAuthHeader(auth.getId(), auth.getSecret(), \"GET\", \"/xeduo/index.html\");\n String date = getDateGMT();\n HttpRequest request = HttpUtil.createRequest(Method.GET, \"http://xeduo.oss-cn-hongkong.aliyuncs.com/index.html\");\n request.header(\"Authorization\", authorization);\n request.header(\"Date\",date);\n HttpResponse response = request.execute();\n System.out.println(request);\n System.out.println(response);\n }",
"public void test10(HttpServletRequest request) throws javax.servlet.ServletException, java.io.IOException {\n InetAddress addr = InetAddress.getByName(request.getRemoteAddr());\n if(addr.getHostName().endsWith(\"trustme.com\")){ /* BUG */\n\n }\n }",
"public boolean hasRequestId() {\n return result.hasRequestId();\n }",
"public void test7(HttpServletRequest request, HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException {\n InetAddress addr = InetAddress.getByName(request.getRemoteAddr());\n\n if(addr.getCanonicalHostName().startsWith(\"trustme.com\", 3)){ /* BUG */\n\n }\n }",
"protected void validateSpaRequest()\n\t{\n\t\tif (isSpaRequest())\n\t\t{\n\t\t\thttpContext.disableSpaRequest();\n\t\t\tsendSpaHeaders();\n\t\t}\n\t}",
"@java.lang.Override\n public boolean hasRequestStatus() {\n return ((bitField0_ & 0x00000008) != 0);\n }",
"@java.lang.Override\n public boolean hasRequestStatus() {\n return ((bitField0_ & 0x00000008) != 0);\n }",
"default boolean visitHeader() {\n\t\treturn true;\n\t}",
"boolean hasInitialResponse();",
"@Test\n\tpublic void verifyHeader() {\n\t\t\tHeaders head = response.getHeaders();\n\t\t\tAssert.assertEquals(head.getValues(\"Content-Type\").toString(), \"[application/json; charset=utf-8]\");\n\t\t}",
"public void test3(HttpServletRequest request, HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException {\n InetAddress addr = InetAddress.getByName(request.getRemoteAddr());\n if(addr.getCanonicalHostName().equals(\"trustme.com\")){ /* BUG */\n\n }\n }",
"public boolean isSetSenderHeaderName()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(SENDERHEADERNAME$24) != 0;\n }\n }",
"public boolean hasRetrieveFileResponse() {\n return msgCase_ == 11;\n }",
"public boolean isRequest(){\n return false;\n }",
"public boolean isValid() {\n return header.isValid();\n }",
"private void checkRequest(Request req) throws MethodNotAllowed, NotFound {\n if (!req.getHeader(\"Method\").equals(\"GET\") ||\n !req.getHeader(\"Version\").equals(\"HTTP/1.1\")) {\n throw new MethodNotAllowed();\n }\n if (req.getHeader(\"Path\").endsWith(\"/\")) {\n throw new NotFound();\n }\n }",
"@Test\n public void testEmptyResponseHeaderValidity() {\n assertFalse(\"Valid header on empty response.\", EMPTY.isHeaderValid());\n }",
"public boolean hasHttpRequest() {\n return ((bitField0_ & 0x00000001) != 0);\n }",
"public abstract boolean isAppropriateRequest(Request request);",
"org.apache.xmlbeans.XmlString xgetHeader();",
"private boolean isXKey(String key) {\r\n return key.startsWith(\"x-\");\r\n }",
"public void test4(HttpServletRequest request, HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException {\n InetAddress addr = InetAddress.getByName(request.getRemoteAddr());\n if(addr.getCanonicalHostName().equalsIgnoreCase(\"trustme.com\")){ /* BUG */\n\n }\n }",
"public boolean hasRetrieveFileResponse() {\n return msgCase_ == 11;\n }",
"public void Req_detail()\n {\n\t boolean reqpresent=reqdetails.size()>0;\n\t // boolean reqpresent = driver.findElements(By.linkText(\"Requests details\")).size()>0;\n\t if(reqpresent)\n\t {\n\t\t // System.out.println(\"Request details report is PRESENT\");\n\t }\n\t else\n\t {\n\t\t System.out.println(\"Request details report is not present\");\n\t }\n }",
"public boolean isHeaderParsed();"
] | [
"0.6711263",
"0.65941924",
"0.63321084",
"0.62475014",
"0.62475014",
"0.62475014",
"0.62475014",
"0.62475014",
"0.62475014",
"0.62475014",
"0.62475014",
"0.62475014",
"0.62475014",
"0.619136",
"0.61699367",
"0.6069363",
"0.6051351",
"0.6028632",
"0.6026076",
"0.590122",
"0.5855247",
"0.58025485",
"0.58025485",
"0.58025485",
"0.5792255",
"0.5760191",
"0.57580423",
"0.56852704",
"0.56779724",
"0.5677637",
"0.562895",
"0.5625451",
"0.5622817",
"0.55993783",
"0.55993783",
"0.5594144",
"0.5594144",
"0.55846",
"0.55846",
"0.55794305",
"0.5574205",
"0.55679256",
"0.5567307",
"0.55599785",
"0.5552552",
"0.5547797",
"0.5547797",
"0.5547262",
"0.5547262",
"0.55254585",
"0.55119187",
"0.5498209",
"0.54880434",
"0.5483148",
"0.54643685",
"0.5447186",
"0.5438931",
"0.54021907",
"0.5377393",
"0.5377393",
"0.5377393",
"0.5377393",
"0.53751546",
"0.5372734",
"0.5356455",
"0.5355351",
"0.53474325",
"0.53294075",
"0.5309804",
"0.530113",
"0.52995586",
"0.52918977",
"0.528548",
"0.5280063",
"0.5276055",
"0.52712256",
"0.5269057",
"0.5268438",
"0.52672875",
"0.5261445",
"0.52594113",
"0.52497226",
"0.5247848",
"0.5245149",
"0.5241736",
"0.5237154",
"0.5234655",
"0.5231032",
"0.5230202",
"0.52254033",
"0.52251863",
"0.522294",
"0.5222752",
"0.521869",
"0.5213447",
"0.5197385",
"0.5193226",
"0.51884836",
"0.5181795",
"0.5173861",
"0.51701814"
] | 0.0 | -1 |
Boolean varInvi = true; | @Override
public void onClick(View v) {
Intent int1 = new Intent(getApplicationContext(), lista.class);
int1.putExtra("variableInvitado", Sesion);
startActivity(int1 );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean hasVarValue();",
"boolean getVarReturn();",
"boolean getBoolean();",
"boolean getBoolean();",
"public void method_217(boolean var1) {}",
"public static void main(String[] args) {\n\r\n\r\n\t\t boolean value = true;\r\n\r\n\t\t value = false;\r\n\r\n\t\t System.out.println(\"The value for the Boolean variable is : \"+ value);\r\n\t\r\n\r\n}",
"public void setVar290(java.lang.Boolean value) {\n this.var290 = value;\n }",
"public void setVar101(java.lang.Boolean value) {\n this.var101 = value;\n }",
"public void setVar56(java.lang.Boolean value) {\n this.var56 = value;\n }",
"boolean getBoolValue();",
"boolean getBoolValue();",
"public static void main(String[] args) {\nboolean var=false;\nboolean var1=true;\n\nSystem.out.println(var +\" \"+var1);\n\t}",
"void setVarReturn(boolean varReturn);",
"public void method_9697(boolean var1) {\r\n this.field_9139 = var1;\r\n }",
"public void method_103(boolean var1) {\n this.field_4130 = var1;\n }",
"public void setVar11(java.lang.Boolean value) {\n this.var11 = value;\n }",
"public boolean estavacia(){\n return inicio==null;\n }",
"boolean isDummy() {\n return var == null;\n }",
"public boolean estVacia(){\n return inicio==null;\n }",
"public boolean getBoolean(){\r\n try{return kd.getJSONObject(ug).getBoolean(udn);}\r\n catch(JSONException e){return false;}\r\n }",
"boolean readBoolean();",
"public void setVar29(java.lang.Boolean value) {\n this.var29 = value;\n }",
"public boolean getBoolean();",
"public void setVar110(java.lang.Boolean value) {\n this.var110 = value;\n }",
"public boolean isVariable() {\n return false;\n }",
"public void setVar146(java.lang.Boolean value) {\n this.var146 = value;\n }",
"@Override\n\tpublic boolean isVar() {\n\t\treturn heldObj.isVar();\n\t}",
"private boolean isLava() {\n/* 317 */ return this.isLava;\n/* */ }",
"public void setVar245(java.lang.Boolean value) {\n this.var245 = value;\n }",
"public void setVar155(java.lang.Boolean value) {\n this.var155 = value;\n }",
"public boolean isIndicadorNuevo()\r\n/* 210: */ {\r\n/* 211:218 */ return this.indicadorNuevo;\r\n/* 212: */ }",
"public boolean estaVacia(){\n return inicio == null;\n }",
"boolean isSetNcbieaa();",
"public void setMyBool(boolean myBoolIn) {\n myBool = myBoolIn;\n }",
"public void setVar272(java.lang.Boolean value) {\n this.var272 = value;\n }",
"public boolean getAI(){return ai;}",
"Boolean getIndemnity();",
"public boolean get_boolean() {\n return local_boolean;\n }",
"protected boolean colaVacia() {\r\n return ini == -1;\r\n }",
"public void cambiarEstado(){\n\r\n revelado=true;\r\n }",
"public void setVar74(java.lang.Boolean value) {\n this.var74 = value;\n }",
"public Boolean asBoolean();",
"public Boolean getInplay(){\n return inplay;\n }",
"void mo28195a(C5670a aVar, boolean z);",
"boolean getValue();",
"public void setVar236(java.lang.Boolean value) {\n this.var236 = value;\n }",
"public boolean isActivo()\r\n/* 110: */ {\r\n/* 111:138 */ return this.activo;\r\n/* 112: */ }",
"boolean hasVarSrc();",
"public java.lang.Boolean getVar11() {\n return var11;\n }",
"public void setVar65(java.lang.Boolean value) {\n this.var65 = value;\n }",
"public boolean getMyBool() {\n return myBool;\n }",
"public void setVar20(java.lang.Boolean value) {\n this.var20 = value;\n }",
"public java.lang.Boolean getVar101() {\n return var101;\n }",
"public void setVar119(java.lang.Boolean value) {\n this.var119 = value;\n }",
"public boolean isActivo()\r\n/* 144: */ {\r\n/* 145:245 */ return this.activo;\r\n/* 146: */ }",
"public void setVar83(java.lang.Boolean value) {\n this.var83 = value;\n }",
"private CheckBoolean() {\n\t}",
"public boolean estaVacia(){\n if(darTamanio==0){\n return true;\n } \n else{\n return false;\n }\n}",
"public boolean esVacia(){\r\n return inicio == null;\r\n }",
"public boolean isActivo()\r\n/* 173: */ {\r\n/* 174:318 */ return this.activo;\r\n/* 175: */ }",
"public abstract boolean read_boolean();",
"void mo98208a(boolean z);",
"public boolean getMyStartBoolean(){\n return myStartBoolean;\n }",
"void mo1488a(boolean z);",
"public void setV(boolean v) {\n\tthis.v = v;\n }",
"boolean booleanOf();",
"public boolean ci() {\n/* 84 */ return true;\n/* */ }",
"boolean get();",
"public boolean estaVacia(){\n if(inicio==null){\n return true;\n }else{\n return false;\n }\n }",
"public void setIndicadorNuevo(boolean indicadorNuevo)\r\n/* 215: */ {\r\n/* 216:222 */ this.indicadorNuevo = indicadorNuevo;\r\n/* 217: */ }",
"void mo21069a(boolean z);",
"public void setVar191(java.lang.Boolean value) {\n this.var191 = value;\n }",
"void mo64153a(boolean z);",
"public boolean isPredeterminado()\r\n/* 154: */ {\r\n/* 155:264 */ return this.predeterminado;\r\n/* 156: */ }",
"public void setVar182(java.lang.Boolean value) {\n this.var182 = value;\n }",
"public boolean isProcessed() \n{\nObject oo = get_Value(\"Processed\");\nif (oo != null) \n{\n if (oo instanceof Boolean) return ((Boolean)oo).booleanValue();\n return \"Y\".equals(oo);\n}\nreturn false;\n}",
"public void set_boolean(boolean param) {\n this.local_boolean = param;\n }",
"public boolean verMina(){\n\r\n return espM;\r\n }",
"public java.lang.Boolean getVar56() {\n return var56;\n }",
"public void setVar47(java.lang.Boolean value) {\n this.var47 = value;\n }",
"public void setVar38(java.lang.Boolean value) {\n this.var38 = value;\n }",
"public java.lang.Boolean getVar11() {\n return var11;\n }",
"public void setVar2(java.lang.Boolean value) {\n this.var2 = value;\n }",
"boolean hasVal();",
"boolean hasVal();",
"public java.lang.Boolean getVar101() {\n return var101;\n }",
"public boolean sawNonboolean() {\n return nonboolean;\n }",
"public void setVar200(java.lang.Boolean value) {\n this.var200 = value;\n }",
"void mo99838a(boolean z);",
"void mo6661a(boolean z);",
"public void ativa()\n\t{\n\t\tativado = true;\n\t}",
"@Test\r\n public void testSetMatin() {\r\n System.out.println(\"*****************\");\r\n System.out.println(\"Test : setMatin\");\r\n boolean matin = false;\r\n Cours_Reservation instance = new Cours_Reservation();\r\n instance.setMatin(matin);\r\n assertEquals(matin, instance.isMatin());\r\n }",
"void mo3305a(boolean z);",
"public RubyBoolean getTrue() {\n return trueObject;\n }",
"boolean hasBoolValue();",
"public static void setInsta(boolean i) {\n insta = i;\n }",
"public boolean hasVariable(Generator producer) {\n boolean isNew = producer.getAttribute(AlgorithmConstants.IS_NEW_MICROGRID_KEY) != null && producer.getAttribute(AlgorithmConstants.IS_NEW_MICROGRID_KEY, Boolean.class); \n return producer.getStatus() && isNew;\n }",
"public boolean isBoolean();",
"private boolean Verific() {\n\r\n\treturn true;\r\n\t}",
"boolean isEBoolean();",
"public void setVar173(java.lang.Boolean value) {\n this.var173 = value;\n }"
] | [
"0.69905657",
"0.6958513",
"0.66399956",
"0.66399956",
"0.6599073",
"0.65345955",
"0.6529456",
"0.6526914",
"0.65012157",
"0.64876777",
"0.64876777",
"0.64289606",
"0.640601",
"0.6380812",
"0.63792187",
"0.6371399",
"0.6370227",
"0.63683444",
"0.6365311",
"0.63517225",
"0.63262784",
"0.6312825",
"0.63017213",
"0.62988657",
"0.62872595",
"0.62870485",
"0.6276381",
"0.6264633",
"0.6262105",
"0.62470573",
"0.6246657",
"0.62400705",
"0.62384444",
"0.62368137",
"0.6235827",
"0.623325",
"0.6214597",
"0.62142503",
"0.62088263",
"0.6208387",
"0.6193064",
"0.6192625",
"0.61891544",
"0.6164556",
"0.6163559",
"0.61630386",
"0.61567134",
"0.6149798",
"0.61480784",
"0.61395544",
"0.6139171",
"0.61260796",
"0.6114229",
"0.61085105",
"0.61043113",
"0.61038136",
"0.60965306",
"0.60894084",
"0.6085812",
"0.6085592",
"0.6066347",
"0.60607255",
"0.6052406",
"0.60509425",
"0.6047167",
"0.60381997",
"0.60372937",
"0.60364515",
"0.6036163",
"0.60261124",
"0.60242385",
"0.6023727",
"0.60188955",
"0.60149914",
"0.60131174",
"0.60006875",
"0.59962785",
"0.59937537",
"0.59924024",
"0.599056",
"0.59861934",
"0.598477",
"0.59828377",
"0.59818166",
"0.59818166",
"0.5978784",
"0.5975085",
"0.5972518",
"0.59660906",
"0.59589034",
"0.59556997",
"0.59540325",
"0.5944705",
"0.59350485",
"0.59292394",
"0.5922052",
"0.5918543",
"0.5914366",
"0.5901293",
"0.5899062",
"0.5896968"
] | 0.0 | -1 |
/ TextView textViewas = (TextView) findViewById(R.id.numcal); textViewas.setVisibility(View.VISIBLE); TextView textView2 = (TextView) findViewById(R.id.textcal); textView2.setVisibility(View.VISIBLE); | @Override
public void onClick(View v) {
if (txu.getText().toString().equals("")){
txu.setText("0");
}
TextView txu = (TextView) findViewById(R.id.total);
TextView txtBolus = (TextView) findViewById(R.id.txtBC);
TextView txtCarbos = (TextView) findViewById(R.id.txtCH);
TextView textView = (TextView) findViewById(R.id.numcal);
TextView bolusCorreccion = (TextView) findViewById(R.id.numBC);
TextView bolusCarbos = (TextView) findViewById(R.id.numCH);
TextView glucosa = (TextView) findViewById(R.id.input_nombre);
TextView carbos = (TextView) findViewById(R.id.input_apellido2);
TextView ratio = (TextView) findViewById(R.id.edit3);
TextView sensibilidad = (TextView) findViewById(R.id.edit4);
TextView rango = (TextView) findViewById(R.id.edit5);
totalCarb = Float.parseFloat(txu.getText().toString());
glucosaActual = Integer.parseInt(glucosa.getText().toString());
carbosCons = Integer.parseInt(carbos.getText().toString());
ratioS = Integer.parseInt(ratio.getText().toString());
sensibilidadS = Integer.parseInt(sensibilidad.getText().toString());
rangoS = Integer.parseInt(rango.getText().toString());
correcion = ((glucosaActual - rangoS)/sensibilidadS);
ch = (carbosCons +totalCarb) / ratioS;
total = correcion + ch;
bolusCorreccion.setText(String.format("%.2f", correcion));
bolusCarbos.setText(String.format("%.2f", ch));
textView.setText(String.format("%.2f", total));
textView.setVisibility(View.VISIBLE);
bolusCorreccion.setVisibility(View.VISIBLE);
bolusCarbos.setVisibility(View.VISIBLE);
txtBolus.setVisibility(View.VISIBLE);
txtCarbos.setVisibility(View.VISIBLE);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void nastavViews() {\n tv_steps = (TextView) findViewById(R.id.textview1);\n den = (TextView) findViewById(R.id.time1);\n kcalTv = (TextView) findViewById(R.id.kCalTv);\n df = new SimpleDateFormat(\"EEE, d. MMM\");\n df2 = new SimpleDateFormat(\"dd-MMM-yyyy\");\n c = Calendar.getInstance().getTime();\n aktualnyDatum = df.format(c);\n aktualnyDatum2 = df2.format(c);\n }",
"private void display() {\n TextView textview = (TextView) findViewById(R.id.textView);\n EditText editText = (EditText) findViewById(R.id.editNumber) ;\n textview.setText(\"TEXT\");\n editText.setText(\"\");\n\n }",
"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 onClick(View v) {\n if(textViewDescription.getVisibility() != View.VISIBLE && textViewDescription.getText().toString() != null){\n\n textViewDescription.setVisibility(View.VISIBLE);\n barreHorizontale.setVisibility(View.VISIBLE);\n }else{\n barreHorizontale.setVisibility(View.GONE);\n textViewDescription.setVisibility(View.GONE);\n }\n\n }",
"private void showTextViews(Boolean show) {\n if (show) {\n this.lblTitle.setVisibility(View.VISIBLE);\n this.lblDescription.setVisibility(View.VISIBLE);\n this.lblDateCreated.setVisibility(View.VISIBLE);\n return;\n }\n this.lblTitle.setVisibility(View.INVISIBLE);\n this.lblDescription.setVisibility(View.INVISIBLE);\n this.lblDateCreated.setVisibility(View.INVISIBLE);\n }",
"private void m50375a(TextView textView) {\n textView.setVisibility(8);\n }",
"@Override\r\n\tpublic void onClick(View v) {\n\t\ttxt1.setVisibility(View.GONE);\r\n\t txt2.setVisibility(View.GONE);\r\n\t txt3.setVisibility(View.GONE);\r\n\t txt4.setVisibility(View.GONE);\r\n\t txt5.setVisibility(View.GONE);\r\n\t txt6.setVisibility(View.GONE);\r\n\t /* txt7.setVisibility(View.GONE);\r\n\t txt8.setVisibility(View.GONE);*/\r\n\t txt9.setVisibility(View.GONE);\r\n\t txt10.setVisibility(View.GONE);\r\n\t \r\n\t img2.setVisibility(View.VISIBLE);\r\n\t img3.setVisibility(View.VISIBLE);\r\n\t img4.setVisibility(View.VISIBLE);\r\n\t \r\n\t btn2.setVisibility(View.VISIBLE);\r\n\t btn3.setVisibility(View.VISIBLE);\r\n\t btn4.setVisibility(View.VISIBLE);\r\n\t back.setVisibility(View.GONE);\r\n\t scr.setVisibility(View.GONE);\r\n\t myBrowser.setVisibility(View.GONE);\r\n\t scr.setVisibility(View.GONE);\r\n\t \r\n\t \r\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t\r\n\t\t\t\ttxt1.setVisibility(View.VISIBLE);\r\n\t\t\t txt2.setVisibility(View.VISIBLE);\r\n\t\t\t txt3.setVisibility(View.VISIBLE);\r\n\t\t\t txt4.setVisibility(View.VISIBLE);\r\n\t\t\t txt5.setVisibility(View.VISIBLE);\r\n\t\t\t txt9.setVisibility(View.VISIBLE);\r\n\t\t\t txt10.setVisibility(View.VISIBLE);\r\n\t\t\t \r\n\t\t\t img2.setVisibility(View.GONE);\r\n\t\t\t img3.setVisibility(View.GONE);\r\n\t\t\t img4.setVisibility(View.GONE);\r\n\t\t\t \r\n\t\t\t btn2.setVisibility(View.GONE);\r\n\t\t\t btn3.setVisibility(View.GONE);\r\n\t\t\t btn4.setVisibility(View.GONE);\r\n\t\t\t back.setVisibility(View.VISIBLE);\r\n\t\t\t \r\n\t\t\t txt6.setVisibility(View.GONE);\r\n\t\t\t myBrowser.setVisibility(View.GONE);\r\n\t\t\t //txt7.setVisibility(View.GONE);\r\n\t\t\t // txt8.setVisibility(View.GONE);\r\n\t\t\t scr.setVisibility(View.GONE);\r\n\r\n\t\t\t}",
"public void TextView_Config(){\n textviewBaro=(TextView) findViewById(R.id.textviewGravity);\n textviewAcceleration=(TextView) findViewById(R.id.textviewAcceleration);\n textviewGyro=(TextView) findViewById(R.id.textviewGyro);\n display=(TextView)findViewById(R.id.textView1);\n }",
"private void setViews4Display() {\n nameView.setFocusable(false);\n nameView.setClickable(false);\n nameView.setInputType(InputType.TYPE_NULL);\n\n ageView.setFocusable(false);\n ageView.setClickable(false);\n ageView.setInputType(InputType.TYPE_NULL);\n\n phoneView.setFocusable(false);\n phoneView.setClickable(false);\n phoneView.setInputType(InputType.TYPE_NULL);\n\n workView.setFocusable(false);\n workView.setClickable(false);\n workView.setInputType(InputType.TYPE_NULL);\n\n emailView.setFocusable(false);\n emailView.setClickable(false);\n emailView.setInputType(InputType.TYPE_NULL);\n\n save.setVisibility(View.GONE);\n\n if (nameView.getText().toString().equals(\"\"))\n nameView.setVisibility(View.GONE);\n if (ageView.getText().toString().equals(\"\"))\n ageView.setVisibility(View.GONE);\n if (emailView.getText().toString().equals(\"\"))\n emailView.setVisibility(View.GONE);\n if (workView.getText().toString().equals(\"\"))\n workView.setVisibility(View.GONE);\n if (phoneView.getText().toString().equals(\"\"))\n phoneView.setVisibility(View.GONE);\n\n // check if user have past activities\n int childCount = past_activities.getChildCount();\n if (childCount == 1)\n past_activities.setVisibility(View.GONE);\n }",
"private void setTextViews() {\n TextView textToggleFilters = (TextView) findViewById(R.id.text_totalExpenditure);\n textToggleFilters.setPaintFlags(textToggleFilters.getPaintFlags() | Paint.FAKE_BOLD_TEXT_FLAG);\n }",
"private void findViews() {\n\n altura_et = findViewById(R.id.et_altura);\n altura_et.setText(String.valueOf(user.getAltura()));\n\n peso_et = findViewById(R.id.et_peso);\n peso_et.setText(String.valueOf(user.getPeso()));\n\n nombreUO_et = findViewById(R.id.et_uo);\n nombreUO_et.setText(user.getUserID());\n\n email_et = (EditText) findViewById(R.id.editTextEmail);\n email_et.setText(user.getCorreo().toString());\n\n nombre = findViewById(R.id.tv_nombre);\n nombre.setText(user.getNombre().concat(\" \").concat(user.getApellidos()));\n\n fecha = findViewById(R.id.textViewFechaNaci);\n fecha.setText(fecha.getText().toString().concat(\" \").concat(user.getNacimiento()));\n\n email_et.setEnabled(false);\n altura_et.setEnabled(false);\n peso_et.setEnabled(false);\n nombreUO_et.setEnabled(false);\n }",
"private void showLeyendas(){\n\t\tint status;\n\t\t\n\t\tif(!CuentaUtils.isCuentaPro() || CuentaUtils.isDowngrade()){\n\t\t\tlabelMaxImagenes.setText(R.string.txtMaxImagenes1);\n\t\t\tstatus = View.VISIBLE;\n\t\t}\t\t\t\t\t\n\t\telse{\n\t\t\tlabelMaxImagenes.setText(R.string.txtMaxImagenes2);\n\t\t\tstatus = View.GONE;\n\t\t}\n\t\t\n\t\tfor(int i=0;i<layoutGaleria.getChildCount();i++){\n\t\t View child=layoutGaleria.getChildAt(i);\n\t\t if(child.getId() != R.id.labelMaxImagenes){\n\t\t \t child.setVisibility(status);\n\t\t }\n\t\t}\n\t\t\n\t}",
"@Override\n\t public void onClick(View v) {\n \t\t \n \t\tdancea.setVisibility(View.VISIBLE);\n \t\t croa.setVisibility(View.INVISIBLE);\n \t\t kfja.setVisibility(View.INVISIBLE);\n \t\t starters.setVisibility(View.INVISIBLE);\n \t\t smia.setVisibility(View.INVISIBLE);\n \t\t diz1.setVisibility(View.INVISIBLE); \n \t\t\t diz2.setVisibility(View.INVISIBLE);\n \t\t\t plaa.setVisibility(View.INVISIBLE);\n \t\t\tstarteres.setVisibility(View.INVISIBLE);\n \t \t\t diz3.setVisibility(View.INVISIBLE); \n \t\t\t diz4.setVisibility(View.INVISIBLE);\n \t\t\ttjza.setVisibility(View.INVISIBLE);\n \t startAnimationdan();\n \t b = 0 ;\n \t \t \n \t }",
"@Override\n\tpublic void findViews() {\n\t\tet1 = (TextView) findViewById(R.id.et1);\n\t\tet2 = (TextView) findViewById(R.id.et2);\n\t\tet3 = (TextView) findViewById(R.id.et3);\n\t\tet4 = (TextView) findViewById(R.id.et4);\n\t\tet5 = (TextView) findViewById(R.id.et5);\n\t\tet6 = (TextView) findViewById(R.id.et6);\n\t\tet7 = (TextView) findViewById(R.id.et7);\n\t\tet8 = (TextView) findViewById(R.id.et8);\n\t\tet9 = (TextView) findViewById(R.id.et9);\n\t\tet10 = (TextView) findViewById(R.id.et10);\n\t\tet11 = (TextView) findViewById(R.id.et11);\n\t\tet12 = (TextView) findViewById(R.id.et12);\n\t\tet13 = (TextView) findViewById(R.id.et13);\n\t\tet14 = (TextView) findViewById(R.id.et14);\n\t\ttv_total1 = findViewById(R.id.tv_total1);\n\t\ttv_total2 = findViewById(R.id.tv_total2);\n\t\tiv1 = findViewById(R.id.im1);\n\t\tiv2 = findViewById(R.id.im2);\n\t\tiv3 = findViewById(R.id.im3);\n\t\tiv4 = findViewById(R.id.im4);\n\t\tiv5 = findViewById(R.id.im5);\n\t\tiv6 = findViewById(R.id.im6);\n\t\tiv7 = findViewById(R.id.im7);\n\t\tiv8 = findViewById(R.id.im8);\n\t\tiv9 = findViewById(R.id.im9);\n\t\tiv10 = findViewById(R.id.im10);\n\t\tiv11 = findViewById(R.id.im11);\n\t\tiv12 = findViewById(R.id.im12);\n\t\tiv13 = findViewById(R.id.im13);\n\t\tiv14 = findViewById(R.id.im14);\n\t\ttv_title1 = (TextView) findViewById(R.id.tv_title1);\n\t\ttv_title2 = (TextView) findViewById(R.id.tv_title2);\n\t\ttv_title3 = (TextView) findViewById(R.id.tv_title3);\n\t\ttv_title4 = (TextView) findViewById(R.id.tv_title4);\n\t\ttv_title5 = (TextView) findViewById(R.id.tv_title5);\n\t\ttv_title6 = (TextView) findViewById(R.id.tv_title6);\n\t\ttv_title7 = (TextView) findViewById(R.id.tv_title7);\n\t\tll_progress = (LinearLayout) findViewById(R.id.ll_progress);\n\t\tll_progress.setVisibility(View.VISIBLE);\n\t}",
"@Override\n public void onClick(View view) {\n //Metodos Getters y Setters\n tvSaludo.setVisibility(View.VISIBLE);\n tvSaludo.setText(\"HOLA ANDROIDS JUNIORS\"); // hard coding\n }",
"@Override\r\n\tpublic void onClick(View v) {\n\t\ttxt1.setVisibility(View.GONE);\r\n\t txt2.setVisibility(View.GONE);\r\n\t txt3.setVisibility(View.GONE);\r\n\t txt4.setVisibility(View.GONE);\r\n\t txt5.setVisibility(View.GONE);\r\n\t txt9.setVisibility(View.GONE);\r\n\t txt10.setVisibility(View.GONE);\r\n\t \r\n\t img2.setVisibility(View.GONE);\r\n\t img3.setVisibility(View.GONE);\r\n\t img4.setVisibility(View.GONE);\r\n\t \r\n\t btn2.setVisibility(View.GONE);\r\n\t btn3.setVisibility(View.GONE);\r\n\t btn4.setVisibility(View.GONE);\r\n\t back.setVisibility(View.GONE);\r\n\t \r\n\t txt6.setVisibility(View.VISIBLE);\r\n\t l1.setVisibility(View.VISIBLE);\r\n\t // txt7.setVisibility(View.VISIBLE);\r\n\t // txt8.setVisibility(View.VISIBLE);\r\n\t myBrowser.setVisibility(View.VISIBLE);\r\n\t scr.setVisibility(View.VISIBLE);\r\n\t \r\n\t myBrowser.loadUrl(\"file:///android_asset/rules.html\");\r\n\r\n\t}",
"public void updateViews() {\n this.titleTextView.setText(title);\n this.authorTextView.setText(author);\n this.yearTextView.setText(String.valueOf(year));\n this.publisherTextView.setText(publisher);\n if (endsDate != \"\") {\n this.lentToDateTextView.setText(endsDate);\n } else {\n this.lentToDateTextView.setVisibility(View.GONE);\n this.lentToDateLabelTextView.setVisibility(View.GONE);\n }\n }",
"public void setarText() {\n txdata2 = (TextView) findViewById(R.id.txdata2);\n txdata1 = (TextView) findViewById(R.id.txdata3);\n txCpf = (TextView) findViewById(R.id.cpf1);\n txRenda = (TextView) findViewById(R.id.renda1);\n txCpf.setText(cpf3);\n txRenda.setText(renda.toString());\n txdata1.setText(data);\n txdata2.setText(data2);\n\n\n }",
"@Override\n\t public void onAnimationEnd(Animation animation) {\n\t\t findViewById(R.id.textView8).setVisibility(View.GONE);\n\t\t findViewById(R.id.textView81).setVisibility(View.GONE);\n\t \tfindViewById(R.id.textView9).setVisibility(View.GONE);\n\t \tfindViewById(R.id.textView10).setVisibility(View.GONE);\t \t\n\t \tfindViewById(R.id.textView11).startAnimation(animb);\n\t }",
"@Override\n public void onClick(View v) {\n contador++;\n if((contador%2)==0){\n elTexto.setText(\"Es divisible entre 2\");\n\n }else{\n elTexto.setText(R.string.titulo);\n elTexto.setText(elTexto.getText().toString()+contador);}\n //Texto directo\n //elTexto.setText(\"!!Soy el titulo!!! Contador:\"+contador);\n }",
"private void showElements(){\n question.setVisibility(View.VISIBLE);\n yes_for_joke.setVisibility(View.VISIBLE);\n no_for_joke.setVisibility(View.VISIBLE);\n progressBar.setVisibility(View.GONE);\n }",
"private void setViews() {\n\n TextView currentApixu = findViewById(R.id.currentApixu);\n TextView currentOwm = findViewById(R.id.currentOwm);\n TextView currentWu = findViewById(R.id.currentWu);\n\n currentApixu.setText(feedValues[0]);\n currentOwm.setText(feedValues[1]);\n currentWu.setText(feedValues[2]);\n }",
"private void setVisibilityTextViewDebetableGoalsNowNotAvailable (String visibility) {\n\n RelativeLayout tmpNotAvailable = (RelativeLayout) viewFragmentDebetablGoalNow.findViewById(R.id.textViewOurGoalsFunctionNotAvailable);\n\n if (tmpNotAvailable != null) {\n\n switch (visibility) {\n\n case \"show\":\n tmpNotAvailable.setVisibility(View.VISIBLE);\n break;\n case \"hide\":\n tmpNotAvailable.setVisibility(View.GONE);\n break;\n }\n }\n }",
"public void Limpiar(View view)\r\n {\n\r\n etCaja1.setText(\"\");\r\n etCaja2.setText(\"\");\r\n tvCaja3.setText(\"\");\r\n }",
"public void updateTextViews() {\n // Set the inputs according to the initial input from the entry.\n //TextView dateTextView = (TextView) findViewById(R.id.date_textview);\n //dateTextView.setText(DateUtils.formatDateTime(getApplicationContext(), mEntry.getStart(), DateUtils.FORMAT_SHOW_DATE));\n\n EditText dateEdit = (EditText) findViewById(R.id.date_text_edit);\n dateEdit.setText(DateUtils.formatDateTime(this, mEntry.getStart(), DateUtils.FORMAT_NUMERIC_DATE | DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_SHOW_YEAR | DateUtils.FORMAT_ABBREV_ALL));\n\n EditText startTimeEdit = (EditText) findViewById(R.id.start_time_text_edit);\n startTimeEdit.setText(DateUtils.formatDateTime(this, mEntry.getStart(), DateUtils.FORMAT_SHOW_TIME));\n\n EditText endTimeEdit = (EditText) findViewById(R.id.end_time_text_edit);\n endTimeEdit.setText(DateUtils.formatDateTime(this, mEntry.getEnd(), DateUtils.FORMAT_SHOW_TIME));\n\n\n TextView descriptionView = (TextView) findViewById(R.id.description);\n descriptionView.setText(mEntry.getDescription());\n\n\n enableSendButtonIfPossible();\n }",
"private void findViews() {\n tvPercentFirstPlace = findViewById(R.id.tvPercentFirstPlace);\n tvPercentSecondPlace = findViewById(R.id.tvPercentSecondPlace);\n tvPercentThirdPlace = findViewById(R.id.tvPercentThirdPlace);\n tvMainPrizeWon = findViewById(R.id.tvMainPrizeWon);\n tvMainPrizeWonText = findViewById(R.id.tvMainPrizeWonText);\n tvPrizeWonFirstPlace = findViewById(R.id.tvPrizeWonFirstPlace);\n tvPrizeWonSecondPlace = findViewById(R.id.tvPrizeWonSecondPlace);\n tvPrizeWonThirdPlace = findViewById(R.id.tvPrizeWonThirdPlace);\n tvPlatformFee = findViewById(R.id.tvPlatformFee);\n tvPrizeSum = findViewById(R.id.tvPrizeSum);\n tvPrizeSumText = findViewById(R.id.tvPrizeSumText);\n tvMainPrizeWon.setText(String.valueOf(mainPrize));\n btnChange = findViewById(R.id.btnChange);\n btnNext = findViewById(R.id.btnNext);\n }",
"private void showfivetype() {\n\r\n\t\tbtn_menu1.setText(ticketname[btn_menu1_int]);\r\n\t\tbtn_menu2.setText(ticketname[btn_menu2_int]);\r\n\t\tbtn_menu3.setText(ticketname[btn_menu3_int]);\r\n\t\tbtn_menu4.setText(ticketname[btn_menu4_int]);\r\n\t\tbtn_menu5.setText(ticketname[btn_menu5_int]);\r\n\t\tif (btn_menu1_int == 0) {\r\n\t\t\tbtn_menu1.setVisibility(View.GONE);\r\n\t\t} else {\r\n\t\t\tbtn_menu1.setVisibility(View.VISIBLE);\r\n\t\t}\r\n\t\tif (btn_menu2_int == 0) {\r\n\t\t\tbtn_menu2.setVisibility(View.GONE);\r\n\t\t} else {\r\n\t\t\tbtn_menu2.setVisibility(View.VISIBLE);\r\n\t\t}\r\n\t\tif (btn_menu3_int == 0) {\r\n\t\t\tbtn_menu3.setVisibility(View.GONE);\r\n\t\t} else {\r\n\t\t\tbtn_menu3.setVisibility(View.VISIBLE);\r\n\t\t}\r\n\t\tif (btn_menu4_int == 0) {\r\n\t\t\tbtn_menu4.setVisibility(View.GONE);\r\n\t\t} else {\r\n\t\t\tbtn_menu4.setVisibility(View.VISIBLE);\r\n\t\t}\r\n\t\tif (btn_menu5_int == 0) {\r\n\t\t\tbtn_menu5.setVisibility(View.GONE);\r\n\t\t} else {\r\n\t\t\tbtn_menu5.setVisibility(View.VISIBLE);\r\n\t\t}\r\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 }",
"@Override\n\t public void onClick(View v) {\n \t\tsmia.setVisibility(View.VISIBLE);\n \t\t kfja.setVisibility(View.INVISIBLE);\n \t\t croa.setVisibility(View.INVISIBLE);\n \t\t dancea.setVisibility(View.INVISIBLE);\n \t\t starters.setVisibility(View.INVISIBLE);\n \t\t diz1.setVisibility(View.INVISIBLE); \n \t\t\t diz2.setVisibility(View.INVISIBLE);\n \t\t\t plaa.setVisibility(View.INVISIBLE);\n \t\t\tstarteres.setVisibility(View.INVISIBLE);\n \t \t\t diz3.setVisibility(View.INVISIBLE); \n \t\t\t diz4.setVisibility(View.INVISIBLE);\n \t\t\ttjza.setVisibility(View.INVISIBLE);\n \t startAnimationsmi();\n \t b = 0 ;\n \t }",
"@Override\n public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n final TextView sucursal2 = (TextView) findViewById(R.id.textSucursal2);\n boolean i = buttonView.isChecked();\n if (i == false) {\n// sucursal2.setVisibility(View.VISIBLE);\n sucursal2.animate()\n .translationX(0)\n .alpha(1.0f)\n .setDuration(300)\n .setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n super.onAnimationEnd(animation);\n sucursal2.setVisibility(View.VISIBLE);\n }\n });\n\n\n } else if (i == true) {\n// sucursal2.setVisibility(View.GONE);\n sucursal2.animate()\n .translationX(sucursal2.getWidth())\n .alpha(0.0f)\n .setDuration(300)\n .setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n super.onAnimationEnd(animation);\n sucursal2.setVisibility(View.GONE);\n }\n });\n\n }\n\n }",
"private void updateDisplay() \n\t{\n\t\t// updates the date in the TextView\n if(bir.hasFocus())\n {\n\t\tbir.setText(\n\t\t\t\tnew StringBuilder()\n\t\t\t\t// Month is 0 based so add 1\n\t\t\t\t\n\t\t\t\t.append(mDay).append(\"-\")\n\t\t\t\t.append(mMonth + 1).append(\"-\")\n\t\t\t\t.append(mYear).append(\" \"));\n }else\n {\n\t\taniv.setText(\n\t\t\t\tnew StringBuilder()\n\t\t\t\t// Month is 0 based so add 1\n\t\t\t\t\n\t\t\t\t.append(mDay).append(\"-\")\n\t\t\t\t.append(mMonth + 1).append(\"-\")\n\t\t\t\t.append(mYear).append(\" \"));\n }\n\n\n\t}",
"public void button0OnClick(View view){ display.setText(display.getText()+ \"0\");}",
"@Override\n\t public void onClick(View v) {\n\t\t tjza.setVisibility(View.VISIBLE);\n\t\t smia.setVisibility(View.INVISIBLE);\n\t\t kfja.setVisibility(View.INVISIBLE);\n\t\t croa.setVisibility(View.INVISIBLE);\n\t\t dancea.setVisibility(View.INVISIBLE);\n\t\t starters.setVisibility(View.INVISIBLE);\n\t\t diz1.setVisibility(View.INVISIBLE); \n\t\t\t diz2.setVisibility(View.INVISIBLE);\n\t\t\t plaa.setVisibility(View.INVISIBLE);\n\t\t\tstarteres.setVisibility(View.INVISIBLE);\n\t \t\t diz3.setVisibility(View.INVISIBLE); \n\t\t\t diz4.setVisibility(View.INVISIBLE);\n\t startAnimationtjz();\n\t b = 0 ;\n\t }",
"@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n\n Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);\n setSupportActionBar(toolbar);\n //getSupportActionBar().setDisplayHomeAsUpEnabled(true);\n\n\n hours = (EditText) findViewById(R.id.HoursET);\n tipBonus = (EditText) findViewById(R.id.TipForsSalET);\n travelers = (EditText) findViewById(R.id.HowManyTravelersET);\n distance = (EditText) findViewById(R.id.DistanceET);\n parking = (EditText) findViewById(R.id.ParkingET);\n privateTip = (EditText) findViewById(R.id.PrivateTipET);\n waitersTip = (EditText) findViewById(R.id.WaitersTipET);\n locationET = (EditText) findViewById(R.id.locationET);\n manualSalaryTV = (TextView) findViewById(R.id.ManuallySalC);\n\n dateTV = (TextView) findViewById(R.id.DateTV);\n timeStartTV = (TextView) findViewById(R.id.timeStartTV);\n timeEndTV = (TextView) findViewById(R.id.timeEndTV);\n sumTv = (TextView) findViewById(R.id.sumTV);\n sumCashTV = (TextView) findViewById(R.id.sumCash);\n drivesP = (TextView) findViewById(R.id.drivesTV);\n tipP = (TextView) findViewById(R.id.TipTv);\n manualSalaryET = (EditText) findViewById(R.id.ManualSalET);\n idForRes=(TextView)findViewById(R.id.IdForRes);\n\n\n commentsET = (EditText) findViewById(R.id.CommentsET);\n\n drivesP.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n if (!flagDrive) {\n distance.setVisibility(View.VISIBLE);\n parking.setVisibility(View.VISIBLE);\n flagDrive = true;\n } else {\n distance.setVisibility(View.GONE);\n parking.setVisibility(View.GONE);\n flagDrive = false;\n }\n\n }\n });\n\n tipP.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n if (!flagTip) {\n privateTip.setVisibility(View.VISIBLE);\n waitersTip.setVisibility(View.VISIBLE);\n tipBonus.setVisibility(View.VISIBLE);\n flagTip = true;\n } else {\n privateTip.setVisibility(View.GONE);\n waitersTip.setVisibility(View.GONE);\n tipBonus.setVisibility(View.GONE);\n flagTip = false;\n }\n\n }\n });\n final Intent intentA = new Intent(this, SetWorksActivity.class);\n\n if (db.getAllWorks().size() == 0) {\n startActivity(intentA);\n }\n else {\n spinner = (Spinner) findViewById(R.id.spinnerTE);\n\n ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, getWorksName());\n// Specify the layout to use when the list of choices appears\n adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n// Apply the adapter to the spinner\n spinner.setAdapter(adapter);\n spinner.setOnItemSelectedListener(this);\n\n if (db.getAllWorks().get(workIdPosition).getTypeOfDrive() < 2)\n distance.setHint(R.string.MainDriveManually);\n\n\n\n Intent intent = getIntent();\n id = intent.getIntExtra(\"id\", 9999);\n if (id != 9999)\n flagIsUpdate = true;\n\n if(!flagIsUpdate) {\n if (db.getAllWorks().get(workIdPosition).getTypeOfDrive() == 1)\n distance.setText(String.valueOf(db.getAllWorks().get(workIdPosition).getPerKilometer()));\n if(intent.getStringExtra(\"date\")!=null) {\n dateCalender = intent.getStringExtra(\"date\");\n dateTV.setText(dateCalender);\n date=dateCalender;\n }\n }\n\n\n if (flagIsUpdate)\n updateShift();\n\n }\n }",
"@Override\n\t\t\t\t\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\t\t\t\t\tebar.setVisibility(View.VISIBLE);\n\t\t\t\t\t\t\t\t\t\t\t\t\tesend.setVisibility(View.GONE);\n\t\t\t\t\t\t\t\t\t\t\t\t\tetopic.setEnabled(false);\n\t\t\t\t\t\t\t\t\t\t\t\t\tetext.setEnabled(false);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t}",
"private void showNoFavoriteMoviesTextView(){\n errorTextView.setVisibility(View.INVISIBLE);\n errorButton.setVisibility(View.INVISIBLE);\n errorButton.setEnabled(false);\n recyclerView.setVisibility(View.INVISIBLE);\n progressBar.setVisibility(View.INVISIBLE);\n noFavoriteMoviesTextView.setVisibility(View.VISIBLE);\n }",
"public void showTimer(){\n mTimerProgressBar.setVisibility(View.VISIBLE);\n mTimerText.setVisibility(View.VISIBLE);\n }",
"private void setVisibility( int answer_visibility )\n {\n int yes_no_visibility = View.VISIBLE;\n\n if ( answer_visibility == View.VISIBLE )\n {\n yes_no_visibility = View.INVISIBLE;\n }\n\n TextView question = (TextView) findViewById( R.id.question );\n question.setVisibility( yes_no_visibility );\n\n ImageView butterfly_icon = (ImageView) findViewById( R.id.butterfly_icon );\n \n if ( yes_no_visibility == View.VISIBLE )\n {\n ((AnimationDrawable) butterfly_icon.getBackground()).start();\n }\n else\n {\n ((AnimationDrawable) butterfly_icon.getBackground()).stop();\n }\n\n butterfly_icon.setVisibility( yes_no_visibility );\n\n ImageView caterpillar_icon = (ImageView) findViewById( R.id.caterpillar_icon );\n \n if ( yes_no_visibility == View.VISIBLE )\n {\n caterpillar_icon.startAnimation( caterpillar_icon_animation );\n }\n else\n {\n caterpillar_icon_animation.cancel();\n caterpillar_icon.clearAnimation();\n }\n\n caterpillar_icon.setVisibility(yes_no_visibility);\n\n TextView answer = (TextView) findViewById( R.id.answer );\n answer.setVisibility(answer_visibility);\n\n ImageView answer_rectangle = (ImageView) findViewById( R.id.answer_rectangle );\n answer_rectangle.setVisibility(answer_visibility);\n }",
"private void setTVnotication()\n {\n if(countnoti == 0)\n {\n tv_none_notification.setVisibility(View.VISIBLE);\n }\n else\n if(countnoti > 0)\n {\n tv_none_notification.setVisibility(View.GONE);\n }\n }",
"@Override\n\t public void onClick(View v) {\n \t\t croa.setVisibility(View.VISIBLE);\n \t dancea.setVisibility(View.INVISIBLE);\n \t\t kfja.setVisibility(View.INVISIBLE);\n \t\t starters.setVisibility(View.INVISIBLE);\n \t\t smia.setVisibility(View.INVISIBLE);\n \t\t diz1.setVisibility(View.INVISIBLE); \n \t\t diz2.setVisibility(View.INVISIBLE);\n \t\t plaa.setVisibility(View.INVISIBLE);\n \t\t starteres.setVisibility(View.INVISIBLE);\n \t\t diz3.setVisibility(View.INVISIBLE); \n\t\t diz4.setVisibility(View.INVISIBLE);\n\t\t tjza.setVisibility(View.INVISIBLE);\n \t startAnimationcroc();\n \t b = 0 ;\n \t player.stop();\n \t }",
"public void setTxtViews(){\n \tupdateTextView(\"Phil Simms\", \"txtPatientName\");\n \tupdateTextView(\"Male\", \"txtPatientGender\");\n \tupdateTextView(\"24\", \"txtPatientAge\");\n \tupdateTextView(\"13\", \"txtPatientRoom\");\n \tupdateTextView(\"Melanoma\", \"txtPatientDiagnosis\");\n \tupdateTextView(\"165\", \"txtPatientWeight\");\n \tupdateTextView(\"10am: Gave tylenol for headache.\", \"txtPatientRecentActions\");\n \tupdateTextView(\"Beach\", \"txtPatientNotes\");\n }",
"@Override\r\n\t\tpublic void bindView(View v, Context arg1, Cursor arg2) {\n\t\t\t String tv1 = arg2.getString(2);\r\n\t\t\t String tv3 = CommonCode.change_Date_Format(arg2.getString(3), \"yyyy-MM-dd HH:mm:ss\", \"MM-dd-yyyy HH:mm:ss\");\r\n\t\t\t String tv4 = arg2.getString(4);\r\n\t\t\t String tv2 = arg2.getString(1);\r\n\t\t\t String tv6 = arg2.getString(7);\r\n\t\t\t String tv5 = arg2.getString(6);\r\n\t\t\t String tv8 = arg2.getString(8);//randomnumber\r\n\t\t\t String tv7 = arg2.getString(5);\r\n\t\t\t \r\n\t\t\t final TextView text1 = (TextView) v.findViewById(R.id.textView1);\r\n\t\t\t final TextView text2 = (TextView) v.findViewById(R.id.textView2);\r\n\t\t\t final TextView text3 = (TextView) v.findViewById(R.id.textView3);\r\n\t\t\t final TextView text4 = (TextView) v.findViewById(R.id.textView4);\r\n\t\t\t final TextView text5 = (TextView) v.findViewById(R.id.textView5);\r\n\t\t\t final TextView text6 = (TextView) v.findViewById(R.id.textView6);\r\n\t\t\t final TextView text7 = (TextView) v.findViewById(R.id.textView7); \r\n\t\t\t final TextView text8 = (TextView) v.findViewById(R.id.textView8);\r\n\t\t\t \r\n\t\t\t\ttext1.setText(tv1);\r\n\t\t\t\ttext2.setText(tv2);\r\n\t\t\t\ttext3.setText(tv3);\r\n\t\t\t\ttext4.setText(tv4);\r\n\t\t\t\ttext5.setText(tv5);\r\n\t\t\t\ttext6.setText(tv6);\r\n\t\t\t\ttext7.setText(\"\");\r\n\t\t\t\ttext8.setText(\"\");\r\n\t\t}",
"private void findView() {\n\t\tteacher = Teacher.getTeacher(this);\r\n\t\tsaoyisaonan = (ImageView) findViewById(R.id.saoyisaonan);\r\n\t\tsaoyisaonv = (ImageView) findViewById(R.id.saoyisaonv);\r\n\t\tif(teacher.isBoy()){\r\n\t\t\tsaoyisaonan.setVisibility(View.VISIBLE);\r\n\t\t}else{\r\n\t\t\tsaoyisaonv.setVisibility(View.VISIBLE);\r\n\t\t}\r\n\t\tclose = (ImageView) findViewById(R.id.close);\r\n\t\tclose.setOnClickListener(this);\r\n\t\tlogin = (ImageView) findViewById(R.id.login);\r\n\t\tlogin.setOnClickListener(this);\r\n\t\treg = (ImageView) findViewById(R.id.reg);\r\n\t\treg.setOnClickListener(this);\r\n\t}",
"@Override\n public void onClick(View v) {\n if (v == ButtonCar1){\n if(red_line.isVisible()){\n red_line.setVisible(false);\n }\n if(yellow_line.isVisible()){\n yellow_line.setVisible(false);\n }\n else{\n yellow_line.setVisible(true);\n }\n }\n\n if( v == ButtonCar2) {\n if(yellow_line.isVisible()){\n yellow_line.setVisible(false);\n }\n if(red_line.isVisible()){\n red_line.setVisible(false);\n }\n else{\n red_line.setVisible(true);\n }\n }\n\n\n }",
"private void setStatTextViews() {\n TextView numLives = findViewById(R.id.lives);\n numLives.setText(String.valueOf(player.getLives()));\n\n TextView multiplier = findViewById(R.id.currMultiply);\n multiplier.setText(String.valueOf(player.getMultiplier()));\n\n TextView totalPoint = findViewById(R.id.currScore);\n totalPoint.setText(String.valueOf(player.getPoints()));\n }",
"private void setupTextView() {\n painterTextViewMoves = findViewById(R.id.painterTextView1);\n painterTextViewTime = findViewById(R.id.painterTextView2);\n painterTextViewPoints = findViewById(R.id.painterTextView3);\n painterTextViewInstructions = findViewById(R.id.painterInstructionsView);\n }",
"@Override\n\t public void onClick(View v) {\n \t\t smia.setVisibility(View.INVISIBLE);\n \t\t kfja.setVisibility(View.INVISIBLE);\n \t\t croa.setVisibility(View.INVISIBLE);\n \t\t dancea.setVisibility(View.INVISIBLE);\n \t\t starters.setVisibility(View.INVISIBLE);\n \t\t diz1.setVisibility(View.INVISIBLE); \n \t\t\t diz2.setVisibility(View.INVISIBLE);\n \t\t plaa.setVisibility(View.VISIBLE);\n \t\tstarteres.setVisibility(View.INVISIBLE);\n\t\t diz3.setVisibility(View.INVISIBLE); \n\t\t diz4.setVisibility(View.INVISIBLE);\n\t\t tjza.setVisibility(View.INVISIBLE);\n \t startAnimationbas();\n \t b = 1 ;\n \t player.stop();\n \t }",
"private void intviews() {\n\t\tyanzhengmall=(LinearLayout) findViewById(R.id.yanzhengma);\r\n\t\tphonell=(LinearLayout) findViewById(R.id.phone);\r\n\t\tzhucell=(LinearLayout) findViewById(R.id.zhuce);\r\n\t\tbtn=(Button) findViewById(R.id.button1);\r\n\t\tbtn1=(Button) findViewById(R.id.yanzhengmabutton);\r\n\t\tgetcodebtn=(Button) findViewById(R.id.getcodebtn);\r\n\t\tphoneet=(EditText) findViewById(R.id.phoneet);\r\n\t\tphonetv=(TextView) findViewById(R.id.phonetv);\r\n\t\tyanzhengmatv=(TextView) findViewById(R.id.yanzhengmatv);\r\n\t\tpasswordtv=(TextView) findViewById(R.id.passwordtv);\r\n\t\tbackimageview=(ImageView) findViewById(R.id.backimageview);\r\n\t\tcodeedittext=(EditText) findViewById(R.id.yanzhengmaEditText);\r\n\t\tpasswordet=(EditText) findViewById(R.id.passwordEditText);\r\n\t\tquerenpasswordet=(EditText) findViewById(R.id.passwordquerenEditText);\r\n\t\tregisterbtn=(Button) findViewById(R.id.zhucebutton);\r\n\t}",
"@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_time_adition);\n TimeButtons = new TextView[4];\n TimeButtons[0] = findViewById(R.id.Time2Y);\n TimeButtons[1] = findViewById(R.id.Time3M);\n TimeButtons[2] = findViewById(R.id.Time7D);\n TimeButtons[3] = findViewById(R.id.Time5H);\n //todo: сделать блять нормально\n TimeButtons[0].setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n time[0] += 2;\n }\n });\n TimeButtons[1].setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n time[1] += 3;\n }\n });\n TimeButtons[2].setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n time[2] += 7;\n }\n });\n TimeButtons[3].setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n time[3] += 5;\n }\n });\n //todo: сделать блять нормально\n }",
"@Override\n public void onClick(View v) {\n \tif (tgl_btn.isChecked()) {\n \t\tlay_feather.setVisibility(View.VISIBLE);\n \t\tlay_nail.setVisibility(View.GONE);\n\t\t\t\t}\n \telse {\n \t\tlay_feather.setVisibility(View.GONE);\n \t\tlay_nail.setVisibility(View.VISIBLE);\n\t\t\t\t}\n }",
"@Override\n protected void onCreate(Bundle savedInstanceState) {\n\n super.onCreate(savedInstanceState);\n\n setContentView(R.layout.activity_main);\n b1 = (Button) findViewById(R.id.button);\n b1.setOnClickListener(this);\n t = (TextView) findViewById(R.id.textView);\n\n\n\n\n}",
"@Override\n public void run() {\n mButton_Buy_Ticket.setVisibility(View.VISIBLE);\n ln_view_number.setVisibility(View.VISIBLE);\n }",
"@Override\n public void run() {\n mButton_Buy_Ticket.setVisibility(View.VISIBLE);\n ln_view_number.setVisibility(View.VISIBLE);\n }",
"private void initViews() {\n\n //O metodo findViewById() recupera a referencia do EditText que se encontra no XML.\n editTextQuantidade = (EditText) findViewById(R.id.edittext_quantidade);\n imageViewOvos = (ImageView) findViewById(R.id.imageview_ovos);\n textViewTotal = (TextView) findViewById(R.id.textview_total);\n }",
"@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.layout_one,container,false);\n view.findViewById(R.id.lay1);\n TxtViw1=(TextView)view.findViewById(R.id.lay1);\n String string=\"The director has put a lot of efforts in giving Baadshaho a period film look\" +\n \"The vehicles and props have been designed as per the need of the narration.\" +\n \"However, it is yet to be seen whether Baadshaho works as a complete package or not.\";\n TxtViw1.setText(string);\n return view;\n }",
"@Override\n public void onClick(View v) {\n a[0] = a[0] - 1;\n if (a[0] == 1) {\n tru.setVisibility(View.INVISIBLE);\n }\n sl.setText(String.valueOf(a[0]));\n int tong = Integer.parseInt(sl.getText().toString()) * Integer.parseInt(temp_gia);\n temp_sl.setText(sl.getText());\n temp_price.setText(price.getText());\n temp_total.setText(tong + \".000 đ\");\n }",
"protected void hideRevalView() {\n int cx = (iv_reval.getLeft() + iv_reval.getRight()) / 2;\n int cy = (iv_reval.getTop() + iv_reval.getBottom()) / 2;\n\n // get the final radius for the clipping circle\n int finalRadius = Math.max(iv_reval.getWidth(), iv_reval.getHeight());\n\n// create the animator for this view (the start radius is zero)\n Animator anim =\n ViewAnimationUtils.createCircularReveal(\n iv_reval,//对应的view\n iv_reval.getWidth() / 2,// 开始缩放点x位置\n iv_reval.getHeight() / 2,// 开始缩放点y位置\n iv_reval.getWidth(),// 开始半径和结束半径 hypot(double ,double ) 斜线的长度\n 0);\n // make the view visible and start the animation\n iv_reval.setVisibility(View.VISIBLE);\n anim.setDuration(2000);\n /* Set a natural ease-in/ease-out interpolator. */\n anim.setInterpolator(new AccelerateDecelerateInterpolator());\n anim.start();\n anim.addListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n iv_reval.setVisibility(View.GONE);\n }\n });\n }",
"public void searchBarClick() {\n String searchText = searchView.getText().toString();\n if(searchText.equals(\"Age\")) {\n age.setVisibility(View.VISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n } else if(searchText.equals(\"Sex\")) {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.VISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n } else if(searchText.equals(\"Chest Pain\")) {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.VISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n } else if(searchText.equals(\"Resting Blood Pressure\")) {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.VISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n } else if(searchText.equals(\"Serum Cholesterol\")) {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.VISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n } else if(searchText.equals(\"Fasting Blood Sugar Larger\")) {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.VISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n } else if(searchText.equals(\"Resting Electroc. Result\")) {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.VISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n } else if(searchText.equals(\"Maximum Heart Rate Achieved\")) {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.VISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n } else if(searchText.equals(\"Exercise Induced Angina\")) {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.VISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n } else if(searchText.equals(\"ST Depression Induc. ex.\")) {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.VISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n } else if(searchText.equals(\"Slope of Peak Exercise ST\")) {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.VISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n } else if(searchText.equals(\"Number of Major Vessel\")) {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.VISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n } else if(searchText.equals(\"Thalassemia\")) {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.VISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n } else if(searchText.equals(\"Pregnancies\")) {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.VISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n } else if(searchText.equals(\"Glucose\")) {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.VISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n } else if(searchText.equals(\"Blood Pressure\")) {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.VISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n } else if(searchText.equals(\"Skin Thickness\")) {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.VISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n } else if(searchText.equals(\"Insulin\")) {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.VISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n } else if(searchText.equals(\"BMI\")) {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.VISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n } else if(searchText.equals(\"Diabetes Pedigree Function\")) {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.VISIBLE);\n } else {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n }\n }",
"@Override\r\n\t public void onTextChanged( CharSequence arg0, int arg1, int arg2, int arg3){\n\t \tlist.setVisibility(View.VISIBLE);\r\n\t \tif(arg3 == 0){\r\n\t \t\tlist.setVisibility(View.GONE);\r\n\t \t}\r\n\t \t\t\r\n\t }",
"private void bindViews() {\n txt_home = (TextView) findViewById(R.id.txt_home);\n txt_progress = (TextView) findViewById(R.id.txt_progress);\n txt_community = (TextView) findViewById(R.id.txt_community);\n txt_profile = (TextView) findViewById(R.id.txt_profile);\n\n txt_home.setOnClickListener(this);\n txt_progress.setOnClickListener(this);\n txt_community.setOnClickListener(this);\n txt_profile.setOnClickListener(this);\n }",
"public void ShowCalendar(){\n TextView ChangeCalendar=(TextView)findViewById(R.id.ChangeCalendar);\n if(DropDownCalendar.getLayoutParams().height==0){\n DropDownCalendar.setLayoutParams(TopWeekdays.getLayoutParams());\n }\n else{\n DropDownCalendar.setLayoutParams(ChangeCalendar.getLayoutParams());\n }\n }",
"@Override\n public void onClick(View v) {\n reSetparams();\n popparent.setVisibility(View.GONE);\n timeTxt.setText(\"今年\");\n\n SimpleDateFormat dateFormater = new SimpleDateFormat(\n \"yyyy-MM-dd\");\n Calendar cal = Calendar.getInstance();\n cal.set(Calendar.DAY_OF_YEAR, 1);\n cal.getTime();\n start_time.setText(dateFormater.format(cal.getTime()) + \"\");\n\n cal.set(Calendar.DAY_OF_YEAR,\n cal.getActualMaximum(Calendar.DAY_OF_YEAR));\n end_time.setText(dateFormater.format(cal.getTime()));\n starttime = start_time.getText().toString();\n endtime = end_time.getText().toString();\n setBottomPointView(0);\n onloadJsMethod();\n }",
"public void fillText(View view){\n if(running==true){\n\n\n latestOp=false;\n for(int i = 0; i<9; i++)\n if(i==win&&idOfViews[i]==view.getId()) {\n score++;\n sec=sec+3;\n latestOp=true;\n }\n\n //Defining the score\n total++;\n scoret.setText(\" \"+score+\" /\"+total);\n\n //Setting the message about the latest one.\n resultT.setText(\"Missed\");\n if(latestOp==true)\n resultT.setText(\"Correct!\");\n\n\n //Calling a new screen\n newScreen();\n }\n\n\n }",
"protected void setUpTextView(TextView textView, String text) {\n textView.setText(text);\n textView.setVisibility(text.isEmpty() ? View.GONE : View.VISIBLE);\n }",
"@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n\n txtDisplay = (TextView) findViewById (R.id.txtDisplay);\n btnDivide = (Button) findViewById(R.id.btnDivide);\n btnMultiply = (Button) findViewById(R.id.btnMultiply);\n btnAdd = (Button) findViewById(R.id.btnAdd);\n btnMinus = (Button) findViewById(R.id.btnMinus);\n btnClear = (Button) findViewById(R.id.btnClear);\n btnClearElement = (Button) findViewById(R.id.btnClearElement);\n btnClearUnitElement = (Button) findViewById(R.id.btnClearUnitNumber);\n Dot = (Button) findViewById(R.id.btnDot);\n Zero = (Button) findViewById(R.id.btnNo0);\n One = (Button) findViewById(R.id.btnNo1);\n Two = (Button) findViewById(R.id.btnNo2);\n Three = (Button) findViewById(R.id.btnNo3);\n Four = (Button) findViewById(R.id.btnNo4);\n Five = (Button) findViewById(R.id.btnNo5);\n Six = (Button) findViewById(R.id.btnNo6);\n Seven = (Button) findViewById(R.id.btnNo7);\n Eight = (Button) findViewById(R.id.btnNo8);\n Nine = (Button) findViewById(R.id.btnNo9);\n opposite = (Button) findViewById(R.id.btnOpposite);\n equal = (Button) findViewById(R.id.btnEqual);\n\n Typeface typeface = Typeface.createFromAsset(getAssets(), \"fonts/DS-DIGI.TTF\");\n txtDisplay.setTypeface(typeface);\n One.setOnClickListener(this);\n Two.setOnClickListener(this);\n Three.setOnClickListener(this);\n Four.setOnClickListener(this);\n Five.setOnClickListener(this);\n Six.setOnClickListener(this);\n Seven.setOnClickListener(this);\n Eight.setOnClickListener(this);\n Nine.setOnClickListener(this);\n Zero.setOnClickListener(this);\n Dot.setOnClickListener(this);\n btnClear.setOnClickListener(this);\n opposite.setOnClickListener(this);\n btnClearUnitElement.setOnClickListener(this);\n btnClearElement.setOnClickListener(this);\n btnAdd.setOnClickListener(this);\n btnMinus.setOnClickListener(this);\n btnMultiply.setOnClickListener(this);\n btnDivide.setOnClickListener(this);\n equal.setOnClickListener(this);\n\n operator = 0;\n next = 1;\n }",
"private void initViews() {\n\t\t\tfirstTimeEditor=(EditText) findViewById(R.id.get_one_square_first_time_editor);\r\n\t\t\tlastTimeEditor=(EditText) findViewById(R.id.get_one_square_last_time_editor);\r\n\t\t\t\r\n\t\t\tfirstLatitudeEditor=(EditText) findViewById(R.id.get_one_square_first_latitude_editor);\r\n\t\t\tsecondLatitudeEditor=(EditText) findViewById(R.id.get_one_square_second_latitude_editor);\r\n\t\t\t\r\n\t\t\tfirstLongitudeEditor=(EditText) findViewById(R.id.get_one_square_first_longitude_editor);\r\n\t\t\tsecondLongitudeEditor=(EditText) findViewById(R.id.get_one_square_second_longitude_editor);\r\n\t\t\t\r\n\t\t\tsureBtn=(Button) findViewById(R.id.get_one_square_sureBtn);\r\n\t\t\tsureBtn.setOnClickListener(new OnClickListener() {\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void onClick(View v) {\r\n\t\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\t\r\n\t\t\t\t\tgetInputContent();\r\n\t\t\t\t\tif(checkInputContent())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tIntent intent=getIntent();\r\n\t\t\t\t\t\tBundle bundle=new Bundle();\r\n\t\t\t\t\t\tbundle.putString(\"firstTime\", firstTime);\r\n\t\t\t\t\t\tbundle.putString(\"lastTime\", lastTime);\r\n\t\t\t\t\t\tbundle.putString(\"firstLatitude\", firstLatitude);\r\n\t\t\t\t\t\tbundle.putString(\"secondLatitude\", secondLatitude);\r\n\t\t\t\t\t\tbundle.putString(\"firstLongitude\", firstLongitude);\r\n\t\t\t\t\t\tbundle.putString(\"secondLongitude\", secondLongitude);\r\n\t\t\t\t\t\tbundle.putString(Arguments.FINISH,Arguments.FINISH);\r\n\t\t\t\t\t\tintent.putExtras(bundle);\r\n\t\t\t\t\t\tsetResult(Arguments.GET_TIME_AND_RANGE_FROM_ONE_SPACE, intent);\r\n\t\t\t\t\t\tGetTimeRangeFromOneSpaceAty.this.finish();\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse Toast.makeText(GetTimeRangeFromOneSpaceAty.this, \"ÊäÈëÓдí............\", Toast.LENGTH_LONG).show();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}",
"private void display(int number){\n TextView quantTV = (TextView) findViewById(R.id.quant_tv);\n quantTV.setText(\"\"+ number);\n }",
"public void fieldClicked(TextView tv, EditText et, Button btn)\n {\n tv.setVisibility(View.INVISIBLE);\n String[] a = tv.getText().toString().split(\": \");\n if(a[1] != null)\n et.setText(a[1]);\n et.setVisibility(View.VISIBLE);\n btn.setVisibility(View.VISIBLE);\n }",
"@Override\n public void onClick(View v) {\n \t\t croa.setVisibility(View.INVISIBLE);\n \t dancea.setVisibility(View.INVISIBLE);\n \t\t kfja.setVisibility(View.INVISIBLE);\n \t\t starters.setVisibility(View.VISIBLE);\n \t\t smia.setVisibility(View.INVISIBLE);\n \t\t diz1.setVisibility(View.INVISIBLE); \n \t\t diz2.setVisibility(View.INVISIBLE);\n \t\t plaa.setVisibility(View.INVISIBLE);\n \t\t starteres.setVisibility(View.VISIBLE);\n \t\t diz3.setVisibility(View.INVISIBLE); \n \t\t diz4.setVisibility(View.INVISIBLE);\n \t\t tjza.setVisibility(View.INVISIBLE);\n \t\t b = 0 ;\n \t\t player.stop();\n \t }",
"private void displayTextView() {\n wellnessEntryErrorTextView.setText(\"This is an error message e.g no data\");\n wellnessEntryErrorTextView.setVisibility(View.VISIBLE);\n recyclerView.setVisibility(View.GONE);\n }",
"public void enableFields (Boolean enable) {\n if (enable) {\n if (textViewV.getVisibility() == View.INVISIBLE) {\n textViewV.setVisibility(View.VISIBLE);\n editTextV.setVisibility(View.VISIBLE);\n editTextV.getText().clear();\n textViewDateTime.setVisibility(View.INVISIBLE);\n editTextV.requestFocus();\n }\n if (editTextV.getText().length() == 4 ) {\n int user = Integer.valueOf(editTextV.getText().toString());\n if (textViewS.getVisibility() == View.INVISIBLE && user != 9999) {\n textViewS.setVisibility(View.VISIBLE);\n editTextS.setVisibility(View.VISIBLE);\n editTextS.getText().clear();\n editTextS.setShowSoftInputOnFocus(false);\n editTextS.setClickable(false);\n editTextS.setSelection(editTextS.getText().length());\n editTextS.setCursorVisible(false);\n }\n }\n } else {\n\n\n if (textViewS.getVisibility() == View.VISIBLE) {\n editTextS.getText().clear();\n textViewS.setVisibility(View.INVISIBLE);\n editTextS.setVisibility(View.INVISIBLE);\n return;\n }\n\n if (textViewV.getVisibility() == View.VISIBLE) {\n textViewDateTime.setVisibility(View.VISIBLE);\n editTextV.getText().clear();\n textViewV.setVisibility(View.INVISIBLE);\n editTextV.setVisibility(View.INVISIBLE);\n }\n }\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 }",
"@Override\n public void onCreate(final Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);\n //Teurastetaan otsikkopalkki pois:\n requestWindowFeature(Window.FEATURE_NO_TITLE);\n //Teurastetaan status-palkki pois (full screen):\n getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);\n final View v = getLayoutInflater().inflate(R.layout.credits, null);\n v.setKeepScreenOn(true);\n setContentView(v); \n res=this.getResources();\n managing = (TextView) findViewById(R.id.managing);\n contentdevelopment = (TextView) findViewById(R.id.contentdevelopment);\n programming = (TextView) findViewById(R.id.programming);\n\n \n managing.setText(Html.fromHtml(\"<b>\" + res.getString(R.string.cr_managing)+\"</b><br/>Myriam Munezero<br/>Balozi Kirongo<br/>Sari Pitkänen\"));\n\n contentdevelopment.setText(Html.fromHtml(\"<b>\" + res.getString(R.string.cr_contentdevelopment)+\"</b>\" +\n \t\t\"<br/>Mwasambo Benjamin<br/>Haraka Joseph<br/>Virginia Nyawira<br/>Swapprinah Imbosa\"));\n contentdevelopment.setTextColor(Color.BLACK);\n\n programming.setText(Html.fromHtml(\"<b>\"+res.getString(R.string.cr_programming)+\"</b><br/>Moses Shitote<br/>Duncan Kiplangat<br/>Peter Waweru\"));\n\n }",
"public void res(View view) {\n n.setText(\"0\");\n num=0;\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tTextView tv1 = (TextView) findViewById(R.id.textView1);\n\t\t\t\tTextView tv2 = (TextView) findViewById(R.id.textView2);\n\t\t\t\tTextView tv3 = (TextView) findViewById(R.id.textView3);\n\t\t\t\t\n\t\t\t\tint a = Integer.parseInt(tv1.getText().toString());\n\t\t\t\tint b = Integer.parseInt(tv2.getText().toString());\n\t\t\t\tHelloCal cal = new HelloCal();\n\t\t\t\tint c = cal.helloAdd(a,b);\n\t\t\t\tString str = cal.helloSay(); \n\t\t\t\ttv3.setText(str + Integer.toString(c));\n\t\t\t}",
"@Override\n\tprotected void initView() {\n\t\tsuper.initView();\n\t\t// 不显示暂停原因\n\t\t/*\n\t\t * rsnET.setFocusable(true); rsnTV.setText(\"取消原因:\");\n\t\t */\n\t\trsnET.setVisibility(View.GONE);\n\t\trsnTV.setVisibility(View.GONE);\n\t}",
"@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tif(phoneet.getText().toString().length()==11){\r\n\t\t\t\t\tphonell.setVisibility(View.GONE);\r\n\t\t\t\t\tyanzhengmall.setVisibility(View.VISIBLE);\r\n\t\t\t\t\tphonetv.setTextColor(getResources().getColor(R.color.bg_Black));\r\n\t\t\t\t\tyanzhengmatv.setTextColor(getResources().getColor(R.color.top_background));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tToastUtil.showToast(RegisterActivity.this, \"手机号格式不正确\");\r\n\t\t\t\t}\r\n\t\t\t}",
"private void initializeViews() {\n titleTV = (TextView) findViewById(R.id.displayTitle);\n typeTV = (TextView) findViewById(R.id.displayType);\n categoryTV = (TextView) findViewById(R.id.displayCategory);\n amountTV = (TextView) findViewById(R.id.displayAmount);\n partyTV = (TextView) findViewById(R.id.displayParty);\n modeTV = (TextView) findViewById(R.id.displayMode);\n dateTV = (TextView) findViewById(R.id.displayDate);\n descriptionTV = (TextView) findViewById(R.id.displayDescription);\n currencyTV = (TextView)findViewById(R.id.displayCurrency);\n\n //find all buttons\n editButton = (FloatingActionButton) findViewById(R.id.editButton);\n deleteButton = (FloatingActionButton) findViewById(R.id.deleteButton);\n\n\n }",
"public void displayExam(WordExam exam) {\n\n wordToExamTxt.setText(exam.getWordToExam().getWord());\n\n MediaPlayer wordMediaPlayer = wordsAudioManager.getWordMediaPlayer(exam.getWordToExam());\n if (wordMediaPlayer != null) {\n wordMediaPlayer.start();\n }\n\n option1Btn.setVisibility(View.INVISIBLE);\n option2Btn.setVisibility(View.INVISIBLE);\n option3Btn.setVisibility(View.INVISIBLE);\n option4Btn.setVisibility(View.INVISIBLE);\n\n // Wait 2 seconds\n option1Btn.postDelayed(new Runnable() {\n @Override\n public void run() {\n option1Btn.setVisibility(View.VISIBLE);\n }\n }, TIME_ANSWERS_ARE_HIDDEN);\n\n option2Btn.postDelayed(new Runnable() {\n @Override\n public void run() {\n option2Btn.setVisibility(View.VISIBLE);\n }\n }, TIME_ANSWERS_ARE_HIDDEN);\n\n option3Btn.postDelayed(new Runnable() {\n @Override\n public void run() {\n option3Btn.setVisibility(View.VISIBLE);\n }\n }, TIME_ANSWERS_ARE_HIDDEN);\n\n option4Btn.postDelayed(new Runnable() {\n @Override\n public void run() {\n option4Btn.setVisibility(View.VISIBLE);\n }\n }, TIME_ANSWERS_ARE_HIDDEN);\n\n option1Btn.setText(exam.getOptions().get(0));\n option2Btn.setText(exam.getOptions().get(1));\n option3Btn.setText(exam.getOptions().get(2));\n option4Btn.setText(exam.getOptions().get(3));\n }",
"@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.azkar);\n\n\t\t// stop screen from locking off automatically\n\t\tgetWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);\n\n\n\t\t// lstVw.setAdapter(new ArrayAdapter<String>(this, R.layout.list_view_item, new String[] {\"hello\"} ));\n\t\tlst = (LinearLayout) findViewById(R.id.lst);\n\t\talkorsyVwItem = (TextView) findViewById(R.id.alkorsyVwItem);\n\t\tlastPageVwItem = (TextView) findViewById(R.id.lastPageVwItem);\n\t\tazkarTxtView = (TextView) findViewById(R.id.azkarView);\n\t\tazkarScrollView = (ScrollView)findViewById(R.id.azkarScrollView);\n\t\t//azkarTxtView.setMovementMethod(new ScrollingMovementMethod());\n\t\tazkarTxtView.setOnLongClickListener(this);\n\t\tazkarTxtView.setOnClickListener(this);\n\n\t\t// delete the sound effect when click on azkar text view\n\t\tazkarTxtView.setSoundEffectsEnabled(false);\n\n\t\talkorsyVwItem.setOnClickListener(this);\n\t\tlastPageVwItem.setOnClickListener(this);\n\t\tprefs = getSharedPreferences(\"setting\", Context.MODE_PRIVATE);\n\t\tsetRequestedOrientation(prefs.getBoolean(\"isPortrait\", true)\n\t\t\t\t? ActivityInfo.SCREEN_ORIENTATION_PORTRAIT : ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);\n\n\t\tif (getIntent().getExtras().getBoolean(\"isMorning\")) {\n\t\t\tazkarTxtView.setText(R.string.morning_azkar);\n\t\t\tazkarTxtView.setTextColor(0xFF000000); // alpha R G B\n\t\t\tisMorning = true;\n\t\t\tbgID = R.drawable.morning;\n\t\t} else {\n\t\t\tazkarTxtView.setText(R.string.evening_azkar);\n\t\t\tazkarTxtView.setTextColor(0xFFFFFFFF); // alpha R G B\n\t\t\tisMorning = false;\n\t\t\tbgID = R.drawable.evening_2;\n\t\t}\n\n\t\tazkarTxtView.setBackgroundResource(bgID);\n\t\tintent = new Intent(getApplicationContext(), Reiterating.class);\n\t\tintent.putExtra(\"bgID\", bgID).putExtra(\"isMorning\", isMorning);\n\n\t\tadjustView(prefs.getInt(\"fontSize\", 27));\n\n\t\t// we use this variable to check today with the last day the user access this application\n\t\tString today = new SimpleDateFormat(\"dd\").format(new Date());\n\t\t// my new code (logic)\n\t\t// check if we start in new day we doesn't scroll to the saved position \n\t\t// (start scrolling from the beginning)\n\t\tif (prefs.getString(\"day\", today).equals(today)) {\n\t\t\t// NOTE: if you don't use post method the scroll view doesn't scroll to the desired position\n\t\t\t// this method is called after the android rendering the UI so you can then scroll\n\t\t\tazkarScrollView.post(\n\t\t\t\t\tnew 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\tint offset;\n\t\t\t\t\t\t\tif (isMorning) offset = prefs.getInt(\"yMorning\", 0);\n\t\t\t\t\t\t\telse offset = prefs.getInt(\"yEvening\", 0);\n\t\t\t\t\t\t\tazkarScrollView.scrollBy(0, offset);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t} else { // in a new day ... we reset scrolling positions' values to zero\n\t\t\tSharedPreferences.Editor ed = prefs.edit();\n\t\t\ted.putInt(\"yMorning\", 0);\n\t\t\ted.putInt(\"yEvening\", 0);\n\t\t\ted.commit();\n\t\t}\n\n\t\t// run the following code (logic) only at the first time we run this application version 2.4\n\t\t//\t\tif (prefs.getBoolean(\"isFirst2_4\", true)) \n\t\t//\t\t\tif (prefs.getBoolean(\"isMorning\", isMorning) == isMorning &&\n\t\t//\t\t\tprefs.getString(\"day\", today).equals(today))\n\t\t//\t\t\t\tazkarTxtView.scrollBy(0, prefs.getInt(\"y\", 0));\n\n\t}",
"private void mostrarDatosPeliculas() {\n this.mBinding.tvMostrarError.setVisibility(View.GONE);\n /* Then, make sure the weather data is visible */\n this.mBinding.rvPeliculas.setVisibility(View.VISIBLE);\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.main);\n\n Button button = (Button) findViewById((R.id.Bbli));\n Button buttPlus = (Button) findViewById(R.id.Bplus);\n Button buttRaz = (Button) findViewById(R.id.Braz);\n final EditText nbOne = (EditText)findViewById(R.id.nbOne);\n final EditText nbTwo = (EditText) findViewById(R.id.nbTwo);\n final EditText resul = (EditText) findViewById(R.id.resultat);\n button.setOnClickListener(new OnClickListener() {\n @Override\n public void onClick(View view) {\n //To change body of implemented methods use File | Settings | File Templates.\n Toast msg = Toast.makeText(NicogetActivity.this, \"Je confirme !\", Toast.LENGTH_LONG);\n msg.setGravity(Gravity.CENTER, msg.getXOffset()/2, msg.getYOffset()/2);\n msg.show();\n }\n });\n\n buttPlus.setOnClickListener(new OnClickListener() {\n @Override\n public void onClick(View view) {\n try {\n int nbOneInt = Integer.parseInt(nbOne.getText().toString());\n int nbTwoInt = Integer.parseInt(nbTwo.getText().toString());\n int resulInt = Integer.parseInt(resul.getText().toString());\n resulInt = resulInt + (nbOneInt+nbTwoInt);\n resul.setText(String.valueOf(resulInt));\n } catch (Exception err) {\n Toast msg = Toast.makeText(NicogetActivity.this, err.getMessage(), Toast.LENGTH_LONG);\n msg.setGravity(Gravity.CENTER, msg.getXOffset()/2, msg.getYOffset()/2);\n msg.show();\n }\n }\n });\n\n buttRaz.setOnClickListener(new OnClickListener() {\n @Override\n public void onClick(View view) {\n resul.setText(\"0\");\n }\n });\n }",
"private void limpiar2() {\n txtValorRel.setText(null);\n txtImptoRel.setText(null);\n txtNotariaRel.setText(null);\n txtReperRel.setText(null);\n jcFechaConstitucion.setCalendar(null);\n txtRutRelac.setText(null);\n// txtFolioRelac.setText(null);\n txtApellMatRelac.setText(null);\n txtApellPatRel.setText(null);\n txtNombreRelac.setText(null);\n txtDescripcionRelac.setText(null);\n txtOtroComentarioRelac.setText(null);\n btnGuardarRelac.setVisible(false);\n }",
"public void initView(){\n editText = (EditText) v.findViewById(R.id.main_edittext);\n userAppTv = (TextView)v.findViewById(R.id.main_userapp_tv);\n curColor = userAppTv.getCurrentTextColor();\n if (MainActivity.isNightMode){\n editText.setTextColor(curColor);\n editText.setHintTextColor(Color.GRAY);\n }\n// userAppTv.setTextColor(Color.parseColor(\"#40d0b7\"));\n clearIv = (ImageView) v.findViewById(R.id.top_clear_iv);\n sysAppTv = (TextView)v.findViewById(R.id.main_sysapp_tv);\n alertFl = (FrameLayout)v.findViewById(R.id.main_alert_fl);\n alertFl.setVisibility(View.GONE);\n alertTv = (TextView)v.findViewById(R.id.main_alert_tv);\n closeOpenTv = (TextView)v.findViewById(R.id.main_alert_closetv);\n closeOpenTv.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n alertFl.setVisibility(alertFl.isShown()?View.GONE:View.VISIBLE);\n BaseActivity.zhenDong(act);\n// XposedStopApp.stopApk(\"com.tencent.mm\",(ActivityManager) act.getSystemService(Context.ACTIVITY_SERVICE));\n }\n });\n clearIv.setVisibility(View.INVISIBLE);\n clearIv.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n clearIv.setVisibility(View.INVISIBLE);\n editText.setText(\"\");\n }\n });\n\n userAppTv.setTextColor(appType==1?curColor:Color.parseColor(MainActivity.THEME_TEXT_COLOR));\n sysAppTv.setTextColor(appType==0?curColor:Color.parseColor(MainActivity.THEME_TEXT_COLOR));\n\n sysAppTv.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n if(appType == 0){\n// if (act instanceof MainActivity&&(((MainActivity) act).chooseFragment instanceof ControlFragment ||((MainActivity) act).chooseFragment instanceof IFWFragment ||((MainActivity) act).chooseFragment instanceof IceUnstallFragment)) {\n// AlertUtil.showConfirmAlertMsg(act, \"处理系统应用时最好你十分确定处理了不会影响系统功能,否则请不要乱禁用,部分系统应用禁用后会导致无法开机及各种问题\", new AlertUtil.InputCallBack() {\n// @Override\n// public void backData(String txt, int tag) {\n// if (tag == 1) {\n// appType = 2;\n// sysAppTv.setTextColor(Color.parseColor(MainActivity.THEME_TEXT_COLOR));\n// if(cb!=null){\n// searchText = editText.getText().toString().trim().length()>0?editText.getText().toString().trim():(appType==0?\"u\":(appType==1?\"s\":\"\"));\n// cb.backAppType(searchText);\n// }\n// }\n// }\n// });\n// }else{\n appType = 2;\n sysAppTv.setTextColor(Color.parseColor(MainActivity.THEME_TEXT_COLOR));\n// }\n }else if(appType == 2){\n appType = 0;\n sysAppTv.setTextColor(curColor);\n }\n if(cb!=null){\n searchText = editText.getText().toString().trim().length()>0?editText.getText().toString().trim():(appType==0?\"u\":(appType==1?\"s\":\"\"));\n cb.backAppType(searchText);\n }\n BaseActivity.zhenDong(act);\n }\n });\n userAppTv.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n if(appType == 1){\n appType = 2;\n userAppTv.setTextColor(Color.parseColor(MainActivity.THEME_TEXT_COLOR));\n }else if(appType == 2){\n appType = 1;\n userAppTv.setTextColor(curColor);\n }\n if(cb!=null){\n searchText = editText.getText().toString().trim().length()>0?editText.getText().toString().trim():(appType==0?\"u\":(appType==1?\"s\":\"\"));\n cb.backAppType(searchText);\n }\n BaseActivity.zhenDong(act);\n }\n });\n editText.addTextChangedListener(new TextWatcher() {\n @Override\n public void beforeTextChanged(CharSequence s, int start, int count, int after) {\n\n }\n @Override\n public void onTextChanged(CharSequence s, int start, int before, int count) {\n String appName = editText.getText().toString();\n if(cb!=null){\n searchText = editText.getText().toString().trim().length()>0?editText.getText().toString().trim():(appType==0?\"u\":(appType==1?\"s\":\"\"));\n cb.backAppType(searchText);\n }\n\n }\n @Override\n public void afterTextChanged(Editable s) {\n clearIv.setVisibility(editText.getText().toString().length()>0?View.VISIBLE:View.INVISIBLE);\n }\n });\n editText.setOnFocusChangeListener(new View.OnFocusChangeListener() {\n @Override\n public void onFocusChange(View view, boolean b) {\n editText.setSelection(editText.getText().length());\n }\n });\n// return v;\n }",
"private void actualizarVisor()\n {\n visor.setText(\"\" + calc.getValorEnVisor());\n }",
"public void mo84055a() {\n if (getVisibility() == 0) {\n animate().cancel();\n setLayerType(2, null);\n animate().alpha(0.0f).setListener(new Animator.AnimatorListener() {\n /* class com.zhihu.android.article.widget.ArticleFloatingTipsView.C172711 */\n\n public void onAnimationCancel(Animator animator) {\n }\n\n public void onAnimationRepeat(Animator animator) {\n }\n\n public void onAnimationStart(Animator animator) {\n }\n\n public void onAnimationEnd(Animator animator) {\n ArticleFloatingTipsView.this.setVisibility(4);\n ArticleFloatingTipsView.this.setLayerType(0, null);\n }\n }).start();\n }\n }",
"private void initializeVariables() {\n\t\ttvTimeShow= (TextView) findViewById(R.id.tvTimeTracker);\r\n\t}",
"public void b0 (View v) {\n Addtxt(\"0\");\n }",
"public void onRadioButtonClick(View v){\n if (internalBtn.isChecked()){\n field1.setVisibility(View.VISIBLE);\n field2.setVisibility(View.VISIBLE);\n field3.setVisibility(View.GONE);\n }\n else if (externalBtn.isChecked()){\n field1.setVisibility(View.GONE);\n field2.setVisibility(View.VISIBLE);\n field3.setVisibility(View.VISIBLE);\n }\n else if (depositBtn.isChecked()){\n field1.setVisibility(View.VISIBLE);\n field2.setVisibility(View.GONE);\n field3.setVisibility(View.GONE);\n }\n }",
"private void initializeViews(){\n\n\n if(callType){\n accept_call_btn.setVisibility(ImageButton.VISIBLE);\n deny_call_btn.setVisibility(ImageButton.VISIBLE);\n\n }\n else{\n accept_call_btn.setVisibility(ImageButton.GONE);\n deny_call_btn.setVisibility(ImageButton.VISIBLE);\n caller_name.setText(sipNameOutcome);\n }\n\n }",
"public void mo10458a(View view) {\n TextView textView = (TextView) view.findViewById(C3261c.fscv_title);\n if (VERSION.SDK_INT >= 23) {\n textView.setTextAppearance(C3243f.this.f8722k);\n } else {\n textView.setTextAppearance(C3243f.this.f8713b, C3243f.this.f8722k);\n }\n if (C3243f.this.f8723l != -1) {\n textView.setTextSize(C3243f.this.f8724m, (float) C3243f.this.f8723l);\n }\n textView.setGravity(C3243f.this.f8721j);\n if (C3243f.this.f8734w) {\n ((RelativeLayout.LayoutParams) textView.getLayoutParams()).setMargins(0, C3264k.m14942a(C3243f.this.getContext()), 0, 0);\n }\n if (C3243f.this.f8715d != null) {\n textView.setText(C3243f.this.f8715d);\n } else {\n textView.setText(C3243f.this.f8714c);\n }\n }",
"@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)\n public void cambiarEstadoSinAbastecimiento(int indiceLayoutHose){\n txt_Estado_abastecimiento = (TextView) layoutsHose.get(indiceLayoutHose).inflater.findViewById(R.id.txt_Estado_abastecimiento);\n iv_estado_abastecimiento = layoutsHose.get(indiceLayoutHose).inflater.findViewById(R.id.iv_estado_abastecimiento);\n txt_galones = (TextView) layoutsHose.get(indiceLayoutHose).inflater.findViewById(R.id.txt_galones);\n txt_ultimo_ticket = (TextView) layoutsHose.get(indiceLayoutHose).inflater.findViewById(R.id.txt_ultimo_ticket);\n txt_placa = layoutsHose.get(indiceLayoutHose).inflater.findViewById(R.id.txt_placa);\n txt_producto = layoutsHose.get(indiceLayoutHose).inflater.findViewById(R.id.txt_producto);\n ly_cuadrante = layoutsHose.get(indiceLayoutHose).inflater.findViewById(R.id.ly_cuadrante);\n ly_cuadrante_estado_pausa = layoutsHose.get(indiceLayoutHose).inflater.findViewById(R.id.ly_cuadrante_estado_pausa);\n ly_cuadrante_estado_pausa2 = layoutsHose.get(indiceLayoutHose).inflater.findViewById(R.id.ly_cuadrante_estado_pausa2);\n ly_cuadrante_estado_abasteciendo = layoutsHose.get(indiceLayoutHose).inflater.findViewById(R.id.ly_cuadrante_estado_abasteciendo);\n ly_cuadrante_estado_abasteciendo2 = layoutsHose.get(indiceLayoutHose).inflater.findViewById(R.id.ly_cuadrante_estado_abasteciendo2);\n\n txt_Estado_abastecimiento.setText(\"Disponible\");\n iv_estado_abastecimiento.setImageResource(R.drawable.ic_station_yellow_64);\n txt_Estado_abastecimiento.setTextColor(getResources().getColor(R.color.md_yellow_assac));\n txt_galones.setTextColor(getResources().getColor(R.color.md_yellow_assac));\n txt_ultimo_ticket.setTextColor(getResources().getColor(R.color.md_yellow_assac));\n txt_placa.setTextColor(getResources().getColor(R.color.md_yellow_assac));\n txt_producto.setTextColor(getResources().getColor(R.color.md_yellow_assac));\n ly_cuadrante.setBackground(getResources().getDrawable(R.drawable.bg_para_cuadrante_manguera_estado_pausa));\n\n //txt_galones.setText(hoseEntities.get(indiceLayoutHose).getVolumen());\n\n ly_cuadrante_estado_pausa.setVisibility(View.VISIBLE);\n ly_cuadrante_estado_pausa2.setVisibility(View.VISIBLE);\n\n //txt_ultimo_ticket_m1_p2.setText(\"\"+contadorTicketBomba1);\n ly_cuadrante_estado_abasteciendo.setVisibility(View.GONE);\n ly_cuadrante_estado_abasteciendo2.setVisibility(View.GONE);\n\n\n\n }",
"public void restaNumeros(View view){\n\n String valor1=etNum1.getText().toString();\n String valor2=etNum2.getText().toString();\n\n int nro1=Integer.parseInt(valor1);\n int nro2=Integer.parseInt(valor2);\n\n int resta=nro1-nro2;\n\n String resulResta=String.valueOf(resta);\n tvSalida.setText(resulResta);\n\n }",
"private void castLayoutElements() {\n edtTaxName = (AppCompatEditText) findViewById(R.id.edtTaxName);\n edtTaxPercentage = (AppCompatEditText) findViewById(R.id.edtTaxPercentage);\n edtTaxRegistration = (AppCompatEditText) findViewById(R.id.edtTaxRegistration);\n rdgrpPercentOfAmount = (RadioGroup) findViewById(R.id.rdgrpPercentOfAmount);\n rdbtnYes = (RadioButton) findViewById(R.id.rdbtnYes);\n rdbtnNo = (RadioButton) findViewById(R.id.rdbtnNo);\n linlaPercentageOfAmount = (LinearLayout) findViewById(R.id.linlaPercentageOfAmount);\n edtTaxPercentageOfAmount = (AppCompatEditText) findViewById(R.id.edtTaxPercentageOfAmount);\n imgvwWhatIsThis = (ImageView) findViewById(R.id.imgvwWhatIsThis);\n\n /** CHECK PERCENTAGE OF AMOUNT RADIOBUTTON CLICK **/\n rdgrpPercentOfAmount.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {\n\n @Override\n public void onCheckedChanged(RadioGroup group, int checkedId) {\n int position = rdgrpPercentOfAmount.indexOfChild(findViewById(checkedId));\n switch (position) {\n case 0:\n /** SET ENTIRE AMOUNT TAXABLE **/\n TAX_COMPLETE_AMOUNT = true;\n\n /** HIDE THE PERCENTAGE OF AMOUNT AppCompatEditText **/\n linlaPercentageOfAmount.setVisibility(View.GONE);\n break;\n case 1:\n /** SET PART OF AMOUNT TAXABLE **/\n TAX_COMPLETE_AMOUNT = false;\n\n /** SHOW THE PERCENTAGE OF AMOUNT AppCompatEditText **/\n linlaPercentageOfAmount.setVisibility(View.VISIBLE);\n break;\n default:\n break;\n }\n }\n });\n\n /** SHOW THE NOTICE (WHAT IS THIS) **/\n imgvwWhatIsThis.setOnClickListener(new View.OnClickListener() {\n\n @Override\n public void onClick(View v) {\n\n MaterialDialog dialog = new MaterialDialog.Builder(TaxModifier.this)\n .title(R.string.tax_creator_popup_title)\n .content(R.string.tax_creator_what_is_this)\n .positiveText(R.string.tax_creator_popup_title_dismiss)\n .theme(Theme.LIGHT)\n .icon(ContextCompat.getDrawable(TaxModifier.this, R.drawable.ic_info_outline_white_24dp))\n .typeface(\"HelveticaNeueLTW1G-MdCn.otf\", \"HelveticaNeueLTW1G-Cn.otf\")\n .show();\n }\n });\n }",
"private void updateTextViews(String timeStamp,\n boolean isGi, int amount, String stress, String tired, boolean isPhysicallyActive,\n boolean hasAlcoholConsumed,\n boolean isIll, boolean takesMedication, boolean hasPeriod,\n int mv0, int mv15, int mv30, int mv45, int mv60,\n int mv75, int mv90, int mv105, int mv120) {\n\n /* Update text views */\n\n // Time information\n mBinding.date.setText(\n Converter.convertTimeStampToDate(timeStamp));\n\n mBinding.time\n .setText(Converter.convertTimeStampToTimeStart(timeStamp));\n\n // Advance information\n\n mBinding.amount.setText(Converter.convertInteger(amount));\n\n // If GI measurement disable amount text field\n if (isGi) {\n mBinding.amount.setEnabled(false);\n }\n\n mBinding.stress.setText(stress);\n mBinding.tired.setText(tired);\n mBinding.physicallyActive.setChecked(isPhysicallyActive);\n mBinding.alcoholConsumed.setChecked(hasAlcoholConsumed);\n\n // Events\n mBinding.ill.setChecked(isIll);\n mBinding.medication.setChecked(takesMedication);\n mBinding.period.setChecked(hasPeriod);\n\n // Glucose Values\n mBinding.mv0.setText(Converter.convertIntegerMeasurement(mv0));\n mBinding.mv15.setText(Converter.convertIntegerMeasurement(mv15));\n mBinding.mv30.setText(Converter.convertIntegerMeasurement(mv30));\n mBinding.mv45.setText(Converter.convertIntegerMeasurement(mv45));\n mBinding.mv60.setText(Converter.convertIntegerMeasurement(mv60));\n mBinding.mv75.setText(Converter.convertIntegerMeasurement(mv75));\n mBinding.mv90.setText(Converter.convertIntegerMeasurement(mv90));\n mBinding.mv105.setText(Converter.convertIntegerMeasurement(mv105));\n mBinding.mv120.setText(Converter.convertIntegerMeasurement(mv120));\n }",
"@Override\n public void onClick(View v) {\n\n\n if(textViewInput.getText().length() > 0 )\n {\n CharSequence name = textViewInput.getText().toString();\n textViewInput.setText(name.subSequence(0, name.length()-1 ));\n\n\n\n // val1 = Double.NaN; //I added this part, take off when u want original\n // val2 = Double.NaN; //I added this part, take off when u want original\n // textViewInput.setText(null); //I added this part, take off when u want original\n // textViewAnswer.setText(null); //I added this part, take off when u want original\n\n\n\n }\n else\n {\n\n\n val1 = Double.NaN;\n val2 = Double.NaN;\n textViewInput.setText(null);\n textViewAnswer.setText(null);\n }\n\n\n\n\n }",
"@BindingAdapter(\"app:hideIfZero\")\n public static void hideIfZero(View view, int number) {\n if(number==0){\n view.setVisibility(View.GONE);\n }else {\n view.setVisibility(View.VISIBLE);\n }\n }",
"private void setupEditTexts() {\n EditText paino = findViewById(R.id.etWeight);\n EditText alaPaine = findViewById(R.id.etLowerBP);\n EditText ylaPaine = findViewById(R.id.etUpperBP);\n\n //Set the input filters\n paino.setFilters(new InputFilter[] { new InputFilterMinMax(0f, 999f)});\n alaPaine.setFilters(new InputFilter[] { new InputFilterMinMax(1, 999)});\n ylaPaine.setFilters(new InputFilter[] { new InputFilterMinMax(1, 999)});\n\n //Set listeners for the edit texts on when the user clicks something else on the screen while typing\n //When clicked outside, the keyboard closes\n paino.setOnFocusChangeListener(new View.OnFocusChangeListener() {\n @Override\n public void onFocusChange(View v, boolean hasFocus) {\n MainActivity.hideKeyboard(getApplicationContext(), v);\n }\n });\n alaPaine.setOnFocusChangeListener(new View.OnFocusChangeListener() {\n @Override\n public void onFocusChange(View v, boolean hasFocus) {\n MainActivity.hideKeyboard(getApplicationContext(), v);\n }\n });\n ylaPaine.setOnFocusChangeListener(new View.OnFocusChangeListener() {\n @Override\n public void onFocusChange(View v, boolean hasFocus) {\n MainActivity.hideKeyboard(getApplicationContext(), v);\n }\n });\n }",
"private void showMovies(){\n errorTextView.setVisibility(View.INVISIBLE);\n errorButton.setVisibility(View.INVISIBLE);\n errorButton.setEnabled(true);\n recyclerView.setVisibility(View.VISIBLE);\n progressBar.setVisibility(View.INVISIBLE);\n noFavoriteMoviesTextView.setVisibility(View.INVISIBLE);\n }"
] | [
"0.69375306",
"0.69134134",
"0.6890428",
"0.6741745",
"0.6717904",
"0.6671316",
"0.6667214",
"0.654171",
"0.6497381",
"0.6364064",
"0.6357449",
"0.63363457",
"0.6325787",
"0.62836283",
"0.6272988",
"0.6247331",
"0.6242048",
"0.6234099",
"0.61900425",
"0.618119",
"0.6170987",
"0.6166979",
"0.61273",
"0.61129004",
"0.6109477",
"0.61008614",
"0.6100023",
"0.6087491",
"0.6054569",
"0.60474604",
"0.6040516",
"0.59984183",
"0.59666985",
"0.59573525",
"0.594751",
"0.59294987",
"0.5913815",
"0.5904403",
"0.5899729",
"0.58868897",
"0.5870314",
"0.5858618",
"0.5846445",
"0.5834159",
"0.5826971",
"0.58164155",
"0.579957",
"0.5798701",
"0.57797265",
"0.57651794",
"0.57360435",
"0.57261103",
"0.5725438",
"0.5725438",
"0.5714463",
"0.57132053",
"0.5700713",
"0.5685321",
"0.5678681",
"0.56770635",
"0.5675424",
"0.56732297",
"0.56635576",
"0.56635416",
"0.56631964",
"0.5662387",
"0.56597155",
"0.56560886",
"0.56546897",
"0.56342465",
"0.5632805",
"0.5627857",
"0.56238604",
"0.5618205",
"0.56148773",
"0.56119853",
"0.56115603",
"0.561153",
"0.5607505",
"0.5607388",
"0.560577",
"0.56025577",
"0.5601946",
"0.5595073",
"0.55865586",
"0.5585533",
"0.5585468",
"0.55825394",
"0.55773795",
"0.55663294",
"0.55660945",
"0.5565382",
"0.5562291",
"0.5562229",
"0.5560664",
"0.5558448",
"0.555585",
"0.55532795",
"0.55438745",
"0.5543033"
] | 0.6185102 | 19 |
Take appropriate action for each action item click | @Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.salir:
finish();
return true;
default:
return super.onOptionsItemSelected(item);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void issuedClick(String item);",
"@Override\n\t\t\t\t\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\t\t\t\t\tMainActivity sct = (MainActivity) act;\n\t\t\t\t\t\t\t\t\tsct.onItemClick(posit2, 11);\n\t\t\t\t\t\t\t\t}",
"@Override\n public boolean onActionItemClicked(ActionMode mode, MenuItem item) {\n\n\n return true;\n }",
"void clickItem(int uid);",
"@Override\r\n public boolean onActionItemClicked(ActionMode mode, MenuItem item) {\r\n // TODO Auto-generated method stub\r\n return false;\r\n }",
"abstract public boolean cabOnMenuItemClicked(ActionMode mode, MenuItem item);",
"@Override\n public void itemClick(int pos) {\n }",
"@Override\n public void OnItemClick(int position) {\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\titemClickListener.Callback(itemInfo);\n\t\n\t\t\t}",
"@Override\n\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}",
"protected void onClick() {\n for(Runnable action : onClick) action.run();\n }",
"@Override\n public void onClick(View view) { listener.onItemClick(view, getPosition()); }",
"@Override\n public void onClick(View v) {\n itemClickListener.itemClicked(movieId, v);\n }",
"public interface OnActionItemClickListener {\r\n\t\tpublic abstract void onItemClick(QuickAction source, int pos, int actionId);\r\n\t}",
"void onClick(PropertyItem item);",
"void onClick(View item, View widget, int position, int which);",
"private void performActionOnNavDrawerItem(String nameOfTheClickedItem){\n if(nameOfTheClickedItem.equals(getString(R.string.nav_dr_list_item_01_most_popular))){\n\n // dismiss the search mode if one was on\n searchModeIsOn = false;\n // change the sort order of results that are being queried by the Loader\n sortOrderOfResults = AppUtilities.QUERY_PATH_POPULAR;\n // call helper method to perform further actions\n performNewQuery();\n\n } else if (nameOfTheClickedItem.equals(getString(R.string.nav_dr__list_item_02_top_rated))){\n\n // dismiss the search mode if one was on\n searchModeIsOn = false;\n // change the sort order of results that are being queried by the Loader\n sortOrderOfResults = AppUtilities.QUERY_PATH_TOP_RATED;\n // call helper method to perform further actions\n performNewQuery();\n\n } else if (nameOfTheClickedItem.equals(getString(R.string.nav_dr__list_item_03_settings))){\n // Todo(23) check the actions according to other options\n\n Intent openSettingsActivity = new Intent(this, SettingsActivity.class);\n startActivity(openSettingsActivity);\n\n } else if (nameOfTheClickedItem.equals(getString(R.string.nav_dr__list_item_04_about))) {\n\n // open a new activity\n Intent openActivity = new Intent(this, AboutActivity.class);\n startActivity(openActivity);\n }\n // after handling the click, we close the NavigationDrawer\n navDrLayout.closeDrawers();\n }",
"public void act() \n {\n if(Greenfoot.mouseClicked(this)){\n storeMenu.getLastPressed(this,item,cost);\n changeImage();\n } \n }",
"void onChamaItemClicked(int position);",
"@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\t\t\t\tswitch(arg2){\n\t\t\t\tcase 0:\n\t\t\t\t\tintent=new Intent(MainActivity.this,AddEvent.class);\n\t\t\t\t\tstartActivity(intent);\n\t\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tintent=new Intent(MainActivity.this,AddIncome.class);\n\t\t\t\t\tstartActivity(intent);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tintent=new Intent(MainActivity.this,QueryByDateActivity.class);\n\t\t\t\t\tstartActivity(intent);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tintent=new Intent(MainActivity.this,BudgetActivity.class);\n\t\t\t\t\tstartActivity(intent);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\t intent=new Intent(MainActivity.this,AnalysisActivity.class);\n\t\t\t\t\t startActivity(intent);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\tintent=new Intent(MainActivity.this,SettingActivity.class);\n\t\t\t\t\tstartActivity(intent);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}",
"@Override\n public boolean onActionItemClicked(ActionMode mode, MenuItem item) {\n switch (item.getItemId()) {\n case R.id.action_check_all:\n toogleCheckAll();\n return true;\n case R.id.action_backup:\n new FileSaveTask(bAdapter.getSelected()).execute();\n new BackupAppsTask().execute(bAdapter.getSelected());\n return true;\n case R.id.action_uninstall:\n uninstallApp(bAdapter.getSelected());\n return true;\n\n default:\n return false;\n }\n }",
"abstract public void onSingleItemClick(View view);",
"@Override\n public void onItemClick(int pos) {\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n Log.w(TAG , \"POSITION : \" + position);\n\n itemClick(position);\n }",
"@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\n\t\t\t}",
"@Override\n public void onItemClicked(int itemPosition, Object dataObject) {\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 onClick(View view) {\n itemInterface.OnItemClickedListener(tracks, getAdapterPosition());\n }",
"@Override\n public void onClickItem(MeowBottomNavigation.Model item) {\n }",
"@Override\n public void onClickItem(MeowBottomNavigation.Model item) {\n }",
"@Override\r\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void clicked(ItemMenuIcon icon, Player p) {\n\t\t\r\n\t}",
"@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\t\t\t\t\tlong arg3) {\n\t\t\t}",
"@Override\n\t\t\tpublic void 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\t\t\t\t\tpublic boolean onMenuItemClick(MenuItem item) {\n\t\t\t\t\t\tswitch (item.getItemId()) {\n\t\t\t\t\t\tcase R.id.popup_reInfo:\n\t\t\t\t\t\t\tmainAct.ResetInfo(position);\n\t\t\t\t\t\t\tmainAct.UpdateList();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase R.id.popup_upload:\n\t\t\t\t\t\t\tmainAct.addImage(position);\n\t\t\t\t\t\t\tmainAct.UpdateList();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase R.id.popup_del:\n\t\t\t\t\t\t\tmainAct.delete(position);\n\t\t\t\t\t\t\tmainAct.UpdateList();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n String name = navDrawerItems.get(position).getListItemName();\n // call a helper method to perform a corresponding action\n performActionOnNavDrawerItem(name);\n }",
"@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\t\t\t}",
"@Override\n\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\tlong arg3) {\n\t\t\t\n\t\t}",
"@Override\n public void onClick(View v) {\n this.itemClickListener.onItemClick(v, getLayoutPosition());\n }",
"@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t\t\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(AdapterView<?> parent, View view, int position, long id) {\n if (mActionMode != null)\n onListItemSelect(position);\n }",
"@Override\n public boolean onActionItemClicked(ActionMode mode, MenuItem item) {\n\n // Process action item selection\n switch (item.getItemId()) {\n\n // If delete icon is clicked\n case R.id.delete:\n\n // Delete weight from the database\n mWeightDb.deleteWeight(mSelectedWeight.getId());\n\n // Remove item in RecyclerView\n mWeightAdapter.removeWeight(mSelectedWeight);\n\n // Close the CAB\n mode.finish();\n\n // Define Undo snackbar\n Snackbar snackbar = Snackbar.make(getActivity().findViewById(R.id.weightRecyclerView), R.string.weight_deleted, Snackbar.LENGTH_LONG);\n snackbar.setAction(R.string.undo, new View.OnClickListener() {\n /* Define on click listener */\n @Override\n public void onClick(View v) {\n // Add weight back into database\n mWeightDb.addWeight(mSelectedWeight); // Add weight to database\n mWeightAdapter.addWeight(mSelectedWeight); // Add item to list\n }\n });\n\n // Show undo snackbar after deleting an entry\n snackbar.show();\n return true;\n\n // If edit icon is clicked\n case R.id.edit:\n\n // Add selected weight to bundle\n Bundle extras = new Bundle();\n extras.putSerializable(\"SELECTED_WEIGHT\",mSelectedWeight);\n\n // Open add weight screen\n Navigation.findNavController(getView()).navigate(R.id.navigation_add_weight, extras);\n\n // Close action bar\n mode.finish();\n return true;\n\n default:\n\n // Close action bar\n mode.finish();\n return false;\n }\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\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t}",
"void onMenuItemClicked();",
"@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\tHashMap<String, Object> item = (HashMap<String, Object>) arg0\n\t\t\t\t\t\t.getAdapter().getItem(arg2);\n\n\t\t\t\tIntent intent = new Intent(ViewActivity.this,\n\t\t\t\t\t\tContentActivity.class);\n\t\t\t\tBundle bundle = new Bundle();\n\t\t\t\tbundle.putString(\"_id\", item.get(\"_id\").toString());\n\t\t\t\tbundle.putString(\"_CityEventID\", item.get(\"_CityEventID\")\n\t\t\t\t\t\t.toString());\n\t\t\t\tbundle.putString(\"_type\", String.valueOf(_type));\n\t\t\t\tintent.putExtras(bundle);\n\t\t\t\tstartActivity(intent);\n\t\t\t}",
"@Hide\r\n\tpublic interface OnActionItemClickListener {\r\n\t\tpublic abstract void onItemClick(QuickActionBase source, int pos, int actionId);\r\n\t}",
"@Override\r\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\r\n\t\t\t\t\tlong arg3) {\n\r\n\t\t\t}",
"@Override\n public void onClick(View view) {\n clearItemData();\n set_view_for(1);\n getSellMenuId();\n\n\n }",
"@Override\n public void onClick(View view) {\n clickListener.onItemClicked(getBindingAdapterPosition());\n }",
"public void toSelectingAction() {\n }",
"@Override\n public void onClick(View v) {\n if(listener!=null & getLayoutPosition()!=0)\n listener.onItemClick(itemView, getLayoutPosition());\n }",
"@Override\n public void onClick(View v) {\n if (listener != null)\n listener.onItemClick(itemView, getPosition());\n }",
"@Override\n\tpublic void onItemClick(Object o, int position) {\n\n\t}",
"@Override\n public void onItemClick(View view, Campaign campaign) {\n\n }",
"public void clickAction(int clickCount);",
"private void secondClick(Player player, ByteBuf buf) {\n\t\tint container = buf.getShort(true, ByteTransform.A);\n\t\tint slot = buf.getShort(true, ByteOrder.LITTLE);\n\t\tint id = buf.getShort(true, ByteTransform.A);\n\t\tif(Arrav.DEBUG) {\n\t\t\tplayer.message(\"Item action: second click, ID: \" + id);\n\t\t}\n\t\tif(slot < 0 || container < 0 || id < 0 || id > ItemDefinition.DEFINITIONS.length) {\n\t\t\treturn;\n\t\t}\n\t\tItem item = player.getInventory().get(slot);\n\t\tif(item == null || item.getId() != id) {\n\t\t\treturn;\n\t\t}\n\t\tplayer.getCombat().reset(false, false);\n\t\tItemAction e = ITEM_ACTION.get(item.getId());\n\t\tif(e != null)\n\t\t\te.click(player, item, container, slot, 3);\n\t\tswitch(id) {\n\t\t\tcase 5509:\n\t\t\t\tRunecrafting.empty(player, PouchType.SMALL);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 5510:\n\t\t\t\tRunecrafting.empty(player, PouchType.MEDIUM);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 5512:\n\t\t\t\tRunecrafting.empty(player, PouchType.LARGE);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 5514:\n\t\t\t\tRunecrafting.empty(player, PouchType.GIANT);\n\t\t\t\tbreak;\n\t\t}\n\t}",
"@Override\n public void onItemClick(View view, String data) {\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\r\n\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\r\n\t\t\t\tlong arg3) {\n\t\t\tif (arg2 != 0) {\r\n\t\t\t\tIntent jIntent = new Intent(activity, ApplyFollowActivity.class);\r\n\t\t\t\tjIntent.putExtra(\"id\", mlist.get(arg2 - 1).get(\"regid\"));\r\n\t\t\t\tjIntent.putExtra(\"jobid\", mlist.get(arg2 - 1).get(\"jobid\"));\r\n\t\t\t\tjIntent.putExtra(\"jsid\", mlist.get(arg2 - 1).get(\"jsid\"));\r\n\t\t\t\tjIntent.putExtra(\"eid\", mlist.get(arg2 - 1).get(\"entid\"));\r\n\t\t\t\tjIntent.putExtra(\"title\", mlist.get(arg2 - 1).get(\"title\"));\r\n\t\t\t\tjIntent.putExtra(\"time\", mlist.get(arg2 - 1).get(\"issuetime\").split(\" \")[0]);\r\n\t\t\t\tjIntent.putExtra(\"city\", mlist.get(arg2 - 1).get(\"city\"));\r\n\t\t\t\tjIntent.putExtra(\"status\", mlist.get(arg2 - 1).get(\"status\"));\r\n\t\t\t\tjIntent.putExtra(\"price\", mlist.get(arg2 - 1).get(\"wage\") + mlist.get(arg2 - 1).get(\"unit\"));\r\n\t\t\t\tstartActivity(jIntent);\r\n\t\t\t}\r\n\t\t}",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n if (isInActionMode()) {\n if (getSelecteditemPositions().size() == 0) {\n actionMode.finish();\n }\n }\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tclickMulti();\n\t\t\t}",
"@Override\n public void onClick(int position, Object obj) {\n }",
"@Override\n public void onClick(View view) {\n int type = i+1;\n Intent intent = new Intent(viewHolder.itemView.getContext(), ShowItemActivity.class);\n intent.putExtra(\"type\",String.valueOf(type));\n viewHolder.itemView.getContext().startActivity(intent);\n\n }",
"public void act() \n {\n super.checkClick();\n active(isActive);\n }",
"public void selected(String action);",
"@Override\n public void onItemClick(Nson parent, View view, int position) {\n }",
"@Override\n public void onClick(View v) {\n if (mListener != null){\n mListener.onItemClick(itemView, getLayoutPosition());\n }\n }",
"@Override\n public void onClick(View v) {\n viewModel.holderClicked();\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}",
"private void firstClick(Player player, ByteBuf buf) {\n\t\tint container = buf.getShort(true, ByteTransform.A, ByteOrder.LITTLE);\n\t\tint slot = buf.getShort(false, ByteTransform.A);\n\t\tint id = buf.getShort(false, ByteOrder.LITTLE);\n\t\tif(Arrav.DEBUG) {\n\t\t\tplayer.message(\"Item action: First click, ID: \" + id);\n\t\t}\n\t\tif(slot < 0 || container < 0 || id < 0 || id > ItemDefinition.DEFINITIONS.length)\n\t\t\treturn;\n\t\tItem item = player.getInventory().get(slot);\n\t\tif(item == null || item.getId() != id) {\n\t\t\treturn;\n\t\t}\n\t\tplayer.getCombat().reset(false, false);\n\t\tItemAction e = ITEM_ACTION.get(item.getId());\n\t\tif(e != null)\n\t\t\te.click(player, item, container, slot, 1);\n\t\tswitch(id) {\n\t\t}\n\t}",
"@Override\n public void onClick(View v)\n {\n String itemType = (String) v.getTag();\n\n //using the itemtype, pull tooltipParams for that item to use in the URL later\n String tooltipParams = currentCharacter.getItems().get(itemType).get(\"tooltipParams\");\n\n //concat url for pulling detailed item info\n String url = MainActivity.DETAILED_ITEM_API_URL + tooltipParams;\n\n //start battlenetapihandler for the url\n DetailedItemInfoCallback callback = new DetailedItemInfoCallback();\n new BattleNetAPIHandler(CharacterSheetActivity.this, callback).execute(url);\n }",
"void onItemClick(int position);",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n }",
"public void clickAddTopping(int itemIndex, ItemCart item);",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position,\n long id) {\n\n\n }",
"@Override\n public void onClick(View view) {\n int position = getAdapterPosition();\n\n // Check if listener!=null bcz it is not guarantee that we'll call setOnItemClickListener\n // RecyclerView.NO_POSITION - Constant for -1, so that we don't click item at Invalid position (safety measure)\n if (listener != null && position != RecyclerView.NO_POSITION) {\n //listener.onItemClick(notes.get(position)); - used in RecyclerView.Adapter\n listener.onItemClick(getItem(position)); // getting data from superclass\n }\n }",
"@Override\n public void onClick(View v) {\n customItemClickListener.onItemClick(inflatedView, holder.getAdapterPosition());\n }",
"@Override\n public void onClick(View view) {\n\n switch (view.getId()) {\n case R.id.tvSomeText:\n listener.sendDataToActivity(\"MainActivity: TextView clicked\");\n break;\n\n case -1:\n listener.sendDataToActivity(\"MainActivity: ItemView clicked\");\n break;\n }\n }",
"@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t\t\t\tif (null != mListOnItemClickListener) {\n\t\t\t\t\tmListOnItemClickListener.onItemClick(list.get(arg2), type);\n\t\t\t\t\tpopup.dismiss();\n\t\t\t\t}\n\t\t\t}",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }",
"@Override\n\tprotected void OnClick() {\n\t\t\n\t}",
"public void onClicked(EntityPlayer player, QRayTraceResult hit, ItemStack item);",
"@Override\n public boolean onActionItemClicked(ActionMode mode, MenuItem item) {\n switch (item.getItemId()) {\n case R.id.action_delete:\n \tdeleteSelected(mSelection);\n mSelection.clearSelection();\n \n numItemsSelected=0;\n \n mode.finish(); // Action picked, so close the CAB\n return true;\n case R.id.action_rename:\n // TODO renameItem();\n \t\n numItemsSelected=0;\n \n mode.finish(); // Action picked, so close the CAB\n return true;\n default:\n return false;\n }\n }",
"@Override\n public void onClick(View view) {\n if (mSelectedWeightPosition == RecyclerView.NO_POSITION) {\n\n if (mActionMode != null) {\n return;\n }\n\n // Selected weight\n mSelectedWeight = mWeight;\n\n // Get the position of the selected item\n mSelectedWeightPosition = getAdapterPosition();\n\n // Inform the Adapter that the item at the given position has changed\n mWeightAdapter.notifyItemChanged(mSelectedWeightPosition);\n\n // Show the CAB\n mActionMode = getActivity().startActionMode(mActionModeCallback);\n\n } else {\n\n mActionMode.finish();\n\n }\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 }",
"@OnClick(R.id.converter_sale_or_purchase_cv)\n public void chooseAction() {\n mDialog = new DialogList(mContext,\n mActionDialogTitle, mListForActionDialog, null,\n new RecyclerViewAdapterDialogList.OnItemClickListener() {\n @Override\n public void onClick(int position) {\n if (position == 0) {\n mAction = ConstantsManager.CONVERTER_ACTION_PURCHASE;\n } else {\n mAction = ConstantsManager.CONVERTER_ACTION_SALE;\n }\n mPreferenceManager.setConverterAction(mAction);\n mDialog.getDialog().dismiss();\n setLang();\n }\n });\n ((ImageView) mDialog.getDialog().getWindow().findViewById(R.id.dialog_list_done))\n .setImageResource(R.drawable.ic_tr);\n mDialog.getDialog().getWindow().findViewById(R.id.dialog_list_done)\n .setBackground(getResources().getDrawable(R.drawable.ic_tr));\n }",
"@Override\n public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n long arg3) {\n CheckItemBase item = null;\n if (TAB_AUTO == mTabIndex) {\n item = mAutoItemArray.get(arg2).mCheckItem;\n } else if (TAB_MANUAL == mTabIndex) {\n item = mManualItemArray.get(arg2).mCheckItem;\n } else {\n myAssert(false, \"No such tab!\");\n }\n if (null == item) {\n myAssert(false, \"check item is null!\");\n }\n setupAlertDlg(item);\n }",
"@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 Intent prefIntent = new Intent(intent);\n\t\t\t prefIntent.setComponent(new ComponentName(\n\t\t\t rList.get(arg2).activityInfo.packageName, rList.get(arg2).activityInfo.name));\n\t\t\t Test.this.startActivity(prefIntent);\n\t\t\t\t}",
"private void thirdClick(Player player, ByteBuf buf) {\n\t\tint container = buf.getShort(true, ByteTransform.A);\n\t\tint slot = buf.getShort(true, ByteOrder.LITTLE);\n\t\tint id = buf.getShort(true, ByteTransform.A);\n\t\tif(Arrav.DEBUG) {\n\t\t\tplayer.message(\"Item action: third click, ID: \" + id);\n\t\t}\n\t\tif(slot < 0 || container < 0 || id < 0 || id > ItemDefinition.DEFINITIONS.length) {\n\t\t\treturn;\n\t\t}\n\t\tItem item = player.getInventory().get(slot);\n\t\tif(item == null || item.getId() != id) {\n\t\t\treturn;\n\t\t}\n\t\tplayer.getCombat().reset(false, false);\n\t\tItemAction e = ITEM_ACTION.get(item.getId());\n\t\tif(e != null)\n\t\t\te.click(player, item, container, slot, 3);\n\t\tif(item.getDefinition().getName().contains(\"Black mask\")) {\n\t\t\tplayer.getInventory().replace(item.getId(), 8921, true);//black mask discharge\n\t\t}\n\t\tswitch(item.getId()) {\n\t\t\tcase 5509:\n\t\t\t\tRunecrafting.examine(player, PouchType.SMALL);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 5510:\n\t\t\t\tRunecrafting.examine(player, PouchType.MEDIUM);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 5512:\n\t\t\t\tRunecrafting.examine(player, PouchType.LARGE);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 5514:\n\t\t\t\tRunecrafting.examine(player, PouchType.GIANT);\n\t\t\t\tbreak;\n\t\t}\n\t}",
"private void optionSelected(MenuActionDataItem action){\n \t\tString systemAction = action.getSystemAction();\n \t\tif(!systemAction.equals(\"\")){\n \t\t\t\n \t\t\tif(systemAction.equals(\"back\")){\n \t\t\t\tonBackPressed();\n \t\t\t}else if(systemAction.equals(\"home\")){\n \t\t\t\tIntent launchHome = new Intent(this, CoverActivity.class);\t\n \t\t\t\tstartActivity(launchHome);\n \t\t\t}else if(systemAction.equals(\"tts\")){\n \t\t\t\ttextToSearch();\n \t\t\t}else if(systemAction.equals(\"search\")){\n \t\t\t\tshowSearch();\n \t\t\t}else if(systemAction.equals(\"share\")){\n \t\t\t\tshowShare();\n \t\t\t}else if(systemAction.equals(\"map\")){\n \t\t\t\tshowMap();\n \t\t\t}else\n \t\t\t\tLog.e(\"CreateMenus\", \"No se encuentra el el tipo de menu: \" + systemAction);\n \t\t\t\n \t\t}else{\n \t\t\tNextLevel nextLevel = action.getNextLevel();\n \t\t\tshowNextLevel(this, nextLevel);\n \t\t\t\n \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\tIntent i;\n\t\t\t\tswitch (arg2) {\n\t\t\t\tcase 0:\n\t\t\t\t\tFacadeController.getInstance().setSportSelected(\"Arco\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tFacadeController.getInstance()\n\t\t\t\t\t\t\t.setSportSelected(\"Atletismo\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tFacadeController.getInstance().setSportSelected(\n\t\t\t\t\t\t\t\"Baloncesto\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tFacadeController.getInstance().setSportSelected(\"Ciclismo\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tFacadeController.getInstance().setSportSelected(\"Esgrima\");\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t\tif (FacadeController.getInstance()\n\t\t\t\t\t\t.getActivitySelectedFromGrid()\n\t\t\t\t\t\t.equals(\"Busqueda_Evento\")) {\n\t\t\t\t\ti = new Intent(getApplicationContext(),\n\t\t\t\t\t\t\tEventsActivity.class);\n\t\t\t\t\tstartActivity(i);\n\n\t\t\t\t} else if (FacadeController.getInstance()\n\t\t\t\t\t\t.getActivitySelectedFromGrid()\n\t\t\t\t\t\t.equals(\"Publicacion_Evento\")) {\n\t\t\t\t\ti = new Intent(getApplicationContext(),\n\t\t\t\t\t\t\tCreateEventActivity.class);\n\t\t\t\t\tstartActivity(i);\n\n\t\t\t\t} else {\n\n\t\t\t\t}\n\n\t\t\t}",
"void onItemClick(Note note);"
] | [
"0.75739783",
"0.7466974",
"0.72950786",
"0.70914495",
"0.7069994",
"0.7064883",
"0.705234",
"0.7013274",
"0.6977113",
"0.6918688",
"0.68949413",
"0.6888427",
"0.6810508",
"0.6777203",
"0.67675406",
"0.67573786",
"0.6751628",
"0.67396545",
"0.6738035",
"0.6737632",
"0.67299044",
"0.6724138",
"0.67184734",
"0.6711522",
"0.6707908",
"0.6701871",
"0.6689321",
"0.66339535",
"0.66137624",
"0.66137624",
"0.66096157",
"0.6602917",
"0.65941167",
"0.6591996",
"0.65784615",
"0.65741354",
"0.6572341",
"0.6569445",
"0.65687263",
"0.65679324",
"0.6562232",
"0.6562232",
"0.6559428",
"0.65591985",
"0.65574807",
"0.65574807",
"0.6555054",
"0.65359527",
"0.6515899",
"0.65083563",
"0.6505218",
"0.6494831",
"0.6490681",
"0.64898735",
"0.64895636",
"0.64864427",
"0.6476733",
"0.6464252",
"0.64610153",
"0.6460198",
"0.64581573",
"0.6451033",
"0.6427863",
"0.642726",
"0.64262056",
"0.64219016",
"0.6414124",
"0.6411674",
"0.64052796",
"0.6402804",
"0.639977",
"0.6394808",
"0.63921726",
"0.6373491",
"0.637266",
"0.6372113",
"0.6367264",
"0.63603485",
"0.6359892",
"0.6356863",
"0.6348867",
"0.63455325",
"0.63454175",
"0.63447684",
"0.63430846",
"0.63430846",
"0.63430846",
"0.63430846",
"0.63430846",
"0.63413763",
"0.63333195",
"0.63316905",
"0.6330036",
"0.6323605",
"0.6323591",
"0.6320413",
"0.6318746",
"0.631556",
"0.6308733",
"0.63073015",
"0.6306816"
] | 0.0 | -1 |
Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); | @Override
public boolean onCreateOptionsMenu(Menu menu) {
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\t\t\t\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\t\t\t\tgetMenuInflater().inflate(R.menu.activity_main, menu);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tthis.getMenuInflater().inflate(R.menu.activity_main, menu);\n\t\treturn true;\n\t}",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\n\t\treturn true;\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.activity_main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.activity_main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.activity_main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.activity_main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.activity_main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.activity_main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.activity_main, menu);\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.activity_main, menu);\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.activity_main, menu);\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.activity_main, menu);\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.activity_main, menu);\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.activity_main, menu);\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.activity_main, menu);\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.activity_main, menu);\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.activity_main, menu);\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.activity_main, menu);\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.activity_main, menu);\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.activity_main, menu);\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.activity_main, menu);\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.activity_main, menu);\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.activity_main, menu);\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.activity_main, menu);\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.activity_main, menu);\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.activity_main, menu);\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.activity_main, menu);\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.activity_main, menu);\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.activity_main, menu);\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.activity_main, menu);\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.activity_main, menu);\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.activity_main, menu);\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.activity_main, menu);\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.activity_main, menu);\n\t\treturn true;\n\t}",
"@Override\t\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.activity_main, menu);\n return true;\n }",
"@Override\t\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\t\t\n\t\t/* Inflate the menu; this adds items to the action bar if it is present */\n\t\tgetMenuInflater().inflate(R.menu.act_main, menu);\t\t\n\t\treturn true;\n\t}",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t}",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\t// Inflate the menu; this adds items to the action bar if it is present.\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.activity_main_menu, menu);\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.activity_main_menu, menu);\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(final Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n this.getMenuInflater().inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu)\n\t{\n\t\tgetMenuInflater().inflate(R.menu.activity_main, menu);\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main_actions, menu);\n\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn true;\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ui_main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) \n\t{\n\t\tgetMenuInflater().inflate(R.menu.activity_main, menu);\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\n\t\tMenuInflater mInflater = getMenuInflater();\n\t\tmInflater.inflate(R.menu.main, menu);\n\n\t\treturn true;\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn true;\r\n\t}"
] | [
"0.8230093",
"0.81548685",
"0.8147321",
"0.8147321",
"0.8147321",
"0.8147321",
"0.8139778",
"0.8118505",
"0.8117212",
"0.8117212",
"0.8117212",
"0.81051034",
"0.8100998",
"0.8100998",
"0.8100998",
"0.8100998",
"0.8100998",
"0.8100998",
"0.80988204",
"0.80988204",
"0.80988204",
"0.80988204",
"0.80988204",
"0.80988204",
"0.80988204",
"0.80988204",
"0.80988204",
"0.80988204",
"0.80988204",
"0.80988204",
"0.80988204",
"0.80988204",
"0.80988204",
"0.80988204",
"0.80988204",
"0.80988204",
"0.80988204",
"0.80988204",
"0.80988204",
"0.80988204",
"0.80988204",
"0.80988204",
"0.80988204",
"0.80988204",
"0.80985236",
"0.8096838",
"0.80924016",
"0.8077842",
"0.807669",
"0.807669",
"0.80729604",
"0.8069341",
"0.8065419",
"0.8058801",
"0.80553806",
"0.8052803",
"0.804882",
"0.8047404",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452",
"0.8040452"
] | 0.0 | -1 |
Write your code here | public static String reverseWordWise(String input) {
String output = "";
int index = 0;
for (int i = 0; i < input.length(); i++) {
if (input.charAt(i) == ' ') {
index = i+1;
output += input.charAt(i);
} else {
output = output.substring(0,index) + input.charAt(i) + output.substring(index);
}
}
return output;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void generateCode()\n {\n \n }",
"public void logic(){\r\n\r\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"private static void cajas() {\n\t\t\n\t}",
"void pramitiTechTutorials() {\n\t\n}",
"public void ganar() {\n // TODO implement here\n }",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"CD withCode();",
"public void mo38117a() {\n }",
"private stendhal() {\n\t}",
"public void mo4359a() {\n }",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\r\n\tpublic void runn() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"public static void main(String[] args) {\n // write your code here - this is called comment and it always starts with double slash\n // and comlier will ignore this because of the // sign.\n // I am gonna say hello\n // JAVA IS CASE SENSITIVE LANGUAGE\n // System and system are very different things in java\n //Hello AND hello are different for java\n // System.out.println(\"Hello Batch 15!\");\n // System.out.println(\"I am still here.\");\n // System.out.println(\"I love Java.\");\n\n // Write a program to display your information.\n // When you run it, it should have this outcome.\n // I am your name here\n // I am from batch 15\n // I am from your city here\n // I love Java\n\n System.out.println(\"I am Sevim.\");\n System.out.println(\"I am from Batch 15.\");\n System.out.println(\"I'm from New Jersey.\");\n System.out.println(\"I love Java.\");\n\n\n\n }",
"@Override\n\tpublic void anular() {\n\n\t}",
"public void genCode(CodeFile code) {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"Programming(){\n\t}",
"public void smell() {\n\t\t\n\t}",
"@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}",
"public void furyo ()\t{\n }",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public void hello(){\n\t\t\r\n \t\r\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"public void working()\n {\n \n \n }",
"@Override\r\n\t\tpublic void doDomething() {\r\n\t\t\tSystem.out.println(\"I am here\");\r\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"public void baocun() {\n\t\t\n\t}",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void code() {\n\t\tus.code();\r\n\t\tSystem.out.println(\"我会java...\");\r\n\t}",
"@Override\r\n\tpublic void code() {\n\t\tSystem.out.println(\"我会C语言....\");\r\n\t}",
"@Override\n\tpublic void function() {\n\t\t\n\t}",
"private void strin() {\n\n\t}",
"public void edit() {\n\t\tSystem.out.println(\"编写java笔记\");\r\n\t}",
"private void kk12() {\n\n\t}",
"public void mo55254a() {\n }",
"public void gen(CodeSeq code, ICodeEnv env) {\n\r\n\t}",
"public void mo9848a() {\n }",
"protected void mo6255a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void themesa()\n {\n \n \n \n \n }",
"private void yy() {\n\n\t}",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t}",
"public void perder() {\n // TODO implement here\n }",
"void rajib () {\n\t\t \n\t\t System.out.println(\"Rajib is IT Eng\");\n\t }",
"private static void oneUserExample()\t{\n\t}",
"public static void main(String[] args) {\n\t// write your code here\n }",
"@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}",
"public void mo3376r() {\n }",
"public void mo97908d() {\n }",
"@Override\r\n\tvoid func04() {\n\t\t\r\n\t}",
"public void cocinar(){\n\n }",
"private void getStatus() {\n\t\t\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"public void mo5382o() {\n }",
"@Override\n public void memoria() {\n \n }",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"private static void ThridUmpireReview() {\n\t\tSystem.out.println(\" Umpier Reviews the Score Board\");\n\t\t \n\t\t\n\t}",
"@Override\n\tpublic void dosomething() {\n\t\t\n\t}",
"@Override\r\n\tprotected void doF6() {\n\t\t\r\n\t}",
"protected void execute() {\n\t\t\n\t}",
"@Override\n public void execute() {\n \n \n }",
"public static void main(String args[]) throws Exception\n {\n \n \n \n }",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"public void mo21793R() {\n }",
"public void mo12930a() {\n }",
"private void test() {\n\n\t}",
"public void mo6081a() {\n }",
"static void feladat5() {\n\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tvoid output() {\n\t\t\n\t}",
"public void run() {\n\t\t\t\t\n\t\t\t}",
"@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}",
"public void mo3749d() {\n }",
"void berechneFlaeche() {\n\t}",
"@Override\n\tpublic void orgasm() {\n\t\t\n\t}",
"public void mo21791P() {\n }",
"public final void cpp() {\n }",
"@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}",
"void kiemTraThangHopLi() {\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}",
"public void skystonePos5() {\n }",
"@Override\n protected void execute() {\n \n }",
"@Override\n\tprotected void postRun() {\n\n\t}",
"@Override\n\tpublic void HowtoEat() {\n\t\tSystem.out.println(\"Fırında Ye!!\");\n\t}",
"@Override\n protected void codeGenMain(DecacCompiler compiler, Registres regs, Pile p) {\n }",
"@Override\n\tpublic void view() {\n\t\t\n\t}"
] | [
"0.63849014",
"0.6282245",
"0.609384",
"0.5969596",
"0.5919565",
"0.58799326",
"0.5875124",
"0.58691454",
"0.5868616",
"0.5855494",
"0.58265156",
"0.582598",
"0.58234346",
"0.57725835",
"0.57709163",
"0.5769708",
"0.57687974",
"0.5748677",
"0.5737696",
"0.57376194",
"0.572957",
"0.5728263",
"0.57222235",
"0.5715707",
"0.57103807",
"0.57103807",
"0.57047886",
"0.56821483",
"0.56821483",
"0.56743574",
"0.5652282",
"0.56416786",
"0.56296474",
"0.5612761",
"0.56063414",
"0.5602042",
"0.55994606",
"0.5583815",
"0.5579645",
"0.5571516",
"0.5565412",
"0.55622125",
"0.55557257",
"0.5549644",
"0.5545772",
"0.5545772",
"0.5545772",
"0.5545772",
"0.5545772",
"0.5545772",
"0.5545772",
"0.55297816",
"0.552605",
"0.5516417",
"0.5516417",
"0.5508414",
"0.5503603",
"0.5500894",
"0.5499638",
"0.54964185",
"0.5487659",
"0.5481764",
"0.5478071",
"0.5477508",
"0.5474692",
"0.5474263",
"0.5469756",
"0.54669404",
"0.5464576",
"0.5460441",
"0.54583865",
"0.54582435",
"0.5458042",
"0.5452765",
"0.5452318",
"0.54484075",
"0.5445236",
"0.54451174",
"0.543959",
"0.5439255",
"0.5437711",
"0.5434874",
"0.5432184",
"0.5430253",
"0.54276085",
"0.54232574",
"0.5419696",
"0.54190874",
"0.5419057",
"0.5415783",
"0.54151136",
"0.5413413",
"0.5403212",
"0.5401456",
"0.5401456",
"0.5395126",
"0.5390369",
"0.5389595",
"0.53859144",
"0.53834575",
"0.5382113"
] | 0.0 | -1 |
/ Your class should be named Solution. Don't write main() function. Don't read input, it is passed as function argument. Print output as specified in the question | public static void findLargest(int input[][]){
int numRows = input.length;
int numCols = input[0].length;
int num = 0;
int ans = Integer.MIN_VALUE;
String row_or_col = "NA";
for (int i = 0; i < numRows; i++) {
int sum = 0;
for (int j = 0; j < numCols; j++) {
sum += input[i][j];
}
if (sum > ans) {
ans = sum;
num = i;
row_or_col = "row";
}
}
for (int i = 0; i < numCols; i++) {
int sum = 0;
for (int j = 0; j < numRows; j++) {
sum += input[i][j];
}
if (sum > ans) {
ans = sum;
num = i;
row_or_col = "column";
}
}
System.out.println(row_or_col+" "+num+" "+ans);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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\t\t\tSystem.out.println(Solution(5, 83));\n\t\t\t\n\t\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\tSystem.out.println(Arrays.toString(solution(8, 1)));\r\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 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) {\n\n Solution2.solution();\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\t\tScanner sc = new Scanner(System.in);\r\n\t\tSolution s = new Solution();\r\n\t}",
"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) {\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) {\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\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\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}",
"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 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 System.out.println(solution(new int[]{3,1,2,4,3}));\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\t\tSolution s = new Solution();\n\t\ts.solution(2, 4, 2, 1);\n\t}",
"public static void main(String[] args) {\n\t\tint[] arr = {5,5,3,3,3,2,5};\n\t\tint[] result = solution(arr);\n\t\tfor(int n : result) {\n\t\t\tSystem.out.print(n + \" \");\n\t\t}\n\t}",
"public static void main(String[] args) {\n\t\tint[] arr= {6,9,5,7,4};\r\n\t\t//int[] arr= {3,9,9,3,5,7,2};\r\n\t\t//int[] arr= {1,5,3,6,7,6,5};\r\n\t\tint[] tmp=solution(arr);\r\n\t\tfor(int i=0;i<tmp.length;i++)\r\n\t\t\tSystem.out.print(tmp[i]+\" \");\r\n\t}",
"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\t\tint nums[] = {0, 1, 0, 3, 12};\r\n\t\tsolution(nums);\r\n\t\tfor(int a:nums)\r\n\t\t\tSystem.out.println(a);\r\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{\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) {\n\t\tint arr[] = {9,3,9,3,9,7,9};\n\t\tSolution(arr);\n\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\t\tint[] A = { 1, 3, 2, 5, 4, 6, 5, 7 };\r\n\t\tint X = 5;\r\n\t\tSystem.out.println(solution(X, A));\r\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\tint A[]={1,3,1,4,2,3,5,4};\n\t\tint result=solution(5,A);\n\t\tSystem.out.println(result);\n\t}",
"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}",
"public static void main(String[] args) {\n\t\t\tint[] A = {1};\r\n\t\t\tSystem.out.println(solution(A, 6));\r\n\t}",
"public static void main(String[] args) {\n\r\n\t\tnew Main().sol();\r\n\t}",
"public static void main(String[] args) {\n\t\tint[][] maps = \n\t\t\t{\n\t\t\t\t\t{1,0,1,1,1},\n\t\t\t\t\t{1,0,1,0,1},\n\t\t\t\t\t{1,0,1,1,1},\n\t\t\t\t\t{1,1,1,0,1},\n\t\t\t\t\t{0,0,0,0,1}\n\t\t\t};\n\t\tSystem.out.println(solution(maps));\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 Homework1 hw1 = new Homework1();\n\n System.out.println(\"===Problem 1===\");\n hw1.problem1();\n\n System.out.println(\"===Problem 2===\");\n System.out.println(hw1.topInt(1.5));\n System.out.println(hw1.topInt(5.1));\n System.out.println(hw1.topInt(1.0));\n System.out.println(hw1.topInt(-4.2));\n\n\n System.out.println(\"===Problem 3===\");\n hw1.draw4x4('-');\n hw1.draw4x4('4');\n\n System.out.println(\"===Problem 4===\");\n System.out.println(hw1.citationName(\"Alastair\", \"Reynolds\"));\n System.out.println(hw1.citationName(\"Grace\", \"Hopper\"));\n\n System.out.println(\"===Problem 5===\");\n System.out.println(String.valueOf(hw1.min3(1.0, 2.0, 3.0)));\n System.out.println(String.valueOf(hw1.min3(4.0, 3.0, 2.0)));\n System.out.println(String.valueOf(hw1.min3(0.5, 0.1, 0.5)));\n \n System.out.println(\"===Problem 6===\");\n System.out.println(hw1.fibonacci(0));\n System.out.println(hw1.fibonacci(1));\n System.out.println(hw1.fibonacci(2));\n System.out.println(hw1.fibonacci(3));\n System.out.println(hw1.fibonacci(10));\n System.out.println(hw1.fibonacci(25));\n \n \n System.out.println(\"===Problem 7===\");\n //System.out.println(hw1.isPalindrome(\"racecar\"));\n //System.out.println(hw1.isPalindrome(\"cat\"));\n //System.out.println(hw1.isPalindrome(\"hannah\"));\n //System.out.println(hw1.isPalindrome(\"saippuakivikauppias\"));\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 }",
"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) {\n\t\tSolution s = new Solution();\n\t\t//char[][] test = {{'O','O','O'},{'O','X','O'},{'O','O','O'}};\n\t\tchar[][] test = {{'X','O','X','X'},{'O','X','O','X'},{'X','O','X','O'},{'O','X','O','X'},{'X','O','X','O'}};\n\t\tfor(int i = 0;i < test.length;i++){\n\t\t\tfor(int j = 0;j < test[0].length;j++){\n\t\t\t\tSystem.out.print(test[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tSystem.out.println();\n\t\ts.solve(test);\n\t\tfor(int i = 0;i < test.length;i++){\n\t\t\tfor(int j = 0;j < test[0].length;j++){\n\t\t\t\tSystem.out.print(test[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"public static void main(String[] args) {\n int[] nums = {3,2,4};\n solution s = new solution();\n System.out.println(Arrays.toString(s.twoSum(nums,6)));\n }",
"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}",
"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) {\n\t\tint [] a= {4,3,2,1};\r\n\t\tfor(int i:solution(a)) System.out.println(i);\r\n\t}",
"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\r\n\t\tSystem.out.println(solution(\"ACACACA\"));\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}",
"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\n\t\tint ar[] = { 7, 5, 4 };\n\n\t\tSystem.out.println(solution(ar));\n\n\t}",
"public static void main(String[] args) {\n System.out.println(solution(5, new int[]{1, 3, 1, 4, 2, 3, 5, 4})); // 6\n }",
"public static void main(String[] args) {\n\t\tSystem.out.println(solution(people, limit));\n\t}",
"public static void main(String[] args) {\n\t\tint[] stones = {2, 4, 5, 3, 2, 1, 4, 2, 5, 1};\n\t\tint k = 3;\n\t\tSystem.out.println(solution(stones, k));\n\t}",
"public static void main(String[] args) {\n int[] grades = {73,67,38,33};\n// for(int grades_i=0; grades_i < n; grades_i++){\n// grades[grades_i] = in.nextInt();\n// }\n int[] result = solve(grades);\n for (int i = 0; i < result.length; i++) {\n System.out.print(result[i] + (i != result.length - 1 ? \"\\n\" : \"\"));\n }\n System.out.println(\"\");\n \n\n }",
"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\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(String[] args) {\n\n\t\tint [] scoville= {1,2,3,9,10};\n\t\tint [] scoville2= {3,1,5,7,2};\n\n\t\tSystem.out.println(solution(scoville,10));\n\t}",
"public static void main(String[] args) {\n\t\tString[][] relation = {\r\n\t\t\t{\"100\",\"ryan\",\"music\",\"2\"},{\"200\",\"apeach\",\"math\",\"2\"},{\"300\",\"tube\",\"computer\",\"3\"},{\"400\",\"con\",\"computer\",\"4\"},{\"500\",\"muzi\",\"music\",\"3\"},{\"600\",\"apeach\",\"music\",\"2\"}\r\n\t\t};\r\n\r\n\t\tSystem.out.println(solution(relation));\r\n\t}",
"public static void main(String[] args) {\n\t\tlong n = 3;\n//\t\tlong n = 1;\n\t\tSystem.out.println(solution(n));\n\t\t\n\t}",
"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 []) 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 Solution s = new Solution();\n System.out.println(s.letterCombinations(\"67\").toString());\n\n }",
"Solution(){\n\n n = scanner.nextInt();\n scanner.skip(\"(\\r\\n|[\\n\\r\\u2028\\u2029\\u0085])?\");\n\n a = new int[n+1];\n\n \n for (int i = 1; i <= n; i++) {\n a[i] = scanner.nextInt();\n }\n Graph graph=new Graph(a);\n for(int i=0;i<n-1;i++) {\n \tint node1=scanner.nextInt();\n \tint node2=scanner.nextInt();\n \tgraph.addEdge(node1, node2);\n \t//System.out.println(node1+\" \"+node2);\n }\n //graph.dump();\n int q=scanner.nextInt();\n while(q-- > 0) {\n \tint u=scanner.nextInt();\n \tint d=scanner.nextInt();\n \tint k=scanner.nextInt();\n \t//System.out.println(\"u:\"+u+\" d:\"+d+\" k:\"+k);\n \tSystem.out.println(graph.DFS(u, d, k));\n }\n scanner.close();\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\tScanner scan=new Scanner(System.in);\n\t\tSystem.out.print(\"Enter No. disks :\");\n\t\tint number=scan.nextInt();\n\t\tif(number<=0){\n\t\t\tSystem.out.println(\"Please Enter a Valid Number\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t\tint strSize=((int)Math.pow(2,number))-1;\n\t\tString str[]=new String[strSize];\n\t\tString result[]=new TowerOfHanoiSolution().getTOHSolution(number,\"A\",\"B\",\"C\",str);\n\t\tfor(int i=0;i<strSize;i++){\n\t\tSystem.out.println(result[i]);\n\t\t}\n\t\tscan.close();\n\t}",
"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 {\n\n int A[] ={ 1, 0, 8, 9, 20, 39};\n\n int res = solution2(A);\n\n\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 Solution app = new Solution();\n System.out.println(app.getPermutation(4, 5));\n }",
"public static void main(String args[]) {\n\t List<int[][]> result = solveKT();\n\t for(int [][] sol: result){\n\t\t printSolution(sol);\n\t\t System.out.println();\n\t }\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 static void main(String[] args) {\nAddNumbers a=new AddNumbers();\r\na.getInput();\r\na.addNumbers();\r\nint output=a.addNumbers();\r\nSystem.out.println(\"OUTPUT:\");\r\nSystem.out.println(\"The addition of n numbers is: \"+output);\r\n\t}",
"private Solution() { }",
"private Solution() { }",
"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 static void main(String args[]) {\n\t\tint cost[][] = { { 10, 1, 10, 1 }, { 1, 1, 1, 10 }, { 10, 1, 10, 1 }, { 1, 10, 1, 1 } };\n\n\t\tSystem.out.println(solution(cost));\n\t}",
"public static void main(String[] args) {\n\t\tTwoSumIII_DataStructureDesign result = new TwoSumIII_DataStructureDesign();\n\t\tresult.add(1);\n\t\tresult.add(3);\n\t\tresult.add(5);\n\t\tSystem.out.println(result.find(4));\n\t\tSystem.out.println(result.find(7));\n\t}",
"private void generateSolution() {\n\t\t// TODO\n\n\t}",
"public static void main(String[] args) {\n\t\t\r\n\t\tScanner sc = null;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tsc = new Scanner( new File(\"C:\\\\Users\\\\SRT\\\\algorithms\\\\robot\\\\src\\\\frodo\\\\input2.txt\") );\r\n\t\t} catch (Exception e){\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tint test_case = sc.nextInt();\r\n\t\t\r\n\t\tint N=0;\r\n\r\n\t\tfor (int tc = 1; tc <= test_case; tc++){\r\n\t\t\t//if(tc ==1 ) {\r\n\t\t\tN = sc.nextInt();\r\n\t\t\tint grid [][] = new int [N][2];\r\n\r\n\t\t\tfor(int row = 0 ; row < grid.length ; row++) {\r\n\t\t\t\tSystem.out.println(\" \");\r\n\t\t\t\tfor(int col=0; col< grid[0].length; col++) {\r\n\t\t\t\t\tgrid[row][col] = sc.nextInt();\r\n\t\t\t\t\tSystem.out.print(\" \"+ grid[row][col]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"\\n\");\r\n\t\t\t\t\t\t\t\r\n\t\t\tSystem.out.println(\"#\"+tc+\":\"+getAnswer(N,grid));\r\n\t\t\t//}\t\r\n\t\t}\r\n\t\t\r\n\t}",
"public static void main(String[] args) {\n\t\tSolution a = new Solution();\n\t\tint[] testCase = {1};//{2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,1,2};//{0,0,0,0,0,0,0,0,0,1,2,0,0};\n\t\tboolean result = a.search(testCase, 1);\n\t\tSystem.out.printf(\"ans = \"+result);\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 \r\n Scanner sc = new Scanner(System.in);\r\n ArrayList<Integer> digits = new ArrayList<Integer>();\r\n System.out.println(\"Enter the input\");\r\n int n = sc.nextInt();\r\n for (int i=1;i<=n;i++) {\r\n int digit = sc.nextInt();\r\n digits.add(digit);\r\n }\r\n int b = sc.nextInt();\r\n int c = sc.nextInt();\r\n int res = solve(digits, b, c);\r\n\r\n\r\n }",
"public static void main(String[] args) {\n\tint[] a=\t {3, 8, 9, 7, 6};\r\n\ta=solution(a, 8);\r\n\t}",
"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 int[] nums = {10, 15, 3, 7};\n System.out.println(solution2(nums, 17));\n System.out.println(solution2(nums, 25));\n System.out.println(solution2(nums, 11));\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 {\n\t\tSalesmanTour ss = new SalesmanTour();\n\t\tss.input();\n\t\tSystem.out.println(ss.solve());\n\t}",
"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) {\n\t// write your code here\n int[][] input = new int[3][3];\n input[1][1] = 1;\n\n Solution sol = new Solution();\n sol.printMatrix(input);\n int[][] output = sol.updateMatrix(input);\n sol.printMatrix(output);\n\n }",
"public static void main(String[] args) {\n System.out.println(solution(\"1 + 2\"));\n System.out.println(solution(\"1 * 2 + 3\"));\n System.out.println(solution(\"1 + 2 * 3\"));\n System.out.println(solution(\"1 + 2 * 3 - 4 / 2 + 6 / 2 - 7\"));\n\n System.out.println(solution(\"1 + 2 * (3 * (1 + 2))\"));\n }",
"public static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tn = in.nextInt(); r = in.nextInt(); c = in.nextInt();\n\t\tint size = 1;\n\t\tfor (int i = 1; i <= n; i++) size *= 2;\n\t\tSystem.out.print(sol(0, 0, size));\n\t}",
"public static void main(String[] args) {\n\t\tString[][] q = {{\"yellow_hat\",\"headgear\"},{\"blue_sunglasses\",\"eyewear\"}};\n\t\tint an = solution(q);\n\t\t\n\t\tSystem.out.println(an);\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 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\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) 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 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\tint num = Solve(5);\n\t\tint num2 = Solve2(5);\n\t\tSystem.out.println(num);\n\t\tSystem.out.println(num2);\n\t}",
"public static void main(String[] args) {\n for (List<Integer> l : solution(new int[]{1, 2, 2})) {\n System.out.println(Arrays.toString(l.toArray()));\n }\n ;\n }",
"public static void main(String[] args) {\n Last_coding_exercises.task17();\n\n\n }",
"public static void main(String[] args) {\n\t\tTreeNode node1 = new TreeNode(1);\r\n\t\tTreeNode node2 = new TreeNode(2);\r\n\t\tTreeNode node3 = new TreeNode(3);\r\n\t\tTreeNode node4 = new TreeNode(4);\r\n\t\tTreeNode node5 = new TreeNode(5);\r\n\t\tTreeNode node6 = new TreeNode(6);\r\n\t\tnode1.left=node2;\r\n\t\tnode1.right=node3;\r\n\t\tnode2.left=node4;\r\n\t\tnode3.left=node5;\r\n\t\tnode3.right=node6;\r\n\t\tSolution s=new Solution();\r\n\t\tString res=s.Serialize(node1);\r\n\t\tSystem.out.println(res);\r\n\t\t\r\n\r\n \r\n\t}",
"public static void main(String[] args)throws IOException {\n\t\t\r\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\r\n\t\tPrintWriter pw = new PrintWriter(System.out);\r\n\t\tint t=Integer.parseInt(br.readLine());\r\n\t int i , need , remaining , noF ,friend[]=new int[1000];\t\r\n\t\tfor(int s=1;s<=t;s++)\r\n\t\t{\r\n\t\t\tString str[]=br.readLine().split(\" \");\r\n\t\t\tneed=Integer.parseInt(str[0]);\r\n\t\t\tremaining=need;\r\n\t\t\tnoF=Integer.parseInt(str[1]);\r\n\t\t\tString str2[]=br.readLine().split(\" \");\r\n\t\t\tfor(i=0;i<noF;i++)\r\n\t\t\t\t{\r\n\t\t\t\tfriend[i]=Integer.parseInt(str2[i]);\r\n\t\t\t\t}\r\n\t\t\t\tArrays.sort(friend,0,noF);\r\n\t\t\tfor(i=noF-1;i>=0;i--)\r\n\t\t\t\t{\r\n\t\t\t\t\tremaining-=friend[i];\r\n\t\t\t\t\tif(remaining<=0)break;\r\n\t\t\t\t}\r\n\t\t\tif(remaining<=0)\r\n\t\t\t\tpw.println(\"Scenario #\"+s+\":\\n\"+(noF-i)+\"\\n\");\r\n\t\t\telse pw.println(\"Scenario #\"+s+\":\\nimpossible\\n\");\r\n\t\t}\r\n\t\tpw.close();\r\n\t}",
"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\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}"
] | [
"0.75544894",
"0.7449339",
"0.7344063",
"0.7252791",
"0.72445005",
"0.7229486",
"0.71954286",
"0.71607035",
"0.7130309",
"0.71241117",
"0.70734525",
"0.7056663",
"0.7028586",
"0.69980526",
"0.698333",
"0.694548",
"0.693278",
"0.6890846",
"0.6879249",
"0.6878304",
"0.6877132",
"0.68753666",
"0.6872591",
"0.6843842",
"0.6838362",
"0.6824525",
"0.68207556",
"0.6791673",
"0.67503244",
"0.6738504",
"0.6715152",
"0.67008847",
"0.66983217",
"0.66924965",
"0.66904795",
"0.66779196",
"0.6661433",
"0.6660461",
"0.66554636",
"0.66544384",
"0.6635312",
"0.66311795",
"0.66292137",
"0.66206306",
"0.6620361",
"0.661849",
"0.6614803",
"0.66124314",
"0.6608035",
"0.6595904",
"0.6593327",
"0.65902066",
"0.65830696",
"0.65821755",
"0.65620947",
"0.6541143",
"0.65399",
"0.6531481",
"0.6530219",
"0.65275955",
"0.6520343",
"0.65152144",
"0.6512731",
"0.6511009",
"0.6508179",
"0.65047914",
"0.6501874",
"0.6489154",
"0.6480839",
"0.6467247",
"0.6460951",
"0.6460951",
"0.6444274",
"0.6443198",
"0.64395416",
"0.6436253",
"0.64211935",
"0.6415827",
"0.6412359",
"0.63932025",
"0.6390292",
"0.63876253",
"0.63837445",
"0.63824004",
"0.6364387",
"0.6354098",
"0.63441956",
"0.6340314",
"0.63398165",
"0.63170356",
"0.63157254",
"0.6314101",
"0.6301895",
"0.63012975",
"0.6299093",
"0.628855",
"0.62859046",
"0.62855864",
"0.62716264",
"0.62662923",
"0.6258674"
] | 0.0 | -1 |
/ Your class should be named Solution Don't write main(). Don't read input, it is passed as function argument. Print output and don't return it. Taking input is handled automatically. | public static void leaders(int[] input) {
for (int i=0; i < input.length; i++) {
boolean leader = true;
int candidate = input[i];
// check if it's a leader
int j = i+1;
while (j<input.length) {
if (input[j] > input[i]) {
leader = false;
break;
}
j++;
}
if (leader==true) {
System.out.print(candidate+" ");
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void solution() {\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tSolution s = new Solution();\r\n\t}",
"public static void main(String[] args) {\n\t\tSystem.out.println(solution());\r\n\t}",
"public static void main(String[] args) {\n\t\tSystem.out.println(solution(0));\n\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\n Solution2.solution();\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) 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) {\n int[] arr = {10, 2, 5, 1, 8, 12};\n System.out.println(solution(arr));\n }",
"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) {\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 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) \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\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) {\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)\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) {\n\t\tSystem.out.println(Arrays.toString(solution(8, 1)));\r\n\t}",
"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\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\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\t\tSolution s = new Solution();\n\t\ts.solution(2, 4, 2, 1);\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}",
"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\t\tint arr[] = {9,3,9,3,9,7,9};\n\t\tSolution(arr);\n\t}",
"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\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) 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 }",
"public static void main(String[] args) {\n\t\tint[] A = { 1, 3, 2, 5, 4, 6, 5, 7 };\r\n\t\tint X = 5;\r\n\t\tSystem.out.println(solution(X, A));\r\n\t}",
"public static void main(String[] args) {\n\t\tint nums[] = {0, 1, 0, 3, 12};\r\n\t\tsolution(nums);\r\n\t\tfor(int a:nums)\r\n\t\t\tSystem.out.println(a);\r\n\t}",
"public static void main(String[] args) {\n\t\tint A[]={1,3,1,4,2,3,5,4};\n\t\tint result=solution(5,A);\n\t\tSystem.out.println(result);\n\t}",
"public static void main(String[] args) {\n System.out.println(solution(5, new int[]{1, 3, 1, 4, 2, 3, 5, 4})); // 6\n }",
"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) {\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 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) {\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 String name = \"ABAAABB\";\n\n System.out.println(solution(name));\n }",
"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\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}",
"public static void main(String[] args) {\n\n\t\tint ar[] = { 7, 5, 4 };\n\n\t\tSystem.out.println(solution(ar));\n\n\t}",
"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\r\n\t\tSystem.out.println(solution(\"ACACACA\"));\r\n\t}",
"public static void main(String[] args) {\n\t\t\tint[] A = {1};\r\n\t\t\tSystem.out.println(solution(A, 6));\r\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}",
"private Solution() { }",
"private Solution() { }",
"public static void main(String[] args) {\n\t\tint[] arr= {6,9,5,7,4};\r\n\t\t//int[] arr= {3,9,9,3,5,7,2};\r\n\t\t//int[] arr= {1,5,3,6,7,6,5};\r\n\t\tint[] tmp=solution(arr);\r\n\t\tfor(int i=0;i<tmp.length;i++)\r\n\t\t\tSystem.out.print(tmp[i]+\" \");\r\n\t}",
"public static void main(String[] args) {\n\t\tlong n = 3;\n//\t\tlong n = 1;\n\t\tSystem.out.println(solution(n));\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\tint[] a=\t {3, 8, 9, 7, 6};\r\n\ta=solution(a, 8);\r\n\t}",
"public static void main(String[] args) {\n\t\tint[] arr = {5,5,3,3,3,2,5};\n\t\tint[] result = solution(arr);\n\t\tfor(int n : result) {\n\t\t\tSystem.out.print(n + \" \");\n\t\t}\n\t}",
"public static void main(String[] args) {\n System.out.println(solution(\"1 + 2\"));\n System.out.println(solution(\"1 * 2 + 3\"));\n System.out.println(solution(\"1 + 2 * 3\"));\n System.out.println(solution(\"1 + 2 * 3 - 4 / 2 + 6 / 2 - 7\"));\n\n System.out.println(solution(\"1 + 2 * (3 * (1 + 2))\"));\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 (String[] args)\n {\n\n int A[] ={ 1, 0, 8, 9, 20, 39};\n\n int res = solution2(A);\n\n\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\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\t\tSolution sol = new Solution();\n\t\tsol.test();\n\t}",
"Solution(){\n\n n = scanner.nextInt();\n scanner.skip(\"(\\r\\n|[\\n\\r\\u2028\\u2029\\u0085])?\");\n\n a = new int[n+1];\n\n \n for (int i = 1; i <= n; i++) {\n a[i] = scanner.nextInt();\n }\n Graph graph=new Graph(a);\n for(int i=0;i<n-1;i++) {\n \tint node1=scanner.nextInt();\n \tint node2=scanner.nextInt();\n \tgraph.addEdge(node1, node2);\n \t//System.out.println(node1+\" \"+node2);\n }\n //graph.dump();\n int q=scanner.nextInt();\n while(q-- > 0) {\n \tint u=scanner.nextInt();\n \tint d=scanner.nextInt();\n \tint k=scanner.nextInt();\n \t//System.out.println(\"u:\"+u+\" d:\"+d+\" k:\"+k);\n \tSystem.out.println(graph.DFS(u, d, k));\n }\n scanner.close();\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\tint[] stones = {2, 4, 5, 3, 2, 1, 4, 2, 5, 1};\n\t\tint k = 3;\n\t\tSystem.out.println(solution(stones, k));\n\t}",
"public static void main(String[] args) {\n \r\n Scanner sc = new Scanner(System.in);\r\n ArrayList<Integer> digits = new ArrayList<Integer>();\r\n System.out.println(\"Enter the input\");\r\n int n = sc.nextInt();\r\n for (int i=1;i<=n;i++) {\r\n int digit = sc.nextInt();\r\n digits.add(digit);\r\n }\r\n int b = sc.nextInt();\r\n int c = sc.nextInt();\r\n int res = solve(digits, b, c);\r\n\r\n\r\n }",
"public static void main(String[] args) {\n\n\t\tint [] scoville= {1,2,3,9,10};\n\t\tint [] scoville2= {3,1,5,7,2};\n\n\t\tSystem.out.println(solution(scoville,10));\n\t}",
"public static void main(String[] args) {\n\t\tSystem.out.println(solution(people, limit));\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}",
"public static void main(String[] args) {\n\t\tint[][] maps = \n\t\t\t{\n\t\t\t\t\t{1,0,1,1,1},\n\t\t\t\t\t{1,0,1,0,1},\n\t\t\t\t\t{1,0,1,1,1},\n\t\t\t\t\t{1,1,1,0,1},\n\t\t\t\t\t{0,0,0,0,1}\n\t\t\t};\n\t\tSystem.out.println(solution(maps));\n\t}",
"public static void main(String[] args){\n int[] nums = {10, 15, 3, 7};\n System.out.println(solution2(nums, 17));\n System.out.println(solution2(nums, 25));\n System.out.println(solution2(nums, 11));\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 static void main(String[] args) {\n int[] nums = {3,2,4};\n solution s = new solution();\n System.out.println(Arrays.toString(s.twoSum(nums,6)));\n }",
"public static void main(String[] args) {\n\t\tint [] a= {4,3,2,1};\r\n\t\tfor(int i:solution(a)) System.out.println(i);\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}",
"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 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\tint num = Solve(5);\n\t\tint num2 = Solve2(5);\n\t\tSystem.out.println(num);\n\t\tSystem.out.println(num2);\n\t}",
"public static void main(String[] args) {\n int input = 0;\n int armLength;\n int solution = 0;\n\n // get the puzzle input\n System.out.print(\"Please provide the puzzle input: \");\n input = new Scanner(System.in).nextInt();\n\n /// PART 1\n // figure out which spiral input is on to calculate distance on one axis\n armLength = SpiralUtils.lengthOfSprialArm(input);\n solution = (armLength - 1) / 2;\n\n // find the midpoints of the spiral the input is on\n List<Integer> midpoints = SpiralUtils.midpointsOfSprialArm(armLength);\n\n // calculate the smallest distance from any midpoint to our input for other access\n solution += SpiralUtils.smallestDistanceFromMidpoints(input, midpoints);\n\n System.out.println(\"The solution to part 1 is: \" + solution);\n\n /// PART 2\n // this part is less elegant, as I'm just going to create the spiral instead of run calculations\n System.out.println(\"The solution to part 2 is: \" + SpiralUtils.spiralUntilAtLeast(input));\n }",
"public static void main(String[] args) {\n Homework1 hw1 = new Homework1();\n\n System.out.println(\"===Problem 1===\");\n hw1.problem1();\n\n System.out.println(\"===Problem 2===\");\n System.out.println(hw1.topInt(1.5));\n System.out.println(hw1.topInt(5.1));\n System.out.println(hw1.topInt(1.0));\n System.out.println(hw1.topInt(-4.2));\n\n\n System.out.println(\"===Problem 3===\");\n hw1.draw4x4('-');\n hw1.draw4x4('4');\n\n System.out.println(\"===Problem 4===\");\n System.out.println(hw1.citationName(\"Alastair\", \"Reynolds\"));\n System.out.println(hw1.citationName(\"Grace\", \"Hopper\"));\n\n System.out.println(\"===Problem 5===\");\n System.out.println(String.valueOf(hw1.min3(1.0, 2.0, 3.0)));\n System.out.println(String.valueOf(hw1.min3(4.0, 3.0, 2.0)));\n System.out.println(String.valueOf(hw1.min3(0.5, 0.1, 0.5)));\n \n System.out.println(\"===Problem 6===\");\n System.out.println(hw1.fibonacci(0));\n System.out.println(hw1.fibonacci(1));\n System.out.println(hw1.fibonacci(2));\n System.out.println(hw1.fibonacci(3));\n System.out.println(hw1.fibonacci(10));\n System.out.println(hw1.fibonacci(25));\n \n \n System.out.println(\"===Problem 7===\");\n //System.out.println(hw1.isPalindrome(\"racecar\"));\n //System.out.println(hw1.isPalindrome(\"cat\"));\n //System.out.println(hw1.isPalindrome(\"hannah\"));\n //System.out.println(hw1.isPalindrome(\"saippuakivikauppias\"));\n }",
"public static void main(String[] args) {\n Last_coding_exercises.task17();\n\n\n }",
"public static void main(String[] args) {\n\n String test5 = \"abracadabra\";\n System.out.println(answer(test5));\n\n }",
"public static void main(String[] args) {\n\t\tSolution s = new Solution();\n\t\t//char[][] test = {{'O','O','O'},{'O','X','O'},{'O','O','O'}};\n\t\tchar[][] test = {{'X','O','X','X'},{'O','X','O','X'},{'X','O','X','O'},{'O','X','O','X'},{'X','O','X','O'}};\n\t\tfor(int i = 0;i < test.length;i++){\n\t\t\tfor(int j = 0;j < test[0].length;j++){\n\t\t\t\tSystem.out.print(test[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tSystem.out.println();\n\t\ts.solve(test);\n\t\tfor(int i = 0;i < test.length;i++){\n\t\t\tfor(int j = 0;j < test[0].length;j++){\n\t\t\t\tSystem.out.print(test[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"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}",
"public static void main(String[] args) throws IOException{\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tint n=Integer.parseInt(in.readLine());\n\t\tSystem.out.println((1<<n)-1);\n\t\tsolve(n,1,3);\n\t}",
"public static void main(String[] args) {\n\t\tsolve(new int[] {1, 2, 3, 4, 5});\t\t\n\t}",
"public static void main(String[] args) {\n\t\tScanner scan=new Scanner(System.in);\n\t\tSystem.out.print(\"Enter No. disks :\");\n\t\tint number=scan.nextInt();\n\t\tif(number<=0){\n\t\t\tSystem.out.println(\"Please Enter a Valid Number\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t\tint strSize=((int)Math.pow(2,number))-1;\n\t\tString str[]=new String[strSize];\n\t\tString result[]=new TowerOfHanoiSolution().getTOHSolution(number,\"A\",\"B\",\"C\",str);\n\t\tfor(int i=0;i<strSize;i++){\n\t\tSystem.out.println(result[i]);\n\t\t}\n\t\tscan.close();\n\t}",
"public static void main(String[] args) {\n\t\tSolution test = new Solution();\n\t\tSystem.out.println(test.isPalindrome(\"A man, a plan, a canal: Panama\"));\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tn = in.nextInt(); r = in.nextInt(); c = in.nextInt();\n\t\tint size = 1;\n\t\tfor (int i = 1; i <= n; i++) size *= 2;\n\t\tSystem.out.print(sol(0, 0, size));\n\t}",
"public static void main(String[] args) {\n int[] grades = {73,67,38,33};\n// for(int grades_i=0; grades_i < n; grades_i++){\n// grades[grades_i] = in.nextInt();\n// }\n int[] result = solve(grades);\n for (int i = 0; i < result.length; i++) {\n System.out.print(result[i] + (i != result.length - 1 ? \"\\n\" : \"\"));\n }\n System.out.println(\"\");\n \n\n }",
"private void generateSolution() {\n\t\t// TODO\n\n\t}",
"private Solution() {\n\n }",
"public static void main(String[] args) {\n\t\tSolution s = new Solution();\r\n\r\n\t\t\r\n\t\tBoolean result = s.isValid(\"()[]{p}\");\r\n\t\tSystem.out.println(result);\r\n\t\tSystem.out.println(\"done\");\r\n\t}",
"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) {\nAddNumbers a=new AddNumbers();\r\na.getInput();\r\na.addNumbers();\r\nint output=a.addNumbers();\r\nSystem.out.println(\"OUTPUT:\");\r\nSystem.out.println(\"The addition of n numbers is: \"+output);\r\n\t}",
"public static void main(String[] args) {\n\t\tSolution a = new Solution();\n\t\tint[] testCase = {1};//{2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,1,2};//{0,0,0,0,0,0,0,0,0,1,2,0,0};\n\t\tboolean result = a.search(testCase, 1);\n\t\tSystem.out.printf(\"ans = \"+result);\n\t}",
"public static void main(String[] args) {\n\t\tFactorialusingrecursion f=new Factorialusingrecursion();\n\t\tScanner input=new Scanner(System.in);\n\t\tSystem.out.println(\"enter the number to get the factorial:\");\n\t\tint a=input.nextInt();\n\t\tint ans=factorial(a);\n\t\tif(ans>=1){\n\t\tSystem.out.println(\"The factorial of\"+\" \"+a+\" \"+\"is\"+\" \"+ans);\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(\"please write correct number\");\n\t\t}\n\t\t\n\t\t\t\t\n\n\t}",
"public static void main(String[] args) throws NumberFormatException, IOException {\n\t\tsolve();\nBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\nStringBuilder sb=new StringBuilder();\nwhile(true){\n\tint K=Integer.parseInt(br.readLine());\n\tif(K==-1)break;\n\tsb.append(calculate[K]+\"\\n\");\n}\n\tSystem.out.println(sb);\n\t}",
"public static void main(String[] args) {\n\t\tsolve(8, 3);\r\n\t\tsolve(2, 4);\r\n\t\tsolve(3, 2);\r\n\t}",
"public static void main(String[] args) {\n\t\tString number = \"777777\";\n\t\tint k = 2;\n\t\t\n\t\t//solution(number, k, 0, \"\", 0);\n\t\tsol(number, k);\n\t\t\n\t}",
"private Solution() {\n }",
"public<P extends Problem, S extends Solution> S solve(P problem, Class<P> problemClass, Class<S> solutionClass);",
"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[]) {\n\t\tint cost[][] = { { 10, 1, 10, 1 }, { 1, 1, 1, 10 }, { 10, 1, 10, 1 }, { 1, 10, 1, 1 } };\n\n\t\tSystem.out.println(solution(cost));\n\t}",
"public static void main(String[] args) {\n\t\tScanner sc=new Scanner(System.in); \r\n\t\twhile(sc.hasNext()){\r\n\t\t\tint x=sc.nextInt();\r\n\t\t\tint y=sc.nextInt();\r\n\t\t\tint result=getResult(x,y);\r\n\t\t\tSystem.out.println(result);\r\n\t\t\t\r\n\t\t}\r\n\t}",
"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){\n challenges = new Challenge[]{new DayOne(), new DayTwo(), new DayThree(), new DayFour(), new DayFive(),\n new DaySix(), new DaySeven(), new DayEight(), new DayNine(), new DayTen(), new DayEleven(),\n new DayTwelve()};\n\n //Display user prompt to select challenge\n System.out.print(\"Which day would you like to solve? (1-12): \");\n Scanner scanner = new Scanner(System.in);\n\n //Attempt to run the selected challenge\n try {\n int challenge = scanner.nextInt();\n for(Challenge challengeInstance : challenges){\n if(challengeInstance.getDay() != challenge) continue;\n System.out.println();\n long start = System.currentTimeMillis();\n System.out.println(\"Part One: \" + challengeInstance.puzzleOne() + \" (took \" + (System.currentTimeMillis() - start) + \" ms).\");\n start = System.currentTimeMillis();\n System.out.println(\"Part Two: \" + challengeInstance.puzzleTwo() + \" (took \" + (System.currentTimeMillis() - start) + \" ms).\");\n return;\n }\n }catch(InputMismatchException ex){\n System.out.println(\"Number expected, aborting...\");\n return;\n }\n\n //If the challenge cannot be found, restart the program\n System.out.println(\"Challenge not found!\");\n System.out.println();\n\n main(new String[]{});\n }",
"public static void main(String[] args) {\n Solution app = new Solution();\n System.out.println(app.getPermutation(4, 5));\n }"
] | [
"0.76107115",
"0.7437779",
"0.736473",
"0.72855985",
"0.728182",
"0.7255596",
"0.7251086",
"0.72446245",
"0.71559066",
"0.7130934",
"0.71126676",
"0.70887375",
"0.7066973",
"0.6986178",
"0.6970083",
"0.6963553",
"0.6960707",
"0.68993396",
"0.68583995",
"0.68519676",
"0.68457896",
"0.684474",
"0.68069535",
"0.6783305",
"0.6772373",
"0.67519176",
"0.67474353",
"0.6734882",
"0.6711612",
"0.66545266",
"0.6649291",
"0.6628427",
"0.66261816",
"0.66257757",
"0.6616358",
"0.6591985",
"0.6584426",
"0.6581271",
"0.6579302",
"0.6572456",
"0.6568535",
"0.65657747",
"0.65641546",
"0.6554844",
"0.6554844",
"0.65525305",
"0.654486",
"0.65397483",
"0.65392023",
"0.65107447",
"0.64891016",
"0.6480335",
"0.646816",
"0.64677817",
"0.6457041",
"0.6426652",
"0.64081",
"0.64062196",
"0.64022106",
"0.63996047",
"0.6397527",
"0.6392968",
"0.6380232",
"0.6373042",
"0.6371114",
"0.63578266",
"0.63557607",
"0.6350797",
"0.6335258",
"0.6319507",
"0.6319355",
"0.6313009",
"0.6309202",
"0.63067377",
"0.63059306",
"0.63047075",
"0.6302842",
"0.6285001",
"0.6282711",
"0.6281999",
"0.6279756",
"0.62775165",
"0.6265189",
"0.6262168",
"0.6253528",
"0.6248066",
"0.6248062",
"0.6244973",
"0.62449723",
"0.624457",
"0.62411094",
"0.6240714",
"0.624023",
"0.6229235",
"0.62215793",
"0.6211629",
"0.62080204",
"0.620229",
"0.61997014",
"0.6199315",
"0.6197179"
] | 0.0 | -1 |
Helper Functions Precondition: key != null && key != "" | private Node<Value> get(Node<Value> x, String key, int d)
{
if (x == null) return null;
char c = key.charAt(d);
if (c > x.c) return get(x.right, key, d);
else if (c < x.c) return get(x.left, key, d);
else if (d < key.length()-1) return get(x.mid, key, d+1);
else return x;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static void checkForNullKey(String key) {\n if ( key == null ) {\n throw new NullPointerException();\n }\n }",
"private String check_Key(String key) throws JsonException {\r\n\t\tif (key == null || key.isEmpty()) {\r\n\t\t\tthrow new JsonException(\"The key must not null, or empty\");\r\n\t\t}\r\n\r\n\t\treturn key;\r\n\t}",
"private void throwIfNullKey(final K key) {\n if (key == null) {\n throw new IllegalArgumentException(\"null keys are not supported\");\n }\n }",
"protected boolean addNonEmpty(final String key, final String value) {\n if (isEmptyString(value)) {\n final String format = \"Parameter '%s' is required and may not be null or empty!\";\n throw new IllegalArgumentException(String.format(format, key));\n }\n return addParameterValue(key, value);\n }",
"Boolean isBlankOrNull(String key)\n {\n return StringUtils.isBlank(properties.getProperty(key));\n }",
"private String getString(String key) {\n return key;\r\n }",
"abstract protected boolean validateKey(String key);",
"private V isertNullKey(K key, V value) {\n return value;\n }",
"private void checkStringKey(Key key) {\n m_logger.debug(\"checkByteArrKey start key:\" + key.toString());\n if(m_cache != null){\n \tm_logger.debug(\"Cache HashCode:\" + m_cache.hashCode());\n }\n if (m_checked){\n m_logger.debug(\"checkByteArrKey end.\");\n \treturn;\n }\n if (key instanceof String) {\n if (!(m_cache instanceof StringMap)) {\n \tm_logger.debug(\"Cache HashCode:\" + m_cache.hashCode());\n throw new RuntimeException(\"Wrong map/set for String key\");\n }\n }\n m_checked = true;\n m_logger.debug(\"checkByteArrKey end.\");\n }",
"private boolean validate(String key) {\n \t\t\t for (int i = 0; i < ignoreKeys.length; i ++) {\n \t\t\t\t String test = key.trim();\n \t\t\t\t if(test.equalsIgnoreCase(ignoreKeys[i])) return false;\n \t\t\t }\n \t\t\t return true;\n \t\t }",
"boolean containsKey(Object key) throws NullPointerException;",
"@Override\n\t\t\tpublic String get(String key) {\n\t\t\t\treturn null;\n\t\t\t}",
"Object get(Object key) throws NullPointerException;",
"String getString(String key);",
"private void check(List<K> key) {\n if (key == null || key.isEmpty()) {\n throw new IllegalArgumentException(\"key must be a list of size >= 1\");\n }\n }",
"protected final String getString(final String key) {\n try {\n if (!jo.isNull(key)) {\n return jo.getString(key);\n }\n } catch (JSONException e) {\n } catch (ArrayIndexOutOfBoundsException e) {\n }\n return null;\n }",
"public String getMandatoryString(String key) throws ConfigNotFoundException;",
"public final String nullSafeGetString(final JSONObject data, final String key) {\n if ( data.get(key) != null ) {\n return data.get(key).toString();\n } else {\n return \"null\";\n }\n }",
"protected String getNavArgStr(String key){\r\n if(mNavArgs != null && mNavArgs.containsKey(key)){\r\n return (String)mNavArgs.get(key);\r\n }\r\n return null;\r\n }",
"public String getString(String key);",
"java.lang.String getFieldOrThrow(\n java.lang.String key);",
"public String getString(String key) {\r\n String value = (String) keyvaluepairs.get(key.toLowerCase());\r\n return value == null ? \"\" : value;\r\n }",
"private String isKeyAlreadyFormed(String Key){\n\t\tfor(String key : userData.keySet()){\n\t\t\tif(key.startsWith(Key)){\n\t\t\t\treturn key;\n\t\t\t}\n\t\t}\n\t\treturn \"\";\n\t}",
"private boolean containsKeyHelper(Node n, K key) {\n // base case\n if (n == null) {\n return false;\n }\n\n int compareResult = key.compareTo(n.key);\n if (compareResult == 0) {\n return true;\n } else if (compareResult < 0) {\n return containsKeyHelper(n.leftChild, key);\n } else {\n return containsKeyHelper(n.rightChild, key);\n }\n }",
"private static void isValid(Map<String, Set<String>> propertiesGroupedBy, String key) {\n stringPredicate = s -> {\n final String property = PropertiesUtil.getInstance().getProperty(s);\n return (property == null || property.isEmpty());\n };\n\n //but you can write more predicates as per your needs\n\n\n final Optional<String> optional = propertiesGroupedBy.get(key).stream().filter(stringPredicate).findFirst();\n\n if (optional.isPresent()) {\n try {\n throw new Exception(optional.get() + \" value is null or empty \");\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }",
"java.lang.String getAttributesOrThrow(java.lang.String key);",
"final String get(String key) {\n return get(key,null);\n }",
"public void setKey(String key) {\n this.key = key == null ? null : key.trim();\n }",
"public void setKey(String key) {\n this.key = key == null ? null : key.trim();\n }",
"private boolean isPresent(JSONObject object, String key) {\n\n\t\treturn !(object.isNull(key));\n\n\t}",
"private String getValueFromRequest(String key, HttpServletRequest request) {\n if (!StringUtils.isEmpty(key) && null != request) {\n return request.getParameter(key);\n }\n return null;\n }",
"private static boolean validateString(Map.Entry<String, CheckState> entry) {\n String prop = System.getProperty(entry.getKey());\n if (entry.getValue().isOptional && prop == null) {\n return true;\n }\n return prop != null && !\"\".equals(prop);\n }",
"protected boolean shouldAddProperty(String key) {\n return !key.equals(\"label\") && !key.equals(\"id\");\n }",
"public boolean isValidKey(String key) throws Exception;",
"private String keyAsString(Map map, String key) {\n Object value = map.get(key);\n return (value != null) ? value.toString() : null;\n }",
"@SuppressWarnings(\"rawtypes\")\n private boolean containsNoValidValueFor(final Dictionary properties,\n final String propertyKey) {\n final Object propertyValue = properties.get(propertyKey);\n return !(propertyValue instanceof String) || StringUtils.isEmpty((String) propertyValue);\n }",
"default String normalizeKey(String key) {\r\n\t\treturn key.intern();\r\n\t}",
"private String validateAndGetLowerCaseKey(String key) {\n Strings.requireNonNullAndNotEmpty(key);\n return key.toLowerCase(Locale.ROOT);\n }",
"public boolean isSmartKey(String key);",
"String getString( String key, String def);",
"public boolean contains(String key)\r\n { return get(key) != null; }",
"String getString(String key) throws KeyValueStoreException;",
"public static String getQueryString(String key) {\n String value = Http.Context.current().request().getQueryString(key);\n if (value != null) {\n value = value.trim();\n }\n return value;\n }",
"@Override\n\t\t\tpublic boolean contains(String key) {\n\t\t\t\treturn false;\n\t\t\t}",
"@Override\n protected void onNullNonKeyAttribute(String attributeName) {\n /* When doing a force put, we can safely ignore the null-valued attributes. */\n return;\n }",
"@Override\n public Object getValue(String key) {\n return null;\n }",
"protected void checkKey(Object key) {\n\tif (!canContainKey(key)) {\n throw new IllegalArgumentException(\n \"key is not valid for this LeaseMap\");\n }\n }",
"public boolean hasKey() {\n return keyBuilder_ != null || key_ != null;\n }",
"private int validateKey (int key) {\n return (key < 0 || key > ALPHABET_LENGTH-1) ? 0 : key;\n }",
"private String getRequiredProperty(Properties props, String key) {\r\n\t\tString value = props.getProperty(key);\r\n\t\tif ((value == null) || (value.trim().length() == 0)) {\r\n\t\t\tthrow new IllegalArgumentException(\r\n\t\t\t\t\t\"Property file must provide a value for '\" + key + \"'\");\r\n\t\t}\r\n\t\treturn value;\r\n\t}",
"private NoValue(K key) {\n this.key = key;\n }",
"@Test\n\tpublic void equalsNullItemType() {\n\t\tProductScanImageURIKey key1 = this.getDefaultKey();\n\t\tProductScanImageURIKey key2 = this.getDefaultKey();\n\t\tkey1.setId(LONG_ZERO);\n\t\tboolean equals = key1.equals(key2);\n\t\tAssert.assertFalse(equals);\n\t}",
"@Override\r\n\tpublic boolean containsKey(Object key) {\r\n\t\tif (key == null) throw new NullPointerException();\r\n\t\treturn get(key) != null;\r\n\t}",
"boolean hasKey(String key);",
"String getString(String key, String defaultValue);",
"String getString(String key, String defaultValue);",
"boolean hasKey();",
"boolean hasKey();",
"boolean hasKey();",
"boolean hasKey();",
"boolean hasKey();",
"public boolean containsKey(final String key) {\n return key != null && _properties.containsKey(key);\n }",
"@Override\n\tpublic boolean containsKey(Object arg0) {\n\t\treturn false;\n\t}",
"public boolean containsKey(String key) {\n \treturn (getNode(key) != null);\n }",
"public String checkKey() {\n for (int i = 0; i < keys.length; i++) {\n if (!this.keys[i].isValid()) {\n return \"Invalid Key found in Grid. Key Position is \" + i\n + \" Key is: \" + keys[i].getOrigStr();\n }\n }\n return null;\n }",
"@Override\n public synchronized Object get(Object key) {\n if ((System.currentTimeMillis() - this.lastCheck) > this.CACHE_TIME) {\n update();\n }\n String strkey = key.toString();\n if (this.ignoreCase) {\n strkey = this.keyMap.getProperty(strkey.toLowerCase());\n if (strkey == null)\n return null;\n }\n return super.get(strkey);\n }",
"@Override\n\t\t\tpublic boolean containsKey(Object key) {\n\t\t\t\treturn false;\n\t\t\t}",
"public static final String safeGetOptionalString(JsonNode objectNode, String key) throws RuntimeException {\n\t\t// optionalValue can be null\n\t\treturn safeGetOptionalString(objectNode, key, null);\n\t}",
"@Override\n\tpublic boolean containsKey(Object key) {\n\t\tString uKey = key.toString().toUpperCase();\n\t\treturn super.containsKey(uKey);\n\t}",
"public boolean contains(String key){\r\n\t\treturn get(key) != null;\r\n\t}",
"public boolean assertNotNullKeys(Map<String, String> viewparams, String...keys) {\n\t\tif (viewparams == null || keys == null) return false;\n\t\tfor(String k : keys) {\n\t\t\tif (viewparams.get(k) == null) {\n\t\t\t\tthrow new IllegalArgumentException(\"proc-argument-exception :key[\"+ k + \"] is missing\");\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"protected TSTNode<E> getNode(String key, TSTNode<E> startNode) {\n if(key == null || startNode == null || key.length() == 0) return null;\n TSTNode<E> currentNode = startNode;\n int charIndex = 0;\n \n while(true) {\n if (currentNode == null) return null;\n int charComp = compareCharsAlphabetically(key.charAt(charIndex), currentNode.splitchar);\n \n if (charComp == 0) {\n charIndex++;\n if(charIndex == key.length()) return currentNode;\n currentNode = currentNode.relatives[TSTNode.EQKID];\n } else if(charComp < 0) {\n currentNode = currentNode.relatives[TSTNode.LOKID];\n } else { \n // charComp must be greater than zero\n currentNode = (TSTNode<E>)currentNode.relatives[TSTNode.HIKID];\n }\n }\n }",
"java.lang.String getDetailsOrThrow(\n java.lang.String key);",
"java.lang.String getDetailsOrThrow(\n java.lang.String key);",
"private boolean hasValue (String s) { return s != null && s.length() != 0; }",
"@Override\n\tpublic Boolean getAsBoolean(final String key)\n\t{\n\t\tif (!containsKey(key))\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\treturn getBoolean(key);\n\t\t}\n\t\tcatch (StringValueConversionException ignored)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t}",
"private boolean hasAttributeKey(String xryLine) {\n int attributeKeyIndex = xryLine.indexOf(KEY_VALUE_DELIMITER);\n //No key structure found.\n if (attributeKeyIndex == -1) {\n return false;\n }\n\n String normalizedDataKey = xryLine.substring(0,\n attributeKeyIndex).trim().toLowerCase();\n return normalizedDataKey.equals(ATTRIBUTE_KEY);\n }",
"@Override\n public boolean containsKey(Object key) {\n String fieldName = key.toString();\n ScriptDocValues<?> scriptValues = localCacheFieldData.get(fieldName);\n if (scriptValues == null) {\n MappedFieldType fieldType = mapperService.fieldType(fieldName);\n if (fieldType == null) {\n return false;\n }\n }\n return true;\n }",
"protected String in(String sql, String key){\n boolean isNeedDynamic = this.isNeedDynamic(key);\n if (isNeedDynamic) {\n LogUtils.debug(\"{} is equals to set default value, be delete\", key);\n return \" ( 1 = 1 or '1' = ?) \";\n }\n return sql;\n }",
"protected String getKey( String key, String prefix ){\n //sanity check\n if( !key.startsWith( prefix ) )\n return null;\n\n //if the key and prefix are same length\n if( key.length() == prefix.length() ){\n return this.TYPE_KEY;\n }\n\n //if prefix does not end in a dot add a dot\n if ( prefix.charAt(prefix.length()-1) != '.' ) {\n prefix = prefix + '.';\n }\n\n //for a valid subsetting operation there should be . at prefix.length() - 1\n //allows us to distinguish between lrc1.url and lrc1a.url for prefix\n //lrc1\n return ( key.charAt( prefix.length() - 1) != '.' )?\n null:\n key.substring( prefix.length() );\n }",
"public boolean hasKey() {\n return key_ != null;\n }",
"@Override\n\tpublic boolean containsKey(Object key) {\n\t\treturn false;\n\t}",
"public boolean definesKey( final String key ) {\n return values.containsKey( key );\n }",
"boolean isTypeKey(String key);",
"private void ensureValidKeyNames() {\n assertThat(Iterables.any(graphiteMockServer.content, containsPattern(\"\\\\.\\\\.\")), is(false));\n assertThat(Iterables.any(graphiteMockServer.content, containsPattern(\"\\\\[\")), is(false));\n assertThat(Iterables.any(graphiteMockServer.content, containsPattern(\"\\\\]\")), is(false));\n assertThat(Iterables.any(graphiteMockServer.content, containsPattern(\"\\\\(\")), is(false));\n assertThat(Iterables.any(graphiteMockServer.content, containsPattern(\"\\\\)\")), is(false));\n }",
"private <Key, Value> Value get(Node x, Key key) {\n return null;\n }",
"@SuppressWarnings(\"unused\")\n private static String getKeyString(Key key)\n {\n return Base64.encode(key.getEncoded());\n }",
"protected abstract Object _get(String key);",
"public boolean checkKeyExistance(Node target, String key){\n\t\tElement child = (Element) target;\n\t\tString result = child.getAttribute(key);\n\t\tif(result.equals(\"\")) return false; //return if no key exists\n\t\treturn true;\n\t}",
"@Override\r\n public K lowerKey(final K key) {\n return null;\r\n }",
"@Test\n\tpublic void removeMyKeyNullName() {\n\t\tRsaKeyStore ks = new RsaKeyStore();\n\t\tks.createNewMyKeyPair(\"first\");\n\t\tks.createNewMyKeyPair(\"second\");\n\t\tks.removeMyKey(null);\n\t\tSet<String> names = ks.getMyKeyNames();\n\t\tassertTrue(\"wrong number of keys\", names.size() == 2);\n\t\tassertTrue(\"should contain key\", names.contains(\"first\"));\n\t\tassertTrue(\"should contain key\", names.contains(\"second\"));\n\t\tassertFalse(\"should not contain key\", names.contains(null));\n\t}",
"public boolean hasKeyComponents(){\n\n // Event is valid if it has an event name date\n if(event == null || date == 0 || startTime == null || endTime == null){\n return false;\n }\n return true;\n }",
"private static String addToKey(String key, String addendum) {\n String ret = key;\n\n if (ret == null) {\n ret = \"\";\n }\n\n if (!ret.equals(\"\")) {\n ret += \".\";\n }\n\n ret += addendum;\n\n return ret;\n }",
"private boolean hasDataKey(String xryLine) {\n int dataKeyIndex = xryLine.indexOf(KEY_VALUE_DELIMITER);\n //No key structure found.\n if (dataKeyIndex == -1) {\n return false;\n }\n\n String normalizedDataKey = xryLine.substring(0,\n dataKeyIndex).trim().toLowerCase();\n return normalizedDataKey.equals(DATA_KEY);\n }",
"public boolean contains(String key) {\r\n\t\treturn getValue(key) != null;\r\n\t}",
"@Override\n public boolean contains(String key) {\n if (key == null) {\n throw new IllegalArgumentException(\"argument to contains() is null\");\n }\n return get(root, key, 0) != null;\n }",
"public boolean containsKey(String s){\r\n return this.get(s) != 0;\r\n }",
"protected final Object get(final String key) {\n try {\n if (!jo.isNull(key)) {\n return jo.get(key);\n }\n } catch (JSONException e) {\n }\n return null;\n }",
"private boolean hasValue(final String name, final String key) {\n\t\treturn bundleConstants.containsKey(name + SEPERATOR + key);\n\t}",
"NOT_OK(@JsonProperty String key) { this.key = key; }",
"public Value get(String key)\r\n {\r\n if (key.equals(\"\")) return null_str_val;\r\n Node<Value> x = get(root, key, 0);\r\n return x == null ? null : x.val;\r\n }"
] | [
"0.7598582",
"0.75716215",
"0.6881133",
"0.6611883",
"0.6591505",
"0.6449791",
"0.64208263",
"0.6420309",
"0.62972987",
"0.6284959",
"0.6264142",
"0.62248284",
"0.62131864",
"0.6081056",
"0.60765004",
"0.60397255",
"0.6028602",
"0.6010227",
"0.59617376",
"0.5885728",
"0.58678913",
"0.586575",
"0.5858363",
"0.5852546",
"0.5842271",
"0.57940006",
"0.5782704",
"0.5776414",
"0.5776414",
"0.5773277",
"0.57561904",
"0.57557696",
"0.5738874",
"0.57372135",
"0.5734404",
"0.57251173",
"0.5695768",
"0.5695496",
"0.56900066",
"0.5688271",
"0.56818986",
"0.566236",
"0.5654711",
"0.5634411",
"0.5625899",
"0.56106925",
"0.55817616",
"0.5566609",
"0.55610865",
"0.55306435",
"0.55173343",
"0.55105186",
"0.5505001",
"0.5482106",
"0.5460875",
"0.5460875",
"0.5459603",
"0.5459603",
"0.5459603",
"0.5459603",
"0.5459603",
"0.54446226",
"0.5432515",
"0.542002",
"0.54184973",
"0.5410148",
"0.539715",
"0.5395155",
"0.53931373",
"0.5392497",
"0.53906953",
"0.5390122",
"0.53816664",
"0.53816664",
"0.53681046",
"0.53667057",
"0.53560436",
"0.53518707",
"0.53518254",
"0.5349675",
"0.5339519",
"0.5333435",
"0.5331033",
"0.53287846",
"0.53287274",
"0.53242093",
"0.5317047",
"0.5316183",
"0.5315503",
"0.530785",
"0.53021127",
"0.5296638",
"0.528235",
"0.52784175",
"0.52703935",
"0.52695817",
"0.5267228",
"0.5264763",
"0.52604806",
"0.5258235",
"0.52577543"
] | 0.0 | -1 |
Precondition: key != null && key != "" | private Node<Value> put(Node<Value> x, String key, Value val, int d)
{
char c = key.charAt(d);
if (x == null) { x = new Node<Value>(); x.c = c; }
if (c > x.c) x.right = put(x.right, key, val, d);
else if (c < x.c) x.left = put(x.left, key, val, d);
else if (d < key.length()-1) x.mid = put(x.mid, key, val, d+1);
else if (x.val != null) x.val = val;
else { x.val = val; ++N; }
return x;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static void checkForNullKey(String key) {\n if ( key == null ) {\n throw new NullPointerException();\n }\n }",
"private String check_Key(String key) throws JsonException {\r\n\t\tif (key == null || key.isEmpty()) {\r\n\t\t\tthrow new JsonException(\"The key must not null, or empty\");\r\n\t\t}\r\n\r\n\t\treturn key;\r\n\t}",
"private void throwIfNullKey(final K key) {\n if (key == null) {\n throw new IllegalArgumentException(\"null keys are not supported\");\n }\n }",
"protected boolean addNonEmpty(final String key, final String value) {\n if (isEmptyString(value)) {\n final String format = \"Parameter '%s' is required and may not be null or empty!\";\n throw new IllegalArgumentException(String.format(format, key));\n }\n return addParameterValue(key, value);\n }",
"abstract protected boolean validateKey(String key);",
"boolean containsKey(Object key) throws NullPointerException;",
"Boolean isBlankOrNull(String key)\n {\n return StringUtils.isBlank(properties.getProperty(key));\n }",
"private void check(List<K> key) {\n if (key == null || key.isEmpty()) {\n throw new IllegalArgumentException(\"key must be a list of size >= 1\");\n }\n }",
"public void setKey(String key) {\n this.key = key == null ? null : key.trim();\n }",
"public void setKey(String key) {\n this.key = key == null ? null : key.trim();\n }",
"Object get(Object key) throws NullPointerException;",
"@Override\n\t\t\tpublic String get(String key) {\n\t\t\t\treturn null;\n\t\t\t}",
"private V isertNullKey(K key, V value) {\n return value;\n }",
"private boolean validate(String key) {\n \t\t\t for (int i = 0; i < ignoreKeys.length; i ++) {\n \t\t\t\t String test = key.trim();\n \t\t\t\t if(test.equalsIgnoreCase(ignoreKeys[i])) return false;\n \t\t\t }\n \t\t\t return true;\n \t\t }",
"private String getString(String key) {\n return key;\r\n }",
"private void checkStringKey(Key key) {\n m_logger.debug(\"checkByteArrKey start key:\" + key.toString());\n if(m_cache != null){\n \tm_logger.debug(\"Cache HashCode:\" + m_cache.hashCode());\n }\n if (m_checked){\n m_logger.debug(\"checkByteArrKey end.\");\n \treturn;\n }\n if (key instanceof String) {\n if (!(m_cache instanceof StringMap)) {\n \tm_logger.debug(\"Cache HashCode:\" + m_cache.hashCode());\n throw new RuntimeException(\"Wrong map/set for String key\");\n }\n }\n m_checked = true;\n m_logger.debug(\"checkByteArrKey end.\");\n }",
"@Override\n protected void onNullNonKeyAttribute(String attributeName) {\n /* When doing a force put, we can safely ignore the null-valued attributes. */\n return;\n }",
"public boolean isValidKey(String key) throws Exception;",
"private NoValue(K key) {\n this.key = key;\n }",
"java.lang.String getFieldOrThrow(\n java.lang.String key);",
"protected void checkKey(Object key) {\n\tif (!canContainKey(key)) {\n throw new IllegalArgumentException(\n \"key is not valid for this LeaseMap\");\n }\n }",
"String getString(String key);",
"public String getMandatoryString(String key) throws ConfigNotFoundException;",
"@Override\n public Object getValue(String key) {\n return null;\n }",
"java.lang.String getAttributesOrThrow(java.lang.String key);",
"@Override\n\t\t\tpublic boolean contains(String key) {\n\t\t\t\treturn false;\n\t\t\t}",
"NOT_OK(@JsonProperty String key) { this.key = key; }",
"protected boolean shouldAddProperty(String key) {\n return !key.equals(\"label\") && !key.equals(\"id\");\n }",
"public String getString(String key);",
"protected final String getString(final String key) {\n try {\n if (!jo.isNull(key)) {\n return jo.getString(key);\n }\n } catch (JSONException e) {\n } catch (ArrayIndexOutOfBoundsException e) {\n }\n return null;\n }",
"public void delete(String key)\r\n {\r\n if (key.equals(\"\")) {\r\n if (null_str_val != null) --N;\r\n null_str_val = null;\r\n return;\r\n }\r\n root = delete(root, key, 0);\r\n }",
"public boolean hasKey() {\n return keyBuilder_ != null || key_ != null;\n }",
"private int validateKey (int key) {\n return (key < 0 || key > ALPHABET_LENGTH-1) ? 0 : key;\n }",
"public Vigenere(CharSequence key)\n\t{\n\t\tthis.key = sanitizeValue(key);\n\t}",
"@Override\r\n\tpublic boolean containsKey(Object key) {\r\n\t\tif (key == null) throw new NullPointerException();\r\n\t\treturn get(key) != null;\r\n\t}",
"private static void isValid(Map<String, Set<String>> propertiesGroupedBy, String key) {\n stringPredicate = s -> {\n final String property = PropertiesUtil.getInstance().getProperty(s);\n return (property == null || property.isEmpty());\n };\n\n //but you can write more predicates as per your needs\n\n\n final Optional<String> optional = propertiesGroupedBy.get(key).stream().filter(stringPredicate).findFirst();\n\n if (optional.isPresent()) {\n try {\n throw new Exception(optional.get() + \" value is null or empty \");\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }",
"public boolean isSmartKey(String key);",
"private String validateAndGetLowerCaseKey(String key) {\n Strings.requireNonNullAndNotEmpty(key);\n return key.toLowerCase(Locale.ROOT);\n }",
"@NotNull\n @JsonProperty(\"key\")\n public String getKey();",
"String getString(String key) throws KeyValueStoreException;",
"protected String getNavArgStr(String key){\r\n if(mNavArgs != null && mNavArgs.containsKey(key)){\r\n return (String)mNavArgs.get(key);\r\n }\r\n return null;\r\n }",
"Object remove(Object key) throws NullPointerException;",
"public boolean contains(String key)\r\n { return get(key) != null; }",
"private boolean isPresent(JSONObject object, String key) {\n\n\t\treturn !(object.isNull(key));\n\n\t}",
"@Override\n\tpublic boolean containsKey(Object arg0) {\n\t\treturn false;\n\t}",
"boolean hasKey(String key);",
"@SuppressWarnings(\"rawtypes\")\n private boolean containsNoValidValueFor(final Dictionary properties,\n final String propertyKey) {\n final Object propertyValue = properties.get(propertyKey);\n return !(propertyValue instanceof String) || StringUtils.isEmpty((String) propertyValue);\n }",
"NOT_OK2(@JsonProperty String key) { this.key = key; }",
"Object put(Object key, Object value) throws NullPointerException;",
"private String getValueFromRequest(String key, HttpServletRequest request) {\n if (!StringUtils.isEmpty(key) && null != request) {\n return request.getParameter(key);\n }\n return null;\n }",
"@Test\n public void test001_IllegalNullKey() {\n try {\n HashTableADT htIntegerKey = new HashTable<Integer, String>();\n htIntegerKey.insert(null, null);\n fail(\"should not be able to insert null key\");\n } catch (IllegalNullKeyException e) {\n /* expected */ } catch (Exception e) {\n fail(\"insert null key should not throw exception \" + e.getClass().getName());\n }\n }",
"private boolean containsKeyHelper(Node n, K key) {\n // base case\n if (n == null) {\n return false;\n }\n\n int compareResult = key.compareTo(n.key);\n if (compareResult == 0) {\n return true;\n } else if (compareResult < 0) {\n return containsKeyHelper(n.leftChild, key);\n } else {\n return containsKeyHelper(n.rightChild, key);\n }\n }",
"public boolean hasKey() {\n return key_ != null;\n }",
"default String normalizeKey(String key) {\r\n\t\treturn key.intern();\r\n\t}",
"private String isKeyAlreadyFormed(String Key){\n\t\tfor(String key : userData.keySet()){\n\t\t\tif(key.startsWith(Key)){\n\t\t\t\treturn key;\n\t\t\t}\n\t\t}\n\t\treturn \"\";\n\t}",
"@Override\n\t\t\tpublic boolean containsKey(Object key) {\n\t\t\t\treturn false;\n\t\t\t}",
"public boolean containsKey(final String key) {\n return key != null && _properties.containsKey(key);\n }",
"@Override\n public boolean contains(String key) {\n if (key == null) {\n throw new IllegalArgumentException(\"argument to contains() is null\");\n }\n return get(root, key, 0) != null;\n }",
"private void setKey(String key){\n\t\tthis.key=key;\n\t}",
"@Override\r\n public K lowerKey(final K key) {\n return null;\r\n }",
"@Override\n public boolean containsKey(Object key) {\n String fieldName = key.toString();\n ScriptDocValues<?> scriptValues = localCacheFieldData.get(fieldName);\n if (scriptValues == null) {\n MappedFieldType fieldType = mapperService.fieldType(fieldName);\n if (fieldType == null) {\n return false;\n }\n }\n return true;\n }",
"public final String nullSafeGetString(final JSONObject data, final String key) {\n if ( data.get(key) != null ) {\n return data.get(key).toString();\n } else {\n return \"null\";\n }\n }",
"@Override\n\tpublic boolean containsKey(Object key) {\n\t\treturn false;\n\t}",
"@Ignore\n\t@Test\n\tpublic void testParamNull() {\n\t\tregisterParamException(null, keyString, valueString);\n\t\tregisterParamException(groupString, null, valueString);\n\t\tregisterParamException(groupString, keyString, null);\n\t}",
"public void testGetObjectSpecificationWithNullKey() throws Exception {\r\n root.addChild(createObject(\"key:identifier\", TYPE_OBJECT));\r\n\r\n specificationFactory = new ConfigurationObjectSpecificationFactory(root);\r\n\r\n try {\r\n specificationFactory.getObjectSpecification(null, \"identifier\");\r\n fail(\"IllegalArgumentException is expected.\");\r\n } catch (IllegalArgumentException e) {\r\n // ok\r\n }\r\n }",
"@Test\n\tpublic void equalsNullItemType() {\n\t\tProductScanImageURIKey key1 = this.getDefaultKey();\n\t\tProductScanImageURIKey key2 = this.getDefaultKey();\n\t\tkey1.setId(LONG_ZERO);\n\t\tboolean equals = key1.equals(key2);\n\t\tAssert.assertFalse(equals);\n\t}",
"public boolean assertNotNullKeys(Map<String, String> viewparams, String...keys) {\n\t\tif (viewparams == null || keys == null) return false;\n\t\tfor(String k : keys) {\n\t\t\tif (viewparams.get(k) == null) {\n\t\t\t\tthrow new IllegalArgumentException(\"proc-argument-exception :key[\"+ k + \"] is missing\");\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"public void privateSetPeopleKey(com.hps.july.persistence.PeopleKey inKey) {\n\tboolean people_NULLTEST = (inKey == null);\n\tif (people_NULLTEST) people_man = null; else people_man = (new Integer(inKey.man));\n}",
"@Test\n\tpublic void removeMyKeyNullName() {\n\t\tRsaKeyStore ks = new RsaKeyStore();\n\t\tks.createNewMyKeyPair(\"first\");\n\t\tks.createNewMyKeyPair(\"second\");\n\t\tks.removeMyKey(null);\n\t\tSet<String> names = ks.getMyKeyNames();\n\t\tassertTrue(\"wrong number of keys\", names.size() == 2);\n\t\tassertTrue(\"should contain key\", names.contains(\"first\"));\n\t\tassertTrue(\"should contain key\", names.contains(\"second\"));\n\t\tassertFalse(\"should not contain key\", names.contains(null));\n\t}",
"@Override\n public boolean contains(String key) {\n if (key == null || key.length() == 0 || root == null)\n return false;\n Node p = root;\n for (int i = 0; i < key.length(); i++) {\n char current = key.charAt(i);\n Node next = p.next.get(current);\n if (next == null) {\n return false;\n }\n p = next;\n }\n return p.isKey;\n }",
"@Override\n\tpublic String getKey() {\n\t\treturn null;\n\t}",
"void setKey(java.lang.String key);",
"public boolean isSetKey() {\n return this.key != null;\n }",
"final String get(String key) {\n return get(key,null);\n }",
"public static String getQueryString(String key) {\n String value = Http.Context.current().request().getQueryString(key);\n if (value != null) {\n value = value.trim();\n }\n return value;\n }",
"private void setKey(String key) {\n this.key = key;\n }",
"public boolean containsKey(String key) {\n \treturn (getNode(key) != null);\n }",
"boolean hasKey();",
"boolean hasKey();",
"boolean hasKey();",
"boolean hasKey();",
"boolean hasKey();",
"public String getString(String key) {\r\n String value = (String) keyvaluepairs.get(key.toLowerCase());\r\n return value == null ? \"\" : value;\r\n }",
"private DataKeys(String pKey) {\n key = pKey;\n }",
"@Override\r\n\tpublic String getKey() {\n\t\treturn null;\r\n\t}",
"@Override\r\n\tpublic String getKey() {\n\t\treturn null;\r\n\t}",
"public boolean contains(String key){\r\n\t\treturn get(key) != null;\r\n\t}",
"public IDataKey(String key) {\n this(key, false);\n }",
"public TypeFilterHonSearch(String key) {\r\n\t\temptyKey = StringUtils.isEmpty(key);\r\n\t\tif (emptyKey == false) {\r\n\t\t\tkey = key.trim().toLowerCase();\r\n\t\t\tif (key.length() > 0) {\r\n\t\t\t\tif (key.charAt(key.length() - 1) != '*') {\r\n\t\t\t\t\tkey += '*';\r\n\t\t\t\t}\r\n\t\t\t\tpattern = Pattern.compile(StringUtils.replace(key, \"*\", \".*\"));\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"boolean isTypeKey(String key);",
"void setKey(final String key);",
"@Implementation\n protected String getParameters(String keys) {\n return null;\n }",
"@Override\n\t\tpublic boolean hasProperty(String key) {\n\t\t\treturn false;\n\t\t}",
"public boolean containsKey(Key key) ;",
"boolean hasCompoundKey();",
"public boolean contains(String key) {\r\n\t\treturn getValue(key) != null;\r\n\t}",
"public boolean definesKey( final String key ) {\n return values.containsKey( key );\n }",
"@Override\n public Object getMetadata(String key) {\n return null;\n }",
"private void ensureValidKeyNames() {\n assertThat(Iterables.any(graphiteMockServer.content, containsPattern(\"\\\\.\\\\.\")), is(false));\n assertThat(Iterables.any(graphiteMockServer.content, containsPattern(\"\\\\[\")), is(false));\n assertThat(Iterables.any(graphiteMockServer.content, containsPattern(\"\\\\]\")), is(false));\n assertThat(Iterables.any(graphiteMockServer.content, containsPattern(\"\\\\(\")), is(false));\n assertThat(Iterables.any(graphiteMockServer.content, containsPattern(\"\\\\)\")), is(false));\n }",
"private String getRequiredProperty(Properties props, String key) {\r\n\t\tString value = props.getProperty(key);\r\n\t\tif ((value == null) || (value.trim().length() == 0)) {\r\n\t\t\tthrow new IllegalArgumentException(\r\n\t\t\t\t\t\"Property file must provide a value for '\" + key + \"'\");\r\n\t\t}\r\n\t\treturn value;\r\n\t}",
"public PSRelation(String keyName, String keyValue)\n {\n if (keyName == null || keyName.trim().length() == 0)\n throw new IllegalArgumentException(\"keyName may not be null or empty\");\n\n if (keyValue == null || keyValue.trim().length() == 0)\n throw new IllegalArgumentException(\"keyValue may not be null or empty\");\n\n if (keyValue == null)\n keyValue = \"\";\n\n addKey(keyName, keyValue);\n }"
] | [
"0.7615145",
"0.75807273",
"0.6963268",
"0.6902379",
"0.6643546",
"0.65328324",
"0.65277565",
"0.63992846",
"0.63428813",
"0.63428813",
"0.6283148",
"0.6204705",
"0.62029994",
"0.6118046",
"0.6114498",
"0.61126435",
"0.5992563",
"0.5940031",
"0.585199",
"0.5798326",
"0.57772714",
"0.57278174",
"0.5727712",
"0.5726116",
"0.57072353",
"0.57012856",
"0.5694587",
"0.56860703",
"0.56766087",
"0.5673384",
"0.56598526",
"0.56598276",
"0.56379366",
"0.56341904",
"0.5632578",
"0.56269956",
"0.56243426",
"0.56200254",
"0.5611826",
"0.5611592",
"0.56037706",
"0.5598596",
"0.559634",
"0.5583002",
"0.55829936",
"0.5577896",
"0.5564179",
"0.5560476",
"0.55594116",
"0.5549152",
"0.5545409",
"0.552671",
"0.55199575",
"0.5510325",
"0.5503018",
"0.5497754",
"0.5487292",
"0.5479936",
"0.54688907",
"0.5467112",
"0.5465355",
"0.5465114",
"0.54643977",
"0.5453621",
"0.5440858",
"0.54362154",
"0.5431089",
"0.54303837",
"0.54245347",
"0.5422391",
"0.54184395",
"0.5412255",
"0.5410172",
"0.54097563",
"0.5407102",
"0.5405969",
"0.53988016",
"0.5389073",
"0.5389073",
"0.5389073",
"0.5389073",
"0.5389073",
"0.53830385",
"0.53744876",
"0.53679705",
"0.53679705",
"0.5343422",
"0.5339409",
"0.53336155",
"0.5333385",
"0.5333212",
"0.5332911",
"0.5311587",
"0.5311373",
"0.53069216",
"0.5304928",
"0.53030026",
"0.53020585",
"0.52970964",
"0.5292405",
"0.5285665"
] | 0.0 | -1 |
returns the min node in the same level of node x Precondition: x != null | private Node<Value> min(Node<Value> x)
{
while (x.left != null) x = x.left;
return x;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private Node min(Node x) {\n if (x.left == null)\n return x;\n else\n return min(x.left);\n }",
"public Node<E> getMin(Node<E> x) {\n\t\tif (x.getLeftChild() != sentinel) {\n\t\t\treturn getMin(x.getLeftChild()); //Recurisvely go throughs the left side of the tree until a null node pops up\n\t\t} else {\n\n\t\t\treturn x; //x will be the node with the minimum value \n\t\t}\n\t}",
"public Node min() {\n\t\tNode x = root;\n\t\tif (x == null) return null;\n\t\twhile (x.getLeft() != null)\n\t\t\tx = x.getLeft();\n\t\treturn x;\n\t}",
"private Node min(Node node){\n if(node == null)\n return null;\n else if(node.left == null)\n return node;\n\n //walk left nodes\n return min(node.left);\n }",
"public static Node findMin(Node node){\n if(node.left!=null){\n return findMin(node.left); // recursive left-subtree จนตกเกือบ null แล้ว return node นั้น\n }\n else{\n return node;}\n }",
"private Node minNode(Node node) {\n Node updt = node;\n // Finding the leftmost leaf\n while (updt.left != null) {\n updt = updt.left;\n }\n return updt;\n }",
"Node minValueNode(Node node) \n { \n Node current = node; \n \n /* loop down to find the leftmost leaf */\n while (current.left != null) \n current = current.left; \n \n return current; \n }",
"private AvlNode<E> findMin(AvlNode<E> node){\n if(node.left == null){\n return node;\n } else {\n return findMin(node.left);\n }\n }",
"protected final IntervalNode treeMin() {\n\tIntervalNode x = this;\n\twhile(x.left != IntervalNode.nullIntervalNode) {\n\t x = x.left;\n\t}\n\treturn(x);\n }",
"private BinaryNode<AnyType> findMin( BinaryNode<AnyType> t )\r\n\t{\r\n\t\tif( t == null )\r\n\t\t\treturn null;\r\n\t\telse if( t.left == null )\r\n\t\t\treturn t;\r\n\t\treturn findMin( t.left );\r\n\t}",
"public static Object min(TreeNode t)\n {\n if(t==null)\n return null;\n if(t.getLeft() == null)\n return t.getValue();\n else\n return min(t.getLeft());\n \n }",
"private WAVLNode min(WAVLNode x) {\n\t while(x.left!=EXT_NODE) {\r\n \tx=x.left;\r\n }\r\n return x;\r\n }",
"public BSTMapNode findMin() \n\t{\n\t\t\n\t\t\n\t\treturn null;\n\t}",
"int nilaiMin(Node node){\n if (node.left != null) { // karena node yg nilainya minimum atau lebih kecil di sebelah kiri\n return nilaiMin(node.left);// maka jika != null akan me return node sebelah kiri\n }\n return node.data;\n }",
"public Node getMin() {\n return getMin(root);\n }",
"public Website treeMinimum(Website site) {\r\n\t\tWebsite localSite = site; // Local pointer to given Site\r\n\t\twhile (localSite.getLeft() != null&&localSite.getLeft().getPageRank()!=0) { // Traversing Loop, stops at null node\r\n\t\t\tlocalSite = localSite.getLeft(); // incrementation Condition\r\n\t\t}\r\n\t\treturn localSite; // Returns minimum\r\n\t}",
"public static Object min(TreeNode t)\n {\n if(t == null)\n return null;\n TreeNode p = t;\n while(p.getLeft() != null)\n p = p.getLeft();\n return t.getValue();\n }",
"public TreeNode<T> getMinElement(){\n TreeNode<T> t = this;\n while(t.left != null){\n t = t.left;\n }\n return t;\n }",
"private BinaryNode<AnyType> findMin(BinaryNode<AnyType> t) {\r\n\t\tif (t == null)\r\n\t\t\treturn null;\r\n\t\telse if (t.left == null)\r\n\t\t\treturn t;\r\n\t\treturn findMin(t.left);\r\n\t}",
"public AVLNode findMin() {\n\t\tif (this.empty()) {\n\t\t\treturn null;\n\t\t}\n\t\tAVLNode min = (AVLNode) this.root;\n\t\twhile (min.getLeft().getHeight() != -1) {\n\t\t\tmin = (AVLNode) min.getLeft();\n\t\t}\n\t\treturn min;\n\t}",
"protected BinaryNode<AnyType> findMin(BinaryNode<AnyType> t) {\n\t\tif (t != null)\n\t\t\twhile (t.left != null)\n\t\t\t\tt = t.left;\n\n\t\treturn t;\n\t}",
"Node minValueNode(Node Node) {\n Node current = Node;\n\n /* loop down to find the leftmost leaf */\n while (current.left != null) {\n current = current.left;\n }\n\n return current;\n }",
"private static Node min(Node root) {\n\t\tif(root.left == null) {\n\t\t\treturn root;\n\t\t}\n\t\treturn min(root.left);\n\t}",
"public TreeNode smallest() {\n\t\tif(root == null) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tTreeNode current = root; \n\t\t\twhile(current.getLeftChild() != null) {\n\t\t\t\tcurrent = current.getLeftChild();\n\t\t\t}\n\t\t\treturn current;\n\t\t}\n\t}",
"int minValue(Node node) {\r\n\t\tif (node == null) {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\tNode root = node;\r\n\t\twhile (root.left != null) {\r\n\t\t\troot = root.left;\r\n\t\t}\r\n\t\treturn root.data;\r\n\t}",
"public Node<T> extractMin() {\n Node<T> z = min;\n if (z != null) {\n if (z.child != null) {\n Node<T> leftChild = z.child.leftSibling;\n Node<T> rightChild = z.child;\n z.child.parent = null;\n while (leftChild != rightChild) {\n leftChild.parent = null;\n leftChild = leftChild.leftSibling;\n }\n leftChild = leftChild.rightSibling;\n\n // add child to the root list\n Node<T> tmp = z.rightSibling;\n z.rightSibling = leftChild;\n leftChild.leftSibling = z;\n tmp.leftSibling = rightChild;\n rightChild.rightSibling = tmp;\n }\n\n // remove z from the root list\n z.rightSibling.leftSibling = z.leftSibling;\n z.leftSibling.rightSibling = z.rightSibling;\n\n if (z == z.rightSibling) {\n min = null;\n } else {\n min = z.rightSibling;\n consolidate();\n }\n\n size--;\n }\n return z;\n }",
"public E findMin(){\n if(!isEmpty()){\n AvlNode<E> node = findMin(root);\n return (E)node.value;\n } else {\n return null;\n }\n }",
"private BSTNode<T> minimum(BSTNode node){\r\n\t\twhile(node.left != null) {\r\n\t\t\tnode = node.left;\r\n\t\t}\r\n\t\treturn node;\r\n\t}",
"private Node getLowestNode(Set<Node> openSet)\r\n {\r\n // find the node with the least f\r\n double minF = Double.MAX_VALUE;\r\n Node[] openArray = openSet.toArray(new Node[0]);\r\n\r\n Node q = null;\r\n for (int i = 0; i < openArray.length; ++i)\r\n {\r\n if (openArray[i].f < minF) \r\n {\r\n minF = openArray[i].f;\r\n q = openArray[i];\r\n }\r\n }\r\n return q;\r\n }",
"public TreeNode minElemNode(TreeNode node) throws Exception{\n\t\tif (node == null){\n\t\t\tthrow new Exception(\"Empty Node.\");\n\t\t}\t\t\n\t\tTreeNode cur = node;\n\t\twhile (cur.leftchild != null){cur = cur.leftchild;}\n\t\treturn cur;\n\t}",
"public E findMin() {\n Node<E> temp = root;\n // while loop will run until there is no longer a node that has a left child.\n // temp is then assigned to the next node in the left child and will return\n // the node with the minimum value in the BST. The node that does not have a left\n // child will be the minimum value.\n while(temp.left != null){\n temp = temp.left;\n }\n return temp.getInfo();\n }",
"private Node findMinimum(Node current)\r\n\t{\r\n\t\t// Current Node is the minimum\r\n\t\tif(current.getLeftChild() == null)\r\n\t\t{\r\n\t\t\treturn current;\r\n\t\t}\r\n\t\t// Current Node is not the minimum so keep traversing the left subtree of current Node\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn findMinimum(current.getLeftChild());\r\n\t\t}\r\n\t}",
"public static <E> E min(TreeNode<E> t) {\n if (null == t) return null;\n while (null != t.getLeft()) t = t.getLeft();\n return t.getValue();\n }",
"public AVLNode minValueNode(AVLNode node) {\n AVLNode current = node;\n\n // Loop to find the leaf at the left\n while (current.getLeft() != null) {\n current = current.getLeft();\n }\n\n return current;\n }",
"public int findMin(){\n\t\tif(root==nil){\n\t\t\treturn 0;\n\t\t}\n\t\tNode temp = root;\n\t\twhile(temp.left != nil){\n\t\t\ttemp=temp.left;\n\t\t}\n\t\treturn temp.id;\n\t}",
"@Override\r\n\tpublic T minimum() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tif(this.root == null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tBSTNode<T> node = minimum(this.root);\r\n\t\tif(node != null) {\r\n\t\t\treturn node.data;\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"public Key min(Node node)\n {\n \tif(node==null)\n \t\treturn null;\n \tif(node.left==null)\n \treturn node.key;\n \telse\n \t\treturn min(node.left);\n \t\n }",
"public static int min(treenode root)\n {\n treenode curr=root;\n while(curr.left!=null)\n curr=curr.left;\n return curr.val;\n }",
"protected BSTNode getMinimumChild(BSTNode n) {\n\t\tassert (n != null);\n\n\t\twhile (hasLeftChild(n)) {\n\t\t\tn = n.left;\n\t\t\t_stats.incOtherTraversals();\n\t\t}\n\n\t\treturn n;\n\t}",
"public String min() // return the value of the minimum key in the tree\r\n {\r\n\t \tif(empty()) {\r\n\t \t\treturn null;\r\n\t \t}\r\n return min(root).info;\r\n }",
"private Node smallest(Node p){\n if(p == null){\n return null;\n }\n Node smallest = p;\n while(smallest.left!=null){\n smallest = smallest.left;\n }\n return smallest;\n }",
"public T smallest(Node node) {\n while (node.left != null) {\n node = node.left;\n }\n return node.element;\n }",
"private K smallest(BSTnode<K> n) {\n\t\tif (n.getLeft() == null) {\n\t\t\treturn n.getKey();\n\t\t} else {\n\t\t\treturn smallest(n.getLeft());\n\t\t}\n\t}",
"AVLTreeNode Min() {\r\n\r\n AVLTreeNode current = root;\r\n\r\n /* loop down to find the leftmost leaf */\r\n while (current.left != null)\r\n current = current.left;\r\n\r\n return current;\r\n\r\n\r\n }",
"public static Node leftDescendant(Node node){\n if(node.left!=null){\n return leftDescendant(node.left); // คือการ (findMin) ด้ายซ้าย\n }\n else{\n return node;}\n }",
"public Node binomialHeapMinimum() {\n\t\tNode y = null;\n\t\tNode x = this.head;\n\t\tint min = Integer.MAX_VALUE;\n\t\twhile(x!=null) {\n\t\t\tif (x.key < min) {\n\t\t\t\tmin = x.key;\n\t\t\t\ty = x;\n\t\t\t}\n\t\t\tx = x.rightSibling;\n\t\t}\n\t\treturn y;\n\t}",
"private T getMinUnvisited(){\n if (unvisited.isEmpty()) return null;\n T min = unvisited.get(0);\n for (int i = 1; i < unvisited.size(); i++){\n T temp = unvisited.get(i);\n if (distances[vertexIndex(temp)] < distances[vertexIndex(min)]){\n min = temp;\n }\n }\n return min;\n }",
"private Node getSuccessorBasedOnMin(Node node) {\n Node successor = localMinAndItsParent(node)[0];\n Node successorParent = localMinAndItsParent(node)[1];\n if (successor != node.rightChild) {\n successorParent.leftChild = successor.rightChild;\n successor.rightChild = node.rightChild;\n }\n return successor;\n }",
"private Node findSmallest(Node curr) {\n Node prev = null;\n while(curr != null && !curr.isNull) {\n prev = curr;\n curr = curr.left;\n }\n return prev != null ? prev : curr;\n }",
"@Override\n public TreeNode<E> tree_minimum() {\n return tree_minimum(root);\n }",
"public int\ngetNodeIndexMin();",
"public AnyType findMin() {\r\n\t\tif (isEmpty())\r\n\t\t\tthrow new UnderflowException();\r\n\t\treturn findMin(root).element;\r\n\t}",
"public node_data heapExtractMin(){\n\t\tdouble min = _positiveInfinity;\n\t\tnode_data v=null;\n\t\tif (!isEmpty()){\n\t\t\tv = _a[0];\n\t\t\tmin = v.getWeight();\n\t\t\t_a[0]=_a[_size-1];\n\t\t\t_size = _size-1;\n\t\t\tminHeapify(0, _size);\n\t\t}\n\t\treturn v;\n\t}",
"public BinaryNode getMinNode(BinaryNode current, int min) throws Exception {\n getMinNodeHelper(current, min);\n if (getMinNodeFromSeq() == null) {\n throw new Exception(\"Alle Knoten sind kleiner als der angegebene Wert!\");\n }\n return getMinNodeFromSeq();\n }",
"private static <K extends Comparable<? super K>, V> Node<K, V> findSmallestNode(Node<K, V> root) {\n @Var Node<K, V> current = root;\n while (current.left != null) {\n current = current.left;\n }\n return current;\n }",
"public AnyType findMin() {\n\t\treturn elementAt(findMin(root));\n\t}",
"int getMinValue(AVLTreeNode node)\r\n {\n if (node == null) return Integer.MIN_VALUE;\r\n\r\n // if this is the left-most node\r\n if (node.left == null) return node.key;\r\n\r\n return getMinValue(node.left);\r\n }",
"private IAVLNode minPointer(IAVLNode node) \r\n\t {\r\n\t\t\twhile (node.isRealNode())\r\n\t\t\t\tnode = node.getLeft();\r\n\t\t\treturn node.getParent();\t\r\n\t }",
"private Node getMinimumOld() {\n Node tmp = null;\n\n // TODO: optimize by putting in 1 list and\n // provide 'starting offset' for remaining nodes to find mimimum\n // note: see new getMinimum method above\n\n if (null != nodeA) {\n tmp = nodeA;\n if (null != nodeB && tmp.data > nodeB.data) {\n tmp = nodeB;\n }\n if (null != nodeC && tmp.data > nodeC.data) {\n tmp = nodeC;\n }\n } else if (null != nodeB) {\n tmp = nodeB;\n if (null != nodeC && tmp.data > nodeC.data) {\n tmp = nodeC;\n }\n } else if (null != nodeC) {\n tmp = nodeC;\n }\n\n // System.out.println(tmp);\n\n if (null == tmp ) {\n // terminating condition\n return null;\n }\n\n if (tmp.equals(nodeA)) {\n nodeA = nodeA.next;\n }\n if (tmp.equals(nodeB)) {\n nodeB = nodeB.next;\n }\n if (tmp.equals(nodeC)) {\n nodeC = nodeC.next;\n }\n\n System.out.println(tmp.data);\n\n return tmp;\n }",
"int getMin() {\n\t\tif (stack.size() > 0) {\n\t\t\treturn minEle;\n\t\t} else {\n\t\t\treturn -1;\n\t\t}\n\t}",
"private Node<Value> delMin(Node<Value> x)\r\n {\r\n if (x.left == null) return x.right;\r\n x.left = delMin(x.left);\r\n return x;\r\n }",
"public AnyType findMin() {\n if (isEmpty())\n throw new UnderflowException();\n return root.element;\n }",
"public int minValue(Node node) {\n /* loop down to find the rightmost leaf */\n Node current = node;\n while (current.left != null)\n current = current.left;\n\n return (current.key);\n }",
"public int findMinValue(Node root) {\n if(root == null) {\n return Integer.MAX_VALUE;\n }\n int output = (int)root.getData();\n int outputOnLeft = findMinValue(root.getLeftChildNode());\n int outputOnRight = findMinValue(root.getRightChildNode());\n if(outputOnLeft < output) {\n output = outputOnLeft;\n }\n if(outputOnRight < output) {\n output = outputOnRight;\n }\n return output;\n }",
"private Node removeMin(Node node){\n if(node == null)\n return null;\n else if(node.left == null) {//use right child to replace this node (min value node)\n if(node.count!=0){ //multiple value in same node\n node.count--;\n return node;\n }\n else{\n decDepth(node.right); //maintain depth when chain in right tree\n return node.right;\n }\n }\n\n //walk through left branch\n node.left = removeMin(node.left);\n if(node!=null) node.size--; // the min value must be removed\n return node;\n }",
"public Integer smallest() {\n if (root != null) {\n return root.smallest();\n }\n return null;\n }",
"public Node binomialHeapExtractMin() {\n\t\tNode x = this.deleteMin();\n\t\t\n\t\t// make a new heap\n\t\t// reverse the child list of x and assign it to the head of new heap.\n\t\tBinomialHeap hPrime = new BinomialHeap();\n\t\thPrime.head = reverseLinkedList(x.leftChild);\n\t\t\n\t\t// perform union on the child tree list of x and the original heap\n\t\tBinomialHeap h = this.binomialHeapUnion(hPrime);\n\t\tthis.head = h.head;\n\t\t\n\t\t// return the minimum node\n\t\treturn x;\n\t}",
"private SearchNode findFirstNode(HashSet<SearchNode> set){\n\t\t\tSearchNode min = null;\n\t\t\tfor (SearchNode cur : set){\n\t\t\t\tif (min == null || cur.fScore < min.fScore)\n\t\t\t\t\tmin = cur;\n\t\t\t}\n\t\t\treturn min;\n\t\t}",
"public K min() {\n if (root == null)\n return null;\n else {\n Node curr = root;\n while (true) {\n if (curr.left != null)\n curr = curr.left;\n else\n return curr.key;\n }\n }\n }",
"public int minElement() {\n\t\tNode min=root;\n\t\tint out=-1;\n\t\twhile(min!=null) {\n\t\t\tout=min.data;\n\t\t\tmin=min.left;\n\t\t}\n\t\treturn out;\n\t}",
"public String min() {\n\t\tif (this.empty()) {\n\t\t\treturn null;\n\t\t}\n\t\tAVLNode min = (AVLNode) this.root;\n\t\twhile (min.getLeft().getHeight() != -1) {\n\t\t\tmin = (AVLNode) min.getLeft();\n\t\t}\n\t\treturn min.getValue();\n\t}",
"private BinaryNode<AnyType> findParentNode1(BinaryNode<AnyType> t, AnyType x)\r\n\t{\r\n\t\tif(t == null)\r\n\t\t\treturn null;\r\n\t\telse if(t == root && (x.compareTo(root.element)== 0))\r\n\t\t\treturn t;\r\n\t\telse\r\n\t\t{\r\n\t\t\tif((t.left!= null && (x.compareTo(t.left.element) == 0)) || (t.right!= null && (x.compareTo(t.right.element) == 0)))\r\n\t\t\t\treturn t;\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tBinaryNode<AnyType> temp = findParentNode1(t.left,x);\r\n\t\t\t\tif(temp == null)\r\n\t\t\t\t\treturn findParentNode1(t.right,x);\r\n\t\t\t\telse\r\n\t\t\t\t\treturn temp;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public int minValue() {\n\t\treturn minValue(root);\n\t}",
"public void testFindMin() {\r\n assertNull(tree.findMin());\r\n tree.insert(\"apple\");\r\n tree.insert(\"act\");\r\n assertEquals(\"act\", tree.findMin());\r\n tree.remove(\"act\");\r\n assertEquals(\"apple\", tree.findMin());\r\n }",
"public int getMin() {\r\n // get root\r\n RedBlackTree.Node<Grade> min = rbt.root;\r\n // loop to left of tree\r\n while (min.leftChild != null) {\r\n min = min.leftChild;\r\n }\r\n\r\n return min.data.getGrade();\r\n }",
"public K min(Tree<K, V> t, K key) {\n\t\treturn left.min(left, this.key);\n\t}",
"private Integer minimumData(Node root) {\n Integer min = root.getData();\n while (root.getLeftChild() != null) {\n min = root.getLeftChild().getData();\n root = root.getLeftChild();\n }\n return min;\n }",
"public static int minimum(Node root){\r\n int mn = Integer.MAX_VALUE;\r\n for(Node child : root.children){\r\n mn = Math.min(mn, minimum(child));\r\n }\r\n return Math.min(mn, root.data);\r\n }",
"public Point getMinPoint() {\r\n int minX = children.get(0).getShapeStartingPoint().getX();\r\n int minY = children.get(0).getShapeStartingPoint().getY();\r\n for(IShape shape: children) {\r\n if(minX > shape.getShapeStartingPoint().getX()) {\r\n minX = shape.getShapeStartingPoint().getX();\r\n }\r\n if(minY > shape.getShapeStartingPoint().getY()) {\r\n minY = shape.getShapeStartingPoint().getY();\r\n }\r\n }\r\n minPoint = new Point(minX,minY);\r\n return minPoint;\r\n }",
"public int findSmallest() {\n\t/*\n\t Cases:\n\t If last or only node, return datum\n\n\t Otherwise:\n\t Return whatever is smaller: \n\t The datum of the current node,\n\t or the datum of the next node \n\t*/ \n\tif (next == null) return datum; \n\telse {\n\t int nextDatum = next.findSmallest();\n\t if (nextDatum < datum) return nextDatum;\n\t else return datum;\n\t}\n }",
"public T minValue(){\r\n \tif(size > 0) {\r\n \t\treturn stack1.peek();\r\n \t}else {\r\n \t\treturn null;\r\n \t}\r\n }",
"private IAVLNode findPredecessor(IAVLNode node)\r\n\t{\r\n\t\t//minimum node has no predecessor\r\n\t\tif (node == minimum) \r\n\t\t\treturn null; \r\n\t\t\r\n\t\tif (node.getLeft().isRealNode()) \r\n\t\t\treturn maxPointer(node.getLeft()); \r\n\t\telse \r\n\t\t{\r\n\t\t\tIAVLNode parent = node.getParent();\r\n\t\t\twhile ((node == parent.getLeft())&&(parent != null)) \r\n\t\t\t{ \r\n\t\t\t\tnode = parent; \r\n \t\t\t\tparent = parent.getParent() ; \r\n\t\t\t}\r\n\t\t\treturn parent;\t\r\n\t\t}\r\n\t}",
"private static int minimum(BinarySearchTreeNode<Integer> root) {\n if (root == null) {\n return Integer.MAX_VALUE;\n }\n\n int leftMin = minimum(root.left);\n int rightMin = minimum(root.right);\n\n return Math.min(root.data, Math.min(leftMin, rightMin));\n }",
"public AnyType findMin( ) throws Exception\r\n\t{\r\n\t\tif( isEmpty( ) )\r\n\t\t\tthrow new Exception( );\r\n\t\treturn findMin( root ).element;\r\n\t}",
"public static Node rmin(Node root) {\n\t\twhile(root.left!=null)\r\n\t\t\troot=root.left;\r\n\t\t\r\n\t\treturn root;\r\n\t}",
"public int min(BSTNode root)\n\t{\n\t\tBSTNode curr;\n\t\tint min=Integer.MAX_VALUE;\n\t\tQueue<BSTNode> q = new LinkedList<BSTNode>();\n\t\tq.add(root);\n\t\twhile(!q.isEmpty())\n\t\t{\n\t\t\tcurr=q.poll();\n\t\t\tif(curr.getData()<min)\n\t\t\t\tmin=curr.getData();\n\t\t\tif(curr.getLeft()!=null)\n\t\t\t\tq.add(curr.getLeft());\n\t\t\tif(curr.getRight()!=null)\n\t\t\t\tq.add(curr.getRight());\n\t\t}\n\t\treturn min;\n\t}",
"private String findMin(Map<String, Node> nodeList)\n\t{\n\t\tint min = Integer.MAX_VALUE;\n\t\tString sommet = null;\n\t\t\n\t\tfor (String nodeName : nodeList.keySet()) {\n\t\t\tint distance = nodeList.get(nodeName).getDistanceFromOrigin();\n\n\t\t\tif(min > distance) {\n\t\t\t\tmin = distance;\n\t\t\t\tsommet = nodeName;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn sommet;\n\t}",
"public E extractMin() {\n\t\tif (heap.size() <= 0)\n\t\t\treturn null;\n\t\telse {\n\t\t\tE minVal = heap.get(0);\n\t\t\theap.set(0, heap.get(heap.size() - 1)); // Move last to position 0\n\t\t\theap.remove(heap.size() - 1);\n\t\t\tminHeapify(heap, 0);\n\t\t\treturn minVal;\n\t\t}\n\t}",
"public E extractMin() {\n\t\tif (heap.size() <= 0)\n\t\t\treturn null;\n\t\telse {\n\t\t\tE minVal = heap.get(0);\n\t\t\theap.set(0, heap.get(heap.size()-1)); // Move last to position 0\n\t\t\theap.remove(heap.size()-1);\n\t\t\tminHeapify(heap, 0);\n\t\t\treturn minVal;\n\t\t}\n\t}",
"Coordinate getMinX();",
"public K min() throws EmptyTreeException {\n\t\tTree<K, V> t = this;\n\t\treturn min(t, key);\n\t}",
"@Override\r\n\tpublic T min() {\n\t\treturn null;\r\n\t}",
"public static Node inorderSuccessor(Node x) {\n Node cursor = null;\n if (x == null) {\n return cursor;\n }\n\n if (x.right != null) {\n cursor = x.right;\n while (cursor != null) {\n cursor = cursor.left;\n }\n return cursor;\n } else {\n cursor = x.parent;\n while (cursor != null && cursor.val < x.val) {\n cursor = cursor.parent;\n }\n return cursor;\n }\n }",
"public E findMin() {\n // TODO: YOUR CODE HERE\n return getElement(1);\n }",
"int getXMin();",
"private SubArrayMinNode getNode(int index) {\n if (index < 0 || index >= root.size) {\n throw new IndexOutOfBoundsException(\"Index \" + index + \" is not in the range [0, \" + root.size + \")\");\n }\n int rank = index;\n SubArrayMinNode node = root;\n while (rank != node.left.size) {\n if (rank < node.left.size) {\n node = node.left;\n } else {\n rank -= node.left.size + 1;\n node = node.right;\n }\n }\n return node;\n }",
"private List<Integer> findMinNodes() {\n\t\tint minLabel = Integer.MAX_VALUE;\n\t\tList<Integer> result = new ArrayList<Integer>();\n\n\t\tfor (int node = 0; node < vertices.length; node++) {\n\t\t\tint nodeLabel = connectivity[node][node];\n\t\t\tif (nodeLabel < minLabel) {\n\t\t\t\tresult.clear();\n\t\t\t\tresult.add(node);\n\t\t\t\tminLabel = nodeLabel;\n\t\t\t} else if (nodeLabel == minLabel) {\n\t\t\t\tresult.add(node);\n\t\t\t} else\n\t\t\t\tcontinue;\n\t\t}\n\t\treturn result;\n\t}",
"private static int minDepth(TreeNode node) {\r\n\t\tif (node == null) return 0;\r\n\t\treturn 1 + Math.min(minDepth(node.left), minDepth(node.right));\r\n\t}",
"int Smallest()throws EmptyException {\n\t\tif (isEmpty()) {\n\t\t\tthrow new EmptyException();\n\t\t}\n\t\tNode curr = head;\n\t\tint min = curr.data;\n\t\twhile (curr.next != null) {\n\t\t\tif (curr.next.data < min) {\n\t\t\t\tmin = curr.next.data;\n\t\t\t}\n\t\t\tcurr = curr.next;\n\t\t}\n\t\treturn min;\n\t}",
"public T findMin();"
] | [
"0.84487927",
"0.83234155",
"0.8049694",
"0.79547507",
"0.7908666",
"0.7765832",
"0.773983",
"0.7712483",
"0.7682014",
"0.7675393",
"0.7655407",
"0.7636949",
"0.7629864",
"0.76171446",
"0.758857",
"0.756691",
"0.7559445",
"0.7547674",
"0.7542098",
"0.75163436",
"0.74840456",
"0.747206",
"0.74550265",
"0.7441805",
"0.74188286",
"0.7378745",
"0.73454577",
"0.73450667",
"0.73079437",
"0.7298307",
"0.7265665",
"0.72625154",
"0.7258951",
"0.7253763",
"0.72522295",
"0.7152616",
"0.7135105",
"0.71291673",
"0.7123765",
"0.71143836",
"0.7077868",
"0.7070187",
"0.7062685",
"0.7061836",
"0.7040016",
"0.70292866",
"0.7017847",
"0.70160633",
"0.7000905",
"0.6994991",
"0.69868475",
"0.6973957",
"0.69562423",
"0.6943305",
"0.6886074",
"0.6875616",
"0.68472034",
"0.6838269",
"0.6825687",
"0.68014973",
"0.6798504",
"0.67875034",
"0.67845166",
"0.67731524",
"0.67539483",
"0.673234",
"0.67234236",
"0.67217004",
"0.6720965",
"0.67156094",
"0.6705364",
"0.6699076",
"0.6698127",
"0.6691119",
"0.66859055",
"0.66176665",
"0.66067547",
"0.6593795",
"0.6583937",
"0.6580319",
"0.6577628",
"0.655268",
"0.6545933",
"0.6533532",
"0.6522767",
"0.6512609",
"0.64972365",
"0.64880717",
"0.6480419",
"0.647318",
"0.6453399",
"0.64400136",
"0.64242184",
"0.6416273",
"0.64041567",
"0.63988715",
"0.63756764",
"0.63529545",
"0.6348564",
"0.6347561"
] | 0.83214706 | 2 |
removes the subtrie rooted at the min node in the same level of x used as assistant to delete only, otherwise would destroy the trie Precondition: x != null | private Node<Value> delMin(Node<Value> x)
{
if (x.left == null) return x.right;
x.left = delMin(x.left);
return x;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void delete(Node<T> x) {\n decreaseKey(x, min.key);\n extractMin();\n }",
"public void deleteMin() {\n root = deleteMin(root);\n }",
"public void deleteMin() {\n root = deleteMin(root);\n }",
"public void deleteMin()\t\t\t\t//delete smallest key\n\t{\n\t\troot=deleteMin(root);\n\t}",
"public void removeMin() {\n\t\troot = removeMin(root);\n\t}",
"public HuffmanTree removeMin();",
"private BinaryNode<AnyType> remove( AnyType x, BinaryNode<AnyType> t )\r\n\t{\r\n\t\tif( t == null )\r\n\t\t\treturn t; // Item not found; do nothing\r\n\r\n\t\tint compareResult = x.compareTo( t.element );\r\n\r\n\t\tif( compareResult < 0 )\r\n\t\t\tt.left = remove( x, t.left );\r\n\t\telse if( compareResult > 0 )\r\n\t\t\tt.right = remove( x, t.right );\r\n\t\telse if( t.left != null && t.right != null ) // Two children\r\n\t\t{\r\n\t\t\tt.element = findMin( t.right ).element;\r\n\t\t\tt.right = remove( t.element, t.right );\r\n\t\t}\r\n\t\telse\r\n\t\t\tt = ( t.left != null ) ? t.left : t.right;\r\n\t\treturn t;\r\n\t}",
"public void delete(Node x) {\n if (!redoDone)\n redoStack.clear();\n else\n redoDone = false;\n BSTTrackingData log = new BSTTrackingData(x, x.left, x.right, x.parent, null, 'd');\n Boolean isRoot = x == root;\n Node toRemove = x;\n Node succ = null;\n if (x.left != null & x.right != null) { //if Case 3 - PartA change toRemove to the successor and remove it from the tree\n succ = successorForDelete(x); //use side function to get the successor (adjusted to improve retrack runtime)\n toRemove = succ;\n log.setSuccParent(succ.parent); //update log accordingly\n }\n stack.push(log);\n deleteUpToChild(toRemove); //function to handle removal of node with up to 1 child.\n if (succ != null) { //Case 3 part B - Place the successor in x's location in the tree.\n //update parent\n succ.parent = x.parent;\n if (isRoot) {\n root = succ;\n } else {\n if (x.parent.right == x) x.parent.right = succ;\n else x.parent.left = succ;\n }\n //update both children\n succ.right = x.right;\n if (x.right != null)\n x.right.parent = succ;\n succ.left = x.left;\n if (x.left != null)\n x.left.parent = succ;\n }\n\n }",
"public void binomialHeapDelete(Node x) {\n\t\tthis.binomialHeapDecreaseKey(x, Integer.MIN_VALUE);\n\t\tthis.binomialHeapExtractMin();\n\t}",
"public void deleteMin() {\n if (isEmpty()) throw new NoSuchElementException(\"Symbol table underflow\");\n root = deleteMin(root);\n// TODO:adding check for assurance\n }",
"private void deleteFixup(Node<K, V> x) {\n\t\t\n\t}",
"private Node delete(Node x, int time) {\n\t\tif (x == null) return null;\n\n\t\tif (x.getTime() == time) {\n\t\t\tif (x.getLeft() == null && x.getRight() == null) return null;\n\t\t\tif (x.getLeft() == null || x.getRight() == null) {\n\t\t\t\treturn (x.getLeft() == null) ? x.getRight() : x.getLeft();\n\t\t\t}\n\t\t\t// Copy successor's data into x\n\t\t\tNode s = succ(x.getTime());\n\t\t\tx.setTime(s.getTime());\n\t\t\tx.setReq_index(s.getReq_index());\n\t\t\t// Then delete successor\n\t\t\tx.setRight(delete(x.getRight(), s.getTime()));\n\t\t\treturn x;\n\t\t}\n\t\tif (time < x.getTime()) {\n\t\t\tx.setLeft(delete(x.getLeft(), time));\n\t\t}\n\t\telse {\n\t\t\tx.setRight(delete(x.getRight(), time));\n\t\t}\n\t\treturn x;\n\t}",
"public static void delete(Node node){\n // There should be 7 cases here\n if (node == null) return;\n\n if (node.left == null && node.right == null) { // sub-tree is empty case\n if (node.key < node.parent.key) { // node น้อยกว่าข้างบน\n node.parent.left = null;\n }\n else {\n node.parent.right = null;\n }\n\n return;\n }\n\n else if (node.left != null && node.right == null) { // right sub-tree is empty case\n if (node.left.key < node.parent.key) { // sub-tree อยู่ทางซ้ายของ parent\n node.left.parent = node.parent;\n node.parent.left = node.left;\n }\n else {\n node.left.parent = node.parent;\n node.parent.right = node.left;\n }\n return;\n }\n else if (node.right != null && node.left == null) { // left sub-tree is empty case\n if (node.right.key < node.parent.key) { // sub-tree อยู่ทางซ้ายของ parent\n node.right.parent = node.parent;\n node.parent.left = node.right;\n }\n else {\n node.right.parent = node.parent;\n node.parent.right = node.right;\n }\n return;\n }\n else { // full node case\n // หา min ของ right-subtree เอา key มาเขียนทับ key ของ node เลย\n Node n = findMin(node.right);\n node.key = n.key;\n delete(n);\n }\n }",
"protected BinaryNode<AnyType> remove(AnyType x, BinaryNode<AnyType> t) {\n\t\tif (t == null)\n\t\t\tthrow new ItemNotFoundException(x.toString());\n\t\tif (x.compareTo(t.element) < 0)\n\t\t\tt.left = remove(x, t.left);\n\t\telse if (x.compareTo(t.element) > 0)\n\t\t\tt.right = remove(x, t.right);\n\t\telse if (t.duplicate.size() != 0) {\n\t\t\tt.duplicate.remove(0);\n\t\t} else if (t.left != null && t.right != null) // Two children\n\t\t{\n\t\t\tt.element = findMin(t.right).element;\n\t\t\tt.right = removeMin(t.right);\n\t\t} else\n\t\t\tt = (t.left != null) ? t.left : t.right;\n\t\treturn t;\n\t}",
"public T remove(T x) {\n\t\tEntry<T> node = getSplay(find(x));\n\t\tT result;\n\t\tresult = node.element;\n\t\tif(node == null)\n\t\t\treturn null;\n\t\tsplay(node);\n\t\tif(node.left != null && node.right != null) {\n\t\t\tEntry<T> tmp = getSplay(node.left);\n\t\t\twhile(tmp.right != null)\n\t\t\t\ttmp = getSplay(tmp.right);\n\t\t\t\n\t\t\ttmp.right = node.right;\n\t\t\tgetSplay(node.right).parent = tmp;\n\t\t\tgetSplay(node.left).parent = null;\n\t\t\troot = node.right;\n\t\t\t \n\t\t}\n\t\telse if(node.right != null) {\n\t\t\tgetSplay(node.right).parent = null;\n\t\t\troot = node.right;\n\t\t}\n\t\telse if(node.left != null) {\n\t\t\tgetSplay(node.left).parent = null;\n\t\t\troot = node.left;\n\t\t}\n\t\telse {\n\t\t\troot = null;\n\t\t}\n\t\tnode.parent = null;\n node.left = null;\n node.right = null;\n node = null;\n return result;\n\t}",
"private Node deleteMin(Node n)\n {\n if (n.left == null) \n return n.right;\n n.left = deleteMin(n.left); \n n.count= 1 + size(n.left)+ size(n.right); \n return n;\n }",
"private void pruneTree(QuadNode node){\n int i;\n while(node.parent != null && node.quads[0] == null && node.quads[1] == null && node.quads[2] == null && node.quads[3] == null){\n i=0;\n if(node.x != node.parent.x){\n i++;\n }\n if(node.z != node.parent.z){\n i+=2;\n }\n node = node.parent;\n node.quads[i] = null;\n }\n }",
"public void deleteMax() {\n root = deleteMax(root);\n }",
"public void deleteMax() {\n root = deleteMax(root);\n }",
"private Node<Value> delMax(Node<Value> x)\r\n {\r\n if (x.right == null) return x.left;\r\n x.right = delMax(x.right);\r\n return x;\r\n }",
"void deleteTree(TreeNode node) \n {\n root = null; \n }",
"public int delete(int k){\n\t WAVLNode x = treePosForDel(this, k); // find the node to delete\r\n\t int cnt = 0; // rebalance operations counter\r\n\t if(x.key!=k) { // if a node with a key of k doesnt exist in the tree there is nothing to delete, return -1\r\n\t\t return -1;\r\n\t }\r\n\t if(this.root.key==x.key&&this.root.rank==0) {//root is a leaf\r\n\t\t this.root=EXT_NODE;// change the root pointer to EXT_NODE\r\n\t\t return 0;\r\n\t }\r\n\t else if(this.root.key==x.key&&(this.root.right==EXT_NODE||this.root.left==EXT_NODE)) {//root is onary\r\n\t\t if(x.left!=EXT_NODE) { // x is a root with a left child\r\n\t\t\t x.left.parent = null;\r\n\t\t\t this.root = x.left; // change the root pointer to the root's left child\r\n\t\t\t x.left.sizen=1;\r\n\t\t\t return 0;\r\n\t\t }\r\n\t\t x.right.parent = null; // x is a root with a right child \r\n\t\t x.right.sizen=1;\r\n\t\t this.root = x.right; // change the root pointer to the root's right child\r\n\t\t return 0;\r\n\t }\r\n\t WAVLNode z;\r\n\t if(isInnerNode(x)) {// x is an inner node, requires a call for successor and swap\r\n\t\t z = successorForDel(x); // find the successor of x\r\n\t\t x = swap(x,z); // put x's successor instead of x and delete successor \r\n\t }\r\n\t\t if(x.rank == 0) {//x is a leaf\r\n\t\t\t if(parentside(x.parent, x).equals(\"left\")) { // x is a left child of it's parent, requires change in pointers \r\n\t\t\t\t x.parent.left = EXT_NODE;\r\n\t\t\t\t z = x.parent;\r\n\t\t\t\t x = x.parent.left;\r\n\t\t\t }\r\n\t\t\telse { // x is a right child of it's parent, requires change in pointers \r\n\t\t\t\t x.parent.right = EXT_NODE;\r\n\t\t\t\t z = x.parent;\r\n\t\t\t\t x = x.parent.right; \r\n\t\t\t }\r\n\t\t }\r\n\t\t else {//x is onary\r\n\t\t\t boolean onaryside = onaryLeft(x); // check if x is onary with a left child\r\n\t\t\t WAVLNode x_child = EXT_NODE;\r\n\t\t\t if (onaryside) {\r\n\t\t\t\t x_child=x.left; // get a pointer for x child\r\n\t\t\t }\r\n\t\t\t else {\r\n\t\t\t\t x_child=x.right;\r\n\t\t\t }\r\n\t\t\t if(parentside(x.parent, x).equals(\"left\")) { // x is a left child of its parent, change pointers for delete and rebalance loop\r\n\t\t\t\t x.parent.left=x_child;\r\n\t\t\t\t x_child.parent=x.parent;\r\n\t\t\t\t z=x.parent;\r\n\t\t\t\t x=x_child;\r\n\t\t\t\t \r\n\t\t\t }\r\n\t\t\t else {// x is a left child of its parent, change pointers for delete and rebalance loop\r\n\t\t\t\t x.parent.right=x_child;\r\n\t\t\t\t x_child.parent=x.parent;\r\n\t\t\t\t z=x.parent;\r\n\t\t\t\t x=x_child;\r\n\t\t\t }\r\n\t\t }\r\n\t if (z.left.rank==-1&&z.right.rank==-1) {//special case, z becomes a leaf, change pointers and demote\r\n\t\t demote(z);\r\n\t\t x=z;\r\n\t\t z=z.parent;\r\n\t\t cnt++;\r\n\t }\r\n\t \r\n\t while(z!=null&&z.rank-x.rank==3) { // while the tree is not balanced continue to balance the tree\r\n\t\t if(parentside(z, x).equals(\"left\")) { // x is z's left son\r\n\t\t\t if(z.rank-z.right.rank==2) {//condition for demote\r\n\r\n\t\t\t\t demote(z);\r\n\r\n\t\t\t\t x=z;\r\n\t\t\t\t z=z.parent;\r\n\t\t\t\t cnt++;\r\n\t\t\t }\r\n\t\t\t else {\r\n\t\t\t\t if(z.right.rank-z.right.left.rank==2&&z.right.rank-z.right.right.rank==2) {//condition for doubledemote left\r\n\t\t\t\t\t doubleDemoteLeft(z);\r\n\t\t\t\t\t x=z;\r\n\t\t\t\t\t z=z.parent;\r\n\t\t\t\t\t cnt+=2;\r\n\t\t\t\t\t \r\n\t\t\t\t }\r\n\t\t\t\t else if((z.right.rank-z.right.left.rank==1||z.right.rank-z.right.left.rank==2)&&z.right.rank-z.right.right.rank==1) {// condition for rotate left for del\r\n\t\t\t\t\t rotateLeftDel(z);\r\n\t\t\t\t\t cnt+=3;\r\n\t\t\t\t\t break; // tree is balanced\r\n\t\t\t\t }\r\n\t\t\t\t else {//condition for doublerotate left for del\r\n\t\t\t\t\t doubleRotateLeftDel(z);\r\n\t\t\t\t\t \r\n\t\t\t\t\t cnt=cnt+5;\r\n\t\t\t\t\t break; // tree is balanced\r\n\t\t\t\t }\r\n\t\t\t }\r\n\t\t }\r\n\t\t else { // x is z's right son, conditions are symmetric to left side\r\n\t\t\t if(z.rank-z.left.rank==2) {\r\n\t\t\t\t demote(z);\r\n\t\t\t\t x=z;\r\n\t\t\t\t z=z.parent;\r\n\t\t\t\t cnt++;\r\n\t\t\t\t \r\n\t\t\t }\r\n\t\t\t else {\r\n\t\t\t\t if(z.left.rank-z.left.right.rank==2&&z.left.rank-z.left.left.rank==2) {\r\n\t\t\t\t\t doubleDemoteright(z);\r\n\t\t\t\t\t x=z;\r\n\t\t\t\t\t z=z.parent;\r\n\t\t\t\t\t cnt+=2;\r\n\t\t\t\t }\r\n\t\t\t\t else if((z.left.rank-z.left.right.rank==1||z.left.rank-z.left.right.rank==2)&&z.left.rank-z.left.left.rank==1) {\r\n\t\t\t\t\t rotateRightDel(z);\r\n\t\t\t\t\t cnt+=3;\r\n\t\t\t\t\t break;\r\n\t\t\t\t }\r\n\t\t\t\t else {\r\n\r\n\t\t\t\t\t doubleRotateRightDel(z);\r\n\t\t\t\t\t cnt+=5;\r\n\t\t\t\t\t break;\r\n\t\t\t\t }\r\n\t\t\t\t \r\n\t\t\t }\r\n\t\t }\r\n\t }\r\n\t return cnt;\r\n }",
"private void deleteTree(tnode root){\n if (root != null)\n root = null;\n }",
"void deleteMin() {\n delete(keys[0]);\n }",
"public T deleteMin()\n\t{\t\n\t\t//declating variables\n\t\tint minIndex = 0;\n\t\tboolean flag = false;\n\t\tboolean flag2 = false;\n\t\t//if size == 0; returns null\n\t\tif(size == 0)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t//if checks size and deletes accordingly.\n\t\tif(size == 1)\n\t\t{\n\t\t\tT tempo = array[0];\n\t\t\tarray[0] = null;\n\t\t\tsize--;\n\t\t\treturn tempo;\n\n\t\t}\n\n\t\tif(size == 2)\n\t\t{\n\t\t\tT temp = array[0];\n\t\t\tarray[0] = array[1];\n\t\t\tarray[1] = null;\n\t\t\tsize--;\n\t\t\treturn temp;\n\n\t\t}\n\t\tif(size == 3)\n\t\t{\n\t\t\tT tempo = array[0];\n\t\t\tint small = grandChildMin(1, 2);\n\t\t\tarray[0] = array[small];\n\t\t\tif(small == 2)\n\t\t\t{\n\t\t\t\tarray[small] = null;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tarray[1] = array[2];\n\t\t\t\tarray[2] = null;\n\t\t\t}\n\n\t\t\tsize--;\n\t\t\treturn tempo;\n\t\t}\n\n\t\t//if size > 3 does sophisticated deleting\n\t\tT temp = array[0];\n\t\tarray[0] = array[size-1];\n\t\tarray[size-1] = null;\n\t\tsize--;\n\t\tint index = 0;\n\n\t\t//gets the smallest of the children & grandchildren\n\t\tint smallest = min(index).get(0);\n\t\t//while it has grandchildren, keeps going\n\t\twhile(smallest != 0)\n\t\t{\n\t\t\t//doesn't switch if im less than the smallest grandchild\n\t\t\t//& breaks\n\t\t\tif(object.compare(array[index], array[smallest]) <= 0 )\n\t\t\t{\n\t\t\t\tflag = true;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t//special case when i could switch with child or grandchild\n\t\t\tif( min(index).size() > 1)\n\t\t\t{\n\t\t\t\tflag2 = true;\n\t\t\t}\n\n\t\t\t//switches the locations and updates index\n\t\t\tT lemp = array[index];\n\t\t\tarray[index] = array[smallest];\n\t\t\tarray[smallest] = lemp;\n\t\t\tindex = smallest;\n\t\t\tsmallest = min(smallest).get(0);\n\n\t\t}\n\t\t//if i dont switch, i check if i have to switch then percolate back up\n\t\tif(flag == true)\n\t\t{\n\t\t\tif(object.compare(array[index], array[grandChildMin(2*index+1, 2*index+2)]) > 0)\n\t\t\t{\n\t\t\t\tint mIndex = grandChildMin(2*index+1, 2*index+2);\n\t\t\t\tT k = array[mIndex];\n\t\t\t\tarray[mIndex] = array[index];\n\t\t\t\tarray[index] = k;\n\n\t\t\t\tint y = mIndex;\n\t\t\t\twhile(object.compare(array[y], array[(y-3)/4]) > 0 && y > 2)\n\t\t\t\t{\n\t\t\t\t\tT f = array[(y-3)/4];\n\t\t\t\t\tarray[(y-3)/4] = array[y];\n\t\t\t\t\tarray[y] = f;\n\t\t\t\t\ty = (y-3)/4;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(object.compare(array[index], array[(index-1)/2]) > 0)\n\t\t\t{\n\t\t\t\tT m = array[(index-1)/2];\n\t\t\t\tarray[(index-1)/2] = array[index];\n\t\t\t\tarray[index] = m;\n\t\t\t\tint y = (index-1)/2;\n\t\t\t\twhile(object.compare(array[y], array[(y-3)/4]) > 0 && y > 2)\n\t\t\t\t{\n\t\t\t\t\tT k = array[(y-3)/4];\n\t\t\t\t\tarray[(y-3)/4] = array[y];\n\t\t\t\t\tarray[y] = k;\n\t\t\t\t\ty = (y-3)/4;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\telse if(flag2 == true)\n\t\t{\n\t\t\tint y = index;\n\n\t\t\tif(getLevel(y+1) % 2 == 1)\n\t\t\t{\n\t\t\t\twhile(object.compare(array[y], array[(y-3)/4]) > 0 && y > 2)\n\t\t\t\t{\n\t\t\t\t\tT k = array[(y-3)/4];\n\t\t\t\t\tarray[(y-3)/4] = array[y];\n\t\t\t\t\tarray[y] = k;\n\t\t\t\t\ty = (y-3)/4;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse{\n\t\t\t\twhile(object.compare(array[y], array[(y-3)/4]) < 0 && y > 2)\n\t\t\t\t{\n\t\t\t\t\tT k = array[(y-3)/4];\n\t\t\t\t\tarray[(y-3)/4] = array[y];\n\t\t\t\t\tarray[y] = k;\n\t\t\t\t\ty = (y-3)/4;\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t}\n\n\t\telse if(object.compare(array[index], array[grandChildMin(2*index +1, 2*index+2)]) > 0 && grandChildMin(2*index +1, 2*index+2) != 0)\n\t\t{\n\t\t\tminIndex = grandChildMin(2*index+1, 2*index+2);\n\t\t\tT wemp = array[index];\n\t\t\tarray[index] = array[minIndex];\n\t\t\tarray[minIndex] = wemp;\n\n\t\t\tint y = minIndex;\n\t\t\twhile(object.compare(array[y], array[(y-3)/4]) > 0 && y > 2)\n\t\t\t{\n\t\t\t\tT demp = array[(y-3)/4];\n\t\t\t\tarray[(y-3)/4] = array[y];\n\t\t\t\tarray[y] = demp;\n\t\t\t\ty = (y-3)/4;\n\t\t\t}\n\t\t}\n\n\t\telse if (object.compare(array[index], array[(index-1)/2]) > 0) \n\t\t{\n\n\t\t\tT femp = array[(index-1)/2];\n\t\t\tarray[(index-1)/2] = array[index];\n\t\t\tarray[index] = femp;\n\n\t\t\tint y = (index-1)/2;\n\t\t\twhile(object.compare(array[y], array[(y-3)/4]) > 0 && y > 2)\n\t\t\t{\n\t\t\t\tT demp = array[(y-3)/4];\n\t\t\t\tarray[(y-3)/4] = array[y];\n\t\t\t\tarray[y] = demp;\n\t\t\t\ty = (y-3)/4;\n\t\t\t}\n\t\t}\n\n\t\t\n\t\treturn temp;\n\t}",
"private RBNode<T> removeMin(RBNode<T> node){\n //find the min node\n RBNode<T> parent = node;\n while(node!=null && node.getLeft()!=null){\n parent = node;\n node = node.getLeft();\n }\n //remove min node\n if(parent==node){\n return node;\n }\n\n parent.setLeft(node.getRight());\n setParent(node.getRight(),parent);\n\n //don't remove right pointer,it is used for fixed color balance\n //node.setRight(null);\n return node;\n }",
"public void deleteMin() {\n if (isEmpty()) throw new NoSuchElementException(\"Symbol table underflow\");\n root = deleteMin(root);\n }",
"public void deleteMin() {\n if (isEmpty()) throw new NoSuchElementException(\"Symbol table underflow\");\n root = deleteMin(root);\n assert check();\n }",
"public void delete() {\n this.root = null;\n }",
"private Node removeMin(Node node){\n if(node == null)\n return null;\n else if(node.left == null) {//use right child to replace this node (min value node)\n if(node.count!=0){ //multiple value in same node\n node.count--;\n return node;\n }\n else{\n decDepth(node.right); //maintain depth when chain in right tree\n return node.right;\n }\n }\n\n //walk through left branch\n node.left = removeMin(node.left);\n if(node!=null) node.size--; // the min value must be removed\n return node;\n }",
"private static <K, V> @Nullable Node<K, V> removeMininumNodeInTree(@Var Node<K, V> current) {\n if (current.left == null) {\n // This is the minium node to delete\n return null;\n }\n\n if (!Node.isRed(current.left) && !Node.isRed(current.left.left)) {\n // Push red to left if necessary (similar to general removal strategy).\n current = makeLeftRed(current);\n }\n\n // recursive descent\n Node<K, V> newLeft = removeMininumNodeInTree(current.left);\n current = current.withLeftChild(newLeft);\n\n return restoreInvariants(current);\n }",
"private A deleteLargest(int subtree) {\n return null; \n }",
"private static BstDeleteReturn deleteHelper(BinarySearchTreeNode<Integer> root, int x) {\n if (root == null) {\n return new BstDeleteReturn(null, false);\n }\n\n if (root.data < x) {\n BstDeleteReturn outputRight = deleteHelper(root.right, x);\n root.right = outputRight.root;\n outputRight.root = root;\n return outputRight;\n }\n\n if (root.data > x) {\n BstDeleteReturn outputLeft = deleteHelper(root.left, x);\n root.left = outputLeft.root;\n outputLeft.root = root;\n return outputLeft;\n }\n\n // 0 children\n if (root.left == null && root.right == null) {\n return new BstDeleteReturn(null, true);\n }\n\n // only left child\n if (root.left != null && root.right == null) {\n return new BstDeleteReturn(root.left, true);\n }\n\n // only right child\n if (root.right != null && root.left == null) {\n return new BstDeleteReturn(root.right, true);\n }\n\n // both children are present\n int minRight = minimum(root.right);\n root.data = minRight;\n BstDeleteReturn output = deleteHelper(root.right, minRight);\n root.right = output.root;\n return new BstDeleteReturn(root, true);\n }",
"public void deleteMin() {\r\n\t\tif (empty())\r\n\t\t\treturn;\r\n\t\telse {\r\n\t\t\tif (this.size > 0) {\r\n\t\t\t\tthis.size--;\r\n\t\t\t}\r\n\t\t\tif (this.size == 0) {\r\n\t\t\t\tthis.empty = true;\r\n\t\t\t}\r\n\r\n\t\t\tHeapNode hN = this.min;\r\n\t\t\tint rnkCount = 0;\r\n\t\t\tHeapNode hNIterator = null;\r\n\t\t\tif (hN != null) {\r\n\t\t\t\thNIterator = hN.theMostLeftChild;\r\n\t\t\t}\r\n\t\t\twhile (hNIterator != null) {\r\n\t\t\t\trnkCount++;\r\n\t\t\t\thNIterator = hNIterator.rightBrother;\r\n\t\t\t}\r\n\t\t\tthis.HeapTreesArray[rnkCount] = null;\r\n\t\t\tif (hN != null) {\r\n\t\t\t\thNIterator = hN.theMostLeftChild;\r\n\t\t\t}\r\n\t\t\trnkCount--;\r\n\t\t\tBinomialHeap bH = new BinomialHeap();\r\n\t\t\tif (hNIterator != null) {\r\n\t\t\t\tbH.empty = false;\r\n\t\t\t}\r\n\t\t\twhile (hNIterator != null) {\r\n\t\t\t\tbH.HeapTreesArray[rnkCount] = hNIterator;\r\n\t\t\t\thNIterator = hNIterator.rightBrother;\r\n\t\t\t\tbH.HeapTreesArray[rnkCount].rightBrother = null;\r\n\t\t\t\tif (hNIterator != null) {\r\n\t\t\t\t\thNIterator.leftBrother = null;\r\n\t\t\t\t}\r\n\t\t\t\trnkCount = rnkCount - 1;\r\n\t\t\t}\r\n\t\t\tthis.min = null;\r\n\t\t\tfor (int i = 0; i < this.HeapTreesArray.length; i++) {\r\n\t\t\t\tif (this.min == null) {\r\n\t\t\t\t\tif (this.HeapTreesArray[i] != null) {\r\n\t\t\t\t\t\tthis.min = this.HeapTreesArray[i];\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (this.HeapTreesArray[i] != null) {\r\n\t\t\t\t\t\tif (this.HeapTreesArray[i].value < this.min.value) {\r\n\t\t\t\t\t\t\tthis.min = this.HeapTreesArray[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (!bH.empty()) {\r\n\t\t\t\tfor (int i = 0; i < bH.HeapTreesArray.length; i++) {\r\n\t\t\t\t\tif (bH.min == null) {\r\n\t\t\t\t\t\tif (bH.HeapTreesArray[i] != null) {\r\n\t\t\t\t\t\t\tbH.min = bH.HeapTreesArray[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (bH.HeapTreesArray[i] != null) {\r\n\t\t\t\t\t\t\tif (bH.HeapTreesArray[i].value < bH.min.value) {\r\n\t\t\t\t\t\t\t\tbH.min = bH.HeapTreesArray[i];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tthis.meld(bH);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}",
"private void step4(Node node) {\n\t\tHashMap<String, ArrayList<String>> svn = node.svN;\r\n\t\tHashMap<String, ArrayList<String>> cn = node.cN;\r\n\t\tArrayList<String> keys = node.keysN;\r\n\t\tString c = checksubset(cn);\r\n\r\n\t\tif (c != null) {\r\n\t\t\tfor (int i = 0; i < keys.size(); i++) {\r\n\t\t\t\tif (svn.get(keys.get(i)).contains(c)) {\r\n\t\t\t\t\tsvn.get(keys.get(i)).remove(c);\r\n\t\t\t\t\tif (svn.get(keys.get(i)).size() <= 1) {\r\n\t\t\t\t\t\tsvn.remove(keys.get(i));\r\n\t\t\t\t\t\tkeys.remove(i);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcn.remove(c);\r\n\t\t}\r\n\t}",
"public Node removeMin() {\n \t\t// TODO Complete this method!\n \t\tif (indexOfLeastPriority == 2) {\n \t\t\tNode toReturn = getNode(1);\n \t\t\tsetNode(1, null);\n \t\t\treturn toReturn;\n \t\t}\n \t\tint indexOfReplacement = indexOfLeastPriority - 1;\n \t\tNode nodeOfReplacement = getNode(indexOfReplacement);\n \t\tNode toRemove = getNode(1);\n \t\tsetNode(indexOfReplacement, null);\n \t\tsetNode(1, nodeOfReplacement);\n \t\tbubbleDown(1);\n \t\t//decrement IoLP\n \t\tindexOfLeastPriority--;\n \t\treturn toRemove;\n \t}",
"public void deleteMin();",
"public boolean delete(int x) {\n BstDeleteReturn output = deleteHelper(root,x );\n root = output.root;\n if (output.deleted) {\n size--;\n }\n\n return output.deleted;\n }",
"public void delete(int key) {\n\n\n // There should be 6 cases here\n // Non-root nodes should be forwarded to the static function\n if (root == null) System.out.println(\"Empty Tree!!!\"); // ไม่มี node ใน tree\n else {\n\n Node node = find(key);\n\n if (node == null) System.out.println(\"Key not found!!!\"); //ไม่เจอ node\n\n\n else if(node == root){ //ตัวที่ลบเป็น root\n if (root.left == null && root.right == null) { //ใน tree มีแค่ root ตัสเดียว ก็หายไปสิ จะรอไร\n root = null;\n }\n else if (root.left != null && root.right == null) { //่ root มีลูกฝั่งซ้าย เอาตัวลูกขึ้นมาแทน\n root.left.parent = null;\n root = root.left;\n }\n else { //่ root มีลูกฝั่งขวา เอาตัวลูกขึ้นมาแทน\n Node n = findMin(root.right);\n root.key = n.key;\n delete(n);\n }\n\n }\n\n\n else { //ตัวที่ลบไม่ใช่ root\n delete(node);\n }\n }\n }",
"@Test\n public void remove_BST_0_CaseRootLeafLeft()\n {\n BinarySearchTree bst = new BinarySearchTree();\n No root = new No(2);\n No no = new No(1);\n \n bst.insert(root, root);\n //bst.printTree();\n \n bst.insert(root, no);\n //bst.printTree();\n //System.err.println(); // Print[ERR] Devido a prioridade do buffer de impressao (out, err)\n \n assertEquals(new Integer(2), bst.size());\n assertEquals(no, bst.remove(no));\n assertEquals(new Integer(1), bst.size());\n //bst.printTree();\n }",
"public void remove( AnyType x )\r\n\t{\r\n\t\troot = remove( x, root );\r\n\t}",
"protected BinaryNode<AnyType> removeMin(BinaryNode<AnyType> t) {\n\t\tif (t == null)\n\t\t\tthrow new ItemNotFoundException();\n\t\telse if (t.left != null) {\n\t\t\tt.left = removeMin(t.left);\n\t\t\treturn t;\n\t\t} else\n\t\t\treturn t.right;\n\t}",
"public TreeNode pruneTree(TreeNode root) {\n if (containsOne(root) == false) {\n return null;\n } else {\n return root;\n }\n }",
"private Node<Value> delete(Node<Value> x, String key, int d)\r\n {\r\n if (x == null) return null;\r\n char c = key.charAt(d);\r\n if (c > x.c) x.right = delete(x.right, key, d);\r\n else if (c < x.c) x.left = delete(x.left, key, d);\r\n else if (d < key.length()-1) x.mid = delete(x.mid, key, d+1);\r\n else if (x.val != null) { x.val = null; --N; }\r\n if (x.mid == null && x.val == null)\r\n {\r\n if (x.left == null) return x.right;\r\n if (x.right == null) return x.left;\r\n Node<Value> t;\r\n if (StdRandom.bernoulli()) // to keep balance\r\n { t = min(x.right); x.right = delMin(x.right); }\r\n else\r\n { t = max(x.left); x.left = delMax(x.left); }\r\n t.right = x.right;\r\n t.left = x.left;\r\n return t;\r\n }\r\n return x;\r\n }",
"private AvlNode deleteNode(AvlNode root, int value) {\n\r\n if (root == null)\r\n return root;\r\n\r\n // If the value to be deleted is smaller than the root's value,\r\n // then it lies in left subtree\r\n if ( value < root.key )\r\n root.left = deleteNode(root.left, value);\r\n\r\n // If the value to be deleted is greater than the root's value,\r\n // then it lies in right subtree\r\n else if( value > root.key )\r\n root.right = deleteNode(root.right, value);\r\n\r\n // if value is same as root's value, then This is the node\r\n // to be deleted\r\n else {\r\n // node with only one child or no child\r\n if( (root.left == null) || (root.right == null) ) {\r\n\r\n AvlNode temp;\r\n if (root.left != null)\r\n temp = root.left;\r\n else\r\n temp = root.right;\r\n\r\n // No child case\r\n if(temp == null) {\r\n temp = root;\r\n root = null;\r\n }\r\n else // One child case\r\n root = temp; // Copy the contents of the non-empty child\r\n\r\n temp = null;\r\n }\r\n else {\r\n // node with two children: Get the inorder successor (smallest\r\n // in the right subtree)\r\n AvlNode temp = minValueNode(root.right);\r\n\r\n // Copy the inorder successor's data to this node\r\n root.key = temp.key;\r\n\r\n // Delete the inorder successor\r\n root.right = deleteNode(root.right, temp.key);\r\n }\r\n }\r\n\r\n // If the tree had only one node then return\r\n if (root == null)\r\n return root;\r\n\r\n // STEP 2: UPDATE HEIGHT OF THE CURRENT NODE\r\n root.height = Math.max(height(root.left), height(root.right)) + 1;\r\n\r\n // STEP 3: GET THE BALANCE FACTOR OF THIS NODE (to check whether\r\n // this node became unbalanced)\r\n int balance = balance(root).key;\r\n\r\n // If this node becomes unbalanced, then there are 4 cases\r\n\r\n // Left Left Case\r\n if (balance > 1 && balance(root.left).key >= 0)\r\n return doRightRotation(root);\r\n\r\n // Left Right Case\r\n if (balance > 1 && balance(root.left).key < 0) {\r\n root.left = doLeftRotation(root.left);\r\n return doRightRotation(root);\r\n }\r\n\r\n // Right Right Case\r\n if (balance < -1 && balance(root.right).key <= 0)\r\n return doLeftRotation(root);\r\n\r\n // Right Left Case\r\n if (balance < -1 && balance(root.right).key > 0) {\r\n root.right = doRightRotation(root.right);\r\n return doLeftRotation(root);\r\n }\r\n\r\n return root;\r\n }",
"private Node deleteMin(Node h) {\n if (h.left == null)\n return null;\n\n if (!isRed(h.left) && !isRed(h.left.left))\n h = moveRedLeft(h);\n\n h.left = deleteMin(h.left);\n return balance(h);\n }",
"private void reFixForDel(WAVLNode y) { // in a case of deletion of a node that doesnt exist in the tree, the method will fix the size all the way to the root\r\n\t y.sizen++;\r\n\t while(y.parent!=null) {\r\n\t\t y=y.parent;\r\n\t\t y.sizen++;\r\n\t }\r\n }",
"protected void xremove(Node<T> u) {\n\t\tif (u == r) {\n\t\t\tremove();\n\t\t} else {\n\t\t\tif (u == u.parent.left) {\n\t\t\t\tu.parent.left = nil;\n\t\t\t} else {\n\t\t\t\tu.parent.right = nil;\n\t\t\t}\n\t\t\tu.parent = nil;\n\t\t\tr = merge(r, u.left);\n\t\t\tr = merge(r, u.right);\n\t\t\tr.parent = nil;\n\t\t\tn--;\n\t\t}\n\t}",
"public void remove(AnyType x) {\n LinkedListIterator<AnyType> p = findPrevious(x);\n\n if (p.current.next != null) {\n p.current.next = p.current.next.next; // Bypass deleted node\n }\n }",
"public Node<E> remove_min_node(){\r\n if (theData.size() <= 0) return null;\r\n\r\n int index = 0 ;\r\n E min = theData.get(0).getData();\r\n //searching min element\r\n for (int i = 0; i< theData.size() ; i++){\r\n if (min.compareTo(theData.get(i).getData()) > 0 ){\r\n min = theData.get(i).getData();\r\n index = i;\r\n }\r\n }\r\n\r\n //copying element for return\r\n Node<E> item = new Node<E>(theData.get(index).getData());\r\n item.data = theData.get(index).getData();\r\n item.count = theData.get(index).getCount();\r\n\r\n //removing all occurances\r\n while (theData.get(index).count > 1)\r\n theData.get(index).count-=1;\r\n\r\n if (theData.get(index).count == 1 ){\r\n\r\n if(index != theData.size()-1){\r\n theData.set(index, theData.remove(theData.size() - 1));\r\n fixHeap(index);\r\n }else\r\n theData.remove(theData.size() - 1);\r\n }\r\n return item;\r\n }",
"@Test\n public void remove_BST_0_CaseRootOneChildren()\n {\n BinarySearchTree bst = new BinarySearchTree();\n No root = new No(20);\n bst.insert(null, root);\n bst.insert(root, new No(10));\n //bst.printTree();\n //System.err.println(); // Print[ERR] Devido a prioridade do buffer de impressao (out, err)\n \n assertEquals(root, bst.remove(root));\n assertEquals(new Integer(1), bst.size());\n //bst.printTree();\n }",
"private void reFix(WAVLNode x) {\n\t x.sizen--;\r\n\t while(x.parent!=null) {\r\n\t\t x=x.parent;\r\n\t\t x.sizen--;\r\n\t }\r\n }",
"private BinarySearchTree deleteLeftMost(BinarySearchTree tree){\r\n\t\t\r\n\t\tif(tree.getLeftChild() == null){\r\n\t\t\t//this is the node we want. No left child\r\n\t\t\t//Right child might exist\r\n\t\t\t\r\n\t\t\treturn tree.getRightChild();\r\n\t\t}\r\n\t\telse{\r\n\t\t\tBinarySearchTree replacement = deleteLeftMost(tree.getLeftChild());\r\n\t\t\ttree.attachRightSubtree(replacement);\r\n\t\t\treturn tree;\r\n\t\t}\r\n\t}",
"@Test\n public void remove_BST_1_CaseLeafLeft()\n {\n BinarySearchTree bst = new BinarySearchTree();\n No root = new No(6);\n No leaf = new No(2);\n \n bst.insert(null, root);\n //bst.printTree();\n \n bst.insert(root, new No(9));\n //bst.printTree();\n \n bst.insert(root, leaf);\n //bst.printTree();\n //System.err.println(); // Print[ERR] Devido a prioridade do buffer de impressao (out, err)\n \n assertEquals(leaf, bst.remove(leaf));\n assertEquals(new Integer(2), bst.size());\n //bst.printTree();\n }",
"public void removeMin() {\n if (isEmpty()) throw new RuntimeException(\"underflow\");\n root = removeMin(root);\n }",
"public Node delete(Node x, Key key) {\n if (x == null) return null;\n if (key.equals(x.key)) {\n n--;\n return x.next;\n }\n x.next = delete(x.next, key);\n return x;\n }",
"public AnyType deleteMin() {\n if (isEmpty())\n throw new UnderflowException();\n\n AnyType minItem = root.element;\n root = merge(root.left, root.right);\n\n return minItem;\n }",
"private void delete(Node curr, int ID, AtomicReference<Node> rootRef) {\n\t\tif(curr == null || curr.isNull) {\n return;\n }\n if(curr.ID == ID) {\n if(curr.right.isNull || curr.left.isNull) {\n deleteDegreeOneChild(curr, rootRef);\n } else {\n Node n = findSmallest(curr.right);\n \tcurr.ID = n.ID;\n curr.count = n.count;\n delete(curr.right, n.ID, rootRef);\n }\n }\n if(curr.ID < ID) {\n delete(curr.right, ID, rootRef);\n } else {\n delete(curr.left, ID, rootRef);\n }\n\t}",
"private Node removeVx(Node node, K k){\n if(node == null)\n return null;\n\n if(k.compareTo(node.k) >0) { //value is greater, then looking right node\n node.right = removeVx(node.right, k);\n }else if(k.compareTo(node.k) < 0){ //value is smaller, then looking left node\n node.left = removeVx(node.left, k);\n }else { //(e.compareTo(node.e) == 0) found value matched node\n deleting = true;\n if(node.count!=0) { // if multiple value in one node, just decrease count\n node.count--;\n }else if (node.left != null) { //had left children use max of left children to replace this node\n node.copyValue(max(node.left));\n node.left = removeMax(node.left);\n }\n else if(node.right!=null) { //only had right child, use right child to replace this node\n decDepth(node.right); //maintain depth when chain in right tree\n node = node.right;\n }\n else {\n node = null; // no children, delete this node\n }\n }\n if (node != null && deleting) node.size--;\n return node;\n }",
"public void deleteNode(BinaryTreeNode node) // Only leaf nodes and nodes with degree 1 can be deleted. If a degree 1 node is deleted, it is replaced by its subtree.\r\n {\n if(!node.hasRightChild() && !node.hasLeftChild()){\r\n if(node.mActualNode.mParent.mRightChild == node.mActualNode) {\r\n\r\n node.mActualNode.mParent.mRightChild = null;\r\n }\r\n else if(node.mActualNode.mParent.mLeftChild == node.mActualNode) {\r\n\r\n node.mActualNode.mParent.mLeftChild = null;\r\n }\r\n //node.mActualNode = null;\r\n\r\n }\r\n //if deleted node has degree 1 and has only left child\r\n else if(node.hasLeftChild() && !node.hasRightChild()){\r\n node.mActualNode.mLeftChild.mParent = node.mActualNode.mParent;\r\n //if deleted node is left child of his father\r\n if(node.mActualNode.mParent.mLeftChild == node.mActualNode)\r\n node.mActualNode.mParent.mLeftChild = node.mActualNode.mLeftChild;\r\n //if deleted node is right child of his father\r\n else {\r\n\r\n node.mActualNode.mParent.mRightChild = node.mActualNode.mLeftChild;\r\n }\r\n }\r\n // if deleted node has degree 1 and has only right child\r\n else if(node.hasRightChild() && !node.hasLeftChild()){\r\n node.mActualNode.mRightChild.mParent = node.mActualNode.mParent;\r\n\r\n //if node is left child of his father\r\n if(node.mActualNode.mParent.mLeftChild == node.mActualNode) {\r\n\r\n\r\n node.mActualNode.mParent.mLeftChild = node.mActualNode.mRightChild;\r\n\r\n }\r\n //if node is right child of his father\r\n else\r\n node.mActualNode.mParent.mRightChild = node.mActualNode.mRightChild;\r\n\r\n\r\n }\r\n else\r\n System.out.println(\"Error : node has two child\");\r\n\r\n }",
"public AnyType deleteMin() throws NoSuchElementException {\n\t\t\n\t\t// if the heap is empty, throw a NoSuchElementException\n\t\tif(this.size() == 0){\n\t\t\tthrow new NoSuchElementException();\n\t\t}\n\n\t\t// store the minimum item so that it may be returned at the end\n\t\tAnyType minValue = this.findMin();\n\n\t\t// replace the item at minIndex with the last item in the tree\n\t\tAnyType lastValue = this.array[this.size()-1];\n\t\tthis.array[0] = lastValue;\n\t\tthis.array[this.size() - 1] = null;\n\t\t\n\t\t// update size\n\t\tthis.currentSize--;\n\n\t\t// percolate the item at minIndex down the tree until heap order is restored\n\t\t// It is STRONGLY recommended that you write a percolateDown helper method!\n\t\tthis.percolateDown(0);\n\t\t\n\t\t// return the minimum item that was stored\n\t\treturn minValue;\n\t}",
"Nodefh removeMin(){\n\t\t\n\t\tif(min == null){\n\t\t\tNodefh dummy = new Nodefh();\n\t\t\tdummy.index = -1;\n\t\t\treturn dummy;\n\t\t}\n\t\tNodefh temp = new Nodefh();\n\t\ttemp = min;\n\t\tif((min.Child == null) && (min == min.Right)){\n\t\t\tmin = null;\n\t\t\treturn temp;\n\t\t}\n\t\tpairwiseCombine();\n\t\treturn temp;\n\t}",
"public int delete(int k)\r\n\t{\r\n\t\tIAVLNode node = searchFor(this.root, k);\r\n\t\tIAVLNode parent;\r\n\t\tif(node==root)\r\n\t\t\tparent=new AVLNode(null);\r\n\t\telse\r\n\t\t\tparent=node.getParent();\r\n\t\t\r\n\t\tIAVLNode startHieghtUpdate = parent; // this will be the node from which we'll start updating the nodes' hieghts\r\n\t\t\r\n\t\tif (!node.isRealNode())\r\n\t\t\treturn -1;\r\n\t\t\r\n\t\t//updating the maximum and minimum fields\r\n\t\tif (node == this.maximum)\r\n\t\t\tthis.maximum = findPredecessor(node);\r\n\t\telse\r\n\t\t\tif (node == this.minimum)\r\n\t\t\t\tthis.minimum = findSuccessor(node); \r\n\t\t\r\n\t\t//if the node we wish to delete is a leaf\r\n\t\tif (!node.getLeft().isRealNode()&&!node.getRight().isRealNode())\r\n\t\t{\r\n\t\t\tif (node == parent.getLeft())\r\n\t\t\t\tparent.setLeft(node.getRight());\r\n\t\t\telse\r\n\t\t\t\tparent.setRight(node.getRight());\r\n\t\t\tnode.getRight().setParent(parent);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t //if the node we wish to delete is unary:\r\n\t\t\tif (node.getLeft().isRealNode()&&!node.getRight().isRealNode()) //only left child\r\n\t\t\t{\r\n\t\t\t\tif (node == parent.getLeft())\r\n\t\t\t\t\tparent.setLeft(node.getLeft());\r\n\t\t\t\telse\r\n\t\t\t\t\tparent.setRight(node.getLeft());\r\n\t\t\t\tnode.getLeft().setParent(parent);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tif (node.getRight().isRealNode()&&!node.getLeft().isRealNode()) //only right child\r\n\t\t\t\t\t{\r\n\t\t\t\t\tif (node == parent.getLeft())\r\n\t\t\t\t\t\tparent.setLeft(node.getRight());\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tparent.setRight(node.getRight());\r\n\t\t\t\t\tnode.getRight().setParent(parent);\r\n\t\t\t\t\t}\r\n\t\t\t\t//if the node we wish to delete is a father of two\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t\tIAVLNode suc = findSuccessor(node);\r\n\t\t\t\t\t\tIAVLNode sucsParent = suc.getParent();\r\n\t\t\t\t\t\t//deleting the successor of the node we wish to delete\r\n\t\t\t\t\t\tif (suc == sucsParent.getLeft())\r\n\t\t\t\t\t\t\tsucsParent.setLeft(suc.getRight());\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tsucsParent.setRight(suc.getRight());\r\n\t\t\t\t\t\tsuc.getRight().setParent(sucsParent);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//inserting the successor in it's new place (the previous place of the node we deleted)\r\n\t\t\t\t\t\tif (node == parent.getLeft())\r\n\t\t\t\t\t\t\tparent.setLeft(suc);\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tparent.setRight(suc);\r\n\t\t\t\t\t\tsuc.setParent(parent);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// node's children are now his scuccessor's children\r\n\t\t\t\t\t\tsuc.setRight(node.getRight());\r\n\t\t\t\t\t\tsuc.setLeft(node.getLeft());\r\n\t\t\t\t\t\tsuc.getRight().setParent(suc);\r\n\t\t\t\t\t\tsuc.getLeft().setParent(suc);\r\n\t\t\t\t\t\t//now we check if the successor of the node we wanted to delete was his son\r\n\t\t\t\t\t\tif (node != sucsParent) // the successor's parent was the deleted node (which is no longer part of the tree)\r\n\t\t\t\t\t\t\tstartHieghtUpdate = sucsParent;\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tstartHieghtUpdate = suc;\r\n\t\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//if we wish to delete the tree's root, then we need to update the tree's root to a new node\r\n\t\tif (node == this.root) \r\n\t\t{\r\n\t\t\tthis.root = parent.getRight();\r\n\t\t\tthis.root.setParent(null);\r\n\t\t}\r\n\t\t\r\n\t\tint moneRot = HieghtsUpdating(startHieghtUpdate);\r\n\t\treturn moneRot;\r\n\t}",
"void deleteFromFirst(){\r\n\t\tif (start==null){\r\n\t\t\tSystem.out.print(\"LL is empty\");\r\n\t\t}\r\n\t\telse{\r\n\t\t\tnode temp=start;\r\n\t\t\tstart=start.next;\r\n\t\t\tSystem.out.print(temp.data+\" is going to be deleted\");\r\n\t\t\ttemp=null;\r\n\t\t}\r\n\t}",
"Node deleteNode(Node root, int key) \n {\n if (root == null) \n return root; \n \n // If the key to be deleted is smaller than \n // the root's key, then it lies in left subtree \n if (key < root.key) \n root.left = deleteNode(root.left, key); \n \n // If the key to be deleted is greater than the \n // root's key, then it lies in right subtree \n else if (key > root.key) \n root.right = deleteNode(root.right, key); \n \n // if key is same as root's key, then this is the node \n // to be deleted \n else\n { \n // node with only one child or no child \n if ((root.left == null) || (root.right == null)) \n { \n Node temp = null; \n if (temp == root.left) \n temp = root.right; \n else\n temp = root.left; \n \n // No child case \n if (temp == null) \n { \n temp = root; \n root = null; \n } \n else // One child case \n root = temp; // Copy the contents of \n // the non-empty child \n } \n else\n { \n \n // node with two children: Get the inorder \n // successor (smallest in the right subtree) \n Node temp = minValueNode(root.right); \n \n // Copy the inorder successor's data to this node \n root.key = temp.key; \n \n // Delete the inorder successor \n root.right = deleteNode(root.right, temp.key); \n } \n } \n \n // If the tree had only one node then return \n if (root == null) \n return root; \n \n // STEP 2: UPDATE HEIGHT OF THE CURRENT NODE \n root.height = max(height(root.left), height(root.right)) + 1; \n \n // STEP 3: GET THE BALANCE FACTOR OF THIS NODE (to check whether \n // this node became unbalanced) \n int balance = getBalance(root); \n \n // If this node becomes unbalanced, then there are 4 cases \n // Left Left Case \n if (balance > 1 && getBalance(root.left) >= 0) \n return rightRotate(root); \n \n // Left Right Case \n if (balance > 1 && getBalance(root.left) < 0) \n { \n root.left = leftRotate(root.left); \n return rightRotate(root); \n } \n \n // Right Right Case \n if (balance < -1 && getBalance(root.right) <= 0) \n return leftRotate(root); \n \n // Right Left Case \n if (balance < -1 && getBalance(root.right) > 0) \n { \n root.right = rightRotate(root.right); \n return leftRotate(root); \n } \n \n return root; \n }",
"public static TreapNode deleteNode(TreapNode root, int key)\n {\n // base case: the key is not found in the tree\n if (root == null) {\n return null;\n }\n\n // if the key is less than the root node, recur for the left subtree\n if (key < root.data) {\n root.left = deleteNode(root.left, key);\n }\n\n // if the key is more than the root node, recur for the right subtree\n else if (key > root.data) {\n root.right = deleteNode(root.right, key);\n }\n\n // if the key is found\n else {\n // Case 1: node to be deleted has no children (it is a leaf node)\n if (root.left == null && root.right == null)\n {\n // deallocate the memory and update root to null\n root = null;\n }\n\n // Case 2: node to be deleted has two children\n else if (root.left != null && root.right != null)\n {\n // if the left child has less priority than the right child\n if (root.left.priority < root.right.priority)\n {\n // call `rotateLeft()` on the root\n root = rotateLeft(root);\n\n // recursively delete the left child\n root.left = deleteNode(root.left, key);\n }\n else {\n // call `rotateRight()` on the root\n root = rotateRight(root);\n\n // recursively delete the right child\n root.right = deleteNode(root.right, key);\n }\n }\n\n // Case 3: node to be deleted has only one child\n else {\n // choose a child node\n TreapNode child = (root.left != null)? root.left: root.right;\n root = child;\n }\n }\n\n return root;\n }",
"@Test\n public void remove_BST_0_CaseRootLeafRight()\n {\n BinarySearchTree bst = new BinarySearchTree();\n No root = new No(2);\n No no = new No(3);\n \n bst.insert(root, root);\n //bst.printTree();\n \n bst.insert(root, no);\n //bst.printTree();\n //System.err.println(); // Print[ERR] Devido a prioridade do buffer de impressao (out, err)\n \n assertEquals(new Integer(2), bst.size());\n assertEquals(no, bst.remove(no));\n assertEquals(new Integer(1), bst.size());\n //bst.printTree();\n }",
"public boolean remove(T x) {\n\t\tNode<T> u = findLast(x);\n\t\tif (u == nil || c.compare(u.x, x) != 0)\n\t\t\treturn false;\n\t\tNode<T> w = u.right;\n\t\tif (w == nil) {\n\t\t\tw = u;\n\t\t\tu = w.left;\n\t\t} else {\n\t\t\twhile (w.left != nil)\n\t\t\t\tw = w.left;\n\t\t\tu.x = w.x;\n\t\t\tu = w.right;\n\t\t}\n\t\tsplice(w);\n\t\tu.colour += w.colour;\n\t\tSystem.out.printf(\"Remove(%s): u.parent = w.parent;%n\", x.toString());\n\t\tSystem.out.printf(\"BEFORE: u = %s, u.parent = %s, w = %s, w.parent = %s%n\", u,\n\t\t\t\tu.parent, w, w.parent);\n\t\tSystem.out.printf(\"BEFORE: nil = %s, nil.parent = %s, nil.left = %s, nil.right = %s%n\",\n\t\t\t\tnil, nil.parent, nil.left, nil.right);\n\t\tu.parent = w.parent;\n\t\tSystem.out.printf(\" AFTER: u = %s, u.parent = %s, w = %s, w.parent = %s%n\", u,\n\t\t\t\tu.parent, w, w.parent);\n\t\tSystem.out.printf(\" AFTER: nil = %s, nil.parent = %s, nil.left = %s, nil.right = %s%n\",\n\t\t\t\tnil, nil.parent, nil.left, nil.right);\n\t\tremoveFixup(u);\n\t\treturn true;\n\t}",
"public String remove()\n\t{\n\t\tString result = null;\n\t\tif (pointer > 0)\n\t\t{\n\t\t\tif (pointer == 1)\n\t\t\t{\n\t\t\t\tpointer--;\n\t\t\t\tresult = data[pointer];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tString oldRoot = data[0];\n\t\t\t\tString oldLast = data[pointer - 1];\n\t\t\t\tdata[0] = oldLast;\n\t\t\t\tdata[pointer - 1] = oldRoot;\n\t\t\t\tpointer--;\n\t\t\t\tresult = data[pointer];\n\t\t\t\tint parent = 0;\n\t\t\t\t//left child\n\t\t\t\tint childLeft = parent * 2 + 1;\n\n\t\t\t\twhile (childLeft < pointer)\n\t\t\t\t{\n\t\t\t\t\t//right child\n\t\t\t\t\tint childRight = parent * 2 + 2;\n\t\t\t\t\t//assume the mininum of the two children is left child\n\t\t\t\t\tint childMin = childLeft;\n\t\t\t\t\tif (childRight < pointer)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (smallerThan(childRight, childLeft))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tchildMin = childRight;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (smallerThan(childMin, parent))\n\t\t\t\t\t{\n\t\t\t\t\t\t//downheap\n\t\t\t\t\t\tswap(childMin, parent);\n\t\t\t\t\t\tparent = childMin;\n\t\t\t\t\t\tchildLeft = parent * 2 + 1;\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}",
"private BinarySearchTree deleteTree(BinarySearchTree tree, Comparable key){\r\n\t\t\r\n\t\t//If it is a leaf\r\n\t\tif(tree.getLeftChild() == null && tree.getRightChild() == null){\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t//Tree has only 1 leaf\r\n\t\telse if( (tree.getLeftChild() == null && tree.getRightChild() != null) ||\r\n\t\t\t\t (tree.getLeftChild() != null && tree.getRightChild() == null)){\r\n\t\t\t\r\n\t\t\t//Make a new tree out of the leaf and make it the new root\r\n\t\t\tif(tree.getLeftChild() != null){\r\n\t\t\t\treturn tree.getLeftChild();\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn tree.getRightChild();\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Has two leaves. This case is slightly more complicated\r\n\t\telse{\r\n\t\t\t//get the leftmost item in the right child subtree. This becomes the \r\n\t\t\t//new root. This allows the BinarySearchTree to stay a valid \r\n\t\t\t//BinarySearchTree\r\n\t\t\tKeyedItem replacementItem = findLeftMost(tree.getRightChild());\r\n\t\t\t\r\n\t\t\t//Delete the tree with that item so it can be moved to the new root\r\n\t\t\tBinarySearchTree replacementTree = deleteLeftMost(tree.getRightChild());\r\n\t\t\t\r\n\t\t\t//change the root to the new item\r\n\t\t\ttree.setRootItem(replacementItem);\r\n\t\t\t\r\n\t\t\t//Set the new roots right tree to the replacement tree\r\n\t\t\ttree.attachRightSubtree(replacementTree);\r\n\t\t\treturn tree;\r\n\t\t}\r\n\t}",
"public static void testTreeDelete()\n {\n ArrayList<Tree<String>> treelist = new ArrayList<Tree<String>>();\n treelist.add(new BinaryTree<String>());\n treelist.add(new AVLTree<String>());\n treelist.add(new RBTree<String>());\n treelist.add(new SplayTree<String>());\n\n System.out.println(\"Start TreeDelete test\");\n for(Tree<String> t : treelist)\n {\n\n try\n {\n RobotRunner.loadDictionaryIntoTree(\"newDutch.dic\", t);\n// RobotRunner.loadDictionaryIntoTree(\"smallDutch.dic\", t);\n// RobotRunner.loadDictionaryIntoTree(\"Dutch.dic\", t); //Won't work with BinaryTree and SplayTree, too many items == StackOverflow\n// RobotRunner.loadDictionaryIntoTree(\"dict.txt\", t); //Won't work with BinaryTree and SplayTree, too many items == StackOverflow\n }\n catch(IOException e)\n {\n System.out.println(e);\n }\n System.out.println(\"\\nStart Testcase\");\n\n SystemAnalyser.start();\n t.delete(\"aanklotsten\");\n SystemAnalyser.stop();\n\n SystemAnalyser.printPerformance();\n\n System.out.println(\"Stop Testcase\\n\");\n }\n System.out.println(\"Values after test.\");\n SystemAnalyser.printSomeTestValues();\n }",
"@Test\n public void remove_BST_0_CaseRoot()\n {\n BinarySearchTree bst = new BinarySearchTree();\n No root = new No(6);\n bst.insert(null, root);\n bst.insert(root, new No(2));\n bst.insert(root, new No(9));\n //bst.printTree();\n //System.err.println(); // Print[ERR] Devido a prioridade do buffer de impressao (out, err)\n \n assertEquals(root, bst.remove(root));\n assertEquals(new Integer(2), bst.size());\n //bst.printTree();\n }",
"public void prune() {\n this.getTree().prune();\n }",
"public void delete(SplayNode n) {\n\t\t this.splay(n);\n\n\t\t SplayTree leftSubtree = new SplayTree();\n\t\t leftSubtree.root = this.root.left;\n\t\t if(leftSubtree.root != null)\n\t\t leftSubtree.root.parent = null;\n\n\t\t SplayTree rightSubtree = new SplayTree();\n\t\t rightSubtree.root = this.root.right;\n\t\t if(rightSubtree.root != null)\n\t\t rightSubtree.root.parent = null;\n\n\t\t if(leftSubtree.root != null) {\n\t\t \tSplayNode m = leftSubtree.maximum(leftSubtree.root);\n\t\t leftSubtree.splay(m);\n\t\t leftSubtree.root.right = rightSubtree.root;\n\t\t this.root = leftSubtree.root;\n\t\t }\n\t\t else {\n\t\t this.root = rightSubtree.root;\n\t\t }\n\t\t }",
"public T deleteMin();",
"private void deleteNode(Cat valueToDelete, Node root){\n Node temp = findNode(valueToDelete, root);\n if(temp.getRight()==null){\n Node parent = temp.getParent();\n if(temp.getLeft()==null){\n temp.setParent(null);\n if(temp==parent.getRight()){\n parent.setRight(null);\n fixBalanceValues(parent,-1);\n }\n else{\n parent.setLeft(null);\n fixBalanceValues(parent,1);\n }\n \n }\n else{\n //copy value of leftchild into the node to deletes data and delete it's leftchild\n temp.setData(temp.getLeft().getData());\n temp.setLeft(null);\n fixBalanceValues(temp, 1);\n }\n }\n Node nodeToDelete = temp.getRight();\n if(nodeToDelete.getLeft()==null){\n temp.setData(nodeToDelete.getData());\n temp.setRight(null);\n nodeToDelete.setParent(null);\n fixBalanceValues(temp,-1);\n }\n else{\n while(nodeToDelete.getLeft()!=null){\n nodeToDelete=nodeToDelete.getLeft(); \n } \n temp.setData(nodeToDelete.getData());\n Node parent = nodeToDelete.getParent();\n parent.setLeft(null);\n nodeToDelete.setParent(null);\n fixBalanceValues(parent,1);\n }\n \n \n }",
"public boolean delete(String name)\r\n\t{\r\n\t\t// Find the location of the Node with the search method and assign it to current\r\n\t\tNode current = search(name);\r\n\t\t\r\n\t\t// Return False if the Node was not found\r\n\t\tif(current == null)\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// Special case of deleting the root Node\r\n\t\tif(current == getRoot())\r\n\t\t{\r\n\t\t\t// Root has no children (aka is a leaf)\r\n\t\t\tif(getRoot().isLeaf())\r\n\t\t\t{\r\n\t\t\t\t// Deleting the Root (aka destroying the Binary Tree)\r\n\t\t\t\tdestroy();\r\n\t\t\t}\r\n\t\t\t// Root only has a left child\r\n\t\t\telse if(getRoot().getRightChild() == null)\r\n\t\t\t{\r\n\t\t\t\t// Make the left child of the deleted Root the new Root\r\n\t\t\t\tsetRoot(current.getLeftChild());\r\n\t\t\t\tcurrent.getLeftChild().setParent(null);\r\n\t\t\t\tdecrementCounter();\r\n\t\t\t}\r\n\t\t\t// Root only has a right child\r\n\t\t\telse if(getRoot().getLeftChild() == null)\r\n\t\t\t{\r\n\t\t\t\t// Make the right child of the deleted Root the new Root\r\n\t\t\t\tsetRoot(current.getRightChild());\r\n\t\t\t\tcurrent.getRightChild().setParent(null);\r\n\t\t\t\tdecrementCounter();\r\n\t\t\t}\r\n\t\t\t// Root has two children\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// Find the minimum of the Right Subtree of the Node to delete to use as the replacement\r\n\t\t\t\tNode minimum = findMinimum(current.getRightChild());\r\n\t\t\t\t\r\n\t\t\t\t// Copy the String from the minimum Node to the original Node we were supposed to delete\r\n\t\t\t\tcurrent.setName(minimum.getName());\r\n\t\t\t\t\r\n\t\t\t\t// Delete what used to be the minimum from the Tree\r\n\t\t\t\t// The minimum is the right child of its parent\r\n\t\t\t\tif(minimum.getParent().getRightChild() == minimum)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Minimum by definition cannot have a left child, however:\r\n\t\t\t\t\t// The minimum has no children\r\n\t\t\t\t\tif(minimum.getRightChild() == null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Just delete the minimum\r\n\t\t\t\t\t\tminimum.getParent().setRightChild(null);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// The minimum has a right child\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Delete the minimum but connect its child and its parent\r\n\t\t\t\t\t\tminimum.getParent().setRightChild(minimum.getRightChild());\r\n\t\t\t\t\t\tminimum.getRightChild().setParent(minimum.getParent());\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Node was deleted so adjust the counter accordingly\r\n\t\t\t\t\tdecrementCounter();\r\n\t\t\t\t}\r\n\t\t\t\t// The minimum is the left child of its parent\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t// Minimum by definition cannot have a left child, however:\r\n\t\t\t\t\t// The minimum has no children\r\n\t\t\t\t\tif(minimum.getRightChild() == null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Just delete the minimum\r\n\t\t\t\t\t\tminimum.getParent().setLeftChild(null);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// The minimum has a right child\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Delete the minimum but connect its child and its parent\r\n\t\t\t\t\t\tminimum.getParent().setLeftChild(minimum.getRightChild());\r\n\t\t\t\t\t\tminimum.getRightChild().setParent(minimum.getParent());\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Node was deleted so adjust the counter accordingly\r\n\t\t\t\t\tdecrementCounter();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}// END special root case\r\n\t\t// Deleting any other Node besides the root\r\n\t\telse\r\n\t\t{\r\n\t\t\t// Node to delete has no children (aka is a leaf)\r\n\t\t\tif(current.isLeaf())\r\n\t\t\t{\r\n\t\t\t\t// Delete the Node by finding out what type of child it is\r\n\t\t\t\t// Node is a left child\r\n\t\t\t\tif(current.getParent().getLeftChild() == current)\r\n\t\t\t\t{\r\n\t\t\t\t\tcurrent.getParent().setLeftChild(null);\r\n\t\t\t\t}\r\n\t\t\t\t// Node is a right child\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tcurrent.getParent().setRightChild(null);\r\n\t\t\t\t}\r\n\t\t\t\t// Node was deleted so adjust the counter accordingly\t\r\n\t\t\t\tdecrementCounter();\r\n\t\t\t}\r\n\t\t\t// Node to delete only has a left child\r\n\t\t\telse if(current.getRightChild() == null)\r\n\t\t\t{\r\n\t\t\t\t// Connect the Node to delete's parent and left child\r\n\t\t\t\t// Need to first find out what type of child the Node to delete is\r\n\t\t\t\t// Node is a left child\r\n\t\t\t\tif(current.getParent().getLeftChild() == current)\r\n\t\t\t\t{\r\n\t\t\t\t\tcurrent.getLeftChild().setParent(current.getParent());\r\n\t\t\t\t\tcurrent.getParent().setLeftChild(current.getLeftChild());\r\n\t\t\t\t}\r\n\t\t\t\t// Node is a right child\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tcurrent.getLeftChild().setParent(current.getParent());\r\n\t\t\t\t\tcurrent.getParent().setRightChild(current.getLeftChild());\r\n\t\t\t\t}\r\n\t\t\t\t\t// Node was deleted so adjust the counter accordingly\r\n\t\t\t\t\tdecrementCounter();\r\n\t\t\t}\r\n\t\t\t// Node to delete only has a right child\r\n\t\t\telse if(current.getLeftChild() == null)\r\n\t\t\t{\r\n\t\t\t\t// Connect the Node to delete's parent and right child\r\n\t\t\t\t// Need to first find out what type of child the Node to delete is\r\n\t\t\t\t// Node is a left child\r\n\t\t\t\tif(current.getParent().getLeftChild() == current)\r\n\t\t\t\t{\r\n\t\t\t\t\tcurrent.getRightChild().setParent(current.getParent());\r\n\t\t\t\t\tcurrent.getParent().setLeftChild(current.getRightChild());\r\n\t\t\t\t}\r\n\t\t\t\t// Node is a right child\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tcurrent.getRightChild().setParent(current.getParent());\r\n\t\t\t\t\tcurrent.getParent().setRightChild(current.getRightChild());\r\n\t\t\t\t}\r\n\t\t\t\t\t// Node was deleted so adjust the counter accordingly\r\n\t\t\t\t\tdecrementCounter();\r\n\t\t\t}\r\n\t\t\t// Node to delete has two children\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// Find the minimum of the Right Subtree of the Node to delete to use as the replacement\r\n\t\t\t\tNode minimum = findMinimum(current.getRightChild());\r\n\t\t\t\t\r\n\t\t\t\t// Copy the String from the minimum Node to the Node we were supposed to delete\r\n\t\t\t\tcurrent.setName(minimum.getName());\r\n\t\t\t\t\r\n\t\t\t\t// Delete what used to be the minimum from the Tree\r\n\t\t\t\t// The minimum is the right child of its parent\r\n\t\t\t\tif(minimum.getParent().getRightChild() == minimum)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Minimum by definition cannot have a left child, however:\r\n\t\t\t\t\t// The minimum has no children\r\n\t\t\t\t\tif(minimum.getRightChild() == null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Just delete the minimum\r\n\t\t\t\t\t\tminimum.getParent().setRightChild(null);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// The minimum has a right child\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Delete the minimum but connect its child and its parent\r\n\t\t\t\t\t\tminimum.getParent().setRightChild(minimum.getRightChild());\r\n\t\t\t\t\t\tminimum.getRightChild().setParent(minimum.getParent());\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Node was deleted so adjust the counter accordingly\r\n\t\t\t\t\tdecrementCounter();\r\n\t\t\t\t}\r\n\t\t\t\t// The minimum is the left child of its parent\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t// Minimum by definition cannot have a left child, however:\r\n\t\t\t\t\t// The minimum has no children\r\n\t\t\t\t\tif(minimum.getRightChild() == null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Just delete the minimum\r\n\t\t\t\t\t\tminimum.getParent().setLeftChild(null);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// The minimum has a right child\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Delete the minimum but connect its child and its parent\r\n\t\t\t\t\t\tminimum.getParent().setLeftChild(minimum.getRightChild());\r\n\t\t\t\t\t\tminimum.getRightChild().setParent(minimum.getParent());\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Node was deleted so adjust the counter accordingly\r\n\t\t\t\t\tdecrementCounter();\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\r\n\t\t}// END of deleting any case except for Root\r\n\t\t\r\n\t\t// Balance the tree only if necessary - the current depth of the tree is greater than what it should be based on \r\n\t\t// the total amount of Nodes in the tree\r\n\t\tif(depth() > howManyLevels())\r\n\t\t{\r\n\t\t\tbalance();\r\n\t\t}\r\n\t\t// A Node was deleted so return true\r\n\t\treturn true;\r\n\t}",
"public BinaryNode removeNode(BinaryNode node){\n if(isLeaf(node)){//base case\n BinaryNode parent = (BinaryNode) node.getParent();\n if(parent == null){\n root = null;\n }\n else{\n parent.removeChild(node);\n }\n size--;\n return parent;\n }\n BinaryNode lower = descendant(node);\n promote(lower, node);\n return removeNode(lower);\n }",
"public int delete(int k) {\n\t\tif (this.empty()) {// empty tree, nothing to erase\n\t\t\treturn -1;\n\t\t}\n\t\tAVLNode root = (AVLNode) this.root;\n\t\tAVLNode node = (AVLNode) root.delFindNode(k);\n\t\tif (node == null) {// no node with key==k in this tree\n\t\t\treturn -1;\n\t\t}\n\t\tchar side = node.parentSide();\n\t\tboolean rootTerm = (node.getLeft().getKey() != -1 && node.getRight().getKey() != -1);\n\t\tif (side == 'N' && (rootTerm == false)) {\n\t\t\treturn this.deleteRoot(node);\n\t\t}\n\t\tif (side == 'L') {\n\t\t\tif (node.isLeaf()) {\n\t\t\t\tint leftEdge = node.parent.getHeight() - node.getHeight();\n\t\t\t\tint rightEdge = node.parent.getHeight() - node.parent.getRight().getHeight();\n\t\t\t\tAVLNode parent = (AVLNode) node.parent;\n\t\t\t\tif (leftEdge == 1 && rightEdge == 1) {// first case (\"easy one\", just delete)\n\t\t\t\t\tnode.parent.setLeft(new AVLNode());\n\t\t\t\t\tnode.setParent(null);\n\t\t\t\t\tparent.updateSize();\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\tif (leftEdge == 1 && rightEdge == 2) {\n\t\t\t\t\tnode.parent.setLeft(new AVLNode());\n\t\t\t\t\tnode.setParent(null);\n\t\t\t\t\tparent.setHeight(parent.getHeight() - 1);\n\t\t\t\t\tparent.setSize();\n\t\t\t\t\treturn this.delRecTwos(parent);\n\t\t\t\t} else {// leftEdge==2&&rightEdge==1\n\t\t\t\t\tnode.parent.setLeft(new AVLNode());\n\t\t\t\t\tnode.setParent(null);\n\t\t\t\t\treturn this.delRecTriOne(parent, side);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ((node.left != null && node.right == null) || (node.left == null && node.right != null)) {// node is //\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// unary\n\t\t\t\tint leftEdge = node.parent.getHeight() - node.getHeight();\n\t\t\t\tint rightEdge = node.parent.getHeight() - node.parent.getRight().getHeight();\n\t\t\t\tif ((leftEdge == 1 && rightEdge == 1)) {\n\t\t\t\t\tif (node.left != null) {\n\t\t\t\t\t\tAVLNode parent = node.delUnaryLeft();\n\t\t\t\t\t\tparent.updateSize();\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t} else {// node.right!=null\n\t\t\t\t\t\tAVLNode parent = node.delUnaryRight();\n\t\t\t\t\t\tparent.updateSize();\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ((leftEdge == 1 && rightEdge == 2)) {\n\t\t\t\t\tif (node.left != null) {\n\t\t\t\t\t\treturn this.delRecTwos(node.delUnaryLeft());\n\t\t\t\t\t} else {// node.right!=null\n\t\t\t\t\t\treturn this.delRecTwos(node.delUnaryRight());\n\t\t\t\t\t}\n\t\t\t\t} else {// leftEdge==2&&rightEdge==1\n\t\t\t\t\tif (node.left != null) {\n\t\t\t\t\t\treturn this.delRecTriOne(node.delUnaryLeft(), side);\n\t\t\t\t\t} else {// node.right!=null\n\t\t\t\t\t\treturn this.delRecTriOne(node.delUnaryRight(), side);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tif (side == 'R') {\n\t\t\tif (node.isLeaf()) {\n\t\t\t\tint rightEdge = node.parent.getHeight() - node.getHeight();\n\t\t\t\tint leftEdge = node.parent.getHeight() - node.parent.getLeft().getHeight();\n\t\t\t\tAVLNode parent = (AVLNode) node.parent;\n\t\t\t\tif (leftEdge == 1 && rightEdge == 1) {// first case (\"easy one\", just delete)\n\t\t\t\t\tnode.parent.setRight(new AVLNode());\n\t\t\t\t\tnode.setParent(null);\n\t\t\t\t\tparent.updateSize();\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\tif (leftEdge == 2 && rightEdge == 1) {\n\t\t\t\t\tnode.parent.setRight(new AVLNode());\n\t\t\t\t\tnode.setParent(null);\n\t\t\t\t\tparent.setHeight(parent.getHeight() - 1);\n\t\t\t\t\tparent.setSize();\n\t\t\t\t\treturn this.delRecTwos(parent);\n\t\t\t\t} else {// leftEdge==1&&rightEdge==2\n\t\t\t\t\tnode.parent.setRight(new AVLNode());\n\t\t\t\t\tnode.setParent(null);\n\t\t\t\t\treturn this.delRecTriOne(parent, side);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ((node.getLeft().getHeight() != -1 && node.getRight().getHeight() == -1)\n\t\t\t\t\t|| (node.getLeft().getHeight() == -1 && node.getRight().getHeight() != -1)) {// node is unary\n\t\t\t\tint rightEdge = node.parent.getHeight() - node.getHeight();\n\t\t\t\tint leftEdge = node.parent.getHeight() - node.parent.getLeft().getHeight();\n\t\t\t\tif ((leftEdge == 1 && rightEdge == 1)) {\n\t\t\t\t\tif (node.left != null) {\n\t\t\t\t\t\tAVLNode parent = node.delUnaryLeft();\n\t\t\t\t\t\tparent.updateSize();\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t} else {// node.right!=null\n\t\t\t\t\t\tAVLNode parent = node.delUnaryRight();\n\t\t\t\t\t\tparent.updateSize();\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ((leftEdge == 2 && rightEdge == 1)) {\n\t\t\t\t\tif (node.left != null) {\n\t\t\t\t\t\treturn this.delRecTwos(node.delUnaryLeft());\n\t\t\t\t\t} else {// node.right!=null\n\t\t\t\t\t\treturn this.delRecTwos(node.delUnaryRight());\n\t\t\t\t\t}\n\t\t\t\t} else {// leftEdge==1&&rightEdge==2\n\t\t\t\t\tif (node.left != null) {\n\t\t\t\t\t\treturn this.delRecTriOne(node.delUnaryLeft(), side);\n\t\t\t\t\t} else {// node.right!=null\n\t\t\t\t\t\treturn this.delRecTriOne(node.delUnaryRight(), side);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\t// we get here only if node is binary, and thus not going through any other\n\t\t// submethod\n\t\tAVLNode successor = this.findSuccessor(node); // successor must be unary/leaf\n\t\tif (node.checkRoot()) {\n\t\t\tthis.root = successor;\n\t\t}\n\t\tint numOp = this.delete(successor.key);\n\t\tsuccessor.setHeight(node.getHeight());\n\t\tsuccessor.size = node.getSize();\n\t\tsuccessor.setRight(node.getRight());\n\t\tnode.right.setParent(successor);\n\t\tnode.setRight(null);\n\t\tsuccessor.setLeft(node.getLeft());\n\t\tnode.left.setParent(successor);\n\t\tnode.setLeft(null);\n\t\tsuccessor.setParent(node.getParent());\n\t\tif (node.parentSide() == 'L') {\n\t\t\tnode.parent.setLeft(successor);\n\t\t} else if (node.parentSide() == 'R') {// node.parentSide()=='R'\n\t\t\tnode.parent.setRight(successor);\n\t\t}\n\t\tnode.setParent(null);\n\t\treturn numOp;\n\n\t}",
"public static TreapNode deleteNode(TreapNode root, int key)\n {\n if (root == null)\n return root;\n\n if (key < root.key)\n root.left = deleteNode(root.left, key);\n else if (key > root.key)\n root.right = deleteNode(root.right, key);\n\n // IF KEY IS AT ROOT\n\n // If left is null\n else if (root.left == null)\n {\n TreapNode temp = root.right;\n root = temp; // Make right child as root\n }\n\n // If Right is null\n else if (root.right == null)\n {\n TreapNode temp = root.left;\n root = temp; // Make left child as root\n }\n\n // If key is at root and both left and right are not null\n else if (root.left.priority < root.right.priority)\n {\n root = leftRotate(root);\n root.left = deleteNode(root.left, key);\n }\n else\n {\n root = rightRotate(root);\n root.right = deleteNode(root.right, key);\n }\n\n return root;\n }",
"public void deleteMax()\t\t\t\t//delete largest key\n\t{\n\t\troot=deleteMax(root);\n\t}",
"private TSTNode<E> deleteNodeRecursion(TSTNode<E> currentNode) {\n \n if(currentNode == null) return null;\n if(currentNode.relatives[TSTNode.EQKID] != null || currentNode.data != null) return null; // can't delete this node if it has a non-null eq kid or data\n\n TSTNode<E> currentParent = currentNode.relatives[TSTNode.PARENT];\n\n // if we've made it this far, then we know the currentNode isn't null, but its data and equal kid are null, so we can delete the current node\n // (before deleting the current node, we'll move any lower nodes higher in the tree)\n boolean lokidNull = currentNode.relatives[TSTNode.LOKID] == null;\n boolean hikidNull = currentNode.relatives[TSTNode.HIKID] == null;\n\n ////////////////////////////////////////////////////////////////////////\n // Add by Cheok. To resolve java.lang.NullPointerException\n // I am not sure this is the correct solution, as I have not gone\n // through this sourc code in detail.\n if (currentParent == null && currentNode == this.rootNode) {\n // if this executes, then current node is root node\n rootNode = null;\n return null;\n }\n // Add by Cheok. To resolve java.lang.NullPointerException\n ////////////////////////////////////////////////////////////////////////\n\n // now find out what kind of child current node is\n int childType;\n if(currentParent.relatives[TSTNode.LOKID] == currentNode) {\n childType = TSTNode.LOKID;\n } else if(currentParent.relatives[TSTNode.EQKID] == currentNode) {\n childType = TSTNode.EQKID;\n } else if(currentParent.relatives[TSTNode.HIKID] == currentNode) {\n childType = TSTNode.HIKID;\n } else {\n // if this executes, then current node is root node\n rootNode = null;\n return null;\n }\n\n if(lokidNull && hikidNull) {\n // if we make it to here, all three kids are null and we can just delete this node\n currentParent.relatives[childType] = null;\n return currentParent;\n }\n\n // if we make it this far, we know that EQKID is null, and either HIKID or LOKID is null, or both HIKID and LOKID are NON-null\n if(lokidNull) {\n currentParent.relatives[childType] = currentNode.relatives[TSTNode.HIKID];\n currentNode.relatives[TSTNode.HIKID].relatives[TSTNode.PARENT] = currentParent;\n return currentParent;\n }\n\n if(hikidNull) {\n currentParent.relatives[childType] = currentNode.relatives[TSTNode.LOKID];\n currentNode.relatives[TSTNode.LOKID].relatives[TSTNode.PARENT] = currentParent;\n return currentParent;\n }\n\n int deltaHi = currentNode.relatives[TSTNode.HIKID].splitchar - currentNode.splitchar;\n int deltaLo = currentNode.splitchar - currentNode.relatives[TSTNode.LOKID].splitchar;\n int movingKid;\n TSTNode<E> targetNode;\n \n // if deltaHi is equal to deltaLo, then choose one of them at random, and make it \"further away\" from the current node's splitchar\n if(deltaHi == deltaLo) {\n if(Math.random() < 0.5) {\n deltaHi++;\n } else {\n deltaLo++;\n }\n }\n\n\tif(deltaHi > deltaLo) {\n movingKid = TSTNode.HIKID;\n targetNode = currentNode.relatives[TSTNode.LOKID];\n } else {\n movingKid = TSTNode.LOKID;\n targetNode = currentNode.relatives[TSTNode.HIKID];\n }\n\n while(targetNode.relatives[movingKid] != null) targetNode = targetNode.relatives[movingKid];\n \n // now targetNode.relatives[movingKid] is null, and we can put the moving kid into it.\n targetNode.relatives[movingKid] = currentNode.relatives[movingKid];\n\n // now we need to put the target node where the current node used to be\n currentParent.relatives[childType] = targetNode;\n targetNode.relatives[TSTNode.PARENT] = currentParent;\n\n if(!lokidNull) currentNode.relatives[TSTNode.LOKID] = null;\n if(!hikidNull) currentNode.relatives[TSTNode.HIKID] = null;\n\n // note that the statements above ensure currentNode is completely dereferenced, and so it will be garbage collected\n return currentParent;\n }",
"public void removeLevel()\r\n {\r\n if( tables.size()>1 )\r\n {\r\n tables.removeFirst();\r\n }\r\n if( counts.size()>1 )\r\n {\r\n counts.removeFirst();\r\n }\r\n }",
"public Node deleteNode(Node root, int key) {\n if (root == null)\n return root;\n\n /* Otherwise, recur down the tree */\n if (key < root.data)\n root.left = deleteNode(root.left, key);\n else if (key > root.data)\n root.right = deleteNode(root.right, key);\n\n // if key is same as root's\n // key, then This is the\n // node to be deleted\n else {\n // node with only one child or no child\n if (root.left == null)\n return root.right;\n else if (root.right == null)\n return root.left;\n\n // node with two children: Get the inorder\n // successor (smallest in the right subtree)\n root.data = minValue(root.right);\n\n // Delete the inorder successor\n root.right = deleteNode(root.right, root.data);\n }\n\n return root;\n }",
"public void remove(AnyType x) {\n\t\troot = remove(x, root);\n\t}",
"public void delete(String key) {\n key = key.toLowerCase();\n BTreeNode leftChild = root.getChild(0);\n BTreeNode rightChild = root.getChild(1);\n\n if (!root.isLeaf() && root.getN() == 1 && leftChild.getN() < T_VAR && rightChild.getN() < T_VAR) {\n root = mergeSingleKeyRoot();\n }\n if (root.keyExist(key)) {\n if (root.isLeaf()) {\n root.deleteKey(key);\n }\n else {\n root.handleCase2(key);\n }\n }\n else {\n root.handleCase4(key);\n }\n }",
"public MinHeapNode<T> deleMin() {\n\t\tif(!isEmpty()) { \r\n\t\t\tMinHeapNode<T> min = heap[1]; //min node\r\n\t heap[1] = heap[currentSize--]; //move bottom node to root\r\n\t heapDown(1); //move root down\r\n\t return min; \r\n\t } \r\n\t return null; \r\n\t}",
"public void delete(E data){\n \t// Preform a regular delete\n \t// Check to make sure the tree remains an RBT tree\n\tNode<E> z = search(data);\n\tNode<E> x = sentinel;\n\tNode<E> y = z;\n\tCharacter y_original_color = y.getColor();\n\tif (z.getLeftChild() == sentinel) {\n\t\tx = z.getRightChild();\n\t\ttransplant(z, z.getRightChild());\n\t} else if (z.getRightChild() == sentinel) {\n\t\tx = z.getLeftChild();\n\t\ttransplant(z, z.getLeftChild());\n\t} else {\n\t\ty = getMin(z.getRightChild());\n\t\ty_original_color = y.getColor();\n\t\tx = y.getRightChild();\n\t\tif (y.getParent() == z) {\n\t\t\tx.setParent(y);\n\t\t} else {\n\t\t\ttransplant(y, y.getRightChild());\n\t\t\ty.setRightChild(z.getRightChild());\n\t\t\ty.getRightChild().setParent(y);\n\t\t}\n\t\t\n\t\ttransplant(z, y);\n\t\ty.setLeftChild(z.getLeftChild());\n\t\ty.getLeftChild().setParent(y);\n\t\ty.setColor(z.getColor());\n\t}\n\t\n\tif (y_original_color == 'B') {\n\t\tfixDelete(x);\n\t}\n\t\t\n \n }",
"private Node prune(Node r) {\r\n if (r == null) return null;\r\n Op op = r.op();\r\n r.left(prune(r.left()));\r\n if (r.left() == null) r.ref(prune(r.ref()));\r\n else r.right(prune(r.right()));\r\n if (r.right() != null && r.right().op() == Temp) r.right(null);\r\n if (op == Temp) return r.left();\r\n return r;\r\n }",
"private BSTNode<K> deleteNode(BSTNode<K> currentNode, K key) throws IllegalArgumentException{ \n // if key is null, throw an IllegalArgumentException\n if (key == null) {\n throw new IllegalArgumentException(\"Please input a valid key\");\n }\n // if currentNode is null, return null\n if (currentNode == null) \n return currentNode; \n // otherwise, keep searching through the tree until meet the node with value key\n switch(key.compareTo(currentNode.getId())){\n case -1:\n currentNode.setLeftChild(deleteNode(currentNode.getLeftChild(), key));\n break;\n case 1:\n currentNode.setRightChild(deleteNode(currentNode.getRightChild(), key));\n break;\n case 0:\n // build a temporary node when finding the node that need to be deleted\n BSTNode<K> tempNode = null;\n // when the node doesn't have two childNodes\n // has one childNode: currentNode = tempNode = a childNode\n // has no childNode: currentNode = null, tempNode = currentNode\n if ((currentNode.getLeftChild() == null) || (currentNode.getRightChild() == null)) {\n if (currentNode.getLeftChild() == null) \n tempNode = currentNode.getRightChild(); \n else \n tempNode = currentNode.getLeftChild(); \n \n if (tempNode == null) {\n //tempNode = currentNode; \n currentNode = null; \n }\n else\n currentNode = tempNode;\n }\n // when the node has two childNodes, \n // use in-order way to find the minimum node in its subrighttree, called rightMinNode\n // set tempNode = rightMinNode, and currentNode's ID = tempNode.ID\n // do recursion to update the subrighttree with currentNode's rightChild and tempNode's Id\n else {\n BSTNode<K> rightMinNode = currentNode.getRightChild();\n while (rightMinNode.getLeftChild() != null)\n rightMinNode = rightMinNode.getLeftChild();\n \n tempNode = rightMinNode;\n currentNode.setId(tempNode.getId());\n \n currentNode.setRightChild(deleteNode(currentNode.getRightChild(), tempNode.getId()));\n }\n }\n // since currentNode == null means currentNode has no childNode, return null to its ancestor\n if (currentNode == null) \n return currentNode; \n // since currentNode != null, we have to update its balance\n int balanceValue = getNodeBalance(currentNode);\n if (balanceValue < -1) { // balanceValue < -1 means sublefttree is longer than subrighttree\n if (getNodeBalance(currentNode.getLeftChild()) < 0) { // Left Left Case \n return rotateRight(currentNode);\n }\n else if (getNodeBalance(currentNode.getLeftChild()) >= 0) { // Left Right Case \n currentNode.setLeftChild(rotateLeft(currentNode.getLeftChild()));\n return rotateRight(currentNode);\n }\n }\n else if (balanceValue > 1) { // balanceValue < -1 means subrighttree is longer than sublefttree\n if ((getNodeBalance(currentNode.getRightChild()) > 0)) { // Right Right Case \n return rotateLeft(currentNode);\n }\n else if ((getNodeBalance(currentNode.getRightChild()) <= 0)) {// Right Left Case \n currentNode.setRightChild(rotateRight(currentNode.getRightChild()));\n return rotateLeft(currentNode);\n }\n }\n return currentNode;\n }",
"public static TreeNode delete(TreeNode t, String target)\n {\n \n if(t == null)\n return null;\n \n else if(target.compareTo((String)t.getValue()) < 0)\n t.setLeft(delete(t.getLeft(), target));\n else if(target.compareTo((String)t.getValue()) > 0)\n t.setRight(delete(t.getRight(), target));\n else\n {\n //t.getValue() == v\n //ndoe thats leaf or one child\n if(t.getLeft() == null)\n return t.getRight();\n else if (t.getRight() == null)\n return t.getLeft();\n \n \n //if node has 2 children\n t.setValue(min(t.getRight()));\n \n //recursive call \n t.setRight(delete(t.getRight(), (String)t.getValue()));\n }\n return t;\n \n }",
"private void clean() {\n //use iterator\n Iterator<Long> it = nodes.keySet().iterator();\n while (it.hasNext()) {\n Long node = it.next();\n if (nodes.get(node).adjs.isEmpty()) {\n it.remove();\n }\n }\n }",
"public void remove(E x) {\n\n if(head == null) {\n return; // nothing to return.\n }\n\n if(head.data.equals(x)) {\n head = head.next; // moves where the first pointer is pointing to, and the garbage collector will delete the first element that has not pointers(old one)\n size--;\n return;\n }\n\n // Day 2\n RectNode<E> current = head;\n RectNode<E> back = head;\n\n while(current != null && !current.data.equals(x)) {\n back = current;\n current = current.next;\n }\n\n if(current == null) return;\n\n // else\n back.next = current.next;\n size--;\n\n }",
"private void removeWord(Node root,String word,int index){\n if(index == word.length()){ //not word.length()-1 because starts from empty root\n //visiting the last Node to Remove\n //but need to remove later when com back to its paren root.removeChild(ch);\n //cause need to check weather node has children or not\n System.out.println(root.value);\n root.isEndOfWord = false; //CARE can only physically 'E' but CAR Node R has E children so R.isEndOfWord =false\n return;\n }\n\n //1st get the 'ch' at the index of th word\n var ch = word.charAt(index);\n\n //get the child Node of ch in root/children\n var child = root.getChild(ch);\n\n //if word doesn't exist/ no any Characters\n if(child == null) return;\n\n //post order traversal visiting child 1st\n removeWord(child,word,index+1); //recursively remove/ go to the next indexes of the word\n\n //then visit root to remove last index\n System.out.println(root.value);\n // if the child doesn't have any children\n // or no any characters related to end of the removing word\n //ex: cant remove word 'CAT' cause 'CATEGORY' exist.\n //if doesnt have any children and it's not the end of another word, physically remove it\n if(!child.hasChildren() && !child.isEndOfWord)\n root.removeChild(ch); //CARE can only physically 'E' but CAR Node R has E children\n\n }",
"public void remove(BinaryNode input){\n\t\tBinaryNode node = this.root;\n\t\tBinaryNode parent = null;\n\t\tboolean isFound = false;\n\t\tboolean leftNode = false;\n\t\tboolean rightNode = false;\n\t\twhile(node != null){\n\t\t\tif(node.getData() == input.getData()){\n\t\t\t\tisFound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if(node.getData() > input.getData()){\n\t\t\t\tparent = node;\n\t\t\t\tleftNode = true;\n\t\t\t\trightNode = false;\n\t\t\t\tnode = node.getLeft();\n\t\t\t}\n\t\t\telse if(node.getData() < input.getData()){\n\t\t\t\tparent = node;\n\t\t\t\tleftNode = false;\n\t\t\t\trightNode = true;\n\t\t\t\tnode = node.getRight();\n\t\t\t}\n\t\t}\n\t\t\n\t\t/*\n\t\t * Check \n\t\t */\n\t\tif(isFound){\n\t\t\tif(node.getLeft() == null && node.getRight() == null){\n\t\t\t\tif(leftNode){\n\t\t\t\t\tparent.setLeft(null);\n\t\t\t\t}else if(rightNode){\n\t\t\t\t\tparent.setRight(node);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\t/*\n\t\t\t\t *find the min from the right \n\t\t\t\t */\n\t\t\t\tif(node.getRight() != null){\n\t\t\t\t\tBinaryNode temp = node.getRight();\n\t\t\t\t\twhile(temp.getLeft() != null){\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(node.getLeft() != null){\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public void remove( Object x )\n {\n LinkedListItr p = findPrevious( x );\n\n if( p.current.next != null )\n p.current.next = p.current.next.next; // Bypass deleted node\n }",
"public static Node delete (BST bst, String name){\n\t\tNode bstRoot = bst.getRoot();\n\t\tNode deletedNode = findByName(bstRoot, name); // The node to be removed from the bst.\n\t\tNode substituteNode = floorOrCeiling(deletedNode); // The substitute node for the removed one.\n\t\t\n\t\t\n\t\tSystem.out.println(\"\\nThe node to be deleted:\");\n\t\tSystem.out.println(deletedNode);\n\n\t\tSystem.out.println(\"\\nThe substitute for the deleted node:\");\n\t\tSystem.out.println(substituteNode);\n\t\t\n\t\t/* If the node to be removed is an external node, which has no children nodes,\n\t\t then there is no need for the substitute node. Thus, we can simply set the nodes\n\t\t that point to the external nodes to null to remove the node.\n\t\t*/\n\t\tif ((deletedNode.getRight()==null)&&(deletedNode.getLeft()==null)){\n\t\t\tif(deletedNode.getName().compareTo(deletedNode.getParent().getName())<0)\n\t\t\t\tdeletedNode.getParent().setLeft(null);\t\t\t\n\t\t\telse\n\t\t\t\tdeletedNode.getParent().setRight(null);\n\t\t\t\n\t\t\tdeletedNode.setLeft(null);\n\t\t\tdeletedNode.setRight(null);\n\t\t\tdeletedNode.setParent(null);\n\t\t\t\n\t\t\treturn bstRoot;\n\t\t}\n\t\t\n\t\t/* If the node to be removed is not a root node, we'll apply the general approach.\n\t\t*/\n\t\tif (deletedNode.getParent()!=null){\n\n\t\t\t/* If the name of the parent node of the substitute node precedes the one of the substitute,\n\t\t\t * then, set the right child of the parent node to a null unless the substitute node is a child\n\t\t\t * of the deleted node.\n\t\t\t */\n\t\t\tif(substituteNode.getParent().getName().compareTo(substituteNode.getName())<0)\t\t\t\n\t\t\t\tif(substituteNode == deletedNode.getRight())\n\t\t\t\t\tsubstituteNode.getParent().setRight(substituteNode.getRight());\n\t\t\t\telse\t\n\t\t\t\tsubstituteNode.getParent().setRight(null);\n\t\t\t\n\t\t\t/* If the name of the parent node of the substitute node succeeds the one of the substitute,\n\t\t\t * then, set the left child of the parent node to a null unless the substitute node is a child\n\t\t\t * of the deleted node.\n\t\t\t */\n\t\t\telse\n\t\t\t\tif(substituteNode == deletedNode.getLeft())\n\t\t\t\t\tsubstituteNode.getParent().setLeft(substituteNode.getLeft());\n\t\t\t\telse\n\t\t\t\t\tsubstituteNode.getParent().setLeft(null);\n\t\t\t\n\t\t\t\n\t\t\t/* If the name of the parent node of the deleted node succeed the one of the substitute,\n\t\t\t * then, set substitute node as the left child of the parent node of the deleted node.\n\t\t\t * Otherwise, set the substitute to the right child.\n\t\t\t */\n\t\t\tif(deletedNode.getParent().getName().compareTo(substituteNode.getName())>0)\n\t\t\t\tdeletedNode.getParent().setLeft(substituteNode);\n\t\t\t\t\n\t\t\telse\n\t\t\t\tdeletedNode.getParent().setRight(substituteNode);\t\t\t\n\t\t\t\n\n\t\t\t/* Duplicates the binding that the deleted node previously had.\n\t\t\t */\n\t\t\tsubstituteNode.setLeft(deletedNode.getLeft());\n\t\t\tsubstituteNode.setRight(deletedNode.getRight());\n\t\t\tsubstituteNode.setParent(deletedNode.getParent());\n\t\t\t\n\t\t\t\n\t\t\t/* If the deleted node has any child, then set the substitute node as their parent node.\n\t\t\t */\n\t\t\tif (deletedNode.getRight()!=null)\n\t\t\t\tdeletedNode.getRight().setParent(substituteNode);\n\t\t\t\n\t\t\tif (deletedNode.getLeft()!=null)\n\t\t\tdeletedNode.getLeft().setParent(substituteNode);\n\t\t\t\n\t\t\tdeletedNode.setLeft(null);\n\t\t\tdeletedNode.setRight(null);\n\t\t\tdeletedNode.setParent(null);\n\t\t}\t\n\t\t/* If the node to be removed is a root node, we'll approach a bit differently.\n\t\t*/\t\t\t\n\t\telse{\n\t\t\t/* Sets the child node of the parent of the substitute one to null.\n\t\t\t*/\t\t\t\n\t\t\tif(substituteNode.getParent().getName().compareTo(substituteNode.getName())<0)\n\t\t\t\tsubstituteNode.getParent().setRight(null);\n\t\t\telse\n\t\t\t\tsubstituteNode.getParent().setLeft(null);\n\t\t\t\n\t\t\t/* Duplicates the binding that the deleted node previously had without setting the parent node.\n\t\t\t */\n\t\t\tsubstituteNode.setLeft(deletedNode.getLeft());\n\t\t\tsubstituteNode.setRight(deletedNode.getRight());\n\t\t\t\n\t\t\t\n\t\t\t/* If the deleted node has any child, then set the substitute node as their parent node.\n\t\t\t*/\t\t\t\n\t\t\tif (deletedNode.getRight()!=null)\n\t\t\t\tdeletedNode.getRight().setParent(substituteNode);\n\t\t\t\n\t\t\tif (deletedNode.getLeft()!=null)\n\t\t\tdeletedNode.getLeft().setParent(substituteNode);\t\n\t\t\t\n\t\t\t\n\t\t\tdeletedNode.setLeft(null);\n\t\t\tdeletedNode.setRight(null);\n\t\t\tdeletedNode.setParent(null);\n\t\t\t\n\t\t\tSystem.out.println(\"\\nThe node \" + deletedNode + \" is removed from the tree successfully\\n\");\n\t\t\t\n\t\t\treturn substituteNode;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"\\nThe node \" + deletedNode + \" is removed from the tree successfully\\n\");\n\n\n\t\treturn bstRoot;\n\t\t\n\t}",
"public NodeBinaryTree deleteNode(NodeBinaryTree node, int value)\n {\n if(node == null)\n {\n return null;\n }\n\n if(value < node.data)\n {\n node.leftNode = deleteNode(node.leftNode, value);\n }\n else if(value > node.data)\n {\n node.rightNode = deleteNode(node.rightNode, value);\n }\n else\n {\n // it is the condition where the the ndoe value is itself\n if(node.leftNode == null)\n {\n return node.rightNode;\n }\n else if(node.rightNode == null)\n {\n return node.leftNode;\n }\n\n // we traverse right part of tree for minimum value\n node.data = minimumValueOfRight(node.rightNode);\n node.rightNode = deleteNode(node.rightNode, node.data);\n }\n return node;\n }",
"Object unlink(Node x) {\n final Object element = x.item;\n final Node next = x.next;\n final Node prev = x.pre;\n\n //当前节点为first节点\n if (prev == null) {\n //删除这个节点时,要将next节点赋值为first节点\n first = next;\n } else {\n prev.next = next;\n x.pre = null;\n }\n\n //最后一个节点\n if (next == null) {\n last = prev;\n } else {\n next.pre = prev;\n x.next = null;\n }\n\n x.item = null;\n size--;\n return element;\n }",
"public boolean Delete(int num) {\r\n\t\t//initialize boolean field, set to true if value found in tree\r\n\t\tboolean found;\r\n\t\t//initialize the parent node using the TreeNodeWrapper\r\n\t\tTreeNodeWrapper p = new TreeNodeWrapper();\r\n\t\t//initialize the child node using the TreeNodeWrapper\r\n\t\tTreeNodeWrapper c = new TreeNodeWrapper();\r\n\t\t//initialize largest field to re-allocate parent/child nodes\r\n\t\tTreeNode largest;\r\n\t\t//initialize nextLargest field to re-allocate parent/child nodes\r\n\t\tTreeNode nextLargest;\r\n\t\t//found set to true if FindNode methods locates value in the tree\r\n\t\tfound = FindNode(num, p, c);\r\n\t\t//if node not found return false\r\n\t\tif(found == false)\r\n\t\t\treturn false;\r\n\t\telse //identify the case number\r\n\t\t{\r\n\t\t\t//case 1: deleted node has no children\r\n\t\t\t//if left and right child nodes of value are both null node has no children\r\n\t\t\tif(c.Get().Left == null && c.Get().Right == null)\r\n\t\t\t\t//if parent left node is equal to child node then deleted node is a left child\r\n\t\t\t\tif(p.Get().Left == c.Get())\r\n\t\t\t\t\tp.Get().Left = null;\r\n\t\t\t\telse //deleted node is a right child\r\n\t\t\t\t\tp.Get().Right = null;\r\n\t\t\t//case 2: deleted node has 1 child\r\n\t\t\t//if deleted node only has 1 child node\r\n\t\t\telse if(c.Get().Left == null || c.Get().Right == null)\r\n\t\t\t{\r\n\t\t\t\t//if parent left node is equal to child node then deleted node is a left child\r\n\t\t\t\tif(p.Get().Left == c.Get())\r\n\t\t\t\t{\r\n\t\t\t\t\t//if deleted node is a left child then set deleted node child node as child to parent node\r\n\t\t\t\t\tif(c.Get().Left != null) //deleted node has a left child\r\n\t\t\t\t\t\tp.Get().Left = c.Get().Left;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tp.Get().Left = c.Get().Right;\r\n\t\t\t\t}\r\n\t\t\t\telse //if deleted node is a right child then set deleted node child node as child to parent node\r\n\t\t\t\t{\r\n\t\t\t\t\tif(c.Get().Left != null) //deleted node has a left child\r\n\t\t\t\t\t\tp.Get().Right = c.Get().Left;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tp.Get().Right = c.Get().Right;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//case 3: deleted node has two children\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t//set the nextLargest as the left child of deleted node\r\n\t\t\t\tnextLargest = c.Get().Left;\r\n\t\t\t\t//set the largest as the right node of the nextLargest node\r\n\t\t\t\tlargest = nextLargest.Right;\r\n\t\t\t\t//if right node is not null then left child has a right subtree\r\n\t\t\t\tif(largest != null) \r\n\t\t\t\t{\r\n\t\t\t\t\t//while loop to move down the right subtree and re-allocate after node is deleted\r\n\t\t\t\t\twhile(largest.Right != null) //move down right subtree\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tnextLargest = largest;\r\n\t\t\t\t\t\tlargest = largest.Right;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//overwrite the deleted node\r\n\t\t\t\t\tc.Get().Data = largest.Data; \r\n\t\t\t\t\t// save the left subtree\r\n\t\t\t\t\tnextLargest.Right = largest.Left; \r\n\t\t\t\t}\r\n\t\t\t\telse //left child does not have a right subtree\r\n\t\t\t\t{\r\n\t\t\t\t\t//save the right subtree\r\n\t\t\t\t\tnextLargest.Right = c.Get().Right; \r\n\t\t\t\t\t//deleted node is a left child\r\n\t\t\t\t\tif(p.Get().Left == c.Get()) \r\n\t\t\t\t\t\t//jump around deleted node\r\n\t\t\t\t\t\tp.Get().Left = nextLargest; \r\n\t\t\t\t\telse //deleted node is a right child\r\n\t\t\t\t\t\tp.Get().Right = nextLargest; //jump around deleted node\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//return true is delete is successful\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}"
] | [
"0.7397829",
"0.7287364",
"0.7287364",
"0.6900219",
"0.688817",
"0.6743239",
"0.6616305",
"0.6603571",
"0.6595944",
"0.65892124",
"0.65749466",
"0.6517136",
"0.6500276",
"0.64912796",
"0.6475314",
"0.64326924",
"0.63879836",
"0.6373097",
"0.6373097",
"0.63635176",
"0.633381",
"0.6324514",
"0.6306744",
"0.63032705",
"0.62962806",
"0.6289702",
"0.6273062",
"0.6267105",
"0.62406665",
"0.6198543",
"0.6176975",
"0.61719537",
"0.6162766",
"0.6147984",
"0.6111428",
"0.61060435",
"0.6104833",
"0.610397",
"0.60868114",
"0.6078122",
"0.6064974",
"0.60396695",
"0.6038344",
"0.60011387",
"0.59885246",
"0.5971042",
"0.5968844",
"0.59504056",
"0.59420156",
"0.59222084",
"0.59143335",
"0.5896308",
"0.5893933",
"0.5890683",
"0.5889201",
"0.58879244",
"0.58658427",
"0.5863566",
"0.58523643",
"0.5850999",
"0.5850196",
"0.5843978",
"0.5840771",
"0.58353204",
"0.58330035",
"0.58318925",
"0.5817272",
"0.58109176",
"0.58081037",
"0.58028704",
"0.57987225",
"0.57956123",
"0.57878727",
"0.5777714",
"0.5773507",
"0.5757971",
"0.57491076",
"0.5743554",
"0.5735973",
"0.5735121",
"0.5732902",
"0.573281",
"0.5724487",
"0.571964",
"0.5713083",
"0.5711143",
"0.5708347",
"0.57032895",
"0.5698258",
"0.5696861",
"0.5695569",
"0.5688702",
"0.5685122",
"0.5683425",
"0.5679443",
"0.5679197",
"0.5676547",
"0.5669555",
"0.5659306",
"0.5653215"
] | 0.7265826 | 3 |
returns the max node in the same level of node x Precondition: x != null | private Node<Value> max(Node<Value> x)
{
while (x.right != null) x = x.right;
return x;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public SplayNode maximum(SplayNode x) {\n\t\t while(x.right != null)\n\t\t x = x.right;\n\t\t return x;\n\t\t }",
"private BinaryNode max(BinaryNode node) {\n if (node == null) return node.parent;\n else if (node.right == null) return node;\n else return max(node.right);\n }",
"public static Node findMax(Node node){\n if(node.right!=null){ // recursive right-subtree จนตกเกือบ null แล้ว return node นั้น\n return findMax(node.right);\n }\n else{\n return node;}\n }",
"public Node findMax(){\n if(root!=null){ // มี node ใน tree\n return findMax(root); // Call the recursive version\n }\n else{\n return null;\n }\n }",
"private Node max(Node node){\n if(node == null)\n return null;\n else if(node.right == null)\n return node;\n\n //walk through right branch\n return max(node.right);\n }",
"public Node max() {\n\t\tNode x = root;\n\t\tif (x == null) return null;\n\t\twhile (x.getRight() != null)\n\t\t\tx = x.getRight();\n\t\treturn x;\n\t}",
"public int findMaxValueWithoutRecursion() {\n\t\tQueue<XTreeNode<Integer>> collectedNodes = new LinkedList<>();\n\t\tcollectedNodes.add( (XTreeNode<Integer>) this );\n\n\t\tint maxValue = Integer.MIN_VALUE;\n\t\twhile( !collectedNodes.isEmpty() ) {\n\t\t\tXTreeNode<Integer> node = collectedNodes.poll();\n\t\t\tmaxValue = node.getData() > maxValue ? node.getData() : maxValue;\n\n\t\t\tif( node.getLeftChild() != null ) {\n\t\t\t\tcollectedNodes.add( node.getLeftChild() );\n\t\t\t}\n\t\t\tif( node.getRightChild() != null ) {\n\t\t\t\tcollectedNodes.add( node.getRightChild() );\n\t\t\t}\n\t\t}\n\t\treturn maxValue;\n\t}",
"private AvlNode<E> findMax(AvlNode<E> node){\n if(node.right == null){\n return node;\n } else {\n return findMax(node.right);\n }\n }",
"protected final IntervalNode treeMax() {\n\tIntervalNode x = this;\n\twhile(x.right != IntervalNode.nullIntervalNode) {\n\t x = x.right;\n\t}\n\treturn(x);\n }",
"public static <T> T findMax(Node<T> t) {\n if (t == null)\n return null;\n else if (t.right == null)//right-most node found\n return t.data;\n else\n return findMax(t.right);//recursive call to traverse as far right\n }",
"public E findMax(){\n if(!isEmpty()){\n AvlNode<E> node = findMax(root);\n return (E)node.value;\n } else {\n return null;\n }\n }",
"public TreeNode<T> getMaxElement(){\n TreeNode<T> t = this;\n while(t.right != null){\n t = t.right;\n }\n return t;\n }",
"private BinaryNode<AnyType> findMax( BinaryNode<AnyType> t )\r\n\t{\r\n\t\tif( t != null )\r\n\t\t\twhile( t.right != null )\r\n\t\t\t\tt = t.right;\r\n\r\n\t\treturn t;\r\n\t}",
"public int findMax(){\n\t\tif(root==nil){\n\t\t\treturn 0;\n\t\t}\n\t\tNode temp = root;\n\t\twhile(temp.right != nil){\n\t\t\ttemp = temp.right;\n\t\t}\n\t\treturn temp.id;\n\t}",
"private Node findLargestNodeIn(Node n) {\n if (n != null) {\n while (n.rightChild != null) {\n n = n.rightChild;\n }\n }\n return n;\n }",
"public Node getMax() {\n Node current = root;\n while (current.right != null) {\n current = current.right;\n }\n return current;\n }",
"private BinaryNode<AnyType> findMax(BinaryNode<AnyType> t) {\n\t\tif (t != null)\n\t\t\twhile (t.right != null)\n\t\t\t\tt = t.right;\n\n\t\treturn t;\n\t}",
"public TreeNode largest() {\n\t\tif(root == null) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tTreeNode current = root; \n\t\t\twhile(current.getRightChild() != null) {\n\t\t\t\tcurrent = current.getRightChild();\n\t\t\t}\n\t\t\treturn current;\n\t\t}\n\t}",
"private BinaryNode<AnyType> findMax(BinaryNode<AnyType> t) {\r\n\t\tif (t != null)\r\n\t\t\twhile (t.right != null)\r\n\t\t\t\tt = t.right;\r\n\r\n\t\treturn t;\r\n\t}",
"public static Object max(TreeNode t)\n {\n if(t == null)\n return null;\n if(t.getRight() == null)\n return t.getValue();\n return max(t.getRight());\n }",
"AVLTreeNode Max() {\r\n\r\n AVLTreeNode current = root;\r\n\r\n /* loop down to find the leftmost leaf */\r\n while (current.right != null)\r\n current = current.right;\r\n\r\n return current;\r\n\r\n\r\n }",
"private BSTNode<T> maximum(BSTNode node){\r\n\t\twhile(node.right != null) {\r\n\t\t\tnode = node.right;\r\n\t\t}\r\n\t\treturn node;\r\n\t}",
"public E findMax() {\n Node<E> temp = root;\n // while loop will run until there is no longer a node that has a right child.\n // temp is then assigned to the next node in the right child and will return\n // the node with the maximum value in the BST. The node that does not have a right\n // child will be the maximum value.\n while(temp.right != null){\n temp = temp.right;\n }\n return temp.getInfo();\n }",
"public int findMaxValue(Node root) {\n if(root == null) {\n return Integer.MIN_VALUE;\n }\n int output = (int)root.getData();\n int leftOutput = findMaxValue(root.getLeftChildNode());\n int rightOutput = findMaxValue(root.getRightChildNode());\n if(leftOutput > output){\n output = leftOutput;\n }\n if(rightOutput > output) {\n output = rightOutput;\n }\n return output;\n\n }",
"private int findMaxValue( XTreeNode<E> rootNode ) {\n\t\tif( rootNode == null ) {\n\t\t\treturn Integer.MIN_VALUE;\n\t\t}\n\n\t\tint rootValue = (Integer) rootNode.getData();\n\t\tint maxValue = rootValue;\n\n\t\tint leftValue = findMaxValue( rootNode.getLeftChild() );\n\t\tint rightValue = findMaxValue( rootNode.getRightChild() );\n\n\t\t// not using if else if, as need to compare three values - root, left, right\n\t\tif( leftValue > rootValue ) {\n\t\t\tmaxValue = leftValue;\n\t\t}\n\t\tif( rightValue > maxValue ) {\n\t\t\tmaxValue = rightValue;\n\t\t}\n\t\treturn maxValue;\n\t}",
"@Override\r\n\tpublic T maximum() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tif(this.root == null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tBSTNode<T> node = maximum(this.root);\r\n\t\tif(node != null) {\r\n\t\t\treturn node.data;\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"public T largest(Node node) {\n while (node.right != null) {\n node = node.right;\n }\n return node.element;\n }",
"public int\ngetNodeIndexMax();",
"public int findMax(TreeNode root){\r\n TreeNode current;\r\n if( isLeaf(root )){\r\n return root.getValue();\r\n }else {\r\n current = root;\r\n current = current.right;\r\n if( isLeaf(current)){\r\n return current.value;\r\n }\r\n if( current.left != null && current.right == null){\r\n return current.left.getValue();\r\n }\r\n }\r\n return current.getValue();\r\n }",
"int getMaxValue(AVLTreeNode node) {\n if (node == null) return Integer.MAX_VALUE;\r\n\r\n // if this is the left-most node\r\n if (node.right == null) return node.key;\r\n\r\n return getMinValue(node.right);\r\n }",
"private Node<Value> delMax(Node<Value> x)\r\n {\r\n if (x.right == null) return x.left;\r\n x.right = delMax(x.right);\r\n return x;\r\n }",
"private int getMax(TreeNode root) {\n\t\twhile(root.right!=null)\n\t\t\troot=root.right;\n\t\treturn root.val;\n\t}",
"public Node getMaximalNode(Node currentNode) {\n\t\twhile (currentNode.getrightChild() != mSentinel) {\n\t\t\tcurrentNode = currentNode.getrightChild();\n\t\t\t// simply go right until you reach an empty node\n\t\t}\n\t\treturn currentNode;\n\t\t// return the last non-empty node\n\t}",
"public BinaryNode getMaxNode(BinaryNode current, int max) throws Exception {\n getMaxNodeHelper(current, max);\n\n if (getMaxNodeFromSeq() == null) {\n throw new Exception(\"Alle Knoten sind groesser als der angegebene Wert!\");\n }\n\n return getMaxNodeFromSeq();\n }",
"private static Node mrvFindNode() {\n\t\tif (constrainedNodes.size() == 0) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\t// Was able to use this by 'implementing Comparable'\r\n\t\t// in the Node class\r\n\t\t// return max value node of constrained nodes\r\n\t\treturn Collections.max(constrainedNodes);\r\n\r\n\t}",
"@Override\n public TreeNode<E> tree_maximum() {\n return tree_maximum(root);\n }",
"public int maxElement() {\n\t\tNode max=root;\n\t\tint out=-1;\n\t\twhile(max!=null) {\n\t\t\tout=max.data;\n\t\t\tmax=max.right;\n\t\t}\n\t\treturn out;\n\t}",
"public static int max(treenode root)\n {\n treenode curr=root;\n while(curr.right!=null)\n {\n curr=curr.right;\n }\n return curr.val;\n }",
"int getMax_depth();",
"private Node removeMax(Node node){\n if(node == null)\n return null;\n else if(node.right == null){ //use its left child to replace this node(max value node)\n if(node.count!=0) { //multiple value in same node\n node.count--;\n return node;\n }\n else {\n decDepth(node.left); //maintain depth when chain in left tree\n return node.left;\n }\n }\n\n //walk through right branch\n node.right = removeMax(node.right);\n if(node!=null) node.size--; // the max value must be removed\n return node;\n }",
"public AnyType findMax() {\r\n\t\tif (isEmpty())\r\n\t\t\tthrow new UnderflowException();\r\n\t\treturn findMax(root).element;\r\n\t}",
"private static <K extends Comparable<? super K>, V> Node<K, V> findLargestNode(Node<K, V> root) {\n @Var Node<K, V> current = root;\n while (current.right != null) {\n current = current.right;\n }\n return current;\n }",
"private Node largest(Node p){\n if(p == null){\n return null;\n }\n Node largest = p;\n while(largest.right != null){\n largest = largest.right;\n }\n return largest;\n }",
"public int findMax(){\n return nilaiMaks(this.root);\n }",
"public int maxValue(Node node) {\n /* loop down to find the rightmost leaf */\n Node current = node;\n while (current.right != null)\n current = current.right;\n\n return (current.key);\n }",
"public String max() {\n\t\tif (this.empty()) {\n\t\t\treturn null;\n\t\t}\n\t\tAVLNode max = (AVLNode) this.root;\n\t\twhile (max.getRight().getHeight() != -1) {\n\t\t\tmax = (AVLNode) max.getRight();\n\t\t}\n\t\treturn max.getValue();\n\t}",
"private IAVLNode maxPointer(IAVLNode node)\r\n\t{\r\n\t\twhile (node.isRealNode())\r\n\t\t\tnode = node.getRight();\r\n\t\treturn node.getParent();\t\r\n\t}",
"Key max(Node node)\n {\n \tif(node==null)\n \t return null;\n \tif(node.right==null)\n \t return node.key;\n \telse\n \t return max(node.right);\n }",
"public static Node lmax(Node root) {\n\t\twhile(root.right!=null) {\r\n\t\t\troot=root.right;\r\n\t\t}\r\n\t\treturn root;\r\n\t}",
"public AnyType findMax() {\n\t\treturn elementAt(findMax(root));\n\t}",
"public String max()// return the value of the maximum key in the tree\r\n {\r\n\t if(empty()) {\r\n\t return null;\r\n\t }\r\n\t WAVLNode x = root;\r\n while(x.right!=EXT_NODE) {\r\n \tx=x.right;\r\n }\r\n return x.info;\r\n }",
"int getMaxLevel();",
"public int findMaximumValue(Node root) {\r\n int max = Integer.MIN_VALUE;\r\n if (root == null) {\r\n return max;\r\n } else {\r\n int leftMax = findMaximumValue(root.left);\r\n int rightMax = findMaximumValue(root.right);\r\n if (leftMax > rightMax) {\r\n max = leftMax;\r\n } else {\r\n max = rightMax;\r\n }\r\n if (root.value > max) {\r\n max = root.value;\r\n }\r\n }\r\n return max;\r\n }",
"public abstract int getMaxChildren();",
"abstract int getMaxLevel();",
"protected BSTNode getMaximumChild(BSTNode n) {\n\t\tassert (n != null);\n\n\t\twhile (hasRightChild(n)) {\n\t\t\tn = n.right;\n\t\t\t_stats.incOtherTraversals();\n\t\t}\n\n\t\treturn n;\n\t}",
"public static <T> Node<T> removeMax(Node<T> t) {\n if (t == null)\n return null;\n else if (t.right != null) {\n t.right = removeMax(t.right);//recursive call to remove max\n return t;\n } else\n return t.left;// otherwise return left node\n }",
"public int getMax() {\r\n // get root\r\n RedBlackTree.Node<Grade> max = rbt.root;\r\n // loop to right of tree\r\n while (max.rightChild != null) {\r\n max = max.rightChild;\r\n }\r\n\r\n return max.data.getGrade();\r\n }",
"public Integer largest() {\n if (root != null) {\n return root.largest();\n }\n return null;\n }",
"public FHeapNode removeMax()\r\n {\r\n FHeapNode z = maxNode;\r\n //hmap.remove(maxNode.gethashtag());\t\t\t\t\t\t\t\t\t\t//remove the node from the hashtable\r\n \r\n if (z != null) \r\n\t\t{\r\n \t for (HashMap.Entry<String, FHeapNode> entry : hmap.entrySet()) \r\n {\r\n \tif(entry.getValue() == maxNode)\r\n \t{\r\n \t\thmap.remove(entry.getKey());\r\n \t\tbreak;\r\n \t}\r\n }\r\n \t \r\n int numKids = z.degree;\r\n FHeapNode x = z.child;\r\n FHeapNode tempRight;\r\n\r\n while (numKids > 0) \t\t\t\t\t\t\t\t\t\t\t\t\t// iterate trough all the children of the max node\r\n\t\t\t{\r\n tempRight = x.right; \r\n x.left.right = x.right;\t\t\t\t\t\t\t\t\t\t\t\t// remove x from child list\r\n x.right.left = x.left;\r\n \r\n x.left = maxNode;\t\t\t\t\t\t\t\t\t\t\t\t\t// add x to root list of heap\r\n x.right = maxNode.right;\r\n maxNode.right = x;\r\n x.right.left = x;\r\n \r\n x.parent = null;\t\t\t\t\t\t\t\t\t\t\t\t\t// set parent[x] to null\r\n x = tempRight;\r\n numKids--;\r\n }\r\n\t\t\tz.left.right = z.right;\t\t\t\t\t\t\t\t\t\t\t\t\t// remove z from root list of heap\r\n z.right.left = z.left;\r\n\r\n if (z == z.right)\r\n\t\t\t{\r\n maxNode = null;\r\n } \r\n\t\t\telse \r\n\t\t\t{\r\n maxNode = z.right;\r\n meld();\r\n } \r\n nNodes--;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// decrement size of heap\r\n }\r\n \r\n\r\n return z;\r\n }",
"int maxDepth();",
"public int getLongestBranch(TreeNode node) {\n // base case:\n if (node == null) {\n return 0;\n }\n\n int left = getLongestBranch(node.left);\n int right = getLongestBranch(node.right);\n\n max = Math.max(max, right + left);\n\n return Math.max(left, right) + 1;\n\n }",
"public E deleteMax() {\r\n\t\tE max = null;\r\n\t\tif (currentIndex > 0) { // replace the root of heap with the last element on the last level\r\n\t\t\tmax = heap.get(0); // save current max\r\n\t\t\t\r\n\t\t\theap.set(0, heap.get(currentIndex - 1));\r\n\t\t\theap.remove(currentIndex - 1);\r\n\t\t\tcurrentIndex--;\r\n\t\t\t\r\n\t\t\theapifyDown(0); // re-heapify\r\n\t\t}\r\n\t\treturn max; // if tree is empty, returns null\r\n\t}",
"private int findMax(NodeTest root)\n\t{\n\t\t//traverse all of the right NodeTests of the root to find the last one at the right.\n\t\twhile (root.right != null)\n\t\t{\n\t\t\troot = root.right;\n\t\t}\n\t\t//being that it is a BST it is safe to assume that the last NodeTest to the right of the root\n\t\t//is the largest value\n\t\treturn root.data;\n\t}",
"public static TreeNode<Integer> maxSumNode(TreeNode<Integer> root){\n\t\tif(root==null) {\n\t\t\treturn null;\n\t\t}\n\t\tint sumRoot = sum(root);\n\t\tint max=Integer.MIN_VALUE;\n\t\tTreeNode<Integer> maxNode = null;\n\t\tfor(int i=0;i<root.children.size();i++) {\n\t\t\t\n\t\t\tTreeNode<Integer> maxNode1 =maxSumNode(root.children.get(i));\n\t\t\tint sum = sum(maxNode1);\n\t\t\tif( max < sum ) {\n\t\t\t\tmax = sum;\n\t\t\t\tmaxNode = maxNode1;\n\t\t\t}\n\t\t}\n\t\tif( sumRoot > max ) {\n\t\t\treturn root;\n\t\t}\n\t\treturn maxNode;\n\t\t\n\t}",
"public Node<E> getMin(Node<E> x) {\n\t\tif (x.getLeftChild() != sentinel) {\n\t\t\treturn getMin(x.getLeftChild()); //Recurisvely go throughs the left side of the tree until a null node pops up\n\t\t} else {\n\n\t\t\treturn x; //x will be the node with the minimum value \n\t\t}\n\t}",
"public AnyType findMax( ) throws Exception\r\n\t{\r\n\t\tif( isEmpty( ) )\r\n\t\t\tthrow new Exception( );\r\n\t\treturn findMax( root ).element;\r\n\t}",
"public static double max(ExpressionContext context, List nodeset) {\n if ((nodeset == null) || (nodeset.size() == 0)) {\n return Double.NaN;\n }\n\n JXPathContext rootContext = context.getJXPathContext();\n Object max = nodeset.get(0);\n\n for (int index = 1; index < nodeset.size(); index++) {\n Object current = nodeset.get(index);\n rootContext.getVariables().declareVariable(\"max\", max);\n rootContext.getVariables().declareVariable(\"current\", current);\n\n boolean more = ((Boolean) rootContext.getValue(\"number($current) > number($max)\", Boolean.class)).booleanValue();\n\n if (more) {\n max = current;\n }\n }\n\n return (new Double(max.toString())).doubleValue();\n }",
"public void testFindMax() {\r\n assertNull(tree.findMax());\r\n tree.insert(\"apple\");\r\n tree.insert(\"bagel\");\r\n assertEquals(\"bagel\", tree.findMax());\r\n tree.remove(\"bagel\");\r\n assertEquals(\"apple\", tree.findMax());\r\n }",
"private Node<Value> min(Node<Value> x)\r\n {\r\n while (x.left != null) x = x.left;\r\n return x;\r\n }",
"public int getMax()\n {\n int max = data.get(0).getX();\n\n for(int i = 0; i < data.size(); i++)\n {\n if (data.get(i).getX() > max)\n {\n max = data.get(i).getX();\n }\n }\n\n\n return max;\n }",
"E maxVal();",
"private static int maxDepth(TreeNode node) {\r\n\t\tif (node == null) return 0;\r\n\t\treturn 1 + Math.max(maxDepth(node.left), maxDepth(node.right));\r\n\t}",
"Node minValueNode(Node node) \n { \n Node current = node; \n \n /* loop down to find the leftmost leaf */\n while (current.left != null) \n current = current.left; \n \n return current; \n }",
"public E findMax() {\r\n\t\treturn heap.get(0);\r\n\t}",
"private Node min(Node x) {\n if (x.left == null)\n return x;\n else\n return min(x.left);\n }",
"public int max() {\n if (First == null) {\n return 0;\n }\n\n int max = (Integer) First.item;\n\n Node<Integer> current = First.next;\n\n while (current != null) {\n max = (current.item > max) ? current.item : max;\n current = current.next;\n }\n\n return max;\n }",
"int get_height(Node node) {\n\t\tif (node == null) \n\t\t\treturn 0;\n\t\telse if (node.leftChild == null && node.rightChild == null)\n\t\t\treturn 0;\t\t\n\t\telse return 1 + max(get_height(node.leftChild), get_height(node.rightChild));\n\t}",
"public Integer getMaxNestingLevel(){\n\t\tint i=-1;\n\t\tfor(Loop lp:loops){\n\t\t\tint temp = getNestingLevel(lp);\n\t\t\tif(temp>i)i=temp;\n\t\t}\n\t\treturn i;\n\t}",
"private static int getOptimalValue(int depth, int nodeIndex, boolean isMax,\n int[] scores, int h) {\n if (depth == h) \n return scores[nodeIndex];\n \n if (isMax) {\n return Math.max(getOptimalValue(depth+1, nodeIndex*2, false, scores, h), \n getOptimalValue(depth+1, nodeIndex * 2 + 1, false, scores, h));\n } else {\n return Math.min(getOptimalValue(depth+1, nodeIndex*2, true, scores, h), \n getOptimalValue(depth+1, nodeIndex * 2 + 1, true, scores, h));\n }\n }",
"public Dog findYoungest() {\r\n\t\tif (root == null)\r\n\t\t\treturn null;\r\n\t\t\r\n\t\treturn root.findYoungest();\r\n\t}",
"private void maximize(Node node) {\n // maximize:\n double max = Tree.MININT;\n List<Node> children = node.getChildren();\n \n// if(children.isEmpty()){\n// return;\n// }\n \n //String values = \"\";\n for (Node child : children) {\n if (child.getMove().getRating() > max) {\n max = child.getMove().getRating();\n }\n // values += \"\" + child.getMove().getRating() + \", \";\n }\n // set value\n // System.out.println(\"setting value for next parent (maximize): \" + max + \" (all values: \" + values + \")\");\n\n node.getMove().setRating(max);\n }",
"private static int getMaxChildVal(ArrayList<MMT> childLst){\n\t\t//assign values first\n\t\tfor (MMT tree: childLst){\n\t\t\tif(tree.value == null)\n\t\t\t\ttree.value = getValue(tree);\n\t\t}\n\t\t//now get max child val\n\t\tint max = childLst.get(0).value;\n\t\tfor (int i=1; i<childLst.size(); i++){\n\t\t\tif (childLst.get(i).value > max)\n\t\t\t\tmax = childLst.get(i).value;\n\t\t}\n\t\treturn max;\n\t}",
"private int height(Node<T> node){\n if(node == null)\n return 0;\n // get height of left and right side\n int left = height(node.left);\n int right = height(node.right);\n\n // height will be Max of height of left and right + 1 (Own level)\n return 1 + Math.max(left, right );\n\n }",
"Expression getMax();",
"int height(Node node) {\r\n\t\tif (node == null) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tint left = height(node.left);\r\n\t\tint right = height(node.right);\r\n\t\tint max = Integer.max(left, right);\r\n\t\treturn max + 1;\r\n\t}",
"Object getMaximumValue(Object elementID) throws Exception;",
"public int maxHeight(Node root){\n\t\tif(root == null)\n\t\t\treturn 0;\n\t\tif(root.left == null && root.right == null) //isleaf return 1\n\t\t\treturn 1;\n\t\tint max = 1; //max height\n\t\t//left subtree height + 1 == cur height\n\t\tif(maxHeight(root.left) + 1 > max) \n\t\t\tmax = maxHeight(root.left) + 1;\n\t\t//check right subtree height, if greater than left height\n\t\tif(maxHeight(root.right) + 1 > max) \n\t\t\tmax = maxHeight(root.right) + 1;\n\n\t\treturn max;\n\t}",
"@Override\r\n\tpublic T max() {\n\t\treturn null;\r\n\t}",
"public int maxDepht(Node node){\n //if a tree is empty then return 0\n if (node == null)\n return 0;\n\n else {\n //compute the depth of each subtree\n int leftDepth = maxDepht(node.left);\n int rightDepth = maxDepht(node.right);\n\n if (leftDepth > rightDepth)\n return leftDepth+1;\n else\n return rightDepth+1;\n }\n }",
"int nilaiMin(Node node){\n if (node.left != null) { // karena node yg nilainya minimum atau lebih kecil di sebelah kiri\n return nilaiMin(node.left);// maka jika != null akan me return node sebelah kiri\n }\n return node.data;\n }",
"int getMaximum();",
"static int findMaxSum(Node node){\n Res res = new Res();\n res.value = Integer.MIN_VALUE;\n findmaxUtil(node,res);\n return res.value;\n }",
"public int getMaxCount(XsdNode node) {\n\t\tXsdNode originalNode = node;\n\t\t/* if no document loaded */\n\t\tif (lineElements == null) {\n\t\t\treturn 0;\n\t\t}\n\t\t/* max count already computed */\n\t\tif (maxCounts.containsKey(node)) {\n\t\t\treturn ((Integer) maxCounts.get(node)).intValue();\n\t\t}\n\t\tint count = 0;\n\t\tint max = 0;\n\n\t\t/** for attributes get number of parent element */\n\t\tif (((Annotated) node.getUserObject()).getStructureType() == Structure.ATTRIBUTE) {\n\t\t\tnode = (XsdNode) node.getParent();\n\t\t}\n\t\tfor (int i = 0; i < lineElements.size(); i++) {\n\t\t\tcount = getMaxCount((Node) lineElements.get(i), lineNode, node,\n\t\t\t\t\tnode.pathFromAncestorEnumeration(lineNode));\n\t\t\tif (count > max)\n\t\t\t\tmax = count;\n\t\t}\n\n\t\t/* the fields are kept even if no element have been found */\n\t\tif (max < node.min) {\n\t\t\tmax = node.min;\n\t\t}\n\t\tif (max == 0) {\n\t\t\tmax = 1;\n\t\t}\n\n\t\t/* keep the result */\n\t\tmaxCounts.put(originalNode, new Integer(max));\n\n\t\treturn max;\n\t}",
"public int max(BSTNode root)\n\t{\n\t\tBSTNode curr;\n\t\tint max=Integer.MIN_VALUE;\n\t\tQueue<BSTNode> q = new LinkedList<BSTNode>();\n\t\tq.add(root);\n\t\twhile(!q.isEmpty())\n\t\t{\n\t\t\tcurr=q.poll();\n\t\t\tif(curr.getData()>max)\n\t\t\t\tmax=curr.getData();\n\t\t\tif(curr.getLeft()!=null)\n\t\t\t\tq.add(curr.getLeft());\n\t\t\tif(curr.getRight()!=null)\n\t\t\t\tq.add(curr.getRight());\n\t\t}\n\t\treturn max;\n\t}",
"public static int nodeHeight(PhyloTreeNode node) {\n if(node == null) {\n return -1;\n }\n else{\n return 1 + Math.max(nodeHeight(node.getLeftChild()), nodeHeight(node.getRightChild()));\n }\n }",
"public int maxDepth(TreeNode root) {\n helper(root,1);\n return m;\n }",
"public MoveNode getBestMove() {\n if (rootValues.isEmpty()) {\n return null;\n }\n\n MoveNode moveNode = rootValues.get(0);\n int maxScore = moveNode.getMinimaxValue();\n\n for(MoveNode m : rootValues) {\n if(m.getMinimaxValue() > maxScore) {\n moveNode = m;\n maxScore = m.getMinimaxValue();\n }\n }\n\n return moveNode;\n }",
"public int getMaxLevel()\r\n\t{\treturn this.maxLevel;\t}",
"int height(Node root) { return (root != null) ? Math.max(height(root.left), height(root.right)) + 1 : 0;}"
] | [
"0.79565084",
"0.77228284",
"0.7676104",
"0.76711506",
"0.7669645",
"0.76055866",
"0.73993266",
"0.73480994",
"0.7302343",
"0.7266952",
"0.71950936",
"0.7170117",
"0.7169756",
"0.7158297",
"0.7155722",
"0.71275467",
"0.7095053",
"0.7085013",
"0.7078152",
"0.7058162",
"0.7038047",
"0.6994923",
"0.6970569",
"0.6964845",
"0.6945022",
"0.69393635",
"0.69268095",
"0.6870409",
"0.68470514",
"0.6830902",
"0.68212",
"0.6814521",
"0.6785894",
"0.67552364",
"0.674831",
"0.6739387",
"0.67267174",
"0.67262477",
"0.6720165",
"0.6702624",
"0.6698682",
"0.6694815",
"0.6688475",
"0.6676051",
"0.66728026",
"0.6633406",
"0.6605618",
"0.6603583",
"0.6603289",
"0.65463245",
"0.6513911",
"0.65001196",
"0.6496512",
"0.64791965",
"0.6456867",
"0.64250255",
"0.64185977",
"0.6393608",
"0.6363573",
"0.63566077",
"0.63323724",
"0.62969244",
"0.6286794",
"0.6277808",
"0.61661303",
"0.6150728",
"0.6140013",
"0.61305887",
"0.6120712",
"0.60780144",
"0.60747075",
"0.6055957",
"0.60437155",
"0.6036246",
"0.603386",
"0.6033854",
"0.6018775",
"0.5996261",
"0.59856963",
"0.59692264",
"0.5967885",
"0.5960974",
"0.5951257",
"0.59480494",
"0.5939546",
"0.5934773",
"0.5932185",
"0.59263295",
"0.5916625",
"0.5908829",
"0.59076416",
"0.5905334",
"0.58990204",
"0.5893282",
"0.58927",
"0.5881036",
"0.58602923",
"0.5860145",
"0.5856535",
"0.5852006"
] | 0.7852394 | 1 |
removes the subtrie rooted at the max node in the same level of x used as assistant to delete only, otherwise would destroy the trie Precondition: x != null | private Node<Value> delMax(Node<Value> x)
{
if (x.right == null) return x.left;
x.right = delMax(x.right);
return x;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void deleteMax() {\n root = deleteMax(root);\n }",
"public void deleteMax() {\n root = deleteMax(root);\n }",
"public void delete(Node<T> x) {\n decreaseKey(x, min.key);\n extractMin();\n }",
"private A deleteLargest(int subtree) {\n return null; \n }",
"public void deleteMax()\t\t\t\t//delete largest key\n\t{\n\t\troot=deleteMax(root);\n\t}",
"private Node<Value> delMin(Node<Value> x)\r\n {\r\n if (x.left == null) return x.right;\r\n x.left = delMin(x.left);\r\n return x;\r\n }",
"private BinaryNode<AnyType> remove( AnyType x, BinaryNode<AnyType> t )\r\n\t{\r\n\t\tif( t == null )\r\n\t\t\treturn t; // Item not found; do nothing\r\n\r\n\t\tint compareResult = x.compareTo( t.element );\r\n\r\n\t\tif( compareResult < 0 )\r\n\t\t\tt.left = remove( x, t.left );\r\n\t\telse if( compareResult > 0 )\r\n\t\t\tt.right = remove( x, t.right );\r\n\t\telse if( t.left != null && t.right != null ) // Two children\r\n\t\t{\r\n\t\t\tt.element = findMin( t.right ).element;\r\n\t\t\tt.right = remove( t.element, t.right );\r\n\t\t}\r\n\t\telse\r\n\t\t\tt = ( t.left != null ) ? t.left : t.right;\r\n\t\treturn t;\r\n\t}",
"public void binomialHeapDelete(Node x) {\n\t\tthis.binomialHeapDecreaseKey(x, Integer.MIN_VALUE);\n\t\tthis.binomialHeapExtractMin();\n\t}",
"public void delete(Node x) {\n if (!redoDone)\n redoStack.clear();\n else\n redoDone = false;\n BSTTrackingData log = new BSTTrackingData(x, x.left, x.right, x.parent, null, 'd');\n Boolean isRoot = x == root;\n Node toRemove = x;\n Node succ = null;\n if (x.left != null & x.right != null) { //if Case 3 - PartA change toRemove to the successor and remove it from the tree\n succ = successorForDelete(x); //use side function to get the successor (adjusted to improve retrack runtime)\n toRemove = succ;\n log.setSuccParent(succ.parent); //update log accordingly\n }\n stack.push(log);\n deleteUpToChild(toRemove); //function to handle removal of node with up to 1 child.\n if (succ != null) { //Case 3 part B - Place the successor in x's location in the tree.\n //update parent\n succ.parent = x.parent;\n if (isRoot) {\n root = succ;\n } else {\n if (x.parent.right == x) x.parent.right = succ;\n else x.parent.left = succ;\n }\n //update both children\n succ.right = x.right;\n if (x.right != null)\n x.right.parent = succ;\n succ.left = x.left;\n if (x.left != null)\n x.left.parent = succ;\n }\n\n }",
"public FHeapNode removeMax()\r\n {\r\n FHeapNode z = maxNode;\r\n //hmap.remove(maxNode.gethashtag());\t\t\t\t\t\t\t\t\t\t//remove the node from the hashtable\r\n \r\n if (z != null) \r\n\t\t{\r\n \t for (HashMap.Entry<String, FHeapNode> entry : hmap.entrySet()) \r\n {\r\n \tif(entry.getValue() == maxNode)\r\n \t{\r\n \t\thmap.remove(entry.getKey());\r\n \t\tbreak;\r\n \t}\r\n }\r\n \t \r\n int numKids = z.degree;\r\n FHeapNode x = z.child;\r\n FHeapNode tempRight;\r\n\r\n while (numKids > 0) \t\t\t\t\t\t\t\t\t\t\t\t\t// iterate trough all the children of the max node\r\n\t\t\t{\r\n tempRight = x.right; \r\n x.left.right = x.right;\t\t\t\t\t\t\t\t\t\t\t\t// remove x from child list\r\n x.right.left = x.left;\r\n \r\n x.left = maxNode;\t\t\t\t\t\t\t\t\t\t\t\t\t// add x to root list of heap\r\n x.right = maxNode.right;\r\n maxNode.right = x;\r\n x.right.left = x;\r\n \r\n x.parent = null;\t\t\t\t\t\t\t\t\t\t\t\t\t// set parent[x] to null\r\n x = tempRight;\r\n numKids--;\r\n }\r\n\t\t\tz.left.right = z.right;\t\t\t\t\t\t\t\t\t\t\t\t\t// remove z from root list of heap\r\n z.right.left = z.left;\r\n\r\n if (z == z.right)\r\n\t\t\t{\r\n maxNode = null;\r\n } \r\n\t\t\telse \r\n\t\t\t{\r\n maxNode = z.right;\r\n meld();\r\n } \r\n nNodes--;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// decrement size of heap\r\n }\r\n \r\n\r\n return z;\r\n }",
"public void deleteMax() {\n if (isEmpty()) throw new NoSuchElementException(\"Symbol table underflow\");\n root = deleteMax(root);\n// TODO:adding check for assurance\n\n\n }",
"public T remove(T x) {\n\t\tEntry<T> node = getSplay(find(x));\n\t\tT result;\n\t\tresult = node.element;\n\t\tif(node == null)\n\t\t\treturn null;\n\t\tsplay(node);\n\t\tif(node.left != null && node.right != null) {\n\t\t\tEntry<T> tmp = getSplay(node.left);\n\t\t\twhile(tmp.right != null)\n\t\t\t\ttmp = getSplay(tmp.right);\n\t\t\t\n\t\t\ttmp.right = node.right;\n\t\t\tgetSplay(node.right).parent = tmp;\n\t\t\tgetSplay(node.left).parent = null;\n\t\t\troot = node.right;\n\t\t\t \n\t\t}\n\t\telse if(node.right != null) {\n\t\t\tgetSplay(node.right).parent = null;\n\t\t\troot = node.right;\n\t\t}\n\t\telse if(node.left != null) {\n\t\t\tgetSplay(node.left).parent = null;\n\t\t\troot = node.left;\n\t\t}\n\t\telse {\n\t\t\troot = null;\n\t\t}\n\t\tnode.parent = null;\n node.left = null;\n node.right = null;\n node = null;\n return result;\n\t}",
"public int delete(int k){\n\t WAVLNode x = treePosForDel(this, k); // find the node to delete\r\n\t int cnt = 0; // rebalance operations counter\r\n\t if(x.key!=k) { // if a node with a key of k doesnt exist in the tree there is nothing to delete, return -1\r\n\t\t return -1;\r\n\t }\r\n\t if(this.root.key==x.key&&this.root.rank==0) {//root is a leaf\r\n\t\t this.root=EXT_NODE;// change the root pointer to EXT_NODE\r\n\t\t return 0;\r\n\t }\r\n\t else if(this.root.key==x.key&&(this.root.right==EXT_NODE||this.root.left==EXT_NODE)) {//root is onary\r\n\t\t if(x.left!=EXT_NODE) { // x is a root with a left child\r\n\t\t\t x.left.parent = null;\r\n\t\t\t this.root = x.left; // change the root pointer to the root's left child\r\n\t\t\t x.left.sizen=1;\r\n\t\t\t return 0;\r\n\t\t }\r\n\t\t x.right.parent = null; // x is a root with a right child \r\n\t\t x.right.sizen=1;\r\n\t\t this.root = x.right; // change the root pointer to the root's right child\r\n\t\t return 0;\r\n\t }\r\n\t WAVLNode z;\r\n\t if(isInnerNode(x)) {// x is an inner node, requires a call for successor and swap\r\n\t\t z = successorForDel(x); // find the successor of x\r\n\t\t x = swap(x,z); // put x's successor instead of x and delete successor \r\n\t }\r\n\t\t if(x.rank == 0) {//x is a leaf\r\n\t\t\t if(parentside(x.parent, x).equals(\"left\")) { // x is a left child of it's parent, requires change in pointers \r\n\t\t\t\t x.parent.left = EXT_NODE;\r\n\t\t\t\t z = x.parent;\r\n\t\t\t\t x = x.parent.left;\r\n\t\t\t }\r\n\t\t\telse { // x is a right child of it's parent, requires change in pointers \r\n\t\t\t\t x.parent.right = EXT_NODE;\r\n\t\t\t\t z = x.parent;\r\n\t\t\t\t x = x.parent.right; \r\n\t\t\t }\r\n\t\t }\r\n\t\t else {//x is onary\r\n\t\t\t boolean onaryside = onaryLeft(x); // check if x is onary with a left child\r\n\t\t\t WAVLNode x_child = EXT_NODE;\r\n\t\t\t if (onaryside) {\r\n\t\t\t\t x_child=x.left; // get a pointer for x child\r\n\t\t\t }\r\n\t\t\t else {\r\n\t\t\t\t x_child=x.right;\r\n\t\t\t }\r\n\t\t\t if(parentside(x.parent, x).equals(\"left\")) { // x is a left child of its parent, change pointers for delete and rebalance loop\r\n\t\t\t\t x.parent.left=x_child;\r\n\t\t\t\t x_child.parent=x.parent;\r\n\t\t\t\t z=x.parent;\r\n\t\t\t\t x=x_child;\r\n\t\t\t\t \r\n\t\t\t }\r\n\t\t\t else {// x is a left child of its parent, change pointers for delete and rebalance loop\r\n\t\t\t\t x.parent.right=x_child;\r\n\t\t\t\t x_child.parent=x.parent;\r\n\t\t\t\t z=x.parent;\r\n\t\t\t\t x=x_child;\r\n\t\t\t }\r\n\t\t }\r\n\t if (z.left.rank==-1&&z.right.rank==-1) {//special case, z becomes a leaf, change pointers and demote\r\n\t\t demote(z);\r\n\t\t x=z;\r\n\t\t z=z.parent;\r\n\t\t cnt++;\r\n\t }\r\n\t \r\n\t while(z!=null&&z.rank-x.rank==3) { // while the tree is not balanced continue to balance the tree\r\n\t\t if(parentside(z, x).equals(\"left\")) { // x is z's left son\r\n\t\t\t if(z.rank-z.right.rank==2) {//condition for demote\r\n\r\n\t\t\t\t demote(z);\r\n\r\n\t\t\t\t x=z;\r\n\t\t\t\t z=z.parent;\r\n\t\t\t\t cnt++;\r\n\t\t\t }\r\n\t\t\t else {\r\n\t\t\t\t if(z.right.rank-z.right.left.rank==2&&z.right.rank-z.right.right.rank==2) {//condition for doubledemote left\r\n\t\t\t\t\t doubleDemoteLeft(z);\r\n\t\t\t\t\t x=z;\r\n\t\t\t\t\t z=z.parent;\r\n\t\t\t\t\t cnt+=2;\r\n\t\t\t\t\t \r\n\t\t\t\t }\r\n\t\t\t\t else if((z.right.rank-z.right.left.rank==1||z.right.rank-z.right.left.rank==2)&&z.right.rank-z.right.right.rank==1) {// condition for rotate left for del\r\n\t\t\t\t\t rotateLeftDel(z);\r\n\t\t\t\t\t cnt+=3;\r\n\t\t\t\t\t break; // tree is balanced\r\n\t\t\t\t }\r\n\t\t\t\t else {//condition for doublerotate left for del\r\n\t\t\t\t\t doubleRotateLeftDel(z);\r\n\t\t\t\t\t \r\n\t\t\t\t\t cnt=cnt+5;\r\n\t\t\t\t\t break; // tree is balanced\r\n\t\t\t\t }\r\n\t\t\t }\r\n\t\t }\r\n\t\t else { // x is z's right son, conditions are symmetric to left side\r\n\t\t\t if(z.rank-z.left.rank==2) {\r\n\t\t\t\t demote(z);\r\n\t\t\t\t x=z;\r\n\t\t\t\t z=z.parent;\r\n\t\t\t\t cnt++;\r\n\t\t\t\t \r\n\t\t\t }\r\n\t\t\t else {\r\n\t\t\t\t if(z.left.rank-z.left.right.rank==2&&z.left.rank-z.left.left.rank==2) {\r\n\t\t\t\t\t doubleDemoteright(z);\r\n\t\t\t\t\t x=z;\r\n\t\t\t\t\t z=z.parent;\r\n\t\t\t\t\t cnt+=2;\r\n\t\t\t\t }\r\n\t\t\t\t else if((z.left.rank-z.left.right.rank==1||z.left.rank-z.left.right.rank==2)&&z.left.rank-z.left.left.rank==1) {\r\n\t\t\t\t\t rotateRightDel(z);\r\n\t\t\t\t\t cnt+=3;\r\n\t\t\t\t\t break;\r\n\t\t\t\t }\r\n\t\t\t\t else {\r\n\r\n\t\t\t\t\t doubleRotateRightDel(z);\r\n\t\t\t\t\t cnt+=5;\r\n\t\t\t\t\t break;\r\n\t\t\t\t }\r\n\t\t\t\t \r\n\t\t\t }\r\n\t\t }\r\n\t }\r\n\t return cnt;\r\n }",
"private Node delete(Node x, int time) {\n\t\tif (x == null) return null;\n\n\t\tif (x.getTime() == time) {\n\t\t\tif (x.getLeft() == null && x.getRight() == null) return null;\n\t\t\tif (x.getLeft() == null || x.getRight() == null) {\n\t\t\t\treturn (x.getLeft() == null) ? x.getRight() : x.getLeft();\n\t\t\t}\n\t\t\t// Copy successor's data into x\n\t\t\tNode s = succ(x.getTime());\n\t\t\tx.setTime(s.getTime());\n\t\t\tx.setReq_index(s.getReq_index());\n\t\t\t// Then delete successor\n\t\t\tx.setRight(delete(x.getRight(), s.getTime()));\n\t\t\treturn x;\n\t\t}\n\t\tif (time < x.getTime()) {\n\t\t\tx.setLeft(delete(x.getLeft(), time));\n\t\t}\n\t\telse {\n\t\t\tx.setRight(delete(x.getRight(), time));\n\t\t}\n\t\treturn x;\n\t}",
"private void deleteFixup(Node<K, V> x) {\n\t\t\n\t}",
"protected BinaryNode<AnyType> remove(AnyType x, BinaryNode<AnyType> t) {\n\t\tif (t == null)\n\t\t\tthrow new ItemNotFoundException(x.toString());\n\t\tif (x.compareTo(t.element) < 0)\n\t\t\tt.left = remove(x, t.left);\n\t\telse if (x.compareTo(t.element) > 0)\n\t\t\tt.right = remove(x, t.right);\n\t\telse if (t.duplicate.size() != 0) {\n\t\t\tt.duplicate.remove(0);\n\t\t} else if (t.left != null && t.right != null) // Two children\n\t\t{\n\t\t\tt.element = findMin(t.right).element;\n\t\t\tt.right = removeMin(t.right);\n\t\t} else\n\t\t\tt = (t.left != null) ? t.left : t.right;\n\t\treturn t;\n\t}",
"public void deleteMin() {\n root = deleteMin(root);\n }",
"public void deleteMin() {\n root = deleteMin(root);\n }",
"private int deleteMax() {\n int ret = heap[0];\n heap[0] = heap[--size];\n\n // Move root back down\n int pos = 0;\n while (pos < size / 2) {\n int left = getLeftIdx(pos), right = getRightIdx(pos);\n\n // Compare left and right child elements and swap accordingly\n if (heap[pos] < heap[left] || heap[pos] < heap[right]) {\n if (heap[left] > heap[right]) {\n swap(pos, left);\n pos = left;\n } else {\n swap(pos, right);\n pos = right;\n }\n } else {\n break;\n }\n }\n\n return ret;\n }",
"private void deleteTree(tnode root){\n if (root != null)\n root = null;\n }",
"public boolean delete(int x) {\n BstDeleteReturn output = deleteHelper(root,x );\n root = output.root;\n if (output.deleted) {\n size--;\n }\n\n return output.deleted;\n }",
"private void pruneTree(QuadNode node){\n int i;\n while(node.parent != null && node.quads[0] == null && node.quads[1] == null && node.quads[2] == null && node.quads[3] == null){\n i=0;\n if(node.x != node.parent.x){\n i++;\n }\n if(node.z != node.parent.z){\n i+=2;\n }\n node = node.parent;\n node.quads[i] = null;\n }\n }",
"private void reFixForDel(WAVLNode y) { // in a case of deletion of a node that doesnt exist in the tree, the method will fix the size all the way to the root\r\n\t y.sizen++;\r\n\t while(y.parent!=null) {\r\n\t\t y=y.parent;\r\n\t\t y.sizen++;\r\n\t }\r\n }",
"void deleteTree(TreeNode node) \n {\n root = null; \n }",
"private void reFix(WAVLNode x) {\n\t x.sizen--;\r\n\t while(x.parent!=null) {\r\n\t\t x=x.parent;\r\n\t\t x.sizen--;\r\n\t }\r\n }",
"private Node removeVx(Node node, K k){\n if(node == null)\n return null;\n\n if(k.compareTo(node.k) >0) { //value is greater, then looking right node\n node.right = removeVx(node.right, k);\n }else if(k.compareTo(node.k) < 0){ //value is smaller, then looking left node\n node.left = removeVx(node.left, k);\n }else { //(e.compareTo(node.e) == 0) found value matched node\n deleting = true;\n if(node.count!=0) { // if multiple value in one node, just decrease count\n node.count--;\n }else if (node.left != null) { //had left children use max of left children to replace this node\n node.copyValue(max(node.left));\n node.left = removeMax(node.left);\n }\n else if(node.right!=null) { //only had right child, use right child to replace this node\n decDepth(node.right); //maintain depth when chain in right tree\n node = node.right;\n }\n else {\n node = null; // no children, delete this node\n }\n }\n if (node != null && deleting) node.size--;\n return node;\n }",
"public void remove( AnyType x )\r\n\t{\r\n\t\troot = remove( x, root );\r\n\t}",
"private Node removeMax(Node node){\n if(node == null)\n return null;\n else if(node.right == null){ //use its left child to replace this node(max value node)\n if(node.count!=0) { //multiple value in same node\n node.count--;\n return node;\n }\n else {\n decDepth(node.left); //maintain depth when chain in left tree\n return node.left;\n }\n }\n\n //walk through right branch\n node.right = removeMax(node.right);\n if(node!=null) node.size--; // the max value must be removed\n return node;\n }",
"private static BstDeleteReturn deleteHelper(BinarySearchTreeNode<Integer> root, int x) {\n if (root == null) {\n return new BstDeleteReturn(null, false);\n }\n\n if (root.data < x) {\n BstDeleteReturn outputRight = deleteHelper(root.right, x);\n root.right = outputRight.root;\n outputRight.root = root;\n return outputRight;\n }\n\n if (root.data > x) {\n BstDeleteReturn outputLeft = deleteHelper(root.left, x);\n root.left = outputLeft.root;\n outputLeft.root = root;\n return outputLeft;\n }\n\n // 0 children\n if (root.left == null && root.right == null) {\n return new BstDeleteReturn(null, true);\n }\n\n // only left child\n if (root.left != null && root.right == null) {\n return new BstDeleteReturn(root.left, true);\n }\n\n // only right child\n if (root.right != null && root.left == null) {\n return new BstDeleteReturn(root.right, true);\n }\n\n // both children are present\n int minRight = minimum(root.right);\n root.data = minRight;\n BstDeleteReturn output = deleteHelper(root.right, minRight);\n root.right = output.root;\n return new BstDeleteReturn(root, true);\n }",
"public void delete() {\n this.root = null;\n }",
"public E deleteMax() {\r\n\t\tE max = null;\r\n\t\tif (currentIndex > 0) { // replace the root of heap with the last element on the last level\r\n\t\t\tmax = heap.get(0); // save current max\r\n\t\t\t\r\n\t\t\theap.set(0, heap.get(currentIndex - 1));\r\n\t\t\theap.remove(currentIndex - 1);\r\n\t\t\tcurrentIndex--;\r\n\t\t\t\r\n\t\t\theapifyDown(0); // re-heapify\r\n\t\t}\r\n\t\treturn max; // if tree is empty, returns null\r\n\t}",
"private AvlNode deleteNode(AvlNode root, int value) {\n\r\n if (root == null)\r\n return root;\r\n\r\n // If the value to be deleted is smaller than the root's value,\r\n // then it lies in left subtree\r\n if ( value < root.key )\r\n root.left = deleteNode(root.left, value);\r\n\r\n // If the value to be deleted is greater than the root's value,\r\n // then it lies in right subtree\r\n else if( value > root.key )\r\n root.right = deleteNode(root.right, value);\r\n\r\n // if value is same as root's value, then This is the node\r\n // to be deleted\r\n else {\r\n // node with only one child or no child\r\n if( (root.left == null) || (root.right == null) ) {\r\n\r\n AvlNode temp;\r\n if (root.left != null)\r\n temp = root.left;\r\n else\r\n temp = root.right;\r\n\r\n // No child case\r\n if(temp == null) {\r\n temp = root;\r\n root = null;\r\n }\r\n else // One child case\r\n root = temp; // Copy the contents of the non-empty child\r\n\r\n temp = null;\r\n }\r\n else {\r\n // node with two children: Get the inorder successor (smallest\r\n // in the right subtree)\r\n AvlNode temp = minValueNode(root.right);\r\n\r\n // Copy the inorder successor's data to this node\r\n root.key = temp.key;\r\n\r\n // Delete the inorder successor\r\n root.right = deleteNode(root.right, temp.key);\r\n }\r\n }\r\n\r\n // If the tree had only one node then return\r\n if (root == null)\r\n return root;\r\n\r\n // STEP 2: UPDATE HEIGHT OF THE CURRENT NODE\r\n root.height = Math.max(height(root.left), height(root.right)) + 1;\r\n\r\n // STEP 3: GET THE BALANCE FACTOR OF THIS NODE (to check whether\r\n // this node became unbalanced)\r\n int balance = balance(root).key;\r\n\r\n // If this node becomes unbalanced, then there are 4 cases\r\n\r\n // Left Left Case\r\n if (balance > 1 && balance(root.left).key >= 0)\r\n return doRightRotation(root);\r\n\r\n // Left Right Case\r\n if (balance > 1 && balance(root.left).key < 0) {\r\n root.left = doLeftRotation(root.left);\r\n return doRightRotation(root);\r\n }\r\n\r\n // Right Right Case\r\n if (balance < -1 && balance(root.right).key <= 0)\r\n return doLeftRotation(root);\r\n\r\n // Right Left Case\r\n if (balance < -1 && balance(root.right).key > 0) {\r\n root.right = doRightRotation(root.right);\r\n return doLeftRotation(root);\r\n }\r\n\r\n return root;\r\n }",
"public static void delete(Node node){\n // There should be 7 cases here\n if (node == null) return;\n\n if (node.left == null && node.right == null) { // sub-tree is empty case\n if (node.key < node.parent.key) { // node น้อยกว่าข้างบน\n node.parent.left = null;\n }\n else {\n node.parent.right = null;\n }\n\n return;\n }\n\n else if (node.left != null && node.right == null) { // right sub-tree is empty case\n if (node.left.key < node.parent.key) { // sub-tree อยู่ทางซ้ายของ parent\n node.left.parent = node.parent;\n node.parent.left = node.left;\n }\n else {\n node.left.parent = node.parent;\n node.parent.right = node.left;\n }\n return;\n }\n else if (node.right != null && node.left == null) { // left sub-tree is empty case\n if (node.right.key < node.parent.key) { // sub-tree อยู่ทางซ้ายของ parent\n node.right.parent = node.parent;\n node.parent.left = node.right;\n }\n else {\n node.right.parent = node.parent;\n node.parent.right = node.right;\n }\n return;\n }\n else { // full node case\n // หา min ของ right-subtree เอา key มาเขียนทับ key ของ node เลย\n Node n = findMin(node.right);\n node.key = n.key;\n delete(n);\n }\n }",
"public void deleteMax() {\n if (isEmpty()) throw new NoSuchElementException(\"Symbol table underflow\");\n root = deleteMax(root);\n assert check();\n }",
"public void removeMin() {\n\t\troot = removeMin(root);\n\t}",
"private void step4(Node node) {\n\t\tHashMap<String, ArrayList<String>> svn = node.svN;\r\n\t\tHashMap<String, ArrayList<String>> cn = node.cN;\r\n\t\tArrayList<String> keys = node.keysN;\r\n\t\tString c = checksubset(cn);\r\n\r\n\t\tif (c != null) {\r\n\t\t\tfor (int i = 0; i < keys.size(); i++) {\r\n\t\t\t\tif (svn.get(keys.get(i)).contains(c)) {\r\n\t\t\t\t\tsvn.get(keys.get(i)).remove(c);\r\n\t\t\t\t\tif (svn.get(keys.get(i)).size() <= 1) {\r\n\t\t\t\t\t\tsvn.remove(keys.get(i));\r\n\t\t\t\t\t\tkeys.remove(i);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcn.remove(c);\r\n\t\t}\r\n\t}",
"public boolean remove(T x) {\n\t\tNode<T> u = findLast(x);\n\t\tif (u == nil || c.compare(u.x, x) != 0)\n\t\t\treturn false;\n\t\tNode<T> w = u.right;\n\t\tif (w == nil) {\n\t\t\tw = u;\n\t\t\tu = w.left;\n\t\t} else {\n\t\t\twhile (w.left != nil)\n\t\t\t\tw = w.left;\n\t\t\tu.x = w.x;\n\t\t\tu = w.right;\n\t\t}\n\t\tsplice(w);\n\t\tu.colour += w.colour;\n\t\tSystem.out.printf(\"Remove(%s): u.parent = w.parent;%n\", x.toString());\n\t\tSystem.out.printf(\"BEFORE: u = %s, u.parent = %s, w = %s, w.parent = %s%n\", u,\n\t\t\t\tu.parent, w, w.parent);\n\t\tSystem.out.printf(\"BEFORE: nil = %s, nil.parent = %s, nil.left = %s, nil.right = %s%n\",\n\t\t\t\tnil, nil.parent, nil.left, nil.right);\n\t\tu.parent = w.parent;\n\t\tSystem.out.printf(\" AFTER: u = %s, u.parent = %s, w = %s, w.parent = %s%n\", u,\n\t\t\t\tu.parent, w, w.parent);\n\t\tSystem.out.printf(\" AFTER: nil = %s, nil.parent = %s, nil.left = %s, nil.right = %s%n\",\n\t\t\t\tnil, nil.parent, nil.left, nil.right);\n\t\tremoveFixup(u);\n\t\treturn true;\n\t}",
"public void remove(AnyType x) {\n LinkedListIterator<AnyType> p = findPrevious(x);\n\n if (p.current.next != null) {\n p.current.next = p.current.next.next; // Bypass deleted node\n }\n }",
"public Node delete(Node x, Key key) {\n if (x == null) return null;\n if (key.equals(x.key)) {\n n--;\n return x.next;\n }\n x.next = delete(x.next, key);\n return x;\n }",
"private void removeWord(Node root,String word,int index){\n if(index == word.length()){ //not word.length()-1 because starts from empty root\n //visiting the last Node to Remove\n //but need to remove later when com back to its paren root.removeChild(ch);\n //cause need to check weather node has children or not\n System.out.println(root.value);\n root.isEndOfWord = false; //CARE can only physically 'E' but CAR Node R has E children so R.isEndOfWord =false\n return;\n }\n\n //1st get the 'ch' at the index of th word\n var ch = word.charAt(index);\n\n //get the child Node of ch in root/children\n var child = root.getChild(ch);\n\n //if word doesn't exist/ no any Characters\n if(child == null) return;\n\n //post order traversal visiting child 1st\n removeWord(child,word,index+1); //recursively remove/ go to the next indexes of the word\n\n //then visit root to remove last index\n System.out.println(root.value);\n // if the child doesn't have any children\n // or no any characters related to end of the removing word\n //ex: cant remove word 'CAT' cause 'CATEGORY' exist.\n //if doesnt have any children and it's not the end of another word, physically remove it\n if(!child.hasChildren() && !child.isEndOfWord)\n root.removeChild(ch); //CARE can only physically 'E' but CAR Node R has E children\n\n }",
"public int delete(int k)\r\n\t{\r\n\t\tIAVLNode node = searchFor(this.root, k);\r\n\t\tIAVLNode parent;\r\n\t\tif(node==root)\r\n\t\t\tparent=new AVLNode(null);\r\n\t\telse\r\n\t\t\tparent=node.getParent();\r\n\t\t\r\n\t\tIAVLNode startHieghtUpdate = parent; // this will be the node from which we'll start updating the nodes' hieghts\r\n\t\t\r\n\t\tif (!node.isRealNode())\r\n\t\t\treturn -1;\r\n\t\t\r\n\t\t//updating the maximum and minimum fields\r\n\t\tif (node == this.maximum)\r\n\t\t\tthis.maximum = findPredecessor(node);\r\n\t\telse\r\n\t\t\tif (node == this.minimum)\r\n\t\t\t\tthis.minimum = findSuccessor(node); \r\n\t\t\r\n\t\t//if the node we wish to delete is a leaf\r\n\t\tif (!node.getLeft().isRealNode()&&!node.getRight().isRealNode())\r\n\t\t{\r\n\t\t\tif (node == parent.getLeft())\r\n\t\t\t\tparent.setLeft(node.getRight());\r\n\t\t\telse\r\n\t\t\t\tparent.setRight(node.getRight());\r\n\t\t\tnode.getRight().setParent(parent);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t //if the node we wish to delete is unary:\r\n\t\t\tif (node.getLeft().isRealNode()&&!node.getRight().isRealNode()) //only left child\r\n\t\t\t{\r\n\t\t\t\tif (node == parent.getLeft())\r\n\t\t\t\t\tparent.setLeft(node.getLeft());\r\n\t\t\t\telse\r\n\t\t\t\t\tparent.setRight(node.getLeft());\r\n\t\t\t\tnode.getLeft().setParent(parent);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tif (node.getRight().isRealNode()&&!node.getLeft().isRealNode()) //only right child\r\n\t\t\t\t\t{\r\n\t\t\t\t\tif (node == parent.getLeft())\r\n\t\t\t\t\t\tparent.setLeft(node.getRight());\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tparent.setRight(node.getRight());\r\n\t\t\t\t\tnode.getRight().setParent(parent);\r\n\t\t\t\t\t}\r\n\t\t\t\t//if the node we wish to delete is a father of two\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t\tIAVLNode suc = findSuccessor(node);\r\n\t\t\t\t\t\tIAVLNode sucsParent = suc.getParent();\r\n\t\t\t\t\t\t//deleting the successor of the node we wish to delete\r\n\t\t\t\t\t\tif (suc == sucsParent.getLeft())\r\n\t\t\t\t\t\t\tsucsParent.setLeft(suc.getRight());\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tsucsParent.setRight(suc.getRight());\r\n\t\t\t\t\t\tsuc.getRight().setParent(sucsParent);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//inserting the successor in it's new place (the previous place of the node we deleted)\r\n\t\t\t\t\t\tif (node == parent.getLeft())\r\n\t\t\t\t\t\t\tparent.setLeft(suc);\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tparent.setRight(suc);\r\n\t\t\t\t\t\tsuc.setParent(parent);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// node's children are now his scuccessor's children\r\n\t\t\t\t\t\tsuc.setRight(node.getRight());\r\n\t\t\t\t\t\tsuc.setLeft(node.getLeft());\r\n\t\t\t\t\t\tsuc.getRight().setParent(suc);\r\n\t\t\t\t\t\tsuc.getLeft().setParent(suc);\r\n\t\t\t\t\t\t//now we check if the successor of the node we wanted to delete was his son\r\n\t\t\t\t\t\tif (node != sucsParent) // the successor's parent was the deleted node (which is no longer part of the tree)\r\n\t\t\t\t\t\t\tstartHieghtUpdate = sucsParent;\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tstartHieghtUpdate = suc;\r\n\t\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//if we wish to delete the tree's root, then we need to update the tree's root to a new node\r\n\t\tif (node == this.root) \r\n\t\t{\r\n\t\t\tthis.root = parent.getRight();\r\n\t\t\tthis.root.setParent(null);\r\n\t\t}\r\n\t\t\r\n\t\tint moneRot = HieghtsUpdating(startHieghtUpdate);\r\n\t\treturn moneRot;\r\n\t}",
"public void deleteMin()\t\t\t\t//delete smallest key\n\t{\n\t\troot=deleteMin(root);\n\t}",
"private Node<Value> delete(Node<Value> x, String key, int d)\r\n {\r\n if (x == null) return null;\r\n char c = key.charAt(d);\r\n if (c > x.c) x.right = delete(x.right, key, d);\r\n else if (c < x.c) x.left = delete(x.left, key, d);\r\n else if (d < key.length()-1) x.mid = delete(x.mid, key, d+1);\r\n else if (x.val != null) { x.val = null; --N; }\r\n if (x.mid == null && x.val == null)\r\n {\r\n if (x.left == null) return x.right;\r\n if (x.right == null) return x.left;\r\n Node<Value> t;\r\n if (StdRandom.bernoulli()) // to keep balance\r\n { t = min(x.right); x.right = delMin(x.right); }\r\n else\r\n { t = max(x.left); x.left = delMax(x.left); }\r\n t.right = x.right;\r\n t.left = x.left;\r\n return t;\r\n }\r\n return x;\r\n }",
"public int delete(int k) {\n\t\tif (this.empty()) {// empty tree, nothing to erase\n\t\t\treturn -1;\n\t\t}\n\t\tAVLNode root = (AVLNode) this.root;\n\t\tAVLNode node = (AVLNode) root.delFindNode(k);\n\t\tif (node == null) {// no node with key==k in this tree\n\t\t\treturn -1;\n\t\t}\n\t\tchar side = node.parentSide();\n\t\tboolean rootTerm = (node.getLeft().getKey() != -1 && node.getRight().getKey() != -1);\n\t\tif (side == 'N' && (rootTerm == false)) {\n\t\t\treturn this.deleteRoot(node);\n\t\t}\n\t\tif (side == 'L') {\n\t\t\tif (node.isLeaf()) {\n\t\t\t\tint leftEdge = node.parent.getHeight() - node.getHeight();\n\t\t\t\tint rightEdge = node.parent.getHeight() - node.parent.getRight().getHeight();\n\t\t\t\tAVLNode parent = (AVLNode) node.parent;\n\t\t\t\tif (leftEdge == 1 && rightEdge == 1) {// first case (\"easy one\", just delete)\n\t\t\t\t\tnode.parent.setLeft(new AVLNode());\n\t\t\t\t\tnode.setParent(null);\n\t\t\t\t\tparent.updateSize();\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\tif (leftEdge == 1 && rightEdge == 2) {\n\t\t\t\t\tnode.parent.setLeft(new AVLNode());\n\t\t\t\t\tnode.setParent(null);\n\t\t\t\t\tparent.setHeight(parent.getHeight() - 1);\n\t\t\t\t\tparent.setSize();\n\t\t\t\t\treturn this.delRecTwos(parent);\n\t\t\t\t} else {// leftEdge==2&&rightEdge==1\n\t\t\t\t\tnode.parent.setLeft(new AVLNode());\n\t\t\t\t\tnode.setParent(null);\n\t\t\t\t\treturn this.delRecTriOne(parent, side);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ((node.left != null && node.right == null) || (node.left == null && node.right != null)) {// node is //\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// unary\n\t\t\t\tint leftEdge = node.parent.getHeight() - node.getHeight();\n\t\t\t\tint rightEdge = node.parent.getHeight() - node.parent.getRight().getHeight();\n\t\t\t\tif ((leftEdge == 1 && rightEdge == 1)) {\n\t\t\t\t\tif (node.left != null) {\n\t\t\t\t\t\tAVLNode parent = node.delUnaryLeft();\n\t\t\t\t\t\tparent.updateSize();\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t} else {// node.right!=null\n\t\t\t\t\t\tAVLNode parent = node.delUnaryRight();\n\t\t\t\t\t\tparent.updateSize();\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ((leftEdge == 1 && rightEdge == 2)) {\n\t\t\t\t\tif (node.left != null) {\n\t\t\t\t\t\treturn this.delRecTwos(node.delUnaryLeft());\n\t\t\t\t\t} else {// node.right!=null\n\t\t\t\t\t\treturn this.delRecTwos(node.delUnaryRight());\n\t\t\t\t\t}\n\t\t\t\t} else {// leftEdge==2&&rightEdge==1\n\t\t\t\t\tif (node.left != null) {\n\t\t\t\t\t\treturn this.delRecTriOne(node.delUnaryLeft(), side);\n\t\t\t\t\t} else {// node.right!=null\n\t\t\t\t\t\treturn this.delRecTriOne(node.delUnaryRight(), side);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tif (side == 'R') {\n\t\t\tif (node.isLeaf()) {\n\t\t\t\tint rightEdge = node.parent.getHeight() - node.getHeight();\n\t\t\t\tint leftEdge = node.parent.getHeight() - node.parent.getLeft().getHeight();\n\t\t\t\tAVLNode parent = (AVLNode) node.parent;\n\t\t\t\tif (leftEdge == 1 && rightEdge == 1) {// first case (\"easy one\", just delete)\n\t\t\t\t\tnode.parent.setRight(new AVLNode());\n\t\t\t\t\tnode.setParent(null);\n\t\t\t\t\tparent.updateSize();\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\tif (leftEdge == 2 && rightEdge == 1) {\n\t\t\t\t\tnode.parent.setRight(new AVLNode());\n\t\t\t\t\tnode.setParent(null);\n\t\t\t\t\tparent.setHeight(parent.getHeight() - 1);\n\t\t\t\t\tparent.setSize();\n\t\t\t\t\treturn this.delRecTwos(parent);\n\t\t\t\t} else {// leftEdge==1&&rightEdge==2\n\t\t\t\t\tnode.parent.setRight(new AVLNode());\n\t\t\t\t\tnode.setParent(null);\n\t\t\t\t\treturn this.delRecTriOne(parent, side);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ((node.getLeft().getHeight() != -1 && node.getRight().getHeight() == -1)\n\t\t\t\t\t|| (node.getLeft().getHeight() == -1 && node.getRight().getHeight() != -1)) {// node is unary\n\t\t\t\tint rightEdge = node.parent.getHeight() - node.getHeight();\n\t\t\t\tint leftEdge = node.parent.getHeight() - node.parent.getLeft().getHeight();\n\t\t\t\tif ((leftEdge == 1 && rightEdge == 1)) {\n\t\t\t\t\tif (node.left != null) {\n\t\t\t\t\t\tAVLNode parent = node.delUnaryLeft();\n\t\t\t\t\t\tparent.updateSize();\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t} else {// node.right!=null\n\t\t\t\t\t\tAVLNode parent = node.delUnaryRight();\n\t\t\t\t\t\tparent.updateSize();\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ((leftEdge == 2 && rightEdge == 1)) {\n\t\t\t\t\tif (node.left != null) {\n\t\t\t\t\t\treturn this.delRecTwos(node.delUnaryLeft());\n\t\t\t\t\t} else {// node.right!=null\n\t\t\t\t\t\treturn this.delRecTwos(node.delUnaryRight());\n\t\t\t\t\t}\n\t\t\t\t} else {// leftEdge==1&&rightEdge==2\n\t\t\t\t\tif (node.left != null) {\n\t\t\t\t\t\treturn this.delRecTriOne(node.delUnaryLeft(), side);\n\t\t\t\t\t} else {// node.right!=null\n\t\t\t\t\t\treturn this.delRecTriOne(node.delUnaryRight(), side);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\t// we get here only if node is binary, and thus not going through any other\n\t\t// submethod\n\t\tAVLNode successor = this.findSuccessor(node); // successor must be unary/leaf\n\t\tif (node.checkRoot()) {\n\t\t\tthis.root = successor;\n\t\t}\n\t\tint numOp = this.delete(successor.key);\n\t\tsuccessor.setHeight(node.getHeight());\n\t\tsuccessor.size = node.getSize();\n\t\tsuccessor.setRight(node.getRight());\n\t\tnode.right.setParent(successor);\n\t\tnode.setRight(null);\n\t\tsuccessor.setLeft(node.getLeft());\n\t\tnode.left.setParent(successor);\n\t\tnode.setLeft(null);\n\t\tsuccessor.setParent(node.getParent());\n\t\tif (node.parentSide() == 'L') {\n\t\t\tnode.parent.setLeft(successor);\n\t\t} else if (node.parentSide() == 'R') {// node.parentSide()=='R'\n\t\t\tnode.parent.setRight(successor);\n\t\t}\n\t\tnode.setParent(null);\n\t\treturn numOp;\n\n\t}",
"public boolean Delete(int num) {\r\n\t\t//initialize boolean field, set to true if value found in tree\r\n\t\tboolean found;\r\n\t\t//initialize the parent node using the TreeNodeWrapper\r\n\t\tTreeNodeWrapper p = new TreeNodeWrapper();\r\n\t\t//initialize the child node using the TreeNodeWrapper\r\n\t\tTreeNodeWrapper c = new TreeNodeWrapper();\r\n\t\t//initialize largest field to re-allocate parent/child nodes\r\n\t\tTreeNode largest;\r\n\t\t//initialize nextLargest field to re-allocate parent/child nodes\r\n\t\tTreeNode nextLargest;\r\n\t\t//found set to true if FindNode methods locates value in the tree\r\n\t\tfound = FindNode(num, p, c);\r\n\t\t//if node not found return false\r\n\t\tif(found == false)\r\n\t\t\treturn false;\r\n\t\telse //identify the case number\r\n\t\t{\r\n\t\t\t//case 1: deleted node has no children\r\n\t\t\t//if left and right child nodes of value are both null node has no children\r\n\t\t\tif(c.Get().Left == null && c.Get().Right == null)\r\n\t\t\t\t//if parent left node is equal to child node then deleted node is a left child\r\n\t\t\t\tif(p.Get().Left == c.Get())\r\n\t\t\t\t\tp.Get().Left = null;\r\n\t\t\t\telse //deleted node is a right child\r\n\t\t\t\t\tp.Get().Right = null;\r\n\t\t\t//case 2: deleted node has 1 child\r\n\t\t\t//if deleted node only has 1 child node\r\n\t\t\telse if(c.Get().Left == null || c.Get().Right == null)\r\n\t\t\t{\r\n\t\t\t\t//if parent left node is equal to child node then deleted node is a left child\r\n\t\t\t\tif(p.Get().Left == c.Get())\r\n\t\t\t\t{\r\n\t\t\t\t\t//if deleted node is a left child then set deleted node child node as child to parent node\r\n\t\t\t\t\tif(c.Get().Left != null) //deleted node has a left child\r\n\t\t\t\t\t\tp.Get().Left = c.Get().Left;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tp.Get().Left = c.Get().Right;\r\n\t\t\t\t}\r\n\t\t\t\telse //if deleted node is a right child then set deleted node child node as child to parent node\r\n\t\t\t\t{\r\n\t\t\t\t\tif(c.Get().Left != null) //deleted node has a left child\r\n\t\t\t\t\t\tp.Get().Right = c.Get().Left;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tp.Get().Right = c.Get().Right;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//case 3: deleted node has two children\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t//set the nextLargest as the left child of deleted node\r\n\t\t\t\tnextLargest = c.Get().Left;\r\n\t\t\t\t//set the largest as the right node of the nextLargest node\r\n\t\t\t\tlargest = nextLargest.Right;\r\n\t\t\t\t//if right node is not null then left child has a right subtree\r\n\t\t\t\tif(largest != null) \r\n\t\t\t\t{\r\n\t\t\t\t\t//while loop to move down the right subtree and re-allocate after node is deleted\r\n\t\t\t\t\twhile(largest.Right != null) //move down right subtree\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tnextLargest = largest;\r\n\t\t\t\t\t\tlargest = largest.Right;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//overwrite the deleted node\r\n\t\t\t\t\tc.Get().Data = largest.Data; \r\n\t\t\t\t\t// save the left subtree\r\n\t\t\t\t\tnextLargest.Right = largest.Left; \r\n\t\t\t\t}\r\n\t\t\t\telse //left child does not have a right subtree\r\n\t\t\t\t{\r\n\t\t\t\t\t//save the right subtree\r\n\t\t\t\t\tnextLargest.Right = c.Get().Right; \r\n\t\t\t\t\t//deleted node is a left child\r\n\t\t\t\t\tif(p.Get().Left == c.Get()) \r\n\t\t\t\t\t\t//jump around deleted node\r\n\t\t\t\t\t\tp.Get().Left = nextLargest; \r\n\t\t\t\t\telse //deleted node is a right child\r\n\t\t\t\t\t\tp.Get().Right = nextLargest; //jump around deleted node\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//return true is delete is successful\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}",
"private void delete(Node curr, int ID, AtomicReference<Node> rootRef) {\n\t\tif(curr == null || curr.isNull) {\n return;\n }\n if(curr.ID == ID) {\n if(curr.right.isNull || curr.left.isNull) {\n deleteDegreeOneChild(curr, rootRef);\n } else {\n Node n = findSmallest(curr.right);\n \tcurr.ID = n.ID;\n curr.count = n.count;\n delete(curr.right, n.ID, rootRef);\n }\n }\n if(curr.ID < ID) {\n delete(curr.right, ID, rootRef);\n } else {\n delete(curr.left, ID, rootRef);\n }\n\t}",
"public TreeNode pruneTree(TreeNode root) {\n if (containsOne(root) == false) {\n return null;\n } else {\n return root;\n }\n }",
"protected void xremove(Node<T> u) {\n\t\tif (u == r) {\n\t\t\tremove();\n\t\t} else {\n\t\t\tif (u == u.parent.left) {\n\t\t\t\tu.parent.left = nil;\n\t\t\t} else {\n\t\t\t\tu.parent.right = nil;\n\t\t\t}\n\t\t\tu.parent = nil;\n\t\t\tr = merge(r, u.left);\n\t\t\tr = merge(r, u.right);\n\t\t\tr.parent = nil;\n\t\t\tn--;\n\t\t}\n\t}",
"@Test\n public void remove_BST_0_CaseRootOneChildren()\n {\n BinarySearchTree bst = new BinarySearchTree();\n No root = new No(20);\n bst.insert(null, root);\n bst.insert(root, new No(10));\n //bst.printTree();\n //System.err.println(); // Print[ERR] Devido a prioridade do buffer de impressao (out, err)\n \n assertEquals(root, bst.remove(root));\n assertEquals(new Integer(1), bst.size());\n //bst.printTree();\n }",
"public static void testTreeDelete()\n {\n ArrayList<Tree<String>> treelist = new ArrayList<Tree<String>>();\n treelist.add(new BinaryTree<String>());\n treelist.add(new AVLTree<String>());\n treelist.add(new RBTree<String>());\n treelist.add(new SplayTree<String>());\n\n System.out.println(\"Start TreeDelete test\");\n for(Tree<String> t : treelist)\n {\n\n try\n {\n RobotRunner.loadDictionaryIntoTree(\"newDutch.dic\", t);\n// RobotRunner.loadDictionaryIntoTree(\"smallDutch.dic\", t);\n// RobotRunner.loadDictionaryIntoTree(\"Dutch.dic\", t); //Won't work with BinaryTree and SplayTree, too many items == StackOverflow\n// RobotRunner.loadDictionaryIntoTree(\"dict.txt\", t); //Won't work with BinaryTree and SplayTree, too many items == StackOverflow\n }\n catch(IOException e)\n {\n System.out.println(e);\n }\n System.out.println(\"\\nStart Testcase\");\n\n SystemAnalyser.start();\n t.delete(\"aanklotsten\");\n SystemAnalyser.stop();\n\n SystemAnalyser.printPerformance();\n\n System.out.println(\"Stop Testcase\\n\");\n }\n System.out.println(\"Values after test.\");\n SystemAnalyser.printSomeTestValues();\n }",
"private void deleteNode(Cat valueToDelete, Node root){\n Node temp = findNode(valueToDelete, root);\n if(temp.getRight()==null){\n Node parent = temp.getParent();\n if(temp.getLeft()==null){\n temp.setParent(null);\n if(temp==parent.getRight()){\n parent.setRight(null);\n fixBalanceValues(parent,-1);\n }\n else{\n parent.setLeft(null);\n fixBalanceValues(parent,1);\n }\n \n }\n else{\n //copy value of leftchild into the node to deletes data and delete it's leftchild\n temp.setData(temp.getLeft().getData());\n temp.setLeft(null);\n fixBalanceValues(temp, 1);\n }\n }\n Node nodeToDelete = temp.getRight();\n if(nodeToDelete.getLeft()==null){\n temp.setData(nodeToDelete.getData());\n temp.setRight(null);\n nodeToDelete.setParent(null);\n fixBalanceValues(temp,-1);\n }\n else{\n while(nodeToDelete.getLeft()!=null){\n nodeToDelete=nodeToDelete.getLeft(); \n } \n temp.setData(nodeToDelete.getData());\n Node parent = nodeToDelete.getParent();\n parent.setLeft(null);\n nodeToDelete.setParent(null);\n fixBalanceValues(parent,1);\n }\n \n \n }",
"Object unlink(Node x) {\n final Object element = x.item;\n final Node next = x.next;\n final Node prev = x.pre;\n\n //当前节点为first节点\n if (prev == null) {\n //删除这个节点时,要将next节点赋值为first节点\n first = next;\n } else {\n prev.next = next;\n x.pre = null;\n }\n\n //最后一个节点\n if (next == null) {\n last = prev;\n } else {\n next.pre = prev;\n x.next = null;\n }\n\n x.item = null;\n size--;\n return element;\n }",
"public void removeLevel()\r\n {\r\n if( tables.size()>1 )\r\n {\r\n tables.removeFirst();\r\n }\r\n if( counts.size()>1 )\r\n {\r\n counts.removeFirst();\r\n }\r\n }",
"private TSTNode<E> deleteNodeRecursion(TSTNode<E> currentNode) {\n \n if(currentNode == null) return null;\n if(currentNode.relatives[TSTNode.EQKID] != null || currentNode.data != null) return null; // can't delete this node if it has a non-null eq kid or data\n\n TSTNode<E> currentParent = currentNode.relatives[TSTNode.PARENT];\n\n // if we've made it this far, then we know the currentNode isn't null, but its data and equal kid are null, so we can delete the current node\n // (before deleting the current node, we'll move any lower nodes higher in the tree)\n boolean lokidNull = currentNode.relatives[TSTNode.LOKID] == null;\n boolean hikidNull = currentNode.relatives[TSTNode.HIKID] == null;\n\n ////////////////////////////////////////////////////////////////////////\n // Add by Cheok. To resolve java.lang.NullPointerException\n // I am not sure this is the correct solution, as I have not gone\n // through this sourc code in detail.\n if (currentParent == null && currentNode == this.rootNode) {\n // if this executes, then current node is root node\n rootNode = null;\n return null;\n }\n // Add by Cheok. To resolve java.lang.NullPointerException\n ////////////////////////////////////////////////////////////////////////\n\n // now find out what kind of child current node is\n int childType;\n if(currentParent.relatives[TSTNode.LOKID] == currentNode) {\n childType = TSTNode.LOKID;\n } else if(currentParent.relatives[TSTNode.EQKID] == currentNode) {\n childType = TSTNode.EQKID;\n } else if(currentParent.relatives[TSTNode.HIKID] == currentNode) {\n childType = TSTNode.HIKID;\n } else {\n // if this executes, then current node is root node\n rootNode = null;\n return null;\n }\n\n if(lokidNull && hikidNull) {\n // if we make it to here, all three kids are null and we can just delete this node\n currentParent.relatives[childType] = null;\n return currentParent;\n }\n\n // if we make it this far, we know that EQKID is null, and either HIKID or LOKID is null, or both HIKID and LOKID are NON-null\n if(lokidNull) {\n currentParent.relatives[childType] = currentNode.relatives[TSTNode.HIKID];\n currentNode.relatives[TSTNode.HIKID].relatives[TSTNode.PARENT] = currentParent;\n return currentParent;\n }\n\n if(hikidNull) {\n currentParent.relatives[childType] = currentNode.relatives[TSTNode.LOKID];\n currentNode.relatives[TSTNode.LOKID].relatives[TSTNode.PARENT] = currentParent;\n return currentParent;\n }\n\n int deltaHi = currentNode.relatives[TSTNode.HIKID].splitchar - currentNode.splitchar;\n int deltaLo = currentNode.splitchar - currentNode.relatives[TSTNode.LOKID].splitchar;\n int movingKid;\n TSTNode<E> targetNode;\n \n // if deltaHi is equal to deltaLo, then choose one of them at random, and make it \"further away\" from the current node's splitchar\n if(deltaHi == deltaLo) {\n if(Math.random() < 0.5) {\n deltaHi++;\n } else {\n deltaLo++;\n }\n }\n\n\tif(deltaHi > deltaLo) {\n movingKid = TSTNode.HIKID;\n targetNode = currentNode.relatives[TSTNode.LOKID];\n } else {\n movingKid = TSTNode.LOKID;\n targetNode = currentNode.relatives[TSTNode.HIKID];\n }\n\n while(targetNode.relatives[movingKid] != null) targetNode = targetNode.relatives[movingKid];\n \n // now targetNode.relatives[movingKid] is null, and we can put the moving kid into it.\n targetNode.relatives[movingKid] = currentNode.relatives[movingKid];\n\n // now we need to put the target node where the current node used to be\n currentParent.relatives[childType] = targetNode;\n targetNode.relatives[TSTNode.PARENT] = currentParent;\n\n if(!lokidNull) currentNode.relatives[TSTNode.LOKID] = null;\n if(!hikidNull) currentNode.relatives[TSTNode.HIKID] = null;\n\n // note that the statements above ensure currentNode is completely dereferenced, and so it will be garbage collected\n return currentParent;\n }",
"public void remove(AnyType x) {\n\t\troot = remove(x, root);\n\t}",
"public static TreapNode deleteNode(TreapNode root, int key)\n {\n // base case: the key is not found in the tree\n if (root == null) {\n return null;\n }\n\n // if the key is less than the root node, recur for the left subtree\n if (key < root.data) {\n root.left = deleteNode(root.left, key);\n }\n\n // if the key is more than the root node, recur for the right subtree\n else if (key > root.data) {\n root.right = deleteNode(root.right, key);\n }\n\n // if the key is found\n else {\n // Case 1: node to be deleted has no children (it is a leaf node)\n if (root.left == null && root.right == null)\n {\n // deallocate the memory and update root to null\n root = null;\n }\n\n // Case 2: node to be deleted has two children\n else if (root.left != null && root.right != null)\n {\n // if the left child has less priority than the right child\n if (root.left.priority < root.right.priority)\n {\n // call `rotateLeft()` on the root\n root = rotateLeft(root);\n\n // recursively delete the left child\n root.left = deleteNode(root.left, key);\n }\n else {\n // call `rotateRight()` on the root\n root = rotateRight(root);\n\n // recursively delete the right child\n root.right = deleteNode(root.right, key);\n }\n }\n\n // Case 3: node to be deleted has only one child\n else {\n // choose a child node\n TreapNode child = (root.left != null)? root.left: root.right;\n root = child;\n }\n }\n\n return root;\n }",
"public void delete(DNA key){\n if(this.debug)\n System.out.println(\"ExtHash::delete >> eliminando cadena: \" + key.toString() + \", hashCode: \" + key.hashCode());\n\n Node actual_node = this.getReference(key);\n if(this.debug)\n System.out.println(\"ExtHash::delete >> altura del nodo: \" + actual_node.getAltura());\n\n int reference_page = actual_node.getReference();\n ArrayList<Integer> content = this.fm.read(reference_page); this.in_counter++;\n\n int last_page = reference_page, last_chain = 0;\n ArrayList<Integer> last_content = content, search_content;\n\n // last_block: referencia al ultimo bloque.\n // search_block: referencia al bloque con el elemento buscado.\n int last_block = reference_page, search_block = -1, search_pos = -1;\n int total_elements = 0, altura = actual_node.getAltura();\n\n while(true) {\n if(this.debug)\n System.out.println(\"ExtHash::delete >> referencia a pagina: \" + last_page);\n\n if(this.debug) {\n System.out.println(\"ExtHash::delete >> contenido de la pagina:\");\n for(int i=0; i<last_content.size(); i++)\n System.out.println(\" \" + last_content.get(i));\n }\n\n total_elements += last_content.get(0);\n if(search_block == -1) {\n for (int i = 1; i <= last_content.get(0); i++) {\n if (last_content.get(i) == key.hashCode()) {\n if(this.debug)\n System.out.println(\"ExtHash::delete >> cadena \" + key.hashCode() + \" encontrada\");\n search_pos = i;\n search_block = last_page;\n total_elements--;\n total_in--;\n break;\n }\n }\n }\n\n if(last_content.get(0) != 0) {\n last_block = last_page;\n last_chain = last_content.get(last_content.get(0));\n }\n\n if(last_content.get(0) != B - 2) {\n break;\n }\n\n if(this.debug)\n System.out.println(\"ExtHash::delete >> acceciendo a siguiente pagina\");\n\n last_page = last_content.get(B-1);\n last_content = this.fm.read(last_page); this.in_counter++;\n }\n\n ArrayList<Integer> new_content = new ArrayList<>();\n if(search_block != -1) {\n // se encontro el elemento buscado.\n // search_block: referencia al bloque que contiene la buscado.\n // last_block: referencia al ultimo bloque de la lista enlazada.\n\n search_content = this.fm.read(search_block); this.in_counter++;\n last_content = this.fm.read(last_block); this.in_counter++;\n\n if(search_block == last_block) {\n // elemento buscado estaba en la ultima pagina de la lista enlazada.\n new_content.add(search_content.get(0) - 1);\n for(int i=1; i<=search_content.get(0); i++) {\n if(i != search_pos)\n new_content.add(search_content.get(i));\n\n }\n if(search_content.get(0) == B-2)\n total_active_block--;\n\n } else {\n // elemento buscado no esta en la ultima pagina de la lista enlazada.\n new_content.add(search_content.get(0));\n for(int i=1; i<=search_content.get(0); i++) {\n if(i != search_pos)\n new_content.add(search_content.get(i));\n else\n new_content.add(last_chain);\n\n }\n new_content.add(search_content.get(B - 1));\n\n ArrayList<Integer> new_last_content = new ArrayList<>();\n new_last_content.add(last_content.get(0) - 1);\n for(int i=1; i<last_content.get(0); i++) {\n new_last_content.add(last_content.get(i));\n\n }\n if(last_content.get(0) == B-2)\n total_active_block--;\n\n this.fm.write(new_last_content, last_block); this.out_counter++;\n\n }\n this.fm.write(new_content, search_block); this.out_counter++;\n }\n\n // la pagina contiene pocos elementos, y no es parte del primer nodo\n\n if(total_elements < (B - 2) / 2 && search_block != -1 && 0 < altura){\n if(this.debug)\n System.out.println(\"ExtHash::delete >> limite de pagina, iniciando compresion\");\n this.compress(actual_node);\n }\n\n }",
"public void deleteNode(BinaryTreeNode node) // Only leaf nodes and nodes with degree 1 can be deleted. If a degree 1 node is deleted, it is replaced by its subtree.\r\n {\n if(!node.hasRightChild() && !node.hasLeftChild()){\r\n if(node.mActualNode.mParent.mRightChild == node.mActualNode) {\r\n\r\n node.mActualNode.mParent.mRightChild = null;\r\n }\r\n else if(node.mActualNode.mParent.mLeftChild == node.mActualNode) {\r\n\r\n node.mActualNode.mParent.mLeftChild = null;\r\n }\r\n //node.mActualNode = null;\r\n\r\n }\r\n //if deleted node has degree 1 and has only left child\r\n else if(node.hasLeftChild() && !node.hasRightChild()){\r\n node.mActualNode.mLeftChild.mParent = node.mActualNode.mParent;\r\n //if deleted node is left child of his father\r\n if(node.mActualNode.mParent.mLeftChild == node.mActualNode)\r\n node.mActualNode.mParent.mLeftChild = node.mActualNode.mLeftChild;\r\n //if deleted node is right child of his father\r\n else {\r\n\r\n node.mActualNode.mParent.mRightChild = node.mActualNode.mLeftChild;\r\n }\r\n }\r\n // if deleted node has degree 1 and has only right child\r\n else if(node.hasRightChild() && !node.hasLeftChild()){\r\n node.mActualNode.mRightChild.mParent = node.mActualNode.mParent;\r\n\r\n //if node is left child of his father\r\n if(node.mActualNode.mParent.mLeftChild == node.mActualNode) {\r\n\r\n\r\n node.mActualNode.mParent.mLeftChild = node.mActualNode.mRightChild;\r\n\r\n }\r\n //if node is right child of his father\r\n else\r\n node.mActualNode.mParent.mRightChild = node.mActualNode.mRightChild;\r\n\r\n\r\n }\r\n else\r\n System.out.println(\"Error : node has two child\");\r\n\r\n }",
"private static void delTree(BoardTree root) {\n if (root.children == null) return;\n for (BoardTree child : root.children) {\n delTree(child);\n }\n root.children.clear();\n root = null;\n }",
"private Node deleteMin(Node n)\n {\n if (n.left == null) \n return n.right;\n n.left = deleteMin(n.left); \n n.count= 1 + size(n.left)+ size(n.right); \n return n;\n }",
"public void deleteMin() {\n if (isEmpty()) throw new NoSuchElementException(\"Symbol table underflow\");\n root = deleteMin(root);\n// TODO:adding check for assurance\n }",
"public void deleteMax();",
"public void delete(int id) { \n\t\tint save = findPosition(id);\n\t\t\n\t\tif (save == numOfNode - 1) {\n\t\t\tnode [save] = null;\n\t\t\tnumOfNode--;\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// dich dan cac node vao\n\t\tfor (int i = save; i < numOfNode - 1; i++) {\n\t\t\tnode[i] = node[i + 1];\n\t\t}\n\t\t\n\t\tnode[numOfNode - 1] = null;\n\t\tnumOfNode--;\n\t}",
"public BinaryNode removeNode(BinaryNode node){\n if(isLeaf(node)){//base case\n BinaryNode parent = (BinaryNode) node.getParent();\n if(parent == null){\n root = null;\n }\n else{\n parent.removeChild(node);\n }\n size--;\n return parent;\n }\n BinaryNode lower = descendant(node);\n promote(lower, node);\n return removeNode(lower);\n }",
"public void delete(int key) {\n\n\n // There should be 6 cases here\n // Non-root nodes should be forwarded to the static function\n if (root == null) System.out.println(\"Empty Tree!!!\"); // ไม่มี node ใน tree\n else {\n\n Node node = find(key);\n\n if (node == null) System.out.println(\"Key not found!!!\"); //ไม่เจอ node\n\n\n else if(node == root){ //ตัวที่ลบเป็น root\n if (root.left == null && root.right == null) { //ใน tree มีแค่ root ตัสเดียว ก็หายไปสิ จะรอไร\n root = null;\n }\n else if (root.left != null && root.right == null) { //่ root มีลูกฝั่งซ้าย เอาตัวลูกขึ้นมาแทน\n root.left.parent = null;\n root = root.left;\n }\n else { //่ root มีลูกฝั่งขวา เอาตัวลูกขึ้นมาแทน\n Node n = findMin(root.right);\n root.key = n.key;\n delete(n);\n }\n\n }\n\n\n else { //ตัวที่ลบไม่ใช่ root\n delete(node);\n }\n }\n }",
"public void delete(SplayNode n) {\n\t\t this.splay(n);\n\n\t\t SplayTree leftSubtree = new SplayTree();\n\t\t leftSubtree.root = this.root.left;\n\t\t if(leftSubtree.root != null)\n\t\t leftSubtree.root.parent = null;\n\n\t\t SplayTree rightSubtree = new SplayTree();\n\t\t rightSubtree.root = this.root.right;\n\t\t if(rightSubtree.root != null)\n\t\t rightSubtree.root.parent = null;\n\n\t\t if(leftSubtree.root != null) {\n\t\t \tSplayNode m = leftSubtree.maximum(leftSubtree.root);\n\t\t leftSubtree.splay(m);\n\t\t leftSubtree.root.right = rightSubtree.root;\n\t\t this.root = leftSubtree.root;\n\t\t }\n\t\t else {\n\t\t this.root = rightSubtree.root;\n\t\t }\n\t\t }",
"public HuffmanTree removeMin();",
"private BinarySearchTree deleteLeftMost(BinarySearchTree tree){\r\n\t\t\r\n\t\tif(tree.getLeftChild() == null){\r\n\t\t\t//this is the node we want. No left child\r\n\t\t\t//Right child might exist\r\n\t\t\t\r\n\t\t\treturn tree.getRightChild();\r\n\t\t}\r\n\t\telse{\r\n\t\t\tBinarySearchTree replacement = deleteLeftMost(tree.getLeftChild());\r\n\t\t\ttree.attachRightSubtree(replacement);\r\n\t\t\treturn tree;\r\n\t\t}\r\n\t}",
"public boolean remove(int a) {\r\n\t\tif (contains(a)) {\r\n\t\t\tif (this.value == a) {\r\n\t\t\t\tif (this.leftChild != null) {\r\n\t\t\t\t\tthis.value = this.leftChild.value; \r\n\t\t\t\t\tfindRL(this.leftChild).rightChild = this.rightChild;\r\n\t\t\t\t\tif (this.leftChild.rightChild != null) {\r\n\t\t\t\t\t\tthis.rightChild = this.leftChild.rightChild;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (this.leftChild.leftChild != null) {\r\n\t\t\t\t\t\tthis.leftChild = this.leftChild.leftChild;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.leftChild = this.leftChild.leftChild;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (this.rightChild != null) {\r\n\t\t\t\t\tthis.value = this.rightChild.value;\r\n\t\t\t\t\tif (this.rightChild.rightChild != null) {\r\n\t\t\t\t\t\tthis.rightChild = this.rightChild.rightChild;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.rightChild = this.rightChild.rightChild;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (this.rightChild.leftChild != null) {\r\n\t\t\t\t\t\tthis.leftChild = this.rightChild.leftChild;\r\n\t\t\t\t\t} \r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.value = 0; \r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tif (this.value < a) {\r\n\t\t\t\tif (this.rightChild != null) {\r\n\t\t\t\t\tif (this.rightChild.value == a) {\r\n\t\t\t\t\t\tif (this.rightChild.leftChild != null) {\r\n\t\t\t\t\t\t\tfindRL(this.rightChild.leftChild).rightChild = this.rightChild.rightChild;\r\n\t\t\t\t\t\t\tthis.rightChild = this.rightChild.leftChild;\r\n\t\t\t\t\t\t} else if (this.rightChild.rightChild != null) {\r\n\t\t\t\t\t\t\tthis.rightChild = this.rightChild.rightChild;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tthis.rightChild = null; \r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.rightChild.remove(a);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (this.leftChild != null) {\r\n\t\t\t\t\tif (this.leftChild.value == a) {\r\n\t\t\t\t\t\tif (this.leftChild.leftChild != null) {\r\n\t\t\t\t\t\t\tfindRL(this.leftChild.leftChild).rightChild = this.leftChild.rightChild; \r\n\t\t\t\t\t\t\tthis.leftChild = this.leftChild.leftChild;\r\n\t\t\t\t\t\t} else if (this.leftChild.rightChild != null) {\r\n\t\t\t\t\t\t\tthis.leftChild = this.leftChild.rightChild;\t\t\t\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tthis.leftChild = null;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.leftChild.remove(a);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"@Test\n public void remove_BST_0_CaseRootLeafLeft()\n {\n BinarySearchTree bst = new BinarySearchTree();\n No root = new No(2);\n No no = new No(1);\n \n bst.insert(root, root);\n //bst.printTree();\n \n bst.insert(root, no);\n //bst.printTree();\n //System.err.println(); // Print[ERR] Devido a prioridade do buffer de impressao (out, err)\n \n assertEquals(new Integer(2), bst.size());\n assertEquals(no, bst.remove(no));\n assertEquals(new Integer(1), bst.size());\n //bst.printTree();\n }",
"public String remove()\n\t{\n\t\tString result = null;\n\t\tif (pointer > 0)\n\t\t{\n\t\t\tif (pointer == 1)\n\t\t\t{\n\t\t\t\tpointer--;\n\t\t\t\tresult = data[pointer];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tString oldRoot = data[0];\n\t\t\t\tString oldLast = data[pointer - 1];\n\t\t\t\tdata[0] = oldLast;\n\t\t\t\tdata[pointer - 1] = oldRoot;\n\t\t\t\tpointer--;\n\t\t\t\tresult = data[pointer];\n\t\t\t\tint parent = 0;\n\t\t\t\t//left child\n\t\t\t\tint childLeft = parent * 2 + 1;\n\n\t\t\t\twhile (childLeft < pointer)\n\t\t\t\t{\n\t\t\t\t\t//right child\n\t\t\t\t\tint childRight = parent * 2 + 2;\n\t\t\t\t\t//assume the mininum of the two children is left child\n\t\t\t\t\tint childMin = childLeft;\n\t\t\t\t\tif (childRight < pointer)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (smallerThan(childRight, childLeft))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tchildMin = childRight;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (smallerThan(childMin, parent))\n\t\t\t\t\t{\n\t\t\t\t\t\t//downheap\n\t\t\t\t\t\tswap(childMin, parent);\n\t\t\t\t\t\tparent = childMin;\n\t\t\t\t\t\tchildLeft = parent * 2 + 1;\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}",
"@Test\n public void remove_BST_0_CaseRootLeafRight()\n {\n BinarySearchTree bst = new BinarySearchTree();\n No root = new No(2);\n No no = new No(3);\n \n bst.insert(root, root);\n //bst.printTree();\n \n bst.insert(root, no);\n //bst.printTree();\n //System.err.println(); // Print[ERR] Devido a prioridade do buffer de impressao (out, err)\n \n assertEquals(new Integer(2), bst.size());\n assertEquals(no, bst.remove(no));\n assertEquals(new Integer(1), bst.size());\n //bst.printTree();\n }",
"public void remove(E x) {\n\n if(head == null) {\n return; // nothing to return.\n }\n\n if(head.data.equals(x)) {\n head = head.next; // moves where the first pointer is pointing to, and the garbage collector will delete the first element that has not pointers(old one)\n size--;\n return;\n }\n\n // Day 2\n RectNode<E> current = head;\n RectNode<E> back = head;\n\n while(current != null && !current.data.equals(x)) {\n back = current;\n current = current.next;\n }\n\n if(current == null) return;\n\n // else\n back.next = current.next;\n size--;\n\n }",
"@Test\n public void remove_BST_0_CaseRoot()\n {\n BinarySearchTree bst = new BinarySearchTree();\n No root = new No(6);\n bst.insert(null, root);\n bst.insert(root, new No(2));\n bst.insert(root, new No(9));\n //bst.printTree();\n //System.err.println(); // Print[ERR] Devido a prioridade do buffer de impressao (out, err)\n \n assertEquals(root, bst.remove(root));\n assertEquals(new Integer(2), bst.size());\n //bst.printTree();\n }",
"void deleteTreeRef(Node nodeRef) {\n\t\tSystem.out.println(\"\\nSize of given Tree before delete : \" + sizeOfTreeWithRecursion(nodeRef));\n\t\tdeleteTree(nodeRef);\n\t\tnodeRef = null;\n\n\t\tSystem.out.println(\"\\nSize of given Tree after delete : \" + sizeOfTreeWithRecursion(nodeRef));\n\t}",
"public boolean delete (int val) throws DifferentOrderTrees {\r\n \tboolean supprime = false;\r\n \tMonceau monceauTemp = new Monceau();\r\n \t\r\n \t//recherche de la valeur a supprimer\r\n \tfor (int i = 0; i < arbres.size(); i++) {\r\n \t\tif (arbres.get(i).findValue(val) == null)\r\n \t\t\tcontinue;\r\n \t\telse {\r\n \t\t\tmonceauTemp.arbres = arbres.get(i).findValue(val).delete();\r\n \t\t\tarbres.remove(arbres.get(i)); //supprime noeud\r\n \t\t\tthis.fusion(monceauTemp); //fusionne les 2 monceaux\r\n \t\t\ti = (0-1); //on recommence (-1 car on fait i++ apres (boucle for))\r\n \t\t\tsupprime = true;\r\n \t\t}\r\n \t}\r\n \t\r\n return supprime;\r\n }",
"private Node removeElement(Object value) {\n if (value.equals(this.value)) {\n return this.removeElement();\n }\n\n if (((Comparable)value).compareTo(this.value) < 0) {\n if (this.leftChild != null) {\n this.leftChild = this.leftChild.removeElement(value);\n return this.balance();\n }\n } else {\n if (this.rightChild != null) {\n this.rightChild = this.rightChild.removeElement(value);\n return this.balance();\n }\n }\n return this;\n }",
"public T deleteMin()\n\t{\t\n\t\t//declating variables\n\t\tint minIndex = 0;\n\t\tboolean flag = false;\n\t\tboolean flag2 = false;\n\t\t//if size == 0; returns null\n\t\tif(size == 0)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t//if checks size and deletes accordingly.\n\t\tif(size == 1)\n\t\t{\n\t\t\tT tempo = array[0];\n\t\t\tarray[0] = null;\n\t\t\tsize--;\n\t\t\treturn tempo;\n\n\t\t}\n\n\t\tif(size == 2)\n\t\t{\n\t\t\tT temp = array[0];\n\t\t\tarray[0] = array[1];\n\t\t\tarray[1] = null;\n\t\t\tsize--;\n\t\t\treturn temp;\n\n\t\t}\n\t\tif(size == 3)\n\t\t{\n\t\t\tT tempo = array[0];\n\t\t\tint small = grandChildMin(1, 2);\n\t\t\tarray[0] = array[small];\n\t\t\tif(small == 2)\n\t\t\t{\n\t\t\t\tarray[small] = null;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tarray[1] = array[2];\n\t\t\t\tarray[2] = null;\n\t\t\t}\n\n\t\t\tsize--;\n\t\t\treturn tempo;\n\t\t}\n\n\t\t//if size > 3 does sophisticated deleting\n\t\tT temp = array[0];\n\t\tarray[0] = array[size-1];\n\t\tarray[size-1] = null;\n\t\tsize--;\n\t\tint index = 0;\n\n\t\t//gets the smallest of the children & grandchildren\n\t\tint smallest = min(index).get(0);\n\t\t//while it has grandchildren, keeps going\n\t\twhile(smallest != 0)\n\t\t{\n\t\t\t//doesn't switch if im less than the smallest grandchild\n\t\t\t//& breaks\n\t\t\tif(object.compare(array[index], array[smallest]) <= 0 )\n\t\t\t{\n\t\t\t\tflag = true;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t//special case when i could switch with child or grandchild\n\t\t\tif( min(index).size() > 1)\n\t\t\t{\n\t\t\t\tflag2 = true;\n\t\t\t}\n\n\t\t\t//switches the locations and updates index\n\t\t\tT lemp = array[index];\n\t\t\tarray[index] = array[smallest];\n\t\t\tarray[smallest] = lemp;\n\t\t\tindex = smallest;\n\t\t\tsmallest = min(smallest).get(0);\n\n\t\t}\n\t\t//if i dont switch, i check if i have to switch then percolate back up\n\t\tif(flag == true)\n\t\t{\n\t\t\tif(object.compare(array[index], array[grandChildMin(2*index+1, 2*index+2)]) > 0)\n\t\t\t{\n\t\t\t\tint mIndex = grandChildMin(2*index+1, 2*index+2);\n\t\t\t\tT k = array[mIndex];\n\t\t\t\tarray[mIndex] = array[index];\n\t\t\t\tarray[index] = k;\n\n\t\t\t\tint y = mIndex;\n\t\t\t\twhile(object.compare(array[y], array[(y-3)/4]) > 0 && y > 2)\n\t\t\t\t{\n\t\t\t\t\tT f = array[(y-3)/4];\n\t\t\t\t\tarray[(y-3)/4] = array[y];\n\t\t\t\t\tarray[y] = f;\n\t\t\t\t\ty = (y-3)/4;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(object.compare(array[index], array[(index-1)/2]) > 0)\n\t\t\t{\n\t\t\t\tT m = array[(index-1)/2];\n\t\t\t\tarray[(index-1)/2] = array[index];\n\t\t\t\tarray[index] = m;\n\t\t\t\tint y = (index-1)/2;\n\t\t\t\twhile(object.compare(array[y], array[(y-3)/4]) > 0 && y > 2)\n\t\t\t\t{\n\t\t\t\t\tT k = array[(y-3)/4];\n\t\t\t\t\tarray[(y-3)/4] = array[y];\n\t\t\t\t\tarray[y] = k;\n\t\t\t\t\ty = (y-3)/4;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\telse if(flag2 == true)\n\t\t{\n\t\t\tint y = index;\n\n\t\t\tif(getLevel(y+1) % 2 == 1)\n\t\t\t{\n\t\t\t\twhile(object.compare(array[y], array[(y-3)/4]) > 0 && y > 2)\n\t\t\t\t{\n\t\t\t\t\tT k = array[(y-3)/4];\n\t\t\t\t\tarray[(y-3)/4] = array[y];\n\t\t\t\t\tarray[y] = k;\n\t\t\t\t\ty = (y-3)/4;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse{\n\t\t\t\twhile(object.compare(array[y], array[(y-3)/4]) < 0 && y > 2)\n\t\t\t\t{\n\t\t\t\t\tT k = array[(y-3)/4];\n\t\t\t\t\tarray[(y-3)/4] = array[y];\n\t\t\t\t\tarray[y] = k;\n\t\t\t\t\ty = (y-3)/4;\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t}\n\n\t\telse if(object.compare(array[index], array[grandChildMin(2*index +1, 2*index+2)]) > 0 && grandChildMin(2*index +1, 2*index+2) != 0)\n\t\t{\n\t\t\tminIndex = grandChildMin(2*index+1, 2*index+2);\n\t\t\tT wemp = array[index];\n\t\t\tarray[index] = array[minIndex];\n\t\t\tarray[minIndex] = wemp;\n\n\t\t\tint y = minIndex;\n\t\t\twhile(object.compare(array[y], array[(y-3)/4]) > 0 && y > 2)\n\t\t\t{\n\t\t\t\tT demp = array[(y-3)/4];\n\t\t\t\tarray[(y-3)/4] = array[y];\n\t\t\t\tarray[y] = demp;\n\t\t\t\ty = (y-3)/4;\n\t\t\t}\n\t\t}\n\n\t\telse if (object.compare(array[index], array[(index-1)/2]) > 0) \n\t\t{\n\n\t\t\tT femp = array[(index-1)/2];\n\t\t\tarray[(index-1)/2] = array[index];\n\t\t\tarray[index] = femp;\n\n\t\t\tint y = (index-1)/2;\n\t\t\twhile(object.compare(array[y], array[(y-3)/4]) > 0 && y > 2)\n\t\t\t{\n\t\t\t\tT demp = array[(y-3)/4];\n\t\t\t\tarray[(y-3)/4] = array[y];\n\t\t\t\tarray[y] = demp;\n\t\t\t\ty = (y-3)/4;\n\t\t\t}\n\t\t}\n\n\t\t\n\t\treturn temp;\n\t}",
"public void removeMax() {\n if (isEmpty()) throw new RuntimeException(\"underflow\");\n root = removeMax(root);\n }",
"Node deleteNode(Node root, int key) \n {\n if (root == null) \n return root; \n \n // If the key to be deleted is smaller than \n // the root's key, then it lies in left subtree \n if (key < root.key) \n root.left = deleteNode(root.left, key); \n \n // If the key to be deleted is greater than the \n // root's key, then it lies in right subtree \n else if (key > root.key) \n root.right = deleteNode(root.right, key); \n \n // if key is same as root's key, then this is the node \n // to be deleted \n else\n { \n // node with only one child or no child \n if ((root.left == null) || (root.right == null)) \n { \n Node temp = null; \n if (temp == root.left) \n temp = root.right; \n else\n temp = root.left; \n \n // No child case \n if (temp == null) \n { \n temp = root; \n root = null; \n } \n else // One child case \n root = temp; // Copy the contents of \n // the non-empty child \n } \n else\n { \n \n // node with two children: Get the inorder \n // successor (smallest in the right subtree) \n Node temp = minValueNode(root.right); \n \n // Copy the inorder successor's data to this node \n root.key = temp.key; \n \n // Delete the inorder successor \n root.right = deleteNode(root.right, temp.key); \n } \n } \n \n // If the tree had only one node then return \n if (root == null) \n return root; \n \n // STEP 2: UPDATE HEIGHT OF THE CURRENT NODE \n root.height = max(height(root.left), height(root.right)) + 1; \n \n // STEP 3: GET THE BALANCE FACTOR OF THIS NODE (to check whether \n // this node became unbalanced) \n int balance = getBalance(root); \n \n // If this node becomes unbalanced, then there are 4 cases \n // Left Left Case \n if (balance > 1 && getBalance(root.left) >= 0) \n return rightRotate(root); \n \n // Left Right Case \n if (balance > 1 && getBalance(root.left) < 0) \n { \n root.left = leftRotate(root.left); \n return rightRotate(root); \n } \n \n // Right Right Case \n if (balance < -1 && getBalance(root.right) <= 0) \n return leftRotate(root); \n \n // Right Left Case \n if (balance < -1 && getBalance(root.right) > 0) \n { \n root.right = rightRotate(root.right); \n return leftRotate(root); \n } \n \n return root; \n }",
"private BinarySearchTree deleteTree(BinarySearchTree tree, Comparable key){\r\n\t\t\r\n\t\t//If it is a leaf\r\n\t\tif(tree.getLeftChild() == null && tree.getRightChild() == null){\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t//Tree has only 1 leaf\r\n\t\telse if( (tree.getLeftChild() == null && tree.getRightChild() != null) ||\r\n\t\t\t\t (tree.getLeftChild() != null && tree.getRightChild() == null)){\r\n\t\t\t\r\n\t\t\t//Make a new tree out of the leaf and make it the new root\r\n\t\t\tif(tree.getLeftChild() != null){\r\n\t\t\t\treturn tree.getLeftChild();\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn tree.getRightChild();\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Has two leaves. This case is slightly more complicated\r\n\t\telse{\r\n\t\t\t//get the leftmost item in the right child subtree. This becomes the \r\n\t\t\t//new root. This allows the BinarySearchTree to stay a valid \r\n\t\t\t//BinarySearchTree\r\n\t\t\tKeyedItem replacementItem = findLeftMost(tree.getRightChild());\r\n\t\t\t\r\n\t\t\t//Delete the tree with that item so it can be moved to the new root\r\n\t\t\tBinarySearchTree replacementTree = deleteLeftMost(tree.getRightChild());\r\n\t\t\t\r\n\t\t\t//change the root to the new item\r\n\t\t\ttree.setRootItem(replacementItem);\r\n\t\t\t\r\n\t\t\t//Set the new roots right tree to the replacement tree\r\n\t\t\ttree.attachRightSubtree(replacementTree);\r\n\t\t\treturn tree;\r\n\t\t}\r\n\t}",
"protected Tree remove(){\n if(noItems<=0){\n System.out.println(\"Q Empty. Cant remove\");\n return null;\n }else{\n return array[--noItems];\n }\n }",
"public static TreapNode deleteNode(TreapNode root, int key)\n {\n if (root == null)\n return root;\n\n if (key < root.key)\n root.left = deleteNode(root.left, key);\n else if (key > root.key)\n root.right = deleteNode(root.right, key);\n\n // IF KEY IS AT ROOT\n\n // If left is null\n else if (root.left == null)\n {\n TreapNode temp = root.right;\n root = temp; // Make right child as root\n }\n\n // If Right is null\n else if (root.right == null)\n {\n TreapNode temp = root.left;\n root = temp; // Make left child as root\n }\n\n // If key is at root and both left and right are not null\n else if (root.left.priority < root.right.priority)\n {\n root = leftRotate(root);\n root.left = deleteNode(root.left, key);\n }\n else\n {\n root = rightRotate(root);\n root.right = deleteNode(root.right, key);\n }\n\n return root;\n }",
"public void delete(Integer data) {\n ArrayList<Node> parents = new ArrayList<>();\n Node nodeDel = this.root;\n Node parent = this.root;\n Node imBalance;\n Integer balanceFactor;\n boolean isLeftChild = false;\n if (nodeDel == null) {\n return;\n }\n while (nodeDel != null && !nodeDel.getData().equals(data)) {\n parent = nodeDel;\n if (data < nodeDel.getData()) {\n nodeDel = nodeDel.getLeftChild();\n isLeftChild = true;\n } else {\n nodeDel = nodeDel.getRightChild();\n isLeftChild = false;\n }\n parents.add(nodeDel);\n }\n\n if (nodeDel == null) {\n return;\n// delete a leaf node\n } else if (nodeDel.getLeftChild() == null && nodeDel.getRightChild() == null) {\n if (nodeDel == root) {\n root = null;\n } else {\n if (isLeftChild) {\n parent.setLeftChild(null);\n } else {\n parent.setRightChild(null);\n }\n }\n }\n// deleting a node with degree of one\n else if (nodeDel.getRightChild() == null) {\n if (nodeDel == root) {\n root = nodeDel.getLeftChild();\n } else if (isLeftChild) {\n parent.setLeftChild(nodeDel.getLeftChild());\n } else {\n parent.setRightChild(nodeDel.getLeftChild());\n }\n } else if (nodeDel.getLeftChild() == null) {\n if (nodeDel == root) {\n root = nodeDel.getRightChild();\n } else if (isLeftChild) {\n parent.setLeftChild(nodeDel.getRightChild());\n } else {\n parent.setRightChild(nodeDel.getRightChild());\n }\n }\n // deleting a node with degree of two\n else {\n Integer minimumData = minimumData(nodeDel.getRightChild());\n delete(minimumData);\n nodeDel.setData(minimumData);\n }\n parent.setHeight(maximum(height(parent.getLeftChild()), height(parent.getRightChild())));\n balanceFactor = getBalance(parent);\n if (balanceFactor <= 1 && balanceFactor >= -1) {\n for (int i = parents.size() - 1; i >= 0; i--) {\n imBalance = parents.get(i);\n balanceFactor = getBalance(imBalance);\n if (balanceFactor > 1 || balanceFactor < -1) {\n if (imBalance.getData() > parent.getData()) {\n parent.setRightChild(rotateCase(imBalance, data, balanceFactor));\n } else\n parent.setLeftChild(rotateCase(imBalance, data, balanceFactor));\n break;\n }\n }\n }\n }",
"public boolean remove(int node) {\n \n if (node < 0) {\n throw new IllegalArgumentException(\"node must \"\n + \"be greater than or equal to 0\");\n } else if (node > maxC) {\n throw new IllegalArgumentException(\"node must \"\n + \"be less than \" + maxC);\n }\n \n int index = node/binSz;\n \n boolean removed = deleteFromRBTree(node, index);\n \n if (!removed) {\n return false;\n }\n \n if (!xftReps.containsKey(index)) {\n return false;\n }\n \n TreeMap<Integer, Integer> map = getTreeMap(index);\n \n int existingRepr = xftReps.get(index);\n \n if (map.isEmpty()) {\n // just deleted the last item so remove from rbs\n // delete is O(log_2(w)) + O(w-l)\n if (xftReps.containsKey(index)) {\n xft.remove(Integer.valueOf(existingRepr));\n xftReps.remove(index);\n }\n } else if (node == existingRepr) {\n \n //existingRepr is maintained as the minimum in the bin,\n // so if a node w/ this value is removed and the multiplicity\n // was 1, need to assign a new repr\n \n // O(log_2(N/w))\n Integer multiplicity = map.get(Integer.valueOf(node));\n \n if (multiplicity == null) {\n // remove the current repr and assign a new one\n // delete is O(log_2(w)) + O(w-l)\n xft.remove(Integer.valueOf(existingRepr));\n xftReps.remove(index);\n \n // O(log_2(N/w))\n Entry<Integer, Integer> minEntry = map.firstEntry(); \n xft.add(minEntry.getKey());\n xftReps.put(index, minEntry.getKey()); \n } \n }\n \n n--;\n \n return true;\n }",
"public static TreeNode delete(TreeNode t, String target)\n {\n \n if(t == null)\n return null;\n \n else if(target.compareTo((String)t.getValue()) < 0)\n t.setLeft(delete(t.getLeft(), target));\n else if(target.compareTo((String)t.getValue()) > 0)\n t.setRight(delete(t.getRight(), target));\n else\n {\n //t.getValue() == v\n //ndoe thats leaf or one child\n if(t.getLeft() == null)\n return t.getRight();\n else if (t.getRight() == null)\n return t.getLeft();\n \n \n //if node has 2 children\n t.setValue(min(t.getRight()));\n \n //recursive call \n t.setRight(delete(t.getRight(), (String)t.getValue()));\n }\n return t;\n \n }",
"public void delete(int time) {\n\t\troot = delete(root, time);\n\t}",
"@objid (\"808c0839-1dec-11e2-8cad-001ec947c8cc\")\n @Override\n public void delete() {\n // List children from the end to avoid reordering of the other GMs\n for (int i = this.children.size() - 1; i >= 0; i--) {\n GmNodeModel child = this.children.get(i);\n child.delete();\n \n // When several elements have been deleted consecutively, fix the next index\n if (i > this.children.size()) {\n i = this.children.size();\n }\n }\n \n assert (this.children.isEmpty()) : \"All children should have been deleted:\" + this.children;\n \n super.delete();\n }",
"public void remove( Object x )\n {\n LinkedListItr p = findPrevious( x );\n\n if( p.current.next != null )\n p.current.next = p.current.next.next; // Bypass deleted node\n }",
"private Node removeMin(Node node){\n if(node == null)\n return null;\n else if(node.left == null) {//use right child to replace this node (min value node)\n if(node.count!=0){ //multiple value in same node\n node.count--;\n return node;\n }\n else{\n decDepth(node.right); //maintain depth when chain in right tree\n return node.right;\n }\n }\n\n //walk through left branch\n node.left = removeMin(node.left);\n if(node!=null) node.size--; // the min value must be removed\n return node;\n }",
"private void trimX() {\n\t\tint indexIntoBranches = 0;\n\t\tfor (int i = 0; i < this.branches.size(); i++) {\n\t\t\tif (this.branches.get(i).size() == this.numXVertices) {\n\t\t\t\tindexIntoBranches = i;\n\t\t\t}\n\t\t}\n\n\t\tthis.allX = (ArrayList) this.branches.get(indexIntoBranches).clone(); // We need this for a set difference above\n\n\t\tfor (int k = 0; k < this.branches.get(indexIntoBranches).size(); k++) {\n\t\t\tfor (int j = 0; j < this.branches.get(indexIntoBranches).size(); j++) {\n\t\t\t\t// Ignore if the index is the same - otherwise remove the edges\n\t\t\t\tif (!(k == j)) {\n\t\t\t\t\tthis.branches.get(indexIntoBranches).get(k)\n\t\t\t\t\t\t\t.removeNeighbor(this.branches.get(indexIntoBranches).get(j));\n\t\t\t\t\tthis.branches.get(indexIntoBranches).get(j)\n\t\t\t\t\t\t\t.removeNeighbor(this.branches.get(indexIntoBranches).get(k));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public void clear(){\n root = null;\n count = 0;\n }",
"private boolean deleteFromRBTree(int node, int index) {\n \n TreeMap<Integer, Integer> map = getTreeMap(index);\n \n assert(map != null);\n \n Integer key = Integer.valueOf(node);\n\n Integer multiplicity = map.get(key);\n \n if (multiplicity == null) {\n return false;\n }\n \n if (multiplicity.intValue() > 0) {\n multiplicity = Integer.valueOf(multiplicity.intValue() - 1);\n if (multiplicity.intValue() > 0) {\n map.put(key, multiplicity);\n }\n }\n if (multiplicity.intValue() == 0) {\n map.remove(key);\n }\n \n return true;\n }",
"public NodeBinaryTree deleteNode(NodeBinaryTree node, int value)\n {\n if(node == null)\n {\n return null;\n }\n\n if(value < node.data)\n {\n node.leftNode = deleteNode(node.leftNode, value);\n }\n else if(value > node.data)\n {\n node.rightNode = deleteNode(node.rightNode, value);\n }\n else\n {\n // it is the condition where the the ndoe value is itself\n if(node.leftNode == null)\n {\n return node.rightNode;\n }\n else if(node.rightNode == null)\n {\n return node.leftNode;\n }\n\n // we traverse right part of tree for minimum value\n node.data = minimumValueOfRight(node.rightNode);\n node.rightNode = deleteNode(node.rightNode, node.data);\n }\n return node;\n }",
"private void eliminarAux(NodoAVL<T> actual){\n NodoAVL<T> papa= actual.getPapa();\n if(actual.getHijoIzq()==null && actual.getHijoDer()==null)\n eliminaSinHijos(actual,papa); \n else{//CASO2: Nodo con un solo hijo (izq)\n NodoAVL<T> sustituto;\n if(actual.getHijoIzq()!=null && actual.getHijoDer()==null){\n sustituto= actual.getHijoIzq();\n eliminaSoloConHijoIzq(actual,papa,sustituto); \n }\n else//CASO3: Nodo con un solo hijo (der)\n if(actual.getHijoIzq()==null && actual.getHijoDer()!=null){\n sustituto= actual.getHijoDer();\n eliminaSoloConHijoDer(actual,papa, sustituto);\n }\n else //CASO4: Nodo con dos hijos\n if(actual.getHijoIzq()!=null && actual.getHijoDer()!=null)\n eliminaConDosHijos(actual);\n }\n \n }",
"private WAVLNode successorForDel(WAVLNode x) {\n\t x.right.sizen--;\r\n\t x=x.right;\r\n\t while(x.left!=EXT_NODE) {\r\n\t\t x=x.left;\r\n\t\t x.sizen--;\r\n\t }\r\n\t return x;\r\n }",
"void deleteTreeRef(TreeNode nodeRef) \n { \n \tif(nodeRef == null) return;\n \t\n \t\n \tdeleteTreeRef(nodeRef.left);\n\n \tdeleteTreeRef(nodeRef.right);\n \t\n \t\n \t System.out.println(\"Deleting node:\" + nodeRef.val);\n \t deleteTree(nodeRef); \n \n nodeRef=null; \n }",
"public void delete(Item<K,V> i) {\n if (i.getL() == null && i.getR() == null) {\n if (i.getP() != null) {\n declineChild(i, null);\n } else {\n root = null;\n }\n } else if (i.getL() != null && i.getR() != null) {\n Item<K,V> s = successor(i);\n declineChild(s, s.getR());\n i.setK(s.getK());\n i.setV(s.getV());\n } else {\n Item<K,V> x = i.getL();\n if (x == null) {\n x = i.getR();\n }\n if (i.getP() != null) {\n declineChild(i, x);\n } else {\n root = x;\n x.setP(null);\n }\n }\n size -= 1;\n }",
"@Override\n public Node remove() {\n Node temp;\n int x = 0;\n while (isEmpty(x)) {\n x++;\n }\n temp = hashTable[x];\n hashTable[x] = temp.getNext(); \n\n return temp;\n }",
"public void delete(int index) {\n\t\tNode node = getNode(index+1);\n\t\tNode parentOfLast = getNode(size >> 1);\n\t\tnode.data = parentOfLast.right != null ? parentOfLast.right.data : parentOfLast.left.data;\n\t\tif (parentOfLast.right != null) {\n\t\t\tparentOfLast.right = null;\n\t\t}\n\t\telse {\n\t\t\tparentOfLast.left = null;\n\t\t}\n\t}"
] | [
"0.7138388",
"0.7138388",
"0.6704454",
"0.66775453",
"0.6529372",
"0.65024424",
"0.6500068",
"0.64632285",
"0.64371085",
"0.6414801",
"0.63899857",
"0.6379738",
"0.63501775",
"0.6349395",
"0.63392895",
"0.6326257",
"0.62754196",
"0.62754196",
"0.627239",
"0.61860853",
"0.6165788",
"0.61635405",
"0.61141646",
"0.6092911",
"0.6088188",
"0.60741013",
"0.6039825",
"0.602826",
"0.60265243",
"0.6023869",
"0.60165936",
"0.59739584",
"0.5958398",
"0.5909505",
"0.58946675",
"0.5893151",
"0.58725363",
"0.58634263",
"0.58536434",
"0.5850803",
"0.5845906",
"0.58310616",
"0.582678",
"0.58157104",
"0.5811279",
"0.5793486",
"0.5792728",
"0.5788989",
"0.5783622",
"0.577868",
"0.57771796",
"0.57530004",
"0.5718398",
"0.571818",
"0.57165915",
"0.5701482",
"0.5691405",
"0.5690945",
"0.5688479",
"0.5686054",
"0.5685156",
"0.56799525",
"0.5679943",
"0.56794494",
"0.567479",
"0.56717783",
"0.5668191",
"0.5653156",
"0.5649536",
"0.5648786",
"0.56470084",
"0.56304264",
"0.5629378",
"0.56180584",
"0.5614034",
"0.5581602",
"0.5568301",
"0.555937",
"0.5558949",
"0.55581766",
"0.55534184",
"0.5551324",
"0.55455494",
"0.55396307",
"0.5536868",
"0.5531097",
"0.5521518",
"0.55172634",
"0.5516747",
"0.5516035",
"0.55143684",
"0.5513476",
"0.55102026",
"0.55068374",
"0.5500397",
"0.5496808",
"0.54956627",
"0.54912263",
"0.5490873",
"0.5486989"
] | 0.7040448 | 2 |
Precondition: key != null && key != "" | private Node<Value> delete(Node<Value> x, String key, int d)
{
if (x == null) return null;
char c = key.charAt(d);
if (c > x.c) x.right = delete(x.right, key, d);
else if (c < x.c) x.left = delete(x.left, key, d);
else if (d < key.length()-1) x.mid = delete(x.mid, key, d+1);
else if (x.val != null) { x.val = null; --N; }
if (x.mid == null && x.val == null)
{
if (x.left == null) return x.right;
if (x.right == null) return x.left;
Node<Value> t;
if (StdRandom.bernoulli()) // to keep balance
{ t = min(x.right); x.right = delMin(x.right); }
else
{ t = max(x.left); x.left = delMax(x.left); }
t.right = x.right;
t.left = x.left;
return t;
}
return x;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static void checkForNullKey(String key) {\n if ( key == null ) {\n throw new NullPointerException();\n }\n }",
"private String check_Key(String key) throws JsonException {\r\n\t\tif (key == null || key.isEmpty()) {\r\n\t\t\tthrow new JsonException(\"The key must not null, or empty\");\r\n\t\t}\r\n\r\n\t\treturn key;\r\n\t}",
"private void throwIfNullKey(final K key) {\n if (key == null) {\n throw new IllegalArgumentException(\"null keys are not supported\");\n }\n }",
"protected boolean addNonEmpty(final String key, final String value) {\n if (isEmptyString(value)) {\n final String format = \"Parameter '%s' is required and may not be null or empty!\";\n throw new IllegalArgumentException(String.format(format, key));\n }\n return addParameterValue(key, value);\n }",
"abstract protected boolean validateKey(String key);",
"boolean containsKey(Object key) throws NullPointerException;",
"Boolean isBlankOrNull(String key)\n {\n return StringUtils.isBlank(properties.getProperty(key));\n }",
"private void check(List<K> key) {\n if (key == null || key.isEmpty()) {\n throw new IllegalArgumentException(\"key must be a list of size >= 1\");\n }\n }",
"public void setKey(String key) {\n this.key = key == null ? null : key.trim();\n }",
"public void setKey(String key) {\n this.key = key == null ? null : key.trim();\n }",
"Object get(Object key) throws NullPointerException;",
"@Override\n\t\t\tpublic String get(String key) {\n\t\t\t\treturn null;\n\t\t\t}",
"private V isertNullKey(K key, V value) {\n return value;\n }",
"private boolean validate(String key) {\n \t\t\t for (int i = 0; i < ignoreKeys.length; i ++) {\n \t\t\t\t String test = key.trim();\n \t\t\t\t if(test.equalsIgnoreCase(ignoreKeys[i])) return false;\n \t\t\t }\n \t\t\t return true;\n \t\t }",
"private String getString(String key) {\n return key;\r\n }",
"private void checkStringKey(Key key) {\n m_logger.debug(\"checkByteArrKey start key:\" + key.toString());\n if(m_cache != null){\n \tm_logger.debug(\"Cache HashCode:\" + m_cache.hashCode());\n }\n if (m_checked){\n m_logger.debug(\"checkByteArrKey end.\");\n \treturn;\n }\n if (key instanceof String) {\n if (!(m_cache instanceof StringMap)) {\n \tm_logger.debug(\"Cache HashCode:\" + m_cache.hashCode());\n throw new RuntimeException(\"Wrong map/set for String key\");\n }\n }\n m_checked = true;\n m_logger.debug(\"checkByteArrKey end.\");\n }",
"@Override\n protected void onNullNonKeyAttribute(String attributeName) {\n /* When doing a force put, we can safely ignore the null-valued attributes. */\n return;\n }",
"public boolean isValidKey(String key) throws Exception;",
"private NoValue(K key) {\n this.key = key;\n }",
"java.lang.String getFieldOrThrow(\n java.lang.String key);",
"protected void checkKey(Object key) {\n\tif (!canContainKey(key)) {\n throw new IllegalArgumentException(\n \"key is not valid for this LeaseMap\");\n }\n }",
"String getString(String key);",
"public String getMandatoryString(String key) throws ConfigNotFoundException;",
"@Override\n public Object getValue(String key) {\n return null;\n }",
"java.lang.String getAttributesOrThrow(java.lang.String key);",
"@Override\n\t\t\tpublic boolean contains(String key) {\n\t\t\t\treturn false;\n\t\t\t}",
"NOT_OK(@JsonProperty String key) { this.key = key; }",
"protected boolean shouldAddProperty(String key) {\n return !key.equals(\"label\") && !key.equals(\"id\");\n }",
"public String getString(String key);",
"protected final String getString(final String key) {\n try {\n if (!jo.isNull(key)) {\n return jo.getString(key);\n }\n } catch (JSONException e) {\n } catch (ArrayIndexOutOfBoundsException e) {\n }\n return null;\n }",
"public void delete(String key)\r\n {\r\n if (key.equals(\"\")) {\r\n if (null_str_val != null) --N;\r\n null_str_val = null;\r\n return;\r\n }\r\n root = delete(root, key, 0);\r\n }",
"public boolean hasKey() {\n return keyBuilder_ != null || key_ != null;\n }",
"private int validateKey (int key) {\n return (key < 0 || key > ALPHABET_LENGTH-1) ? 0 : key;\n }",
"public Vigenere(CharSequence key)\n\t{\n\t\tthis.key = sanitizeValue(key);\n\t}",
"@Override\r\n\tpublic boolean containsKey(Object key) {\r\n\t\tif (key == null) throw new NullPointerException();\r\n\t\treturn get(key) != null;\r\n\t}",
"private static void isValid(Map<String, Set<String>> propertiesGroupedBy, String key) {\n stringPredicate = s -> {\n final String property = PropertiesUtil.getInstance().getProperty(s);\n return (property == null || property.isEmpty());\n };\n\n //but you can write more predicates as per your needs\n\n\n final Optional<String> optional = propertiesGroupedBy.get(key).stream().filter(stringPredicate).findFirst();\n\n if (optional.isPresent()) {\n try {\n throw new Exception(optional.get() + \" value is null or empty \");\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }",
"public boolean isSmartKey(String key);",
"private String validateAndGetLowerCaseKey(String key) {\n Strings.requireNonNullAndNotEmpty(key);\n return key.toLowerCase(Locale.ROOT);\n }",
"String getString(String key) throws KeyValueStoreException;",
"@NotNull\n @JsonProperty(\"key\")\n public String getKey();",
"protected String getNavArgStr(String key){\r\n if(mNavArgs != null && mNavArgs.containsKey(key)){\r\n return (String)mNavArgs.get(key);\r\n }\r\n return null;\r\n }",
"Object remove(Object key) throws NullPointerException;",
"public boolean contains(String key)\r\n { return get(key) != null; }",
"private boolean isPresent(JSONObject object, String key) {\n\n\t\treturn !(object.isNull(key));\n\n\t}",
"@Override\n\tpublic boolean containsKey(Object arg0) {\n\t\treturn false;\n\t}",
"boolean hasKey(String key);",
"@SuppressWarnings(\"rawtypes\")\n private boolean containsNoValidValueFor(final Dictionary properties,\n final String propertyKey) {\n final Object propertyValue = properties.get(propertyKey);\n return !(propertyValue instanceof String) || StringUtils.isEmpty((String) propertyValue);\n }",
"Object put(Object key, Object value) throws NullPointerException;",
"NOT_OK2(@JsonProperty String key) { this.key = key; }",
"private String getValueFromRequest(String key, HttpServletRequest request) {\n if (!StringUtils.isEmpty(key) && null != request) {\n return request.getParameter(key);\n }\n return null;\n }",
"@Test\n public void test001_IllegalNullKey() {\n try {\n HashTableADT htIntegerKey = new HashTable<Integer, String>();\n htIntegerKey.insert(null, null);\n fail(\"should not be able to insert null key\");\n } catch (IllegalNullKeyException e) {\n /* expected */ } catch (Exception e) {\n fail(\"insert null key should not throw exception \" + e.getClass().getName());\n }\n }",
"private boolean containsKeyHelper(Node n, K key) {\n // base case\n if (n == null) {\n return false;\n }\n\n int compareResult = key.compareTo(n.key);\n if (compareResult == 0) {\n return true;\n } else if (compareResult < 0) {\n return containsKeyHelper(n.leftChild, key);\n } else {\n return containsKeyHelper(n.rightChild, key);\n }\n }",
"public boolean hasKey() {\n return key_ != null;\n }",
"default String normalizeKey(String key) {\r\n\t\treturn key.intern();\r\n\t}",
"private String isKeyAlreadyFormed(String Key){\n\t\tfor(String key : userData.keySet()){\n\t\t\tif(key.startsWith(Key)){\n\t\t\t\treturn key;\n\t\t\t}\n\t\t}\n\t\treturn \"\";\n\t}",
"@Override\n\t\t\tpublic boolean containsKey(Object key) {\n\t\t\t\treturn false;\n\t\t\t}",
"public boolean containsKey(final String key) {\n return key != null && _properties.containsKey(key);\n }",
"@Override\n public boolean contains(String key) {\n if (key == null) {\n throw new IllegalArgumentException(\"argument to contains() is null\");\n }\n return get(root, key, 0) != null;\n }",
"private void setKey(String key){\n\t\tthis.key=key;\n\t}",
"public final String nullSafeGetString(final JSONObject data, final String key) {\n if ( data.get(key) != null ) {\n return data.get(key).toString();\n } else {\n return \"null\";\n }\n }",
"@Override\r\n public K lowerKey(final K key) {\n return null;\r\n }",
"@Override\n public boolean containsKey(Object key) {\n String fieldName = key.toString();\n ScriptDocValues<?> scriptValues = localCacheFieldData.get(fieldName);\n if (scriptValues == null) {\n MappedFieldType fieldType = mapperService.fieldType(fieldName);\n if (fieldType == null) {\n return false;\n }\n }\n return true;\n }",
"@Override\n\tpublic boolean containsKey(Object key) {\n\t\treturn false;\n\t}",
"@Ignore\n\t@Test\n\tpublic void testParamNull() {\n\t\tregisterParamException(null, keyString, valueString);\n\t\tregisterParamException(groupString, null, valueString);\n\t\tregisterParamException(groupString, keyString, null);\n\t}",
"public void testGetObjectSpecificationWithNullKey() throws Exception {\r\n root.addChild(createObject(\"key:identifier\", TYPE_OBJECT));\r\n\r\n specificationFactory = new ConfigurationObjectSpecificationFactory(root);\r\n\r\n try {\r\n specificationFactory.getObjectSpecification(null, \"identifier\");\r\n fail(\"IllegalArgumentException is expected.\");\r\n } catch (IllegalArgumentException e) {\r\n // ok\r\n }\r\n }",
"@Test\n\tpublic void equalsNullItemType() {\n\t\tProductScanImageURIKey key1 = this.getDefaultKey();\n\t\tProductScanImageURIKey key2 = this.getDefaultKey();\n\t\tkey1.setId(LONG_ZERO);\n\t\tboolean equals = key1.equals(key2);\n\t\tAssert.assertFalse(equals);\n\t}",
"public boolean assertNotNullKeys(Map<String, String> viewparams, String...keys) {\n\t\tif (viewparams == null || keys == null) return false;\n\t\tfor(String k : keys) {\n\t\t\tif (viewparams.get(k) == null) {\n\t\t\t\tthrow new IllegalArgumentException(\"proc-argument-exception :key[\"+ k + \"] is missing\");\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"public void privateSetPeopleKey(com.hps.july.persistence.PeopleKey inKey) {\n\tboolean people_NULLTEST = (inKey == null);\n\tif (people_NULLTEST) people_man = null; else people_man = (new Integer(inKey.man));\n}",
"@Test\n\tpublic void removeMyKeyNullName() {\n\t\tRsaKeyStore ks = new RsaKeyStore();\n\t\tks.createNewMyKeyPair(\"first\");\n\t\tks.createNewMyKeyPair(\"second\");\n\t\tks.removeMyKey(null);\n\t\tSet<String> names = ks.getMyKeyNames();\n\t\tassertTrue(\"wrong number of keys\", names.size() == 2);\n\t\tassertTrue(\"should contain key\", names.contains(\"first\"));\n\t\tassertTrue(\"should contain key\", names.contains(\"second\"));\n\t\tassertFalse(\"should not contain key\", names.contains(null));\n\t}",
"@Override\n public boolean contains(String key) {\n if (key == null || key.length() == 0 || root == null)\n return false;\n Node p = root;\n for (int i = 0; i < key.length(); i++) {\n char current = key.charAt(i);\n Node next = p.next.get(current);\n if (next == null) {\n return false;\n }\n p = next;\n }\n return p.isKey;\n }",
"@Override\n\tpublic String getKey() {\n\t\treturn null;\n\t}",
"void setKey(java.lang.String key);",
"final String get(String key) {\n return get(key,null);\n }",
"public boolean isSetKey() {\n return this.key != null;\n }",
"public static String getQueryString(String key) {\n String value = Http.Context.current().request().getQueryString(key);\n if (value != null) {\n value = value.trim();\n }\n return value;\n }",
"private void setKey(String key) {\n this.key = key;\n }",
"public boolean containsKey(String key) {\n \treturn (getNode(key) != null);\n }",
"boolean hasKey();",
"boolean hasKey();",
"boolean hasKey();",
"boolean hasKey();",
"boolean hasKey();",
"public String getString(String key) {\r\n String value = (String) keyvaluepairs.get(key.toLowerCase());\r\n return value == null ? \"\" : value;\r\n }",
"private DataKeys(String pKey) {\n key = pKey;\n }",
"@Override\r\n\tpublic String getKey() {\n\t\treturn null;\r\n\t}",
"@Override\r\n\tpublic String getKey() {\n\t\treturn null;\r\n\t}",
"public boolean contains(String key){\r\n\t\treturn get(key) != null;\r\n\t}",
"public IDataKey(String key) {\n this(key, false);\n }",
"@Implementation\n protected String getParameters(String keys) {\n return null;\n }",
"public TypeFilterHonSearch(String key) {\r\n\t\temptyKey = StringUtils.isEmpty(key);\r\n\t\tif (emptyKey == false) {\r\n\t\t\tkey = key.trim().toLowerCase();\r\n\t\t\tif (key.length() > 0) {\r\n\t\t\t\tif (key.charAt(key.length() - 1) != '*') {\r\n\t\t\t\t\tkey += '*';\r\n\t\t\t\t}\r\n\t\t\t\tpattern = Pattern.compile(StringUtils.replace(key, \"*\", \".*\"));\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"boolean isTypeKey(String key);",
"void setKey(final String key);",
"@Override\n\t\tpublic boolean hasProperty(String key) {\n\t\t\treturn false;\n\t\t}",
"public boolean containsKey(Key key) ;",
"boolean hasCompoundKey();",
"public boolean contains(String key) {\r\n\t\treturn getValue(key) != null;\r\n\t}",
"@Override\n public Object getMetadata(String key) {\n return null;\n }",
"public boolean definesKey( final String key ) {\n return values.containsKey( key );\n }",
"private void ensureValidKeyNames() {\n assertThat(Iterables.any(graphiteMockServer.content, containsPattern(\"\\\\.\\\\.\")), is(false));\n assertThat(Iterables.any(graphiteMockServer.content, containsPattern(\"\\\\[\")), is(false));\n assertThat(Iterables.any(graphiteMockServer.content, containsPattern(\"\\\\]\")), is(false));\n assertThat(Iterables.any(graphiteMockServer.content, containsPattern(\"\\\\(\")), is(false));\n assertThat(Iterables.any(graphiteMockServer.content, containsPattern(\"\\\\)\")), is(false));\n }",
"private String getRequiredProperty(Properties props, String key) {\r\n\t\tString value = props.getProperty(key);\r\n\t\tif ((value == null) || (value.trim().length() == 0)) {\r\n\t\t\tthrow new IllegalArgumentException(\r\n\t\t\t\t\t\"Property file must provide a value for '\" + key + \"'\");\r\n\t\t}\r\n\t\treturn value;\r\n\t}",
"public PSRelation(String keyName, String keyValue)\n {\n if (keyName == null || keyName.trim().length() == 0)\n throw new IllegalArgumentException(\"keyName may not be null or empty\");\n\n if (keyValue == null || keyValue.trim().length() == 0)\n throw new IllegalArgumentException(\"keyValue may not be null or empty\");\n\n if (keyValue == null)\n keyValue = \"\";\n\n addKey(keyName, keyValue);\n }"
] | [
"0.7615119",
"0.7579539",
"0.6961755",
"0.6902722",
"0.6641339",
"0.65320146",
"0.6527743",
"0.63981277",
"0.63416207",
"0.63416207",
"0.6283288",
"0.6204538",
"0.62031466",
"0.611632",
"0.6113176",
"0.6110939",
"0.5992873",
"0.5937752",
"0.585013",
"0.57969534",
"0.5774319",
"0.5726662",
"0.57265073",
"0.57262343",
"0.57061034",
"0.56996137",
"0.5693376",
"0.56853706",
"0.5675438",
"0.56741035",
"0.56595516",
"0.56574607",
"0.56351423",
"0.56321865",
"0.56310844",
"0.56273824",
"0.56226254",
"0.5618093",
"0.56108665",
"0.5610264",
"0.56044006",
"0.5598819",
"0.55954564",
"0.5582886",
"0.55808264",
"0.55759186",
"0.5564174",
"0.5559763",
"0.55594856",
"0.5548796",
"0.5544418",
"0.55252624",
"0.55175185",
"0.55089194",
"0.55005246",
"0.5494881",
"0.54864246",
"0.5479349",
"0.54667044",
"0.54661316",
"0.54652417",
"0.5463426",
"0.5461646",
"0.5454805",
"0.54399323",
"0.5434873",
"0.5431192",
"0.54293746",
"0.54231954",
"0.542199",
"0.5416689",
"0.54097676",
"0.5409026",
"0.5407688",
"0.5406314",
"0.5403543",
"0.5397832",
"0.53864694",
"0.53864694",
"0.53864694",
"0.53864694",
"0.53864694",
"0.53825974",
"0.53713846",
"0.53661597",
"0.53661597",
"0.5342593",
"0.53360885",
"0.5333222",
"0.53323317",
"0.5331505",
"0.533081",
"0.5310692",
"0.5308701",
"0.53051686",
"0.5304079",
"0.5301353",
"0.5300271",
"0.52961034",
"0.5292175",
"0.5284245"
] | 0.0 | -1 |
Application Programming Interfaces Returns the number of keyvalue pairs in this symbol table. | public int size()
{ return N; } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Integer sizeOfMap() {\n\t\tMap<String, String> simpleMap = createSimpleMap(\"Key\", \"Value\");\n numberOfEntries = 10;\n\t\treturn simpleMap.size();\n\t}",
"@Override\n public int getG2HashTableNumberOfEntries() throws G2AccessException {\n java.lang.Object retnValue = getAttributeValue (SystemAttributeSymbols.G2_HASH_TABLE_NUMBER_OF_ENTRIES_);\n return ((Integer)retnValue).intValue ();\n }",
"public int size() {\r\n return numberOfKeys;\r\n }",
"public int size() \n\t{\n\t\treturn numKeys;\n\t}",
"int sizeOfKeyArray();",
"public PrimitiveVS<Integer> size() {\n return keys.size();\n }",
"public int sizeOfTypekeyArray()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().count_elements(TYPEKEY$16);\r\n }\r\n }",
"@Override\n public int size() {\n int count = 0;\n for (Counter c : map.values())\n count += c.value();\n return count;\n }",
"public int getSymbolTableSize() {\n\t\treturn symbolTableSize;\n\t}",
"public int size() {\n return keys.length;\n }",
"@Override\n public int size() {\n return numKeys;\n }",
"@Override\n public int size() {\n return numKeys;\n }",
"public Map<String,Integer> getNumKeysMapping(){\n\t\treturn num_keys;\n\t}",
"int getStateValuesCount();",
"public int getKeyCount() {\n return associationCountMap.size();\n }",
"public int size()\n\t{\n\t\tint size = 0;\n\t\tfor(List<Registry.Entry> li : this.reg.values())\n\t\t\tsize += li.size();\n\t\treturn size;\n\t}",
"int getNumKeys();",
"int getValuesCount();",
"public int getStateValuesCount() {\n return stateValues_.size();\n }",
"public int size() {\n\t\treturn nvPairs.size() >> 1;\n\t}",
"public int size() {\n int size = 0;\n for (Collection<V> value : map.values()) {\n size += value.size();\n }\n return size;\n }",
"public static synchronized int size() {\n\t\treturn ClassRegistry.dictionary.size();\n\t}",
"public int getValueCount() {\n return value_.size();\n }",
"public int getStateValuesCount() {\n return stateValues_.size();\n }",
"Integer countForKey(String key);",
"@Override\r\n\tpublic int size() {\n\t\treturn keys.size();\r\n\t}",
"public int getValueCount() {\n return value_.size();\n }",
"public int size() {\n return this.values.length;\n }",
"public int getLength(){\n return keys.length;\n }",
"public int getEntryCount() {\n return mem.getChar(34);\n }",
"public int size(){\n\t\treturn hashTableSize;\n\t}",
"public long[] getSymbolCounts() {\n\t\treturn symbolCounts;\n\t}",
"public int size()\r\n/* 106: */ {\r\n/* 107:194 */ assert (checkRep());\r\n/* 108:195 */ return this.map.keySet().size();\r\n/* 109: */ }",
"public int numberOfEntries();",
"@Override\r\n\tpublic int size() {\r\n\t\treturn keySet().size();\r\n\t}",
"public int getNumElements() {\n return theMap.size();\n }",
"public int size() {\n\t\treturn map.size();\n\t}",
"public int numOfHashFunctions() {\n return config().getK();\n }",
"public int\tsize() {\n\t\treturn map.size();\n\t}",
"public int size() {\n return map.size();\n }",
"public int size(){\n\t\tListMapEntry temp = first;\n\t\tint c=0;\n\t\twhile(temp!=null){\n\t\t\tc++;\n\t\t\ttemp = temp.getNext();\n\t\t}\n\t\treturn c;\n\t}",
"public static int size() {\n\t\treturn anisLookup.size();\n\t}",
"@Override\n\tpublic int size() {\n\t\tint tamano = 0;\n\t\tint i = 0;\n\t\tIterator it = tabla.iterator();\n\t\twhile (it.hasNext()) {\n\t\t\tit.next();\n\t\t\ttamano += tabla.get(i).keySet().size();\n\t\t\ti++;\n\t\t}\n\t\treturn tamano;\n\t}",
"public int size() {\n return map.size();\n }",
"public int size() {\n if (hasKeys) {\n return keys.size();\n } else {\n return objects.size();\n }\n }",
"public synchronized int size() throws IOException {\n\t\t\treadIndex();\n\t\t\treturn keys.size();\n\t\t}",
"int getKeyspacesCount();",
"public int size() {\n return values.size();\n }",
"public int getKeyspacesCount() {\n if (keyspacesBuilder_ == null) {\n return keyspaces_.size();\n } else {\n return keyspacesBuilder_.getCount();\n }\n }",
"public int size() {\r\n\t\treturn values.length;\r\n\t}",
"public int getNumberOfEntries();",
"public int sizeOfMap(){return size;}",
"int getKeySize();",
"public int sizeOfValueArray()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(VALUE$0);\n }\n }",
"public int getKeyNumber()\r\n {\r\n return number_of_key;\r\n }",
"private int getVariablesNumberInMap() {\n\t\tSet<String> variables = KeyValue.getFirstLevelKeys();\n\t\tint count = 0;\n\t\tfor (String name : variables) {\n\t\t\tif (!name.contains(\"~\")) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t\treturn count;\n\t}",
"public int size(){\r\n return cjtMap.size();\r\n }",
"public Integer keySize() {\n return this.keySize;\n }",
"public final synchronized int size() {\n\t\treturn map.size();\n\t}",
"public int size()\n\t{\n\t\tverifyParseState();\n\t\t\n\t\treturn values.size();\n\t}",
"@Override\n public int getKeyspacesCount() {\n return keyspaces_.size();\n }",
"public int size ()\n {\n return this.entryMap.size ();\n }",
"public int getNumberOfEntries() ;",
"@DISPID(11) //= 0xb. The runtime will prefer the VTID if present\r\n @VTID(18)\r\n int count();",
"@Override\n\tpublic int numValues() {\n\t\t// TODO Auto-generated method stub\n\t\treturn 0;\n\t}",
"public int getValuesSize() {\n return values.size();\n }",
"final public int getValueCount(int value) {\r\n \treturn this.values[value];\r\n }",
"public int count( K key ) {\n Integer i = map.get( key );\n return i == null ? 0 : i;\n }",
"@Override\n\tpublic int size() {\n\t\treturn map.size();\n\t}",
"int getMapEntrySize() {\n if (frameType >= Const.SAME_FRAME && frameType <= Const.SAME_FRAME_MAX) {\n return 1;\n }\n if (frameType >= Const.SAME_LOCALS_1_STACK_ITEM_FRAME && frameType <= Const.SAME_LOCALS_1_STACK_ITEM_FRAME_MAX) {\n return 1 + (typesOfStackItems[0].hasIndex() ? 3 : 1);\n }\n if (frameType == Const.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED) {\n return 3 + (typesOfStackItems[0].hasIndex() ? 3 : 1);\n }\n if (frameType >= Const.CHOP_FRAME && frameType <= Const.CHOP_FRAME_MAX || frameType == Const.SAME_FRAME_EXTENDED) {\n return 3;\n }\n if (frameType >= Const.APPEND_FRAME && frameType <= Const.APPEND_FRAME_MAX) {\n int len = 3;\n for (final StackMapType typesOfLocal : typesOfLocals) {\n len += typesOfLocal.hasIndex() ? 3 : 1;\n }\n return len;\n }\n if (frameType != Const.FULL_FRAME) {\n throw new IllegalStateException(\"Invalid StackMap frameType: \" + frameType);\n }\n int len = 7;\n for (final StackMapType typesOfLocal : typesOfLocals) {\n len += typesOfLocal.hasIndex() ? 3 : 1;\n }\n for (final StackMapType typesOfStackItem : typesOfStackItems) {\n len += typesOfStackItem.hasIndex() ? 3 : 1;\n }\n return len;\n }",
"public int getNumberOfEntries()\r\n\t{\r\n\t\treturn tr.size();\r\n\t}",
"public int size() {\r\n\t\tint size = 0;\r\n\t\tfor (Integer key : connectionLists.keySet()) {\r\n\t\t\tsize += connectionLists.get(key).size();\r\n\t\t}\r\n\t\treturn size;\r\n\t}",
"int getStrValuesCount();",
"public int size() {\n\t\t\treturn ALPHABET.length;\n\t\t}",
"@Override\r\n public int getSize()\r\n {\r\n return keyHash.size();\r\n }",
"public int getNumPairs()\n\t{\n\t\treturn pairs.size();\n\t}",
"public int getTotalKeyLength() {\n return this.primaryKeyLength + this.secondaryKeyLength;\n }",
"int getEntryCount();",
"public int getTabCount() {\n\t\treturn tabMap.size();\n\t}",
"public int size() {\n\t\treturn numEntries;\n\t}",
"public int getVertexCount() {\n return map.keySet().size();\n }",
"public int size() {\r\n return this.map.size();\r\n }",
"public int getNumberOfStructures() {\n\t\tSet<String> cs = this.getMainInstance().getConfig().getConfigurationSection(\"Schematics\").getKeys(false);\n\t\treturn cs.size();\n\t}",
"public static int calculateRecordCount(Hashtable data) {\r\n int r = 0;\r\n Enumeration keys = data.keys();\r\n while (keys.hasMoreElements()) {\r\n Object oKey = keys.nextElement();\r\n Object v = data.get(oKey);\r\n if ((v != null) && (v instanceof Vector)) {\r\n r = ((Vector) v).size();\r\n break;\r\n }\r\n }\r\n return r;\r\n }",
"public int getBindingCount() { List bindings = getBindings(false); return bindings!=null? bindings.size() : 0; }",
"public int getKeyLength() {\n\t\treturn keyLength;\n\t}",
"@Override\r\n public int size() {\r\n return map.size();\r\n }",
"public int getAssocCount ()\n {\n return assocCount;\n }",
"@Override\n public int getNInt() {\n return this.values.length;\n }",
"public int getNumEntries() {\n return numEntries;\n }",
"public Integer getNumberOfEntries() {\n return this.numberOfEntries;\n }",
"public int getRowCount() {\r\n return pvValues.length;\r\n }",
"@Override\n public int size() {\n return map.size();\n }",
"int getAttributesCount();",
"int getAttributesCount();",
"public int getSize() {\n int size = 5; // 1 (code) + 2 (data length) + 2 (# of constants)\n try {\n for (Iterator<String> i = constants.iterator(); i.hasNext();) {\n size += (i.next().getBytes(\"UTF-8\").length + 1); // Unicode, null-terminated\n }\n } catch (UnsupportedEncodingException e) {\n // UTF-8 should be available..\n }\n return size;\n }",
"private int getKeyLength() {\n MongoCursor<Document> cursor = this.keystoreCollection.find(eq(\"conf\", \"homomorphic-keylength\")).iterator();\n\n int keyLength = 2048; // Default value is 2048 bits\n while (cursor.hasNext()) {\n keyLength = cursor.next().getDouble(\"keylength\").intValue();\n }\n return keyLength;\n }",
"@Override public int numRows() {\n return listOfKeys.size();\n }",
"public Integer size() { return this.entries.length(); }",
"public int getPartitionKeyCount() {\n return partitionKey_.size();\n }",
"private int getNumberOfAccounts()\n {\n ProtocolProviderFactory factory =\n DictAccRegWizzActivator.getDictProtocolProviderFactory();\n\n return factory.getRegisteredAccounts().size();\n }"
] | [
"0.71046907",
"0.68844783",
"0.682745",
"0.67941827",
"0.6751361",
"0.67059845",
"0.6684444",
"0.66014457",
"0.65781003",
"0.6493754",
"0.6488195",
"0.64797443",
"0.64464873",
"0.6425917",
"0.64104414",
"0.6404782",
"0.6390445",
"0.6360703",
"0.634893",
"0.6334932",
"0.63202626",
"0.63192433",
"0.6309065",
"0.63048387",
"0.6295759",
"0.626736",
"0.62667084",
"0.62665766",
"0.6265586",
"0.6233505",
"0.6191438",
"0.618722",
"0.6160888",
"0.61351734",
"0.6133095",
"0.6111376",
"0.6110398",
"0.6095468",
"0.6081622",
"0.6079559",
"0.6070378",
"0.60691965",
"0.6067414",
"0.605675",
"0.6044355",
"0.6036211",
"0.6029141",
"0.6028796",
"0.60239804",
"0.6010268",
"0.6008669",
"0.5986179",
"0.59799796",
"0.59730864",
"0.59728366",
"0.5968988",
"0.5963541",
"0.59597325",
"0.595432",
"0.5945035",
"0.59423643",
"0.59180564",
"0.5899354",
"0.58976156",
"0.5892402",
"0.5878875",
"0.58787274",
"0.5872917",
"0.587115",
"0.5866519",
"0.58599246",
"0.5857273",
"0.58528554",
"0.58518124",
"0.58513546",
"0.58470845",
"0.58411336",
"0.58381695",
"0.5835125",
"0.5804371",
"0.5785801",
"0.5783832",
"0.5774569",
"0.5772353",
"0.576222",
"0.5743255",
"0.573477",
"0.5727406",
"0.5723947",
"0.5723831",
"0.57229674",
"0.5722909",
"0.571734",
"0.57003355",
"0.57003355",
"0.57001626",
"0.56921333",
"0.56850445",
"0.5677881",
"0.56760675",
"0.56716913"
] | 0.0 | -1 |
Is the symbol table empty ? | public boolean isEmpty()
{ return N == 0; } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isEmpty (){\n\t\treturn hashTableSize == 0;\n\t}",
"boolean hasSymbol();",
"boolean hasSymbol();",
"public synchronized boolean fempty() {\n return table.isEmpty( ); // return if table is empty\n }",
"public boolean isSetSymbol() {\r\n return EncodingUtils.testBit(__isset_bitfield, __SYMBOL_ISSET_ID);\r\n }",
"boolean hasSymbolId();",
"private boolean existsSymbol(String symbol) {\r\n\t\treturn ts.containsKey(symbol.hashCode());\r\n\t}",
"public static synchronized boolean isEmpty() {\n\t\treturn ClassRegistry.dictionary.isEmpty();\n\t}",
"public boolean isEmptyTable() {\r\n return emptyTable;\r\n }",
"boolean hasSymbolTuple();",
"public boolean\tisEmpty() {\n\t\treturn map.isEmpty();\n\t}",
"private final synchronized boolean m12565b() {\n return this.f10287a.getAll().isEmpty();\n }",
"public boolean hasData(int aSym);",
"public boolean isEmpty() {\n\t\treturn map.isEmpty();\n\t}",
"public final synchronized boolean isEmpty() {\n\t\treturn map.isEmpty();\n\t}",
"public boolean isEmptyTable() {\r\n synchronized (lockRoutingTable) {\r\n return this.routingEntries.isEmpty();\r\n }\r\n }",
"public boolean hasSymbol() {\n return ((bitField0_ & 0x00000008) == 0x00000008);\n }",
"public boolean isEmpty() {\n return map.isEmpty();\n }",
"public boolean isEmpty() {\n return map.isEmpty();\n }",
"public boolean hasSymbol() {\n return ((bitField0_ & 0x00000008) == 0x00000008);\n }",
"public boolean hasSymbolId() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }",
"public boolean hasSymbolId() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }",
"public boolean empty() {\n return storeStack.isEmpty();\n }",
"public boolean empty() {\n return storeStack.isEmpty();\n }",
"public boolean empty() {\n return storeStack.isEmpty();\n }",
"public boolean isEmpty(){\n\t\tfor(int i = 0; i < hashMap.length; i++){\n\t\t\tif(hashMap[i]!=null){\n\t\t\t\treturn(false);\n\t\t\t}\n\t\t}\n\t\treturn(true);\n\t}",
"public boolean isEmpty(){\n return myHeap.getLength() == 0;\n }",
"public boolean isEmpty() {\r\n return this.map.isEmpty();\r\n }",
"public boolean emptyStack() {\n return (expStack.size() == 0);\n }",
"public boolean empty() {\n\n\t\treturn header.next == null;\n\t\t// Running time is θ(1) because it's a constant operation.\n\n\t}",
"public boolean isEmpty() {\n return this.extMap.isEmpty();\n }",
"public boolean isEmpty() \n { \n return numberOfEntries == 0;\n }",
"@Override\n\tpublic boolean isEmpty() \n\t{\n\t\treturn this.map.isEmpty();\n\t}",
"boolean isEmpty() {\n return mapped_vms.isEmpty();\n }",
"@Override\n\tpublic boolean isEmpty() {\n\t\treturn map.isEmpty();\n\t}",
"public boolean isEmpty() {\n return numKeys == 0;\n }",
"public boolean hasSymbolTuple() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }",
"public boolean mo20821e() {\n return this.f18932b.isEmpty();\n }",
"public boolean isSymbolDefined(String s) {\n return slexic.containsKey(s);\n }",
"public boolean hasSymbolTuple() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }",
"public boolean isEmpty(){\n return mPezCount == 0;\n }",
"public boolean isEmpty() {\n\t\treturn classCoverageLookups.isEmpty();\n\t}",
"public boolean is_empty() {\n\t\treturn false;\n\t}",
"@Override\n public boolean isEmpty(int index) {\n return hashTable[index] == null;\n }",
"private boolean isEmpty(){\n return cellSize == 0;\n }",
"public boolean isEmpty()\n {\n return heapSize == 0;\n }",
"synchronized boolean isEmpty() {\n return sessionMap.isEmpty();\n }",
"public boolean isEmpty() {\r\n return numberOfKeys == 0;\r\n }",
"public boolean isEmpty()\n\t{\n\t\treturn block == Block.EMPTY;\n\t}",
"private final synchronized boolean m60360c() {\n return this.f49750a.getAll().isEmpty();\n }",
"public synchronized boolean fempty() {\n\t\treturn table.isEmpty();//if the file table is empty, return to call the starting format\n\t}",
"public boolean isEmpty(){\r\n\t\treturn stackData.isEmpty();\r\n\t}",
"@Override\n public boolean isEmpty() {\n return map.isEmpty();\n }",
"public final boolean isEmpty()\n {\n return this.pointer == 0;\n }",
"boolean hasBbgSymbol();",
"boolean isEmpty() {\r\n\t\treturn top==0;\r\n\t}",
"public final boolean isEmpty() {\n\t\treturn !(opstack.size() > 0);\n\t}",
"private boolean isEmpty() {\n\t\treturn size() == 0;\n\t}",
"public boolean isEmpty() {\n \treturn stack.size() == 0;\n }",
"public boolean is_empty() \n\t{\n\t\tif (this.nb_disk == 0)\n\t\t\treturn true;\n\t\treturn false;\n\t}",
"public boolean isClassEmpty()\r\n {\r\n return(number_of_entries == 0);\r\n }",
"public boolean isEmpty(){\n\t\treturn (howMany==0);\n\t}",
"public static boolean isOrphan(Symbol symbol) {\n if (symbol instanceof PseudoSymbol) {\n symbol = ((PseudoSymbol)symbol).getIRSymbol();\n }\n Traversable tr = (Traversable)symbol;\n while (tr != null && !(tr instanceof SymbolTable)) {\n tr = tr.getParent();\n }\n return (tr == null);\n }",
"public boolean isHeapEmpty() {\n\t\treturn this.head == null;\n\t}",
"@Override\n\tpublic boolean isEmpty() {\n\t\treturn bnetMap.size() == 0;\n\t}",
"public boolean isEmpty(){\n return this.stack.isEmpty();\n\n }",
"public boolean isEmpty() {\n if (opStack.size() == 0) {\n return true;\n }\n return false;\n }",
"public boolean isEmpty() {\n\t\treturn treeMap.isEmpty();\n\t}",
"public boolean isEmpty() {\n return keyList.size() == 0;\n }",
"public boolean isEmpty () {\n return mPezCount == 0;\n }",
"public boolean isEmpty() {\n\t\treturn heap.isEmpty();\n\t}",
"public boolean isEmptyHuh() {\n return true; \n }",
"public boolean isEmpty( )\n {\n return header.next == null;\n }",
"public boolean isEmpty() {\r\n return treasures.isEmpty();\r\n }",
"private boolean isEmpty() {\n return dataSize == 0;\n }",
"public boolean isEmpty( ){\r\n\t\treturn beginMarker.next==endMarker;\r\n\t}",
"public Boolean isTerminal(String symbol){\n boolean terminal=false;\n for(Simbolo s:ejemplo.getMapa().values()){\n if(s.getValor().equals(symbol))\n terminal=s.isTerminal();\n }\n return terminal;\n }",
"public boolean mo8172b() {\n return this.f720a.isEmpty();\n }",
"boolean isEmpty(){\n\treturn size() == 0;\n }",
"public boolean isEmpty() {\n return header.next == null;\n }",
"public boolean isEmpty()\n\t{\n\t\treturn top == null;\n\t}",
"private boolean isEmpty(){\n return (numInstances() == 0);\n }",
"public boolean isEmpty() {\n return downStack.isEmpty();\n }",
"private boolean isEmpty() {\n\t\treturn (size == 0);\n\t}",
"public boolean isEmpty() {\r\n\t\treturn header.next == null;\r\n\t}",
"boolean isEmpty();",
"boolean isEmpty();",
"boolean isEmpty();",
"boolean isEmpty();",
"boolean isEmpty();",
"boolean isEmpty();",
"boolean isEmpty();",
"boolean isEmpty();",
"boolean isEmpty();",
"boolean isEmpty();",
"boolean isEmpty();",
"boolean isEmpty();",
"boolean isEmpty();",
"boolean isEmpty();",
"boolean isEmpty();",
"boolean isEmpty();"
] | [
"0.72125936",
"0.720058",
"0.720058",
"0.68761975",
"0.6836505",
"0.68282604",
"0.6777722",
"0.6735263",
"0.6604324",
"0.6600079",
"0.6569958",
"0.6555205",
"0.65195477",
"0.65170896",
"0.6465018",
"0.64634615",
"0.64569676",
"0.64536726",
"0.6444304",
"0.6435986",
"0.64275056",
"0.640407",
"0.64005023",
"0.64005023",
"0.64005023",
"0.63944995",
"0.63907665",
"0.6382731",
"0.6365187",
"0.63547844",
"0.63544166",
"0.634797",
"0.6333933",
"0.63259107",
"0.63214225",
"0.63184214",
"0.63005745",
"0.62926364",
"0.6290056",
"0.6279844",
"0.6271043",
"0.62690043",
"0.6262768",
"0.6254428",
"0.6243464",
"0.62407506",
"0.6238938",
"0.6234783",
"0.6229892",
"0.62213796",
"0.6218877",
"0.6215557",
"0.62152517",
"0.6214909",
"0.62110174",
"0.6210082",
"0.6207515",
"0.6190424",
"0.6187363",
"0.6181675",
"0.6177668",
"0.6177306",
"0.61713034",
"0.6166765",
"0.6161747",
"0.6149836",
"0.61447656",
"0.61439294",
"0.6137236",
"0.613566",
"0.6130167",
"0.6129265",
"0.6126119",
"0.6119516",
"0.6103845",
"0.61025304",
"0.61023873",
"0.6101193",
"0.6098059",
"0.60980004",
"0.60882384",
"0.60814947",
"0.60793775",
"0.60769504",
"0.60762376",
"0.6071976",
"0.6071976",
"0.6071976",
"0.6071976",
"0.6071976",
"0.6071976",
"0.6071976",
"0.6071976",
"0.6071976",
"0.6071976",
"0.6071976",
"0.6071976",
"0.6071976",
"0.6071976",
"0.6071976",
"0.6071976"
] | 0.0 | -1 |
Does this symbol table contain the given key ? | public boolean contains(String key)
{ return get(key) != null; } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean containsKey(CoreLabel key);",
"public boolean contains(int key) {\n int hash = key % 7919;\n if (table[hash] == null)\n {\n return false;\n }\n else\n {\n ArrayList<Integer> al = table[hash].al;\n int size = al.size();\n for (int i = 0; i < size; ++i)\n {\n if (al.get(i) == key)\n {\n return true;\n }\n }\n return false;\n }\n }",
"public boolean containsKey(Object key) {\r\n\t\tif (key == null) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tint slotIndex = Math.abs(key.hashCode()) % table.length;\r\n\r\n\t\tif (table[slotIndex] == null) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tTableEntry<K, V> currentElement = table[slotIndex];\r\n\r\n\t\tdo {\r\n\t\t\tif (currentElement.key.equals(key)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t\tcurrentElement = currentElement.next;\r\n\t\t} while (currentElement != null);\r\n\r\n\t\treturn false;\r\n\t}",
"public boolean contains(K key){\r\n int loc = find(key);\r\n if((hashTable[loc]!= null) && hashTable[loc].equals(key))\r\n return true;\r\n else\r\n return false;\r\n }",
"public boolean containsKey(Key key) ;",
"public boolean contains(int key) {\n Entry tab[] = table;\n int index = (key & 0x7FFFFFFF) % tab.length;\n for (Entry e = tab[index]; e != null; e = e.next) {\n if (e.key == key) {\n return true;\n }\n }\n return false;\n }",
"boolean contains(KeyType key);",
"public boolean contains(Key key);",
"public boolean contains(int key) {\n\t\tint hashkey = hash(key);\n\t\treturn table[hashkey] != null && table[hashkey][pos(key)];\n\t}",
"public boolean contains (String key) {\r\n int arrIndex = hash(key);\r\n\r\n if (hashTableArray[arrIndex] == null) {\r\n hashTableArray[arrIndex] = new LinkedList<>();\r\n }\r\n\r\n for (int i = 0; i < hashTableArray[arrIndex].size(); i++) {\r\n if (hashTableArray[arrIndex].get(i).key.equals(key)){\r\n return true; // returns true when a key already exists\r\n }\r\n }\r\n return false; // returns false when a key does not yet exist\r\n }",
"public boolean containsKey(String key);",
"@Override\n public boolean containsKey(Object key) {\n int index = key.hashCode() % table.length;\n if (index < 0) {\n index += table.length;\n }\n if (table[index] == null) {\n return false;\n }\n for (Entry<K,V> entry : table[index]) {\n if (entry.getKey().equals(key)) {\n return true;\n }\n }\n return false;\n }",
"boolean hasKey(String key);",
"boolean hasKey();",
"boolean hasKey();",
"boolean hasKey();",
"boolean hasKey();",
"boolean hasKey();",
"public boolean contains(String key);",
"public boolean containsKey(K key)\r\n\t{\r\n\t\tint slot = findSlot(key, false);\r\n\t\treturn slot >= 0;\r\n\t}",
"public boolean containsKey(String key) {\n int keyBucket = hash(key);\n \n HashNode temp = table[keyBucket];\n while (temp != null) {\n if ((temp.key == null && key == null) \n || (temp.key != null && temp.key.equals(key))) {\n return true;\n }\n temp = temp.next;\n }\n \n return false;\n }",
"boolean has(String key);",
"@Override\r\n\tpublic boolean exists(T key) {\r\n\t\treturn existsRec(raiz, key);\r\n\t}",
"public boolean containsKey(int key) {\n return getElement(key) != null;\n }",
"public boolean containsKey(K key) {\n int keyBucket = hash(key);\n \n HashMapEntry<K, V> temp = table[keyBucket];\n while (temp != null) {\n if ((temp.key == null && key == null) \n || (temp.key != null && temp.key.equals(key))) {\n return true;\n }\n temp = temp.next;\n }\n \n return false;\n }",
"public boolean contains(String key) {\n\t\treturn serialNumber.contains(key);\n\t}",
"public abstract boolean containsKey(K key);",
"public native Boolean has(K key);",
"private boolean contains(String key) {\n return contains(dict, key);\n }",
"boolean containsKey(K key);",
"boolean containsKey(K key);",
"boolean containsKey(long key);",
"public boolean contains (String key)\n {\n use (key);\n return map.containsKey (key);\n }",
"public boolean contains(K key);",
"@Override\r\n public boolean containsKey(KeyType key) {\r\n // if capacity is 0, return false\r\n if (capacity == 0) {\r\n return false;\r\n }\r\n\r\n int index = hashFunction(key); // the index of the pair in the hashTable\r\n\r\n // If the linked list at the index is null, target is not exist\r\n if (hashTable[index] == null) {\r\n return false;\r\n }\r\n\r\n // Find the key in the linked list. If found, return true. Otherwise return false.\r\n for (HashNode node : hashTable[index]) {\r\n if (node.key.equals(key)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }",
"public boolean existsKey(String inKey);",
"public boolean containsKey(K key) {\n int index = getIndex(getHash(key));\n Entry<K, V> entry = (Entry<K, V>) table[index];\n\n if (entry == null) {\n return false;\n }\n\n while (entry.hasNext()) {\n if (entry.getKey().equals(key))\n return true;\n entry = entry.getNext();\n }\n\n return entry.getKey().equals(key);\n }",
"public boolean containsKey(Object key) {\n\t\treturn false;\r\n\t}",
"boolean contains(String key);",
"boolean contains(String key);",
"boolean exists(Integer key);",
"public boolean containsKey(K key) {\n\t\t\n\t\t\n\t\treturn keySet.contains(key);\n }",
"public boolean containsKey(DNA key){\n Node actual_node = this.getReference(key);\n\n if(this.debug)\n System.out.println(\"ExtHash::containsKey >> buscando cadena: \" + key.toString() + \", hashCode: \" + key.hashCode());\n\n int reference_page = actual_node.getReference(), hash = key.hashCode();\n ArrayList<Integer> content = this.fm.read(reference_page); this.in_counter++;\n\n boolean res = false;\n\n while(true) {\n int cant = content.get(0);\n\n for(int i=1; i<=cant; i++) {\n if(content.get(i) == hash) {\n res = true;\n }\n }\n\n if(res)\n break;\n\n if(content.size() != B)\n break;\n\n reference_page = content.get(B-1);\n content = this.fm.read(reference_page); this.in_counter++;\n\n }\n if(this.debug)\n System.out.println(\"ExtHash::containsKey >> cadena encontrada: \" + res);\n\n return res;\n }",
"public boolean contains(int key) {\n int h = hash(key);\n Iterator<Integer> iterator = data[h].iterator();\n while (iterator.hasNext()) {\n Integer element = iterator.next();\n if (element == key) {\n return true;\n }\n }\n return false;\n }",
"@Override\n\tpublic boolean contains(String key) {\n\t\tint hashVal = hashFunc(key);\n\t\twhile (hashArray[hashVal] != null) {\n\t\t\tif (hashArray[hashVal].value.equals(key))\n\t\t\t\treturn true;\n\t\t\telse {\n\t\t\t\thashVal++;\n\t\t\t\thashVal = hashVal % size;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"boolean containsKey(Object key) throws NullPointerException;",
"public boolean contains(int key) {\n\t\tint index = getIndex(key);\n\t\tint pos = getPos(key, index);\n\t\treturn pos >= 0;\n\t}",
"public boolean contains(String key) {\n\t\treturn recContains(head, key);\n\t}",
"public boolean contains(String key) {\n return find(key) != null;\n }",
"public boolean contains(long key){\n for (int i = 0; i < numKeys; i++){\n if (keys[i].key == key){\n return true;\n }\n }\n return false;\n }",
"boolean containsKey(String keyLabel);",
"public boolean contains( T key )\n {\n if (key == null) return false;\n for ( int i=0 ; i < size() ; ++i )\n if ( get(i).equals( key ) ) \n return true;\n \n return false;\n }",
"public boolean containsKey(String key)\n\t{\n\t\tverifyParseState();\n\t\treturn values.containsKey(key);\n\t}",
"public boolean contains(int key) {\n return s.contains(key);\n }",
"@Override\r\n\tpublic boolean containsKey(Object key) {\r\n\t\tif (key == null) throw new NullPointerException();\r\n\t\treturn get(key) != null;\r\n\t}",
"public boolean containsKey(Comparable key) { return this.store.containsKey(key); }",
"boolean containsInfo(\n int key);",
"public boolean contains(int key) {\n int index = getIndex(key);\n int index2 = getIndex2(key);\n if(buckets[index] != null){\n return buckets[index][index2] == true; \n }\n return false;\n }",
"public boolean containsKey(K key) {\n\tint bucket=Math.abs(key.hashCode()%capacity);\n\tfor(MyEntry i:table[bucket]) {\n\t if(i.key.equals(key)) {\n\t\treturn true;\n\t }\n\t}\n\treturn false;\n }",
"public boolean contains(String key){\r\n\t\treturn get(key) != null;\r\n\t}",
"public boolean contains(Key key) {\n\t\treturn get(key) != null;\n\t}",
"public boolean containsKey(K key)\r\n\t{\r\n\t\treturn data.contains(new Entry(key,null));\r\n\t}",
"public boolean lookup(SymbolTableEntry entry) {\n return table.containsKey(entry.getName());\n }",
"public boolean contains(Key key) {\n return get(key) != null;\n }",
"final boolean hasKey(final E key) {\r\n for (int i=0;i<kcount;i++) {\r\n if (equal(key, (E)k[i])) return true;\r\n }\r\n return false;\r\n }",
"boolean containsKeyLocalOnHeap(Object key);",
"public boolean contains(Key key) {\n return auxContains(root, key);\n }",
"public boolean containsKey(String key) {\n \treturn (getNode(key) != null);\n }",
"public boolean containsKey(K key) {\r\n int hash = key.hashCode() % data.length;\r\n if (hash < 0){\r\n hash *= -1;\r\n }\r\n Node targetNode = data[hash];\r\n while (targetNode != null) {\r\n if (targetNode.key == key || targetNode.key.equals(key)) {\r\n return true;\r\n }\r\n targetNode = targetNode.next;\r\n }\r\n return false;\r\n }",
"public boolean containsKey(K key) {\n return keys[findIndex(key)] != null;\n }",
"public boolean contains(int key) {\n if(entry[hashCode(key)]==null) return false;\n return entry[hashCode(key)].contains(key);\n }",
"public boolean contains(String key) {\r\n\t\treturn getValue(key) != null;\r\n\t}",
"public boolean contains(int key) {\n int index1 = hashfunc1(key);\n int index2 = hashfunc2(key);\n \n if(hset[index1] != null){\n return hset[index1][index2];\n }\n return false; \n }",
"public boolean containsKey(String key) {\n int index = hashOf(key);\n return index < capacity && values[index] != null;\n }",
"public final boolean containsKey(String key)\n {\n\n for (int i = m_firstFree - 1; i >= 0; --i)\n {\n if (m_map[i].get(key) != null)\n return true;\n }\n\n return false;\n }",
"public boolean containsKey(String key) {\n\t\tint HashKey = key.hashCode() % 31;\r\n\t\tif (HashKey > K.length - 1) {\r\n\t\t\twhile (HashKey > K.length - 1) {\r\n\t\t\t\tHashKey %= K.length;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (K[HashKey] == null) {\r\n\t\t\t// LinkedList not exist\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tfor (String c : K[HashKey]) {\r\n\t\t\tif (c.equals(key)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public boolean has(byte[] key) throws IOException {\n assert (RAMIndex == true);\r\n return index.geti(key) >= 0;\r\n }",
"public boolean contains(int key) {\n int h=hash(key);\n if(arr[h]!=null)\n return arr[h].contains(key);\n return false;\n }",
"public boolean contains(K key) \n {\n boolean result = false;\n int keyIndex = locateIndex(key);\n if ((keyIndex < numberOfEntries) && \n key.equals(dictionary[keyIndex].getKey()))\n result = true;\n return result;\n }",
"public boolean contains(int key) {\n return map.containsKey(key);\n }",
"public boolean hasKey(String key) {\n return data.containsKey(key);\n }",
"@Override\n public boolean containsKey(Object key) {\n LinkedList<Entry> tempBucket = chooseBucket(key);\n \n for(int i=0;i<tempBucket.size();i++) {\n \t\tEntry tempEntry = tempBucket.get(i);\n \t\t\n \t\tif(tempEntry.getKey() == key) {\n \t\t\treturn true;\n \t\t}\n \t}\n \n return false;\n }",
"@Override\n\tpublic boolean containsKey(Key k) {\n\t\treturn bst.has(k);\n\t}",
"public boolean containsKey(String key) {\n if (!index.containsKey(key)) return false;\n else if (index.get(key).isEmpty()) return false;\n else return true;\n }",
"@Override\n\tpublic boolean containsKey(Object key) {\n\t\treturn map.containsKey(key);\n\t}",
"public boolean containsKey(K key)\n {\n AssociationList<K, V> bucket = this.get(this.find(key));\n return (bucket != null) && (bucket.containsKey(key));\n }",
"@Override\n\tpublic boolean contains(K key) {\n\t\treturn false;\n\t}",
"public synchronized boolean recordExists(String key) {\n return getMemIndex().containsKey(key);\n }",
"boolean containsKey(byte[] key);",
"public boolean containsKey(int key) {\r\n\t\ttry {\r\n\t\t\tthis.hashlock.readLock().lock();\r\n\t\t\tint index = index(key);\r\n\t\t\tif (index >= 0) {\r\n\t\t\t\tint pos = (index / FREE.length);\r\n\t\t\t\tthis.claims.position(pos);\r\n\t\t\t\tthis.claims.put((byte) 1);\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t} catch (Exception e) {\r\n\t\t\tSDFSLogger.getLog().fatal(\"error getting record\", e);\r\n\t\t\treturn false;\r\n\t\t} finally {\r\n\t\t\tthis.hashlock.readLock().unlock();\r\n\t\t}\r\n\t}",
"private boolean existsSymbol(String symbol) {\r\n\t\treturn ts.containsKey(symbol.hashCode());\r\n\t}",
"boolean containsKeyLocalOffHeap(Object key);",
"@Override\n\t\t\tpublic boolean containsKey(Object key) {\n\t\t\t\treturn false;\n\t\t\t}",
"@Override\n\tpublic boolean containsKey(Object key) {\n\t\treturn false;\n\t}",
"public boolean containsKey(Object key) {\n return map.containsKey(key);\n }",
"public boolean containsKey(Object key) {\n return map.containsKey(key);\n }",
"public boolean contains(int key) {\n int hash1 = key % buckets;\n int hash2 = key / buckets;\n if(arr[hash1] == null)\n return false;\n return arr[hash1][hash2];\n }",
"public boolean containsKey(K theKey) {\n\t\tboolean result = false;\n\t\tint index = hash(theKey);\n\t\t\tfor (WordCode<K, V> wc : myBuckets.get(index)) {\n\t\t\t\tif (wc.myKey.equals(theKey)) result = true;\n\t\t\t}\n\t\t\n\t\t\n\t\treturn result;\n\t}",
"@Override\n\tpublic boolean contains(K key) {\n\t\tNode currentNode = firstNode;\n\t\t\n\t\tif(!isEmpty()){\n\t\t\twhile(currentNode.key != key){\n\t\t\t\tif(currentNode.getNextNode() == null){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public boolean containsKey(TKey key) {\n return !(bstFind(key, mRoot) == null);\n }"
] | [
"0.8086234",
"0.80726314",
"0.806774",
"0.80391026",
"0.79979",
"0.7963824",
"0.79316145",
"0.78868747",
"0.7860658",
"0.7814084",
"0.781323",
"0.7783461",
"0.77780414",
"0.76792175",
"0.76792175",
"0.76792175",
"0.76792175",
"0.76792175",
"0.7632448",
"0.7627756",
"0.7615058",
"0.7561522",
"0.7558209",
"0.7514142",
"0.75100416",
"0.7500591",
"0.7490378",
"0.74841344",
"0.74813545",
"0.74708295",
"0.74708295",
"0.74704665",
"0.7459276",
"0.74579823",
"0.74509573",
"0.74459547",
"0.742865",
"0.7421385",
"0.74154097",
"0.74154097",
"0.74135315",
"0.7409237",
"0.74070585",
"0.74058867",
"0.7404636",
"0.7387213",
"0.73781705",
"0.7373286",
"0.73510957",
"0.73506856",
"0.7344725",
"0.7340837",
"0.7328579",
"0.73164886",
"0.73129857",
"0.7310697",
"0.7299804",
"0.7295663",
"0.72923213",
"0.7288046",
"0.72861737",
"0.7278967",
"0.72691435",
"0.725864",
"0.72432595",
"0.7242728",
"0.72425336",
"0.72421795",
"0.72282076",
"0.7222639",
"0.72179407",
"0.72173005",
"0.72134113",
"0.72068137",
"0.7201196",
"0.7198711",
"0.71971816",
"0.7192253",
"0.7188868",
"0.71684414",
"0.7165439",
"0.7155847",
"0.7151542",
"0.71469563",
"0.71373546",
"0.7133827",
"0.7121558",
"0.7111552",
"0.7104899",
"0.7082252",
"0.70698017",
"0.7069722",
"0.70604026",
"0.7059421",
"0.70503986",
"0.70503986",
"0.70488477",
"0.7012126",
"0.70029265",
"0.7002009"
] | 0.7429501 | 36 |
Returns the value associated with the given key. | public Value get(String key)
{
if (key.equals("")) return null_str_val;
Node<Value> x = get(root, key, 0);
return x == null ? null : x.val;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public V getValue(K key);",
"public V getValue(K key);",
"public Value get(Key key);",
"public V get(K key) {\n if (null == key) {\n throw new IllegalStateException(\"Null value for key is \" +\n \"unsupported!\");\n }\n\n V result = null;\n\n Node<Pair<K, V>> node = findItem(key);\n\n if (node != null) {\n result = node.getData().value;\n }\n\n return result;\n\n }",
"public V getValue(K key)\n {\n V result = null;\n int keyIndex = locateIndex(key);\n if ((keyIndex < numberOfEntries) && \n key.equals(dictionary[keyIndex].getKey()))\n result = dictionary[keyIndex].getValue();\n return result;\n }",
"private DataValue getValueForKey(String key) {\n DataValue value = valueMap.get(key);\n if (value == null) {\n return DataValue.NO_VALUE;\n } else {\n return value;\n }\n }",
"public V value(K key) {\n for(MapEntry<K, V> t : this) {\n if (t == null) continue;\n if (t.key().equals(key)) return t.value();\n }\n\n return null;\n }",
"public T getValue(String key) {\r\n\t\tNode node = getNode(root, key, 0);\r\n\t\treturn node == null ? null : node.value;\r\n\t}",
"public V getValue(K key)\r\n\t{\r\n\t\tint slot = findSlot(key, false);\r\n\t\t\r\n\t\tif (slot < 0) \r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tMapEntry<K, V> e = table[slot];\r\n\t\treturn e.getValue();\r\n\t}",
"public V getValue(Object key) {\n\t\treturn super.get(key);\n\t}",
"public Value get(Key key) ;",
"V get(final K key);",
"public Value get(Value key) {\n\t\treturn storage.get(key);\n\t}",
"public V get(K key);",
"public V get(K key)\r\n\t{\r\n\t\tEntry retrieve = data.get(new Entry(key, null));\r\n\t\t\r\n\t\tif(retrieve != null)\r\n\t\t{\r\n\t\t\treturn retrieve.value;\r\n\t\t}\r\n\t\t\r\n\t\treturn null;\r\n\t}",
"public Object get(String key)\n\t{\n\t\tverifyParseState();\n\t\t\n\t\tValue value = values.get(key);\n\t\tif(value == null)\n\t\t\treturn null;\n\t\treturn value.value;\n\t}",
"public V get(K key) {\r\n\t\t\tif (key == null) {\r\n\t\t\t\tthrow new NullPointerException();\r\n\t\t\t} else if (find(key) == null) {\r\n\t\t\t\treturn null;\r\n\t\t\t} else {\r\n\t\t\t\treturn find(key).value;\r\n\t\t\t}\r\n\t\t}",
"V get(Object key);",
"public V get(K key) {\n V value = null;\n\n if (key != null) {\n int index = indexFor(key);\n if (container[index] != null) {\n value = (V) container[index].value;\n }\n }\n return value;\n }",
"V get(K key);",
"V get(K key);",
"V get(K key);",
"V get(K key);",
"V get(K key);",
"V get(K key);",
"V get(K key);",
"public V get(String key);",
"public V getValue(K key) {\n int i = findPosition(key);\n if (i==DsConst.NOT_FOUND) {\n return null;\n }\n DictionaryPair p = list.get(i);\n return p.getValue();\n }",
"public V get(final K key)\n {\n final StackElement element = this.hashMap.get(key);\n\n if (element != null)\n {\n return element.value;\n }\n\n return null;\n }",
"public String get(String key) {\n return getData().get(key);\n }",
"public V searchValue (K key) {\n\t\tfor (Map.Entry<K, V> entry : this.entrySet()) {\n\t\t\tif (entry.getKey() == key) {\n\t\t\t\treturn entry.getValue();\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"@Override\n\tpublic V get(Object key) {\n\t\treturn map.get(key);\n\t}",
"<T> T getValue(DataKey<T> key);",
"String getValue(String type, String key);",
"public Object get(String key);",
"public CompoundValue getValue(Object key);",
"public V get(K key) {\n int index = findIndex(key);\n if (keys[index] == null)\n return null;\n else\n return values[index];\n }",
"Object get(String key);",
"Object get(String key);",
"public Value get(Key key) {\r\n\t\t\tValue ret = null;\r\n\t\t\t\r\n\t\t\tdata.reset();\r\n\t\t\tfor (int i = 0; i < data.size(); i++) {\r\n\t\t\t\tif (data.get().getKey().compareTo(key) == 0) {\r\n\t\t\t\t\tret = data.get().getValue();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tdata.next();\r\n\t\t\t}\r\n\t\t\tdata.reset();\r\n\t\t\t\r\n\t\t\treturn ret;\r\n\t\t}",
"public int get(int key) {\n return store[key]; // get the value for the key\n }",
"V getValue(final E key) {\r\n for (int i=0;i<kcount;i++) {\r\n if (equal(key, (E)k[i])) return (V)v[i];\r\n }\r\n return null;\r\n }",
"public Object get(Object key){\n\t\tNode tempNode = _locate(key);\r\n\t\tif(tempNode != null){\r\n\t\t\treturn tempNode._value;\r\n\t\t}else{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}",
"public Object get(String key) {\n \t\treturn this.get(null, key);\n \t}",
"public String get(String key) {\n return this.map.get(key);\n }",
"public final synchronized V get(final K key) {\n\t\treturn map.get(key);\n\t}",
"public V get(Object key) { return _map.get(key); }",
"public DataValue lookup(String key) {\n if (validateKey(key)) {\n return getValueForKey(key);\n } else {\n return DataValue.NO_VALUE;\n }\n }",
"public String getValue(final String key)\r\n {\r\n m_keys.addElement(key);\r\n return m_value;\r\n }",
"public V get(K key) {\n\t\treturn table.get(calcIndex(key)).get(key);\n\t}",
"public String getValue(String key) {\r\n\t\t\treturn prop.getProperty(key);\r\n\t\t}",
"public V getValue( K key ) {\r\n\t\tint bucketIndex = getBucketIndex( key );\r\n\t\tMapNode<K, V> head = buckets.get(bucketIndex);\r\n\t\twhile( head != null ) {\r\n\t\t\tif( head.key.equals(key)) {\r\n\t\t\t\treturn head.value;\r\n\t\t\t}\r\n\t\t\thead = head.next;\r\n\t\t}\r\n\t\treturn null;\t\r\n\t}",
"public V get(K key) {\n if (key == null) {\n MyEntry<K, V> entry = null;\n try {\n entry = bucket[0];\n if (entry != null) {\n return entry.getValue();\n }\n } catch (NullPointerException e) {\n }\n } else {\n // other keys\n MyEntry<K, V> entry = null;\n int location = hashFunction(key.hashCode());\n entry = bucket[location];\n if (entry != null && entry.getKey() == key) {\n return entry.getValue();\n }\n }\n return null;\n }",
"Object get(Object key);",
"public String get(int key) {\n String sql = \"SELECT data_val FROM data_map WHERE data_key = ?\";\n\n String value = null;\n try (Connection con = this.connect();\n PreparedStatement pstmt = con.prepareStatement(sql)) {\n pstmt.setInt(1, key);\n ResultSet rs = pstmt.executeQuery();\n\n if (!rs.isClosed()) {\n value = rs.getString(\"data_val\");\n rs.close();\n }\n }\n catch (SQLException e) {\n value = null;\n }\n\n return value;\n }",
"public Value get(String key) {\n Node x = get(root, key, 0);\n if (x == null) return null; //node does not exist\n else return (Value) x.val; //found node, but key could be null\n }",
"public native V get(K key);",
"public abstract V get(K key);",
"protected abstract V get(K key);",
"public V get(K key){\n\t\t\n\n\t\tNode n=searchkey(root, key);\n\n\t\t\n\t\tif(n!=null && n.value!=null){\n\t\t\treturn n.value;\n\t\t}\n\t\telse{\n\t\t\treturn null;\n\t\t}\n\t}",
"public <T> T get(TypedKey<T> key)\n\t{\n\t\tObject value = map.get(Objects.requireNonNull(key));\n\t\treturn (value == null) ? key.getDefaultValue() : key.cast(value);\n\t}",
"public String getValue(String key) {\n\t\tfinal Iterator<Map.Entry<String, String>> iter = entries.iterator();\n\t\twhile (iter.hasNext()) {\n\t\t\tfinal Map.Entry<String, String> entry = iter.next();\n\t\t\tif (entry.getKey().equals(key)) {\n\t\t\t\treturn entry.getValue();\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"private V get(K key) {\n\t\t\tif (keySet.contains(key)) {\n\t\t\t\treturn valueSet.get(keySet.indexOf(key));\n\t\t\t}\n\t\t\treturn null;\n\t\t}",
"String get(Integer key);",
"public static String getValue(String key) {\r\n\t\tload();\r\n\t\treturn properties.getProperty(key);\r\n\t}",
"public Object getValue(String key)\n {\n if (otherDetails == null)\n {\n return null;\n }\n else\n {\n return otherDetails.get(key);\n }\n }",
"public V get( K key ) {\n WeakReference<V> valueRef = map.get( key );\n return valueRef == null ? null : valueRef.get();\n }",
"public V get(K key)\n\t{\n\t\tcheckForNulls(key);\n\t\tint n = Math.abs(key.hashCode() % entries.length);\n\t\t\n\t\tif (entries[n] == null)\n\t\t\treturn null;\n\t\t\n\t\tfor (Entry e : entries[n])\n\t\t{\n\t\t\tif (key.equals(e.key) == true)\n\t\t\t\treturn e.value;\n\t\t}\n\t\t\n\t\treturn null;\n\t}",
"public V get(K key) throws InvalidKeyException;",
"public String get(String key) {\n return mMap.get(key);\n }",
"public Value get(final Key key) {\n int r = rank(key);\n if (r < size && (keys[r].compareTo(key) == 0)) {\n return values[r];\n }\n return null;\n }",
"public V get(K key) {\r\n\t\tint place = hash(key.hashCode());\r\n\t\tif (hashMapArray[place] != null) {\r\n\t\t\tLinkedList<KVPair> temp = hashMapArray[place];\r\n\t\t\tfor (KVPair i : temp) {\r\n\t\t\t\tif (i.getKey().equals(key)) {\r\n\t\t\t\t\treturn i.getValue();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"public V get(K key) {\n int index = getIndex(getHash(key));\n Entry<K, V> entry = (Entry<K, V>) table[index];\n\n if (entry == null) {\n return null;\n }\n\n if (!entry.hasNext()) {\n return entry.getValue();\n }\n\n while (entry.hasNext()) {\n if (entry.getKey().equals(key))\n return entry.getValue();\n entry = entry.getNext();\n }\n\n if (entry.getKey().equals(key))\n return entry.getValue();\n\n return null;\n }",
"public T get(K key);",
"public V lookup(K key);",
"String getValue(Key key) {\n return this.parameters.get(key);\n }",
"public Object get(String key){ \r\n\t\treturn this.context.getValue(key);\r\n\t}",
"public String get(String key) {\n \ttmp = getNode(key);\n \tif (tmp != null) { \n \t\treturn tmp.getVal();\n \t}\n \treturn null;\n }",
"public String get(int key){\n\t\treturn(hashMap[key]);\t\t\n\t}",
"public Value get(Key key)\t\t\t\t//Value passed with Key(Null if key is absent)\n\t{\n\t\tNode x=root;\n\t\twhile(x!=null)\n\t\t{\n\t\t\tint cmp=key.compareTo(x.key);\n\t\t\tif(cmp<0)\tx=x.left;\n\t\t\telse if(cmp>0)\tx=x.right;\n\t\t\telse if(cmp==0)\treturn x.val;\n\t\t}\n\t\treturn null;\n\t}",
"public String get(String key) {\n return this._map.get(key);\n }",
"public String lookup(String key){\n Node N;\n N = findKey(root, key);\n return ( N == null ? null : N.item.value );\n }",
"public V get(Object key) {\r\n\t\tif (key == null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tint slotIndex = Math.abs(key.hashCode()) % table.length;\r\n\r\n\t\tif (table[slotIndex] == null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tTableEntry<K, V> currentElement = table[slotIndex];\r\n\r\n\t\tdo {\r\n\t\t\tif (currentElement.key.equals(key)) {\r\n\t\t\t\treturn currentElement.value;\r\n\t\t\t}\r\n\r\n\t\t\tcurrentElement = currentElement.next;\r\n\t\t} while (currentElement != null);\r\n\r\n\t\treturn null;\r\n\t}",
"public V get(String key) {\n int index = hashOf(key);\n if (index >= capacity) return null;\n return (V) values[index];\n }",
"public Object getDataValue(String key) {\n\t\t if (data.containsKey(key)) {\n\t\t\t return data.get(key);\n\t\t }\n\t\t return null;\n\t }",
"@SuppressWarnings(\"unchecked\")\n public V get(Object key)\n {\n V value = delegate.get(key);\n if(value == null && factory != null)\n {\n value = factory.getValue((K)key);\n if(value != null)\n {\n delegate.put((K)key, value);\n }\n }\n return value;\n }",
"public String getValue(final String key) {\n\n\t\treturn config.getString(StringUtils.lowerCase(key));\n\t\t\t}",
"public Object get(Object key) {\n CacheEntry entry = (CacheEntry)_hash.get(key);\n if (entry != null) {\n touchEntry(entry);\n return entry.getValue();\n } else {\n return null;\n }\n }",
"public V get(K key) {\n int hashCode = scaledHashCode(key);\n OwnLinkedList<K, V> list = table[hashCode];\n if (list == null) {\n return null;\n }\n PairNode<K, V> result = list.search(key);\n if (result == null) {\n return null;\n }\n return result.getValue();\n }",
"public QxType getValue( final String key ) {\n return getValue( key, null );\n }",
"public String getVal(String key) {\n Optional<KeyValList> kv = findKeyVal(key);\n\n if (kv.isPresent()) {\n return kv.get().getCfgVal();\n }\n\n return null;\n }",
"@Override\n public V get(K key) {\n if(containsKey(key)) {\n LinkedList<Entry<K, V>> pointer = entryArr[Math.floorMod(key.hashCode(), entryArr.length)];\n return pointer.stream().filter(x->x.key.equals(key))\n .collect(Collectors.toList()).get(0).value;\n }\n return null;\n }",
"public int get(int key) {\n int index = keys.indexOf(key);\n return index < 0? -1 : values.get(index);\n }",
"public V get(K key) {\r\n int hash = key.hashCode() % data.length;\r\n if (hash < 0){\r\n hash *= -1;\r\n }\r\n V result = null;\r\n if (data[hash] != null) {\r\n Node currentNode = data[hash];\r\n while (currentNode != null) {\r\n if (currentNode.key == key || currentNode.key.equals(key)) {\r\n result = (V) currentNode.value;\r\n }\r\n currentNode = currentNode.next;\r\n }\r\n }\r\n return result;\r\n }",
"@Override\n public V get(K key) {\n return get(root, key);\n }",
"private Value get(Node node, Key key ) {\n if ( node.key.equals( key ) ) {\n return (Value) node.value;\n }\n\n if ( key.compareTo( (Key)node.key ) < 0 ) {\n return node.left.value == null ? null : get(node.left,key);\n }\n else {\n return node.right.value == null ? null : get(node.right,key);\n }\n }",
"public Object lookup(String key){\n ListNode<String,Object> temp = getNode(key);\n if(temp != null)\n return temp.value;\n else\n return null;\n }",
"public Object get(Object key) {\n\t\tint index = key.hashCode() % SLOTS;\n\t\t// check if key is already present in that slot/bucket.\n\t\tfor(Pair p:table[index]) {\n\t\t\tif(key.equals(p.key))\n\t\t\t\treturn p.value;\n\t\t}\n\t\t// if not found, return null\n\t\treturn null;\n\t}",
"private String getValueFromProperty(String key) {\n\t\treturn properties.getProperty(key);\n\n\t}",
"public Value get(Key key) {\n\t\tNode node = current_node;\n\t\twhile(!node.key.equals(key)) node = node.next;\n\t\treturn node.value;\n\t}"
] | [
"0.8175439",
"0.8175439",
"0.7979652",
"0.7953973",
"0.7794757",
"0.775339",
"0.770113",
"0.76934516",
"0.7687241",
"0.7658418",
"0.76402134",
"0.7634589",
"0.76187474",
"0.7611215",
"0.76074713",
"0.76027304",
"0.7580474",
"0.7537891",
"0.7471628",
"0.74469906",
"0.74469906",
"0.74469906",
"0.74469906",
"0.74469906",
"0.74469906",
"0.74469906",
"0.74462444",
"0.7437315",
"0.7414252",
"0.74139977",
"0.7392943",
"0.73850983",
"0.7376301",
"0.73630697",
"0.7348265",
"0.73441744",
"0.73412216",
"0.73407954",
"0.73407954",
"0.7335373",
"0.73343664",
"0.73321",
"0.73118895",
"0.73077947",
"0.7284205",
"0.72753966",
"0.72692037",
"0.72655624",
"0.7222592",
"0.72191364",
"0.7218417",
"0.72183084",
"0.7203068",
"0.71913314",
"0.7186429",
"0.71740186",
"0.7164382",
"0.71428686",
"0.71161157",
"0.7110803",
"0.7100228",
"0.7095241",
"0.70874643",
"0.70835525",
"0.70626533",
"0.7055349",
"0.70422006",
"0.703509",
"0.70347553",
"0.70198965",
"0.701093",
"0.7001531",
"0.70010996",
"0.6976996",
"0.6974797",
"0.6969509",
"0.69354653",
"0.69208926",
"0.69073737",
"0.6892135",
"0.6864654",
"0.68594944",
"0.68582743",
"0.68533975",
"0.684865",
"0.68331355",
"0.6826725",
"0.68158895",
"0.6813587",
"0.68101645",
"0.6806012",
"0.67849195",
"0.6769833",
"0.6768493",
"0.67584753",
"0.6753025",
"0.67487985",
"0.67429817",
"0.6739478",
"0.67359334"
] | 0.7290926 | 44 |
Inserts the keyvalue pair into the symbol table, overwriting the old value with the new value if the key is already in the symbol table. | public void put(String key, Value val)
{
if (key.equals("")) {
if (null_str_val == null) ++N;
null_str_val = val;
return;
}
root = put(root, key, val, 0);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void insert(SymbolTableEntry newEntry) {\n if (table.containsKey(newEntry.getName())) {\n table.remove(newEntry.getName());\n }\n table.put(newEntry.getName(), newEntry);\n }",
"public void put(Object key, Object value) {\n\t\tint index = key.hashCode() % SLOTS;\n\t\t// check if key is already present in that slot/bucket.\n\t\tfor(Pair p:table[index]) {\n\t\t\tif(key.equals(p.key)) {\n\t\t\t\tp.value = value; // overwrite value if key already present.\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t// if not present, add key-value pair in that slot/bucket.\n\t\tPair pair = new Pair(key, value);\n\t\ttable[index].add(pair);\n\t}",
"@Override\n public Symbol put(String key, Symbol value) {\n value.setIndex(this.local++);\n return super.put(key, value);\n }",
"public void insert (k key, v val) {\n\t\tint b = hash(key);\n\t\tNode<k,v> curr = buckets[b];\n\t\t\n\t\twhile (curr != null) {\t\n\t\t\tif (key.equals(curr.getKey()) && val.equals(curr.getValue())) { \n\t\t\t\t\n\t\t\t\tSystem.err.println(\"Pair \" + key + \" \" + val + \" already exists\");\n\t\t\t\treturn;\t\t\t\t\t\t\t\t// if both key and value already exist, terminate\n\t\t\t}\n\t\t\telse if (curr.getNext() == null) {\t\t// if reached last element, append the new node to the end\n\t\t\t\tcurr.setNext(key, val);\n\t\t\t\treturn; \n\t\t\t}\n\t\t\tcurr = curr.getNext();\t\t\t\t\t// propagate on the SLL until key and value matched or end of SLL reached\n\t\t}\n\t\tbuckets[b] = new Node<k,v>(key, val, null);\t// if there are no nodes at the hashed index, place the new node there\n\t}",
"public void insert(Key key, Value value) {\r\n root.insert(key,value);\r\n size++;\r\n }",
"abstract void insert(K key, V value);",
"abstract void insert(K key, V value);",
"public void insert(K key, V value) throws KeyFoundException {\n\tif (RBT.containsKey(key))\n\t throw new KeyFoundException(); \n\tRBT.put(key, value);\n }",
"void put(String symbol, int id);",
"public Entry insert(Object key, Object value) {\n int hashCode = key.hashCode();\n int index = compFunction(hashCode);\n\n Entry entry = new Entry();\n entry.key = key;\n entry.value = value;\n\n defTable[index].insertFront(entry);\n size++;\n return entry;\n }",
"public void insert(String key){\n DataPair dp = getDataPair(key);\n insert(dp);\n }",
"public void add(K key,V value) {\n DictionaryPair pair = new DictionaryPair(key,value);\n int index = findPosition(key);\n\n if (index!=DsConst.NOT_FOUND) {\n list.set(index,pair);\n } else {\n list.addLast(pair);\n this.count++;\n }\n }",
"public Entry<K, V> insert(K key, V value) {\r\n try {\r\n int hash = key.hashCode();\r\n Entry<K, V> entry = new Entry<K, V>();\r\n entry.key = key;\r\n entry.value = value;\r\n table[compFunction(hash)].insertFront(entry);\r\n return entry;\r\n } catch (Exception e) {\r\n System.out.println(\"Unhashable key: \" + e);\r\n return null;\r\n }\r\n }",
"public void insert(K key, E val) {\n MapEntry<K, E> newEntry = new MapEntry<K, E>(key, val);\n int b = hash(key);\n for (SLLNode<MapEntry<K,E>> curr = buckets[b]; curr != null; curr = curr.succ) {\n if (key.equals(((MapEntry<K, E>) curr.element).key)) {\n curr.element = newEntry;\n return;\n }\n }\n buckets[b] = new SLLNode<MapEntry<K,E>>(newEntry, buckets[b]);\n }",
"public void put(Key key,Value value){\n\t\troot = insert(root,key,value);\n\t}",
"public void insert(Key key, Value value){\n this.root = this.insertHelper(key, value, root);\n }",
"public boolean insert(K key, V value)\r\n\t{\r\n\t\tint size = SIZES[sizeIdx];\r\n\t\tint i;\r\n\t\tnumProbes = 0;\r\n\r\n\t\t// Make sure we haven't filled 70% or more of the entries\r\n\t\tif (numFilledSlots >= 0.7 * size)\r\n\t\t{\r\n\t\t\t// If we're running out of space, increase the size of our table\r\n\t\t\tincreaseCapacity();\r\n\t\t\tsize = SIZES[sizeIdx];\r\n\t\t}\r\n\r\n\t\t// Probe no more iterations than the size of the table\r\n\t\tfor (i = 0; i < size; ++i)\r\n\t\t{\r\n\t\t\t// Compute the next index in the probe sequence\r\n\t\t\tint index = probe(key, i, size);\r\n\r\n\t\t\t// If the current slot doesn't contain a value\r\n\t\t\tif (table[index] == null || table[index].isTombstone)\r\n\t\t\t{\r\n\t\t\t\t// Store the given value at the current slot\r\n\t\t\t\ttable[index] = new HashEntry<K, V>(key, value);\r\n\t\t\t\t++numEntries;\r\n\t\t\t\t++numFilledSlots;\r\n\t\t\t\tnumProbes = i;\r\n\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\t// If the current slot has a value with the same key as the key we\r\n\t\t\t// are inserting with\r\n\t\t\telse if (table[index].key.equals(key) && !table[index].isTombstone)\r\n\t\t\t{\r\n\t\t\t\t// Add the given value to the current slot\r\n\t\t\t\ttable[index].value.add(value);\r\n\t\t\t\t++numEntries;\r\n\t\t\t\tnumProbes = i;\r\n\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Compute the number of probes if probing failed\r\n\t\tnumProbes = i - 1;\r\n\r\n\t\t// The value wasn't inserted because we couldn't find a place to insert\r\n\t\t// it\r\n\t\treturn false;\r\n\t}",
"public void put(K key, V value) {\n int keyBucket = hash(key);\n \n HashMapEntry<K, V> temp = table[keyBucket];\n while (temp != null) {\n if ((temp.key == null && key == null) \n || (temp.key != null && temp.key.equals(key))) {\n temp.value = value;\n return;\n }\n temp = temp.next;\n }\n \n table[keyBucket] = new HashMapEntry<K, V>(key, value, table[keyBucket]);\n size++;\n }",
"public void insert(String key, String value) throws KeyCollisionException{\n Node N, A, B;\n if(findKey(root, key)!=null){\n throw new KeyCollisionException(\"Dictionary Error: insert() cannot insert duplicate keys\");\n }\n N = new Node(new Pair(key, value));\n B = null;\n A = root;\n while( A != null ){\n B = A;\n if(A.item.key.compareToIgnoreCase(key)>0) A = A.left;\n else A = A.right;\n }\n \n if( B == null ) root = N;\n else if(B.item.key.compareToIgnoreCase(key)>0) B.left = N;\n else B.right = N;\n numItems++;\n }",
"private HashEntry(K insertKey, V insertValue)\r\n\t\t{\r\n\t\t\tkey = insertKey;\r\n\t\t\tvalue.add(insertValue);\r\n\t\t}",
"public Entry insert(Object key, Object value) {\r\n if (size / num_buckets > 0.75) { //table must be resized if load factor is too great\r\n this.resize();\r\n }\r\n Entry new_entry = new Entry();\r\n new_entry.key = key;\r\n new_entry.value = value;\r\n int comp_hash = compFunction(new_entry.key.hashCode()); //compresses key hash code\r\n if (hash_table[comp_hash] == null) { \r\n hash_table[comp_hash] = new DList();\r\n hash_table[comp_hash].insertFront(new_entry);\r\n } else {\r\n hash_table[comp_hash].insertFront(new_entry);\r\n }\r\n size++;\r\n return new_entry;\r\n }",
"public void insert(String key, String value) throws KeyCollisionException{\n if( lookup(key) != null){\n throw new KeyCollisionException(\"cannot insert dublicate key\");\n }\n else{\n if( front == null){\n Node N = new Node(key,value);\n front = N;\n numItems++;\n }\n else{\n Node N = front;\n while( N != null){\n if(N.next == null){\n break;\n }\n N = N.next;\n }\n N.next = new Node(key,value);\n numItems++;\n }\n }\n }",
"public void put(K key, V value) {\n if (null == key) {\n throw new IllegalStateException(\"Null value for key is \" +\n \"unsupported!\");\n }\n\n Node<Pair<K, V>> node = findItem(key);\n\n if (node != null) {\n node.getData().value = value;\n return;\n }\n\n Pair<K, V> entry = new Pair<>(key, value);\n\n int hash1 = hash1(key);\n int hash2 = hash2(key);\n\n int count1 = table[hash1] == null ? 0 : table[hash1].list.getCount();\n int count2 = table[hash2] == null ? 0 : table[hash2].list.getCount();\n\n if (count1 <= count2) {\n if (table[hash1] == null) {\n table[hash1] = new Entry<>();\n }\n\n table[hash1].list.put(entry);\n } else {\n if (table[hash2] == null) {\n table[hash2] = new Entry<>();\n }\n\n table[hash2].list.put(entry);\n }\n\n if (++elementsCount > table.length * OCCUPANCY) {\n rehash();\n }\n }",
"public void insert(int key,int value){\n\t\tif(map.containsKey(key)){\n\t\t\tNode n = map.get(key);\n\t\t\tdeleteNode(n);\n\t\t\taddToHead(n);\n\t\t} else {\n\t\t\tif(count > capacity){\n\t\t\t\tint key1 = tail.key;\n\t\t\t\tmap.remove(key1);\n\t\t\t\tdeleteTail();\n\t\t\t\tNode n = new Node(key,value);\n\t\t\t\tmap.put(key, n);\n\t\t\t\taddToHead(n);\n\t\t\t} else {\n\t\t\t\tNode n = new Node(key,value);\n\t\t\t\tmap.put(key, n);\n\t\t\t\taddToHead(n);\n\t\t\t}\n\t\t}\n\t}",
"public void put(K key, V value) {\r\n\t\tObjects.requireNonNull(key);\r\n\r\n\t\tint slotIndex = Math.abs(key.hashCode()) % table.length;\r\n\r\n\t\tif (table[slotIndex] == null) {\r\n\t\t\tsize++;\r\n\t\t\ttable[slotIndex] = new TableEntry<>(key, value);\r\n\r\n\t\t\treallocateIfOverfilled();\r\n\t\t\tmodificationCount++;\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tTableEntry<K, V> currentElement = table[slotIndex];\r\n\r\n\t\twhile (currentElement.next != null) {\r\n\t\t\tif (currentElement.key.equals(key)) {\r\n\t\t\t\tcurrentElement.value = value;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tcurrentElement = currentElement.next;\r\n\t\t}\r\n\r\n\t\tif (currentElement.key.equals(key)) {\r\n\t\t\tcurrentElement.value = value;\r\n\t\t} else {\r\n\t\t\tTableEntry<K, V> newEntry = new TableEntry<>(key, value);\r\n\t\t\tcurrentElement.next = newEntry;\r\n\t\t\tsize++;\r\n\r\n\t\t\tmodificationCount++;\r\n\t\t\treallocateIfOverfilled();\r\n\t\t}\r\n\t}",
"public void add(Key key, Value value) {\n\n\t\tif (2 * this.size > this.capacity) {\n\t\t\tresize(2 * this.capacity);\n\t\t}\n\n\t\t// Add this item to the hash table in the expected location.\n\n\t\tint index = locate(key);\n\t\tthis.keys[index] = key;\n\t\tthis.values[index] = value;\n\t\tthis.size++;\n\t}",
"public void addSymbol(String key, Symbol token) {\n this.variables.put(key, token);\n }",
"@Override\r\n public boolean put(KeyType key, ValueType value) {\r\n // if the table's capacity is 0, expand the table first\r\n if (capacity == 0) {\r\n expand();\r\n }\r\n\r\n int index = hashFunction(key); // the index of the pair in the hashTable\r\n\r\n // If the linked list is null, initialize one. Otherwise, check whether the key has been exist\r\n if (hashTable[index] == null) {\r\n hashTable[index] = new LinkedList<>();\r\n } else {\r\n for (HashNode node : hashTable[index]) {\r\n if (node.key.equals(key)) {\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n // Put the pair, and check whether expand() is needed\r\n hashTable[index].add(new HashNode(key, value));\r\n size++;\r\n if ((double) size / capacity >= 0.8) {\r\n expand();\r\n }\r\n return true;\r\n }",
"@Override\r\n\tpublic void addKeyValuePair(String key, String value) {\r\n\t\t\r\n\t\t// if key is empty\r\n if (key == null || key.equals(\" \") || value == null || value.equals(\" \")) {\r\n System.out.println(\"Key cannot be Empty\");\r\n return;\r\n }\r\n // create new Node to be inserted\r\n Node newNode = new Node(new Data(key, value));\r\n // call recursive function traverse from root to correct Position to add newNode\r\n this.root = insertRecursively(this.root, newNode);\r\n return;\r\n\t\t\r\n\t}",
"public V insert(K key, V value) {\r\n int index = key.hashCode() % mainTable.length;\r\n\r\n if (index < 0) {\r\n index += mainTable.length;\r\n }\r\n if (mainTable[index] == null) {\r\n // No collision. Create a new linked list at mainTable[index].\r\n mainTable[index] = new LinkedList<Entry<K,V>>();\r\n } else {\r\n totalCollisions++;\r\n }\r\n\r\n int chainLength = 0;\r\n // Search the list at mainTable[index] to find the key.\r\n for (Entry<K,V> nextItem : mainTable[index]) {\r\n chainLength++;\r\n // If the search is successful, replace the old value.\r\n if (nextItem.key.equals(key)) {\r\n // Replace value for this key.\r\n V oldVal = nextItem.value;\r\n nextItem.setValue(value);\r\n addChainLength(chainLength);\r\n return oldVal;\r\n }\r\n }\r\n\r\n addChainLength(chainLength);\r\n // Key is not in the mainTable, add new item.\r\n mainTable[index].addFirst(new Entry<K,V>(key, value));\r\n numberOfKeys++;\r\n if (numberOfKeys > (LOAD_THRESHOLD * mainTable.length)) {\r\n rehash();\r\n }\r\n return null;\r\n }",
"public Entry insert(Object key, Object value) {\n resize();//only if it needs to.\n Entry e = new Entry();\n e.key = key;\n e.value = value;\n int i = compFunction(key.hashCode());\n buckets[i].insertFront(e);\n size++;\n return e;\n }",
"public void addKeyValue (String key, String value){\r\n\t\tcodebook.put(key, value);\r\n\t}",
"public void put(K key, V value) {\n int counter = 0;\n for (Table.Entry e : entries) {\n if (e.getKey().equals(key)) {\n entries.set(counter, new Table.Entry<>(key, value));\n return;\n }\n }\n entries.add(new Table.Entry<>(key, value));\n }",
"public void put(K key, V value) {\n\t\ttable.get(calcIndex(key)).put(key, value);\n\t}",
"public V add(K key, V value)\r\n\t{\r\n\t\tint slot = findSlot(key, false); // check if key already exists\r\n\t\tV oldVal = null;\r\n\t\t\r\n\t\tif (slot >= 0)\r\n\t\t{\r\n\t\t\tMapEntry<K, V> e = table[slot];\r\n\t\t\toldVal = e.setValue(value);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tslot = findSlot(key, true); // find empty slot for adding\r\n\t\t\ttable[slot] = new MapEntry<>(key, value);\r\n\t\t\tcount++;\r\n\t\t\tif (count >= maxCount)\r\n\t\t\t{\r\n\t\t\t\trehash();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn oldVal;\r\n\t}",
"public boolean add(K key, V value){\r\n int loc = find(key);\r\n if(needToRehash()){\r\n rehash();\r\n }\r\n Entry<K,V> newEntry = new Entry<>(key,value);\r\n if(hashTable[loc]!= null && hashTable[loc].equals(key))\r\n return false;\r\n else{\r\n hashTable[loc] = newEntry;\r\n size++;\r\n return true;\r\n }\r\n }",
"public void insert(double key, Double value){\n\tif(search(key)!=null){\r\n\t\tLeaf Leaf = (Leaf)Search(root, key);\r\n\t\t\r\n\t\tfor(int i=0; i<Leaf.keyvalues.size(); i++) {\r\n\t\t\tif(key==Leaf.getKeyValue(i).getKey()) {\r\n\t\t\t\t\tLeaf.getKeyValue(i).values.add(value);\r\n\t\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n\tLeaf newleaf = new Leaf(key, value);\r\n\t\r\n\tPair<Double,Node> entry=new Pair<Double, Node>(key,newleaf);\r\n\r\n\tif(root == null ) {\r\n\t\troot = entry.getValue();\r\n\t}\r\n\t\r\n\r\n\tPair<Double, Node> newChildEntry = getChildEntry(root, entry, null);\r\n\t\r\n\tif(newChildEntry == null) {\r\n\t\treturn;\r\n\t} else {\r\n\t\tIntrnlNode newRoot = new IntrnlNode(newChildEntry.getKey(), root, newChildEntry.getValue());\r\n\t\troot = newRoot;\r\n\t\treturn;\r\n\t}\r\n}",
"public boolean insert(Integer key, String value) {\n\t\treturn root.insert(key, value);\n\t}",
"void insert(EntryPair entry);",
"public void put(K key, V value) {\r\n size++;\r\n checkAndModifySize();\r\n\r\n Node newElement = new Node(key, value);\r\n int currentHash = newElement.hash % data.length;\r\n if (currentHash < 0){\r\n currentHash *= -1;\r\n }\r\n\r\n if (data[currentHash] == null) {\r\n data[currentHash] = newElement;\r\n } else {\r\n Node currentElement = data[currentHash];\r\n while (currentElement.next != null) {\r\n if (currentElement.key == key || currentElement.key.equals(key)) {\r\n currentElement.value = value;\r\n size--;\r\n return;\r\n }\r\n currentElement = currentElement.next;\r\n }\r\n currentElement.next = newElement;\r\n }\r\n }",
"public InsertSymbolResponse insertSymbol(InsertSymbolRequest request) throws GPUdbException {\n InsertSymbolResponse actualResponse_ = new InsertSymbolResponse();\n submitRequest(\"/insert/symbol\", request, actualResponse_, false);\n return actualResponse_;\n }",
"public void insertValue(String tablename, Value value, String idkey, String idvalue) throws SQLException {\n mysql.update(\"INSERT INTO `\" + tablename + \"` ('\"+ value.getKey() +\"') VALUES ('\" + value.getValue() + \"')\");\n }",
"public int searchInsert(String symbol) {\r\n\t\tboolean exists = existsSymbol(symbol);\r\n\t\tif (!exists) {\r\n\t\t\tinsert(symbol);\r\n\t\t}\r\n\t\treturn symbol.hashCode();\r\n\t}",
"public abstract boolean insert(Key key);",
"void insert(K key, V value) {\r\n // binary search\r\n int correct_place = Collections.binarySearch(keys, key);\r\n int indexing;\r\n if (correct_place >= 0) {\r\n indexing = correct_place;\r\n } else {\r\n indexing = -correct_place - 1;\r\n }\r\n\r\n if (correct_place >= 0) {\r\n keys.add(indexing, key);\r\n values.add(indexing, value);\r\n } else {\r\n keys.add(indexing, key);\r\n values.add(indexing, value);\r\n }\r\n\r\n // to check if the node is overloaded then split\r\n if (root.isOverflow()) {\r\n Node sibling = split();\r\n InternalNode newRoot = new InternalNode();\r\n newRoot.keys.add(sibling.getFirstLeafKey());\r\n newRoot.children.add(this);\r\n newRoot.children.add(sibling);\r\n root = newRoot;\r\n }\r\n }",
"@Override\n\tpublic Entry<K, V> insert(K key, V value) throws InvalidKeyException {\n\t\treturn null;\n\t}",
"Object insert(String key, Object param);",
"public void put(K key, V value) {\n int index = getIndex(getHash(key));\n\n if (table[index] != null) {\n collisionProcessing(key, value, index);\n return;\n }\n\n table[index] = new Entry<>(key, value);\n extend();\n }",
"public void put(Key key, Value value) {\n\t\tNode entry = new Node(key, value, current_node);\n\t\tcurrent_node = entry; size++;\n\t}",
"public boolean add(String key, String value){\r\n // takes a key and turns it into a hashed thing\r\n int arrIndex = hash(key);\r\n\r\n Entry entry = new Entry(key, value);\r\n\r\n if (hashTableArray[arrIndex] == null){\r\n hashTableArray[arrIndex] = new LinkedList<>();\r\n }\r\n if(contains(key)) {\r\n return false; // the key is already in use, so don't use it.\r\n } else {\r\n hashTableArray[arrIndex].add(entry); // add the key and value pair to the linked list.\r\n }\r\n return true;\r\n }",
"private void put(K key, V value) {\n\t\t\tif (key == null || value == null)\n\t\t\t\treturn;\n\t\t\telse if (keySet.contains(key)) {\n\t\t\t\tvalueSet.set(keySet.indexOf(key), value);\n\t\t\t} else {\n\t\t\t\tkeySet.add(key);\n\t\t\t\tvalueSet.add(keySet.indexOf(key), value);\n\t\t\t\tsize++;\n\t\t\t}\n\t\t}",
"public void put(Object key,Object value) {\n map.put(key,value);\n hashtable.put(key,value);\n }",
"public boolean add( String key, T value )\r\n {\r\n HashMap<String,T> top = tables.peekFirst();\r\n T result = top.get( key );\r\n top.put( key, value );\r\n return result==null;\r\n }",
"void addEntry(String key, Object value) {\n this.storageInputMap.put(key, value);\n }",
"@SuppressWarnings(\"unchecked\")\n public boolean insert(String key, Object value) {\n if (key == null) {\n LOGGER.warning(\"Tried to use a null key on insert()\");\n return false;\n }\n\n // actual insert\n mJSONObject.put(key, value);\n\n return true;\n }",
"public static void insert(int xact, int key, int value) throws Exception {\n\t System.out.println(\"T(\"+(xact+1)+\"):I(\"+(key)+\",\"+value+\")\");\n\t if (mData.containsKey(key)) {\n\t\t System.out.println(\"T(\"+(xact+1)+\"):ROLLBACK\");\n\t\t throw new Exception(\"KEY ALREADY EXISTS IN T(\"+(xact+1)+\"):I(\"+key+\")\");\n\t }\n\t Version v = new Version(xact, xact, value);\n\t LinkedList<Version> m = new LinkedList<Version>();\n\t m.add(v);\n\t mData.put(key, m);\n\n }",
"void add(KeyType key, ValueType value);",
"public boolean insert(K key, V value) {\n boolean isInserted = false;\n\n if (key != null) {\n if ((double) amountOfEntries / container.length > loadFactor) {\n extendContainer();\n }\n int index = indexFor(key);\n Entry<K, V> entry = container[index];\n if (entry == null) {\n //add new\n Entry newEntry = new Entry(key, value);\n container[index] = newEntry;\n amountOfEntries++;\n } else if (entry.key.equals(key)) {\n //update\n entry.value = value;\n }\n }\n return isInserted;\n }",
"public void put(String key, V value) {\n map.computeIfAbsent(key, k -> keepOrder ? new LinkedHashSet<>() : new HashSet<>()).add(value);\n }",
"@Override\n public V put(K key, V value) {\n int index = key.hashCode() % table.length;\n if (index < 0) {\n index += table.length;\n }\n if (table[index] == null) {\n // Create a new linked list at table[index].\n table[index] = new LinkedList<Entry<K, V>>();\n }\n\n // Search the list at table[index] to find the key.\n for (Entry<K, V> nextItem : table[index]) {\n // If the search is successful, replace the old value.\n if (nextItem.key.equals(key)) {\n // Replace value for this key.\n V oldVal = nextItem.value;\n nextItem.setValue(value);\n return oldVal;\n }\n }\n\n // assert: key is not in the table, add new item.\n table[index].addFirst(new Entry<K, V>(key, value));\n numKeys++;\n if (numKeys > (LOAD_THRESHOLD * table.length)) {\n rehash();\n }\n return null;\n }",
"public String put(String key, String value) {\n PairStringString p = new PairStringString(key, value);\n Node pos = find(key);\n if (pos == null) {\n head = new Node(p, head, null);\n if (head.next != null) {\n head.next.prev = head;\n }\n size++;\n return null;\n } else {\n PairStringString tmp = pos.pairStringString;\n pos.pairStringString = p;\n return tmp.getValue();\n }\n }",
"public void add(K key, V value) {\r\n if(this.table.containsKey(key)){\r\n BloomFilterUtil bf = (BloomFilterUtil)table.get(key).getHash();\r\n bf.put(value);\r\n Node<V> node = (Node<V>) table.get(key);\r\n node.getValues().add(value);\r\n }else {\r\n BloomFilterUtil bf = BloomFilterUtil.create(funnel,\r\n expectedInsertions,\r\n fpp,\r\n (BloomFilterUtil.Strategy) hashStrategy);\r\n bf.put(value);\r\n Node<V> node = new Node<V>(value, bf);\r\n table.put(key, node);\r\n }\r\n }",
"public void put(Value key, Value value) {\n\t\tstorage.put(key, value);\n\t}",
"public void insertingANode(T key, E value) {\r\n\t\tRBNode<T, E> insertedNode = createRBNode(key, value);\r\n\t}",
"public void put(Key key, Value val);",
"@Override\n public void insert(Comparable k, Object v) {\n\n if (k == null) { // Check for null key\n throw new IllegalArgumentException(\"null key\");\n }\n\n // If size 0, just add pair\n else if (this.size == 0) {\n ls[this.size] = new Pair(k, v);\n this.size++;\n return;\n }\n // If # of items reached capacity\n else if (this.CAPACITY == this.size) {\n Pair[] newLs = new Pair[this.CAPACITY + 100];\n\n // Deep copy of previous Pair[]\n for (int i = 0; i < this.size; i++) {\n if (ls[i].key.equals(k)) {\n throw new RuntimeException(\"duplicate key\");\n }\n newLs[i] = this.ls[i]; // Change this.ls value\n }\n this.ls = newLs; // Change field to new Pair[]\n this.ls[size] = new Pair(k, v); // Add the Pair\n this.CAPACITY += 100; // Increase capacity\n size++;\n return;\n\n } else {\n // Loop to check for duplicate exception\n for (int i = 0; i < this.size; i++) {\n if (ls[i].key.equals(k)) {\n throw new RuntimeException(\"duplicate key\");\n }\n }\n\n // Add pair to array\n ls[this.size] = new Pair(k, v);\n this.size++;\n }\n\n }",
"@Override\n\tpublic void insert(String value) {\n\t\tif (value == null)\n\t\t\treturn;\n\t\tint hashVal = hashFunc(value);\n\t\tboolean collisionFlag = false;\n\t\twhile (hashArray[hashVal] != null\n\t\t\t\t&& !hashArray[hashVal].value.equals(deleted.value)) {\n\t\t\tif (hashArray[hashVal].value.equals(value)) {\n\t\t\t\thashArray[hashVal].addFrequency();\n\t\t\t\tif (collisionFlag)\n\t\t\t\t\tthis.collision--;\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!collisionFlag) {\n\t\t\t\tif (hashFunc(hashArray[hashVal].value) == hashFunc(value)) {\n\t\t\t\t\tthis.collision++;\n\t\t\t\t\tcollisionFlag = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\thashVal++;\n\t\t\thashVal = hashVal % size;\n\t\t}\n\t\tthis.numOfItems++;\n\t\thashArray[hashVal] = new DataItem(value);\n\n\t\tdouble loadFactor = (double) this.numOfItems / (double) this.size;\n\t\tif (loadFactor >= LoadFactor)\n\t\t\trehash();\n\n\t}",
"public void put(K key, V val) {\n int index = findIndex(key);\n // the real reason we bother to check is \n // to know whether or not to increment pairs.\n if (keys[index] == null) {\n keys[index] = key;\n values[index] = val;\n }\n else\n values[index] = val;\n }",
"public int put(int key, String value) {\n int retval = 0;\n\n String sql = \"INSERT INTO data_map(data_key, data_val) VALUES(?, ?)\";\n\n try (Connection con = this.connect();\n PreparedStatement pstmt = con.prepareStatement(sql)) {\n pstmt.setInt(1, key);\n pstmt.setString(2, value);\n retval = pstmt.executeUpdate();\n }\n catch (SQLException e) {\n retval = -1;\n }\n\n return retval;\n }",
"public void putNewPrice(String symbol, double price);",
"public boolean put( AnyType key , AnyType value)\n { \n int currentPos = findPos( key );\t//TODO: test this\n \n if( array[ currentPos ] == null )\n ++occupied;\n array[ currentPos ] = new HashEntry<>(key, value);\n \n theSize++;\n \n // Rehash\n if( occupied > array.length / 2 )\n rehash( );\n \n return true;\n }",
"void addEntry(K key, V value);",
"public void put(K key, V value) {\n int hash = getHash(key.hashCode());\n Entry<K, V> existing = buckets[hash];\n Entry<K, V> entry = new Entry<>(key, value);\n\n if (existing == null) {\n buckets[hash] = entry;\n } else { // using separating chaining collision resolution. Another way is open addressing, resizing the array to reducing collision.\n while(existing.next != null) {\n if (existing.key.equals(key)) {\n existing.value = value;\n return;\n }\n existing = existing.next;\n }\n if (existing.key.equals(key)) {\n existing.value = value;\n } else {\n existing.next = entry;\n }\n }\n }",
"@Override\r\n public void insert(K key, V value) {\r\n // call insert of the root\r\n root.insert(key, value);\r\n }",
"public void addToValueAtKey(String aKey, String aValue) {\n if (cars.containsKey(aKey)) {\n cars.get(aKey).add(aValue);\n }\n }",
"public void put(String key, Object value)\n\t{\n\t\tverifyParseState();\n\t\tvalues.put(key, ValueUtil.createValue(value));\n\t}",
"public void put(String key, String value)\n\t{\n\t\tverifyParseState();\n\t\tvalues.put(key, ValueUtil.createValue(value));\n\t}",
"@Override\n public void process(String key, String value) {\n logger.info(\"Adding record to state store\");\n this.wordStateStore.put(key, value);\n }",
"public V add(K key, V value)\n { \n checkInitialization();\n if ((key == null) || (value == null))\n throw new IllegalArgumentException();\n else\n { \n V result = null; \n int keyIndex = locateIndex(key); \n if ((keyIndex < numberOfEntries) && \n key.equals(dictionary[keyIndex].getKey()))\n {\n // Key found; return and replace entry's value\n result = dictionary[keyIndex].getValue(); // Get old value\n dictionary[keyIndex].setValue(value); // Replace value \n }\n else // Key not found; add new entry to dictionary\n { \n makeRoom(keyIndex);\n dictionary[keyIndex] = new Entry(key, value);\n numberOfEntries++;\n ensureCapacity(); // Ensure enough room for next add\n } // end if \n return result;\n } // end if\n }",
"protected abstract void put(K key, V value);",
"public final <T> boolean insert(final Class<T> key, T value) {\n\n if(contains(key))\n return false;\n\n _data.put(key, value);\n return true;\n }",
"public void put(Key key, Value val)\t//put key-value pair in the table\n\t{\t\n\t/*\n\t * Tree shape: Many BSTs can correspond to the same set of keys.\n\t * <li>Number of compares for search/insert is equal to 1+depth of node.\n\t * <li>Worst case when keys entered in order\n\t */\n\t\troot=put(root,key,val);\n\t}",
"@Override\n public void Add(String key, Integer value) throws InvalidKeyException {\n if(Contains(key))\n throw new InvalidKeyException(\"Key already exists\");\n\n // Adding the new key/value node\n if(head == null)\n head = new Node(key, value);\n else{\n Node new_node = new Node(key, value);\n new_node.next = head;\n head = new_node;\n }\n\n // increment count\n count++;\n }",
"@Override\n public Status insert(String table, String key, Map<String, ByteIterator> values) {\n String hash = serialize(values);\n InsertM request = InsertM.newBuilder().setTable(table).setKey(key).setValues(hash).build();\n Result response;\n try {\n response = blockingStub.insert(request);\n } catch (StatusRuntimeException e) {\n return Status.ERROR;\n }\n return Status.OK;\n }",
"void addTransientEntry(K key, V value);",
"public void put(int key, int value) {\n store[key] = value; // update operation= overwritten \n }",
"public void addToSymbolsTable(Token t) {\n\t\tif (!t.hasError()\n && (t.getType().equals(\"Constante\") || (t.getType().equals(\"Cadena\")))\n && !reservedWords.containsKey(t.getToken())\n && !symbolsTable.contains(t.getToken())\n ) {\n\n\t\t\tsymbolsTable.add(t);\n\t\t\t//System.out.println(\"[V] Token added line: \" + line + \" TokenType: \"\n\t\t\t//\t\t+ t.getType() + \" Token: \" + t.getToken());\n\t\t} else {\n\t\t\t//System.out.println(\"[X] Token NOT added to the symbol table. line: \"\n\t\t\t//\t\t+ line + \" TokenType: \" + t.getType() + \" Token: \"\n\t\t\t//\t\t+ t.getToken());\n\t\t}\n\n\t}",
"Object put(Object key, Object value);",
"public void put(String key, int value) {\r\n //creating hash code using key value given as a string\r\n int hash = new BigInteger(toAscii(key)).mod(new BigInteger(((Integer)TABLE_SIZE).toString())).intValue();\r\n while (table[hash] != null && table[hash].getKey() != key)\r\n hash = (hash + 1) % TABLE_SIZE;\r\n table[hash] = new HashEntry(key, value);\r\n }",
"@Override\n public void insert(Node item) {\n int hash = getHash(item.getState().getName());\n Node temp = hashTable[hash];\n\n if (isEmpty(hash)) { // Check to see if the hashed index of the array is empty\n hashTable[hash] = item;\n } else if (item.getState().getName().compareTo(temp.getState().getName()) < 0) { // Should the value be inserted at the front\n item.setNext(temp);\n hashTable[hash] = item;\n } else {\n temp = findNode(hashTable[hash], item.getState().getName());\n item.setNext(temp.getNext());\n temp.setNext(item);\n }\n }",
"public abstract V put(K key, V value);",
"public void add(Object key, Object value){\n\t\tint bucketLoc = key.hashCode() % _numBuckets;\r\n\t\tif(_locate(key) == null){\r\n\t\t\tNode newNode = new Node(key,value,_buckets[bucketLoc]);\r\n\t\t\t_buckets[bucketLoc] = newNode;\r\n\t\t\t_count++;\r\n\t\t\t_loadFactor = (double) _count / (double) _numBuckets;\r\n\t\t\tif(_loadFactor > _maxLoadFactor){\r\n\t\t\t\t_increaseTableSize();\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t_buckets[bucketLoc]._value = value;\r\n\t\t}\r\n\t}",
"private void addNewHead(final K key, final V value)\n {\n // Create the new element and add to the map\n final StackElement newElement = new StackElement(key, value);\n this.hashMap.put(key, newElement);\n\n // If there were no elements\n if (this.head == null)\n {\n this.head = newElement;\n this.tail = newElement;\n }\n else\n {\n final StackElement previoussHead = this.head;\n this.head = newElement;\n newElement.next = previoussHead;\n previoussHead.previous = newElement;\n }\n }",
"public void insert( int key, Integer data ){\n if (data == null) data = key;\n\n int index = computeHash(key);\n Node head = list[index];\n while( head != null ){ // Collision : key already in hashtable, put it in the linked list\n \n if(compare(head.key, key) == 0){ // Update : In case key is already present in list : exit\n head.data = data;\n return;\n }\n head = head.next; // put it at the end of the list\n }\n\n // No collision, new key; list.get(index) = null because that node at that index is not present\n list[index] = new Node(key, data, list[index]);\n }",
"public V put(K key, V value) {\r\n\t\tint place = hash(key.hashCode());\r\n\t\tif (get(key) != null) {\r\n\t\t\tLinkedList<KVPair> temp = hashMapArray[place];\r\n\t\t\tfor (KVPair i : temp) {\r\n\t\t\t\tif (i.getKey().equals(key)) {\r\n\t\t\t\t\tV oldKey = i.getValue();\r\n\t\t\t\t\ti.setValue(value);\r\n\t\t\t\t\treturn oldKey;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif ((capacity * loadFactor) <= (size)) {\r\n\t\t\t\texpand(capacity + 10);\r\n\t\t\t\treturn put(key, value);\r\n\t\t\t} else if (hashMapArray[place] == null) {\r\n\t\t\t\thashMapArray[place] = new LinkedList<KVPair>();\r\n\t\t\t}\r\n\t\t\thashMapArray[place].add(new KVPair(key, value));\r\n\t\t\tsize++;\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"public void insert(DataItem item){\n\t\tint key = item.getKey();\n\t\tint hashVal = hashFunc(key);\n\t\tint stepSize = hashFunc2(key); //get step size until empty cell or -1;\n\t\t\n\t\twhile(hashArray[hashVal] != null &&\n\t\t\t\thashArray[hashVal].getKey() != -1){\n\t\t\thashVal += stepSize; // go to the next cell\n\t\t\thashVal %= arraySize;\t\t\t\t\t//wrap around if necessary\n\t\t}\n\t\thashArray[hashVal] = item;\n\t}",
"public void put(Keys key, String value) {\n\t\tp.put(getRegKey(key), value); //$NON-NLS-1$\n\t}",
"public void put(String key, Character val){\r\n\t\tint hash = hash(key);\r\n\t\tfor(int i = 0; i < M; i++){\r\n \tif(hash + i < M){\r\n \tif(keys[hash + i] == null || keys[hash + i].equals(key)){\r\n assign(hash + i, key, val);\r\n N++;\r\n break;\r\n \t\t}\r\n \t}else{\r\n \tif(keys[hash + i - M] == null || keys[hash + i - M].equals(key)){\r\n \tassign(hash + i - M, key, val);\r\n \tN++;\r\n \tbreak;\r\n \t}\r\n \t}\r\n\t\t}\r\n\t\treturn;\r\n\t}",
"public void put(int key, int value) {\n int hashedKey = hash(key);\n Entry entry = map.get(hashedKey);\n if (entry.key == -1){\n // empty entry, insert entry\n entry.key = key;\n entry.value = value;\n }else if (entry.key == key){\n // target entry\n entry.value = value;\n }else{\n // in list, find target entry\n while(entry.key != key && entry.next!=null){\n entry = entry.next;\n }\n if (entry.key == key)\n entry.value = value;\n else\n entry.next = new Entry(key, value);\n }\n }",
"public V put(K key, V value) {\n if (null == key) {\n return isertNullKey(key, value);\n } else {\n // inserting other keys\n int location = hashFunction(key.hashCode());\n if (location / capacity >= loadFactor) {\n resize();\n }\n MyEntry<K, V> entry = null;\n entry = bucket[location];\n //if a value exists with same key, we are not overriding that value, just returning the same,\n //in hashMap they actually override the new value\n if (entry != null && key == entry.getKey()) {\n return entry.getValue();\n } else {\n MyEntry ent = new MyEntry();\n ent.setKey(key);\n ent.setValue(value);\n bucket[location] = ent;\n return value;\n }\n\n }\n }",
"public void insert(KeyedItem newItem);"
] | [
"0.6820363",
"0.6753513",
"0.6630974",
"0.65493304",
"0.64461416",
"0.6430341",
"0.6430341",
"0.63802904",
"0.63001746",
"0.6207619",
"0.6199297",
"0.6198205",
"0.6189198",
"0.61707383",
"0.6152024",
"0.6149929",
"0.6094755",
"0.60601985",
"0.60589457",
"0.60167056",
"0.5974889",
"0.59683627",
"0.5948143",
"0.59472364",
"0.59383124",
"0.5935587",
"0.5916541",
"0.5910193",
"0.5908093",
"0.5904471",
"0.5904469",
"0.58953613",
"0.5888232",
"0.58739686",
"0.5840664",
"0.58377016",
"0.5835175",
"0.58317906",
"0.5820366",
"0.57955706",
"0.57860214",
"0.57792497",
"0.5771066",
"0.5769326",
"0.57668984",
"0.5734519",
"0.5730634",
"0.57285774",
"0.57167816",
"0.57059103",
"0.5702119",
"0.5700869",
"0.56885374",
"0.56805366",
"0.5652459",
"0.5636178",
"0.5633956",
"0.56260264",
"0.5623718",
"0.56164867",
"0.56052804",
"0.5605064",
"0.56015754",
"0.5599951",
"0.55937845",
"0.5590334",
"0.558079",
"0.5563896",
"0.5559031",
"0.5544827",
"0.55308855",
"0.551437",
"0.5506305",
"0.5504479",
"0.55030435",
"0.55013114",
"0.54980487",
"0.5495062",
"0.54929584",
"0.5490436",
"0.54901844",
"0.5483364",
"0.5481821",
"0.54757905",
"0.54688734",
"0.5451011",
"0.544841",
"0.54453295",
"0.5439793",
"0.5437267",
"0.5436537",
"0.5431865",
"0.54316086",
"0.5430832",
"0.5429997",
"0.5428286",
"0.5418184",
"0.54095703",
"0.540709",
"0.54036355",
"0.53956306"
] | 0.0 | -1 |
Removes the key from the set if the key is present. | public void delete(String key)
{
if (key.equals("")) {
if (null_str_val != null) --N;
null_str_val = null;
return;
}
root = delete(root, key, 0);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void remove(K key) {\n super.remove(key);\n keySet.remove(key);\n }",
"public boolean remove(K key);",
"public boolean remove(Key key) ;",
"boolean remove(K key);",
"boolean remove(K key);",
"public void remove(K key);",
"public <K> boolean remove(K key);",
"public void remove(Object key){\n map.remove(key);\n }",
"V remove(K key);",
"V remove(K key);",
"V remove(K key);",
"public abstract boolean remove(Key key);",
"void remove(K key);",
"void remove(K key);",
"void remove(K key);",
"@Override\n\tpublic V remove(Object key) {\n\t\tkeys.remove(key);\n\t\treturn map.remove(key);\n\t}",
"V remove(Object key);",
"@Override\r\n\tpublic void removeElement(K key) {\n\t\tque.remove(key);\r\n\t\thashMap.remove(key);\r\n\t}",
"void remove(String key);",
"void remove(String key);",
"void remove(String key);",
"V remove(final K key);",
"public void remove(K key)\n {\n AssociationList<K, V> bucket = this.get(this.find(key));\n if (bucket != null)\n {\n bucket.remove(key);\n } // if (bucket != null)\n }",
"public V remove(K key);",
"public V remove(K key);",
"public Object remove(String key);",
"@Override\n public T remove(Object key) {\n // Do I have an entry for it?\n Map.Entry<String, T> entry = entries.get((String) key);\n if (entry != null) {\n entries.remove(key);\n // Change the underlying map.\n return map.remove(prefix + key);\n }\n return null;\n }",
"@Override\n\tpublic String remove(String key) {\n\t\tint hashVal = hashFunc(key);\n\t\twhile (hashArray[hashVal] != null) {\n\t\t\tif (hashArray[hashVal].value.equals(key)) {\n\t\t\t\thashArray[hashVal] = deleted;\n\t\t\t\tthis.numOfItems--;\n\t\t\t\treturn key;\n\t\t\t}\n\t\t\thashVal++;\n\t\t\thashVal = hashVal % size;\n\n\t\t}\n\t\treturn null;\n\t}",
"final void remove(String key) {\n remove(key, false);\n }",
"public void remove(K key){\n\t\tfor(int i = 0; i<keys.length;i++)\n\t\t\tif (keys[i] != null && keys[i].equals(key)){\n\t\t\t\t\tkeys[i] = null;\n\t\t\t\t\telem[i] = null;\n\t\t\t\t\thowMany = howMany - 1;\n\t\t\t\t}\n\t}",
"boolean remove(Object key, Object value);",
"public void remove(int key) {\n store[key] = -1; // If the key is removed, the value of that key is replaced with -1, \n \t\t\t\t// that the item doesn't exist because hashmap requires removal of keys.\n }",
"private boolean delete(K key) {\n\t\t\tif (!keySet.contains(key)) {\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\tint index = keySet.indexOf(key);\n\t\t\t\tkeySet.set(index, keySet.get(size - 1));\n\t\t\t\tvalueSet.set(index, valueSet.get(size - 1));\n\t\t\t\tkeySet.set(size - 1, null);\n\t\t\t\tvalueSet.set(size - 1, null);\n\t\t\t\tsize--;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}",
"void removeEntry(K key);",
"public void remove(int key) {\n hashMap.removeIf(pair -> pair[0] == key);\n }",
"void remove(@NonNull String key);",
"public boolean remove(String key, V value) {\n Collection<V> values = map.get(key);\n\n if (values != null) {\n return values.remove(value);\n }\n\n return false;\n }",
"@Override\n public synchronized Object remove(Object key) {\n String strkey = key.toString();\n if (this.ignoreCase) {\n strkey = (String) this.keyMap.remove(strkey.toLowerCase());\n if (strkey == null)\n return null;\n }\n return super.remove(strkey);\n }",
"void remove(String aKey);",
"@Override\r\n\tpublic boolean remove(Object o) {\n\t\treturn set.remove(o);\r\n\t}",
"@Override\n\t\t\tpublic AnalysisResult remove(Object key) {\n\t\t\t\treturn null;\n\t\t\t}",
"public Object removeItem (String key);",
"public Entry remove(Object key) {\n int i = compFunction(key.hashCode());\n SList chain = buckets[i];\n try {\n for (SListNode n = (SListNode) chain.front(); n.isValidNode(); n = (SListNode) n.next()) {\n Entry e = (Entry) n.item();\n if (e.key.equals(key)) {\n n.remove();\n size--;\n return e;\n }\n }\n } catch(InvalidNodeException e) {\n System.out.println(e);\n }\n return null; \n }",
"Object remove(Object key) throws NullPointerException;",
"public void remove(String key) throws IOException;",
"void removeValue(String key);",
"@Override\n\tpublic V remove(K key) {\n\t\treturn null;\n\t}",
"@Override\r\n\tpublic void removeEntry(String key) {\n\t\t\r\n\t}",
"public void remove(int key){\n\t\tif(get(key) != null){\n\t\t\tSystem.out.println(\"Removing \" + get(key) + \" from map\");\n\t\t\thashMap[key] = null;\n\t\t\treturn;\n\t\t}\n\t\tSystem.out.println(\"Key \" + key + \" not in map\");\n\t\treturn;\n\t}",
"protected void remove(K key) {\n segment.remove(key);\n }",
"@Override\n\tpublic V remove(Object key) {\n\t\treturn null;\n\t}",
"@Override\n\tpublic V remove(Object key) {\n\t\treturn null;\n\t}",
"public abstract V remove(K key);",
"@Override\r\n\tpublic Object removeObject(Object key) {\n\t\treturn null;\r\n\t}",
"@Override\n public V remove(K key) {\n return null;\n }",
"public void remove(Key key) {\n root = remove(root, key);\n }",
"public V remove(K key) throws InvalidKeyException;",
"public static void remove(final String key) {\r\n\t\tMap<String, String> map = new HashMap<String, String>(data.get());\r\n\t\tmap.remove(key);\r\n\t\tdata.set(map.isEmpty() ? Collections.<String, String> emptyMap() : Collections.<String, String> unmodifiableMap(map));\r\n\t}",
"public V remove(K key) {\r\n\t\t// TODO Complete this!\r\n\t\tint place = hash(key.hashCode());\r\n\t\tif (hashMapArray[place] != null) {\r\n\t\t\tLinkedList<KVPair> temp = hashMapArray[place];\r\n\t\t\tfor (KVPair i : temp) {\r\n\t\t\t\tif (i.getKey().equals(key)) {\r\n\t\t\t\t\tV oldKey = i.getValue();\r\n\t\t\t\t\ttemp.remove(i);\r\n\t\t\t\t\tsize--;\r\n\t\t\t\t\treturn oldKey;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"public void remove(int key) {\n int hashedKey = hash(key);\n Entry entry = map.get(hashedKey);\n if (entry.key == -1) {\n return;\n } else if (entry.key == key) {\n if (entry.next != null) map.set(hashedKey, entry.next);\n else entry.key = -1;\n } else if (entry.next != null) {\n Entry pre = entry, cur = entry.next;\n while (cur.next != null && cur.key != key) {\n pre = cur;\n cur = cur.next;\n }\n if (cur.key == key) {\n pre.next = cur.next;\n }\n }\n }",
"public boolean remove(Object key) {\n if (keyCardinality.get(key) == null) {\n return false;\n }\n // Remove cardinality of key\n keyCardinality.remove(key);\n // Remove key from hashmaps\n for (int i = 0; i < this.gcdBands; i++) {\n Map<Object, Set<Long>> segmentIdInfo = segmentIds.get(i);\n Map<Long, Set<Object>> hashTable = hashTables.get(i);\n if (segmentIdInfo.get(key) == null) continue;\n for (long segId : segmentIdInfo.get(key)) {\n hashTable.get(segId).remove(key);\n if (hashTable.get(segId).isEmpty()) {\n hashTable.remove(segId);\n }\n }\n segmentIdInfo.remove(key);\n }\n return true;\n }",
"public void remove(String key) {\n\t\tentities.remove(key);\n\t}",
"public void remove(int key) {\n map.remove(key);\n }",
"public void remove(int key) {\n int index = keys.indexOf(key);\n if(index > 0) {\n keys.remove(index);\n values.remove(index);\n }\n }",
"public void remove(Key key) {\n\n\t\tif (!contains(key)) return;\n\t\tint index = locate(key);\n\t\tkeys[index] = null;\n\t\tvalues[index] = null;\n\t\tthis.size--;\n\n\t\t// Check to see if any of the items in the table that follow\n\t\t// this one had collided with the key that was just removed.\n\t\t// If so, we need to rehash/reinsert them.\n\n\t\tint i = increment(index);\n\t\twhile (keys[i] != null) {\n\n\t\t\t// Save the key/value pair at this location.\n\n\t\t\tKey savedKey = keys[i];\n\t\t\tValue savedValue = values[i];\n\n\t\t\t// And temporarily remove it from the hash map.\n\n\t\t\tkeys[i] = null;\n\t\t\tvalues[i] = null;\n\n\t\t\t// Figure out where it should go now and reinsert it.\n\n\t\t\tindex = locate(savedKey);\n\t\t\tkeys[index] = savedKey;\n\t\t\tvalues[index] = savedValue;\n\n\t\t\t// Advance to the next item.\n\t\t\ti = increment(i);\n\t\t}\n\t}",
"public Object remove(Object key)\n\t{\n\t\tremoveOperator(key);\n\t\tremoveLogicalOperator(key);\n\t\treturn super.remove(key);\n\t}",
"public V remove(K key)\n {\n checkInitialization();\n if ((key == null))\n throw new IllegalArgumentException();\n else\n { \n V result = null;\n int keyIndex = locateIndex(key);\n if ((keyIndex < numberOfEntries) && \n key.equals(dictionary[keyIndex].getKey()))\n { \n // Key found; remove entry and return its value\n result = dictionary[keyIndex].getValue();\n removeGap(keyIndex);\n numberOfEntries--;\n } // end if\n // Else result is null\n return result;\n } // end if\n }",
"@Override\n\t@TimeComplexity(\"O(n)\")\n\tpublic V remove(K key) {\n\t/* TCJ\n\t * Binary search operation: log n\n\t * Iterate through new collection: n\n\t */\n\t\tint j = findIndex(key);\n\t\tif ( j == size() || key.compareTo(map.get(j).getKey()) != 0 ) return null;\n\t\treturn map.remove(j).getValue();\n\t}",
"public void remove(long key) {\r\n removeElement(key);\r\n }",
"UserSettings remove(String key);",
"@Override\n public V remove(K key) {\n V val = get(key);\n if (val != null) {\n root = removeHelper(root, key);\n size -= 1;\n }\n return val;\n// throw new UnsupportedOperationException(\"Unsupported operation, sorry!\");\n }",
"public V remove(K key, V value) {\n if (key == null || !keySet.contains(key))\n return null;\n int index = reduce(key, buckets.size());\n ArrayList<Entry> items = buckets.get(index);\n for (Entry e : items) {\n if (e.key.equals(key)) {\n if (e.value.equals(value)) {\n\n items.remove(e);\n keySet.remove(key);\n numEntries--;\n return e.value;\n }\n }\n }\n return null;\n }",
"@Override\n public V remove(K key, V value) {\n V val = get(key);\n if (val != null && value != null && val.equals(value)) {\n root = removeHelper(root, key);\n size -= 1;\n }\n return val;\n// throw new UnsupportedOperationException(\"Unsupported operation, sorry!\");\n }",
"@Override\n public V remove(K key) {\n Entry<K, V> removed = new Entry<>(null, null);\n if(containsKey(key)) {\n LinkedList<Entry<K, V>> pointer = entryArr[Math.floorMod(key.hashCode(), entryArr.length)];\n for(int i = 0; i < pointer.size(); i++) {\n if(pointer.get(i).keyEquals(new Entry<K, V>(key, null))) {\n removed = pointer.get(i);\n pointer.remove(pointer.get(i));\n break;\n }\n }\n size--;\n }\n return removed.value;\n }",
"boolean remove(final K key, final V value);",
"boolean removeAll(Object key, Set values);",
"public void remove(int key) {\n\n }",
"public Entry<K, V> remove(K key) {\r\n try {\r\n int hash = key.hashCode();\r\n ListNode<Entry<K, V>> node = table[compFunction(hash)].front();\r\n if (node.isValidNode()) {\r\n Entry<K, V> entry = (Entry<K, V>) node.getItem();\r\n node.remove();\r\n return entry;\r\n }\r\n } catch (Exception e) {\r\n System.out.println(\"Unhashable key: \" + e);\r\n }\r\n return null;\r\n }",
"public void remove(Object key, Object value) {\n map.get(key).remove(value);\n }",
"public V remove(final K key) {\n expunge();\n final int hash = hash(key);\n final int index = index(hash, entries.length);\n Entry<K, V> temp = entries[index];\n Entry<K, V> previous = temp;\n\n while (temp != null) {\n final Entry<K, V> next = temp.nextEntry;\n if (hash == temp.hash && key == temp.get()) {\n size--;\n if (previous == temp) {\n entries[index] = next;\n } else {\n previous.nextEntry = next;\n }\n return temp.value;\n }\n previous = temp;\n temp = next;\n }\n\n return null;\n }",
"void remove(KeyType key);",
"public void removeAllWithKey(k key) {\n\t\t\n\t\tint b = hash(key);\n\t\tNode<k,v> curr = buckets[b];\n\t\tNode<k,v> previous = null;\n\t\t\n\t\twhile (curr != null) {\n\t\t\tif (key.equals(curr.getKey())) { // check if keys match\n\t\t\t\n\t\t\t\tif (previous == null) {\n\t\t\t\t\tbuckets[b] = curr.getNext(); // if removing first item, set the next as first\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tprevious.setNext(curr.getNext()); // else set the previous' next to curr's next\n\t\t\t\t}\t\t\n\t\t\t} else {\n\t\t\t\tprevious = curr; // if match wasn't found, set previous to current before moving on\n\t\t\t}\n\t\t\tcurr = curr.getNext(); // move in SLL\n\t\t}\n\t}",
"public void remove(String key) {\n \ttmp = getNode(key);\n \tif (tmp == null) {\n \t\treturn;\n \t} else {\n \t\tif (first.getKey() == key) {\n \t\t\tfirst = first.getNext();\n \t\t\tif (first == null) {\n \t\t\t\tlen--;\n \t\t\t\treturn;\n \t\t\t}\n \t\t\tfirst.setPrev(null);\n \t\t} else if (last.getKey() == key) {\n \t\t\tlast = last.getPrev();\n \t\t\tlast.setNext(null);\n \t\t\tif (last.getKey() == first.getKey()) {\n \t\t\t\tlast = null;\n \t\t\t}\n \t\t} else {\n \t\t\tNode tmp1 = tmp.getNext();\n \t\t\tNode tmp2 = tmp.getPrev();\n \t\t\ttmp1.setPrev(tmp2);\n \t\t\ttmp2.setNext(tmp1);\n \t\t}\n \tlen--;\n \t}\n }",
"boolean remove(byte[] key);",
"@Override\n public V remove(K key, V value) {\n if (key == null) return null;\n if (get(key) != value) {\n return get(key);\n }\n root = remove(root, key);\n return get(key);\n }",
"@Override\n public V remove(K key) {\n return delete(root, key).val;\n }",
"@Override\r\n\tpublic V remove(Object key) {\r\n\t\tint index = key.hashCode() % numBuckets;\r\n\t\treturn ((Bucket) buckets[index]).remove((K) key);\r\n\t}",
"public Object remove(String key) {\r\n Object res = attributeMap.remove(key);\r\n fireStateChanged();\r\n return res;\r\n }",
"public void remove(String key) {\n\t\t\tproperties.remove(key);\n\t\t}",
"public void remove(K key) {\n Object[] entries = entrySet();\n\n for (int i = 0; i < entries.length; i ++) {\n Entry<K,V> entry = (Entry<K, V>) entries[i];\n if(entry.getKey().equals(key)) {\n entries[i] = null;\n break;\n }\n }\n\n this.table = new Object[TABLE_SIZE];\n\n rebuild(entries);\n }",
"@Override\n synchronized public void removeKey(Integer key) {\n this.map.remove(key);\n }",
"abstract void remove(String key, boolean commit);",
"protected abstract Set<String> _removeFromSet(String key, Collection<String> str);",
"public Entry remove(K key){\r\n int loc = find(key);\r\n if(hashTable[loc]!=null && hashTable[loc].equals(key)){\r\n Entry<K,V> result = hashTable[loc];\r\n hashTable[loc].isDeleted = true;\r\n size--;\r\n return result;\r\n }\r\n else\r\n return null;\r\n }",
"@Override\n\tpublic V remove(K key) {\n\t\tint h = Math.abs(key.hashCode()) % nrb;// calculam hash-ul asociat cheii\n\n\t\tfor (int i = 0; i < b.get(h).getEntries().size(); i++) {\n\t\t\t// parcurgerea listei de elemente pentru a gasi cheia ceruta si\n\t\t\t// stergerea acesteiu din lista\n\t\t\tif (b.get(h).getEntries().get(i).getKey().equals(key)) {\n\t\t\t\tV x = b.get(h).getEntries().get(i).getValue();\n\t\t\t\tb.get(h).e.remove(i);\n\t\t\t\treturn x;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}",
"@Override\r\n public V remove(K key) {\r\n int index = getIndex(key);\r\n IDictionary<K, V> temp = chains[index];\r\n if (temp!=null) {\r\n if (temp.containsKey(key)) {\r\n V result = temp.get(key);\r\n temp.remove(key);\r\n load--;\r\n return result;\r\n }\r\n }\r\n throw new NoSuchKeyException();\r\n }",
"public V remove(K key)\n\t{\n\t\tcheckForNulls(key);\n\t\tint n = Math.abs(key.hashCode() % entries.length);\n\t\t\n\t\tif (entries[n] == null)\n\t\t\treturn null;\n\t\t\n\t\tV ret = null;\n\t\tfor (Entry e : entries[n])\n\t\t{\n\t\t\tif (key.equals(e.key) == true)\n\t\t\t\tret = e.value;\n\t\t}\n\t\t\n\t\tif (ret == null)\n\t\t\treturn null;\n\t\t\n\t\tentries[n].remove(new Entry(key, null));\n\t\treturn ret;\n\t}",
"public boolean removeKey(@NonNull Q key) {\n boolean removed = false;\n Pair[] alarms = toArray(new Pair[size()]);\n for (int i = alarms.length - 1; i >= 0; --i) {\n if (key.equals(alarms[i].first)) {\n remove(alarms[i]);\n removed = true;\n }\n }\n return removed;\n }",
"public void delete(String key){\r\n\t\tint hash = hash(key);\r\n for(int i = 0; i < M; i++){\r\n if(hash + i < M){\r\n if(keys[hash + i] != null && keys[hash + i].equals(key)){\r\n remove(hash + i);\r\n N--;\r\n break;\r\n }\r\n }else{\r\n if(keys[hash + i - M] != null && keys[hash + i - M].equals(key)){\r\n remove(hash + i - M);\r\n N--;\r\n break;\r\n }\r\n }\r\n\t\t}\r\n }",
"void unset(K k);",
"public V remove(K key)\r\n\t{\r\n\t\t//TODO: add your code here\r\n\t\tV oldVal;\r\n\t\tint slot = findSlot(key, false); // check if it already exists\r\n\t\t// sets the slot in the map to DUMMY value if it exists\r\n\t\tif (slot >= 0)\r\n\t\t{\r\n\t\t\toldVal = table[slot].getValue();\r\n\t\t\ttable[slot] = DUMMY;\r\n\t\t\tcount--;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\toldVal = null;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn oldVal;\r\n\t}"
] | [
"0.7524336",
"0.74451125",
"0.733745",
"0.72817975",
"0.72817975",
"0.7265492",
"0.7230867",
"0.70661575",
"0.7027042",
"0.7027042",
"0.7027042",
"0.6993302",
"0.6991795",
"0.6991795",
"0.6991795",
"0.69781953",
"0.6962847",
"0.69627213",
"0.6952141",
"0.6952141",
"0.6952141",
"0.6912395",
"0.6884121",
"0.68538105",
"0.68538105",
"0.6838788",
"0.68174034",
"0.6803164",
"0.67942965",
"0.6756433",
"0.67181695",
"0.6709941",
"0.66760904",
"0.66673684",
"0.66600645",
"0.66535795",
"0.66237646",
"0.6605651",
"0.66022176",
"0.6591101",
"0.65810394",
"0.656381",
"0.6554465",
"0.65251637",
"0.6518919",
"0.65090364",
"0.6500087",
"0.6489202",
"0.64763844",
"0.64523804",
"0.645083",
"0.645083",
"0.64482105",
"0.644755",
"0.64445275",
"0.64343023",
"0.6417185",
"0.64084786",
"0.6406837",
"0.63900495",
"0.6388419",
"0.63851357",
"0.63702357",
"0.63639224",
"0.6355954",
"0.63374615",
"0.63188523",
"0.631779",
"0.63039976",
"0.6288729",
"0.6287566",
"0.6280685",
"0.62742805",
"0.62664866",
"0.62625927",
"0.6262401",
"0.6257851",
"0.62559485",
"0.6252811",
"0.62514436",
"0.62507474",
"0.6247248",
"0.6238542",
"0.6230812",
"0.62196857",
"0.6211434",
"0.6187398",
"0.6180603",
"0.6179899",
"0.61649036",
"0.6160436",
"0.6154142",
"0.61533713",
"0.6144183",
"0.6141048",
"0.61399156",
"0.6139642",
"0.61318237",
"0.61295134",
"0.611922",
"0.6114479"
] | 0.0 | -1 |
Returns the string in the symbol table that is the longest prefix of query, or null, if no such string. | public String longestPrefixOf(String query)
{
Node<Value> x = root;
int d = 0, e = 0;
int len = query.length();
while (d < len)
{
if (x == null) break;
char c = query.charAt(d);
if (c > x.c) x = x.right;
else if (c < x.c) x = x.left;
else { ++d; if (x.val != null) e = d; x = x.mid; }
}
String s = query.substring(0, e);
return (s.equals("") && null_str_val == null) ? null : s;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private String longestPrefix(String[] inputs){\n\t\tif(inputs == null || inputs.length == 0)\n\t\t\treturn \"\";\n\t\tif(inputs.length == 1)\n\t\t\treturn inputs[0];\n\t\tString prefix = inputs[0];\n\t\t\n\t\tfor(int i=0; i< inputs.length; i++){\n\t\t\twhile(inputs[i].indexOf(prefix) != 0){\n\t\t\t\tprefix = prefix.substring(0, prefix.length()-1);\n\t\t\t\tif(prefix.isEmpty())\n\t\t\t\t\treturn \"\";\n\t\t\t}\n\t\t}\t\t\n\t\treturn prefix;\n\t}",
"@Override\n public String longestPrefixOf(String key) {\n if (key == null || key.length() == 0 || root == null) {\n throw new NoSuchElementException();\n }\n StringBuilder longestPrefix = new StringBuilder();\n Node p = root;\n for (int i = 0; i < key.length(); i++) {\n Node current = p.next.get(key.charAt(i));\n if (current != null) {\n longestPrefix.append(current.value);\n p = current;\n }\n }\n return longestPrefix.toString();\n }",
"private Affix longestCanonicalPrefix()\n\t{\n\t\tAffix currLong \t\t= this.prefixes.get(0); // longest found affix\n\t\tint currLongLength = currLong.getAffix().length();\n\n\t\tfor( int i = 1; i < prefixes.size(); i++ )\n\t\t{\n\t\t\tAffix temp = this.prefixes.get(i);\n\t\t\tint prefixLength\t= temp.getAffix().length();\n\n\t\t\tif( currLongLength < prefixLength )\n\t\t\t{\n\t\t\t\tcurrLong = temp;\n\t\t\t}\n\t\t}\n\n\t\treturn currLong;\n\t}",
"public abstract String getLongestRepeatedSubstring();",
"private String longestCommonPrefixHS(String[] strs){\n\t\tif (strs.length == 0) return \"\";\n\t\tString prefix = strs[0];\n\t\tfor (int i = 1; i < strs.length; i++){\n\t\t\twhile (strs[i].indexOf(prefix) != 0) {\n\t\t\t\tprefix = prefix.substring(0, prefix.length() - 1);\n\t\t\t\tif (prefix.isEmpty()) return \"\";\n\t\t\t}\n\t\t}\n\t\treturn prefix;\n\t}",
"public String bestMatch(String prefix) {\n\t\tif(prefix != null){\n\t\t\tfor(int i = 0; i < data.getRawList().size();i++){\n\t\t\t\tif(data.getRawList().get(i).getWord().startsWith(prefix)){\n\t\t\t\t\treturn data.getRawList().get(i).getWord();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public Route longestPrefixMatch(IpAddress ip) {\n Iterable<Route> prefixes =\n routeTable.getValuesForKeysPrefixing(RouteTools.createBinaryString(ip.toIpPrefix()));\n\n Iterator<Route> it = prefixes.iterator();\n\n Route route = null;\n while (it.hasNext()) {\n route = it.next();\n }\n\n return route;\n }",
"public static String longestCommonPrefix(List<String> a) {\n if (a.isEmpty()) {\n return \"\";\n }\n\n int size = a.size();\n String first = a.get(0);\n if (size == 1)\n return first;\n\n /* sort the array of strings */\n a.sort(String::compareTo);\n\n /* find the minimum length from first and last string */\n int end = Math.min(first.length(), a.get(size - 1).length());\n\n /* find the common prefix between the first and\n last string */\n int i = 0;\n while (i < end && first.charAt(i) == a.get(size - 1).charAt(i))\n i++;\n\n return first.substring(0, i);\n }",
"public Alphabet getShiftableSymbolName() {\n\t\tif (0 <= marker && marker < getRhs().length) {\n\t\t\treturn getRhs()[marker];\n\t\t}\n\t\treturn null;\n\t}",
"public String getFirstLongestConcatenatedWord() {\n return concatenatedWords.get(0);\n }",
"public String getLongestEncoding() {\n EncodeData longest = encodings[0]; //Set longest to the first encoding\n for (int i = 1; i < encodings.length; i++) { //Loop through the encodings\n //If the encoding at index is longer than the longest encoding's length\n if(longest.encode.length() < encodings[i].encode.length()) {\n //Set longest to the new encoding\n longest = encodings[i];\n }\n }\n //Return the longest's symbol and encoding\n return longest.symbol + \" = \" + longest.encode;\n }",
"public String longestCommonPrefix(String[] strs) {\n if (strs == null || strs.length == 0) return \"\";\n for (int i = 0; i < strs[0].length() ; i++){\n char c = strs[0].charAt(i);\n for (int j = 1; j < strs.length; j ++) {\n if (i == strs[j].length() || strs[j].charAt(i) != c)\n return strs[0].substring(0, i); \n }\n }\n return strs[0];\n}",
"public static String longestCommonPrefix(String[] strs) {\n \tif(strs==null){\n \t\treturn null;\n \t}\n \tif(strs.length==0){\n \t\treturn \"\";\n \t}\n \tint prefix_count=strs[0].length();\n \tchar[] s=strs[0].toCharArray();\n \tfor(int i=1;i<strs.length;i++){\n \t\tchar[] str=strs[i].toCharArray();\n \t\tint count=0;\n \t\twhile (count<str.length && count<prefix_count){\n \t\t\tif(str[count]!=s[count]){\n \t\t\t\tbreak;\n \t\t\t}\n \t\t\telse{\n \t\t\t\tcount++;\n \t\t\t}\n \t\t}\n \t\tprefix_count=count;\n \t}\n \treturn strs[0].substring(0, prefix_count);\n }",
"private static String longestCommonPrefix(String[] strs) {\n\t\tif (strs == null || strs.length == 0) {\n\t\t\treturn \"\";\n\t\t}\n\t\tint minLen = Integer.MAX_VALUE;\n\t\tfor (String str : strs) {\n\t\t\tif (minLen > str.length()) {\n\t\t\t\tminLen = str.length();\n\t\t\t}\n\t\t}\n\t\tif (minLen == 0) {\n\t\t\treturn \"\";\n\t\t}\n\t\tfor (int j = 0; j < minLen; j++) {\n\t\t\tchar prev = '0';\n\t\t\tfor (int i = 0; i < strs.length; i++) {\n\t\t\t\tif (i == 0) {\n\t\t\t\t\tprev = strs[i].charAt(j);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (prev != strs[i].charAt(j)) {\n\t\t\t\t\treturn strs[i].substring(0, j);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn strs[0].substring(0, minLen);\n\t}",
"@Override\n public String getLocalKey() {\n if (prefixComponentIndex < prefix.size())\n return prefix.get(prefixComponentIndex);\n else\n return null;\n }",
"public String longestCommonPrefix(String[] strs) {\n if (strs == null && strs.length == 0) {\n return \"\";\n }\n\n String prefix = strs[0];\n\n for (int i = 1; i < strs.length; i++) {\n while (strs[i].indexOf(prefix) != 0) {\n prefix = prefix.substring(0, prefix.length() - 1);\n if (prefix.isEmpty()) {\n return \"\";\n }\n }\n }\n\n return prefix;\n }",
"private String longestCommonPrefixVS(String[] strs){\n\t\tif (strs == null || strs.length == 0) return \"\";\n\t\t for (int i = 0; i < strs[0].length() ; i++){\n\t\t char c = strs[0].charAt(i);\n\t\t for (int j = 1; j < strs.length; j ++) {\n\t\t if (i == strs[j].length() || strs[j].charAt(i) != c)\n\t\t return strs[0].substring(0, i);\n\t\t }\n\t\t }\n\t\t return strs[0];\n\t}",
"public int longestRod ();",
"java.util.Optional<String> getPrefix();",
"public String longestCommonPrefix(String[] strs) {\n\n\t\tif (strs.length == 0)\n\t\t\treturn \"\";\n\n\t\tString prefix = strs[0];\n\t\tfor (int i = 1; i < strs.length; i++)\n\t\t\twhile (strs[i].indexOf(prefix) != 0) {\n\t\t\t\tprefix = prefix.substring(0, prefix.length() - 1);\n\t\t\t\tif (prefix.isEmpty())\n\t\t\t\t\treturn \"\";\n\t\t\t}\n\t\treturn prefix;\n\t}",
"public String longestCommonPrefix1(String[] strs) {\n if (null == strs || strs.length == 0) return \"\";\n\n String pre = strs[0]; //Take the first String as pre\n for (int i = 1; i < strs.length; i++) {\n /**\n * \"indexOf\"\n * This means pre is not the prefix in current string,\n * hence, shorten it by one and continue\n */\n while (strs[i].indexOf(pre) != 0) {\n pre = pre.substring(0, pre.length() - 1);\n if (pre.isEmpty()) {\n return \"\";\n }\n }\n }\n\n return pre;\n }",
"private Node findLastNodeOf(String prefix){\n if(prefix == null) return null;\n\n var current = root;\n // loop over all the ch in this preix String\n for(var ch: prefix.toCharArray()){\n //get the current node for this character\n var child = current.getChild(ch);\n if(child == null) return null; // no any prefix word i Trie\n current = child; // otherwise set current to this child\n }\n return current; // last node of prefix\n }",
"private int longestCanonicalPrefixLength()\n\t{\n\t\tAffix currLong; //= this.longestCanonicalPrefix();\n\n\t\tint length;\n\n\t\tif( prefixes.size() < 1 ) {\n\t\t\tlength = 0;\n\t\t} else {\n\t\t\tcurrLong = this.longestCanonicalPrefix();\n\t\t\tlength = currLong.getAffix().length();\n\t\t}\n\n\t\treturn length;\n\t}",
"public static String findPalliondrom(String str){\n if(str==null || \"\".equals(str)){\n return \"\";\n }\n String longestP = str.substring(0);\n\n\n\n return longestP;\n }",
"@Override\n public String longestWord() {\n return \"\";\n }",
"@Override\n public String longestPrefixOf(String key) {\n throw new UnsupportedOperationException();\n }",
"public String longestCommonPrefix(String[] strs) {\n \n\t\tif(strs==null || strs.length==0||strs[0].length()==0)\n\t\t\treturn \"\";\n\t\t\n \tfor (int j = 0; j < strs[0].length(); j++) {\n \t\t\tfor (int i = 1; i < strs.length; i++) {\n\t\t\t\tif (j >= strs[i].length()) \n\t\t\t\t\treturn strs[0].substring(0, strs[i].length());\n\t\t\t\tif (strs[i].charAt(j) != strs[0].charAt(j))\n \t\t\treturn strs[0].substring(0, j);\n\t\t\t}\n\t\t}\n\t\treturn strs[0];\n \t}",
"public String getMaxKey() {\n return dll.tail.prev == dll.head ? \"\" : (String) dll.tail.prev.keySet.iterator().next();\n }",
"public String longestCommonPrefix(String[] strs) {\n\t\tif (strs == null || strs.length == 0)\n\t\t\treturn \"\";\n\t\tint minLen = Integer.MAX_VALUE;\n\t\tfor (String str : strs)\n\t\t\tminLen = Math.min(minLen, str.length());\n\t\tint low = 1;\n\t\tint high = minLen;\n\t\twhile (low <= high) {\n\t\t\tint middle = (low + high) / 2;\n\t\t\tif (isCommonPrefix(strs, middle))\n\t\t\t\tlow = middle + 1;\n\t\t\telse\n\t\t\t\thigh = middle - 1;\n\t\t}\n\t\treturn strs[0].substring(0, (low + high) / 2);\n\t}",
"protected abstract int findMax(final String prefix);",
"public String longestCommonPrefix(String[] strs) {\n\t\tif(strs.length == 0) return \"\";\n\t\tString min = strs[0];\n\t\tfor(int i =0 ; i< strs.length; i++){\n\t\t\tif(min.length() > strs[i].length()) min = strs[i];\n\t\t}\n\t\t\n\t\tint x = 0;\n\t\t\n\t\t\twhile(x < min.length()){\n\t\t\t\tfor(String s: strs){\n\t\t\t\t\tif(min.equals(s)) continue;\n\t\t\t\t\telse if(s.charAt(x) != min.charAt(x)) return s.substring(0,x);\n\t\t\t}\n\t\t\t\tx++;\n\t\t}\n\t\treturn min.substring(0,x);\n\t}",
"public String getBestMatch(String stem) {\n if (stem == null || stem.length() == 0)\n return null;\n Trie root = find(stem);\n if (root == null)\n return null;\n return root.findBest().item;\n }",
"public String getNextQuery() {\n\t\t return queryQueue.poll();\n\t }",
"public static String longestCommonPrefix(String a, String b){\r\n int l = Math.min(a.length(), b.length());\r\n for (int i = 0; i < l; i++){\r\n if (a.charAt(i) != b.charAt(i))\r\n return a.substring(0,i);\r\n }\r\n return a.substring(0,l);\r\n }",
"public String getMinKey() {\n\t\tif(map.isEmpty()){\n\t\t\treturn \"\";\n\t\t}\n\t\treturn tail.prev.key;\n\t}",
"public String getMinKey() {\n return dll.head.next == dll.tail ? \"\" : (String) dll.head.next.keySet.iterator().next();\n }",
"public String longestCommonPrefix_solution1(String[] strs) {\n if (strs.length == 0)\n return \"\";\n\n String prefix = strs[0];\n for (int i = 0; i < strs.length; i++) {\n while (strs[i].indexOf(prefix) != 0) {\n prefix = prefix.substring(0, prefix.length() - 1); // String.substring: 左闭右开[left inclusive, right exclusive]\n if (prefix.isEmpty())\n return \"\";\n }\n }\n return prefix;\n }",
"public String getMaxKey();",
"public String getMaxKey() {\n\t\tif(map.isEmpty()){\n\t\t\treturn \"\";\n\t\t}\n\t\treturn head.next.key;\n\t}",
"@Nullable\n String getMatch() {\n if (getAnchorType() == STRING_LITERAL || getAnchorType() == CHAR_LITERAL) {\n // Remove quotes inserted by parboiled for completion suggestions\n String fullToken = _anchor.getLabel();\n if (fullToken.length() >= 2) { // remove surrounding quotes\n fullToken = fullToken.substring(1, fullToken.length() - 1);\n }\n return fullToken;\n }\n return null;\n }",
"public String getHighestChromKey();",
"public String longestCommonPrefixApproach2(String[] strs) {\n\t\tif (strs == null || strs.length == 0) return \"\";\n\t\tfor (int i = 0; i < strs[0].length() ; i++){\n\t\t\tchar c = strs[0].charAt(i);\n\t\t\tfor (int j = 1; j < strs.length; j ++) {\n\t\t\t\tif (i == strs[j].length() || strs[j].charAt(i) != c)\n\t\t\t\t\treturn strs[0].substring(0, i); \n\t\t\t}\n\t\t}\n\t\treturn strs[0];\n\t}",
"public String getGoodWordStartingWith(String s) {\n Random random = new Random();\n String x = s;\n TrieNode temp = searchNode(s);\n if (temp == null){\n return \"noWord\";\n }\n // get a random word\n ArrayList<String> charsNoWord = new ArrayList<>();\n ArrayList<String> charsWord = new ArrayList<>();\n String c;\n\n while (true){\n charsNoWord.clear();\n charsWord.clear();\n for (String ch: temp.children.keySet()){\n if (temp.children.get(ch).isWord){\n charsWord.add(ch);\n } else {\n charsNoWord.add(ch);\n }\n }\n System.out.println(\"------>\"+charsNoWord+\" \"+charsWord);\n if (charsNoWord.size() == 0){\n if(charsWord.size() == 0){\n return \"sameAsPrefix\";\n }\n s += charsWord.get( random.nextInt(charsWord.size()) );\n break;\n } else {\n c = charsNoWord.get( random.nextInt(charsNoWord.size()) );\n s += c;\n temp = temp.children.get(c);\n }\n }\n if(x.equals(s)){\n return \"sameAsPrefix\";\n }else{\n return s;\n }\n }",
"public String getShortestEncoding() {\n EncodeData shortest = encodings[0]; //Set shortest to the first encoding\n for (int i = 1; i < encodings.length; i++) { //Loop through the encodings\n //If the encoding at index is shorter than the shortest encoding's length\n if(shortest.encode.length() > encodings[i].encode.length()) {\n //Set shortest to the new encoding\n shortest = encodings[i];\n }\n }\n //Return the shortest's symbol and encoding\n return shortest.symbol + \" = \" + shortest.encode;\n }",
"public String prefix() {\n return string.substring(0, string.length() - 1);\n }",
"public String longestCommonPrefix_solution2(String[] strs) {\n if (strs == null || strs.length == 0) return \"\";\n for (int i = 0; i < strs[0].length() ; i++){\n char c = strs[0].charAt(i);\n for (int j = 1; j < strs.length; j ++) {\n if (i == strs[j].length() || strs[j].charAt(i) != c)\n return strs[0].substring(0, i);\n }\n }\n return strs[0];\n }",
"private int prefixQuery(String prefix) {\n if (curr == null)\n curr = track(dict, prefix);\n else\n curr = track(curr.mid, prefix);\n\n if (curr == null) return 0;\n if (curr.isString) {\n if (curr.mid == null) return 1;\n else return 3;\n } else {\n if (curr.mid == null) return 0;\n return 2;\n }\n }",
"SimpleString getPrefix(SimpleString address);",
"public String getLowestChromKey();",
"public String getMinKey() {\n if (list.isEmpty()) {\n return \"\";\n }\n return v.get(list.getLast()).iterator().next();\n }",
"public String getBestIdentifier(ITopic t, boolean withPrefix) {\r\n\t\tif (bestIdentifiers == null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn bestIdentifiers.get(new BestIdentifierKey(t, withPrefix));\r\n\t}",
"@VisibleForTesting\n static @Nullable String findLastSearchTerm(Tab tab) {\n if (sLastSearchTermProviderForTesting != null) {\n return sLastSearchTermProviderForTesting.getLastSearchTerm(tab);\n }\n assert tab.getWebContents() != null;\n NavigationController controller = tab.getWebContents().getNavigationController();\n NavigationHistory history = controller.getNavigationHistory();\n\n Profile profile = Profile.fromWebContents(tab.getWebContents());\n if (profile == null) return null;\n\n TemplateUrlService templateUrlService = TemplateUrlServiceFactory.getForProfile(profile);\n if (!TextUtils.isEmpty(templateUrlService.getSearchQueryForUrl(tab.getUrl()))) {\n // If we are already at a search result page, do not show the last search term.\n return null;\n }\n\n for (int i = history.getCurrentEntryIndex() - 1; i >= 0; i--) {\n GURL url = history.getEntryAtIndex(i).getOriginalUrl();\n String query = templateUrlService.getSearchQueryForUrl(url);\n if (!TextUtils.isEmpty(query)) {\n return removeEscapedCodePoints(query);\n }\n }\n return null;\n }",
"int getStrLngth(String name){\r\n int l= name.length();\r\n return l;}",
"public static int LongestName () {\n int result = 0;\r\n\r\n // LOOP THROUGH THE PLAYERS\r\n for (int i = 0; i < player_count; i++) {\r\n // DID WE FIND A LONGER NAME?\r\n if (player[i].GetName().length() > result)\r\n result = player[i].GetName().length();\r\n }\r\n\r\n // RETURN THE RESULT\r\n return result;\r\n }",
"private TrieNode searchPrefix(String word) {\n\t\tTrieNode node = root;\n\t\tfor (char c: word.toCharArray()) {\n\t\t\tif (node.containsKey(c)) {\n\t\t\t\tnode = node.get(c);\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\treturn node;\n\t}",
"HasValue<String> getMiddleInitial();",
"public static String longestCommonPrefix(String[] strs) {\n\n if (strs == null || strs.length == 0) {\n return \"\" ;\n }\n String longestPrefix=\"\";\n int index=0;\n for (String str : strs) {\n if (str == null || str.length()==0) {\n return \"\";\n }\n if (index == 0) {\n longestPrefix = str ;\n index++;\n continue;\n }\n longestPrefix = findCommonPreFix(longestPrefix,str);\n index ++;\n }\n return longestPrefix ;\n }",
"public String getStrainPrefix(Db db)\n\t{\n\t\tString prefix = dbHelper.getDbValue(\"exec spMet_getStrainPrefix '\" \n\t\t\t\t+ getStrainType() + \"'\", db);\n\t\tString suffix = dbHelper.getDbValue(\"exec spMet_getIDSuffix\", db);\n\t\tif(WtUtils.isNullOrBlank(suffix))\n\t\t\tsuffix = \"\";\n\t\telse\n\t\t\tsuffix = suffix + \"-\";\n\t\treturn prefix + \"-\" + suffix;\n\t}",
"@Override\n public String longestWord() {\n if (this.word.length() > this.restOfSentence.longestWord().length()) {\n return this.word;\n }\n return this.restOfSentence.longestWord();\n }",
"@Override\n\tpublic String getPreferredPrefix(String namespaceUri, String suggestion, boolean requirePrefix) {\n\t\treturn namespaceMap.getOrDefault(namespaceUri, suggestion);\n\t}",
"public String longestCommonPrefix3(String[] strs) {\n if (strs == null || strs.length == 0) {\n return \"\";\n }\n\n return longestCommonPrefix(strs, 0, strs.length - 1);\n }",
"public String getMaxKey() {\n if (list.isEmpty()) {\n return \"\";\n }\n return v.get(list.getFirst()).iterator().next();\n }",
"static int computeTheLongestSubstringWithMatchingParens(String string) {\n Deque<Integer> stack = new ArrayDeque<>();\n\n int length = 0;\n int endIndex = -1;\n\n for (int i = 0; i < string.length(); i++) {\n if (string.charAt(i) == '(') stack.push(i);\n else {\n if (stack.isEmpty()) {\n endIndex = i;\n } else {\n stack.pop();\n\n int start = stack.isEmpty() ? endIndex : stack.peek();\n length = Math.max(length, i - start);\n }\n }\n }\n\n return length;\n }",
"public String peek()\n\t{\n\t\tString firstVal;\n\t\tfirstVal = q.peekFirst();\n\t\treturn firstVal;\n\t}",
"public int longestValidParenthesis(String s) {\n int maxLength = 0, end = -1;\n Deque<Integer> leftParenthesis = new LinkedList<>();\n for (int i = 0; i < s.length(); i++) {\n if (s.charAt(i) == '(') {\n leftParenthesis.addFirst(i);\n } else if (leftParenthesis.isEmpty()) {\n end = i;\n } else {\n leftParenthesis.removeFirst();\n int start = leftParenthesis.isEmpty() ? end : leftParenthesis.peekFirst();\n maxLength = Math.max(maxLength, i - start);\n }\n }\n return maxLength;\n }",
"public int longestValidParentheses(String s) {\n\t\tint max_len = 0, last = -1; \n\t\t// keep track of the positions of non-matching '('s\n\t\tStack<Integer> lefts = new Stack<Integer>(); \n\t\tfor (int i = 0; i < s.length(); ++i) {\n\t\t\tif (s.charAt(i) == '(') {\n\t\t\t\tlefts.push(i);\n\t\t\t} else {\n\t\t\t\tif (lefts.empty()) {\n\t\t\t\t\t// no matching left\n\t\t\t\t\tlast = i;\n\t\t\t\t} else {\n\t\t\t\t\t// find a matching pair\n\t\t\t\t\tlefts.pop();\n\t\t\t\t\tif (lefts.empty()) {\n\t\t\t\t\t\tmax_len = Math.max(max_len, i - last);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmax_len = Math.max(max_len, i - lefts.peek());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn max_len;\n\t}",
"public static String lastTerm(String input)\n {\n assert isNonBlank(input);\n int dotx = input.lastIndexOf('.');\n \n if (dotx < 0)\n return input;\n \n return input.substring(dotx + 1);\n }",
"int getMaxStringLiteralSize();",
"public static String longestRepeatedSubstring(String s){\r\n int N = s.length();\r\n String[] suffixes = new String[N];\r\n \r\n for (int i = 0; i < N; i++)\r\n suffixes[i] = s.substring(i, N);\r\n \r\n /* bring subffixes with common prefix together. */\r\n Arrays.sort(suffixes);\r\n \r\n /* compare the adjacent suffixes. */\r\n String longest = \"\";\r\n for (int i = 0; i < suffixes.length - 1; i++){\r\n String common = longestCommonPrefix(suffixes[i], suffixes[i+1]);\r\n if (common.length() > longest.length())\r\n longest = common;\r\n }\r\n \r\n return longest;\r\n }",
"public final int getPrefixIndex(String prefix) {\n if (m_extensionPrefixes != null) {\n for (int i = m_extensionPrefixes.length-1; i >= 0; i--) {\n String[] prefixes = m_extensionPrefixes[i];\n for (int j = prefixes.length-1; j >= 0; j--) {\n if (prefix.equals(prefixes[j])) {\n int index = j + m_prefixes.length;\n for (int k = i-1; k >= 0; k--) {\n index += m_extensionPrefixes[k].length;\n }\n return index;\n }\n }\n }\n }\n if (m_translateTable == null) {\n for (int i = m_prefixes.length-1; i >= 0; i--) {\n if (prefix.equals(m_prefixes[i])) {\n return i;\n }\n }\n } else {\n for (int i = m_translateTable.length-1; i >= 0; i--) {\n int xlate = m_translateTable[i];\n if (prefix.equals(m_prefixes[xlate])) {\n return xlate;\n }\n }\n }\n return -1;\n }",
"public static Object findLongestWord(List<String> words) {\n\t\tint longString = 0;\n\t\tString s= \"\";\n\t\tfor (int i = 0; i < words.size(); i++) {\n\t\t\tif (words.get(i).length()>longString) {\n\t\t\tlongString=words.get(i).length();\n\t\t\t\n\t\t\ts = words.get(i);\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\treturn s;\n\t\t//return null;\n\t}",
"public String getLexEntry(String word)\n {\n boolean found = false;\n String buff = \"\";\n String rtn = \"\";\n\n lastCount = 0.0;\n if(word.length() > 0)\n {\n buff = compactNumbers(word);\n rtn = searchLexDb(buff, true);\n if(rtn.length() > 0)\n found = true;\n\n else // try the lowercase version\n {\n buff = buff.toLowerCase();\n rtn = searchLexDb(buff, true);\n if(rtn.length() > 0)\n found = true;\n } // else\n } // fi\n\n // If not found, get the search string corresponding to the word.\n\n if(!found)\n {\n buff = searchString(word);\n\n while(!found && (buff.length() > 0))\n {\n rtn = searchLexDb(buff, false);\n if(rtn.length() > 0)\n found = true;\n else\n buff = buff.substring(1);\n } // while\n } // fi\n\n if(!found)\n System.out.println(\"word: #\" + word + \"# lex entry not found\");\n\n return(rtn.toString());\n }",
"String getFirstIndex();",
"public long distinctSubstring() {\n long ans = 1;\n int n = rank.length;\n for (int i = 0; i < n; i++) {\n long len = n - i;\n if (rank[i] < n - 1) {\n len -= lcp[rank[i]];\n }\n ans += len;\n }\n return ans;\n }",
"public static int longestValidParentheses_best(String s) {\n if (s == null || s.length() <= 1) {\n return 0;\n }\n\n int len = s.length();\n int max = 0;\n int left = 0;\n int right = 0;\n for (int i = 0; i < len; i++) {\n if (s.charAt(i) == '(') {\n left++;\n } else {\n right++;\n }\n\n if (left == right) {\n max = Math.max(max, 2 * left);\n } else if (right > left) {\n left = right = 0;\n }\n }\n\n left = right = 0;\n for (int i = len - 1; i >= 0; i--) {\n if (s.charAt(i) == '(') {\n left++;\n } else {\n right++;\n }\n\n if (left == right) {\n max = Math.max(max, 2 * right);\n } else if (left > right) {\n left = right = 0;\n }\n }\n\n return max;\n }",
"public String getMaxKey() {\n if (map.size() == 0)\n return \"\";\n return maxKey;\n }",
"String getPrefix();",
"String getPrefix();",
"String getPrefix();",
"String getPrefix();",
"public String getSecondLongestConcatenatedWord() {\n return concatenatedWords.get(1);\n }",
"public int numberOfMatches(String prefix) {\r\n if (prefix == null) {\r\n throw new java.lang.NullPointerException();\r\n }\r\n Term temp = new Term(prefix, 0);\r\n int x = BinarySearchDeluxe.firstIndexOf(queries, temporary, Term.byPrefixOrder(prefix.length()));\r\n int y = BinarySearchDeluxe.lastIndexOf(queries, temporary, Term.byPrefixOrder(prefix.length()));\r\n return y - x + 1;\r\n }",
"public String getSuffixOrPrefix()\r\n\t{\r\n\t\treturn suffixOrPrefix;\r\n\t}",
"public String getLhsName() {\n Xnode lhs = getLhs();\n if(lhs != null) {\n return (lhs.opcode() == Xcode.VAR) ? lhs.value() :\n lhs.matchSeq(Xcode.VAR_REF, Xcode.VAR).value();\n }\n return \"\";\n }",
"public String top() {\n return queue.size() == 0 ? null : queue.get(0);\n }",
"public static String getLongestSubSeq(String s1, String s2) {\n if (s1 == null || s2 == null) {\n return null;\n }\n Set<String> set1 = getAllSubSeq(s1);\n Set<String> set2 = getAllSubSeq(s2);\n if (set1 == null || set2 == null || set1.size() == 0 || set2.size() == 0) {\n return null;\n }\n\n String longest = \"\";\n for (String s : set1) {\n if (s.length() > longest.length() && set2.contains(s)) {\n longest = s;\n }\n }\n\n return longest.length() > 0 ? longest : null;\n }",
"public int getLongestRepeatedSubstringLength()\r\n {\r\n return maxLength;\r\n }",
"public static String lastWord(Scanner s){\n\t\t\n\t\t//assume the first string in list is the last word to be returned.\n\t\tString lastString = s.next();\n\t\t\n\t\twhile(s.hasNext()){\n\t\t\t\n\t\t\tString temp = s.next();\n\t\t\t\n\t\t\t//Check to see if if this words come after the current last word if so store that string in lastString\n\t\t\tif(temp.compareToIgnoreCase(lastString) >= 1){\n\t\t\t\tlastString = temp;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn lastString;\n\t}",
"public String getMinKey() {\n if (map.size() == 0)\n return \"\";\n return minKey;\n }",
"public static String lrs(String s) {\n\n // form the N suffixes\n int N = s.length();\n String[] suffixes = new String[N];\n for (int i = 0; i < N; i++) {\n suffixes[i] = s.substring(i, N);\n }\n\n // sort them\n Arrays.sort(suffixes);\n\n // find longest repeated substring by comparing adjacent sorted suffixes\n String lrs = \"\";\n for (int i = 0; i < N - 1; i++) {\n String x = lcp(suffixes[i], suffixes[i+1]);\n if (x.length() > lrs.length())\n lrs = x;\n }\n return lrs;\n }",
"private String longestCommonPrefix(String[] strs, int left, int right) {\n if (left == right) {\n return strs[left];\n } else {\n int mid = left + (right - left) / 2;\n String leftPrefix = longestCommonPrefix(strs, left, mid);\n String rightPrefix = longestCommonPrefix(strs, mid + 1, right);\n return commonPrefix(leftPrefix, rightPrefix);\n }\n }",
"public Key max() {\n if (isEmpty()) throw new NoSuchElementException(\"called max() with empty symbol table\");\n return max(root).key;\n }",
"public String nextIdentifier()\n {\n int end = scanForIdentifier();\n if (end == position)\n return null;\n String result = input.substring(position, end);\n position = end;\n return result;\n }",
"public abstract void createLongestRepeatedSubstring();",
"public int longestValidParenthesesDP(String s) {\n int n = s.length();\n int maxLength = 0;\n int DP[] = new int[n + 1];\n\n for (int i = 1; i <= n; i++) {\n char c = s.charAt(i - 1);\n int j = i - 2 - DP[i - 1];\n if (c == '(' || j < 0 || s.charAt(j) == ')') {\n DP[i] = 0;\n } else {\n DP[i] = 2 + DP[i - 1] + DP[j];\n maxLength = Math.max(maxLength, DP[i]);\n }\n }\n\n return maxLength;\n }",
"String getTopTrailClause(int top);",
"public static int longestValidParentheses_bf_opt(String s) {\n if (s == null || s.length() <= 1) {\n return 0;\n }\n\n int len = s.length();\n int max = 0;\n for (int i = 0; i < len; i++) {\n if (s.charAt(i) == ')') {\n continue;\n }\n\n int count = 0;\n\n for (int j = i; j < len; j++) {\n if (s.charAt(j) == '(') {\n count++;\n } else {\n count--;\n }\n\n if (count < 0) {\n break;\n }\n\n if (count == 0) {\n max = Math.max(max, j - i + 1);\n }\n }\n }\n\n return max;\n }",
"public static String shortestWord(Scanner s){\n\t\t\n\t\t//assume the first word is shortest\n\t\tString shortest = s.next();\n\t\t\n\t\twhile(s.hasNext()){\n\t\t\t\n\t\t\tString temp = s.next();\n\t\t\t\n\t\t\t//check to see if 'temp' is shorter than the current shortest string\n\t\t\tif ( temp.length()< shortest.length()){\n\t\t\t\tshortest = temp;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn shortest;\n\t}",
"public int longestValidParentheses(String s) {\n Stack<Integer> stack = new Stack<>();\n int start = 0;\n int maxLength = 0;\n for (int i = 0; i < s.length(); i++) {\n char c = s.charAt(i);\n if (c == '(') {\n stack.push(i);\n } else if (c == ')') {\n if (stack.empty()) {\n start = i + 1;\n } else {\n stack.pop();\n maxLength = stack.empty() ? Math.max(maxLength, i - start + 1) : Math.max(maxLength, i - stack.peek());\n }\n }\n }\n\n return maxLength;\n }",
"public String getAlternativeOrderNumberPrefix();"
] | [
"0.6186878",
"0.6068071",
"0.5976056",
"0.5818931",
"0.57407624",
"0.5719335",
"0.5716896",
"0.55427414",
"0.5535618",
"0.55071217",
"0.5479694",
"0.54464674",
"0.5436061",
"0.54265547",
"0.5362499",
"0.5361116",
"0.53477544",
"0.5341599",
"0.5330166",
"0.5328495",
"0.53271765",
"0.5315164",
"0.5290285",
"0.52880657",
"0.52747196",
"0.52262175",
"0.5216586",
"0.520858",
"0.5182353",
"0.5159264",
"0.5153755",
"0.51351345",
"0.5132148",
"0.5128491",
"0.5086763",
"0.5071123",
"0.50649685",
"0.505548",
"0.5054155",
"0.50391465",
"0.5019806",
"0.49953732",
"0.49848437",
"0.49672914",
"0.4936576",
"0.49304482",
"0.4900391",
"0.48896435",
"0.48879513",
"0.48876825",
"0.4882579",
"0.4866317",
"0.4855904",
"0.4850826",
"0.4836279",
"0.48358253",
"0.48138478",
"0.4803025",
"0.4798663",
"0.47934583",
"0.47923338",
"0.47759295",
"0.47683477",
"0.47553653",
"0.47519302",
"0.47475392",
"0.47443146",
"0.47385368",
"0.47331557",
"0.47260424",
"0.4724859",
"0.47069144",
"0.46953017",
"0.4678968",
"0.46589556",
"0.46476087",
"0.46442118",
"0.46442118",
"0.46442118",
"0.46442118",
"0.46325696",
"0.4612708",
"0.46065047",
"0.4597214",
"0.45882776",
"0.45826954",
"0.45796534",
"0.45758882",
"0.4568549",
"0.45674288",
"0.45641822",
"0.45622206",
"0.4559846",
"0.4555671",
"0.45529652",
"0.45494193",
"0.45463136",
"0.45410407",
"0.45322156",
"0.45276812"
] | 0.7357245 | 0 |
Returns all of the keys in the set that start with prefix. | public Iterable<String> keysWithPrefix(String prefix)
{
Queue<String> q = new Queue<String>();
Node x;
if (prefix.equals("")) {
if (null_str_val != null) q.enqueue("");
x = root;
} else x = get(root, prefix, 0).mid;
collect(x, prefix, q);
return q;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Iterable<String> getKeys(String keyPrefix);",
"@Override\n public List<String> keysWithPrefix(String prefix) {\n List<String> results = new ArrayList<>();\n Node x = get(root, prefix, 0);\n collect(x, new StringBuilder(prefix), results);\n return results;\n }",
"public static Iterator getKeysMatching(String inKeyPrefix) {\r\n HashSet matchingKeys = new HashSet();\r\n for (Iterator i = getProperties().keySet().iterator(); i.hasNext(); ) {\r\n String key = (String) i.next();\r\n if (key.startsWith(inKeyPrefix)) {\r\n matchingKeys.add(key);\r\n }\r\n }\r\n return matchingKeys.iterator();\r\n }",
"public Iterable<String> keysWithPrefix(String pre) {\n LinkedList<String> q = new LinkedList<String>();\n Node x = get(root, pre, 0);\n collect(x, pre, q);\n return q;\n }",
"@Override\n public List<String> keysWithPrefix(String prefix) {\n if (prefix == null || prefix.length() == 0 || root == null) {\n throw new NoSuchElementException();\n }\n List<String> result = new ArrayList<>();\n Node p = root;\n // Get to the branch with such a prefix\n for (int i = 0; i < prefix.length(); i++) {\n Node childNode = p.next.get((prefix.charAt(i)));\n if (childNode == null) {\n throw new NoSuchElementException();\n } else {\n p = childNode;\n }\n }\n // P is now at the branch, scan every branch of p to get the list of words\n if (p.isKey) {\n result.add(prefix);\n }\n for (Node i : p.next.values()) {\n if (i != null) {\n keysWithPrefix(result, prefix, i);\n }\n }\n return result;\n }",
"Set<K> keys();",
"public Iterable<String> keys()\r\n { return keysWithPrefix(\"\"); }",
"public Iterable<String> keys() { return keysWithPrefix(\"\"); }",
"Set<String> getKeys();",
"public boolean startsWith(String prefix) {\n TrieNode node = search(root, prefix, 0);\n\t\treturn hasKey(node);\n }",
"Set<String> getKeysMatchingPattern(String pattern);",
"public List<String> getAllWordsStartingWith(String prefix) {\n prefix = prefix.toUpperCase();\n TrieNode node = root;\n List<String> li = new ArrayList<>();\n for (int i = 0; i < prefix.length(); i++) {\n char ch = prefix.charAt(i);\n if (node.get(ch) == null) {\n return li;\n }\n node = node.get(ch);\n }\n\n dfs(node, li, prefix);\n return li;\n }",
"public boolean startsWith(String prefix) {\n TrieNode now = root;\n for(int i = 0; i < prefix.length(); i++) {\n Character c = prefix.charAt(i);\n if (!now.children.containsKey(c)) {return false;}\n now = now.children.get(c);\n }\n return true;\n}",
"public Iterator<K> keys();",
"public Iterator<K> keys();",
"public Iterable<K> keys();",
"public List<K> keys();",
"List<T> findTagsStartingWith(String prefix);",
"public boolean startsWith(String prefix) {\n Trie root = this;\n for (char c : prefix.toCharArray()) {\n if (root.next[c - 'a'] != null) {\n root = root.next[c - 'a'];\n } else {\n return false;\n }\n }\n return true;\n }",
"public Iterable<Key> keys();",
"public Iterable<Key> keys();",
"Set<K> keySet();",
"public boolean startsWith(String prefix) {\n TrieNode cur = root;\n for (int i = 0 ; i < prefix.length(); i ++) {\n char ch = prefix.charAt(i);\n if (! cur.children.containsKey(ch)) {\n // does not match\n return false;\n }\n else {\n cur = cur.children.get(ch);\n }\n }\n return true;\n }",
"public boolean startsWith(String prefix) {\n char[] chs = prefix.toCharArray();\n TreeNode cur = root;\n for (int i = 0; i < chs.length; i++) {\n int ind = chs[i] - 'a';\n if (cur.map[ind] == null) {\n return false;\n }\n cur = cur.map[ind];\n }\n return true;\n }",
"public abstract List<String> getAllKeys();",
"public boolean startsWith(String prefix) {\n char [] words=prefix.toCharArray();\n CharTree t=root;\n for (char c : words) {\n t=t.next[c-97];\n if(t==null)return false;\n }\n return true;\n }",
"List<String> getKeys();",
"public LinkedList<String> startsWith(String prefix) { \n char[] w = prefix.toCharArray(); \n TrieNode start = startsWith(root, w, 0); \n LinkedList<String> result = new LinkedList<String>(); \n StringBuilder sb = new StringBuilder(); \n constructWords(start, prefix, result, sb); \n return result; \n }",
"public KeySet getKeys();",
"public boolean startsWith(String prefix) \n\t {\n\t \tTrieNode p = root;\n\t for(int i=0; i<prefix.length(); ++i)\n\t {\n\t \tchar c = prefix.charAt(i);\n\t \tp = p.children[c-'a'];\n\t \tif(p==null)\n\t \t\treturn false;\n\t }\n\t return true;\n\t }",
"Lista<K> keySet();",
"public Set<String> keySet() {\n return map.keySet();\n }",
"StringList keys();",
"public boolean startsWith(String prefix) {\n Trie cur = this;\n int i = 0;\n while(i < prefix.length()) {\n int c = prefix.charAt(i) - 'a';\n if(cur.tries[c] == null) {\n return false;\n }\n cur = cur.tries[c];\n i++;\n }\n return true;\n }",
"@Override\r\n\tpublic Set<K> keySet() {\r\n\t\tSet<K> keySet = new HashSet<K>();\r\n\t\tfor (Object o : buckets) {\r\n\t\t\tBucket b = (Bucket) o;\r\n\t\t\tkeySet.addAll(b.keySet());\r\n\t\t}\r\n\t\treturn keySet;\r\n\t}",
"public boolean startsWith(String prefix) {\n TrieTree point = root;\n for(int i = 0; i < prefix.length(); i++){\n char ch = prefix.charAt(i);\n if(point.getChild(ch - 'a') == null) return false;\n point = point.getChild(ch - 'a');\n }\n return true;\n }",
"public boolean startsWith(String prefix) {\n if (value == null || prefix == null) {\n return false;\n }\n for (String str : value) {\n if (str.startsWith(prefix)) {\n return true;\n }\n }\n return false;\n }",
"public Set<String> keySet() {\r\n return keys.keySet();\r\n }",
"@Override\n public Set<K> keySet() {\n return keys;\n }",
"public Set<String> keySet() {\n\t\t\treturn new HashSet<String>( mMap.keySet() );\n\t\t}",
"@Override\n List<String> keys();",
"public boolean startsWith(String prefix) {\n TrieNode n = root;\n for(char c : prefix.toCharArray()) {\n if(n.children[c]==null)\n return false;\n n = n.children[c];\n }\n return true;\n }",
"Set getPrefixes();",
"@Override\n\tpublic Set<K> keySet() {\n\t\treturn keys;\n\t}",
"public boolean startsWith(String prefix) {\n char[] chars = prefix.toCharArray();\n Node theNode = root;\n for (char c : chars) {\n if (theNode.children.containsKey(c)) {\n theNode = theNode.children.get(c);\n } else {\n return false;\n }\n }\n return true;\n }",
"default Set<String> getSubkeys() {\n return Collections.emptySet();\n }",
"public boolean startsWith(String prefix) {\n int length = prefix.length();\n if(length == 0){\n return false;\n }\n\n char[] chars = prefix.toCharArray();\n\n Map<Character,Node> map = this.root.map;\n // 需要保证word的结尾是endfr\n for(int i = 0;i < length;i++){\n if(!map.containsKey(chars[i])) {\n return false;\n }\n\n map = map.get(chars[i]).map;\n }\n return true;\n }",
"public Set<K> keySet() {\n Set<K> keys = new HashSet<>();\n if (bucket.length != 0) {\n for (int i = 0; i < bucket.length; i++) {\n keys.add(bucket[i].getKey());\n }\n }\n return keys;\n }",
"@Override\n public Set<K> keySet() {\n Set<K> keySet = new HashSet<K>(size());\n for (LinkedList<Entry<K,V>> list : table) {\n for (Entry<K,V> entry : list) {\n if (entry != null) {\n keySet.add(entry.getKey());\n }\n }\n }\n return keySet;\n }",
"@Override\n public Set<K> keySet() {\n if (isEmpty()) return new HashSet<K>();\n return keys(min(), max());\n }",
"public Set<K> keySet() {\r\n\t\t\tSet<K> keySet = new HashSet<K>();\r\n\t\t\tListNode current = header;\r\n\t\t\twhile (current != null) {\r\n\t\t\t\tkeySet.add(current.key);\r\n\t\t\t\tcurrent = current.next;\r\n\t\t\t}\r\n\t\t\treturn keySet;\r\n }",
"public boolean startsWith(String prefix) {\n TrieNode curr = root;\n for (char c : prefix.toCharArray()) {\n int idx = c - 'a';\n if (curr.children[idx] == null) {\n return false;\n }\n curr = curr.children[idx];\n }\n return true;\n }",
"public Set<K> keySet() {\r\n \treturn map.keySet();\r\n }",
"public Iterable<Key> keys() {\n Queue<Key> queue = new Queue<Key>();\n for (int i = 0; i < m; i++) {\n for (Key key : st[i].keys())\n queue.enqueue(key);\n }\n return queue;\n }",
"public boolean startsWith(String prefix) {\n return searchTrie(prefix)!=null;\n }",
"public boolean startsWith(String prefix) {\n TrieNode current = root;\n for(char c : prefix.toCharArray()){\n int index = c - 'a';\n if(current.childrens[index] == null)\n return false;\n current = current.childrens[index];\n }\n return true;\n }",
"@Override\n public boolean startsWith(final String prefix) {\n final TrieNode p = searchNode(prefix);\n return p != null;\n }",
"public String getStartsWith() {\n\t\treturn startsWith;\n\t}",
"public boolean startsWith(String prefix) {\n TrieNode p = root;\n for (char c : prefix.toCharArray()) {\n int childIndex = (int)(c - 'a');\n if(p.children[childIndex] == null) {\n return false;\n }\n p = p.children[childIndex];\n }\n return true;\n }",
"public boolean startsWith(String prefix) {\n return searchWord(prefix, false);\n }",
"public Iterator<Key> keys() ;",
"public Iterable<K> keys() {\n Queue<K> q = new Queue<>();\n inOrder(root, q);\n return q;\n }",
"public boolean startsWith(String prefix) {\n TrieNode p = searchNode(prefix);\n if (p == null) {\n return false;\n } else {\n return true;\n }\n }",
"public Iterable<String> keysThatMatch(String pat) {\n LinkedList<String> q = new LinkedList<String>();\n collect(root, pat, \"\", q);\n return q;\n }",
"public Set<String> keySet()\n\t{\n\t\tverifyParseState();\n\t\t\n\t\treturn values.keySet();\n\t}",
"public boolean startsWith(String prefix) {\r\n return tree.startWith(prefix);\r\n }",
"public boolean startsWith(String prefix) {\n\t\tcur = root;\n\t\tfor (char c : prefix.toCharArray()) {\n\t\t\tif (cur == null)\n\t\t\t\treturn false;\n\t\t\tcur = cur.children[c - 'a'];\n\t\t}\n\t\treturn cur != null;\n\t}",
"public String[] getPropertyNames(final String inPrefix) {\n final String[] propertyNames = getPropertyNames();\n\n final String prefix = inPrefix.toLowerCase();\n\n final List<String> names = new ArrayList<>();\n for (final String propertyName : propertyNames) {\n if (propertyName.startsWith(prefix)) {\n names.add(propertyName);\n }\n }\n\n if (names.isEmpty()) {\n return null;\n }\n\n // Copy the strings from the List over to a String array.\n final String[] prefixNames = new String[names.size()];\n names.toArray(prefixNames);\n return prefixNames;\n }",
"public Set<String> regexFindKeys(String regex);",
"public boolean startsWith(String prefix) {\n TrieNode ptr = root;\n for(int i = 0;i < prefix.length();i++) {\n char c = prefix.charAt(i);\n if(ptr.child[c - 'a'] == null) {\n return false;\n }\n ptr = ptr.child[c - 'a'];\n }\n return true;\n }",
"public boolean startsWith(String prefix) {\n TrieNode node = root;\n\n // for each char in the prefix, search in the TrieNode\n for (char c: prefix.toCharArray()) {\n if (node.children[c - 'a'] == null) {\n return false;\n }\n // move the node to next layer\n node = node.children[c - 'a'];\n }\n // if we iterate to the last, return true\n return true;\n }",
"public Set<K> keySet() {\n return map.keySet();\n }",
"public boolean startsWith(String prefix) {\n char[] chars = prefix.toCharArray();\n Node node = root;\n for (char c: chars) {\n int idx = c - 'a';\n Node next = node.children[idx];\n if (next == null) return false;\n node = next;\n }\n return true;\n }",
"private Collection<String[]> findPrefixPairMatches(String unitNameWithPrefix, boolean constrainBasedOnValidUnitNames, boolean onlyFirstMatch) {\n Collection<String[]> prefixMatches = new ArrayList<>();\n\n String[] prefixMatchByValue = findPrefixMatchByValue(unitNameWithPrefix, constrainBasedOnValidUnitNames);\n if(prefixMatchByValue != NO_PREFIX_MATCH_ARRAY)\n prefixMatches.add(prefixMatchByValue);\n\n prefixMatches.addAll(findPrefixMatchesByName(unitNameWithPrefix, constrainBasedOnValidUnitNames, onlyFirstMatch));\n\n for(String[] prefixMatch:prefixMatches)\n setProperlyOrderedPrefixNamePairs(prefixMatch);\n\n return prefixMatches;\n }",
"public boolean startsWith(String prefix) {\n TrieNode tail = match(root, prefix.toCharArray(), 0);\n return tail != null;\n }",
"Collection<LocatorIF> getSubjectIdentifiersByPrefix(String prefix);",
"public boolean startsWith(String prefix) {\n if (prefix == null || prefix.length() == 0)\n return false;\n char [] letters = prefix.toCharArray();\n TrieNode node = root;\n for (int i=0; i < letters.length; i++) {\n int pos = letters[i] - 'a';\n if (node.son[pos] == null)\n return false;\n node = node.son[pos];\n }\n\n return true;\n }",
"public boolean startsWith(String prefix) {\n Node curr = root;\n for (int i = 0; i < prefix.length(); i++) {\n char c = prefix.charAt(i);\n Node subNode = curr.subNodes[c - 'a'];\n if (subNode == null) {\n return false;\n }\n curr = subNode;\n }\n return true;\n }",
"String getPrefix();",
"String getPrefix();",
"String getPrefix();",
"String getPrefix();",
"public Set<String> keySet() {\n return index.keySet();\n }",
"public boolean startsWith(String prefix) {\n/* 333 */ return this.m_str.startsWith(prefix);\n/* */ }",
"public boolean startsWith(String prefix) {\n return searchPrefix(prefix)!=null;\n }",
"public boolean startsWith(String prefix) {\n return this.root.startWith(prefix);\n \n }",
"@Override\n public Set<K> keySet() {\n Set<K> keyset = new TreeSet<>();\n Inorder(root, keyset);\n return keyset;\n }",
"public boolean startsWith(String prefix) {\n var node = searchPrefix(prefix);\n return node != null;\n }",
"private Stream<ActivationContext> contextsWithPrefix(final Object[] prefix) {\n return contexts.keySet().stream()\n .filter(ctx -> ctx.traceStartsWith(prefix));\n }",
"public boolean startsWith(XMLString prefix) {\n/* 353 */ return this.m_str.startsWith(prefix.toString());\n/* */ }",
"public boolean startWith(String prefix) {\n boolean result = true;\n char[] prefixChar = prefix.toCharArray();\n if (prefixChar.length > data.length) {\n return false;\n }\n for (int i = 0; i < prefixChar.length; i++) {\n if (prefixChar[i] != data[i]) {\n result = false;\n break;\n }\n }\n return result;\n }",
"public String getPrefix();",
"public String getPrefix();",
"Collection<String> getMappingPrefixes();",
"public native IterableIterator<K> keys();",
"public Set keyNames() {\n return new LinkedHashSet<>( asList( idName() ) );\n }",
"Collection<LocatorIF> getItemIdentifiersByPrefix(String prefix);",
"public List<String> keys()\n {\n return new ArrayList<String>(keys);\n }",
"public Iterable<Key> keys() {\n Queue<Key> queue = new Queue<Key>();\n for (Node temp = first; temp != null; temp = temp.next)\n queue.enqueue(temp.key);\n return queue;\n }",
"public Iterable<Key> Keys()\n\t{\n\t\tQueue<Key> q=new Queue<>();\n\t\tInorder(root,q);\n\t\treturn q;\n\t}"
] | [
"0.8061216",
"0.8021702",
"0.77009374",
"0.7368946",
"0.735758",
"0.70622617",
"0.69729805",
"0.69569486",
"0.6920836",
"0.6774875",
"0.6774528",
"0.67301226",
"0.6501354",
"0.6496701",
"0.6496701",
"0.6459661",
"0.64261395",
"0.63864213",
"0.6384492",
"0.6358506",
"0.6358506",
"0.6355132",
"0.6347039",
"0.6342569",
"0.633171",
"0.6327593",
"0.631627",
"0.6314405",
"0.6293721",
"0.62886566",
"0.62880045",
"0.62859136",
"0.6279986",
"0.6239995",
"0.62223",
"0.6220551",
"0.62189263",
"0.621244",
"0.620518",
"0.61948824",
"0.61905175",
"0.6179297",
"0.6156673",
"0.6155968",
"0.6153681",
"0.6153616",
"0.61458254",
"0.6142",
"0.6135505",
"0.6133322",
"0.6131863",
"0.612738",
"0.6122637",
"0.6115832",
"0.611223",
"0.6111694",
"0.61073583",
"0.6102408",
"0.610081",
"0.6096778",
"0.6084444",
"0.60745287",
"0.6069155",
"0.60667914",
"0.605064",
"0.60467815",
"0.6038496",
"0.6032699",
"0.6023966",
"0.6016354",
"0.6007912",
"0.6006622",
"0.6001477",
"0.59917057",
"0.5990794",
"0.5983549",
"0.5973637",
"0.5971297",
"0.5960284",
"0.5960284",
"0.5960284",
"0.5960284",
"0.59576666",
"0.5939697",
"0.5938426",
"0.5927964",
"0.5917358",
"0.5915125",
"0.59143054",
"0.59113663",
"0.5899454",
"0.58949536",
"0.58949536",
"0.5893325",
"0.5888555",
"0.58825535",
"0.5878276",
"0.58779997",
"0.5876718",
"0.58737004"
] | 0.7996394 | 2 |
Returns all of the keys in the symbol table that match pattern, where . symbol is rreated as a wildcard character. | public Iterable<String> keysThatMatch(String pattern)
{
Queue<String> q = new Queue<String>();
if ((pattern.equals("") || pattern.equals(".")) && null_str_val != null)
q.enqueue("");
collect(root, "", pattern, q);
return q;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Set<String> getKeysMatchingPattern(String pattern);",
"public Iterable<String> keysThatMatch(String pat) {\n LinkedList<String> q = new LinkedList<String>();\n collect(root, pat, \"\", q);\n return q;\n }",
"public List<String> getKeysByPattern(String patternKey){\n RKeys keys = redissonClient.getKeys();\n Iterable<String> foundedKeys = keys.getKeysByPattern(patternKey);\n List<String> list = new ArrayList<>();\n foundedKeys.forEach(key -> list.add(key));\n return list;\n }",
"public Set<String> regexFindKeys(String regex);",
"public Hashtable<K, V> getWildcard(String wildcard);",
"public Hashtable<K, V> getPattern(String pattern);",
"public Collection<TapKey> findAllKeys();",
"public abstract List<String> getAllKeys();",
"public Iterable<String> getKeys(String keyPrefix);",
"public Iterable<String> keys()\r\n { return keysWithPrefix(\"\"); }",
"boolean matches(String key) {\n int keyLength = key.length();\n int patternLength = pattern.length();\n boolean[][] state = new boolean[keyLength + 1][patternLength + 1];\n state[0][0] = true; // empty key matches empty pattern\n for (int i = 0; i < patternLength; i++) {\n if (pattern.charAt(i) == '*') state[0][i + 1] = state[0][i]; // whether first empty matches pattern\n }\n for (int i = 0; i < keyLength; i++) {\n for (int j = 0; j < patternLength; j++) {\n char ch = pattern.charAt(j);\n if (ch == '?' || key.charAt(i) == ch) {\n state[i + 1][j + 1] = state[i][j];\n } else if (ch == '*') {\n state[i + 1][j + 1] = state[i][j + 1] || state[i + 1][j];\n }\n }\n }\n return state[keyLength][patternLength];\n }",
"@Override\n public Map<K, ICacheElement<K, V>> getMatchingCacheElements( final String pattern )\n {\n return this.getCacheControl().getMatching( pattern );\n }",
"public List<Symbol> keys() {\n\t\tList<Table.Entry<Symbol, List<Entry<T>>>> entries = table.toList();\n\t\tCollections.sort(entries, new Comparator<Table.Entry<Symbol, List<Entry<T>>>>() {\n\t\t\tpublic int compare(Table.Entry<Symbol, List<Entry<T>>> o1, Table.Entry<Symbol, List<Entry<T>>> o2) {\n\t\t\t\tEntry<T> max1 = Collections.max(o1.value, new EntryComparator());\n\t\t\t\tEntry<T> max2 = Collections.max(o2.value, new EntryComparator());\n\t\t\t\treturn max1.index - max2.index;\n\t\t\t}\n\t\t});\n\t\t\n\t\tList<Symbol> ret = new ArrayList<Symbol>(entries.size());\n\t\tfor (Table.Entry<Symbol, List<Entry<T>>> entry : entries) {\n\t\t\tret.add(entry.key);\n\t\t}\n\t\treturn ret;\n\t}",
"public Iterable<String> keys() { return keysWithPrefix(\"\"); }",
"public Set<String> getVariablesWithin(String exp) {\r\n Set<String> all=new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);\r\n String add=null;\r\n\r\n for(StringTokenizer tkz=new StringTokenizer(exp,SYMBOLS,true); tkz.hasMoreTokens(); ) {\r\n String tkn=tkz.nextToken().trim();\r\n\r\n if (tkn.length()!=0 && Character.isLetter(tkn.charAt(0))) { add=tkn; }\r\n else if(tkn.length()==1 && tkn.charAt(0)=='(' ) { add=null; }\r\n else if(add!=null && !constants.containsKey(add) ) { all.add(add); }\r\n }\r\n if(add!=null && !constants.containsKey(add)) { all.add(add); }\r\n return all;\r\n }",
"public Iterable<Key> keys();",
"public Iterable<Key> keys();",
"@Override\r\n public Map<K, ICacheElement<K, V>> processGetMatching(final String pattern)\r\n {\r\n final Map<K, ICacheElement<K, V>> elements = new HashMap<>();\r\n Set<K> keyArray = null;\r\n storageLock.readLock().lock();\r\n try\r\n {\r\n keyArray = new HashSet<>(keyHash.keySet());\r\n }\r\n finally\r\n {\r\n storageLock.readLock().unlock();\r\n }\r\n\r\n final Set<K> matchingKeys = getKeyMatcher().getMatchingKeysFromArray(pattern, keyArray);\r\n\r\n for (final K key : matchingKeys)\r\n {\r\n final ICacheElement<K, V> element = processGet(key);\r\n if (element != null)\r\n {\r\n elements.put(key, element);\r\n }\r\n }\r\n return elements;\r\n }",
"public Iterable<String> keysWithPrefix(String prefix)\r\n {\r\n Queue<String> q = new Queue<String>();\r\n Node x;\r\n if (prefix.equals(\"\")) {\r\n if (null_str_val != null) q.enqueue(\"\");\r\n x = root;\r\n } else x = get(root, prefix, 0).mid;\r\n collect(x, prefix, q);\r\n return q;\r\n }",
"List<String> getFileSystemEntries(String path, String searchPattern) throws IOException;",
"public Collection<TapKeyColumn> findAllKeyColumns();",
"@Deprecated\n public String[] getTableNames(Pattern pattern) throws IOException {\n List<String> matched = new ArrayList<String>();\n\tDBTableDescriptor[] tables = listTables();\n\tif (tables != null) { \n\t for (DBTableDescriptor table : tables) { \n\t\tString name = table.getNameAsString();\n if (pattern.matcher(name).matches()) \n matched.add(name);\n }\n }\n return matched.toArray(new String[matched.size()]);\n }",
"public static Iterator getKeysMatching(String inKeyPrefix) {\r\n HashSet matchingKeys = new HashSet();\r\n for (Iterator i = getProperties().keySet().iterator(); i.hasNext(); ) {\r\n String key = (String) i.next();\r\n if (key.startsWith(inKeyPrefix)) {\r\n matchingKeys.add(key);\r\n }\r\n }\r\n return matchingKeys.iterator();\r\n }",
"public String[] fetchAllKeys();",
"StringList keys();",
"public static Set<Symbol> getSymbols(SymbolTable st) {\n Set<Symbol> ret = new LinkedHashSet<Symbol>();\n if (st == null) {\n return ret;\n }\n for (IDExpression key : getTable(st).keySet()) {\n if (key instanceof Identifier) {\n Symbol symbol = ((Identifier)key).getSymbol();\n if (symbol != null) {\n ret.add(symbol);\n }\n }\n }\n return ret;\n }",
"@Override\n public List<String> keysWithPrefix(String prefix) {\n List<String> results = new ArrayList<>();\n Node x = get(root, prefix, 0);\n collect(x, new StringBuilder(prefix), results);\n return results;\n }",
"private HashSet < Symbol > getUsedSymbols ()\n {\n HashSet < Symbol > symbols = new HashSet < Symbol > ();\n for ( LeafNode l : this.regexNode.getTokenNodes () )\n {\n if ( l instanceof TokenNode )\n {\n TokenNode t = ( TokenNode ) l;\n symbols.add ( new DefaultSymbol ( t.getName () ) );\n }\n }\n return symbols;\n }",
"public List<K> keys();",
"List<String> getKeys();",
"public static List<Cancion> selectAllH2(String pattern) {\n\t\tList<Cancion> result = new ArrayList();\n\n\t\ttry {\n\t\t\tmanager = Connection.connectToH2();\n\t\t\tmanager.getTransaction().begin();\n\n\t\t\tString q = \"FROM Cancion\";\n\n\t\t\tif (pattern.length() > 0) {\n\t\t\t\tq += \" WHERE nombre LIKE ?\";\n\t\t\t}\n\n\t\t\tif (pattern.length() > 0) {\n\t\t\t\tresult = manager.createQuery(\"FROM Cancion WHERE nombre LIKE '\" + pattern + \"%'\").getResultList();\n\t\t\t} else {\n\t\t\t\tresult = manager.createQuery(\"FROM Cancion\").getResultList();\n\t\t\t}\n\n\t\t\tmanager.getTransaction().commit();\n\t\t} catch (Exception ex) {\n\t\t\tSystem.out.println(ex);\n\t\t}\n\n\t\treturn result;\n\t}",
"public Iterable<K> keys();",
"@Override\n public List<String> keysWithPrefix(String prefix) {\n if (prefix == null || prefix.length() == 0 || root == null) {\n throw new NoSuchElementException();\n }\n List<String> result = new ArrayList<>();\n Node p = root;\n // Get to the branch with such a prefix\n for (int i = 0; i < prefix.length(); i++) {\n Node childNode = p.next.get((prefix.charAt(i)));\n if (childNode == null) {\n throw new NoSuchElementException();\n } else {\n p = childNode;\n }\n }\n // P is now at the branch, scan every branch of p to get the list of words\n if (p.isKey) {\n result.add(prefix);\n }\n for (Node i : p.next.values()) {\n if (i != null) {\n keysWithPrefix(result, prefix, i);\n }\n }\n return result;\n }",
"public List<NeonKey> getKeys();",
"@Override\r\n\tpublic List<String> getListByPattern(String pattern) {\n\t\treturn companyRepository.getPattern(pattern);\r\n\t}",
"public Set<Character> getExtensionKeys() {\n/* 1006 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"public Iterable<String> keysWithPrefix(String pre) {\n LinkedList<String> q = new LinkedList<String>();\n Node x = get(root, pre, 0);\n collect(x, pre, q);\n return q;\n }",
"public interface IPatternMap<K, V> {\r\n\r\n\t/**\r\n\t * return a Hashtable of the entries that matche the pattern\r\n\t * @param pattern\r\n\t * @return\r\n\t */\r\n\tpublic Hashtable<K, V> getPattern(String pattern);\r\n\t\r\n\r\n\t/**\r\n\t * return a Hashtable of the entries that match the wildcard (*)\r\n\t * @param pattern\r\n\t * @return\r\n\t */\r\n\tpublic Hashtable<K, V> getWildcard(String wildcard);\r\n\r\n\r\n\r\n}",
"public Iterator<K> keys();",
"public Iterator<K> keys();",
"public Iterator<Key> keys() ;",
"Set<String> getKeys();",
"private String regex() {\n final List<String> keys = new LinkedList<>();\n for (final String key : this.template.split(\"\\\\.\")) {\n if (key.equals(\"*\")) {\n keys.add(\"\\\\w+\");\n } else {\n keys.add(key);\n }\n }\n return String.join(\"\\\\.\", keys);\n }",
"@Override\n List<String> keys();",
"public HashMap<String, Fraction> getSymbolTable() {\n\n\t\treturn symbolTable;\n\t}",
"Set<K> keys();",
"public VariableBitString getPath(char symbol) {\r\n if(isEmpty()){\r\n throw new ArrayIndexOutOfBoundsException(\"No symbols in table\");\r\n }\r\n else {\r\n Node symbolNode = first;\r\n while(true) {\r\n if(symbolNode.symbol == symbol) {\r\n return symbolNode.path;\r\n }\r\n else if(symbolNode.next == null) {\r\n throw new NoSuchElementException(\"Symbol is not in the table\");\r\n }\r\n else {\r\n symbolNode = symbolNode.next;\r\n }\r\n }\r\n }\r\n }",
"public boolean search(String word) {\n boolean allFlag = false;\n for (Entry<String, String> entry : dataStructure.entrySet()) {\n boolean flag = true;\n String key = entry.getKey();\n if (key.equals(word)) {\n return true;\n }\n if (key.length() != word.length()) {\n return false;\n }\n\n char[] aArr = word.toCharArray();\n char[] bArr = key.toCharArray();\n for (int i = 0; i < aArr.length; i++) {\n if (aArr[i] == '.') {\n continue;\n } else {\n if (aArr[i] != bArr[i]) {\n flag = false;\n break;\n }\n }\n\n }\n if (flag) {\n return true;\n }\n }\n return allFlag;\n }",
"List<Keystroke> findAll();",
"public static List<Result> getDataByRegex(String tableName, String regexKey) {\n RegexStringComparator rc = new RegexStringComparator(regexKey);\n RowFilter rowFilter = new RowFilter(CompareFilter.CompareOp.EQUAL, rc);\n\n Scan scan = new Scan();\n scan.setFilter(rowFilter);\n return getResultsFromScan(tableName, scan);\n }",
"byte[][] getFamilyKeys() {\n\t\tCharset c = Charset.forName(charset);\n\n\t\tbyte[][] familyKeys = new byte[this.familyMap.size()][];\n\t\tint i = 0;\n\t\tfor (String name : this.familyMap.keySet()) {\n\t\t\tfamilyKeys[i++] = name.getBytes(c);\n\t\t}\n\t\treturn familyKeys;\n\t}",
"String getSymbol();",
"Pattern slotsPattern(ENodeBuilder b, Pattern optPrefix, String[] exports) {\n int offset = (null == optPrefix) ? 0 : 1;\n Pattern[] slotPatts = new Pattern[offset + exports.length];\n if (null != optPrefix) {\n slotPatts[0] = optPrefix;\n }\n for (int i = 0; i < exports.length; i++) {\n slotPatts[offset + i] = b.slotPattern(exports[i]);\n }\n return b.listPattern(slotPatts);\n }",
"public static List<Cancion> selectAll(String pattern) {\n\t\tList<Cancion> result = new ArrayList();\n\n\t\ttry {\n\t\t\tmanager = Connection.connectToMysql();\n\t\t\tmanager.getTransaction().begin();\n\n\t\t\tString q = \"FROM Cancion\";\n\n\t\t\tif (pattern.length() > 0) {\n\t\t\t\tq += \" WHERE nombre LIKE ?\";\n\t\t\t}\n\n\t\t\tif (pattern.length() > 0) {\n\t\t\t\tresult = manager.createQuery(\"FROM Cancion WHERE nombre LIKE '\" + pattern + \"%'\").getResultList();\n\t\t\t} else {\n\t\t\t\tresult = manager.createQuery(\"FROM Cancion\").getResultList();\n\t\t\t}\n\n\t\t\tmanager.getTransaction().commit();\n\t\t} catch (Exception ex) {\n\t\t\tSystem.out.println(ex);\n\t\t}\n\n\t\treturn result;\n\t}",
"@Override\n public List<K> keys() {\n List<K> keys = new AList<>();\n for(int i =0; i < capacity; i++){\n Entry n = (Entry) table[i];\n if(n != null && !n.isRemoved())\n keys.add(n.getKey());\n }\n assert keys.size() == size;\n return keys;\n }",
"@Override\n public Map<K, V> getMatching( final String pattern )\n {\n final Map<K, V> unwrappedResults;\n\n final Map<K, ICacheElement<K, V>> wrappedResults = this.getCacheControl().getMatching( pattern );\n\n if ( wrappedResults == null )\n {\n unwrappedResults = new HashMap<>();\n }\n else\n {\n unwrappedResults = wrappedResults.entrySet()\n .stream()\n .filter(entry -> entry.getValue() != null)\n .collect(Collectors.toMap(\n Entry::getKey,\n entry -> entry.getValue().getVal()));\n }\n\n return unwrappedResults;\n }",
"public TypeFilterHonSearch(String key) {\r\n\t\temptyKey = StringUtils.isEmpty(key);\r\n\t\tif (emptyKey == false) {\r\n\t\t\tkey = key.trim().toLowerCase();\r\n\t\t\tif (key.length() > 0) {\r\n\t\t\t\tif (key.charAt(key.length() - 1) != '*') {\r\n\t\t\t\t\tkey += '*';\r\n\t\t\t\t}\r\n\t\t\t\tpattern = Pattern.compile(StringUtils.replace(key, \"*\", \".*\"));\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public K[] keySet() {\n MyStack<K> result = new MyStack<>();\n\n for (Object entry : this.table) {\n if (entry != null) {\n Entry<K, V> current = (Entry<K, V>) entry;\n\n while (current.hasNext()) {\n result.push(current.getKey());\n current = current.getNext();\n }\n result.push(current.getKey());\n }\n }\n return result.toArray();\n }",
"public WildcardPattern(String pattern) {\r\n this.pattern = pattern;\r\n }",
"public Iterable<Key> keys() {\n Queue<Key> queue = new Queue<Key>();\n for (int i = 0; i < m; i++) {\n for (Key key : st[i].keys())\n queue.enqueue(key);\n }\n return queue;\n }",
"public boolean contains_switch(String symbol);",
"List<QueryKey> listQueryKeys();",
"public KeySet getKeys();",
"public Set<String> keySet()\n\t{\n\t\tverifyParseState();\n\t\t\n\t\treturn values.keySet();\n\t}",
"public Set<Character> getExtensionKeys() {\n return _extensions.getExtensionKeys();\n }",
"public static ArrayList<String> searchDictCommands(String query) {\n ArrayList<String> curSearch = new ArrayList<>();\n\n // Iterating through arguments of the same command\n for (int i = 0; i < commandDict.size(); i++) {\n // Checking if current Dictionary key matches what\n // the user has entered so far.\n if (commandDict.get(i).getKey().startsWith(query)) {\n curSearch.add(commandDict.get(i).getKey());\n }\n }\n\n // Returns an empty ArrayList if no match has been found.\n return curSearch;\n }",
"public List<T> findMatchCommands(String input) {\n List<T> appropriateCommands = Lists.newArrayList();\n for (T command : this) {\n if (command.getPattern().startsWith(input)) {\n appropriateCommands.add(command);\n }\n }\n return appropriateCommands;\n }",
"public Iterable<Key> Keys()\n\t{\n\t\tQueue<Key> q=new Queue<>();\n\t\tInorder(root,q);\n\t\treturn q;\n\t}",
"public Set keySet() {\n\treturn table.keySet();\n }",
"byte[][] getQualifierKeys(String family) {\n\t\tMap<String, TypeInformation<?>> qualifierMap = familyMap.get(family);\n\n\t\tif (qualifierMap == null) {\n\t\t\tthrow new IllegalArgumentException(\"Family \" + family + \" does not exist in schema.\");\n\t\t}\n\t\tCharset c = Charset.forName(charset);\n\n\t\tbyte[][] qualifierKeys = new byte[qualifierMap.size()][];\n\t\tint i = 0;\n\t\tfor (String name : qualifierMap.keySet()) {\n\t\t\tqualifierKeys[i++] = name.getBytes(c);\n\t\t}\n\t\treturn qualifierKeys;\n\t}",
"public Enumeration<Object> keys ();",
"@SuppressWarnings(\"unchecked\")\r\n\tpublic static List<Key> getTagKeysByName(String[] tagNames) {\r\n\t\tString query = \"select key from \" + Tag.class.getName();\r\n\t\tQuery q = PMF.get().getPersistenceManager().newQuery(query);\r\n\t\tString filter = \"\";\r\n\t\tString params = \"\";\r\n\t\tfor (int i = 0; i < tagNames.length; i++) {\r\n\t\t\t// Switch it to lowercase\r\n\t\t\ttagNames[i] = tagNames[i].toLowerCase();\r\n\t\t\tif (i < tagNames.length - 1) {\r\n\t\t\t\tfilter += \"searchTerms.contains(n\" + i + \") || \";\r\n\t\t\t\tparams += \"String n\" + i + \", \";\r\n\t\t\t} else {\r\n\t\t\t\tfilter += \"searchTerms.contains(n\" + i + \")\";\r\n\t\t\t\tparams += \"String n\" + i;\r\n\t\t\t}\r\n\r\n\t\t}\r\n//\t\tSystem.out.println(\"FILTER: \" + filter);\r\n//\t\tSystem.out.println(\"PARAMS: \" + params);\r\n\t\tq.setFilter(filter);\r\n\t\tq.declareParameters(params);\r\n\t\treturn (List<Key>) q.executeWithArray((Object[]) tagNames);\r\n\t}",
"public Term[] allMatches(String prefix) {\r\n if (prefix == null) {\r\n throw new java.lang.NullPointerException();\r\n }\r\n Term temporary = new Term(prefix, 0);\r\n \r\n int x = BinarySearchDeluxe.firstIndexOf(queries, temporary, Term.byPrefixOrder(prefix.length()));\r\n int y = BinarySearchDeluxe.lastIndexOf(queries, temporary, Term.byPrefixOrder(prefix.length()));\r\n \r\n if (x == -1 || y == -1) {\r\n throw new java.lang.NullPointerException();\r\n }\r\n Term[] matches = new Term[y - x + 1];\r\n matches = Arrays.copyOfRange(queries, x, y);\r\n Arrays.sort(matches, Term.byReverseWeightOrder());\r\n return matches;\r\n }",
"String symbol();",
"private SymbolData[]\n\t\t\tmakeSymbolMap(Map<StandardSymbolData, JsName> symbolTable) {\n\t\tfinal Set<String> nameUsed = new HashSet<String>();\n\t\tfinal Map<JsName, Integer> nameToFragment = new HashMap<JsName, Integer>();\n\t\tfor (int i = 0; i < jsProgram.getFragmentCount(); i++) {\n\t\t\tfinal Integer fragId = i;\n\t\t\tnew JsVisitor() {\n\t\t\t\t@Override\n\t\t\t\tpublic void endVisit(JsForIn x, JsContext ctx) {\n\t\t\t\t\tif (x.getIterVarName() != null) {\n\t\t\t\t\t\tnameUsed.add(x.getIterVarName().getIdent());\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t@Override\n\t\t\t\tpublic void endVisit(JsFunction x, JsContext ctx) {\n\t\t\t\t\tif (x.getName() != null) {\n\t\t\t\t\t\tnameToFragment.put(x.getName(), fragId);\n\t\t\t\t\t\tnameUsed.add(x.getName().getIdent());\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t@Override\n\t\t\t\tpublic void endVisit(JsLabel x, JsContext ctx) {\n\t\t\t\t\tnameUsed.add(x.getName().getIdent());\n\t\t\t\t}\n\n\t\t\t\t@Override\n\t\t\t\tpublic void endVisit(JsNameOf x, JsContext ctx) {\n\t\t\t\t\tif (x.getName() != null) {\n\t\t\t\t\t\tnameUsed.add(x.getName().getIdent());\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t@Override\n\t\t\t\tpublic void endVisit(JsNameRef x, JsContext ctx) {\n\t\t\t\t\t// Obviously this isn't even that accurate. Some of them are\n\t\t\t\t\t// variable names, some of the are property. At least this\n\t\t\t\t\t// this give us a safe approximation. Ideally we need\n\t\t\t\t\t// the code removal passes to remove stuff in the scope\n\t\t\t\t\t// objects.\n\t\t\t\t\tif (x.isResolved()) {\n\t\t\t\t\t\tnameUsed.add(x.getName().getIdent());\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t@Override\n\t\t\t\tpublic void endVisit(JsParameter x, JsContext ctx) {\n\t\t\t\t\tnameUsed.add(x.getName().getIdent());\n\t\t\t\t}\n\n\t\t\t\t@Override\n\t\t\t\tpublic void endVisit(JsVars.JsVar x, JsContext ctx) {\n\t\t\t\t\tnameUsed.add(x.getName().getIdent());\n\t\t\t\t\t// alcina - add classlits to name/fragment\n\t\t\t\t\tif (x.getName().getIdent().startsWith(\n\t\t\t\t\t\t\t\"com_google_gwt_lang_ClassLiteralHolder_\")) {\n\t\t\t\t\t\tnameToFragment.put(x.getName(), fragId);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}.accept(jsProgram.getFragmentBlock(i));\n\t\t}\n\t\t// TODO(acleung): This is a temp fix. Once we know this is safe. We\n\t\t// new to rewrite it to avoid extra ArrayList creations.\n\t\t// Or we should just consider serializing it as an ArrayList if\n\t\t// it is that much trouble to determine the true size.\n\t\tList<SymbolData> result = new ArrayList<SymbolData>();\n\t\tfor (Map.Entry<StandardSymbolData, JsName> entry : symbolTable\n\t\t\t\t.entrySet()) {\n\t\t\tStandardSymbolData symbolData = entry.getKey();\n\t\t\tsymbolData.setSymbolName(entry.getValue().getShortIdent());\n\t\t\tInteger fragNum = nameToFragment.get(entry.getValue());\n\t\t\tif (fragNum != null) {\n\t\t\t\tsymbolData.setFragmentNumber(fragNum);\n\t\t\t}\n\t\t\tif (nameUsed.contains(entry.getValue().getIdent())\n\t\t\t\t\t|| entry.getKey().isClass()) {\n\t\t\t\tresult.add(symbolData);\n\t\t\t}\n\t\t}\n\t\treturn result.toArray(new SymbolData[result.size()]);\n\t}",
"List getKeyBy(PaymentTradeExample example);",
"boolean hasSymbol();",
"boolean hasSymbol();",
"List getKeyBy(PaymentTradeExampleExtended example);",
"public List<Ohlc> getBySymbol(String symbol);",
"IIndexFragmentBinding[] findBindingsForPrefix(char[] prefix, boolean filescope, IndexFilter filter, IProgressMonitor monitor) throws CoreException;",
"@Override\r\n public List<Asset> findByKeyWord(Map<String, Object> params) {\n return assetDao.findByKeyWord(params);\r\n }",
"public abstract Enumeration keys();",
"int containsMatchingPattern(Set<String> values, String pattern, boolean matchPrefix) {\n return memoizer.matches(values, pattern, matchPrefix, () -> {\n int match = -1;\n for(String val : values) {\n String replaced = val.replaceAll(\"\\\\.\", \"\\\\\\\\.\").replaceAll(\"\\\\*\", \".*\");\n if(Pattern.compile(replaced).matcher(pattern).matches() || (matchPrefix && val.startsWith(pattern + \".\"))) {\n match = replaced.contains(\"*\") ? 0 : 1;\n break;\n }\n }\n return match;\n });\n }",
"public Set<String> keySet() {\n return map.keySet();\n }",
"public EList<GenClass> getAllStartSymbols() {\n \t\tEList<GenClass> symbols = new BasicEList<GenClass>();\n \t\tsymbols.addAll(getStartSymbols());\n \t\t\n \t\tEList<Import> imports = getImports();\n \t\tfor (Import importedElement : imports) {\n \t\t\tfinal ConcreteSyntax importedSyntax = importedElement.getConcreteSyntax();\n \t\t\tif (importedSyntax != null) {\n \t\t\t\tsymbols.addAll(importedSyntax.getAllStartSymbols());\n \t\t\t}\n \t\t}\n \t\treturn symbols;\n \t}",
"public static void printAllCombinations(String pattern)\n {\n // create an empty stack (we can also use set, queue, vector\n // or any other container)\n Stack<String> stack = new Stack();\n stack.push(pattern); // push the pattern into the stack\n \n int index;\n \n // do till stack is not empty\n while (!stack.empty())\n {\n // pop string from stack and process it\n String curr = stack.pop();\n \n // index stores position of first occurrence of wildcard\n // pattern in curr\n if ((index = curr.indexOf('?')) != -1)\n {\n // replace '?' with 0 and 1 and push it to the stack\n for (char ch = '0'; ch <= '1'; ch++)\n {\n curr = curr.substring(0, index) + ch + \n curr.substring(index + 1);\n stack.push(curr);\n }\n }\n \n // If no wildcard pattern is found, print the string\n else\n System.out.println(curr);\n }\n }",
"private List<String> getListForRealKey(String realKey) {\n return List.of(realKey);\n }",
"@Override public RebaseSearcher findSymbols(String pattern,String kind)\n{\n RebaseJavaSearch search = new RebaseJavaSearch(this);\n\n findSymbols(search,pattern,kind);\n\n return search;\n}",
"public List<Key> getkeyList() {\n SimpleJdbcTemplate jdbcTemplate =\n new SimpleJdbcTemplate(SessionFactoryUtils.getDataSource(getSessionFactory()));\n HashMap args = new HashMap();\n return jdbcTemplate.query(\"select a.APP_ID,a.name,a.CERTIFICATEID,a.soa_group_id,c.soa_group_name from \" + APP_KEY_TABLE + \" a , SOA_GROUP c where status='Active' and a.soa_group_id=c.soa_group_id\"\n , new ParameterizedRowMapper<Key>() {\n public Key mapRow(ResultSet rs, int rowNum) throws SQLException {\n return new Key(rs.getString(\"APP_ID\"), rs.getString(\"name\"), rs.getString(\"soa_group_id\"), rs.getString(\"soa_group_name\"), rs.getString(\"CERTIFICATEID\"));\n }\n }, args);\n }",
"public String[] search(String tableName, String[] keyValue) {\r\n List<String> retVal = new ArrayList<String>();\r\n Connection con = null;\r\n Statement stmt = null;\r\n try {\r\n con = ConnectionManager.getInstance().getConnection(databaseName);\r\n stmt = con.createStatement();\r\n TableObject table = _create(tableName);\r\n if (table != null) {\r\n StringBuffer whereClause = new StringBuffer();\r\n for (int i = 0; i < keyValue.length; i++) {\r\n String[] kV = keyValue[i].split(\"=\");\r\n if (whereClause.length() < 1) {\r\n whereClause.append(\" AND \");\r\n }\r\n int multi = kV[1].indexOf(\",\");\r\n boolean isChar = false;\r\n TableField field = table.fields.get(kV[0]);\r\n isChar = field.fieldType.startsWith(\"VARCHAR\");\r\n if(multi < 0){\r\n if(isChar){\r\n whereClause.append( kV[0] + \" LIKE '%\" + kV[1] + \"%' \");\r\n }else{\r\n field.setValue(kV[1]);\r\n whereClause.append(kV[0] + \" = \" + convertValue(field));\r\n }\r\n }else{\r\n whereClause.append(kV[0] + \" in (\" + kV[0] + \") \");\r\n }\r\n }\r\n String searchQry = \"SELECT \" + table.key + \" FROM \" + tableName + \" WHERE \" + whereClause.toString();\r\n ResultSet rs = stmt.executeQuery(searchQry);\r\n while (rs.next()) {\r\n String keyVal = rs.getString(1);\r\n retVal.add(retrieve(tableName, keyVal));\r\n }\r\n }\r\n\r\n } catch (Exception e) {\r\n Logger.getLogger(Converter.class.getName()).log(Level.SEVERE, null, e);\r\n } finally {\r\n if (stmt != null) {\r\n try {\r\n stmt.close();\r\n } catch (Exception e) {\r\n Logger.getLogger(Converter.class.getName()).log(Level.SEVERE, null, e);\r\n }\r\n }\r\n if (con != null) {\r\n try {\r\n //con.close();\r\n } catch (Exception e) {\r\n Logger.getLogger(Converter.class.getName()).log(Level.SEVERE, null, e);\r\n }\r\n }\r\n }\r\n return (String[])retVal.toArray();\r\n }",
"public WeatherKey[] getKeys() {\n return this.keys;\n }",
"public Collection<String[]> findAllPrefixPairMatches(String unitNameWithPrefix, boolean constrainBasedOnValidUnitNames) {\n return findPrefixPairMatches(unitNameWithPrefix, constrainBasedOnValidUnitNames, false);\n }",
"Index getIndex(String symbol);",
"@Deprecated\n List<K> scan(String pattern, long count);",
"public interface SymbolTable\n{\n /**\n * Indicates that a symbol's integer ID could not be determined. That's\n * generally the case when constructing value instances that are not yet\n * contained by a datagram.\n */\n public final static int UNKNOWN_SYMBOL_ID = -1;\n\n\n /**\n * Gets the unique name of this symbol table.\n *\n * @return the unique name, or {@code null} if {@link #isLocalTable()}.\n */\n public String getName();\n\n\n /**\n * Gets the version of this symbol table.\n *\n * @return at least one, or zero if {@link #isLocalTable()}.\n */\n public int getVersion();\n\n\n /**\n * Determines whether this symbol table is local, and therefore unnamed\n * and unversioned.\n * <p>\n * If this method returns {@code true}, then both {@link #isSharedTable()}\n * and {@link #isSystemTable()} will return {@code false}.\n */\n public boolean isLocalTable();\n\n /**\n * Determines whether this symbol table is shared, and therefore named,\n * versioned, and {@linkplain #isReadOnly() read-only}.\n * <p>\n * If this method returns {@code true}, then {@link #isLocalTable()}\n * will return {@code false}.\n */\n public boolean isSharedTable();\n\n /**\n * Determines whether this instance is substituting for an imported\n * shared table for which no exact match was found in the catalog.\n * Such tables are not authoritative and may not even have any symbol text\n * at all (as is the case when no version of an imported table is found).\n * <p>\n * Substitute tables are always shared, non-system tables.\n *\n */\n public boolean isSubstitute();\n\n /**\n * Determines whether this symbol table is a system symbol table, and\n * therefore shared, named, versioned, and\n * {@linkplain #isReadOnly() read-only}.\n * <p>\n * If this method returns {@code true}, then {@link #isLocalTable()}\n * will return {@code false} and {@link #isSharedTable()} will return\n * {@code true}.\n */\n public boolean isSystemTable();\n\n\n /**\n * Determines whether this symbol table can have symbols added to it.\n * Shared symtabs are always read-only.\n * Local symtabs can also be {@linkplain #makeReadOnly() made read-only}\n * on demand, which enables some optimizations when writing data but will\n * cause failures if new symbols are encountered.\n *\n * @return true if this table is read-only, false if symbols may\n * be added.\n *\n * @see #makeReadOnly()\n *\n\n */\n public boolean isReadOnly();\n\n\n /**\n * Prevents this symbol table from accepting any more new symbols.\n * Shared symtabs are always read-only.\n * Making a local symtab read-only enables some optimizations when writing\n * data, but will cause failures if new symbols are encountered.\n *\n * @see #isReadOnly()\n *\n\n */\n public void makeReadOnly();\n\n\n /**\n * Gets the system symbol table being used by this local table.\n * <p>\n * If {@link #isSystemTable()} then this method returns {@code this}.\n * Otherwise, if {@link #isSharedTable()} then this method returns\n * {@code null}.\n *\n * @return not <code>null</code>, except for non-system shared tables.\n */\n public SymbolTable getSystemSymbolTable();\n\n\n /**\n * Gets the identifier for the Ion version (and thus the system symbol\n * table) used by this table.\n * The version identifier is a string of the form {@code \"$ion_X_Y\"}.\n *\n * @return the version identifier; or {@code null} for non-system shared\n * tables.\n */\n public String getIonVersionId();\n\n\n /**\n * Gets the sequence of shared symbol tables imported by this (local)\n * symbol table. The result does not include a system table.\n * <p>\n * If this local table imported a shared table for which the relevant\n * {@link IonCatalog} has the same name but different version and/or max_id,\n * then that entry will be a substitute table with the\n * correct version and max_id, wrapping the original shared symbol table\n * that was found.\n * <p>\n * If this local table imported a shared table for which the relevant\n * {@link IonCatalog} has no entry with the same name, but the import\n * declaration has a max_id available, then that entry will\n * be a substitute table with max_id undefined symbols.\n *\n * @return {@code null} if this is a shared or system table, otherwise a\n * non-null but potentially zero-length array of shared tables (but no\n * system table).\n */\n public SymbolTable[] getImportedTables();\n\n\n /**\n * Gets the highest symbol id reserved by this table's imports (including\n * system symbols). Any id higher than this value is a local symbol\n * declared by this table. This value is zero for shared symbol tables,\n * since they do not utilize imports.\n */\n public int getImportedMaxId();\n\n\n /**\n * Gets the highest symbol id reserved by this table.\n *\n * @return the largest integer such that {@link #findKnownSymbol(int)} could\n * return a non-<code>null</code> result. Note that there is no promise\n * that it <em>will</em> return a name, only that any larger id will not\n * have a name defined.\n */\n public int getMaxId();\n\n\n /**\n * Adds a new symbol to this table, or finds an existing definition of it.\n * <p>\n * The resulting {@link SymbolToken} has the same String instance that\n * was first interned. In order to reduce memory\n * footprint, callers should generally replace their copy of the text with\n * the string in the result.\n * <p>\n * This method will not necessarily return the same instance given the\n * same input.\n *\n * @param text the symbol text to intern.\n *\n * @return the interned symbol, with both text and SID defined; not null.\n *\n * @throws IonException if this symtab {@link #isReadOnly()} and\n * the text isn't already interned.\n *\n * @see #find(String)\n *\n\n */\n public SymbolToken intern(String text);\n\n\n /**\n * Finds a symbol already interned by this table.\n * <p>\n * This method will not necessarily return the same instance given the\n * same input.\n *\n * @param text the symbol text to find.\n *\n * @return the interned symbol, with both text and SID defined;\n * or {@code null} if it's not already interned.\n *\n * @see #intern(String)\n *\n\n */\n public SymbolToken find(String text);\n\n\n /**\n * Gets the symbol ID associated with a given symbol name.\n *\n * @param name must not be null or empty.\n * @return the id of the requested symbol, or\n * {@link #UNKNOWN_SYMBOL_ID} if it's not defined.\n *\n * @throws NullPointerException if {@code name} is null.\n */\n public int findSymbol(String name);\n\n\n /**\n * Gets the interned text for a symbol ID.\n *\n * @param id the requested symbol ID.\n * @return the interned text associated with the symbol ID,\n * or {@code null} if the text is not known.\n *\n * @throws IllegalArgumentException if {@code id < 1}.\n */\n public String findKnownSymbol(int id);\n\n\n /**\n * Creates an iterator that will return all non-imported symbol names, in\n * order of their symbol IDs. The iterator will return {@code null} where\n * there is an undefined sid.\n * <p>\n * The first string returned by the iterator has a symbol ID that is one\n * more than {@link #getImportedMaxId()}, and the last string has symbol\n * ID equals to {@link #getMaxId()}.\n *\n * @return a new iterator.\n */\n public Iterator<String> iterateDeclaredSymbolNames();\n\n\n /**\n * Writes an Ion representation of this symbol table.\n *\n * @param writer must not be null.\n * @throws IOException if thrown by the writer.\n */\n public void writeTo(IonWriter writer)\n throws IOException;\n}",
"protected List<String> getTokens(String pattern)\r\n\t{\r\n\t\tArrayList<String> tokens = new ArrayList<String>();\r\n\t\tPattern tokSplitter = Pattern.compile(pattern);\r\n\t\tMatcher m = tokSplitter.matcher(text);\r\n\t\t\r\n\t\twhile (m.find()) {\r\n\t\t\ttokens.add(m.group());\r\n\t\t}\r\n\t\t\r\n\t\treturn tokens;\r\n\t}",
"public Iterable<String> matches(String prefix, int k) {\n\t\tmatchesList = new ArrayList<String>();\n\t\t\n\t\tif(prefix != null){\n\t\t\tfor(Term term : data.getRawList()){\n\t\t\t\tif((term.getWord().startsWith(prefix))&&(matchesList.size() < k)){\n\t\t\t\t\tmatchesList.add(term.getWord());\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn matchesList;\n\t\t}\n\t\telse{\n\t\t\treturn null;\n\t\t}\n\t}",
"List<Label> findAllByKey(String key);",
"public Iterable<K> keys()\n {\n return new Iterable<K>()\n {\n public Iterator<K> iterator()\n {\n return ChainedHashTable.this.keysIterator();\n } // iterator()\n }; // new Iterable<K>\n }"
] | [
"0.76408297",
"0.6865932",
"0.66514987",
"0.62588775",
"0.6177704",
"0.60466504",
"0.5686566",
"0.55117685",
"0.54944557",
"0.54202044",
"0.53938186",
"0.53871363",
"0.53337383",
"0.5315635",
"0.5308372",
"0.53077275",
"0.53077275",
"0.52860963",
"0.52361196",
"0.5189354",
"0.51847744",
"0.517168",
"0.5135103",
"0.51295906",
"0.50829005",
"0.5079694",
"0.50755316",
"0.5063169",
"0.5056316",
"0.5055476",
"0.50376105",
"0.5021602",
"0.5012314",
"0.49502137",
"0.4945559",
"0.49261963",
"0.49006358",
"0.4895331",
"0.48145014",
"0.48145014",
"0.48135048",
"0.48129758",
"0.4784275",
"0.47673845",
"0.47669706",
"0.47641173",
"0.47262448",
"0.47148308",
"0.470933",
"0.4702395",
"0.46833774",
"0.46777278",
"0.46632522",
"0.46500218",
"0.4642303",
"0.46350148",
"0.46215093",
"0.4606997",
"0.46066463",
"0.45868856",
"0.45836976",
"0.4575455",
"0.45735648",
"0.45715067",
"0.45628482",
"0.45376948",
"0.45247653",
"0.45215383",
"0.4521516",
"0.45183802",
"0.4514661",
"0.45114756",
"0.4511168",
"0.45106146",
"0.4509732",
"0.45048916",
"0.45044494",
"0.45044494",
"0.45029414",
"0.4497985",
"0.4488637",
"0.44811141",
"0.4480987",
"0.44790944",
"0.44737655",
"0.4473143",
"0.44679227",
"0.44663024",
"0.44655687",
"0.44642046",
"0.44587165",
"0.44581103",
"0.44550514",
"0.4454712",
"0.44507045",
"0.44360465",
"0.4430705",
"0.44306445",
"0.44225547",
"0.44189212"
] | 0.6951308 | 1 |
Returns all keys in the symbol table as an Iterable. To iterate over all of the keys in the symbol table named st, use the foreach notation: for (Key key : st.keys()). | public Iterable<String> keys()
{ return keysWithPrefix(""); } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Iterable<Key> keys();",
"public Iterable<Key> keys();",
"public Iterable<K> keys();",
"public Iterable<K> keys()\n {\n return new Iterable<K>()\n {\n public Iterator<K> iterator()\n {\n return ChainedHashTable.this.keysIterator();\n } // iterator()\n }; // new Iterable<K>\n }",
"public Iterable<Key> keys() {\n Queue<Key> queue = new Queue<Key>();\n for (int i = 0; i < m; i++) {\n for (Key key : st[i].keys())\n queue.enqueue(key);\n }\n return queue;\n }",
"public Iterator<Key> keys() ;",
"public Iterator<K> keys();",
"public Iterator<K> keys();",
"public native IterableIterator<K> keys();",
"public Iterable<String> keys() { return keysWithPrefix(\"\"); }",
"public Iterator<String> getKeyIterator(){\r\n\t\treturn map.keySet().iterator();\r\n\t}",
"public static Set<Symbol> getSymbols(SymbolTable st) {\n Set<Symbol> ret = new LinkedHashSet<Symbol>();\n if (st == null) {\n return ret;\n }\n for (IDExpression key : getTable(st).keySet()) {\n if (key instanceof Identifier) {\n Symbol symbol = ((Identifier)key).getSymbol();\n if (symbol != null) {\n ret.add(symbol);\n }\n }\n }\n return ret;\n }",
"public Iterable<Key> keys() {\n Queue<Key> queue = new Queue<Key>();\n for (Node temp = first; temp != null; temp = temp.next)\n queue.enqueue(temp.key);\n return queue;\n }",
"public Iterable<Key> Keys()\n\t{\n\t\tQueue<Key> q=new Queue<>();\n\t\tInorder(root,q);\n\t\treturn q;\n\t}",
"@Override\r\n\tpublic Iterator<K> iterator() {\n\t\treturn keys.iterator();\r\n\t}",
"public Iterable<K> keys() {\n Queue<K> q = new Queue<>();\n inOrder(root, q);\n return q;\n }",
"public KeySet getKeys();",
"public ListVS<T> getKeys() {\n return this.keys.getElements();\n }",
"public IIterator getKeys()\r\n {\r\n return new VectorIterator(m_keys);\r\n }",
"public Iterator iterator() {\n\t\treturn map.keySet().iterator();\n\t}",
"public Enumeration<Object> keys ();",
"public Iterator<X> iterator() {\n return map.keySet().iterator();\n }",
"public Iterable keys() {\n Queue K = new Queue();\n for(int i = 0; i < size; i++) {\n K.enqueue(keys[i]);\n }\n return K;\n }",
"public List<Symbol> keys() {\n\t\tList<Table.Entry<Symbol, List<Entry<T>>>> entries = table.toList();\n\t\tCollections.sort(entries, new Comparator<Table.Entry<Symbol, List<Entry<T>>>>() {\n\t\t\tpublic int compare(Table.Entry<Symbol, List<Entry<T>>> o1, Table.Entry<Symbol, List<Entry<T>>> o2) {\n\t\t\t\tEntry<T> max1 = Collections.max(o1.value, new EntryComparator());\n\t\t\t\tEntry<T> max2 = Collections.max(o2.value, new EntryComparator());\n\t\t\t\treturn max1.index - max2.index;\n\t\t\t}\n\t\t});\n\t\t\n\t\tList<Symbol> ret = new ArrayList<Symbol>(entries.size());\n\t\tfor (Table.Entry<Symbol, List<Entry<T>>> entry : entries) {\n\t\t\tret.add(entry.key);\n\t\t}\n\t\treturn ret;\n\t}",
"public Set keySet() {\n\treturn table.keySet();\n }",
"public Iterable<HashNode> iterator() {\n\t\treturn bucket;\n\t\t//for(HashTable<Character, Integer>.HashNode x : HT.iterator()) {\n\t}",
"public Set<String> keySet() {\r\n return keys.keySet();\r\n }",
"public Iterator<K> iterator() {\n Set keySet = RBT.keySet();\n Iterator itr = keySet.iterator();\n return itr;\n }",
"@Override\n\tpublic Iterable<K> keys() {\n\t\treturn null;\n\t}",
"public K[] keySet() {\n MyStack<K> result = new MyStack<>();\n\n for (Object entry : this.table) {\n if (entry != null) {\n Entry<K, V> current = (Entry<K, V>) entry;\n\n while (current.hasNext()) {\n result.push(current.getKey());\n current = current.getNext();\n }\n result.push(current.getKey());\n }\n }\n return result.toArray();\n }",
"public abstract List<String> getAllKeys();",
"public Iterator<K> keysIterator()\n {\n return new Iterator<K>()\n {\n public boolean hasNext()\n {\n // STUB\n return false;\n } // hasNext()\n\n public K next()\n {\n // STUB\n return null;\n } // next()\n\n public void remove()\n throws UnsupportedOperationException\n {\n throw new UnsupportedOperationException();\n } // remove()\n }; // new Iterator<K>\n }",
"public Set<String> keySet() {\n return map.keySet();\n }",
"public Enumeration getKeys() {\n // Not yet implemented -sorta\n return m_sql_bundle.getKeys();\n }",
"List<String> getKeys();",
"@Override\n\tpublic Iterator<T> iterator() {\n\t\treturn graph.keySet().iterator();\n\t}",
"@Override\n List<String> keys();",
"public List<String> getKeys()\n\t{\n\t\treturn new ArrayList<>(pairs.keySet());\n\t}",
"public Set<String> keySet()\n\t{\n\t\tverifyParseState();\n\t\t\n\t\treturn values.keySet();\n\t}",
"Set<String> getKeys();",
"public Iterable<Key> iterator() {\n Queue<Key> queue = new LinkedList<>();\n inorder(root, queue);\n return queue;\n }",
"@Override\n\tpublic Collection<Key> keys() {\n\t\tCollection<Key> c = new ArrayList<Key>();\n\t\tif (!isEmpty()) {\n\t\t\tFork<Key, Value> f = (Fork<Key,Value>) bst;\n\t\t\tEntry<Key, Value> e = new Entry<>(f.getKey().get(), f.getValue().get());\n\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\tEntry<Key, Value>[] a = (Entry<Key, Value>[]) Array.newInstance(e.getClass(), size());\n\t\t\tbst.saveInOrder(a);\n\t\t\tfor (int i = 0; i < a.length; i++) {\n\t\t\t\tc.add(a[i].getKey());\n\t\t\t}\n\t\t}\n\t\treturn c;\n\t}",
"@Override\n\tpublic Set<K> keySet() {\n\t\treturn keys;\n\t}",
"public Iterator<String> keyIterator() {\n \treturn new MapIter(first);\n }",
"public Set keySet() {\n return map.keySet();\n }",
"public List<K> keys();",
"public abstract Enumeration keys();",
"public List<NeonKey> getKeys();",
"public Set<K> keySet() {\r\n \treturn map.keySet();\r\n }",
"public String[] getKeys() {\n\t\treturn _keys;\n\t}",
"public Set<K> keySet() {\n return map.keySet();\n }",
"public ArrayList getKeys() {\r\n return this.keys;\r\n }",
"public Iterable<String> getPropertyKeys();",
"public String[] fetchAllKeys();",
"public Set<String> keySet() {\n return index.keySet();\n }",
"@Override\n public List<K> keys() {\n List<K> keys = new AList<>();\n for(int i =0; i < capacity; i++){\n Entry n = (Entry) table[i];\n if(n != null && !n.isRemoved())\n keys.add(n.getKey());\n }\n assert keys.size() == size;\n return keys;\n }",
"@Override\n public Set<K> keySet() {\n Set<K> keySet = new HashSet<K>(size());\n for (LinkedList<Entry<K,V>> list : table) {\n for (Entry<K,V> entry : list) {\n if (entry != null) {\n keySet.add(entry.getKey());\n }\n }\n }\n return keySet;\n }",
"@Override\n public Iterable<E> getAllVertices() {\n return dictionary.keySet();\n }",
"Set<K> keys();",
"public String getKeys() {\r\n return keys;\r\n }",
"public List<KeyInner> keys() {\n return this.keys;\n }",
"@Override\n public Set<K> keySet() {\n return keys;\n }",
"public List<String> getKeys(){\n return Collections.unmodifiableList(keys);\n }",
"public Iterator<String> getDictionary() {\r\n return index.keySet().iterator();\r\n }",
"public Collection<TapKey> findAllKeys();",
"public Iterable<String> getStrings(String key);",
"public Set<String> keySet() {\n return this.index.keySet();\n }",
"public List<String> keys()\n {\n return new ArrayList<String>(keys);\n }",
"public K[] getKeys() {\n return keys.clone();\n }",
"public Iterable<String> getKeys(String keyPrefix);",
"public WeatherKey[] getKeys() {\n return this.keys;\n }",
"public Set<Identifier> keySet() {\n return Collections.unmodifiableSet(container.keySet());\n }",
"public KeyPeg[] getKeys() {\n return this.keys;\n }",
"public static Enumeration<String> getKeys() {\n\t\tif (rb == null) {\n\t\t\treinit();\n\t\t}\n\n\t\treturn rb.getKeys();\n\t}",
"@Override\r\n\t\t\t\t\t\tpublic Enumeration<String> getKeys() {\n\t\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t\t}",
"public Set<String> getKeys() {\n return Collections.unmodifiableSet(data.keySet());\n }",
"public List<String> keysAsString() {\n\t\treturn iter.getItems().stream().map(e -> new String(e)).collect(toList());\n\t}",
"@Override\n\tpublic Enumeration<String> getKeys() {\n\t\treturn null;\n\t}",
"StringList keys();",
"public Set<String> keySet() {\n\t\t\treturn new HashSet<String>( mMap.keySet() );\n\t\t}",
"public static Iterator getKeys() {\n\t\tConfigManager cg = getConfigManager(null);\n\t\tIterator returnValue = null;\n\t\tif (cg != null) {\n\t\t\treturnValue = cg.getConfig().getKeys();\n\t\t}\n\t\treturn returnValue;\n\t}",
"public static Set<Symbol> getLocalSymbols(Traversable t) {\n Set<Symbol> ret = new LinkedHashSet<Symbol>();\n if (t == null) {\n return ret;\n }\n DFIterator<SymbolTable> iter =\n new DFIterator<SymbolTable>(t, SymbolTable.class);\n while (iter.hasNext()) {\n ret.addAll(getSymbols(iter.next()));\n }\n return ret;\n }",
"public Collection getKeys() throws CacheException {\n return cache.getKeys();\n }",
"public Set<String> keysOfMap() {\n Map<String, String> tempMap = createSimpleMap(\"Elevensies\",\"Grapes\");\n\t\tSet<String> keys = hashMap.keySet();\n\t\treturn tempMap.keySet();\n\t}",
"Collection<StreamKey> getStreamKeys();",
"private Set<String> getKeys() {\n return bookDB.keySet();\n }",
"public Set keyNames() {\n return new LinkedHashSet<>( asList( idName() ) );\n }",
"public static final Iterator<String> filenames() {\n return tableTracker.keySet().iterator();\r\n }",
"public ImmutableSet<Key<?>> getSessionKeys() {\n return ((SessionKeyExposingObjectify) ofy()).getSessionKeys();\n }",
"public Set<K> keySet() {\n Set<K> keys = new HashSet<>();\n if (bucket.length != 0) {\n for (int i = 0; i < bucket.length; i++) {\n keys.add(bucket[i].getKey());\n }\n }\n return keys;\n }",
"public Enumeration getKeys() throws AspException\n {\n return Contents.keys();\n }",
"public List<K> keys()\r\n\t{\r\n\t\tList<K> keys = new ArrayList<K>();\r\n\t\t\r\n\t\tfor(Entry element : data)\r\n\t\t{\r\n\t\t\tkeys.add(element.key);\r\n\t\t}\r\n\t\t\r\n\t\t//keys.sort(new keyComparator()); //not necessarily needed since I know my BST iterator\r\n\t\t\t\t\t\t\t\t\t\t //iterates through in an inOrder fashion.\r\n\t\t\r\n\t\treturn keys;\r\n\t}",
"public final Enumeration getKeys() {\n/* 130 */ return getBundle().getKeys();\n/* */ }",
"public Lo<K> keys() { return this.entries.map(kvp -> kvp.left); }",
"public Iterator iterator() {\n\n return new EnumerationIterator(elements.keys());\n }",
"public Iterable<Object> getObjects(String key);",
"public Stream<Student> students() {\n ////\n return grades.keySet().stream();\n }",
"public Iterator<String> mo27016b() {\n return Collections.unmodifiableSet(this.f18797b.keySet()).iterator();\n }",
"public static synchronized Set<Class<?>> keySet() {\n\t\treturn ClassRegistry.dictionary.keySet();\n\t}",
"public Set<K> keys() {\n return this.bst.toSortedList().toset().map(i -> i.left);\n }"
] | [
"0.7662974",
"0.7662974",
"0.74680996",
"0.7330015",
"0.7235882",
"0.71582705",
"0.710404",
"0.710404",
"0.7078348",
"0.6924222",
"0.67948925",
"0.673882",
"0.67332345",
"0.6730734",
"0.669804",
"0.66940916",
"0.6603418",
"0.6595312",
"0.6594481",
"0.6589094",
"0.6544277",
"0.6534299",
"0.65273106",
"0.6467127",
"0.6463411",
"0.641404",
"0.63826483",
"0.63641155",
"0.63420683",
"0.6336271",
"0.63347733",
"0.6319891",
"0.6314936",
"0.6301964",
"0.6294769",
"0.62782604",
"0.62460715",
"0.6243117",
"0.6242419",
"0.6229317",
"0.6221205",
"0.6204416",
"0.6198964",
"0.6195561",
"0.6193497",
"0.6190303",
"0.6180973",
"0.6172687",
"0.61660224",
"0.6158625",
"0.61567795",
"0.61466134",
"0.61402786",
"0.6139509",
"0.6128664",
"0.6127267",
"0.6123303",
"0.6123012",
"0.61227465",
"0.6112143",
"0.61073416",
"0.61008567",
"0.6096519",
"0.60827637",
"0.60815275",
"0.6072224",
"0.6064446",
"0.6063887",
"0.6063084",
"0.6045749",
"0.6030554",
"0.601295",
"0.59817564",
"0.5975998",
"0.59723824",
"0.59684974",
"0.5965501",
"0.59642154",
"0.59564334",
"0.59554714",
"0.595511",
"0.5949861",
"0.5946914",
"0.59434867",
"0.59401554",
"0.59363896",
"0.5927431",
"0.59105146",
"0.59060466",
"0.588631",
"0.58847296",
"0.58734334",
"0.58656216",
"0.58655596",
"0.5850816",
"0.5844551",
"0.58377504",
"0.58198047",
"0.5810695",
"0.5809746"
] | 0.69050926 | 10 |
Main Program Unit Test Unit test the TST data type | public static void main(String[] args)
{
// build symbol table from standard input
TST<Integer> st = new TST<Integer>();
for (int i = 0; !StdIn.isEmpty(); i++) {
String key = StdIn.readString();
st.put(key, i);
}
// print results
if (st.size() < 100) {
StdOut.println("keys(\"\"):");
for (String key : st.keys()) {
StdOut.println(key + " " + st.get(key));
}
StdOut.println();
}
StdOut.println("longestPrefixOf(\"shellsort\"):");
StdOut.println(st.longestPrefixOf("shellsort"));
StdOut.println();
StdOut.println("keysWithPrefix(\"shor\"):");
for (String s : st.keysWithPrefix("shor"))
StdOut.println(s);
StdOut.println();
StdOut.println("keysThatMatch(\".he.l.\"):");
for (String s : st.keysThatMatch(".he.l."))
StdOut.println(s);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n\tpublic void testGetType_1()\n\t\tthrows Exception {\n\t\tTreeData fixture = new TreeData((IFile) null, \"\", 1, 1);\n\n\t\tint result = fixture.getType();\n\n\t\t// add additional test code here\n\t\tassertEquals(1, result);\n\t}",
"static boolean test(Type t0)\r\n {\r\n String s0 = Types.stringFor(t0);\r\n TypeParser typeParser = TypeParsers.create();\r\n typeParser.addTypeVariableName(\"E\");\r\n Type t1 = null;\r\n try\r\n {\r\n t1 = typeParser.parse(s0);\r\n } \r\n catch (ClassNotFoundException e)\r\n {\r\n fail(e.getMessage());\r\n }\r\n \r\n String message = \"\";\r\n message += \"Input \" + s0 + \"\\n\";\r\n message += \"should be \" + t0 + \"\\n\";\r\n message += \"was parsed to \" + t1 + \"\\n\";\r\n \r\n boolean passed = TypesEquivalent.areEquivalent(t0, t1);\r\n if (!passed || DEBUG)\r\n {\r\n PrintStream ps = System.out;\r\n if (!passed)\r\n {\r\n ps = System.err;\r\n }\r\n String detailedMessage = \"\";\r\n detailedMessage += \"Input \" + s0 + \"\\n\";\r\n detailedMessage += \"should be \" + t0 + \" \" \r\n + \"(Detailed: \" + Types.debugStringFor(t0) + \")\" + \"\\n\";\r\n detailedMessage += \"was parsed to \" + t1 + \" \" \r\n + \"(Detailed: \" + Types.debugStringFor(t1) + \")\" + \"\\n\";\r\n ps.print(detailedMessage);\r\n }\r\n assertTrue(message, passed);\r\n return passed;\r\n }",
"public static void main(String[] args) {\n\t\tDataTypeTest test = new DataTypeTest();\r\n\t\ttest.i = -1/0; \r\n\t\ttest.i = (int) 3.5f;\r\n\t\ttest.d = 2l;\r\n\t\t//test.s = (short) 10000000000000000000;\r\n\t\ttest.b = (byte) test.s;\r\n\t\ttest.f = test.l;\r\n\t\ttest.c = (char) test.i;\r\n\t\t//test.bool = 1;\r\n\t}",
"@Test\n public void testProgramElementsType() {\n // TODO: test ProgramElementsType\n }",
"@Test\r\n\tpublic void firstTest() {\r\n\t\t\r\n\t\tTree tree = new Tree(\"greg\");\r\n\t\ttree.addElement(\"opera\");\r\n\t\ttree.addElement(\"qwerty\");\r\n\t\ttree.addElement(\"odf\");\r\n\t\ttree.addElement(7363);\r\n\t\ttree.addElement(new Double(23.3));\r\n\t\t\r\n\t\tassertTrue(tree.contains(7363));\r\n\t\tassertTrue(tree.contains(\"greg\"));\r\n\t\tassertTrue(tree.contains(\"opera\"));\r\n\t\tassertTrue(tree.contains(\"odf\"));\r\n\t}",
"@Test\n public void typeTest() {\n // TODO: test type\n }",
"@Test\n public void typeTest() {\n // TODO: test type\n }",
"@Test\n public void typeTest() {\n // TODO: test type\n }",
"@Test\n\tpublic void testTreeData_1()\n\t\tthrows Exception {\n\n\t\tTreeData result = new TreeData();\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t\tassertEquals(0, result.getType());\n\t\tassertEquals(null, result.getDescription());\n\t\tassertEquals(0, result.getCount());\n\t\tassertEquals(null, result.getIfile());\n\t}",
"@Test\n\tpublic void testTreeData_2()\n\t\tthrows Exception {\n\t\tIFile ifile = null;\n\t\tString description = \"\";\n\t\tint count = 1;\n\t\tint type = 1;\n\n\t\tTreeData result = new TreeData(ifile, description, count, type);\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t\tassertEquals(1, result.getType());\n\t\tassertEquals(\"\", result.getDescription());\n\t\tassertEquals(1, result.getCount());\n\t\tassertEquals(null, result.getIfile());\n\t}",
"@Test\n public void testParseDataType() {\n IntegerSpec integerSpec = new IntegerSpec();\n dataTypeParser.setDataTypeSpec(integerSpec);\n dataTypeParser.parse();\n IntegerSpec parsedIntegerSpec = (IntegerSpec) dataTypeParser.getDataTypeSpec();\n\n dataTypeParser = new DataTypeParser(new IntegerSpec(), new RandomGenerator(randomSeed));\n\n IntegerSpec integerSpec1 = new IntegerSpec();\n integerSpec1.setDefaultValue(0);\n dataTypeParser.setDataTypeSpec(integerSpec1);\n dataTypeParser.parse();\n IntegerSpec parsedIntegerSpec1 = (IntegerSpec) dataTypeParser.getDataTypeSpec();\n\n assertNotNull(parsedIntegerSpec.getRandomSeed());\n assertEquals(parsedIntegerSpec.getRandomSeed(), parsedIntegerSpec1.getRandomSeed());\n }",
"public static void main(String[] args) {\n\t\tTestGeneric t=new TestGeneric();\n\t\tt.testAdd();\n\t\tt.testForEach();\n\t\tt.testChild();\n\t\tt.testForEach();\n\t\tt.testBasicType();\n\t\t\n\n\t}",
"@Test\n public void jUnitTest10(){\n TigerLexer lex;\n try {\n lex = new TigerLexer(new ANTLRFileStream(\"test/jUnitTests/jUnitTest10.tig\", \"UTF8\"));\n CommonTokenStream tokens = new CommonTokenStream(lex);\n TigerParser parser = new TigerParser(tokens);\n SemantVisitor visitor = new SemantVisitor();\n parser.prog();\n boolean resp = (parser.getNumberOfSyntaxErrors() == 0 && visitor.getNumberOfSemanticErrors() == 0);\n assertTrue(resp);\n } catch (IOException ex) {\n Logger.getLogger(TesteGlobal.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"@Test\n public void jUnitTest07(){\n TigerLexer lex;\n try {\n lex = new TigerLexer(new ANTLRFileStream(\"test/jUnitTests/jUnitTest07.tig\", \"UTF8\"));\n CommonTokenStream tokens = new CommonTokenStream(lex);\n TigerParser parser = new TigerParser(tokens);\n SemantVisitor visitor = new SemantVisitor();\n parser.prog();\n boolean resp = (parser.getNumberOfSyntaxErrors() == 0 && visitor.getNumberOfSemanticErrors() == 0);\n assertTrue(resp);\n } catch (IOException ex) {\n Logger.getLogger(TesteGlobal.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"@Test\n public void jUnitTest09(){\n TigerLexer lex;\n try {\n lex = new TigerLexer(new ANTLRFileStream(\"test/jUnitTests/jUnitTest09.tig\", \"UTF8\"));\n CommonTokenStream tokens = new CommonTokenStream(lex);\n TigerParser parser = new TigerParser(tokens);\n SemantVisitor visitor = new SemantVisitor();\n parser.prog();\n boolean resp = (parser.getNumberOfSyntaxErrors() == 0 && visitor.getNumberOfSemanticErrors() == 0);\n assertTrue(resp);\n } catch (IOException ex) {\n Logger.getLogger(TesteGlobal.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"@Test\r\n public void testGetStructureNode() {\r\n System.out.println(\"getStructureNode\");\r\n ConfigNode<String> configNode = new ConfigNode<>(testLine);\r\n configNode.setStructureNode(\"a\");\r\n assertTrue(configNode.getStructureNode() instanceof String);\r\n }",
"public void testLotsOfValidTypes() throws Exception {\n\n UnitTestData data = new UnitTestData();\n EventFeedJSON eventFeedJSON = new EventFeedJSON(data.getContest());\n\n String elist = EventFeedJSON.AWARD_KEY + \",\" + // \n EventFeedJSON.CLARIFICATIONS_KEY + \",\" + // \n EventFeedJSON.CONTEST_KEY + \",\" + // \n EventFeedJSON.GROUPS_KEY + \",\" + // \n EventFeedJSON.JUDGEMENT_KEY + \",\" + // \n EventFeedJSON.JUDGEMENT_KEY + \",\" + // \n EventFeedJSON.JUDGEMENT_TYPE_KEY + \",\" + // \n EventFeedJSON.LANGUAGE_KEY + \",\" + // \n EventFeedJSON.CONTEST_KEY + \",\" + // \n EventFeedJSON.ORGANIZATION_KEY + \",\" + // \n EventFeedJSON.TEAM_MEMBERS_KEY + \",\" + // \n EventFeedJSON.PROBLEM_KEY + \",\" + // \n EventFeedJSON.RUN_KEY + \",\" + // \n EventFeedJSON.RUN_KEY + \",\" + // \n EventFeedJSON.SUBMISSION_KEY + \",\" + // \n EventFeedJSON.CLARIFICATIONS_KEY + \",\" + // \n EventFeedJSON.TEAM_KEY + \",\" + // \n EventFeedJSON.TEAM_MEMBERS_KEY;\n\n eventFeedJSON.setEventTypeList(elist);\n String json = eventFeedJSON.createJSON(data.getContest(), null, null);\n assertNotNull(json);\n \n // editFile(writeFile(new File(\"/tmp/stuf.\" + System.currentTimeMillis() + \".json\"), json));\n\n assertCountEvent(2, EventFeedJSON.CONTEST_KEY, json);\n assertCountEvent(200, EventFeedJSON.CLARIFICATIONS_KEY, json);\n assertCountEvent(600, EventFeedJSON.TEAM_MEMBERS_KEY, json);\n assertCountEvent(120, EventFeedJSON.TEAM_KEY, json);\n assertCountEvent(6, EventFeedJSON.LANGUAGE_KEY, json);\n assertCountEvent(24, EventFeedJSON.JUDGEMENT_KEY, json);\n assertCountEvent(9, EventFeedJSON.JUDGEMENT_TYPE_KEY, json);\n }",
"@org.junit.Test\n public void testGetFirst() {\n System.out.println(\"getFirst\");\n TestDataGenerator instance = new TestDataGenerator();\n First result = instance.getFirst();\n //\n Assert.assertEquals(\"Here is a string to check\", result.getOruString());\n Assert.assertEquals(444422, result.getOruInt());\n Assert.assertTrue(result.isOruBoolean());\n Assert.assertEquals(8.8886664E7f, result.getOruFloat(), 0);\n Assert.assertEquals(5555533333222L, result.getOruLong());\n Assert.assertEquals(9.99966663322E9, result.getOruDoble(), 0);\n Assert.assertEquals(OruEnum.FIRST_ENUM, result.getOruEnum());\n Assert.assertNotNull(result.getSecond());\n // Second //\n Assert.assertEquals(531223, result.getSecond().getSecondInt());\n Assert.assertEquals(666666666L, result.getSecond().getOruLong());\n Assert.assertEquals(\"Here is a second String\", result.getSecond().getSecondString());\n Assert.assertFalse(result.getSecond().isSecondBoolean());\n Assert.assertEquals(4444.333f, result.getSecond().getSecondFloat(), 0);\n Assert.assertEquals(555555.55555, result.getSecond().getSecondDoble(), 0);\n Assert.assertNotNull(result.getListOfThrird());\n //Collection\n Assert.assertEquals(3, result.getListOfThrird().size());\n // 1\n Thrird thrird = result.getListOfThrird().get(0);\n Assert.assertEquals(0, thrird.getThrirdInt());\n Assert.assertEquals(0L, thrird.getThrirdLong());\n Assert.assertEquals(\"Thrird String 0\", thrird.getThrirdString());\n Assert.assertTrue(thrird.isThrirdBoolean());\n Assert.assertEquals(0.0f, thrird.getThrirdFloat(), 0);\n Assert.assertEquals(0.0, thrird.getThrirdDoble(), 0);\n // 2\n Thrird thrird2 = result.getListOfThrird().get(1);\n Assert.assertEquals(1, thrird2.getThrirdInt());\n Assert.assertEquals(1L, thrird2.getThrirdLong());\n Assert.assertEquals(\"Thrird String 1\", thrird2.getThrirdString());\n Assert.assertTrue(thrird2.isThrirdBoolean());\n Assert.assertEquals(1.0f, thrird2.getThrirdFloat(), 0);\n Assert.assertEquals(1.0, thrird2.getThrirdDoble(), 0);\n // 3\n Thrird thrird3 = result.getListOfThrird().get(2);\n Assert.assertEquals(2, thrird3.getThrirdInt());\n Assert.assertEquals(2L, thrird3.getThrirdLong());\n Assert.assertEquals(\"Thrird String 2\", thrird3.getThrirdString());\n Assert.assertTrue(thrird3.isThrirdBoolean());\n Assert.assertEquals(2.0f, thrird3.getThrirdFloat(), 0);\n Assert.assertEquals(2.0, thrird3.getThrirdDoble(), 0);\n Assert.assertNotNull(result.getCollectionOfObjects());\n //Collection\n //Support for [java.util.HashMap$KeySet] is yet to be added\n Assert.assertNotNull(result.getMapOfThrird());\n //MAP\n Assert.assertEquals(5, result.getMapOfThrird().size());\n // 1\n Thrird thrird4 = result.getMapOfThrird().get(\"KEY_12\");\n Assert.assertEquals(12, thrird4.getThrirdInt());\n Assert.assertEquals(12L, thrird4.getThrirdLong());\n Assert.assertEquals(\"Thrird String 12\", thrird4.getThrirdString());\n Assert.assertTrue(thrird4.isThrirdBoolean());\n Assert.assertEquals(12.0f, thrird4.getThrirdFloat(), 0);\n Assert.assertEquals(12.0, thrird4.getThrirdDoble(), 0);\n // 1\n Thrird thrird5 = result.getMapOfThrird().get(\"KEY_11\");\n Assert.assertEquals(11, thrird5.getThrirdInt());\n Assert.assertEquals(11L, thrird5.getThrirdLong());\n Assert.assertEquals(\"Thrird String 11\", thrird5.getThrirdString());\n Assert.assertTrue(thrird5.isThrirdBoolean());\n Assert.assertEquals(11.0f, thrird5.getThrirdFloat(), 0);\n Assert.assertEquals(11.0, thrird5.getThrirdDoble(), 0);\n // 1\n Thrird thrird6 = result.getMapOfThrird().get(\"KEY_14\");\n Assert.assertEquals(14, thrird6.getThrirdInt());\n Assert.assertEquals(14L, thrird6.getThrirdLong());\n Assert.assertEquals(\"Thrird String 14\", thrird6.getThrirdString());\n Assert.assertTrue(thrird6.isThrirdBoolean());\n Assert.assertEquals(14.0f, thrird6.getThrirdFloat(), 0);\n Assert.assertEquals(14.0, thrird6.getThrirdDoble(), 0);\n // 1\n Thrird thrird7 = result.getMapOfThrird().get(\"KEY_13\");\n Assert.assertEquals(13, thrird7.getThrirdInt());\n Assert.assertEquals(13L, thrird7.getThrirdLong());\n Assert.assertEquals(\"Thrird String 13\", thrird7.getThrirdString());\n Assert.assertTrue(thrird7.isThrirdBoolean());\n Assert.assertEquals(13.0f, thrird7.getThrirdFloat(), 0);\n Assert.assertEquals(13.0, thrird7.getThrirdDoble(), 0);\n // 1\n Thrird thrird8 = result.getMapOfThrird().get(\"KEY_10\");\n Assert.assertEquals(10, thrird8.getThrirdInt());\n Assert.assertEquals(10L, thrird8.getThrirdLong());\n Assert.assertEquals(\"Thrird String 10\", thrird8.getThrirdString());\n Assert.assertTrue(thrird8.isThrirdBoolean());\n Assert.assertEquals(10.0f, thrird8.getThrirdFloat(), 0);\n Assert.assertEquals(10.0, thrird8.getThrirdDoble(), 0);\n Assert.assertNotNull(result.getMapOfObjects());\n //MAP\n Assert.assertEquals(8, result.getMapOfObjects().size());\n Assert.assertEquals(\"VALUE_7\", result.getMapOfObjects().get(\"KEY_FOR_STRING\"));\n Assert.assertEquals(\"VALUE_1\", result.getMapOfObjects().get(new Character('1')));\n Assert.assertEquals(\"VALUE_7\", result.getMapOfObjects().get(new Double(123456.7890625)));\n Assert.assertEquals(\"VALUE_4\", result.getMapOfObjects().get(new Integer(1234567)));\n Assert.assertEquals(\"VALUE_6\", result.getMapOfObjects().get(new Float(1234.56F)));\n Assert.assertEquals(\"VALUE_5\", result.getMapOfObjects().get(new Long(1234567891011L)));\n Assert.assertEquals(\"VALUE_3\", result.getMapOfObjects().get(new Short((short) 12345)));\n Assert.assertEquals(\"VALUE_2\", result.getMapOfObjects().get(new Byte((byte) 123)));\n Assert.assertNotNull(result.getArrayOfThrird());\n //Array\n Assert.assertEquals(5, result.getArrayOfThrird().length);\n // 1\n Thrird thrird9 = result.getArrayOfThrird()[0];\n Assert.assertEquals(0, thrird9.getThrirdInt());\n Assert.assertEquals(0L, thrird9.getThrirdLong());\n Assert.assertEquals(\"Thrird String 0\", thrird9.getThrirdString());\n Assert.assertTrue(thrird9.isThrirdBoolean());\n Assert.assertEquals(0.0f, thrird9.getThrirdFloat(), 0);\n Assert.assertEquals(0.0, thrird9.getThrirdDoble(), 0);\n // 2\n Thrird thrird10 = result.getArrayOfThrird()[1];\n Assert.assertEquals(1, thrird10.getThrirdInt());\n Assert.assertEquals(1L, thrird10.getThrirdLong());\n Assert.assertEquals(\"Thrird String 1\", thrird10.getThrirdString());\n Assert.assertTrue(thrird10.isThrirdBoolean());\n Assert.assertEquals(1.0f, thrird10.getThrirdFloat(), 0);\n Assert.assertEquals(1.0, thrird10.getThrirdDoble(), 0);\n // 3\n Thrird thrird11 = result.getArrayOfThrird()[2];\n Assert.assertEquals(2, thrird11.getThrirdInt());\n Assert.assertEquals(2L, thrird11.getThrirdLong());\n Assert.assertEquals(\"Thrird String 2\", thrird11.getThrirdString());\n Assert.assertTrue(thrird11.isThrirdBoolean());\n Assert.assertEquals(2.0f, thrird11.getThrirdFloat(), 0);\n Assert.assertEquals(2.0, thrird11.getThrirdDoble(), 0);\n // 4\n Assert.assertNull(result.getArrayOfThrird()[3]);\n // 5\n Assert.assertNull(result.getArrayOfThrird()[4]);\n Assert.assertNotNull(result.getArrayOfString());\n //Array\n Assert.assertEquals(3, result.getArrayOfString().length);\n // 1\n Assert.assertEquals(\"array_1\", result.getArrayOfString()[0]);\n // 2\n Assert.assertEquals(\"array_2\", result.getArrayOfString()[1]);\n // 3\n Assert.assertEquals(\"arrat_3\", result.getArrayOfString()[2]);\n }",
"@Test\n public void recordTypeTest() {\n // TODO: test recordType\n }",
"@Test\n public void jUnitTest01(){\n TigerLexer lex;\n try {\n lex = new TigerLexer(new ANTLRFileStream(\"test/jUnitTests/jUnitTest01.tig\", \"UTF8\"));\n CommonTokenStream tokens = new CommonTokenStream(lex);\n TigerParser parser = new TigerParser(tokens);\n SemantVisitor visitor = new SemantVisitor();\n parser.prog();\n boolean resp = (parser.getNumberOfSyntaxErrors() == 0 && visitor.getNumberOfSemanticErrors() == 0);\n assertTrue(resp);\n } catch (IOException ex) {\n Logger.getLogger(TesteGlobal.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"public void setUp() {\r\n tree = new Lab14BinarySearchTree<String>();\r\n }",
"@Test\n public void jUnitTest05(){\n TigerLexer lex;\n try {\n lex = new TigerLexer(new ANTLRFileStream(\"test/jUnitTests/jUnitTest05.tig\", \"UTF8\"));\n CommonTokenStream tokens = new CommonTokenStream(lex);\n TigerParser parser = new TigerParser(tokens);\n SemantVisitor visitor = new SemantVisitor();\n parser.prog();\n boolean resp = (parser.getNumberOfSyntaxErrors() == 0 && visitor.getNumberOfSemanticErrors() == 0);\n assertTrue(resp);\n } catch (IOException ex) {\n Logger.getLogger(TesteGlobal.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"@Test\n public void jUnitTest04(){\n TigerLexer lex;\n try {\n lex = new TigerLexer(new ANTLRFileStream(\"test/jUnitTests/jUnitTest04.tig\", \"UTF8\"));\n CommonTokenStream tokens = new CommonTokenStream(lex);\n TigerParser parser = new TigerParser(tokens);\n SemantVisitor visitor = new SemantVisitor();\n parser.prog();\n boolean resp = (parser.getNumberOfSyntaxErrors() == 0 && visitor.getNumberOfSemanticErrors() == 0);\n assertTrue(resp);\n } catch (IOException ex) {\n Logger.getLogger(TesteGlobal.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"@Test\n public void jUnitTest03(){\n TigerLexer lex;\n try {\n lex = new TigerLexer(new ANTLRFileStream(\"test/jUnitTests/jUnitTest03.tig\", \"UTF8\"));\n CommonTokenStream tokens = new CommonTokenStream(lex);\n TigerParser parser = new TigerParser(tokens);\n SemantVisitor visitor = new SemantVisitor();\n parser.prog();\n boolean resp = (parser.getNumberOfSyntaxErrors() == 0 && visitor.getNumberOfSemanticErrors() == 0);\n assertTrue(resp);\n } catch (IOException ex) {\n Logger.getLogger(TesteGlobal.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"@Test\n public void jUnitTest02(){\n TigerLexer lex;\n try {\n lex = new TigerLexer(new ANTLRFileStream(\"test/jUnitTests/jUnitTest02.tig\", \"UTF8\"));\n CommonTokenStream tokens = new CommonTokenStream(lex);\n TigerParser parser = new TigerParser(tokens);\n SemantVisitor visitor = new SemantVisitor();\n parser.prog();\n boolean resp = (parser.getNumberOfSyntaxErrors() == 0 && visitor.getNumberOfSemanticErrors() == 0);\n assertTrue(resp);\n } catch (IOException ex) {\n Logger.getLogger(TesteGlobal.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"public void testGetTagType_1_accuracy() {\n instance.setTagType(\"tagtype\");\n assertEquals(\"The type is not set properly.\", \"tagtype\", instance.getTagType());\n }",
"@Test\n public void jUnitTest06(){\n TigerLexer lex;\n try {\n lex = new TigerLexer(new ANTLRFileStream(\"test/jUnitTests/jUnitTest06.tig\", \"UTF8\"));\n CommonTokenStream tokens = new CommonTokenStream(lex);\n TigerParser parser = new TigerParser(tokens);\n SemantVisitor visitor = new SemantVisitor();\n parser.prog();\n boolean resp = (parser.getNumberOfSyntaxErrors() == 0 && visitor.getNumberOfSemanticErrors() == 0);\n assertTrue(resp);\n } catch (IOException ex) {\n Logger.getLogger(TesteGlobal.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"@Test\n public void osTypeTest() {\n // TODO: test osType\n }",
"@Test\n public void genericTest() {\n TestObject to = testAsGeneric(ASJSON, TestObject.class);\n assertEquals(\"test\", to.getData());\n }",
"@RepeatedTest(20)\n void transformtoTStringTest(){\n assertEquals(st.transformtoString(),new TString(hello));\n assertEquals(bot.transformtoString(),new TString(bot.toString()));\n assertEquals(bof.transformtoString(),new TString(bof.toString()));\n assertEquals(f.transformtoString(),new TString(f.toString()));\n assertEquals(i.transformtoString(),new TString(i.toString()));\n assertEquals(bi.transformtoString(),new TString(bi.toString()));\n assertEquals(Null.transformtoString(), Null);\n }",
"@Test\r\n public void testGetType() {\r\n System.out.println(\"getType\");\r\n Table instance = new Table(\"S\",2);\r\n String expResult = \"S\";\r\n String result = instance.getType();\r\n assertEquals(expResult, result);\r\n \r\n }",
"@Test\n\tpublic void typeCheckTest(){\n\t\tSystem.out.println(\"kenta\");\n\t\tSemanticActions actions = new SemanticActions();\n\t\tVariableEntry idInt = new VariableEntry(\"v1\", TokenType.INTEGER);\n\t\tVariableEntry idReal = new VariableEntry(\"v2\", TokenType.REAL);\n\t\tVariableEntry idInt2 = new VariableEntry(\"v3\", TokenType.INTEGER);\n\t\tVariableEntry idReal2 = new VariableEntry(\"v4\", TokenType.REAL);\n\t\tVariableEntry error = new VariableEntry(\"v5\", TokenType.ADDOP);\n\t\tassertTrue(actions.typeCheck(idInt, idInt2) == 0);\n\t\tassertTrue(actions.typeCheck(idReal, idReal2) == 1);\n\t\tassertTrue(actions.typeCheck(idReal, idInt2) == 2);\n\t\tassertTrue(actions.typeCheck(idInt, idReal) == 3);\n\t\tassertTrue(actions.typeCheck(idReal, error) == 4);\n\t\tassertTrue(actions.typeCheck(error, idInt) == 4);\n\t}",
"@Test\n public void testRequireAtomString_GenericType_1() {\n LOGGER.info(\"requireAtomString\");\n final AtomString actual = new AtomString();\n final AtomString expected = requireAtomString(actual);\n assertEquals(expected, actual);\n }",
"@Test\n public void z_topDown_TC03() {\n try {\n Intrebare intrebare = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"M\");\n Intrebare intrebare1 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"A\");\n Intrebare intrebare2 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"B\");\n Intrebare intrebare3 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"C\");\n assertTrue(true);\n assertTrue(appService.exists(intrebare));\n assertTrue(appService.exists(intrebare1));\n assertTrue(appService.exists(intrebare2));\n assertTrue(appService.exists(intrebare3));\n\n try {\n ccir2082MV.evaluator.model.Test test = appService.createNewTest();\n assertTrue(test.getIntrebari().contains(intrebare));\n assertTrue(test.getIntrebari().contains(intrebare1));\n assertTrue(test.getIntrebari().contains(intrebare2));\n assertTrue(test.getIntrebari().contains(intrebare3));\n assertTrue(test.getIntrebari().size() == 5);\n } catch (NotAbleToCreateTestException e) {\n assertTrue(false);\n }\n\n Statistica statistica = appService.getStatistica();\n assertTrue(statistica.getIntrebariDomenii().containsKey(\"Literatura\"));\n assertTrue(statistica.getIntrebariDomenii().get(\"Literatura\")==1);\n\n assertTrue(statistica.getIntrebariDomenii().containsKey(\"M\"));\n assertTrue(statistica.getIntrebariDomenii().get(\"M\")==1);\n\n assertTrue(statistica.getIntrebariDomenii().containsKey(\"A\"));\n assertTrue(statistica.getIntrebariDomenii().get(\"A\")==1);\n\n assertTrue(statistica.getIntrebariDomenii().containsKey(\"B\"));\n assertTrue(statistica.getIntrebariDomenii().get(\"B\")==1);\n\n assertTrue(statistica.getIntrebariDomenii().containsKey(\"C\"));\n assertTrue(statistica.getIntrebariDomenii().get(\"C\")==1);\n\n } catch (DuplicateIntrebareException | IntrebareValidatorFailedException e) {\n e.printStackTrace();\n assertTrue(false);\n } catch (NotAbleToCreateStatisticsException e) {\n assertTrue(false);\n }\n }",
"@Test\n public void atTypeTest() {\n // TODO: test atType\n }",
"@Test\n public void testCheck() throws Exception {\n System.out.println(\"check\");\n byte[] bytes = {0,1,2};\n data = new Data(bytes);\n module = new TestModule(null,\"module\");\n generic = new Generic<UDT_Test_3Bytes>(module, \"generic\");\n udt = new UDT_Test_3Bytes(null, new Address(0,Address.NA,UDT_Test_3Bytes.getSize()), 0, new Data(bytes));\n instance = new IoGeneric(generic, udt);\n module.start();\n while(module.isAlive()) Thread.sleep(500);\n assert(true);\n }",
"public void testGetBasedata() {\n }",
"@Test\n public void testAdd_GenericType() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n boolean expResult = true;\n boolean result = instance.add(1);\n assertEquals(expResult, result);\n }",
"public static void main(String[] args) {\n\t\tUtility utility = new Utility();\n\t\t\n\t\t// build trainingset\n\t\tSystem.out.println(\"Training System....\");\n\t\tArrayList<Student> trainingSet = utility.readStudentfile(\"porto_math_train.csv\");\n\t\tArrayList<Variable> variableSets = Student.getAllVar();\n\n\t\tTree tree = new Tree();\n\t\tNode decisionTree = tree.buildTree2(trainingSet, variableSets);\n\n\t\tutility .printNode(decisionTree);\n\n\t\t// testing DT\n\t\tSystem.out.println(\"\\tTesting System (trainingSet)....\");\n\t\tutility.testTree2(trainingSet, decisionTree);\n\t\t\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"\\tTesting System (testSet)....\");\n\t\tArrayList<Student> testSet = utility.readStudentfile(\"porto_math_test.csv\");\n\t\tutility.testTree2(testSet, decisionTree);\t\t\n\t}",
"@Test\n public void testGetStype() {\n System.out.println(\"getStype && setStype\");\n Setting instance = Setting.factory();\n Setting.SETTING_TYPE expResult = Setting.SETTING_TYPE.UND;\n Setting.SETTING_TYPE result = instance.getStype();\n assertEquals(expResult, result);\n\n instance.setStype(Setting.SETTING_TYPE.TSTRING);\n instance.setValue(\"text\");\n instance.setName(\"test\");\n\n Setting s = Setting.getSetting(\"test\");\n JSONObject jo = new JSONObject(s.toJSONString());\n Setting.removeSetting(s);\n assertTrue(Setting.isNotUsed(\"test\"));\n\n Setting ss = Setting.factory(jo);\n assertFalse(Setting.isNotUsed(\"test\"));\n assertEquals(Setting.SETTING_TYPE.TSTRING, ss.getStype());\n\n }",
"public static void main(String[] args) {\n new TSL2550Test();\n }",
"@Test\n public void testReadTtbinFile_String()\n {\n System.out.println(\"TEST: readTtbinFile\");\n String fileName = \"src/test/resources/test.ttbin\";\n TomTomReader instance = TomTomReader.getInstance();\n Activity expResult = null;\n Activity result = instance.readTtbinFile(fileName);\n\n testContentsNonSmoothed(result);\n }",
"@Test\n public void shouldNotParseXXXXXXTYPE() {\n printTest(\"shouldNotParseXXXXXXTYPE()\");\n String typeString = \"XXXXXXTYPE\";\n String content = typeString;\n\n DdlTokenStream tokens = getTokens(content);\n\n DataType dType = null;\n try {\n dType = parser.parse(tokens);\n } catch (ParsingException e) {\n // Expect exception\n }\n\n Assert.assertNull(\"DataType should NOT have been found for Type = \" + typeString, dType);\n }",
"@Test\n public void test_cast() {\n \n\n }",
"@Test\n public void sunnyday_string(){\n SetupMocks.setup();\n\n List<Token> tokens= new ArrayList<>();\n\n tokens.add(new Token(Token.TSTRG,1,1,null));\n\n\n tokens.add(new Token(Token.TILIT,1,1,null));\n\n Parser parser = new Parser(tokens);\n\n NPrintItemNode nPrintItemNode = new NPrintItemNode();\n nPrintItemNode.setnExprNode(NExprNode.INSTANCE());\n\n TreeNode printitem = nPrintItemNode.make(parser);\n\n assertEquals(TreeNode.NSTRG, printitem.getValue());\n\n }",
"@Test\n\tpublic void testTower()\n\t{\n\t\tassertEquals(1,tower.getNum());\n\t\tassertEquals(22,tower.getPosition().getIntAbscisse());\n\t\tassertEquals(23,tower.getPosition().getIntOrdonne());\n\t}",
"public static void main(String[] args) throws IOException {\n\t\t testType1();\n\n\t\t// testMatrix();\n//\t\ttestKening();\n\t\t\n//\t\ttestOutline();\n\t}",
"@Test\n public void testGetManagerTypeString() {\n System.out.println(\"getManagerTypeString\");\n Manager instance = new Manager();\n String expResult = \"\";\n String result = instance.getManagerTypeString();\n assertEquals(expResult, result);\n \n fail(\"The test case is a prototype.\");\n }",
"Test convert(TestData testData);",
"@Before\n public void setUp()\n { example = new BSTTreeBlueJ<Integer>();\n example2 = new BSTTreeBlueJ<Integer>();\n example3 = new BSTTreeBlueJ<Integer>();\n }",
"public static void main(String[] args) {\n\t\t\r\n\t\tTest<Integer, String> test = new Test<Integer, String>(45, \"Test example\");\r\n\t\ttest.print();\r\n\t\t\r\n\t\tTest<String, String> test1 = new Test<String, String>(\"Apple\", \"Ball\");\r\n\t\ttest1.print();\r\n\t\t\r\n\t\tTest<Boolean, Boolean> tesBoo = new Test<Boolean, Boolean>(true, false);\r\n\t\ttesBoo.print();\r\n\t\t\r\n\t}",
"public static void main(String[] args) {\n BTNode<Integer> tree = new BTNode<>(3);\n tree.setLeft(new BTNode<>(2));\n tree.getLeft().setLeft(new BTNode<>(1));\n tree.setRight(new BTNode<>(5));\n tree.getRight().setLeft(new BTNode<>(4));\n tree.getRight().setRight(new BTNode<>(6));\n // should output true.\n assert isBinaryTreeBST(tree);\n System.out.println(isBinaryTreeBST(tree));\n // 10\n // 2 5\n // 1 4 6\n tree.setData(10);\n // should output false.\n assert !isBinaryTreeBST(tree);\n System.out.println(isBinaryTreeBST(tree));\n // should output true.\n assert isBinaryTreeBST(null);\n System.out.println(isBinaryTreeBST(null));\n }",
"public static void main(String[] args) {\n\t\tTestST st2 = TestST.getInstance();\r\n\t}",
"@Test\n\tpublic void testGetNST_1()\n\t\tthrows Exception {\n\t\tPatientAccessor fixture = new PatientAccessor(\"\");\n\t\tString hospitalNumber = \"\";\n\t\tint weekNumber = 1;\n\n\t\tNST result = fixture.getNST(hospitalNumber, weekNumber);\n\n\t\t// add additional test code here\n\t\t// An unexpected exception was thrown in user code while executing this test:\n\t\t// java.lang.IllegalStateException: _out shouldn't be null\n\t\t// at com.mongodb.DBPort.go(DBPort.java:110)\n\t\t// at com.mongodb.DBPort.call(DBPort.java:74)\n\t\t// at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:286)\n\t\t// at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:257)\n\t\t// at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:310)\n\t\t// at com.mongodb.DB.command(DB.java:274)\n\t\t// at com.mongodb.DB.command(DB.java:256)\n\t\t// at com.mongodb.DB.command(DB.java:313)\n\t\t// at com.mongodb.Mongo.getDatabaseNames(Mongo.java:393)\n\t\t// at com.comp2014group5.generic_database.FormDatabaseMongoImpl.<init>(FormDatabaseMongoImpl.java:24)\n\t\t// at com.comp2014.group5.patient_database.PatientAccessor.<init>(PatientAccessor.java:29)\n\t\tassertNotNull(result);\n\t}",
"@Test(timeout = 4000)\n public void test00() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n TechnicalInformation technicalInformation0 = lovinsStemmer0.getTechnicalInformation();\n assertEquals(TechnicalInformation.Type.ARTICLE, technicalInformation0.getType());\n }",
"@Test\n public void testDAM31303001() {\n\n // Data preparation\n {\n clearAndCreateTestDataForBook();\n }\n\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n\n TodoListPage todoListPage = dam3IndexPage.dam31301001Click();\n\n TodoDetailsPage todoDetailsPage = todoListPage.displayTodoDetail(\n \"0000000010\");\n\n assertThat(todoDetailsPage.getTodoTitle(), equalTo(\"Todo 10\"));\n assertThat(todoDetailsPage.getTodoID(), equalTo(\"0000000010\"));\n assertThat(todoDetailsPage.getTodoCategory(), equalTo(\"CA5\"));\n assertThat(todoDetailsPage.getTodoStatus(), equalTo(\"true\"));\n assertThat(todoDetailsPage.getTodoCreatedDate(), equalTo(\"2016/12/29\"));\n assertThat(todoDetailsPage.getTodoVersion(), equalTo(\"1\"));\n\n // completion date is of timeStamp in DB whereas in entity its of type or.joda.time.DateTime\n // type handler converts appropriately timeStamp to DateTime\n assertThat(todoDetailsPage.getTodoCompleteDate(), equalTo(\n \"2016/12/30\"));\n }",
"public static void main(String[] args) throws IOException {\n\r\n ParserMain Parse = new ParserMain(args);\r\n Node n_program = Parse.program();\r\n\tSystem.out.println(\"\\ninside parser: parsing end, pass tree ro type checking\\n\");\r\n CodeGener cg= new CodeGener(n_program,args[0]); ////////////////////////////////////////////////////////////////////////////////////kavita\r\n h_typeCheckingClass tp = new h_typeCheckingClass(n_program);\r\n Node result = tp.starttype(n_program);\r\n\tSystem.out.println(\"\\ninside parser: TYPE checking end, pass tree to WRITING AST\\n\");\r\n AST2word ast=new AST2word();\r\n ast.read(result, args);\r\n\r\n\r\n\r\n\r\n }",
"public static void main(String[] args) {\n\n String filename = \"D:\\\\Project\\\\Java\\\\DataStructure\\\\Set\\\\src\\\\test\\\\pride-and-prejudice.txt\";\n BSTSet<String> bstSet = new BSTSet<>();\n double time1 = testSet(bstSet, filename);\n System.out.println(time1);\n LinkedListSet<String> listSet = new LinkedListSet<>();\n double time2 = testSet(listSet, filename);\n System.out.println(time2);\n AVLSet<String> avlSet = new AVLSet<>();\n double time3 = testSet(avlSet, filename);\n System.out.println(time3);\n }",
"@Test\n public void shouldParseDATE() {\n printTest(\"shouldParseDATE()\");\n String typeString = getDataTypeString(DataTypes.DTYPE_DATE);\n String content = typeString;\n\n DdlTokenStream tokens = getTokens(content);\n\n DataType dType = parser.parse(tokens);\n\n Assert.assertNotNull(\"DataType was NOT found for Type = \" + typeString, dType);\n Assert.assertEquals(\"Wrong DataType found\", typeString, dType.getName());\n }",
"@Test\n\tpublic void testAll() {\n\n\t\tassertEquals(\"Not specified\", getAtonType(0));\n\t\tassertEquals(\"unknown code 100\", getAtonType(100));\n\t\tassertEquals(\"Fixed - Light, without sectors\", getAtonType(5));\n\t\tassertEquals(\"Fixed - Beacon, Cardinal E\", getAtonType(10));\n\t\tassertEquals(\"Floating - Light Vessel, LANBY, Rigs\", getAtonType(31));\n\t\tassertEquals(\"Fixed - Beacon, Isolated danger\", getAtonType(17));\n\t\tassertEquals(\"Fixed - Beacon, Special mark\", getAtonType(19));\n\t\tassertEquals(\"Floating - Cardinal Mark N\", getAtonType(20));\n\t\tassertEquals(\"Floating - Cardinal Mark E\", getAtonType(21));\n\n\t}",
"@Test\n public void testGetAnalyzedData() {\n System.out.println(\"getAnalyzedData\");\n \n }",
"@Test\n public void comeTypeTest() {\n // TODO: test comeType\n }",
"@Test\n\tpublic void findTypeList() {\n\t}",
"@Test\n public void testAddTablet() {\n System.out.println(\"addTablet\");\n Tablet tb = new Tablet(\"T005\", \"tablet005\", 0,0);\n DBTablet instance = new DBTablet();\n boolean expResult = true;\n boolean result = instance.addTablet(tb);\n assertEquals(expResult, result);\n }",
"public BSTTreeBlueJTest()\n {\n }",
"@Test\n public void testValidDataRtd() throws InterruptedException {\n // validate data renge of cpuWorkLoad\n System.out.println(\"**********************************\");\n System.out.println(\"validate data renge of cpuWorkLoad\");\n System.out.println(\"**********************************\");\n cpuWorkLoad.setMinValid(new Float(0));\n cpuWorkLoad.setMaxValid(new Float(100));\n try {\n System.out.print(\"cpuWorkLoad=100.0001;\");\n cpuWorkLoad.setData(new Float(100.0001));\n fail(\"Data not in valid range\");\n } catch (NotValidRtdData ex) {\n System.out.println(\"Not valid data for cpuWorkLoad<Float> type\");\n assertNotNull(\"Exception exit for not valid data for cpuWorkLoad<Float> type\", ex);\n } catch (RtdException ex) {\n fail(ex.getMessage());\n }\n try {\n System.out.print(\"cpuWorkLoad=-0.0001;\");\n cpuWorkLoad.setData(new Float(-0.0001));\n fail(\"Data not in valid range\");\n } catch (NotValidRtdData ex) {\n System.out.println(\"Not valid data for cpuWorkLoad<Float> type\");\n assertNotNull(\"Exception exit for not valid data for cpuWorkLoad<Float> type\", ex);\n } catch (RtdException ex) {\n fail(ex.getMessage());\n }\n try {\n cpuWorkLoad.setData(new Float(70));\n System.out.print(\"cpuWorkLoad=\"+cpuWorkLoad.getData()+\";\");\n assertNotNull(\"Pass set valid data range for float\", cpuWorkLoad);\n System.out.println(\"Valid data for cpuWorkLoad<Float> type\");\n } catch (RtdException ex) {\n fail(ex.getMessage());\n }\n \n // validate maxDataError nor change but valid time\n System.out.println(\"*******************************\");\n System.out.println(\"*** Test maxDataError ***\");\n System.out.println(\"*** set minimum change to 5 ***\");\n System.out.println(\"*******************************\");\n\n// try {\n// cpuWorkLoad.setData(new Float(30));\n// assertTrue(new Float(30).equals(cpuWorkLoad.getData()));\n// } catch (RtdException ex) {\n// fail(ex.getMessage());\n// }\n \n\n cpuWorkLoad.setMaxDataError(new Float(5.0));\n try {\n // set current time\n cpuWorkLoad.setData(new Float(35));\n System.out.print(\"set=35;\");\n System.out.print(\"cpuWorkLoad=\" + cpuWorkLoad.getData()+\";\");\n assertTrue(new Float(35).equals(cpuWorkLoad.getData()));\n System.out.print(\"now=\" + System.currentTimeMillis()+\";\");\n System.out.print(\"VILB=\" + cpuWorkLoad.getValidityIntervalLowerBound()+\";\");\n System.out.println(\"VIUB=\" + cpuWorkLoad.getValidityIntervalUpperBound());\n assertTrue(System.currentTimeMillis() <= cpuWorkLoad.getValidityIntervalUpperBound());\n } catch (RtdException ex) {\n fail(ex.getMessage());\n }\n\n try {\n // set current time\n cpuWorkLoad.setData(new Float(39.99999));\n System.out.print(\"set=39.99999;\");\n System.out.print(\"cpuWorkLoad=\" + cpuWorkLoad.getData()+\";\");\n assertTrue(new Float(35).equals(cpuWorkLoad.getData()));\n System.out.print(\"now=\" + System.currentTimeMillis()+\";\");\n System.out.print(\"VILB=\" + cpuWorkLoad.getValidityIntervalLowerBound()+\";\");\n System.out.println(\"VIUB=\" + cpuWorkLoad.getValidityIntervalUpperBound());\n assertTrue(System.currentTimeMillis() <= cpuWorkLoad.getValidityIntervalUpperBound());\n } catch (RtdException ex) {\n fail(ex.getMessage());\n }\n\n try {\n // set current time\n cpuWorkLoad.setData(new Float(45));\n System.out.print(\"set=45;\");\n System.out.print(\"cpuWorkLoad=\" + cpuWorkLoad.getData()+\";\");\n assertTrue(new Float(45).equals(cpuWorkLoad.getData()));\n System.out.print(\"now=\" + System.currentTimeMillis()+\";\");\n System.out.print(\"VILB=\" + cpuWorkLoad.getValidityIntervalLowerBound()+\";\");\n System.out.println(\"VIUB=\" + cpuWorkLoad.getValidityIntervalUpperBound());\n assertTrue(System.currentTimeMillis() <= cpuWorkLoad.getValidityIntervalUpperBound());\n System.out.println(\"----------------------------------------\");\n } catch (RtdException ex) {\n fail(ex.getMessage());\n }\n System.out.println(\"----------------------------------------\");\n }",
"@Test\n\tpublic void testSchemaViewer() throws Exception {\n\t\tnew ExecuteRunnable<TestData>().runTests(new RunnableTests<TestData>() {\n\t\t\tpublic void runTest(TestData testData) {\n\t\t\t\tString result = runSchemaViewer(testData.flag, testData.value);\n\t\t\t\tassertThat(testData.result).isEqualTo(result);\n\t\t\t}\n\t\t}, viewerTestData);\n\t}",
"public static void main(String[] args) {\n\t\t \n\t\tResult result1 = JUnitCore.runClasses(TestUnitForCreate.class);\n\t for (Failure failure : result1.getFailures()) {\n\t System.out.println(failure.toString());\n\t }\n\t System.out.println(result1.wasSuccessful());\n\n\t Result result2 = JUnitCore.runClasses(TestUnitForReadByCalimNumber.class);\n\t for (Failure failure : result2.getFailures()) {\n\t System.out.println(failure.toString());\n\t }\n\t System.out.println(result2.wasSuccessful());\n\t \n\t Result result3 = JUnitCore.runClasses(TestUnitForReadByLossDate.class);\n\t for (Failure failure : result3.getFailures()) {\n\t System.out.println(failure.toString());\n\t }\n\t System.out.println(result3.wasSuccessful());\n\t \n\t\tResult result4 = JUnitCore.runClasses(TestUnitForUpdate.class);\n\t\tfor (Failure failure : result4.getFailures()) {\n\t\t\tSystem.out.println(failure.toString());\n\t\t}\n\t\tSystem.out.println(result4.wasSuccessful());\n\t \n\t Result result5 = JUnitCore.runClasses(TestUnitForReadVehicle.class);\n\t for (Failure failure : result5.getFailures()) {\n\t System.out.println(failure.toString());\n\t }\n\t System.out.println(result5.wasSuccessful());\n \n\t Result result6 = JUnitCore.runClasses(TestUnitForDelete.class);\n\t for (Failure failure : result6.getFailures()) {\n\t System.out.println(failure.toString());\n\t }\n\t System.out.println(result6.wasSuccessful());\n\t \n\t}",
"@Test \n\tpublic void testTopologyNodes() { \n\t\tRestAssured.registerParser(\"text/plain\", Parser.JSON);\n\t\texpect().get(\"/rest/topo\").then().statusCode(200).assertThat().body(\"nodes\", Matchers.notNullValue());\n\t}",
"@Test\n public void testParse() {\n System.out.println(\"testing parse\");\n instance.parse();\n if(Scientists.getScientistList().isEmpty()){\n fail(\"Unable to parse database file\");\n }\n // all lines should be parsed\n assertEquals(countLines(), Scientists.getScientistList().size()); \n System.out.println(Scientists.toPlain());\n }",
"@Test\n\tpublic void testMain() {\n\t\t// TODO: test output streams for various IO methods, emulating a user's\n\t\t// input - kinda like Joel did for CSSE2310\n\t\tAssert.fail();\n\t}",
"public void testCheck()\r\n {\n DataUtil.check(9, \"This is a test!\");\r\n }",
"public void testSetBasedata() {\n }",
"@Test\r\n\tpublic void testSanity() {\n\t}",
"public static void main(String[] args) {\n\t\ttestJacksonString();\r\n//\t\tgetFlightSearchData();\r\n\t}",
"@Test\n public void reqTypeTest() {\n // TODO: test reqType\n }",
"public static void main(String[] args)\r\n\t{\r\n\t\t// create the suite of tests\r\n\t\t/*final TestSuite tSuite = new TestSuite();\r\n\t\ttSuite.addTest(new PersonDaoGenericTest(\"testSavePerson\"));\r\n\t\ttSuite.addTest(new PersonDaoGenericTest(\"testLoadPerson\"));\r\n\t\tTestRunner.run(tSuite);*/\r\n\t}",
"@Test\n public void smokeTest() {\n DMNDTAnalyserValueFromNodeVisitor ut = new DMNDTAnalyserValueFromNodeVisitor(Collections.emptyList());\n assertThatExceptionOfType(UnsupportedOperationException.class).isThrownBy(() -> ut.visit(compile(\"date()\")));\n assertThatExceptionOfType(UnsupportedOperationException.class).isThrownBy(() -> ut.visit(compile(\"date and time()\")));\n assertThatExceptionOfType(UnsupportedOperationException.class).isThrownBy(() -> ut.visit(compile(\"time()\")));\n assertThatExceptionOfType(UnsupportedOperationException.class).isThrownBy(() -> ut.visit(compile(\"number()\")));\n assertThatExceptionOfType(UnsupportedOperationException.class).isThrownBy(() -> ut.visit(compile(\"string()\")));\n assertThatExceptionOfType(UnsupportedOperationException.class).isThrownBy(() -> ut.visit(compile(\"duration()\")));\n assertThatExceptionOfType(UnsupportedOperationException.class).isThrownBy(() -> ut.visit(compile(\"years and months duration()\")));\n assertThatExceptionOfType(UnsupportedOperationException.class).isThrownBy(() -> ut.visit(compile(\"x()\")));\n }",
"@Test\n public void testSetStype() {\n System.out.println(\"setStype\");\n Setting.SETTING_TYPE stype;\n Setting instance = Setting.getSetting(\"test\");\n stype = instance.getStype();\n assertEquals(Setting.SETTING_TYPE.UND, stype);\n\n instance.setStype(Setting.SETTING_TYPE.TSTRING);\n instance.setValue(\"I am a String\");\n String result = instance.toString();\n String expected = \"test:TSTRING-I am a String\";\n assertEquals(expected, result);\n\n }",
"@Test\n public void testNestedUserTypes() throws Throwable\n {\n String type1 = createType(\"CREATE TYPE %s ( s set<text>, m map<text, text>, l list<text>)\");\n\n String type2 = createType(\"CREATE TYPE %s ( s set < frozen < \" + type1 + \" >>,)\");\n\n createTable(\"CREATE TABLE %s (id int PRIMARY KEY, val frozen<\" + type2 + \">)\");\n\n execute(\"INSERT INTO %s (id, val) VALUES (0, { s : {{ s : {'foo', 'bar'}, m : { 'foo' : 'bar' }, l : ['foo', 'bar']} }})\");\n\n // TODO: check result once we have an easy way to do it. For now we just check it doesn't crash\n execute(\"SELECT * FROM %s\");\n }",
"@Test\n public void testDiferentDataTypes() throws InterruptedException, RtdException {\n RtdBaseContinuous<BigDecimal> bigDecimalRtd = new RtdBaseContinuous<BigDecimal>();\n bigDecimalRtd.setDuration(500);\n bigDecimalRtd.setData(new BigDecimal(10));\n \n RtdBaseDiscrete<Point> pointRtd = new RtdBaseDiscrete<Point>();\n pointRtd.setData(new Point(5, 6));\n \n RtdBaseDiscrete<EmployeeentityBeanClassTest> employeeRtd = new RtdBaseDiscrete<EmployeeentityBeanClassTest>();\n EmployeeentityBeanClassTest emp = new EmployeeentityBeanClassTest();\n emp.setId(1);\n emp.setName(\"Max\");\n emp.setSalary(1000);\n employeeRtd.setData(emp);\n \n assertTrue(\"Incorrect BigDecimal\", bigDecimalRtd.getData().floatValue()==BigDecimal.valueOf(10).floatValue());\n assertTrue(\"Incorrect Point\", pointRtd.getData().getX() == 5 && pointRtd.getData().getY() == 6);\n assertTrue(\"Incorrect Employee \", employeeRtd.getData().getId() == 1 \n && employeeRtd.getData().getName().equals(\"Max\")\n && employeeRtd.getData().getSalary() == 1000);\n \n }",
"@Test\r\n public void testSerialize() {\r\n System.out.println(\"serialize\");\r\n TreeNode root = null;\r\n BinaryTreeSerialization instance = new BinaryTreeSerialization();\r\n String expResult = \"\";\r\n String result = instance.serialize(root);\r\n assertEquals(expResult, result);\r\n // TODO review the generated test code and remove the default call to fail.\r\n fail(\"The test case is a prototype.\");\r\n }",
"public static void main(String[] args) {\n GenericTree tree = new GenericTree();\n tree.display();\n System.out.println(\"Size \" + tree.size());\n\n System.out.println(\"Calc Size \" + tree.calculateSize());\n\n System.out.println(\"Max Node Data \" + tree.getMaxNodeData());\n\n System.out.println(\"Element 120 exists ? \" + tree.isElementExists(120));\n\n System.out.println(\"Element 56 exists ? \" + tree.isElementExists(56));\n\n System.out.println(\"Height of tree \" + tree.height());\n\n tree.preOrder();\n\n tree.postOrder();\n\n tree.levelOrder();\n\n tree.levelOrderLW();\n\n tree.levelOrderLW2();\n\n tree.levelOrderZigZag();\n\n tree.levelOrderZigZagPepVersion();\n\n // tree.linearize();\n // tree.display();\n\n // tree.removeLeaves();\n\n // tree.display();\n\n // // changes original data\n // tree.printMirrorImage();\n\n // tree.linearizeEffective();\n // tree.display();\n\n\n System.out.println(tree.isSymmetric());\n\n tree.predSucc(120);\n\n tree.justLarger(83);\n\n System.out.println(tree.kthSmallest(3));\n\n }",
"public void testGetSystem()\n\t{\n\t\t((TypeDefinitionImpl) fTypeDefinition).setSystem(fTypeSystem);\n\t\tassertEquals(\"The TypeDefinition type system URI differs from that set-\", fTypeSystem, fTypeDefinition.getSystem());\n\t}",
"@Test\n\tpublic void testSingleEntry_1()\n\t\tthrows Exception {\n\t\tint i0 = 1;\n\t\tint i1 = 1;\n\t\tint i2 = 1;\n\t\tint i3 = 1;\n\t\tint i4 = 1;\n\t\tint i5 = 1;\n\t\tint i6 = 1;\n\t\tint i7 = 1;\n\t\tint i8 = 1;\n\t\tint i9 = 1;\n\n\t\thw1_1000000LOC31.singleEntry(i0, i1, i2, i3, i4, i5, i6, i7, i8, i9);\n\n\t\t// add additional test code here\n\t\t// An unexpected exception was thrown in user code while executing this test:\n\t\t// java.lang.ClassNotFoundException: hw1_1000000LOC31\n\t\t// at java.net.URLClassLoader$1.run(URLClassLoader.java:366)\n\t\t// at java.net.URLClassLoader$1.run(URLClassLoader.java:355)\n\t\t// at java.security.AccessController.doPrivileged(Native Method)\n\t\t// at java.net.URLClassLoader.findClass(URLClassLoader.java:354)\n\t\t// at java.lang.ClassLoader.loadClass(ClassLoader.java:425)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.core.UserDefinedClassLoader.loadClass(UserDefinedClassLoader.java:62)\n\t\t// at java.lang.ClassLoader.loadClass(ClassLoader.java:358)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.core.ExecutionContextImpl.getClass(ExecutionContextImpl.java:99)\n\t\t// at com.instantiations.eclipse.analysis.expression.model.SimpleTypeExpression.execute(SimpleTypeExpression.java:205)\n\t\t// at com.instantiations.eclipse.analysis.expression.model.MethodInvocationExpression.execute(MethodInvocationExpression.java:544)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.core.ExecutionRequest.execute(ExecutionRequest.java:286)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.communication.LocalExecutionClient$1.run(LocalExecutionClient.java:158)\n\t\t// at java.lang.Thread.run(Thread.java:744)\n\t}",
"@Test\n\tpublic void testSingleEntry_1()\n\t\tthrows Exception {\n\t\tint i0 = 1;\n\t\tint i1 = 1;\n\t\tint i2 = 1;\n\t\tint i3 = 1;\n\t\tint i4 = 1;\n\t\tint i5 = 1;\n\t\tint i6 = 1;\n\t\tint i7 = 1;\n\t\tint i8 = 1;\n\t\tint i9 = 1;\n\n\t\thw1_1000000LOC26.singleEntry(i0, i1, i2, i3, i4, i5, i6, i7, i8, i9);\n\n\t\t// add additional test code here\n\t\t// An unexpected exception was thrown in user code while executing this test:\n\t\t// java.lang.ClassNotFoundException: hw1_1000000LOC26\n\t\t// at java.net.URLClassLoader$1.run(URLClassLoader.java:366)\n\t\t// at java.net.URLClassLoader$1.run(URLClassLoader.java:355)\n\t\t// at java.security.AccessController.doPrivileged(Native Method)\n\t\t// at java.net.URLClassLoader.findClass(URLClassLoader.java:354)\n\t\t// at java.lang.ClassLoader.loadClass(ClassLoader.java:425)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.core.UserDefinedClassLoader.loadClass(UserDefinedClassLoader.java:62)\n\t\t// at java.lang.ClassLoader.loadClass(ClassLoader.java:358)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.core.ExecutionContextImpl.getClass(ExecutionContextImpl.java:99)\n\t\t// at com.instantiations.eclipse.analysis.expression.model.SimpleTypeExpression.execute(SimpleTypeExpression.java:205)\n\t\t// at com.instantiations.eclipse.analysis.expression.model.MethodInvocationExpression.execute(MethodInvocationExpression.java:544)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.core.ExecutionRequest.execute(ExecutionRequest.java:286)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.communication.LocalExecutionClient$1.run(LocalExecutionClient.java:158)\n\t\t// at java.lang.Thread.run(Thread.java:744)\n\t}",
"private void test(NFV root) throws Exception{\n\t\tlong beginAll=System.currentTimeMillis();\n\t\tNFV rootTest = init(root);\n\t\tlong endAll=System.currentTimeMillis();\n //System.out.println(\"Total time -> \" + ((endAll-beginAll)/1000) + \"s\");\n\t\trootTest.getPropertyDefinition().getProperty().forEach(p ->{\n \tif(p.isIsSat()){\n\t\t\t\tmaxTotTime = maxTotTime<(endAll-beginAll)? (endAll-beginAll) : maxTotTime;\n\t\t\t\tSystem.out.print(\"time: \" + (endAll-beginAll) + \"ms;\");\n\t\t\t\ttotTime += (endAll-beginAll);\n \t\tnSAT++;\n \t}\n \telse{\n \t\tnUNSAT++;\n \t}\n });\n return;\n\t}",
"public static void main(String[] args) {\n\t\tGenericTree gt = new GenericTree();\n//\t\tgt.display();\n//\t\t System.out.println(gt.max());\t//70\n//\t\t System.out.println(gt.find(70)); //true;\n//\t\t System.out.println(gt.size()); //7\n//\t\t System.out.println(gt.height());\n//\t\tgt.mirror(); //space(logn)\n//\t\tgt.display();\n\t\t//gt.preorder();\n\t\t//gt.postorder();\n\t\t//System.out.println();\n\t\t//gt.levelorder();\n\t\t//gt.levelorderA();\n\t\t//gt.levelorderAlw();\n\t\t//gt.levelorderlwzz();\n\t\t//gt.levelorderAT();\n\t\t//gt.MultiSolver(60);\n\t\t//gt.SumofNodes();\n\t}",
"@Test\n\tpublic void testGetNST_2()\n\t\tthrows Exception {\n\t\tPatientAccessor fixture = new PatientAccessor(\"\");\n\t\tString hospitalNumber = \"\";\n\t\tint weekNumber = 1;\n\n\t\tNST result = fixture.getNST(hospitalNumber, weekNumber);\n\n\t\t// add additional test code here\n\t\t// An unexpected exception was thrown in user code while executing this test:\n\t\t// java.lang.IllegalStateException: _out shouldn't be null\n\t\t// at com.mongodb.DBPort.go(DBPort.java:110)\n\t\t// at com.mongodb.DBPort.call(DBPort.java:74)\n\t\t// at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:286)\n\t\t// at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:257)\n\t\t// at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:310)\n\t\t// at com.mongodb.DB.command(DB.java:274)\n\t\t// at com.mongodb.DB.command(DB.java:256)\n\t\t// at com.mongodb.DB.command(DB.java:313)\n\t\t// at com.mongodb.Mongo.getDatabaseNames(Mongo.java:393)\n\t\t// at com.comp2014group5.generic_database.FormDatabaseMongoImpl.<init>(FormDatabaseMongoImpl.java:24)\n\t\t// at com.comp2014.group5.patient_database.PatientAccessor.<init>(PatientAccessor.java:29)\n\t\tassertNotNull(result);\n\t}",
"@Test\n\tpublic void test_Directory_typeFinder_SENG300W18Iter1() {\n\t\tString directory = _TestSuite.TYPE_FINDER_TEST_DIR.concat(\"SENG300W18Iter1/\");\n\t\ttestOutput(directory);\n\t}",
"@Before\n public void setUp() {\n this.tree = new SimpleBinarySearchTree<>();\n }",
"public static void main(String[] args) {\n // PUT YOUR TEST CODE HERE\n }",
"@SuppressWarnings(\"unchecked\")\n\t@Test\n\tpublic void test_process_some_stage_operation()\n\t{\n\t}",
"public StrandUnitTest()\n {\n }",
"@Test\n\tvoid test() {\n\t\t\n\t\tuserInput ui = new userInput();\n\t\t\n\t\tboolean test0 = ui.isValidChildcareType(0);\n\t\tboolean test1 = ui.isValidChildcareType(1);\n\t\tboolean test2 = ui.isValidChildcareType(2);\n\t\tboolean test3 = ui.isValidChildcareType(3);\n\t\tboolean test4 = ui.isValidChildcareType(4);\n\t\tboolean test5 = ui.isValidChildcareType(5);\n\t\tboolean test6 = ui.isValidChildcareType(-1);\n\t\t\n\t\tassertEquals(test0, false);\n\t\tassertEquals(test1, true);\n\t\tassertEquals(test2, true);\n\t\tassertEquals(test3, true);\n\t\tassertEquals(test4, true);\n\t\tassertEquals(test5, false);\n\t\tassertEquals(test6, false);\n\t}",
"public static void main (String[] args) {\n\t\t\n\t\t//Tests\n\t\tTree testTree = new Leaf(null);\n\t\ttestTree = testTree.setUpTree(1);\n\t\ttestStuff(testTree.getValue(), 1);\n\t\ttestTree = testTree.setUpTree(2);\n\t\ttestStuff(testTree.getValue(), 1);\n\t\ttestStuff(testTree.getLeft().getValue(), 1);\n\t\ttestStuff(testTree.getRight().getValue(), 1);\n\t\ttestTree = testTree.setUpTree(4);\n\t\ttestStuff(testTree.getValue(), 1);\n\t\ttestStuff(testTree.getLeft().getValue(), 1);\n\t\ttestStuff(testTree.getLeft().getRight().getValue(), 2);\n\t\ttestStuff(testTree.getLeft().getLeft().getValue(), 1);\n\t\ttestStuff(testTree.getLeft().getLeft().getRight().getValue(), 3);\n\t\ttestStuff(testTree.getLeft().getRight().getRight().getValue(), 4);\n\t\ttestStuff(testTree.getRight().getLeft().getLeft().getValue(), \n\t\t\t\ttestTree.getLeft().getRight().getRight().getValue());\n\t\t//End of tests\n\t\t\n\t\tSystem.out.println(\"There were \" + Integer.toString(errors) + \" errors from the tests.\");\n\t\tSystem.out.println(\"Hi! Welcome to the NeuroScouting Tree Creator!\");\n\t\t\n\t\tScanner in = new Scanner(System.in);\n\t\tint input = -1;\n\t\t\n\t\twhile (input != 0) {\n\t\t\tSystem.out.print(\"Please enter your tree's height as an integer. Enter 0 to end: \");\n\t\t\tinput = in.nextInt();\n\t\t\tif (input != 0) {\n\t\t\t\ttestTree = testTree.setUpTree(input);\n\t\t\t\ttestTree.printTree();\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Thank you for using NeuroScouting Tree Generator! Have a good day!\");\n\t}",
"@Test\n public void testGetType() {\n System.out.println(\"getType\");\n\n String expResult = \"Comum\";\n String result = instance.getType();\n\n assertEquals(expResult, result);\n }",
"@Test(timeout=300000)\n public void test2() throws Throwable {\n Object[][] objectArray0 = new Object[0][6];\n ControllerLoadViewer controllerLoadViewer0 = new ControllerLoadViewer(objectArray0);\n String[][] stringArray0 = new String[2][6];\n String[] stringArray1 = new String[6];\n stringArray1[0] = \"\";\n stringArray0[0] = stringArray1;\n // Undeclared exception!\n try { \n controllerLoadViewer0.getDataTypes(stringArray0);\n fail(\"Expecting exception: NumberFormatException\");\n \n } catch(NumberFormatException e) {\n //\n // null\n //\n assertThrownBy(\"java.lang.Integer\", e);\n }\n }",
"@Test\n @Ignore\n public void testParse() {\n System.out.println(\"parse\");\n byte[] bytes = null;\n SntParser instance = new SntParser();\n Object expResult = null;\n Object result = instance.parse(bytes);\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }",
"@Test\n void loadData() {\n }",
"@Test\n\tpublic void testGetTariefBehandeling(){\n\t\tdouble expResult = 89.50;\n\t\tassertTrue(expResult == instance.getTariefBehandeling());\n\t}"
] | [
"0.6338675",
"0.6304878",
"0.62793607",
"0.6248716",
"0.6204541",
"0.6118472",
"0.6118472",
"0.6118472",
"0.6057389",
"0.59676677",
"0.59394777",
"0.5912507",
"0.5846311",
"0.58227986",
"0.58201927",
"0.5819428",
"0.5802219",
"0.5798765",
"0.57944274",
"0.5784226",
"0.575499",
"0.57350814",
"0.5734888",
"0.5731807",
"0.5711491",
"0.56923205",
"0.5690384",
"0.56760806",
"0.5670074",
"0.56670356",
"0.56597155",
"0.5650132",
"0.56447905",
"0.5644672",
"0.56308115",
"0.56293136",
"0.561366",
"0.56089526",
"0.56082565",
"0.56071514",
"0.5604482",
"0.5592669",
"0.5563955",
"0.5560141",
"0.55516714",
"0.5543966",
"0.5529796",
"0.55268055",
"0.5523987",
"0.5523252",
"0.5517681",
"0.5513864",
"0.55077744",
"0.54935527",
"0.5493169",
"0.5492927",
"0.5487237",
"0.5482215",
"0.5479604",
"0.54635733",
"0.5460911",
"0.5452641",
"0.54520965",
"0.5448146",
"0.54466313",
"0.54427916",
"0.54301506",
"0.54278",
"0.5426598",
"0.54259604",
"0.54188055",
"0.5415902",
"0.54156256",
"0.5413957",
"0.54128504",
"0.5409088",
"0.5399677",
"0.5397013",
"0.53895205",
"0.5384822",
"0.53812575",
"0.5376885",
"0.5375043",
"0.5363839",
"0.5358993",
"0.5352013",
"0.53517663",
"0.5351272",
"0.5347174",
"0.53421384",
"0.5341585",
"0.5338926",
"0.5328342",
"0.53253156",
"0.53128403",
"0.53111196",
"0.5306901",
"0.5306697",
"0.53059435",
"0.5305662",
"0.53048295"
] | 0.0 | -1 |
Created by 92915 on 2018/4/13. | public interface MySetContract {
interface View extends BaseContract.BaseView {
void startDocData(DocDataBean docDataBean);
void againDocData(int code);
void startSDocData(SDocDataBean sDocDataBean);
void againSDocData(int code);
}
interface Presenter extends BaseContract.BasePresenter<View> {
void getDocDataAttribute(String docid);
void getSDocDataAttribute(String docid,String docname,String sex,String birthday,
String mobile,String professional, String hospital,String office);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void perish() {\n \n }",
"private stendhal() {\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"private static void cajas() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"public void mo38117a() {\n }",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"public void mo4359a() {\n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n public void init() {\n\n }",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"private Rekenhulp()\n\t{\n\t}",
"public void mo6081a() {\n }",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"public Pitonyak_09_02() {\r\n }",
"@Override\n public void init() {\n }",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\n void init() {\n }",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void gored() {\n\t\t\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"private void m50366E() {\n }",
"Petunia() {\r\n\t\t}",
"@Override\n\tpublic void jugar() {\n\t\t\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void init() {}",
"@Override\n protected void getExras() {\n }",
"private void poetries() {\n\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\n protected void init() {\n }",
"@Override\n public void init() {\n\n }",
"@Override\n public void init() {\n\n }",
"public void mo12930a() {\n }",
"@Override\n protected void initialize() \n {\n \n }",
"private void kk12() {\n\n\t}",
"public void mo21877s() {\n }",
"@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\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}",
"private UsineJoueur() {}",
"public void mo55254a() {\n }",
"protected void mo6255a() {\n }",
"private TMCourse() {\n\t}",
"private void init() {\n\n\t}",
"public final void mo91715d() {\n }",
"@Override\r\n\tpublic void init() {}",
"public void mo1531a() {\n }",
"public void mo12628c() {\n }",
"@Override\n public int describeContents() { return 0; }",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"public void mo3376r() {\n }",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"protected MetadataUGWD() {/* intentionally empty block */}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"public void mo21779D() {\n }",
"@Override\n\tprotected void logic() {\n\n\t}"
] | [
"0.6104487",
"0.5989301",
"0.5882448",
"0.576908",
"0.576908",
"0.5766196",
"0.57637376",
"0.57382715",
"0.57290757",
"0.5668724",
"0.5668724",
"0.5668485",
"0.566609",
"0.5657657",
"0.5643485",
"0.5641768",
"0.56078804",
"0.55959004",
"0.55936813",
"0.5583366",
"0.55813706",
"0.5557864",
"0.55552024",
"0.55516374",
"0.5544008",
"0.55429405",
"0.55186665",
"0.5487492",
"0.54874444",
"0.5487127",
"0.54577845",
"0.5457141",
"0.5454755",
"0.54470706",
"0.5441972",
"0.5441972",
"0.5441972",
"0.5441972",
"0.5441972",
"0.5441972",
"0.5441972",
"0.5435641",
"0.542358",
"0.5414857",
"0.5403597",
"0.540155",
"0.53963524",
"0.5395086",
"0.5395086",
"0.5395086",
"0.5395086",
"0.5395086",
"0.5392688",
"0.5392688",
"0.5392688",
"0.5392688",
"0.5392688",
"0.5392688",
"0.53913504",
"0.53888",
"0.53861356",
"0.538413",
"0.5371857",
"0.53691924",
"0.5366684",
"0.5362722",
"0.53469557",
"0.53391206",
"0.53391206",
"0.53387296",
"0.53374785",
"0.53372085",
"0.53302026",
"0.5324616",
"0.53174114",
"0.53174114",
"0.53174114",
"0.53148687",
"0.5313642",
"0.5307094",
"0.5306474",
"0.53054476",
"0.5304689",
"0.5300315",
"0.5298759",
"0.5288287",
"0.5285116",
"0.5279768",
"0.5279768",
"0.5279768",
"0.5276896",
"0.52763957",
"0.52763957",
"0.52763957",
"0.5270383",
"0.52650297",
"0.52650297",
"0.5252983",
"0.5248025",
"0.5246765",
"0.52407575"
] | 0.0 | -1 |
Runs tests for SimME server | public static Test suite() {
TestSuite suite = new TestSuite("Test for Server");
suite.addTestSuite(DatabaseTest.class);
suite.addTest(SuiteTestMenu.suite());
suite.addTestSuite(ServerGameTest.class);
suite.addTestSuite(ManagedGameTest.class);
suite.addTestSuite(UserManagerTest.class);
suite.addTestSuite(SessionManagerTest.class);
return suite;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void serverStarts() {\n }",
"public static void runAllTests() {\n\t\trunClientCode(SimpleRESTClientUtils.getCToFServiceURL());\n\t\trunClientCode(SimpleRESTClientUtils.getCToFServiceURL(new String [] {\"100\"}));\n\t}",
"@Test\n\tpublic void runSend(){\n\t\tstandard();\n\t}",
"@Before\r\n public void setUp() throws Exception\r\n {\r\n\tmss = new MServerSocket(LOCAL_PORT, 0, InetAddress.getByName(LOCALHOST));\r\n\t\r\n \tSystem.out.println(\"MServerSocket created\");\r\n EchoServerThread accepterThread = new EchoServerThread(mss);\r\n accepterThread.start();\r\n }",
"public void testSapServerConnectSimple() {\n mContext = this.getContext();\n\n try {\n\n SapSequencer sequencer = new SapSequencer();\n if(rilTestModeEnabled) {\n sequencer.testModeEnable(true);\n }\n /* Build a default init sequence */\n buildDefaultInitSeq(sequencer);\n SapMessage disconnectReq = new SapMessage(SapMessage.ID_DISCONNECT_REQ);\n SapMessage disconnectResp = new SapMessage(SapMessage.ID_DISCONNECT_RESP);\n\n SapMessage resetResp = new SapMessage(SapMessage.ID_RESET_SIM_RESP);\n resetResp.setResultCode(SapMessage.RESULT_OK);\n\n int index = sequencer.addStep(disconnectReq, disconnectResp);\n\n assertTrue(sequencer.run());\n } catch (IOException e) {\n Log.e(TAG, \"IOException\", e);\n }\n }",
"@Test\n public void testServerApp() throws InterruptedException {\n\n }",
"private void runTest(final Node me) {\n if (!initialized) {\n initStressTest();\n }\n\n List<Row> runs = engine.getSqlTemplate().query(selectControlSql);\n\n for (Row run : runs) {\n int runId = run.getInt(\"RUN_ID\");\n int payloadColumns = run.getInt(\"PAYLOAD_COLUMNS\");\n int initialSeedSize = run.getInt(\"INITIAL_SEED_SIZE\");\n long duration = run.getLong(\"DURATION_MINUTES\");\n\n String status = engine.getSqlTemplate().queryForString(selectStatusSql, runId, me.getNodeId());\n\n if (isMasterNode(me) && StringUtils.isBlank(status)) {\n initStressTestRowOutgoing(payloadColumns, runId, initialSeedSize);\n initStressTestRowIncoming(payloadColumns);\n long commitRows = run.getLong(\"SERVER_COMMIT_ROWS\");\n long sleepMs = run.getLong(\"SERVER_COMMIT_SLEEP_MS\");\n\n engine.getSqlTemplate().update(insertStatusSql, runId, me.getNodeId(), \"RUNNING\");\n for (Node client : engine.getNodeService().findTargetNodesFor(NodeGroupLinkAction.W)) {\n engine.getSqlTemplate().update(insertStatusSql, runId, client.getNodeId(), \"RUNNING\");\n }\n\n fillOutgoing(runId, duration, commitRows, sleepMs, payloadColumns);\n\n engine.getSqlTemplate().update(updateStatusSql, \"COMPLETE\", runId, me.getNodeId());\n\n } else if (!isMasterNode(me) && !StringUtils.isBlank(status) && status.equals(\"RUNNING\")) {\n long commitRows = run.getLong(\"CLIENT_COMMIT_ROWS\");\n long sleepMs = run.getLong(\"CLIENT_COMMIT_SLEEP_MS\");\n\n fillIncoming(runId, duration, commitRows, sleepMs, payloadColumns);\n\n engine.getSqlTemplate().update(updateStatusSql, \"COMPLETE\", runId, me.getNodeId());\n }\n }\n }",
"public TestOutcome executeTests()\n\n\t{\n\t try {\n\t\tString buildServerTestFilesDir = getDirectoryFinder()\n\t\t\t\t.getTestFilesDirectory().getCanonicalPath() + File.separator;\n\n\t\t// Build arguments to java process\n\t\tList<String> javaArgs = new LinkedList<String>();\n\t\tjavaArgs.add(\"java\");\n\t\t// TODO Factor the amount of memory and the extra -D parameters into\n\t\t// config.properties\n\t\tString vmArgs = tester.getTestProperties().getVmArgs();\n\t\tboolean memorySet = false;\n\t\tif (vmArgs != null) {\n\t\t if (vmArgs.contains(\"-Xmx\"))\n\t\t memorySet = true;\n\t\t\t// Break up into separate tokens if necessary\n\t\t\tStringTokenizer tokenizer = new StringTokenizer(vmArgs);\n\t\t\twhile (tokenizer.hasMoreElements()) {\n\t\t\t\tString nextArg = tokenizer.nextToken();\n\t\t\t\tnextArg = nextArg.replace(\"${buildserver.test.files.dir}\",\n\t\t\t\t\t\tbuildServerTestFilesDir);\n\t\t\t\tjavaArgs.add(nextArg);\n\t\t\t}\n\t\t}\n\t\tif (!memorySet)\n\t\t javaArgs.add(\"-Xmx456m\");\n javaArgs.add(\"-Dcom.sun.management.jmxremote\");\n \n\t\tjavaArgs.add(\"-classpath\");\n\t\tjavaArgs.add(classPath);\n\n\t\t// Tests must run headless, for obvious reasons\n\t\tjavaArgs.add(\"-Djava.awt.headless=true\");\n\n\t\t// Do not allow access to home directory\n\t\tjavaArgs.add(\"-Duser.home=/dev/null\");\n\n\t\t// Specify filename of project jar file\n\t\tjavaArgs.add(\"-Dbuildserver.test.jar.file=\"\n\t\t\t\t+ getProjectSubmission().getTestSetup().getCanonicalPath());\n\t\t// Specify the path of the build directory\n\t\tjavaArgs.add(\"-Dbuildserver.build.dir=\"\n\t\t\t\t+ getDirectoryFinder().getBuildDirectory().getCanonicalPath());\n\t\t// Add trusted code bases\n\t\tfor (TrustedCodeBase trustedCodeBase \n\t\t : getTrustedCodeBaseFinder().getCollection()) {\n\t\t\tjavaArgs.add(\"-D\" + trustedCodeBase.getProperty() + \"=\"\n\t\t\t\t\t+ trustedCodeBase.getValue());\n//\t\t\tgetLog().debug(\"adding trusted codebase \" + trustedCodeBase);\n\t\t}\n\t\t// Let the test classes know where test files are.\n\t\t// Append a separator to the end, because this makes it\n\t\t// easier for the tests to determine how to access\n\t\t// the test files.\n\t\tjavaArgs.add(\"-Dbuildserver.test.files.dir=\" + buildServerTestFilesDir);\n\t\tif (getDebugJavaSecurity()) {\n\t\t\tjavaArgs.add(\"-Djava.security.debug=access,failure\");\n\t\t}\n\t\tif (tester.getHasSecurityPolicyFile()) {\n\t\t\t// Project jar file contained a security policy file\n\t\t\tjavaArgs.add(\"-Djava.security.manager\");\n\t\t\tjavaArgs.add(\"-Djava.security.policy=file:\"\n\t\t\t\t\t+ new File(getDirectoryFinder().getTestFilesDirectory(),\n\t\t\t\t\t\t\t\"security.policy\").getCanonicalPath());\n\t\t}\n\t\t// XXX TestRunner\n\t\tjavaArgs.add(TestRunner.class.getName());\n\t\tjavaArgs.add(\"-startTestNumber\");\n\t\tjavaArgs.add(String.valueOf(nextTestNumber));\n\n\t\tjavaArgs.add(getProjectSubmission().getSubmissionPK());\n\t\tjavaArgs.add(testType.toString());\n\t\tjavaArgs.add(testClass);\n\t\tjavaArgs.add(outputFilename);\n\t\tint timeoutInSeconds = tester.getTestProperties()\n\t\t\t\t.getTestTimeoutInSeconds();\n\t\tif (testCase != null && testCase.getMaxTimeInMilliseconds() != 0) {\n\t\t\ttimeoutInSeconds = 1 + (int)( testCase.getMaxTimeInMilliseconds() / 1000);\n\t\t\tgetLog().trace(\n\t\t\t\t\t\"Using @Test(timeout=\" + timeoutInSeconds\n\t\t\t\t\t\t\t+ \") annotation\");\n\t\t}\n\t\tjavaArgs.add(String.valueOf(timeoutInSeconds));\n\t\tif (testMethod != null) {\n\t\t\tjavaArgs.add(testMethod);\n\t\t}\n\n\t\t// Which directory to execute the TestRunner in.\n\t\t// By default, this is the build directory, but the\n\t\t// cwd.testfiles.dir property may set it to\n\t\t// be the testfiles directory.\n\t\tFile testRunnerCWD = getDirectoryFinder().getBuildDirectory();\n\t\t// Student-written tests must be run from the build directory\n\t\t// (where the student code is extracted) no matter what\n\t\tif (tester.getTestProperties().isTestRunnerInTestfileDir()\n\t\t\t\t&& !testType.equals(TestOutcome.TestType.STUDENT))\n\t\t\ttestRunnerCWD = getDirectoryFinder().getTestFilesDirectory();\n\n\t\tgetLog().debug(\"TestRunner working directory: \" + testRunnerCWD);\n\n\t\t// Execute the test!\n\t\tint exitCode;\n\t\tAlarm alarm = tester.getTestProcessAlarm();\n\t\tCombinedStreamMonitor monitor = null;\n\t\t\n\t\tProcess testRunner = null;\n\t\tboolean isRunning = false;\n\t\ttry {\n\t\t\t// Spawn the TestRunner process\n\t\t String cmd = MarmosetUtilities.commandToString(javaArgs);\n getLog().debug(\"TestRunner command: \" + cmd);\n \n\t\t\ttestRunner = Untrusted.execute(\n\t\t\t\t\ttestRunnerCWD, javaArgs.toArray(new String[javaArgs.size()]));\n\n int pid = MarmosetUtilities.getPid(testRunner);\n getLog().debug(\n \"Subprocess for submission \"\n + getProjectSubmission().getSubmissionPK()\n + \" for testSetup \"\n + getProjectSubmission().getTestSetupPK()\n + \" for \" + testType + \" \" + nextTestNumber\n + \" \" + testMethod + \" in testClass \"\n + testClass + \" has pid = \" + pid);\n\n\t\t\tisRunning = true;\n\n\t\t\t// Start the timeout alarm\n\t\t\talarm.start();\n\n\t\t\t// Record the output\n\t\t\tmonitor = tester.createStreamMonitor(testRunner.getInputStream(),\n\t\t\t\t\ttestRunner.getErrorStream());\n\t\t\tmonitor.start();\n\n\t\t\t// Wait for the test runner to finish.\n\t\t\t// This may be interrupted by the timeout alarm.\n\t\t\tmonitor.join();\n\t\t\texitCode = testRunner.waitFor();\n\t\t\tisRunning = false;\n\t\t\t// Groovy, we finished before the alarm went off.\n\t\t\t// Disable it (and clear our interrupted status)\n\t\t\t// in case it went off just after the process wait\n\t\t\t// finished.\n\t\t\talarm.turnOff();\n\n\t\t\t// Just for debugging...\n\t\t\tgetLog().debug(\n\t\t\t\t\t\"TestRunner process finished; captured to stdout/stderr output was: \");\n\t\t\tgetLog().debug(monitor.getCombinedOutput());\n\t\t\tif (monitor.getCombinedOutput().contains(\"AccessControlException\")) {\n\t\t\t\tgetLog().warn(\n\t\t\t\t\t\t\"Clover could not be initialized due to an AccessControlException. \"\n\t\t\t\t\t\t\t\t+ \" Please check your security.policy file and make sure that student code \"\n\t\t\t\t\t\t\t\t+ \"has permission to read/write/delete /tmp and can install shutdown hooks\");\n\t\t\t}\n\n\t\t} catch (IOException e) {\n\t\t\tString shortTestResult = getFullTestName()\n\t\t\t\t\t+ \" failed with IOException: \" + e.getMessage();\n\t\t\t// TODO get a stack trace into here\n\t\t\tString longTestResult = e.toString();\n\t\t\tgetLog().error(shortTestResult, e);\n\t\t\treturn Tester.createUnableToRunOneTestOutcome(testType, testMethod,\n\t\t\t\t\ttestClass, nextTestNumber, TestOutcome.FAILED,\n\t\t\t\t\tshortTestResult, longTestResult);\n\t\t} catch (InterruptedException e) {\n\t\t\tif (!alarm.fired())\n\t\t\t\tgetLog().error(\"Someone unexpectedly interrupted the timer\");\n\n\t\t\tString shortTestResult = \"Timeout!\";\n\t\t\tString longTestResult = monitor.getCombinedOutput();\n\t\t\tgetLog().error(shortTestResult, e);\n\t\t\tgetLog().trace(\n\t\t\t\t\t\"Timeout for \" + testType + \" \" + testMethod + \" \"\n\t\t\t\t\t\t\t+ nextTestNumber);\n\t\t\treturn Tester.createUnableToRunOneTestOutcome(testType, testMethod,\n\t\t\t\t\ttestClass, nextTestNumber, TestOutcome.TIMEOUT,\n\t\t\t\t\tshortTestResult, longTestResult);\n\t\t} finally {\n\t\t\t// Make sure the process is cleaned up.\n\t\t\tif (isRunning && testRunner != null) {\n\t\t\t\ttestRunner.destroy();\n\t\t\t\t// process should already be dead, kill again\n\t\t\t\tMarmosetUtilities.destroyProcessGroup(testRunner, getLog());\n\t\t\t}\n\t\t}\n\n\t\tif (exitCode == 2) {\n // Test runner couldn't execute the tests for some reason.\n // This is probably not our fault.\n // Just add an outcome recording the output of\n // the test runner process.\n String longTestResult = monitor.getCombinedOutput();\n String shortTestResult = \"An expected class could not be found\";\n int end = longTestResult.indexOf('\\n');\n if (end > 0 && longTestResult.startsWith(\"java.lang.NoClassDefFoundError: \")) {\n String missing = longTestResult.substring(\"java.lang.NoClassDefFoundError: \".length(), end);\n missing = missing.replace('/','.');\n shortTestResult = \"Could not find expected class \" + missing;\n longTestResult = \"\";\n }\n getLog().error(shortTestResult);\n return Tester.createUnableToRunOneTestOutcome(testType, testMethod,\n testClass, nextTestNumber, TestOutcome.MISSING_COMPONENT,\n shortTestResult, longTestResult);\n } else if (exitCode != 0) {\n\t\t\t// Test runner couldn't execute the tests for some reason.\n\t\t\t// This is probably not our fault.\n\t\t\t// Just add an outcome recording the output of\n\t\t\t// the test runner process.\n\t\t\tString shortTestResult = getFullTestName()\n\t\t\t\t\t+ \" subprocess failed to return with 0 status\";\n\t\t\tString longTestResult = monitor.getCombinedOutput();\n\t\t\tgetLog().error(shortTestResult);\n\t\t\treturn Tester.createUnableToRunOneTestOutcome(testType, testMethod,\n\t\t\t\t\ttestClass, nextTestNumber, TestOutcome.FAILED,\n\t\t\t\t\tshortTestResult, longTestResult);\n\t\t}\n\n\t\tgetLog().debug(\n\t\t\t\tgetFullTestName() + \" test finished with \"\n\t\t\t\t\t\t+ new File(outputFilename).length()\n\t\t\t\t\t\t+ \" bytes of output\");\n\n\t\tTestOutcome testOutcome = readTestOutcomeFromFile();\n\t\tif (testType == TestType.SECRET) {\n\t\t\tString longTestResult = testOutcome.getLongTestResult();\n\t\t\tString output = monitor.getCombinedOutput().trim();\n\t\t\tif (output.length() > 0)\n\t\t\t\ttestOutcome.setLongTestResultCompressIfNeeded(longTestResult + \"\\nTest output:\\n\" + output);\n\t\t}\n\t\treturn testOutcome;\n\t } catch (IOException e) {\n\t e.printStackTrace();\n\t throw new RuntimeException(\"Unexpected IO Exception\", e);\n\t }\n\t}",
"@Override\r\n\tpublic void run() {\n\t\t\r\n\t\ttest testt = new test();\r\n\t\ttestt.oninIt();\r\n\t\ttry {\r\n\t\t\ttestt.pingServer();\r\n\t\t} catch (DeploymentException | IOException | URISyntaxException | InterruptedException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}",
"public void run() {\n\t try{\n \t\tRegistry registry = LocateRegistry.createRegistry(1099);\n \t\tTestUnitImpl testUnit = new TestUnitImpl();\n \t\tProxyMonitoringUnit proxyUnit= new ProxyMonitoringUnit();\n\t registry.rebind(\"TestingUnit\", testUnit);\n\t registry.rebind(\"ProxyUnit\", proxyUnit);\n\t System.out.println(\"server.RMI Server is ready.\");\n \t}catch(RemoteException e){\n \t\te.printStackTrace();\n \t}\n \t\n }",
"@Test\n\tpublic void test_run_5() throws IOException, InterruptedException {\n\t\t\n\t\t// bind server socket and start TCPserver\n\t\tmockTCPserverTest.getServerSocket().bind(new java.net.InetSocketAddress(port_1));\n\t\tmockTCPserverTest.startServer(mockTCPserverTest.getServerSocket());\n\t\tmockServerThread.start();\n\t\t\n\t\tTCPclientSocket = new Socket(serverHostName, port_1);\n\t\twhen(mockTCPclientTest.getClientSocket()).thenReturn(TCPclientSocket);\t\n\t\t\n\t\tclientManager_1 = clientManager_1.initClientManager(mockTCPclientTest.getClientSocket(), sensor_ID_1);\n\t\tThread.sleep(20);\n\t\t\n\t\t// start test Thread on the client side that is responsible for listening messages sent by TCPserver and re-sending particular responses that are verified in the consecutive test runs\n\t\t// method under test messagesHandler() is called in this thread\n\t\ttestThread_client.start();\n\t\tThread.sleep(20);\n\t\t\n\t\tint sensorID = 1;\n\t\tfloat[][] sensor_coordinates_array_1 = {{11.0f, 14.0f}};\n\t\tString softwareImageID_1 = \"Release X\";\n\t\tint measurement_limit_1 = 5;\n\t\tSensorState sens_state_1 = SensorState.OPERATIONAL;\n\t\tdouble sens_watchdog_scale_factor_1 = 0.1;\n\t\tdouble received_Local_1h_watchdog = Local_1h_Watchdog.getInstance().getExpiration() * 0.25;\n\t\twhen(mockComputeEngine_Runnable.getLocal_1h_watchdog()).thenReturn(received_Local_1h_watchdog);\n\t\t\n\t\tSensorImpl temp_sens_sent_1 = new SensorImpl(sensorID, new Point2D.Float(sensor_coordinates_array_1[0][0], sensor_coordinates_array_1[0][1]), softwareImageID_1, measurement_limit_1);\n\t\ttemp_sens_sent_1.setSensorState(sens_state_1);\n\t\ttemp_sens_sent_1.setSensor_watchdog_scale_factor(sens_watchdog_scale_factor_1);\n\t\t\n\t\tmockComputeEngine_Runnable.sendMessage(new ServerMessage_SensorInfoUpdate(temp_sens_sent_1.getSensorID(), temp_sens_sent_1.getCoordinates(), temp_sens_sent_1.getSoftwareImageID(), \n\t\t\t\t\t\t\t\t\t\t\t\ttemp_sens_sent_1.getSensorState(),\n\t\t\t\t\t\t\t\t\t\t\t\tmockComputeEngine_Runnable.getLocal_1h_watchdog(), mockComputeEngine_Runnable.getLocal_24h_watchdog(),\n\t\t\t\t\t\t\t\t\t\t\t\ttemp_sens_sent_1.getLocal_watchdog_scale_factor(), temp_sens_sent_1.getSensor_m_history_array_size()), mockComputeEngine_Runnable.getOutputStream());\n\t\tThread.sleep(20);\n\t\t\n\t\tassertFalse(clientManager_1.isClientManagerRunning());\n\t\tThread.sleep(20);\n\t}",
"@Test\n\tpublic void test_run_4() throws IOException, InterruptedException {\n\t\t\n\t\t// bind server socket and start TCPserver\n\t\tmockTCPserverTest.getServerSocket().bind(new java.net.InetSocketAddress(port_1));\n\t\tmockTCPserverTest.startServer(mockTCPserverTest.getServerSocket());\n\t\tmockServerThread.start();\n\t\t\n\t\tTCPclientSocket = new Socket(serverHostName, port_1);\n\t\twhen(mockTCPclientTest.getClientSocket()).thenReturn(TCPclientSocket);\t\n\t\t\n\t\tclientManager_1 = clientManager_1.initClientManager(mockTCPclientTest.getClientSocket(), sensor_ID_1);\n\t\tThread.sleep(20);\n\t\t\n\t\t// start test Thread on the client side that is responsible for listening messages sent by TCPserver and re-sending particular responses that are verified in the consecutive test runs\n\t\t// method under test messagesHandler() is called in this thread\n\t\ttestThread_client.start();\n\t\tThread.sleep(20);\n\t\t\n\t\tint sensorID = 1;\n\t\tfloat[][] sensor_coordinates_array_1 = {{11.0f, 14.0f}};\n\t\tString softwareImageID_1 = \"Release X\";\n\t\tint measurement_limit_1 = 5;\n\t\tSensorState sens_state_1 = SensorState.PRE_OPERATIONAL;\n\t\tdouble sens_watchdog_scale_factor_1 = 0.01;\n\t\tdouble received_Local_1h_watchdog = 1300;\n\t\twhen(mockComputeEngine_Runnable.getLocal_1h_watchdog()).thenReturn(received_Local_1h_watchdog);\n\t\t\n\t\tSensorImpl temp_sens_sent_1 = new SensorImpl(sensorID, new Point2D.Float(sensor_coordinates_array_1[0][0], sensor_coordinates_array_1[0][1]), softwareImageID_1, measurement_limit_1);\n\t\ttemp_sens_sent_1.setSensorState(sens_state_1);\n\t\ttemp_sens_sent_1.setSensor_watchdog_scale_factor(sens_watchdog_scale_factor_1);\n\t\t\n\t\tassertFalse(Local_1h_Watchdog.getInstance().getEnabled());\n\t\t\n\t\tmockComputeEngine_Runnable.sendMessage(new ServerMessage_SensorInfoUpdate(temp_sens_sent_1.getSensorID(), temp_sens_sent_1.getCoordinates(), temp_sens_sent_1.getSoftwareImageID(), \n\t\t\t\t\t\t\t\t\t\t\t\ttemp_sens_sent_1.getSensorState(),\n\t\t\t\t\t\t\t\t\t\t\t\tmockComputeEngine_Runnable.getLocal_1h_watchdog(), mockComputeEngine_Runnable.getLocal_24h_watchdog(),\n\t\t\t\t\t\t\t\t\t\t\t\ttemp_sens_sent_1.getLocal_watchdog_scale_factor(), temp_sens_sent_1.getSensor_m_history_array_size()), mockComputeEngine_Runnable.getOutputStream());\n\t\tThread.sleep(50);\n\t\t\n\t\tassertEquals(sens_watchdog_scale_factor_1, \t\t\tTCPclient.watchdogs_scale_factor, 0.01);\n\t\tassertEquals(measurement_limit_1, \t\t\t\t\tTCPclient.measurements_limit, 0.01);\n\t\tassertEquals(received_Local_1h_watchdog, \t\t\tLocal_1h_Watchdog.getInstance().getTimeLeftBeforeExpiration(), 0.5);\n\t\tassertTrue(Local_1h_Watchdog.getInstance().getEnabled());\n\t\t\n\t\t// send ServerMessage_ACK message with respective watchdog values to close TCP connection - it is required to close ClientManager with no ConnectException thrown\n\t\tmockComputeEngine_Runnable.sendMessage(new ServerMessage_ACK(sensorID, mockComputeEngine_Runnable.getLocal_1h_watchdog() ,mockComputeEngine_Runnable.getLocal_24h_watchdog()), mockComputeEngine_Runnable.getOutputStream());\n\t\tThread.sleep(50);\n\t}",
"public void testStartCM()\n\t{\n\t\tString strCurServerAddress = null;\n\t\tint nCurServerPort = -1;\n\t\tString strNewServerAddress = null;\n\t\tString strNewServerPort = null;\n\t\t\n\t\tstrCurServerAddress = m_clientStub.getServerAddress();\n\t\tnCurServerPort = m_clientStub.getServerPort();\n\t\t\n\t\t// ask the user if he/she would like to change the server info\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tSystem.out.println(\"========== start CM\");\n\t\tSystem.out.println(\"current server address: \"+strCurServerAddress);\n\t\tSystem.out.println(\"current server port: \"+nCurServerPort);\n\n\t\tboolean bRet = m_clientStub.startCM();\n\t\tif(!bRet)\n\t\t{\n\t\t\tSystem.err.println(\"CM initialization error!\");\n\t\t\treturn;\n\t\t}\n\t\tloginDS();\n\t}",
"public void startTest(){\n\t\t\tMainUIHandler.sendEmptyMessage(UI_START_TEST);\t\n\t\t}",
"public TestOutcome executeTests()\n\t//throws InternalBuildServerException//, IOException \n\t{\n\t\tString buildServerTestFilesDir = getDirectoryFinder().getTestFilesDirectory().getAbsolutePath() + File.separator;\n\t\t\n\t\t// Build arguments to java process\n\t\tList<String> javaArgs = new LinkedList<String>();\n\t\tjavaArgs.add(\"java\");\n //TODO Factor the amount of memory and the extra -D parameters into config.properties\n javaArgs.add(\"-Xmx256m\");\n javaArgs.add(\"-Dcom.sun.management.jmxremote\");\n String vmArgs = tester.getTestProperties().getVmArgs();\n if (vmArgs != null) {\n // Break up into separate tokens if necessary\n StringTokenizer tokenizer = new StringTokenizer(vmArgs);\n while (tokenizer.hasMoreElements()) {\n String nextArg = tokenizer.nextToken();\n nextArg.replace(\"${buildserver.test.files.dir}\", buildServerTestFilesDir);\n // nextArg = nextArg.replace(\"${buildserver.test.files.dir}\", buildServerTestFilesDir);\n\t\t\t\tjavaArgs.add(nextArg);\n }\n }\n\t\tjavaArgs.add(\"-classpath\");\n\t\tjavaArgs.add(classPath);\n\t\t// Tests must run headless, for obvious reasons\n\t\tjavaArgs.add(\"-Djava.awt.headless=true\");\n\t\t// Specify filename of project jar file\n\t\tjavaArgs.add(\"-Dbuildserver.test.jar.file=\" + getProjectSubmission().getProjectJarFile().getAbsolutePath() + \"\");\n\t\t// Specify the path of the build directory\n\t\tjavaArgs.add(\"-Dbuildserver.build.dir=\" + getDirectoryFinder().getBuildDirectory().getAbsolutePath());\n\t\t// Add trusted code bases\n\t\tfor (Iterator<TrustedCodeBase> i = getTrustedCodeBaseFinder().getCollection().iterator(); i.hasNext(); ) {\n\t\t\tTrustedCodeBase trustedCodeBase = i.next();\n\t\t\tjavaArgs.add(\"-D\" + trustedCodeBase.getProperty() + \"=\" + trustedCodeBase.getValue());\n\t\t}\n\t\t// Let the test classes know where test files are.\n\t\t// Append a separator to the end, because this makes it\n\t\t// easier for the tests to determine how to access\n\t\t// the test files.\n\t\tjavaArgs.add(\"-Dbuildserver.test.files.dir=\" + buildServerTestFilesDir);\n\t\tif (getDebugJavaSecurity()) {\n\t\t\tjavaArgs.add(\"-Djava.security.debug=access,failure\");\n\t\t}\n\t\tif (tester.getHasSecurityPolicyFile()) {\n\t\t\t// Project jar file contained a security policy file\n\t\t\tjavaArgs.add(\"-Djava.security.manager\");\n\t\t\tjavaArgs.add(\"-Djava.security.policy=file:\" \n + new File(getDirectoryFinder().getTestFilesDirectory(), \"security.policy\").getAbsolutePath());\n\t\t}\n\t\t// XXX TestRunner\n\t\tjavaArgs.add(TestRunner.class.getName());\n\t\tif (nextTestNumber > 0) {\n\t\t\tjavaArgs.add(\"-startTestNumber\");\n\t\t\tjavaArgs.add(String.valueOf(nextTestNumber));\n\t\t}\n\t\tjavaArgs.add(getProjectSubmission().getSubmissionPK());\n\t\tjavaArgs.add(testType);\n\t\tjavaArgs.add(testClass);\n\t\tjavaArgs.add(outputFilename);\n\t\tint timeoutInSeconds = tester.getTestProperties().getTestTimeoutInSeconds();\n\t\tif (testCase != null && testCase.getMaxTimeInSeconds() != 0) {\n\t\t\ttimeoutInSeconds = testCase.getMaxTimeInSeconds();\n getLog().trace(\"Using @MaxTestTime(value=\" +timeoutInSeconds+ \") annotation\");\n }\n\t\tjavaArgs.add(String.valueOf(timeoutInSeconds));\n\t\tif (testMethod != null) {\n\t\t\tjavaArgs.add(testMethod);\n\t\t}\n\t\t\n\t\t// Which directory to execute the TestRunner in.\n\t\t// By default, this is the build directory, but the\n\t\t// cwd.testfiles.dir property may set it to\n\t\t// be the testfiles directory.\n\t\tFile testRunnerCWD = getDirectoryFinder().getBuildDirectory();\n\t\t// Student-written tests must be run from the build directory\n\t\t// (where the student code is extracted) no matter what\n\t\tif (tester.getTestProperties().isTestRunnerInTestfileDir() && !testType.equals(TestOutcome.STUDENT_TEST))\n\t\t\ttestRunnerCWD = getDirectoryFinder().getTestFilesDirectory();\n\t\t\n\t\tgetLog().debug(\"TestRunner working directory: \" +testRunnerCWD);\n\t\t\n\t\t// Execute the test!\n\t\tint exitCode;\n\t\t//XXX What is this timing? This assumes we're timing the entire process, which\n\t\t// we're clearly not doing from here\n\t\tAlarm alarm = tester.getTestProcessAlarm();\n\t\tCombinedStreamMonitor monitor = null;\n\n\t\tProcess testRunner = null;\n\t\tboolean isRunning = false;\n\t\ttry {\n\t\t\t// Spawn the TestRunner process\n\t\t\ttestRunner = Runtime.getRuntime().exec(\n\t\t\t\t\tjavaArgs.toArray(new String[javaArgs.size()]),\n\t\t\t\t\tenvironment,\n\t\t\t\t\ttestRunnerCWD\n\t\t\t);\n \n String cmd = MarmosetUtilities.commandToString(javaArgs);\n getLog().debug(\"TestRunner command: \" + cmd);\n try {\n int pid=MarmosetUtilities.getPid(testRunner);\n getLog().debug(\"Subprocess for submission \" +getProjectSubmission().getSubmissionPK() +\n \" for testSetup \" +getProjectSubmission().getProjectJarfilePK() +\n \" for \"+testType +\" \"+nextTestNumber+\n \" \" +testMethod+\n \" in testClass \" +testClass+\n \" has pid = \" +pid);\n } catch (IllegalAccessException e) {\n getLog().debug(\"Cannot get PID of process: \" +e);\n } catch (NoSuchFieldException e) {\n getLog().debug(\"Cannot get PID of process: \" +e);\n }\n \n\t\t\tisRunning = true;\n\n\t\t\t// Start the timeout alarm\n\t\t\talarm.start();\n\n\t\t\t// Record the output\n\t\t\tmonitor = tester.createStreamMonitor(testRunner.getInputStream(), testRunner.getErrorStream());\n\t\t\tmonitor.start();\n\t\t\t\n\t\t\t// Wait for the test runner to finish.\n\t\t\t// This may be interrupted by the timeout alarm.\n\t\t\tmonitor.join();\n\t\t\texitCode = testRunner.waitFor();\n\t\t\tisRunning = false;\n // Groovy, we finished before the alarm went off.\n // Disable it (and clear our interrupted status)\n // in case it went off just after the process wait\n // finished.\n alarm.turnOff();\n \n\t\t\t// Just for debugging...\n\t\t\tgetLog().debug(\"TestRunner process finished; captured to stdout/stderr output was: \");\n\t\t\tgetLog().debug(monitor.getCombinedOutput());\n if (monitor.getCombinedOutput().contains(\"AccessControlException\")) {\n getLog().warn(\"Clover could not be initialized due to an AccessControlException. \" +\n \" Please check your security.policy file and make sure that student code \" +\n \"has permission to read/write/delete /tmp and can install shutdown hooks\");\n }\n\t\n\t\t} catch (IOException e) {\n\t\t\tString shortTestResult=getFullTestName() +\" failed with IOException: \" +e.getMessage();\n\t\t\t// TODO get a stack trace into here\n\t\t\tString longTestResult=e.toString();\n\t\t\tgetLog().error(shortTestResult, e);\n\t\t\treturn Tester.createUnableToRunOneTestOutcome(testType, testMethod, testClass, \n nextTestNumber,\tTestOutcome.FAILED, shortTestResult, longTestResult);\n\t\t} catch (InterruptedException e) {\n\t\t\tif (!alarm.fired())\n\t\t\t\tgetLog().error(\"Someone unexpectedly interrupted the timer\");\n\n\t\t\tString shortTestResult = \"Timeout!\";\n\t\t\tString longTestResult = monitor.getCombinedOutput();\n\t\t\tgetLog().error(shortTestResult, e);\n getLog().trace(\"Timeout for \" +testType+ \" \" +testMethod+ \" \" +nextTestNumber);\n\t\t\treturn Tester.createUnableToRunOneTestOutcome(testType, testMethod, testClass, \n nextTestNumber, TestOutcome.TIMEOUT, shortTestResult, longTestResult);\n\t\t} finally {\n\t\t\t// Make sure the process is cleaned up.\n\t\t\tif (isRunning)\n\t\t\t\ttestRunner.destroy();\n\t\t}\n\t\t\n\t\tif (exitCode != 0) {\n\t\t\t// Test runner couldn't execute the tests for some reason.\n\t\t\t// This is probably not our fault.\n\t\t\t// Just add an outcome recording the output of\n\t\t\t// the test runner process.\n\t\t\tString shortTestResult = getFullTestName() +\" subprocess failed to return with 0 status\";\n\t\t\tString longTestResult = monitor.getCombinedOutput();\n\t\t\tgetLog().error(shortTestResult);\n\t\t\treturn Tester.createUnableToRunOneTestOutcome(testType, testMethod, testClass,\n nextTestNumber,\tTestOutcome.FAILED, shortTestResult, longTestResult);\n\t\t}\n\t\t\n\t\tgetLog().debug(getFullTestName()+ \" test finished with \" + new File(outputFilename).length() +\n\t\t\t\t\" bytes of output\");\n\n\t\treturn readTestOutcomeFromFile();\n\t}",
"@Test\n public void testMain() {\n System.out.println(\"main\");\n String[] args = null;\n SServer.main(args);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }",
"private void runServer()\n\t{\n\t\tif(sm == null)\n\t\t{\n\t\t\tsm = new ServerManager();\n\t\t}\n\t\t\n\t\tint port = 1209;\n\t\ttry \n\t\t{\n\t\t\twaitUser(sm, port);\n\t\t\t//이 아래 로직이 실행된다는건 유저가 다 들어왔다는 뜻임. 즉 게임 시작할 준비 되었음을 의미함\t\t\t\n\t\t\tGame.getInstance().runGame();\n\t\t} \n\t\tcatch (Exception e)\n\t\t{\n\t\t\tSystem.out.println(\"[Server.runServer()] error >>> : \" + e.getMessage());\n\t\t}\n\t}",
"@Test\n\tpublic void testBasicDevStartup() throws InterruptedException, ClassNotFoundException, ExecutionException, TimeoutException {\n\t\ttestArgSetup(\"test\");\n\t\t\n\t\t//really just making sure we don't throw an exception...which catches quite a few mistakes\n\t\tDevelopmentServer server = new DevelopmentServer(true);\n\t\t//In this case, we bind a port\n\t\tserver.start();\n\t\t//we should depend on http client and send a request in to ensure operation here...\n\t\t\n\t\tserver.stop();\n\t}",
"@Test\r\n @SuppressWarnings(\"SleepWhileInLoop\")\r\n public void testStartSimulationSession() {\r\n System.out.println(\"startSimulationSession\");\r\n assertNotNull(sm);\r\n assertEquals(SimulationState.READY, sm.getSimulationSessionState(\"test3\"));\r\n \r\n sm.addSimulatorToSession(\"test3\", Simulators.NUATMOS, \"v1\", true);\r\n //sm.addSimulatorToSession(\"test3\", Simulators.DISPERFIRE, true);\r\n //sm.addSimulatorToSession(\"test3\", Simulators.MEB, true);\r\n \r\n boolean result = sm.startSimulationSession(\"test3\", false);\r\n assertTrue(result);\r\n \r\n result = sm.startSimulationSession(\"test5\", false);\r\n assertFalse(result);\r\n \r\n Iterator<? extends ISimulationJobInfo> jobs = sm.getSession(\"test3\").iterator();\r\n \r\n for(ISimulationJobInfo job; jobs.hasNext();) {\r\n job = jobs.next();\r\n assertEquals(job.getRetVal(), 0);\r\n }\r\n }",
"public void Run(){\n\t\t_TEST stack = new _TEST();\t\t/* TEST */\n\t\tstack.PrintHeader(ID,\"\", \"\");\t/* TEST */\n\t\t\n\t\tSetStatus(Status.RUNNING);\n\t\t\n\t\tstack.PrintTail(ID,\"\", \"\"); \t/* TEST */\n\t\t\n\t}",
"@Test\n public void testStart() {\n System.out.println(\"start\");\n int port = 0;\n SServer instance = new SServer();\n instance.start(port);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }",
"@SuppressWarnings(\"static-access\")\n\t@Test\n\tpublic void test_run_1() throws IOException, InterruptedException {\n\t\t\n\t\t// bind server socket and start TCPserver\n\t\tmockTCPserverTest.getServerSocket().bind(new java.net.InetSocketAddress(port_1));\n\t\tmockTCPserverTest.startServer(mockTCPserverTest.getServerSocket());\n\t\tmockServerThread.start();\n\t\t\n\t\tTCPclientSocket = new Socket(serverHostName, port_1);\n\t\twhen(mockTCPclientTest.getClientSocket()).thenReturn(TCPclientSocket);\t\n\t\t\n\t\tclientManager_1 = clientManager_1.initClientManager(mockTCPclientTest.getClientSocket(), sensor_ID_1);\n\t\tThread.sleep(20);\n\t\t\n\t\t// start test Thread on the server side that is responsible for listening messages sent by TCPclient\n\t\ttestThread_server.start();\n\t\tThread.sleep(20);\n\t\t\n\t\t// start test Thread on the client side that is responsible for listening messages sent by TCPserver and re-sending particular responses that are verified in the consecutive test runs\n\t\t// method under test messagesHandler() is called in this thread\n\t\ttestThread_client.start();\n\t\tThread.sleep(20);\n\t\t\n\t\tint sensorID = 1;\n\t\tfloat[][] sensor_coordinates_array_1 = {{18.0f, 15.0f}};\n\t\tString softwareImageID_1 = \"Release XX\";\n\t\tint measurement_limit_1 = 48;\n\t\tSensorState sens_state_1 = SensorState.MAINTENANCE;\n\t\tdouble sens_watchdog_scale_factor_1 = 0.25;\n\t\t\n\t\tSensorImpl temp_sens_sent_1 = new SensorImpl(sensorID, new Point2D.Float(sensor_coordinates_array_1[0][0], sensor_coordinates_array_1[0][1]), softwareImageID_1, measurement_limit_1);\n\t\ttemp_sens_sent_1.setSensorState(sens_state_1);\n\t\ttemp_sens_sent_1.setSensor_watchdog_scale_factor(sens_watchdog_scale_factor_1);\n\t\t\n\t\tSensorImpl temp_sens_received_1 = mockTCPclientTest.searchInClientSensorList(sensorID);\n\t\t\n\t\tassertNotEquals(temp_sens_sent_1.getCoordinates(),\t\t\t\t\ttemp_sens_received_1.getCoordinates());\n\t\tassertNotEquals(temp_sens_sent_1.getLocal_watchdog_scale_factor(),\ttemp_sens_received_1.getLocal_watchdog_scale_factor(), 0.01);\n\t\tassertNotEquals(temp_sens_sent_1.getSoftwareImageID(),\t\t\t\ttemp_sens_received_1.getSoftwareImageID());\n\t\tassertNotEquals(temp_sens_sent_1.getSensor_m_history_array_size(),\ttemp_sens_received_1.getSensor_m_history_array_size());\n\t\t\n\t\t// add measurement to prove that the sensor has been reset (senor reset removes all measurement from a sensor's memory)\n\t\ttemp_sens_sent_1.addMeasurement(1.0, 1.0, 1, 1, 1);\n\t\tint number_of_measurements = 1;\n\t\tassertEquals(number_of_measurements, temp_sens_sent_1.getNumberOfMeasurements());\n\t\t\n\t\tmockComputeEngine_Runnable.sendMessage(new ServerMessage_SensorInfoUpdate(temp_sens_sent_1.getSensorID(), temp_sens_sent_1.getCoordinates(), temp_sens_sent_1.getSoftwareImageID(), \n\t\t\t\t\t\t\t\t\t\t\t\ttemp_sens_sent_1.getSensorState(),\n\t\t\t\t\t\t\t\t\t\t\t\tmockComputeEngine_Runnable.getLocal_1h_watchdog(), mockComputeEngine_Runnable.getLocal_24h_watchdog(),\n\t\t\t\t\t\t\t\t\t\t\t\ttemp_sens_sent_1.getLocal_watchdog_scale_factor(), temp_sens_sent_1.getSensor_m_history_array_size()), mockComputeEngine_Runnable.getOutputStream());\n\t\tThread.sleep(50);\n\t\t\n\t\ttemp_sens_received_1 = mockTCPclientTest.searchInClientSensorList(sensorID);\n\t\t\n\t\tassertTrue(receivedMessage instanceof ClientMessage_BootUp);\n\t\t\n\t\tint number_of_measurements_after_reset = 0;\n\t\tassertNotEquals(number_of_measurements, \t\t\t\t\t\t\ttemp_sens_received_1.getNumberOfMeasurements());\n\t\tassertEquals(number_of_measurements_after_reset, \t\t\t\t\ttemp_sens_received_1.getNumberOfMeasurements());\n\t\tassertEquals(temp_sens_sent_1.getSensorState(),\t\t\t\t\t\ttemp_sens_sent_1.getSensorState());\n\t\tassertEquals(temp_sens_sent_1.getCoordinates(),\t\t\t\t\t\ttemp_sens_received_1.getCoordinates());\n\t\tassertEquals(temp_sens_sent_1.getLocal_watchdog_scale_factor(),\t\ttemp_sens_received_1.getLocal_watchdog_scale_factor(), 0.01);\n\t\tassertEquals(temp_sens_sent_1.getSensorID(),\t\t\t\t\t\ttemp_sens_received_1.getSensorID());\n\t\tassertEquals(temp_sens_sent_1.getSoftwareImageID(),\t\t\t\t\ttemp_sens_received_1.getSoftwareImageID());\n\t\tassertEquals(temp_sens_sent_1.getSensor_m_history_array_size(),\t\ttemp_sens_received_1.getSensor_m_history_array_size());\n\t\t\n\t\tfloat[][] sensor_coordinates_array_2 = {{18.0f, 13.0f}};\n\t\tString softwareImageID_2 = \"Release XY\";\n\t\tint measurement_limit_2 = 36;\n\t\tSensorState sens_state_2 = SensorState.PRE_OPERATIONAL;\n\t\tdouble sens_watchdog_scale_factor_2 = 0.18;\n\t\t\n\t\tSensorImpl temp_sens_sent_2 = new SensorImpl(sensorID, new Point2D.Float(sensor_coordinates_array_2[0][0], sensor_coordinates_array_2[0][1]), softwareImageID_2, measurement_limit_2);\n\t\ttemp_sens_sent_1.setSensorState(sens_state_2);\n\t\ttemp_sens_sent_1.setSensor_watchdog_scale_factor(sens_watchdog_scale_factor_2);\n\t\t\n\t\tSensorImpl temp_sens_received_2 = mockTCPclientTest.searchInClientSensorList(sensorID);\n\t\t\n\t\tassertNotEquals(temp_sens_sent_2.getCoordinates(),\t\t\t\t\ttemp_sens_received_2.getCoordinates());\n\t\tassertNotEquals(temp_sens_sent_2.getSensorState(),\t\t\t\t\ttemp_sens_received_2.getSensorState());\n\t\tassertNotEquals(temp_sens_sent_2.getLocal_watchdog_scale_factor(),\ttemp_sens_received_2.getLocal_watchdog_scale_factor(), 0.01);\n\t\tassertNotEquals(temp_sens_sent_2.getSoftwareImageID(),\t\t\t\ttemp_sens_received_2.getSoftwareImageID());\n\t\tassertNotEquals(temp_sens_sent_2.getSensor_m_history_array_size(),\ttemp_sens_received_2.getSensor_m_history_array_size());\n\t\t\n\t\t// add measurement to prove that the sensor has been reset (senor reset removes all measurement from a sensor's memory)\n\t\ttemp_sens_sent_2.addMeasurement(1.0, 1.0, 1, 1, 1);\n\t\tassertEquals(number_of_measurements, temp_sens_sent_1.getNumberOfMeasurements());\n\t\t\n\t\tmockComputeEngine_Runnable.sendMessage(new ServerMessage_SensorInfoUpdate(temp_sens_sent_2.getSensorID(), temp_sens_sent_2.getCoordinates(), temp_sens_sent_2.getSoftwareImageID(), \n\t\t\t\t\t\t\t\t\t\t\t\ttemp_sens_sent_2.getSensorState(),\n\t\t\t\t\t\t\t\t\t\t\t\tmockComputeEngine_Runnable.getLocal_1h_watchdog(), mockComputeEngine_Runnable.getLocal_24h_watchdog(),\n\t\t\t\t\t\t\t\t\t\t\t\ttemp_sens_sent_2.getLocal_watchdog_scale_factor(), temp_sens_sent_2.getSensor_m_history_array_size()), mockComputeEngine_Runnable.getOutputStream());\n\t\tThread.sleep(50);\n\t\t\n\t\ttemp_sens_received_2 = mockTCPclientTest.searchInClientSensorList(sensorID);\n\t\t\n\t\tassertTrue(receivedMessage instanceof ClientMessage_BootUp);\n\t\t\n\t\tassertNotEquals(number_of_measurements, \t\t\t\t\t\t\ttemp_sens_received_2.getNumberOfMeasurements());\n\t\tassertEquals(number_of_measurements_after_reset, \t\t\t\t\ttemp_sens_received_2.getNumberOfMeasurements());\n\t\tassertEquals(temp_sens_sent_2.getSensorState(),\t\t\t\t\t\ttemp_sens_received_2.getSensorState());\n\t\tassertEquals(temp_sens_sent_2.getCoordinates(),\t\t\t\t\t\ttemp_sens_received_2.getCoordinates());\n\t\tassertEquals(temp_sens_sent_2.getLocal_watchdog_scale_factor(),\t\ttemp_sens_received_2.getLocal_watchdog_scale_factor(), 0.01);\n\t\tassertEquals(temp_sens_sent_2.getSensorID(),\t\t\t\t\t\ttemp_sens_received_2.getSensorID());\n\t\tassertEquals(temp_sens_sent_2.getSoftwareImageID(),\t\t\t\t\ttemp_sens_received_2.getSoftwareImageID());\n\t\tassertEquals(temp_sens_sent_2.getSensor_m_history_array_size(),\t\ttemp_sens_received_2.getSensor_m_history_array_size());\n\n\t\t// send ServerMessage_ACK message with respective watchdog values to close TCP connection - it is required to close ClientManager with no ConnectException thrown\n\t\tmockComputeEngine_Runnable.sendMessage(new ServerMessage_ACK(sensorID, mockComputeEngine_Runnable.getLocal_1h_watchdog() ,mockComputeEngine_Runnable.getLocal_24h_watchdog()), mockComputeEngine_Runnable.getOutputStream());\n\t\tThread.sleep(50);\n\t}",
"public static void runTests() {\n\t\tResult result = JUnitCore.runClasses(TestCalculator.class);\n\n\t}",
"abstract protected void RunTest(Socket s);",
"@Test\r\n\tpublic void testExecuteMachine() throws MalformedURLException {\n//\t\tassertEquals(true, MockBackLMBets.executed);\r\n//\t\tassertEquals(6000000, MockBackLMBets.marketSuspendTime);\r\n//\r\n//\t\tmachine.fireEvent(\"runner\", ctx);\r\n//\t\tassertEquals(\"backPlaced\", machine.getCurrentStateId());\r\n\r\n\t}",
"@Test\r\n public void testAddSimulatorToSession() {\r\n System.out.println(\"addSimulatorToSession\");\r\n assertNotNull(sm);\r\n sm.initSession(\"test4\", programsHome, programsHome + \"files4/\", requester);\r\n \r\n boolean result = sm.addSimulatorToSession(\"test4\", Simulators.NUATMOS, \"v1\", true);\r\n assertTrue(result);\r\n \r\n result = sm.addSimulatorToSession(\"test5\", Simulators.NUATMOS, \"v1\", true);\r\n assertFalse(result);\r\n \r\n sm.removeSession(\"test4\");\r\n \r\n }",
"public void run() {\n assertEquals(sendQuery(\"SFO\"), 7);\n assertEquals(sendQuery(\"RHV\"), 1);\n assertEquals(sendQuery(\"xyzzy\"), 0);\n }",
"public static void main(String args[]) {\n\t\t JUnitCore junit = new JUnitCore();\n\t\t junit.addListener(new TextListener(System.out));\n\t\t Result result = junit.run(registration.class); // Replace \"SampleTest\" with the name of your class\n\t\t if (result.getFailureCount() > 0) {\n\t\t System.out.println(\"Test failed.\");\n\t\t System.exit(1);\n\t\t } else {\n\t\t System.out.println(\"Session Test finished successfully.\");\n\t\t System.exit(0);\n\t\t }\n\t}",
"public void run()\n\t{\n\t\t// Variables for setting up connection and communication\n\t\tSocket socket = null; // socket to connect with ServerRouter\n\n\t\tint SockNum = 5555; // port number\n\n\t\t// Tries to connect to the ServerRouter\n\t\ttry\n\t\t{\n\t\t\tif (RunningOnLocalMachine)\n\t\t\t\trouterName = \"127.0.0.1\";\n\t\t\tsocket = new Socket(routerName, SockNum, null, PortToRunOn());\n\t\t}\n\t\tcatch (IOException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t\tERROR(\"Couldn't get I/O for the connection to: \" + routerName);\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\tout = new PrintWriter(socket.getOutputStream(), true);\n\t\t\tin = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n\t\t\tout.println(testChoice); //initial send test choice (MUST)\n\t\t\tPRINT(\"Test choice \\'\" + testChoice + \"\\' was sent to the server router\");\n\t\t\tString fromClient = in.readLine();// initial receive from router (verification of connection)\n\t\t\tout.println(fromClient);// initial send (IP of the destination Client)\n\t\t\tPRINT(\"ServerRouter: \" + fromClient);\n\t\t}\n\t\tcatch (IOException e)\n\t\t{\n\t\t\tERROR(\"Couldn't get I/O for the connection\");\n\t\t}\n\n\t\t//since connection now set up, actually run test\n\t\tRunTest(socket);\n\n\t\t//clean up socket\n\t\ttry\n\t\t{\n\t\t\tin.close();\n\t\t\tout.close();\n\t\t\tsocket.close();\n\t\t}\n\t\tcatch (IOException e)\n\t\t{\n\t\t\tERROR(\"Error when closing socket\");\n\t\t}\n\t\tPRINT(\"Thread Closed\");\n\t}",
"public void run() throws Exception {\n ServerEndpoint se = getServerEndpoint();\n TestService service = new TestServiceImpl();\n int redirectPort = getPort() + 1;\n Redirector rd = new Redirector(getHost(),getPort(),redirectPort);\n ((TestServerEndpoint) se).redirect(redirectPort);\n Thread t = new Thread(rd);\n t.start();\n BasicJeriExporter exporter = new BasicJeriExporter(se,\n new BasicILFactory());\n TestService stub = (TestService) exporter.export(service);\n //Connect to the mux server\n Socket s = new Socket(getHost(),getPort());\n InputStream is = s.getInputStream();\n OutputStream os = s.getOutputStream();\n //Send client connection header\n ClientConnectionHeader cHeader = new ClientConnectionHeader();\n cHeader.send(os);\n //Receive ServerConnection header and verify format\n ServerConnectionHeader sHeader = new ServerConnectionHeader();\n try {\n sHeader.receive(is,getTimeout());\n } catch (ProtocolException e) {\n e.printStackTrace();\n throw new TestException(e.getMessage(),e);\n }\n //Make a remote call that returns something\n stub.doSomething();\n exporter.unexport(true);\n rd.stop();\n //Extract and analyze the messages sent by the mux server\n try {\n analyzeServerDataBytes(rd.getServerConversation());\n } catch (ProtocolException e) {\n e.printStackTrace();\n throw new TestException(e.getMessage(),e);\n }\n //Ping the server\n PingMessage pm = new PingMessage().setCookie((short)0x5544);\n pm.send(os);\n //Receive a ping ack from server and verify that the correct cookie\n //is included\n se = getServerEndpoint();\n service = new TestServiceImpl();\n exporter = new BasicJeriExporter(se,\n new BasicILFactory());\n stub = (TestService) exporter.export(service);\n //Connect to the mux server\n s = new Socket(getHost(),getPort());\n is = s.getInputStream();\n os = s.getOutputStream();\n PingAckMessage pam = new PingAckMessage().setCookie((short)0x5544);\n try {\n pam.receive(is,getTimeout());\n } catch (ProtocolException e) {\n e.printStackTrace();\n throw new TestException(e.getMessage(),e);\n }\n }",
"private void runEm() {\n renameOriginalDomainConfig();\n\n testV3_0_1Domain();\n\n // after all the tests have run, move back the old domain\n restoreOriginalDomainConfig();\n\n // print results\n stat.printSummary();\n }",
"@Test\r\n public void startServerAndThreads() throws IOException {\r\n //init\r\n InetAddress iPAddress = InetAddress.getByName(\"localhost\");\r\n int port = 99;\r\n\r\n Server server = new Server(port, iPAddress);\r\n server.start();\r\n }",
"@Before\n public void setUp() throws Exception {\n localServer = new KVServer(\"test\", \"localhost\", 2181);\n localServer.initKVServer(1234, 11, IKVServer.CacheStrategy.LFU.getValue());\n localServerThread = new Thread(localServer);\n localServerThread.start();\n\n KVClient client = new KVClient();\n localKvClient = new KVStore(client, \"localhost\", 1234);\n localKvClient.connect();\n\n // setting up ecs\n client = new KVClient();\n ecsKvClient = new KVStore(client, \"localhost\", 50000);\n ecsKvClient.connect();\n\n }",
"@Test\n public void testServer() throws Exception{\n ServerMain s=new ServerMain(1,3,2,\"test\",InetAddress.getLocalHost(),null);\n uut=new ChatMessageRequest(\"test\",\"test2\",\"test\",MessageTypes.PM);\n uut.serverVisit(new Client(\"test\",s).getServerVisitor());\n\n uut=new ChatMessageRequest(\"test\",\"test2\",\"test\",MessageTypes.MATCH);\n uut.serverVisit(new Client(\"test\",s).getServerVisitor());\n\n uut=new ChatMessageRequest(\"test\",\"test2\",\"test\",MessageTypes.MATCH);\n uut.serverVisit(new Client(\"testInvalid\",s).getServerVisitor());\n }",
"@BeforeClass\n public static void setUpBeforeClass() throws Exception {\n UnitTestUtilities.startDefaultServer();\n Thread.sleep(500);\n }",
"@Test\n\tpublic void check() {\n\n\t\ttry {\n\t\t\tSystem.out.println(\"Unit Test Begins\");\n\t\t\t// Generate Random Log file\n\t\t\tUnitTestLogGenerator.generateRandomLogs();\n\t\t\t// Generate Cmd String\n\t\t\tString cmd = ClientClass.generateCommand(IpAddress, \"seth\", \"v\",\n\t\t\t\t\ttrue);\n\t\t\t// Run Local Grep;\n\t\t\tlocalGrep(cmd);\n\t\t\t// Connecting to Server\n\t\t\tConnectorService connectorService = new ConnectorService();\n\t\t\tconnectorService.connect(IpAddress, cmd);\n\t\t\tInputStream FirstFileStream = new FileInputStream(\n\t\t\t\t\t\"/tmp/localoutput_unitTest.txt\");\n\t\t\tInputStream SecondFileStream = new FileInputStream(\n\t\t\t\t\t\"/tmp/output_main.txt\");\n\t\t\tSystem.out.println(\"Comparing the two outputs...\");\n\t\t\tboolean result = fileComparison(FirstFileStream, SecondFileStream);\n\t\t\tAssert.assertTrue(result);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"protected void doSingleServerTest(String sTest, Runnable runnable)\n {\n try\n {\n System.setProperty(\"coherence.distributed.localstorage\", \"true\");\n _startup();\n runnable.run();\n }\n finally\n {\n _shutdown();\n }\n }",
"@Test\n public void startServer() throws InterruptedException {\n UicdInstrumentation uicdInstrumentation =\n UicdInstrumentation.getInstance(\n getInstrumentation().getContext(), DEFAULT_PORT);\n uicdInstrumentation.startServer();\n\n while (!uicdInstrumentation.isStopServer()) {\n SystemClock.sleep(PING_SERVER_MS);\n }\n }",
"boolean runsServer();",
"@SuppressWarnings(\"static-access\")\n\t@Test\n\tpublic void test_run_3() throws IOException, InterruptedException {\n\t\t\n\t\t// bind server socket and start TCPserver\n\t\tmockTCPserverTest.getServerSocket().bind(new java.net.InetSocketAddress(port_1));\n\t\tmockTCPserverTest.startServer(mockTCPserverTest.getServerSocket());\n\t\tmockServerThread.start();\n\t\t\n\t\tTCPclientSocket = new Socket(serverHostName, port_1);\n\t\twhen(mockTCPclientTest.getClientSocket()).thenReturn(TCPclientSocket);\t\n\t\t\n\t\tclientManager_1 = clientManager_1.initClientManager(mockTCPclientTest.getClientSocket(), sensor_ID_1);\n\t\tThread.sleep(20);\n\t\t\n\t\t// start test Thread on the server side that is responsible for listening messages sent by TCPclient\n\t\ttestThread_server.start();\n\t\tThread.sleep(20);\n\t\t\n\t\t// start test Thread on the client side that is responsible for listening messages sent by TCPserver and re-sending particular responses that are verified in the consecutive test runs\n\t\t// method under test messagesHandler() is called in this thread\n\t\ttestThread_client.start();\n\t\tThread.sleep(20);\n\t\t\n\t\tint sensorID = 1;\n\t\tfloat[][] sensor_coordinates_array_1 = {{11.0f, 14.0f}};\n\t\tString softwareImageID_1 = \"Release X\";\n\t\tint measurement_limit_1 = 12;\n\t\tSensorState sens_state_1 = SensorState.DEAD;\n\t\tdouble sens_watchdog_scale_factor_1 = 0.15;\n\t\t\n\t\tSensorImpl temp_sens_sent_1 = new SensorImpl(sensorID, new Point2D.Float(sensor_coordinates_array_1[0][0], sensor_coordinates_array_1[0][1]), softwareImageID_1, measurement_limit_1);\n\t\ttemp_sens_sent_1.setSensorState(sens_state_1);\n\t\ttemp_sens_sent_1.setSensor_watchdog_scale_factor(sens_watchdog_scale_factor_1);\n\t\t\n\t\tSensorImpl temp_sens_received_1 = mockTCPclientTest.searchInClientSensorList(sensorID);\n\t\t\n\t\tassertNotEquals(temp_sens_sent_1.getSensorState(),\t\t\t\ttemp_sens_received_1.getSensorState());\n\t\t\n\t\tmockComputeEngine_Runnable.sendMessage(new ServerMessage_SensorInfoUpdate(temp_sens_sent_1.getSensorID(), temp_sens_sent_1.getCoordinates(), temp_sens_sent_1.getSoftwareImageID(), \n\t\t\t\t\t\t\t\t\t\t\t\ttemp_sens_sent_1.getSensorState(),\n\t\t\t\t\t\t\t\t\t\t\t\tmockComputeEngine_Runnable.getLocal_1h_watchdog(), mockComputeEngine_Runnable.getLocal_24h_watchdog(),\n\t\t\t\t\t\t\t\t\t\t\t\ttemp_sens_sent_1.getLocal_watchdog_scale_factor(), temp_sens_sent_1.getSensor_m_history_array_size()), mockComputeEngine_Runnable.getOutputStream());\n\t\tThread.sleep(50);\n\t\t\n\t\ttemp_sens_received_1 = mockTCPclientTest.searchInClientSensorList(sensorID);\n\t\t\n\t\tassertTrue(receivedMessage instanceof ClientMessage_ACK);\n\n\t\tassertEquals(temp_sens_sent_1.getSensorState(),\t\t\t\t\ttemp_sens_received_1.getSensorState());\n\t\t\n\t\tassertFalse(clientManager_1.isClientManagerRunning());\n\t}",
"private void runSimulation() throws Exception{\n\t\tsimulatable.simulate();\n\t\tprintUsage();\n\t}",
"public void selfTest() {\n \n \n \n /**\n * TESTING CONFIGURATION RIGHT HERE:\n */\n int total = 1; //How many tests should we run\n int start = 0; //The first test to run\n //TestStubs.storePrints(); //store prints until the end\n TestStubs.displayDebugWhileTesting(false); //shows all the debug prints (with context switches) if set to true\n \n \n //MemoryMap.selfTest();\n //Swap.selfTest();\n \n UserProcess.testing = true;\n TestStubs.debugPrint(\"SELF TESTING VMKERNEL!\");\n \n int passed = 0;\n \n for (int i = 0; i < total; i++) {\n if (runTest(i+start))\n passed += 1;\n }\n \n if (passed != total) {\n TestStubs.debugPrint(\"SOME TESTS FAILED! \" + passed + \"/\" + total + \" passed.\");\n } else {\n TestStubs.debugPrint(\"ALL TESTS PASSED! \" + passed + \"/\" + total + \" passed.\");\n }\n \n UserProcess.testing = false;\n \n\n \n //System.out.println(TestStubs.getStoredPrints());\n //TestStubs.clearAndDontStorePrints();\n \n if (passed != total) {\n System.out.flush();\n /// kernel.terminate();\n }\n \n TestStubs.disable();\n \n }",
"@SuppressWarnings(\"static-access\")\n\t@Test\n\tpublic void test_run_2() throws IOException, InterruptedException {\n\t\t\n\t\t// bind server socket and start TCPserver\n\t\tmockTCPserverTest.getServerSocket().bind(new java.net.InetSocketAddress(port_1));\n\t\tmockTCPserverTest.startServer(mockTCPserverTest.getServerSocket());\n\t\tmockServerThread.start();\n\t\t\n\t\tTCPclientSocket = new Socket(serverHostName, port_1);\n\t\twhen(mockTCPclientTest.getClientSocket()).thenReturn(TCPclientSocket);\t\n\t\t\n\t\tclientManager_1 = clientManager_1.initClientManager(mockTCPclientTest.getClientSocket(), sensor_ID_1);\n\t\tThread.sleep(20);\n\t\t\n\t\t// start test Thread on the server side that is responsible for listening messages sent by TCPclient\n\t\ttestThread_server.start();\n\t\tThread.sleep(20);\n\t\t\n\t\t// start test Thread on the client side that is responsible for listening messages sent by TCPserver and re-sending particular responses that are verified in the consecutive test runs\n\t\t// method under test messagesHandler() is called in this thread\n\t\ttestThread_client.start();\n\t\tThread.sleep(20);\n\t\t\n\t\tint sensorID = 1;\n\t\tfloat[][] sensor_coordinates_array_1 = {{11.0f, 14.0f}};\n\t\tString softwareImageID_1 = \"Release X\";\n\t\tint measurement_limit_1 = 12;\n\t\tSensorState sens_state_1 = SensorState.OPERATIONAL;\n\t\tdouble sens_watchdog_scale_factor_1 = 0.15;\n\t\t\n\t\tSensorImpl temp_sens_sent_1 = new SensorImpl(sensorID, new Point2D.Float(sensor_coordinates_array_1[0][0], sensor_coordinates_array_1[0][1]), softwareImageID_1, measurement_limit_1);\n\t\ttemp_sens_sent_1.setSensorState(sens_state_1);\n\t\ttemp_sens_sent_1.setSensor_watchdog_scale_factor(sens_watchdog_scale_factor_1);\n\t\t\n\t\tSensorImpl temp_sens_received_1 = mockTCPclientTest.searchInClientSensorList(sensorID);\n\t\t\n\t\tassertNotEquals(temp_sens_sent_1.getLocal_watchdog_scale_factor(),\ttemp_sens_received_1.getLocal_watchdog_scale_factor(), 0.01);\n\t\tassertNotEquals(temp_sens_sent_1.getSensorState(),\t\t\t\t\t\ttemp_sens_received_1.getSensorState());\n\t\t\n\t\tmockComputeEngine_Runnable.sendMessage(new ServerMessage_SensorInfoUpdate(temp_sens_sent_1.getSensorID(), temp_sens_sent_1.getCoordinates(), temp_sens_sent_1.getSoftwareImageID(), \n\t\t\t\t\t\t\t\t\t\t\t\ttemp_sens_sent_1.getSensorState(),\n\t\t\t\t\t\t\t\t\t\t\t\tmockComputeEngine_Runnable.getLocal_1h_watchdog(), mockComputeEngine_Runnable.getLocal_24h_watchdog(),\n\t\t\t\t\t\t\t\t\t\t\t\ttemp_sens_sent_1.getLocal_watchdog_scale_factor(), temp_sens_sent_1.getSensor_m_history_array_size()), mockComputeEngine_Runnable.getOutputStream());\n\t\tThread.sleep(50);\n\t\t\n\t\ttemp_sens_received_1 = mockTCPclientTest.searchInClientSensorList(sensorID);\n\t\t\n\t\tassertTrue(receivedMessage instanceof ClientMessage_ACK);\n\n\t\tassertEquals(temp_sens_sent_1.getLocal_watchdog_scale_factor(),\t\ttemp_sens_received_1.getLocal_watchdog_scale_factor(), 0.01);\n\t\tassertEquals(temp_sens_sent_1.getSensorState(),\t\t\t\t\t\ttemp_sens_received_1.getSensorState());\n\t\t\n\t\t// send ServerMessage_ACK message with respective watchdog values to close TCP connection - it is required to close ClientManager with no ConnectException thrown\n\t\tmockComputeEngine_Runnable.sendMessage(new ServerMessage_ACK(sensorID, mockComputeEngine_Runnable.getLocal_1h_watchdog() ,mockComputeEngine_Runnable.getLocal_24h_watchdog()), mockComputeEngine_Runnable.getOutputStream());\n\t\tThread.sleep(50);\n\t}",
"private void execute() {\n\n\t\tPropertiesParser propertiesParser = new PropertiesParser();\n\t\t\n\t\tsetupServer(propertiesParser);\n\t\ttry {\n\t\t\t\n\t\t\tThread.sleep(SERVER_AFTER_RUN_DELAY);\n\t\t\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\t\n\t\tint i=0;\n\t\tfor( ; i < propertiesParser.getReadersNum() ; i++){\n\t\t\t\n\t\t\tsetupClient(propertiesParser , i,true);\n\t\t\t\n\t\t}\n\t\tfor(; i < propertiesParser.getReadersNum()+ propertiesParser.getWritersNum() ; i++){\n\t\t\t\n\t\t\tsetupClient(propertiesParser , i,false);\n\t\t\t\n\t\t}\n\t\t\n\t}",
"@Test\n @Tag(\"slow\")\n @Tag(\"unstable\")\n public void testNESM() {\n CuteNetlibCase.doTest(\"NESM.SIF\", \"1234567890\", \"1234567890\", NumberContext.of(7, 4));\n }",
"public void testStagesSession() {\n\n resetCounter();\n\n try {\n FixedResolver tr0 = new FixedResolver(\"127.0.0.1\", 54222);\n FixedTransportManager ftm0 = new FixedTransportManager(tr0);\n TestMediaManager tmm0 = new TestMediaManager(ftm0);\n tmm0.setPayloads(getTestPayloads1());\n List<JingleMediaManager> trl0 = new ArrayList<JingleMediaManager>();\n trl0.add(tmm0);\n\n FixedResolver tr1 = new FixedResolver(\"127.0.0.1\", 54567);\n FixedTransportManager ftm1 = new FixedTransportManager(tr1);\n TestMediaManager tmm1 = new TestMediaManager(ftm1);\n tmm1.setPayloads(getTestPayloads2());\n List<JingleMediaManager> trl1 = new ArrayList<JingleMediaManager>();\n trl1.add(tmm1);\n\n JingleManager man0 = new JingleManager(getConnection(0), trl0);\n JingleManager man1 = new JingleManager(getConnection(1), trl1);\n\n man1.addJingleSessionRequestListener(new JingleSessionRequestListener() {\n /**\n * Called when a new session request is detected\n */\n public void sessionRequested(final JingleSessionRequest request) {\n System.out.println(\"Session request detected, from \" + request.getFrom() + \": accepting.\");\n try {\n // We accept the request\n JingleSession session1 = request.accept();\n\n session1.addListener(new JingleSessionListener() {\n public void sessionClosed(String reason, JingleSession jingleSession) {\n System.out.println(\"sessionClosed().\");\n }\n\n public void sessionClosedOnError(XMPPException e, JingleSession jingleSession) {\n System.out.println(\"sessionClosedOnError().\");\n }\n\n public void sessionDeclined(String reason, JingleSession jingleSession) {\n System.out.println(\"sessionDeclined().\");\n }\n\n public void sessionEstablished(PayloadType pt, TransportCandidate rc, final TransportCandidate lc,\n JingleSession jingleSession) {\n incCounter();\n System.out.println(\"Responder: the session is fully established.\");\n System.out.println(\"+ Payload Type: \" + pt.getId());\n System.out.println(\"+ Local IP/port: \" + lc.getIp() + \":\" + lc.getPort());\n System.out.println(\"+ Remote IP/port: \" + rc.getIp() + \":\" + rc.getPort());\n }\n\n public void sessionMediaReceived(JingleSession jingleSession, String participant) {\n // Do Nothing\n }\n\n public void sessionRedirected(String redirection, JingleSession jingleSession) {\n }\n });\n\n session1.startIncoming();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n });\n\n // Session 0 starts a request\n System.out.println(\"Starting session request, to \" + getFullJID(1) + \"...\");\n JingleSession session0 = man0.createOutgoingJingleSession(getFullJID(1));\n\n session0.addListener(new JingleSessionListener() {\n public void sessionClosed(String reason, JingleSession jingleSession) {\n }\n\n public void sessionClosedOnError(XMPPException e, JingleSession jingleSession) {\n }\n\n public void sessionDeclined(String reason, JingleSession jingleSession) {\n }\n\n public void sessionEstablished(PayloadType pt, TransportCandidate rc, TransportCandidate lc,\n JingleSession jingleSession) {\n incCounter();\n System.out.println(\"Initiator: the session is fully established.\");\n System.out.println(\"+ Payload Type: \" + pt.getId());\n System.out.println(\"+ Local IP/port: \" + lc.getIp() + \":\" + lc.getPort());\n System.out.println(\"+ Remote IP/port: \" + rc.getIp() + \":\" + rc.getPort());\n }\n\n public void sessionRedirected(String redirection, JingleSession jingleSession) {\n }\n\n public void sessionMediaReceived(JingleSession jingleSession, String participant) {\n // Do Nothing\n }\n });\n session0.startOutgoing();\n\n Thread.sleep(20000);\n\n assertTrue(valCounter() == 2);\n\n } catch (Exception e) {\n e.printStackTrace();\n fail(\"An error occured with Jingle\");\n }\n }",
"@Test\n\tpublic void testExecute_fixture_5()\n\t\tthrows Exception {\n\t\tSessionStateMsg fixture2 = getFixture();\n\t\tLinkedList<String> list = new LinkedList<String>();\n\t\tlist.add(\"\");\n\t\tServerGameSession session = new ServerGameSession((String) null, list, new ImageIcon(), -1, -1);\n\t\tClientInfo sender = new ClientInfo(new Socket(\"\", 0));\n\n\t\tfixture2.execute(session, sender);\n\n\t\t// add additional test code here\n\t\t// An unexpected exception was thrown in user code while executing this test:\n\t\t// java.lang.NoClassDefFoundError: Could not initialize class server.ServerGameSession\n\t}",
"@Before\n public void setUp() {\n \tserver = super.populateTest();\n }",
"public static void main(String args[]){\n\t\tTestingUtils.runTests();\n\t\t\n\t}",
"@Test\n public void testLifeCycle() {\n NewServerResponse serverResponse = connection.createServer(\n \"test.ivan.api.com\", \"lenny\", \"MIRO1B\");\n Server server = serverResponse.getServer();\n // Now we have the server, lets restart it\n assertNotNull(server.getId());\n ServerInfo serverInfo = connection.restartServer(server.getId());\n\n // Should be running now.\n assertEquals(serverInfo.getState(), RunningState.RUNNING);\n assertEquals(server.getName(), \"test.ivan.api.com\");\n assertEquals(server.getImageId(), \"lenny\");\n connection.destroyServer(server.getId());\n }",
"@Test\n public void testStartSession() {\n startSession();\n }",
"@Test\n public void testSuccessfulServerStart() throws Exception {\n var channel = new EmbeddedServerChannel();\n\n server = getServer(channel.newSucceededFuture(), true);\n\n assertTrue(server.isRunning());\n }",
"@Test(groups = {\"rest-commands\"}, dependsOnMethods = {\"createStandaloneInstanceTest\"})\n public void startInstanceTest() {\n GlassFishServer server = glassFishServer();\n Command command = new CommandStartInstance(STANDALONE_INSTANCE);\n try {\n Future<ResultString> future =\n ServerAdmin.<ResultString>exec(server, command);\n try {\n ResultString result = future.get();\n //assertNotNull(result.getValue());\n assertEquals(result.state, TaskState.COMPLETED);\n } catch ( InterruptedException | ExecutionException ie) {\n fail(\"CommandStartInstance command execution failed: \" + ie.getMessage());\n }\n } catch (GlassFishIdeException gfie) {\n fail(\"CommandStartInstance command execution failed: \" + gfie.getMessage());\n }\n }",
"@BeforeSuite\r\n\tvoid start() throws ClassNotFoundException, SQLException\r\n\t{\r\n\t\t//Database obj = new Database();\r\n\t\t//Database.database();\r\n\t\t\r\n\t\tstartServer();\r\n\t\tobj_phoneno = new PageObject_phonenumber(androidDriver) ;\r\n\t\tLog4j.info(\"SERVER START--log\");\r\n\t\t//Log4j.info();\r\n\t\t/*obj_otp=new PageObject_OTP(androidDriver);\r\n\t\tobj_setupprofile=new PageObject_setupprofile(androidDriver);*/\r\n\t}",
"@Test\n public void main() {\n run(\"TEST\");\n }",
"@Override\n\tpublic void run() \n\t{\n\t\tcommunicator = com.zeroc.Ice.Util.initialize();\n GameServerPrx clientPrx = GameServerPrx.checkedCast(\n communicator.stringToProxy(\"client:default -h 58.167.142.74 -p 10002\")).ice_twoway().ice_secure(false).ice_collocationOptimized(false).ice_compress(true);\n\n if(clientPrx == null)\n {\n //If connection is failed due to server problems\n System.err.println(\"SB Connect: \" + \"Invalid proxy\");\n return;\n }\n System.out.println(\"SB Connect: \" + \"Connected\");\n Server server = new Server();\n server.address = ServerInfo.ADDRESS;\n server.UUID = ServerInfo.UUID;\n server.port = ServerInfo.PORT;\n server.name = ServerInfo.NAME;\n server.players = (short) players;\n\t\tclientPrx.sendServerDetails(server);\n\t\tSystem.out.println(\"SB Connect: \" + \"Data sent\");\n\t}",
"@Override\n\tpublic void testEngine() {\n\t\t\n\t}",
"public static void main(String[] args){\n new Testing().runTests();\r\n \r\n }",
"@BeforeClass\n public void setUp() {\n\n service = AppiumDriverLocalService.buildDefaultService();\n\n service.start();\n\n if (service == null || !service.isRunning()) {\n throw new AppiumServerHasNotBeenStartedLocallyException(\"Failed to start the Appium Server\");\n }\n path = AppUtility.getInstance().getPath();\n }",
"@Test\n\tvoid testRun() throws InterruptedException {\n\t\tUdpCommunicator communicator = this.getCommunicatorImplementation(43554);\n\t\tassertFalse(communicator.isAlive());\n\t\tcommunicator.start();\n\t\tassertTrue(communicator.isAlive());\n\t\tcommunicator.close();\n\t\tSystem.out.println(\"Sleeping for 2 seconds...\");\n\t\tThread.sleep(2000);\n\t\tSystem.out.println(\"Checking if communicator is alive...\");\n\t\tassertFalse(communicator.isAlive());\n\t}",
"@Test(timeOut = DEFAULT_TEST_TIMEOUT * 2, groups = \"1\", enabled = false)\r\n \tpublic void bootstrapEc2CloudTest() throws Exception {\r\n \t \r\n \t\tfor (int i = 0; i < NUM_OF_MANAGEMENT_MACHINES; i++) {\r\n \t\t\t// The rest home page is a JSP page, which will fail to compile if there is no JDK installed. So use testrest instead\r\n \t\t\tassertWebServiceAvailable(new URL( restAdminUrl[i].toString() + \"/service/testrest\"));\r\n \t\t\tassertWebServiceAvailable(webUIUrl[i]);\r\n \t\t}\r\n \t \r\n \t\tString connectCommand = \"connect \" + restAdminUrl[0].toString() + \";\";\r\n \t \r\n \t URL machinesURL = getMachinesUrl(restAdminUrl[0].toString());\r\n \t assertEquals(\"Expecting \" + NUM_OF_MANAGEMENT_MACHINES + \" machines\", \r\n \t \t\tNUM_OF_MANAGEMENT_MACHINES, getNumberOfMachines(machinesURL));\r\n \t \r\n \t //running install application on simple\r\n \t String installCommand = new StringBuilder()\r\n \t .append(\"install-application \")\r\n \t .append(\"--verbose \")\r\n \t .append(\"-timeout \")\r\n \t .append(TimeUnit.MILLISECONDS.toMinutes(DEFAULT_TEST_TIMEOUT * 2)).append(\" \")\r\n\t .append((new File(ScriptUtils.getBuildPath(), \"examples/travel\").toString()).replace('\\\\', '/'))\r\n \t .toString();\r\n \t \r\n \t String output = CommandTestUtils.runCommandAndWait(connectCommand + installCommand);\r\n \t \r\n \t Assert.assertTrue(output.contains(INSTALL_TRAVEL_EXPECTED_OUTPUT));\r\n \r\n \t // Travel is started with 2 instances (1 tomcat, 1 cassandra) so we are expecting two more machine\r\n assertEquals(\"Expecting \" + (NUM_OF_MANAGEMENT_MACHINES+2) + \" machines\", \r\n NUM_OF_MANAGEMENT_MACHINES+2, getNumberOfMachines(machinesURL));\r\n \t \r\n \t \r\n \t //uninstall simple application\r\n \t String uninstallCommand = \"uninstall-application --verbose travel\";\r\n \t output = CommandTestUtils.runCommandAndWait(connectCommand + uninstallCommand);\r\n \t \r\n \t Assert.assertTrue(output.contains(UNINSTALL_TRAVEL_EXPECTED_OUTPUT));\r\n \t \r\n \t}",
"public static void run() {\n testAlgorithmOptimality();\n// BenchmarkGraphSets.testMapLoading();\n //testAgainstReferenceAlgorithm();\n //countTautPaths();\n// other();\n// testLOSScan();\n //testRPSScan();\n }",
"@Test public void runCommonTests() {\n\t\trunAllTests();\n\t}",
"public static void main(String[] args) {\n\t\trun();\n\t\t//runTest();\n\n\t}",
"public ServerTest() {\n\t\tsuper();\n\t}",
"@Test\r\n public void test() {\r\n Owner owner = new Owner();\r\n owner.setOauthToken(\"CAACEdEose0cBAMCKHcqSEOcS5O40e4co26HaL6YyEtM7PZAUlPSSDbIca80wF2w3G9B43ZCAx8vojAQKfeyk8ZAapSjv5ala0FPAawudbeNPpFMgyGCDmR0bEhNUuj9gbRjKHQqvVt28DUegx6uAVtMy5PYGhoFSYHstHBtt8Hby7wp2cIczDeZAiuoKe0L6qbGJnFRHqzO87pyZBEhPDpbAZBWjrtCyQZD\");\r\n owner.setFacebookID(\"1492826064306740\");\r\n\r\n MonitorRunner runner = new MonitorRunner(owner);\r\n //runner.run();\r\n }",
"@Test\n public void testTIM(){\n loginToVisit();\n }",
"public void testSendSimpleMessage() {\n\n resetCounter();\n\n try {\n FixedResolver tr0 = new FixedResolver(\"127.0.0.1\", 54222);\n FixedTransportManager ftm0 = new FixedTransportManager(tr0);\n TestMediaManager tmm0 = new TestMediaManager(ftm0);\n tmm0.setPayloads(getTestPayloads1());\n List<JingleMediaManager> trl0 = new ArrayList<JingleMediaManager>();\n trl0.add(tmm0);\n\n FixedResolver tr1 = new FixedResolver(\"127.0.0.1\", 54567);\n FixedTransportManager ftm1 = new FixedTransportManager(tr1);\n TestMediaManager tmm1 = new TestMediaManager(ftm1);\n tmm1.setPayloads(getTestPayloads1());\n List<JingleMediaManager> trl1 = new ArrayList<JingleMediaManager>();\n trl1.add(tmm1);\n\n JingleManager man0 = new JingleManager(getConnection(0), trl0);\n JingleManager man1 = new JingleManager(getConnection(1), trl1);\n\n // Session 1 waits for connections\n man1.addJingleSessionRequestListener(new JingleSessionRequestListener() {\n /**\n * Called when a new session request is detected\n */\n public void sessionRequested(final JingleSessionRequest request) {\n incCounter();\n System.out.println(\"Session request detected, from \" + request.getFrom());\n }\n });\n\n // Session 0 starts a request\n System.out.println(\"Starting session request, to \" + getFullJID(1) + \"...\");\n JingleSession session0 = man0.createOutgoingJingleSession(getFullJID(1));\n session0.startOutgoing();\n\n Thread.sleep(5000);\n\n assertTrue(valCounter() > 0);\n\n } catch (Exception e) {\n e.printStackTrace();\n fail(\"An error occured with Jingle\");\n }\n }",
"public void run() { wait for the launcher script to talk to us\n //\n try {\n ssocket.setSoTimeout(30 * 1000); // 30 seconds\n socket = ssocket.accept();\n socket.setSoTimeout(3 * 60 * 1000);\n socket.setTcpNoDelay(true);\n } catch (SocketTimeoutException stmo) {\n String msg = \"timeout error on initial connection from \" + execName();\n task.log(msg, Project.MSG_ERR);\n failure = new BuildException(msg);\n } catch (Exception e) {\n String err = \"error establishing communication with \" + execName();\n String msg = e.getMessage();\n if (msg != null) {\n err = err + \": \" + msg;\n } else {\n err = err + \": \" + e;\n }\n task.log(err, Project.MSG_ERR);\n failure = new BuildException(err);\n }\n }",
"@Test\r\n public void testConnect() throws Exception {\r\n //Construct an RFIDReaderSimpleSimulator object to simulate the RFID Card Reader board\r\n RFIDReaderSimpleSimulator rFIDReaderSimpleSimulator = new RFIDReaderSimpleSimulator();\r\n //Construct a SerialTransceiver object, setting the packet protocol and frameEventListener\r\n //This SerialTransceiver object is for the aVRReaderSimple simulator\r\n SerialTransceiver aVRTransceiver = new SerialTransceiver(new HacsPacket(), rFIDReaderSimpleSimulator);\r\n //Set the transmitter for the AVRReader simulator\r\n rFIDReaderSimpleSimulator.setTransmitter(aVRTransceiver);\r\n\r\n //Now create a server, that responds to and handles messages from the\r\n //AVR Card reader simulator\r\n RFIDEventManagerSimple rFIDEventManagerSimple = new RFIDEventManagerSimple();\r\n //Construct another SerialTransceiver for the RFIDEventManager\r\n SerialTransceiver rFIDEventManagerTransceiver = new SerialTransceiver(new HacsPacket(), rFIDEventManagerSimple);\r\n //Set the transmitter for the RFIDManagerSimple\r\n rFIDEventManagerSimple.setTransmitter(rFIDEventManagerTransceiver);\r\n\r\n //Open the RFIDEventManager server port - it waits for messages from\r\n //the Card Reader\r\n rFIDEventManagerSimple.openPort();\r\n\r\n //Let the Card Reader simulator connect to the RFIDEventManager server\r\n rFIDReaderSimpleSimulator.connect();\r\n\r\n //Wait for transmission to complete\r\n Thread.sleep(200);\r\n\r\n //We expect the RFIDEventManager to have received a \"03\" message\r\n System.out.println(\"Expect to receive 03\");\r\n String expectedRequest = \"03\";\r\n HacsPacket packet = (HacsPacket) rFIDEventManagerSimple.getPacket();\r\n String req = packet.getCommandStatus();\r\n String actualRequest = rFIDEventManagerSimple.getPacket().getCommandStatus();\r\n\r\n //We expect the RFIDManager to have sent a \"12\" response\r\n String expectedResponse = \"12\";\r\n String actualResponse = rFIDReaderSimpleSimulator.getPacket().getCommandStatus();\r\n\r\n System.out.println(\"expReq: \" + expectedRequest + \" actReq: \" + actualRequest);\r\n assertTrue(expectedRequest.equals(actualRequest));\r\n System.out.println(\"expResp: \" + expectedResponse + \" actResp: \" + actualResponse);\r\n assertTrue(expectedResponse.equals(actualResponse));\r\n\r\n //Now we try to send an RFID and RFID Reader ID\r\n rFIDReaderSimpleSimulator.sendRFIDRequest(\"09\", \"RFIDReader1AB12CD34\");\r\n\r\n //Wait for transmission to complete\r\n Thread.sleep(500);\r\n rFIDEventManagerSimple.closePort();\r\n rFIDReaderSimpleSimulator.closePort();\r\n\r\n expectedRequest = \"09\";\r\n actualRequest = rFIDEventManagerSimple.getPacket().getCommandStatus();\r\n\r\n\r\n\r\n String expectedData = \"RFIDReader1AB12CD34\";\r\n HacsPacket hacsPacket = (HacsPacket) rFIDEventManagerSimple.getPacket();\r\n String actualData = hacsPacket.getData();\r\n\r\n assertTrue(expectedRequest.equals(actualRequest));\r\n assertTrue(expectedData.equals(actualData));\r\n }",
"public SocketServerTest(String testName) {\n\t\tsuper(testName);\n\t}",
"private static void testServer() {\r\n\t\ttry {\r\n\t\t\tserverSocket=new ServerSocket(portno);\r\n\t\t\tSocket temp=serverSocket.accept();\r\n\t\t\tint x=cryptoMessaging.recvInt(temp.getInputStream());\r\n\t\t\tSystem.out.println(\"Got this int: \"+x);\r\n\t\t\tx++;\r\n\t\t\tcryptoMessaging.sendInt(temp.getOutputStream(), x);\r\n\t\t\tx=cryptoMessaging.recvInt(temp.getInputStream());\r\n\t\t\tSystem.out.println(\"Got this int: \"+x);\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.out.println(\"IO Error\");\r\n\t\t\tgiveUp();\r\n\t\t}\r\n\t\tSystem.out.println(\"Test complete.\");\r\n\t\tgiveUp();\r\n\t}",
"private void runFullScenario(HttpServletRequest request, HttpServletResponse response) throws IOException, ClassNotFoundException, InterruptedException, QueryExecutionException {\n SimApi.runFullScenario();\n }",
"public static void main(String[] args) throws IOException, InterruptedException {\r\n\t\r\n TournamentTest();\r\n //humanPlayersTest();\r\n }",
"protected void runTest() {\n\t\trunTest(getIterations());\n\t}",
"public Server() {\n\t\tthis.currentMode = Mode.TEST; // TODO: implement\n\t}",
"public void testSapServerTimeouts() {\n Intent sapDisconnectIntent = new Intent(SapServer.SAP_DISCONNECT_ACTION);\n sapDisconnectIntent.putExtra(\n SapServer.SAP_DISCONNECT_TYPE_EXTRA, SapMessage.DISC_IMMEDIATE);\n mContext = this.getContext();\n\n try {\n\n SapSequencer sequencer = new SapSequencer();\n if(rilTestModeEnabled) {\n sequencer.testModeEnable(true);\n }\n /* Build a default init sequence */\n buildDefaultInitSeq(sequencer);\n\n SapMessage disconnectReq = new SapMessage(SapMessage.ID_DISCONNECT_REQ);\n SapMessage disconnectResp = new SapMessage(SapMessage.ID_DISCONNECT_RESP);\n\n SapMessage resetResp = new SapMessage(SapMessage.ID_RESET_SIM_RESP);\n resetResp.setResultCode(SapMessage.RESULT_OK);\n\n int index = sequencer.addStep(disconnectReq, disconnectResp);\n\n assertTrue(sequencer.run());\n\n mContext.sendBroadcast(sapDisconnectIntent);\n\n } catch (IOException e) {\n Log.e(TAG, \"IOException\", e);\n }\n }",
"public static void main(String[] args) {\n Server server = new Server(1234);\n server.listen();\n \n // YOUR CODE HERE\n // It is not required (or recommended) to implement the server in\n // this runner class.\n }",
"@Test\n public void nameserversTest() {\n // TODO: test nameservers\n }",
"public static void selfTest() {\n\talarmTest1();\n\t// Invoke your other test methods here ...\n }",
"@Test\n public void testStart() {\n simpleMoneyAppStarterUnderTest.start();\n\n // Verify the results\n verify(mockProcessingStarter).startProcessing();\n verify(mockWebStarter).startEndpoints();\n }",
"@Override\n public void setUp() throws Exception {\n transport = new TFramedTransport(new TSocket(\"123.56.206.195\", 1982));\n\n\n\n TProtocol protocol = new TBinaryProtocol(transport);\n client = new SubjectServ.Client(protocol);\n transport.open();\n }",
"@Test\n public void testConstructor2() {\n\n try {\n ServerSocket s = new ServerSocket(5065);\n s.setReuseAddress(true);\n if (!s.isBound()) {System.exit(-1);}\n String address = GeneralInetAddress.getLocalHost().getHostAddress();\n\n\n // create local DisplayServer and DisplayClient\n DisplayServer ds = new DisplayServer(address);\n DisplayClient dc = new DisplayClient(address);\n\n // create Simulator\n Simulator sim = new Simulator(dc);\n\n // create vehicle\n double[] startPosition = {50, 30, 0};\n GroundVehicle gv = new GroundVehicle(startPosition, 0, 0);\n\n UserController uc = new UserController(sim, gv, ds);\n\n assertEquals(sim, uc.getSimulator());\n assertEquals(gv, uc.getUserVehicle());\n assertEquals(ds, uc.getDisplayServer());\n\n } catch (IOException e) {\n System.err.println(\"IOException in UserControllerTest!\");\n e.printStackTrace();\n }\n }",
"public static void twoClientSetupProcesses() {\n\n\tList<String> aClientTags=TagsFactory.getAssignmentTags().getTwoClientClientTags();\n\tList<String> aServerTags=TagsFactory.getAssignmentTags().getTwoClientServerTags();\n\n\ttwoClientSetupProcesses(aClientTags, aServerTags);\n//\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setProcessTeams(Arrays.asList(\"RegistryBasedDistributedProgram\"));\n//\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setTerminatingProcesses(\"RegistryBasedDistributedProgram\", Arrays.asList(\"Client_0\", \"Client_1\"));\n//\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setProcesses(\"RegistryBasedDistributedProgram\", Arrays.asList(\"Registry\", \"Server\", \"Client_0\", \"Client_1\"));\n//\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setEntryTags(\"Registry\", Arrays.asList(\"Registry\"));\n//\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setEntryTags(\"Server\", aServerTags);\n//\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setEntryTags(\"Client_0\", aClientTags);\n//\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setEntryTags(\"Client_1\", aClientTags);\n//\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setArgs(\"Registry\", FlexibleStaticArgumentsTestCase.TEST_REGISTRY_ARGS);\n//\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setArgs(\"Server\", FlexibleStaticArgumentsTestCase.TEST_SERVER_ARGS);\n//\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setArgs(\"Client_0\", FlexibleStaticArgumentsTestCase.TEST_CLIENT_0_ARGS);\n//\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setArgs(\"Client_1\", FlexibleStaticArgumentsTestCase.TEST_CLIENT_1_ARGS);\n//\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setSleepTime(\"Registry\", 500);\n//\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setSleepTime(\"Server\", 2000);\n//\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setSleepTime(\"Client_0\", 5000);\n//\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setSleepTime(\"Client_1\", 5000);\n//\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().getProcessTeams().forEach(team -> System.out.println(\"### \" + team));\n}",
"@Test\r\n public void testInitSession() {\r\n System.out.println(\"initSession\");\r\n assertNotNull(sm);\r\n \r\n boolean result = sm.initSession(\"test1\", programsHome, programsHome + \"files1/\", requester);\r\n assertFalse(result);\r\n \r\n result = sm.initSession(\"test2\", programsHome, programsHome + \"files2/\", requester);\r\n assertFalse(result);\r\n \r\n result = sm.initSession(\"test3\", programsHome, programsHome + \"files3/\", requester);\r\n assertFalse(result);\r\n \r\n result = sm.initSession(\"test4\", programsHome, programsHome + \"files4/\", requester);\r\n assertTrue(result);\r\n \r\n sm.removeSession(\"test4\");\r\n }",
"@Test\n\tpublic void testExecute_fixture_4()\n\t\tthrows Exception {\n\t\tSessionStateMsg fixture2 = getFixture();\n\t\tLinkedList<String> list = new LinkedList<String>();\n\t\tlist.add(\"\");\n\t\tlist.add(\"0123456789\");\n\t\tServerGameSession session = new ServerGameSession(\"\", list, new ImageIcon(new byte[] {(byte) -1, (byte) 0, (byte) 1, Byte.MAX_VALUE, Byte.MIN_VALUE}), Integer.MAX_VALUE, Integer.MAX_VALUE);\n\t\tClientInfo sender = new ClientInfo(new Socket(\"\", 0));\n\n\t\tfixture2.execute(session, sender);\n\n\t\t// add additional test code here\n\t\t// An unexpected exception was thrown in user code while executing this test:\n\t\t// java.lang.NoClassDefFoundError: Could not initialize class server.ServerGameSession\n\t}",
"@Test\n public void tests(TestContext context) {\n async = context.async();\n logger.info(\"Codex mock Test starting\");\n\n // Simple GET request to see the module is running and we can talk to it.\n given()\n .get(\"/admin/health\")\n .then()\n .log().all()\n .statusCode(200);\n\n // Simple GET request without a tenant\n given()\n .get(\"/codex-instances\")\n .then()\n .log().ifValidationFails()\n .statusCode(400)\n .body(containsString(\"Tenant\"));\n\n // Simple GET request before the tenant init\n given()\n .header(TEN)\n .get(\"/codex-instances\")\n .then()\n .log().ifValidationFails()\n .statusCode(400)\n .body(containsString(\"supertenant_mod_codex_mock.codex_mock_data\"));\n\n // Call the tenant interface to initialize the database\n String tenants = \"{\\\"module_to\\\":\\\"\" + moduleId + \"\\\"}\";\n logger.info(\"About to call the tenant interface \" + tenants);\n given()\n .header(TEN).header(JSON)\n .body(tenants)\n .post(\"/_/tenant\")\n .then()\n .log().ifValidationFails()\n .statusCode(201);\n\n // get all\n given()\n .header(TEN)\n .get(\"/codex-instances\")\n .then()\n .log().all() // .ifValidationFails()\n .body(containsString(\"\\\"totalRecords\\\" : 4\"))\n .body(containsString(\"resultInfo\"))\n .statusCode(200);\n\n // get one\n given()\n .header(TEN)\n .get(\"/codex-instances/11111111-1111-1111-1111-111111111111\")\n .then()\n .log().ifValidationFails()\n .statusCode(200)\n .body(containsString(\"alt title for 111111111111\"))\n .body(containsString(\"unitTest\"));\n\n // unknown id\n given()\n .header(TEN)\n .get(\"/codex-instances/99999999-9999-9999-9999-987654321111\")\n .then()\n .log().ifValidationFails()\n .statusCode(404);\n\n // query\n given()\n .header(TEN)\n .get(\"/codex-instances?query=title=000000000001\")\n .then()\n .log().ifValidationFails()\n .body(containsString(\"Title of 000000000001\"))\n .statusCode(200);\n given()\n .header(TEN)\n .get(\"/codex-instances?query=publisher=beta\")\n .then()\n .log().ifValidationFails()\n .body(containsString(\"Title of 111111111112\"))\n .body(containsString(\"unitTest\"))\n .statusCode(200);\n given()\n .header(TEN)\n .get(\"/codex-instances?query=contributor=Contributor of 111111111111\")\n .then()\n .log().ifValidationFails()\n .body(containsString(\"Title of 111111111111\"))\n .statusCode(200);\n given()\n .header(TEN)\n .get(\"/codex-instances?query=contributor=*111111111111*\")\n .then()\n .log().ifValidationFails()\n .body(containsString(\"Title of 111111111111\"))\n .statusCode(200);\n\n // ServerChoice\n given()\n .header(TEN)\n .get(\"/codex-instances?query=Title\")\n .then()\n .log().ifValidationFails()\n .statusCode(200);\n\n // bad query - the query validation ought to catch this\n // But it does not. Logs the \"unable to load schema\" message, and accepts all...\n given()\n .header(TEN)\n .get(\"/codex-instances?query=UNKNOWNFIELD=foo\")\n .then()\n .log().ifValidationFails()\n .statusCode(200);\n //.statusCode(422);\n\n // limit\n given()\n .header(TEN)\n .get(\"/codex-instances?offset=1&limit=2\")\n .then()\n .log().ifValidationFails()\n .body(containsString(\"111111111111\"))\n .body(containsString(\"111111111112\"))\n .statusCode(200);\n\n // sort\n given()\n .header(TEN)\n .get(\"/codex-instances?offset=0&limit=1&query=publisher=for sortBy publisher\")\n .then()\n .log().ifValidationFails()\n .body(containsString(\"alpha publisher\"))\n .statusCode(200);\n\n // Query manipulations: resourceType -> type\n given()\n .header(TEN)\n .get(\"/codex-instances?query=resourceType=books\")\n .then()\n .log().ifValidationFails()\n .body(containsString(\"\\\"totalRecords\\\" : 4\"))\n .statusCode(200);\n\n // Query manipulations: isbn\n given()\n .header(TEN)\n .get(\"/codex-instances?query=identifier/type=isbn=1111111111\")\n .then()\n .log().ifValidationFails()\n .body(containsString(\"\\\"totalRecords\\\" : 1\"))\n .body(containsString(\"111111111112\"))\n .statusCode(200);\n\n // Query manipulations: issn\n given()\n .header(TEN)\n .get(\"/codex-instances?query=identifier /type=issn = 1111111111\")\n .then()\n .log().ifValidationFails()\n .body(containsString(\"\\\"totalRecords\\\" : 1\"))\n .body(containsString(\"000000000001\"))\n .statusCode(200);\n\n // All done\n logger.info(\"codex Mock Test done\");\n async.complete();\n }",
"@Test\r\n\tpublic void mainTest() throws ExceptionMP, InterruptedException {\n\t\tBot bot = new Bot();\r\n\t\tThread t = new Thread(bot);\r\n\t\tt.start();\r\n\t\tThread.sleep(10000);\r\n\r\n\t\t// check if the file has been created\r\n\t\tboolean fileCreated = false;\r\n\t\tFile file = new File(Config.getFilepathSystem() + \"/output/\");\r\n\t\tFile[] files = file.listFiles();\r\n\t\tfor (File f : files) {\r\n\t\t\tif (f.getPath().contains(\"portrait_of_finnish_bands\")) {\r\n\t\t\t\tfileCreated = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tassertTrue(fileCreated);\r\n\t}",
"public static String startServer() throws QVCSException, IOException {\n System.out.println(Thread.currentThread().getName() + \"********************************************************* TestHelper.startServer\");\n String serverStartSyncString = null;\n if (serverProxyObject == null) {\n // So the server starts fresh.\n initDirectories();\n\n // So the server uses a project property file useful for the machine the tests are running on.\n initProjectProperties();\n\n // For unit testing, listen on the 2xxxx ports.\n serverStartSyncString = \"Sync server start\";\n String userDir = System.getProperty(USER_DIR);\n File userDirFile = new File(userDir);\n String canonicalUserDir = userDirFile.getCanonicalPath();\n final String args[] = {canonicalUserDir, \"29889\", \"29890\", \"29080\", serverStartSyncString};\n serverProxyObject = new Object();\n ServerResponseFactory.setShutdownInProgress(false);\n Runnable worker = new Runnable() {\n\n @Override\n public void run() {\n try {\n QVCSEnterpriseServer.main(args);\n } catch (Exception e) {\n LOGGER.log(Level.SEVERE, Utility.expandStackTraceToString(e));\n }\n }\n };\n synchronized (serverStartSyncString) {\n try {\n // Put all this on a separate worker thread.\n new Thread(worker).start();\n serverStartSyncString.wait();\n }\n catch (InterruptedException e) {\n LOGGER.log(Level.SEVERE, Utility.expandStackTraceToString(e));\n }\n }\n } else {\n if (QVCSEnterpriseServer.getServerIsRunningFlag()) {\n System.out.println(Thread.currentThread().getName() + \"********************************************************* TestHelper.startServer -- server already running.\");\n serverProxyObject = null;\n throw new QVCSRuntimeException(\"Starting server when server already running!\");\n }\n }\n LOGGER.log(Level.INFO, \"********************************************************* TestHelper returning from startServer\");\n return (serverStartSyncString);\n }",
"@Test\r\n\r\n\tpublic void GoDirectVoiceTest() throws InterruptedException, IOException {\n\r\n\t\t\r\n\t\tservice = startServer();\r\n\r\n\t\tAndroidDriver<AndroidElement> driver = Capabilities(\"GoDirectVoiceApp\");\r\n\t\tdriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\r\n\t\t\r\n\t\tThread.sleep(4000);\r\n\t\tnew LoginAcc().KeypadNavigation();\r\n\t\tThread.sleep(4000);\r\n\t\t\r\n\t\tAppDrawerEl dr = new AppDrawerEl (driver);\t\r\n\t\tdr.Drawer.click();\t\t\t\t\t\t\t\t\t//click to open App navigation drawer\r\n\t\t\r\n\t\tThread.sleep(1000);\r\n\t\tdr.Account.click();\t\t\t\t\t\t\t\t\t// click to open account settings page\r\n\t\t\r\n\t\tEmpty_Router_Check();\r\n\t\t//HONEYWELL\r\n\t\tRangValidation_CNX900();\r\n\t\tRangValidation_CNX800();\r\n\t\tRangValidation_CNX250();\r\n\t\tRangValidation_CG710GD();\r\n\t\tRangValidation_CG710L();\r\n\t\tRangValidation_CCU200();\r\n\t\tRangValidation_CCU100();\r\n\t\tRangValidation_ASPIRE100();\r\n\t\tRangValidation_GDR();\r\n\t\t//GOGO\r\n\t\tRangValidation_ST4300();\r\n\t\tRangValidation_Axxess();\r\n\t\t//IRIDIUM\r\n\t\tRangValidation_IridiumGo();\r\n\t\t//AVIATOR\r\n\t\tRangValidation_Aviator();\r\n\t\t//SDR\r\n\t\tRangValidation_SDR();\r\n\t\t//TRUENORTH\r\n\t\tRangValidation_Optelity();\r\n\t\tRangValidation_Simphone();\r\n\t\t\r\n\tservice.stop();\r\n\t\t\r\n\t}",
"@GetMapping\n private SimulatorResult runSimulator() {\n return simulatorService.runSimulation();\n }",
"public void testInvokeShell() throws Exception {\n PKey hostKey = PKey.readPrivateKeyFromStream(new FileInputStream(\n \"test/test_rsa.key\"), null);\n PKey publicHostKey = PKey.createFromBase64(hostKey.getBase64());\n mTS.addServerKey(hostKey);\n final FakeServer server = new FakeServer();\n\n final Event sync = new Event();\n new Thread(new Runnable() {\n public void run() {\n try {\n mTS.start(server, 15000);\n sync.set();\n } catch (IOException x) {}\n }\n }).start();\n\n mTC.start(publicHostKey, 15000);\n mTC.authPassword(\"slowdive\", \"pygmalion\", 15000);\n\n sync.waitFor(5000);\n assertTrue(sync.isSet());\n assertTrue(mTS.isActive());\n\n Channel chan = mTC.openSession(5000);\n chan.invokeShell(5000);\n Channel schan = mTS.accept(5000);\n chan.getOutputStream().write(\"communist j. cat\\n\".getBytes());\n assertFalse(chan.isClosed());\n chan.close();\n assertTrue(chan.isClosed());\n\n BufferedReader r = new BufferedReader(new InputStreamReader(\n schan.getInputStream()));\n assertEquals(\"communist j. cat\", r.readLine());\n schan.close();\n }",
"@Test\n public void startApp2Do(){\n }",
"@Test\n public void CloudScriptServer()\n {\n PlayFabServerModels.LoginWithServerCustomIdRequest customIdReq = new PlayFabServerModels.LoginWithServerCustomIdRequest();\n customIdReq.CreateAccount = true;\n customIdReq.ServerCustomId = PlayFabSettings.BuildIdentifier;\n PlayFabResult<PlayFabServerModels.ServerLoginResult> loginRes = PlayFabServerAPI.LoginWithServerCustomId(customIdReq);\n assertNotNull(loginRes.Result);\n PlayFabServerModels.ExecuteCloudScriptServerRequest hwRequest = new PlayFabServerModels.ExecuteCloudScriptServerRequest();\n hwRequest.FunctionName = \"helloWorld\";\n hwRequest.PlayFabId = loginRes.Result.PlayFabId;\n PlayFabResult<PlayFabServerModels.ExecuteCloudScriptResult> hwResult = PlayFabServerAPI.ExecuteCloudScript(hwRequest);\n assertNotNull(hwResult.Result.FunctionResult);\n Map<String, String> arbitraryResults = (Map<String, String>)hwResult.Result.FunctionResult;\n assertEquals(arbitraryResults.get(\"messageValue\"), \"Hello \" + loginRes.Result.PlayFabId + \"!\");\n }",
"public Integer call() throws IOException {\n \t\t\tint ret=90;\n \t\t\ttestCases = new ArrayList<String>();\n \t\t\trealIds = new ArrayList<String>();\n \t \tString path = \"./workspace/\"+jobname;\n\t\t\t\tlistener.getLogger().println(\"IL PATH DEL TESTRUN E' \"+path);\n \t\t\t/* folders = listFilesForFolder(new File(path),listener);\n \t\t\t// cerco il TestRun nell'svn di Polarion\n \tcheck:\tfor(String folder : folders){\n \t \tlistener.getLogger().println(\"confronto: \"+testrunid+\" - \"+folder);\n \t\t\t\tif(testrunid.equals(folder)){ \t\t\t\t\t\n \t\t\t\t\t// prelevo i TestCase relativi al TestRun\n \t\t\t\t\t */\n \t\t\t\t\ttestCases = getTestCases(path,listener);\n \t\t\t\t\tString nometestrun = \"Executed - \"+testrunid+\".xml\";\n \t\t\t\t\tif(!testCases.isEmpty()){\n \t\t\t\t\t\t// prelevo l'ID vero dei Test Case\n\t\t\t\t\t\t\trealIds = getRealTestCaseIdFromPolarion(listener,testCases);\n\t\t\t\t\t\t\tif(type.equals(\"TestMTP\")){ // ESECUZIONE SU MTP\n\t\t\t\t\t\t\t\tlistener.getLogger().println(\"eseguo MTP\");\n\t\t\t\t\t\t\t\tfor(String realId : realIds){\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/* Per l'esecuzione con lo stub (va messa fuori il for per funzionare)\n\t\t \t\t\t\t\tCreaXMLStub stub = new CreaXMLStub(testCases);\n\t\t\t\t\t\t\t\tstub.doTest(\"C:/JenkinsSlave/workspace/\"+jobname+\"/Temp/\"+nometestrun,listener);*/\n\t\t\t\t\t\t\t}else if(type.equals(\"TestMX\")){ // ESECUZIONE SU MICROMAX\n\t\t\t\t\t\t\t\tif(!scenario){\n\t\t\t\t\t\t\t\t\tArrayList<Integer> returnCodes = new ArrayList<Integer>();\n\t\t\t\t\t\t\t\t\tfor(String realId : realIds){\n\t\t\t\t\t\t\t\t\t\t// stampo il realId del test case\n\t\t\t\t\t\t\t \tlistener.getLogger().println(\"TC: \"+realId);\n\t\t\t\t\t\t\t\t\t\tlistener.getLogger().println(\"eseguo MX\");\n\t\t\t\t\t\t\t\t\t\tString[] parameters = realId.split(\",\");\n\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\tProcessBuilder builder = new ProcessBuilder(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"MxVGUI\", \"/n\", \"/r\", mxpath+File.separator+parameters[0]+File.separator+parameters[1]+\".mxp\", mxpath+File.separator+parameters[0]+\"/ScenariosAndTestCases/\"+parameters[2]); \n\t\t\t\t\t\t\t\t\t\t\tbuilder.redirectErrorStream(true); \n\t\t\t\t\t\t\t\t\t\t\tProcess p = builder.start();\n\t\t\t\t\t\t\t\t\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));\n\t\t\t\t\t\t\t\t\t\t\tString line;\n\t\t\t\t\t\t\t\t\t\t\twhile ((line = reader.readLine()) != null)\n\t\t\t\t\t\t\t\t\t\t\t\tlistener.getLogger().println(\"tasklist: \" + line);\n\t\t\t\t\t\t\t\t\t\t\tret=p.waitFor();\n\t\t\t\t\t\t\t\t\t\t\treturnCodes.add(ret);\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tlistener.getLogger().println(\"eseguito MX \"+ret);\n\t\t\t\t\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\t\t\tContactPolarion(listener);\n\t\t\t\t\t\t\t\t\t\t\tlistener.getLogger().println(e.getMessage());\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\n\t\t\t\t\t\t\t\t\t//Scrive i risultati in base al valore di ritorno di MxVDEV\n\t\t\t\t\t\t\t\t\twriteTestResults(\"C:/JenkinsSlave/Results/\"+nometestrun, testCases, returnCodes);\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//Converto tutti i risultati nel formato desiderato leggendo i log\n\t\t\t\t\t\t\t\t//convertTestCaseResults(realIds, \"C:/JenkinsSlave/workspace/\"+jobname+\"/Temp/\"+nometestrun, testCases);\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t//convertScenarioResults(testCases, new ArrayList<String>(), mxpath+File.separator+parameters[0]+\"/ScenariosAndTestCases/\"+testrunid ,testrunid);\n\t\t\t\t\t\t\t\t\tString[] parameters = realIds.get(0).split(\",\");\n\t\t\t\t\t\t\t\t\tScenario scenario = new Scenario(testrunid,realIds,mxpath+File.separator+parameters[0]+\"/ScenariosAndTestCases/\");\n\t\t\t\t\t\t\t\t\tif(scenario.createScenario()){\n\t\t\t\t\t\t\t\t\t\tlistener.getLogger().println(\"Scenario creato\");\n\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\tProcessBuilder builder = new ProcessBuilder(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"MxVGUI\", \"/n\", \"/r\", mxpath+File.separator+parameters[0]+File.separator+parameters[1]+\".mxp\", mxpath+File.separator+parameters[0]+\"/ScenariosAndTestCases/\"+testrunid+\".mxs\"); \n\t\t\t\t\t\t\t\t\t\t\tbuilder.redirectErrorStream(true); \n\t\t\t\t\t\t\t\t\t\t\tProcess p = builder.start();\n\t\t\t\t\t\t\t\t\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));\n\t\t\t\t\t\t\t\t\t\t\tString line;\n\t\t\t\t\t\t\t\t\t\t\twhile ((line = reader.readLine()) != null)\n\t\t\t\t\t\t\t\t\t\t\t\tlistener.getLogger().println(\"tasklist: \" + line);\n\t\t\t\t\t\t\t\t\t\t\tret=p.waitFor();\n\t\t\t\t\t\t\t\t\t\t\tlistener.getLogger().println(\"eseguito MX \"+ret);\n\t\t\t\t\t\t\t\t\t\t\tconvertScenarioResults(testCases, new ArrayList<String>(), mxpath+File.separator+parameters[0]+\"/ScenariosAndTestCases/\"+testrunid ,testrunid);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\t\t\t\t\tContactPolarion(listener);\n\t\t\t\t\t\t\t\t\t\t\tlistener.getLogger().println(e.getMessage());\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\tlistener.getLogger().println(\"creazione dello scenario non riuscita\");\n\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}else{ // CONDIZIONE EVENTUALI ERRORI\n\t\t\t\t\t\t\t\tContactPolarion(listener);\n\t\t\t\t\t\t\t\tlistener.getLogger().println(\"condizione inaspettata\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tpublishTest(\"C:/JenkinsSlave/Results/\",sharedpasswd,shareduser,nometestrun, listener, projectname);\n\t\t\t\t\t \t}else{\n\t\t\t\t\t \t\tContactPolarion(listener);\n\t\t\t\t\t \t\tlistener.getLogger().println(\"Nessun tc impostato. Setto tr a open\");\n\t\t\t\t\t \t//}\n\t\t\t\t\t \t//break check;\n \t\t\t\t//}\n \t\t\t}\n \t\t\treturn ret; \t\n \t\t}",
"public static void main(String[] args) {\n\ttest(tests);\n }",
"@Test\n @DisplayName(\"Action Marker Production Blue And Buy Test\")\n public void ActionMarkerProductionBlueAndBuyTest() throws IOException, InterruptedException {\n ActionMarkerProductionBlue actionMarker = new ActionMarkerProductionBlue();\n Server server= new Server();\n ClientHandler clientHandler= new ClientHandler(server);\n ClientController clientController= new ClientController(server,clientHandler) ;\n VirtualView virtualView = new VirtualView(clientController);\n\n GameSolitaire game = new GameSolitaire(\"Ali\",true,clientController);\n\n assertEquals(4, game.productionDeckSize(0));\n assertEquals(4, game.productionDeckSize(1));\n assertEquals(4, game.productionDeckSize(2));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(2, game.productionDeckSize(0));\n assertEquals(4, game.productionDeckSize(1));\n assertEquals(4, game.productionDeckSize(2));\n\n try {\n game.deckFromDeckNumber(10).removeOneCard();\n } catch (EmptyException | EndOfSolitaireGame ignored) {\n }\n\n assertEquals(1, game.productionDeckSize(0));\n assertEquals(4, game.productionDeckSize(1));\n assertEquals(4, game.productionDeckSize(2));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(0));\n assertEquals(3, game.productionDeckSize(1));\n assertEquals(4, game.productionDeckSize(2));\n\n try {\n game.deckFromDeckNumber(2).removeOneCard();\n } catch (EmptyException | EndOfSolitaireGame ignored) {\n }\n\n assertEquals(0, game.productionDeckSize(0));\n assertEquals(3, game.productionDeckSize(1));\n assertEquals(3, game.productionDeckSize(2));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(0));\n assertEquals(1, game.productionDeckSize(1));\n assertEquals(3, game.productionDeckSize(2));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(0));\n assertEquals(0, game.productionDeckSize(1));\n assertEquals(2, game.productionDeckSize(2));\n\n game.activateActionMarker(actionMarker);\n\n assertEquals(0, game.productionDeckSize(0));\n assertEquals(0, game.productionDeckSize(1));\n assertEquals(0, game.productionDeckSize(2));\n\n FileClass.FileDestroyer();\n\n }",
"public void startTests() {\n if(testSettings.accessibleProperties || testSettings.accessibleInterface)\n testProperties();\n if(testSettings.tabTraversal)\n testTraversal();\n }",
"protected void TestProcess() {\n\t\tchangeCPUWDStatus(false);\n\t\twhile (testIsNotDoneStatus) {\n\t\t\tresetParams();\n\t\t\ttry {\n\t\t\t\tif (!startTrafficAndSample()) {\n\t\t\t\t\ttestIsNotDoneStatus = false;\n\t\t\t\t\tresetTestBol = false;\n\t\t\t\t\texceptionThrown = true;\n\t\t\t\t\tGeneralUtils.stopAllLevels();\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\treport.report(\"Stopping Parallel Commands From Java Exception\" + e.getMessage());\t\t\t\t\n\t\t\t\ttestIsNotDoneStatus = false;\n\t\t\t\tresetTestBol = false;\n\t\t\t\texceptionThrown = true;\n\t\t\t\treason = \"network connection Error\";\n\t\t\t\treport.report(e.getMessage() + \" caused Test to stop\", Reporter.FAIL);\n\t\t\t\te.printStackTrace();\n\t\t\t\tGeneralUtils.stopAllLevels();\n\t\t\t}\n\t\t\tif (resetTestBol) {\n\t\t\t\tnumberOfResets++;\n\t\t\t\tif (syncCommands != null) {\n\t\t\t\t\treport.report(\"Stopping Parallel Commands\");\n\t\t\t\t\tsyncCommands.stopCommands();\n\t\t\t\t}\n\t\t\t\tmakeThreadObjectFinish();\n\t\t\t\tif (syncCommands != null) {\n\t\t\t\t\treport.report(\"Commands File Path: \" + syncCommands.getFile());\n\t\t\t\t}\n\t\t\t\ttestIsNotDoneStatus = true;\n\t\t\t\t// stop level\n\t\t\t\ttry {\n\t\t\t\t\tif (syncCommands != null) {\n\t\t\t\t\t\tsyncCommands.moveFileToReporterAndAddLink();\n\t\t\t\t\t}\n\t\t\t\t\treport.report(\"Stopping Traffic\");\n\t\t\t\t\ttrafficSTC.stopTraffic();\n\t\t\t\t\ttrafficSTC.addResultFilesToReport(String.valueOf(numberOfResets));\n\t\t\t\t\treport.report(\"Resetting test\", Reporter.WARNING);\n\t\t\t\t\treason = \"reset Test because of stream halt\";\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\t\t}\n\n\t\tif (numberOfResets >= 3) {\n\t\t\t// using this flag in order to NOT print results.\n\t\t\ttestIsNotDoneStatus = false;\n\t\t\tprintResultsForTest = false;\n\t\t\treport.report(\"Test Was Reseted Too many times because of more then \" + PRECENT_OF_UE_RESET + \"%\"\n\t\t\t\t\t+ \" Of the Streams are in Halt - check Setup\", Reporter.FAIL);\n\t\t\treason = \"Test Was Restarted Too many Times due to Traffic halt\";\n\t\t}\n\t\ttry {\n\t\t\tif (syncCommands != null) {\n\t\t\t\tsyncCommands.stopCommands();\n\t\t\t}\n\t\t} catch (Exception e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\tmakeThreadObjectFinish();\n\t\ttry {\n\t\t\tif (syncCommands != null) {\n\t\t\t\tsyncCommands.moveFileToReporterAndAddLink();\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\treport.report(\"Exception in ReporterHelper.copyFileToReporterAndAddLink could not attach Command File\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\tchangeCPUWDStatus(true);\n\t}",
"@Test\n public void placeShipsTest()throws GameException, StatusException, IOException,InterruptedException{\n SVToReadTester aliceGameEngineTester = new SVToReadTester();\n //real protocol engine on alice´s side\n SVProtocolEngine aliceSVProtocolEngine = new SVProtocolEngine(aliceGameEngineTester);\n\n //protocol engine\n ProtocolEngine aliceProtocolEngine = aliceSVProtocolEngine;\n SchiffeVersenken aliceGameEngineSide = aliceSVProtocolEngine;\n\n //bobs game engine Tester\n SVToReadTester bobGameEngineTester = new SVToReadTester();\n ProtocolEngine bobProtocolEngine = new SVProtocolEngine(bobGameEngineTester);\n\n // Setup\n int port = this.getPortNumber();\n // this stream plays TCP server role during connection establishment\n TCPStream aliceSide = new TCPStream(port, true, \"aliceSide\");\n // this stream plays TCP client role during connection establishment\n TCPStream bobSide = new TCPStream(port, false, \"bobSide\");\n // start both stream\n aliceSide.start(); bobSide.start();\n // wait until TCP connection is established\n aliceSide.waitForConnection(); bobSide.waitForConnection();\n\n // launch\n aliceProtocolEngine.handleConnection(aliceSide.getInputStream(), aliceSide.getOutputStream());\n bobProtocolEngine.handleConnection(bobSide.getInputStream(), bobSide.getOutputStream());\n\n Thread.sleep(1000);\n\n // run test scenario // todo\n ArrayList<BattleshipsBoardPosition> positions = aliceSVProtocolEngine.placeShips(ALICE, buildPositions(SHIPPOS1));\n ArrayList<BattleshipsBoardPosition> positions1 = aliceSVProtocolEngine.placeShips(BOB, buildPositions(SHIPPOS1));\n BattleshipsBoardPosition testPos = new BattleshipsBoardPosition(\"A\", 0);\n Assert.assertEquals(\"F\", aliceGameEngineSide.attackPos(BOB, testPos));\n\n}"
] | [
"0.6823252",
"0.6699096",
"0.65230703",
"0.63934535",
"0.6344744",
"0.6322692",
"0.62583864",
"0.62574923",
"0.62489253",
"0.6151097",
"0.6141699",
"0.6105424",
"0.6103066",
"0.60963094",
"0.6078143",
"0.60717756",
"0.6068201",
"0.605918",
"0.60585624",
"0.6005538",
"0.59983695",
"0.59905696",
"0.59877926",
"0.5979201",
"0.5971836",
"0.59403515",
"0.59331846",
"0.5932297",
"0.592294",
"0.59181803",
"0.5909333",
"0.59071803",
"0.5901079",
"0.58956873",
"0.58949596",
"0.5891403",
"0.58906925",
"0.5888436",
"0.5882587",
"0.58781916",
"0.5872914",
"0.58702207",
"0.5859465",
"0.5838453",
"0.5817121",
"0.58088684",
"0.58058596",
"0.5798267",
"0.5784629",
"0.5781555",
"0.57516724",
"0.5745914",
"0.57439667",
"0.57397705",
"0.57245266",
"0.5710111",
"0.57069856",
"0.56974506",
"0.5697345",
"0.5693644",
"0.56919456",
"0.5687866",
"0.5684921",
"0.56837714",
"0.5679032",
"0.5678088",
"0.5677858",
"0.5673594",
"0.5668959",
"0.565891",
"0.56573826",
"0.5654951",
"0.5653761",
"0.5653168",
"0.56484574",
"0.56477976",
"0.56462824",
"0.5645193",
"0.56449944",
"0.5643866",
"0.56367785",
"0.56328154",
"0.5628789",
"0.56286347",
"0.5627305",
"0.56243426",
"0.5621757",
"0.56200767",
"0.5618142",
"0.5617547",
"0.5615077",
"0.560951",
"0.5597232",
"0.5593185",
"0.5591765",
"0.5591713",
"0.55906725",
"0.55862796",
"0.5583615",
"0.5577915"
] | 0.5654818 | 72 |
TODO Autogenerated method stub | @Override
public void init() throws ServletException {
super.init();
pdmodel = new pedidoModel();
cmodel = new clienteModel();
cnmodel = new cancionModel();
} | {
"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 | protected void service(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String path = request.getServletPath();
try {
if (path.equals("/newpd")) {
destino = "createpd.jsp";
System.out.println("create new");
} else if (path.equals("/insertpd")) {
insert(request);
mensaje = list(request, pdmodel);
destino = "/panelpd.jsp";
System.out.println("panelpd");
} else if (path.equals("/editpd")) {
read(request,pdmodel);
destino = "/updatepd.jsp";
} else if (path.equals("/updatepd")) {
update(request);
mensaje = list(request, pdmodel);
destino = "/panelpd.jsp";
} else if (path.equals("/removepd")) {
read(request, pdmodel);
destino = "/deletepd.jsp";
} else if (path.equals("/deletepd")) {
delete(request);
mensaje = list(request, pdmodel);
destino = "/panelpd.jsp";
} else if (path.equals("/listpd")) {
mensaje = list(request, pdmodel);
destino = "/panelpd.jsp";
} else if (path.equals("/readpd")) {
read(request, pdmodel);
destino = "/readpd.jsp";
}
if (mensaje != null) {
request.setAttribute("mensaje", mensaje);
} else {
request.removeAttribute("mensaje");
}
} catch (Exception e) {
// TODO: handle exception
}
RequestDispatcher rd = request.getRequestDispatcher(destino);
rd.forward(request, response);
} | {
"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 | private void insert(HttpServletRequest request)throws Exception {
Pedido p = new Pedido();
Cliente c = new Cliente();
Cancion ca = new Cancion();
p.setCod_pedido(request.getParameter("codigo"));
ca.setCod_cancion(request.getParameter("cod_cancion"));
c.setCod_cliente(request.getParameter("cod_cliente"));
p.setCan(ca);
p.setCl(c);
pdmodel.RegistrarPedido(p);
} | {
"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 | protected void update(HttpServletRequest request) throws Exception {
Pedido p = new Pedido();
Cancion c = new Cancion();
Cliente cl = new Cliente();
String cod = (request.getParameter("codigo"));
String cod_cancion = (request.getParameter("cod_cancion"));
String cod_cliente = (request.getParameter("cod_cliente"));
p.setCod_pedido(cod);
c.setCod_cancion(cod_cancion);
cl.setCod_cliente(cod_cliente);
p.setCan(c);
p.setCl(cl);
pdmodel.ActualizarPedido(p);
} | {
"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 | protected void delete(HttpServletRequest request) throws ServletException, IOException, Exception {
String cod = (request.getParameter("codigo"));
pdmodel.EliminarPedido(cod);
} | {
"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 | protected String list(HttpServletRequest request, pedidoModel pdmodel)
throws Exception {
String error = null;
List<Pedido> list =pdmodel.Listarpedido();
if (list != null) {
request.setAttribute("lispedidos", list);
} else {
error = "Sin acceso a Base de datos";
}
return error;
} | {
"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 | protected String read(HttpServletRequest request, pedidoModel pdmodel)
throws ServletException, IOException, Exception {
String error = null;
String cod=(request.getParameter("codigo"));
Pedido ped = pdmodel.BuscarPedido(cod);
if (ped != null) {
request.setAttribute("pedido", ped);
} else {
error = "Sin acceso a Base de datos";
}
return error;
} | {
"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 | protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.getWriter().append("Served at: ").append(request.getContextPath());
} | {
"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 | protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doGet(request, response);
} | {
"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 |
Assignment1(); Assignment2(); Assignment3(); Assignment4(); Assignment5(); Assignment6(); Assignment7(); Assignment8(); Assignment9(1,2); Assignment9_1("soep"); | private static void assignment9_1(String tekst) {
System.out.println(new Date() + " - Main - " + tekst);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main(String[] args) {\n System.out.println(\"*****************************Assignment 1 ********************************\");\n Assignment1 assignment1 = new Assignment1();\n assignment1.dataTypesMethod();\n int variable5 = Assignment1.variableAssignmentMethod(6);\n System.out.println(\"Value of int variable5 in mainMethod is: \" + variable5);\n Assignment1.characterAssignment();\n\n // Assignment2 dated Oct 7 2020\n System.out.println(\"*****************************Assignment 2 Part 1********************************\");\n Assignment2 assignment2 = new Assignment2();\n assignment2.arithmeticOperators(5, 7);\n assignment2.incrementOperators(3);\n System.out.println(\"*****************************Assignment 2 Part 2********************************\");\n assignment2.table(2);\n\n // Assignment dated Oct 9 2020\n System.out.println(\"*****************************Assignment 3********************************\");\n Assignment3 assignment3 = new Assignment3();\n assignment3.arithmeticLogicalOperators(3, 4, 6);\n assignment3.bitwiseOperators();\n\n }",
"public void getAssignment() {\n \n }",
"public static void exercise10() {\n }",
"public static void doExercise4() {\n // TODO: Complete Exercise 4 Below\n\n }",
"public static void doExercise3() {\n // TODO: Complete Exercise 3 Below\n\n }",
"public static void doExercise1() {\n // TODO: Complete Exercise 1 Below\n\n }",
"public static void doExercise2() {\n // TODO: Complete Exercise 2 Below\n\n }",
"public static void doExercise5() {\n // TODO: Complete Exercise 5 Below\n\n }",
"public static void main(String[] args) {\n FullAssignment11.run();\n FullAssignment12.run();\n }",
"public void mo8738a() {\n }",
"public void Case29(){\n\n }",
"@Test\r\n public void test1(){\r\n Exp one = new NumericLiteral(1);\r\n Exp three = new NumericLiteral(3);\r\n Exp exp = new PlusExp(one, three);\r\n Stmt decl = new DeclStmt(\"x\");\r\n Stmt assign = new Assignment(\"x\", exp);\r\n Stmt seq = new Sequence(decl, assign);\r\n assertEquals(seq.text(), \"var x; x = 1 + 3\");\r\n }",
"public void a(eq ☃) {}\r\n/* */ \r\n/* */ \r\n/* */ \r\n/* */ public int k() {\r\n/* 55 */ return 9;\r\n/* */ }",
"static void q7(){\n\t}",
"public void mo38117a() {\n }",
"public void mo21792Q() {\n }",
"Assignment createAssignment();",
"Assignment createAssignment();",
"public String c()\r\n/* 30: */ {\r\n/* 31:175 */ return \"step.\" + this.a;\r\n/* 32: */ }",
"public static void main(String[] args) {\n\t\tassignmentOperations();\n\t\t \n\t}",
"public static void main(String[] args) {\n// new Problem_10().print();\n Problem_10.print();\n }",
"public void Case37(){\n\n }",
"public void mo21789N() {\n }",
"@Test\n public void test39() throws Throwable {\n String[] stringArray0 = new String[7];\n Evaluation.main(stringArray0);\n }",
"private zzfl$zzg$zzc() {\n void var3_1;\n void var2_-1;\n void var1_-1;\n this.value = var3_1;\n }",
"Programming(){\n\t}",
"java.lang.String getS9();",
"public void m23075a() {\n }",
"public void mo6944a() {\n }",
"private void assignment() {\n\n\t\t\t}",
"public Problem38() {\n System.out.println(\"Problem38: \");\n }",
"void mo119581a();",
"void fillAssignmentWithActivities(Assignment assignment);",
"public void mo12930a() {\n }",
"void mo38026a();",
"public void mo21779D() {\n }",
"public abstract void createAssignment(int p);",
"public Snippet visit(Assignment n, Snippet argu) {\n\t\t Snippet _ret = new Snippet(\"\", \"\", null, false);\n\t Snippet f0 = n.identifier.accept(this, argu);\n\t if(!arrayInitializer)\n\t\t arrayInitVar = f0.returnTemp; \n\t Snippet f1 = n.nodeToken.accept(this, argu);\n\t identifierToAddToGlobalHash = f0.returnTemp;\n\t Snippet f2 = n.expression.accept(this, argu);\n\t identifierToAddToGlobalHash = \"\";\n\t Snippet f3 = n.nodeToken1.accept(this, argu);\n\t \n//\t if(arrayInitializer){\n//\t \t _ret.returnTemp = generateTabs(blockDepth)+f0.returnTemp+\" = \";\n//\t _ret.returnTemp+=arrayInit +\"\\n /*ArrayInitilizer*/\"+arrayInitializerBlock;\t \n//\t arrayInit = \"\";\n//\t arrayInitializerBlock = \"\";\n//\t arrayInitializer = false;\n//\t tPlasmaCode+=_ret.returnTemp+\"\\n\";\n//\t }else{\n\t \t \n\t \t _ret.returnTemp = generateTabs(blockDepth)+f0.returnTemp+\" = \";\n\t \t _ret.returnTemp +=f2.returnTemp;\n\t\t\ttPlasmaCode+= f2.preface+\"\\n\";\n\t\t\ttPlasmaCode+=_ret.returnTemp+\";\\n\";\n\t\t\ttPlasmaCode+= f2.postface+\"\\n\";\n\t\t\t\n\t // }\n\t return _ret;\n\t }",
"public String visit(AssignmentStatement n, String s) {\n n.f0.accept(this, null);\n n.f2.accept(this, null);\n return null;\n }",
"void mo5017a();",
"public String b()\r\n/* 35: */ {\r\n/* 36:179 */ return a();\r\n/* 37: */ }",
"public void mo21877s() {\n }",
"public void mo2740a() {\n }",
"public static void main(String[] args) {\n\tint n=10;\r\n\tint grade = 3;\r\n\tproblems( n , grade );\r\n\t\r\n\t\r\n}",
"public static void listing5_14() {\n }",
"public void mo21785J() {\n }",
"public void mo5248a() {\n }",
"@Test\n\tpublic void testAssignment(){\n\t\tVariable x = new Variable(\"x\");\n\t\tOperator plus = new Operator(\"+\");\n\t\tExpression one = f.createNumNode(1);\n\t\tExpression two = f.createNumNode(2);\n\t\tExpression exp = f.createInfixNode(plus, one, two);\n\t\tStatement assign = f.createAssignNode(x,exp);\n\t\tassertEquals(assign.textRepresentation(), \"x = 1 + 2;\");\n\t\n\t\tASTNodeCountVisitor v = new ASTNodeCountVisitor();\n\t\tassign.accept(v);\n\t\tassertEquals(\"assignment test1 fail\", v.numCount, 2);\n\t\tassertEquals(\"assignment test2 fail\", v.infixCount, 1);\n\t\tassertEquals(\"assignment test3 fail\", v.assignCount, 1);\n\t}",
"public Snippet visit(FieldAssignment n, Snippet argu) {\n\t \n\t Snippet _ret = new Snippet(\"\", \"\", null, false);\n\t Snippet f0 = n.identifier.accept(this, argu);\n\t n.nodeToken.accept(this, argu);\n\t Snippet f2 = n.identifier1.accept(this, argu);\n\t n.nodeToken1.accept(this, argu);\n\t n.nodeToken2.accept(this, argu);\n\t Snippet f5 = n.identifier2.accept(this, argu);\n\t n.nodeToken3.accept(this, argu);\n\t n.nodeToken4.accept(this, argu);\n\t _ret.returnTemp = generateTabs(blockDepth)+f0.returnTemp+\".\"+f2.returnTemp+\" = (\"+f5.returnTemp+\")\"+\";\";\n\t\t\ttPlasmaCode+=_ret.returnTemp+\"\\n\";\n\t return _ret;\n\t }",
"public void mo21794S() {\n }",
"void mo12634a();",
"@Test(timeout = 4000)\n public void test079() throws Throwable {\n XPathLexer xPathLexer0 = new XPathLexer(\") (\");\n Token token0 = xPathLexer0.at();\n xPathLexer0.setPreviousToken(token0);\n assertEquals(\")\", token0.getTokenText());\n assertEquals(16, token0.getTokenType());\n \n Token token1 = xPathLexer0.identifierOrOperatorName();\n assertEquals(15, token1.getTokenType());\n assertEquals(\"\", token1.getTokenText());\n }",
"void mo12143a();",
"public static void main(String[] args) {\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tString str;\n\t\tSystem.out.print(\"Enter the string : \");\n\t\tstr = scan.next();\n\t\tint len = str.length();\n\t\tAssignment obj = new Assignment();\n\t\tobj.recursiveCall(str, 0, len);\n\n\t\tfor (int i = 0; i <= lst.size() - 1; i++) {\n\t\t\tSystem.out.println(lst.get(i));\n\t\t}\n\t}",
"public void mo9233aH() {\n }",
"public Test05() {\n this(0);\n n2 = \"n2\";\n n4 = \"n4\";\n }",
"public interface AssignmentNode extends StackOperationNode {\n\n TemporaryVariableName getValueName();\n\n}",
"void mo98969a();",
"public void ScrumMaster1(String n) {\n\t\t}",
"public void mo21791P() {\n }",
"public void mo21787L() {\n }",
"private void assignIntoGrade() {\n }",
"void mo22249a();",
"void mo28194a();",
"public void mo23438b() {\n }",
"public static int i()\r\n/* 25: */ {\r\n/* 26: 48 */ return 9;\r\n/* 27: */ }",
"void mo310e();",
"public void mo97908d() {\n }",
"void mo10148a();",
"void mo57277b();",
"@Test\n\tpublic void testExoticGood() {\n\t\tassertNoException(\"int foo(int a) { return a; }\", \"(a)\");\n\t\tassertNoException(\"int foo(int a) { { int b = 42; } return a; }\", \"(a (b))\");\n\t\tassertNoException(\"int foo(int a) { int c = -1; { int b = a; c = b + 3; } return c; }\", \"(a, c (b))\");\n\t\tassertNoException(\"int foo(int a) { a = 42; return a; }\", \"(a)\");\n\t\tassertNoException(\"int foo(int a) { { int a = 42; } return a; }\", \"(a (a))\");\n\t}",
"EightSix(String n){\r\n // in order for us to use custom constructors we will need to use super.\r\n super(n);\r\n // Assigns the argument value to the string variable name.\r\n name = n;\r\n }",
"void mo28306a();",
"public void mo44053a() {\n }",
"private void parseSimpleStatement() {\n Operand operand = parseDesignator();\n\n if (nextToken.kind == Token.ASSIGN) {\n check(Token.ASSIGN);\n if (operand.kind != Operand.KIND_ELEMENT\n && operand.kind != Operand.KIND_FIELD\n && operand.kind != Operand.KIND_LOCAL\n && operand.kind != Operand.KIND_STATIC) {\n error(\"Illegal left-hand side operand in assignment\");\n }\n\n Struct type = parseExpr().type;\n if (!(type.assignableTo(operand.type))) {\n error(\"Incompatible types in assignment\");\n }\n\n code.store(operand);\n } else {\n if (operand.kind != Operand.KIND_METHOD) {\n error(\"Designator isn't a valid method\");\n }\n parseActPars(operand.object);\n\n code.put(Code.OP_CALL);\n code.put2(operand.address);\n if (operand.kind == Operand.KIND_METHOD\n && operand.type != SymbolTable.STRUCT_NONE) {\n code.put(Code.OP_POP);\n }\n }\n check(Token.SEMICOLON);\n }",
"void m21();",
"private void level7() {\n }",
"void mo7350a();",
"public static void main(String[] args) throws IOException {\n// new Homework01();\n new Homework02();\n }",
"AbsDemo1()\r\n\t\t{\r\n\t\t\tSystem.out.println(\"cons of AbsDemo1\");\r\n\t\t}",
"@Test\n\tpublic void testAddAssignment() {\n\t}",
"static void q4(){\t\n\t}",
"public void mo21782G() {\n }",
"public void mo21780E() {\n }",
"public void mo21793R() {\n }",
"EvaluatorException mo19168b(String str, String str2, int i, String str3, int i2);",
"public org.a9 a() {\n /*\n r4 = this;\n r1 = 0;\n r0 = r4.c;\n if (r0 != 0) goto L_0x0040;\n L_0x0005:\n monitor-enter(r4);\n r0 = r4.c;\t Catch:{ all -> 0x0043 }\n if (r0 != 0) goto L_0x003f;\n L_0x000a:\n r2 = r4.e;\t Catch:{ IllegalArgumentException -> 0x0041 }\n if (r2 != 0) goto L_0x003f;\n L_0x000e:\n r0 = r4.b;\t Catch:{ all -> 0x0043 }\n r2 = z;\t Catch:{ all -> 0x0043 }\n r3 = 8;\n r2 = r2[r3];\t Catch:{ all -> 0x0043 }\n r3 = 0;\n r0 = r0.getSharedPreferences(r2, r3);\t Catch:{ all -> 0x0043 }\n r2 = z;\t Catch:{ all -> 0x0043 }\n r3 = 6;\n r2 = r2[r3];\t Catch:{ all -> 0x0043 }\n r3 = \"\";\n r0 = r0.getString(r2, r3);\t Catch:{ all -> 0x0043 }\n r2 = android.text.TextUtils.isEmpty(r0);\t Catch:{ IllegalArgumentException -> 0x0046 }\n if (r2 == 0) goto L_0x0053;\n L_0x002d:\n r2 = r1;\n L_0x002e:\n if (r2 == 0) goto L_0x0039;\n L_0x0030:\n r0 = new org.a9;\t Catch:{ IllegalArgumentException -> 0x0048 }\n r0.<init>(r2);\t Catch:{ IllegalArgumentException -> 0x0048 }\n r2 = com.whatsapp.DialogToastActivity.f;\t Catch:{ IllegalArgumentException -> 0x0048 }\n if (r2 == 0) goto L_0x003a;\n L_0x0039:\n r0 = r1;\n L_0x003a:\n r4.c = r0;\t Catch:{ all -> 0x0043 }\n r1 = 1;\n r4.e = r1;\t Catch:{ all -> 0x0043 }\n L_0x003f:\n monitor-exit(r4);\t Catch:{ all -> 0x0043 }\n L_0x0040:\n return r0;\n L_0x0041:\n r0 = move-exception;\n throw r0;\t Catch:{ all -> 0x0043 }\n L_0x0043:\n r0 = move-exception;\n monitor-exit(r4);\t Catch:{ all -> 0x0043 }\n throw r0;\n L_0x0046:\n r0 = move-exception;\n throw r0;\t Catch:{ IllegalArgumentException -> 0x0048 }\n L_0x0048:\n r0 = move-exception;\n r2 = z;\t Catch:{ all -> 0x0043 }\n r3 = 7;\n r2 = r2[r3];\t Catch:{ all -> 0x0043 }\n com.whatsapp.util.Log.c(r2, r0);\t Catch:{ all -> 0x0043 }\n r0 = r1;\n goto L_0x003a;\n L_0x0053:\n r2 = 3;\n r0 = android.backport.util.Base64.decode(r0, r2);\t Catch:{ IllegalArgumentException -> 0x0048 }\n r2 = r0;\n goto L_0x002e;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.whatsapp.l9.a():org.a9\");\n }",
"void mo9693a();",
"public static void main(String[] args) {\n\t\t\n\t\tQuestion11 obj=new Question11();\n\t\tSystem.out.println(obj.practiceOne());\n\n\t}",
"public void mo3749d() {\n }",
"public void mo9241ay() {\n }",
"void mo72111a();",
"public Assignment getOperatorAssignment_2() { return cOperatorAssignment_2; }",
"public interface AnonymousClass1lE {\n void A7X(String str, String str2, String str3);\n\n void A7Z(String str, String str2, @Nullable Map<String, String> map);\n\n void A7b(String str, String str2, Throwable th, @Nullable Map<String, String> map);\n\n void A7d(String str, String str2, @Nullable Map<String, String> map);\n\n void A7f(String str, String str2);\n\n void A8G(String str, String str2, boolean z);\n\n boolean A9J(String str);\n}",
"public void mo9848a() {\n }",
"public static void main(String[] args) {\n Last_coding_exercises.task17();\n\n\n }",
"void mo17009a(int i, int i2, int i3);",
"public static void main(String[] args) {\n func1();\n System.out.println(\"---------\");\n func2();\n System.out.println(\"---------\");\n func3();\n System.out.println(\"---------\");\n func4();\n System.out.println(\"---------\");\n func5();\n System.out.println(\"---------\");\n System.out.println(func6(5));\n System.out.println(\"---------\");\n func7(100);\n System.out.println(\"---------\");\n System.out.println(func8(100));\n System.out.println(\"---------\");\n func9();\n System.out.println(\"---------\");\n func10();\n }",
"public void mo3376r() {\n }",
"public Assignment() {\n initComponents();\n }"
] | [
"0.64097583",
"0.6133054",
"0.60300523",
"0.59336",
"0.58859885",
"0.5862387",
"0.58255416",
"0.58086103",
"0.57474506",
"0.5600394",
"0.5522218",
"0.5495705",
"0.5481722",
"0.5478117",
"0.5478045",
"0.5458411",
"0.5396355",
"0.5396355",
"0.5388264",
"0.5362017",
"0.5359917",
"0.5359409",
"0.535209",
"0.532269",
"0.52992564",
"0.5295497",
"0.5292538",
"0.5277156",
"0.52705353",
"0.5268181",
"0.52339816",
"0.5233245",
"0.52292264",
"0.52243793",
"0.52099335",
"0.52033275",
"0.5198643",
"0.5193916",
"0.5193342",
"0.5192469",
"0.51893455",
"0.51790875",
"0.5177276",
"0.5171858",
"0.51674116",
"0.51668715",
"0.5164199",
"0.51287866",
"0.5123566",
"0.5116677",
"0.5115726",
"0.5111021",
"0.5110825",
"0.5110648",
"0.5109917",
"0.5109731",
"0.5109291",
"0.5104706",
"0.51030475",
"0.5102447",
"0.5100074",
"0.5097997",
"0.509595",
"0.50959057",
"0.5094651",
"0.50912625",
"0.50840497",
"0.50829595",
"0.5077542",
"0.50754136",
"0.5072991",
"0.5070628",
"0.50689876",
"0.50688136",
"0.5065372",
"0.50633526",
"0.5059705",
"0.50536287",
"0.50521487",
"0.50444984",
"0.5039738",
"0.50391454",
"0.50377315",
"0.5034287",
"0.50253576",
"0.50242543",
"0.50234723",
"0.5018541",
"0.50179636",
"0.5015015",
"0.50133383",
"0.50104076",
"0.50047415",
"0.4997014",
"0.49961457",
"0.49953046",
"0.49941915",
"0.49901474",
"0.49897113",
"0.49886537"
] | 0.5326553 | 23 |
diagonal = == lower left corner = = top left corner is a single for loop? | private static void assignment6() {
for (int i = 0; i < 4;i++){
System.out.println();
for (int j = 0; j < 4; j++){
// System.out.print(" * ");
if (i <= j){
System.out.print(" * ");
} else {
System.out.print(" ");
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static boolean isInDiagonal(int pos) {\n for (int i = 0; i < ColorFrames.BOARD_DIM; ++i) {\n if (1 + i * (ColorFrames.BOARD_DIM + 1) == pos || ColorFrames.BOARD_DIM + i * (ColorFrames.BOARD_DIM - 1) == pos)\n return true;\n }\n\n return false;\n }",
"@Test\n\tpublic void testCuatroEnRayaDiag1() {\n\t\t\n\t\tint []posX = new int[4];\n\t\tint []posY = new int[4];\n\t\tfor (int i = 1; i <= 12; ++i) {\n\t\t\tint sx = Math.max(1, i-5);\n\t\t\tint sy = Math.min(i, 6);\n\t\t\twhile ((sy - 4 >= 0) && (sx + 3 <= 7)) {\n\t\t\t\tfor (int l = 0; l < 4; ++l) {\n\t\t\t\t\tposX[l] = sx + l;\n\t\t\t\t\tposY[l] = sy - l;\n\t\t\t\t}\n\t\t\t\tpruebaCuatroEnRaya(posX, posY);\n\t\t\t\tsy--; sx++;\n\t\t\t}\n\t\t}\n\t}",
"private int checkDiagonal() {\n if ((this.board[0][0] == this.board[1][1]) && this.board[0][0] == this.board[2][2]) {\n return this.board[0][0];\n } else if ((this.board[0][2] == this.board[1][1]) && this.board[0][2] == this.board[2][0]) {\n return this.board[0][2];\n } else {\n return 0;\n }\n }",
"private boolean winsByDiagonalTopLeftToBottomRight(char symbol){\n int max_diagonal_count = 0;\n\n // Deals with the diagonals below the midpoint in the array. Iterates through diagonals from last row to the\n // first row.\n for (int i = this.boardRows - 1; i > 0; i--) {\n\n // reset counter at each new diagonal\n int count = 0;\n\n // Iterates through the diagonal with origin (top left point) at first element of row i\n for (int j = 0, x = i; x < this.boardRows; j++, x++) {\n\n // If j surpasses the number of available cols we break out the inner for loop. This happens when the\n // num of rows and cols in the array are different\n if (j>=this.boardColumns){\n break;\n }\n // If char symbol is the same as the element in the diagonal, we increment counter by 1 and update\n // max_diagonal_count if possible.\n if(symbol == this.gameBoard[x][j]){\n count+=1;\n\n if (count>max_diagonal_count){\n max_diagonal_count=count;\n }\n }\n //Otherwise, we reset the counter to 0\n else {\n count = 0;\n }\n }\n }\n\n // Deals with the diagonals at and after the midpoint in the array. Iterates through diagonals from first column to the\n // last column\n for (int i = 0; i < this.boardColumns; i++) {\n\n // Resets counter for each new diagonal\n int count = 0;\n\n // Iterates through diagonal values with origin (top left point) at first element of col i\n for (int j = 0, y = i; y < this.boardColumns; j++, y++) {\n\n // If j surpasses the number of available cols we break out the inner for loop. This happens when the\n // num of rows and cols in the array are different\n if (j>=this.boardRows){\n break;\n }\n\n // If char symbol is the same as the element in the diagonal, we increment counter by 1 and update\n // max_diagonal_count if possible.\n if(symbol == this.gameBoard[j][y]){\n count+=1;\n\n if (count>max_diagonal_count){\n max_diagonal_count=count;\n }\n }\n //Otherwise, we reset the counter to 0\n else {\n count = 0;\n }\n }\n }\n\n // If the max_diagonal_count is greater than or equal to tilesNeeded, then we have sufficient tiles in a diagonal\n // for char symbol to win so we return true. Otherwise, we return false.\n if (max_diagonal_count >= this.tilesNeeded){\n return true;\n }\n else {\n return false;\n }\n\n }",
"public boolean diag1(){\n\tboolean trouve=false;\n\tint i=0;\n\tObject tmp='@';\n\twhile(i<5 && !trouve){\n\t\tif(gc[i][i]==tmp)\n\t\t\ttrouve=true;\n\t\telse\n\t\t\ti++;\n\t}\n\treturn trouve;\n}",
"private int diagonalCount() {\n\t\treturn Math.abs(destRow-curRow) > Math.abs(destCol-curCol) ?\n\t\t\t Math.abs(destCol-curCol) : Math.abs(destRow-curRow);\n\t}",
"@Test\n\tpublic void testCuatroEnRayaDiag2() {\n\t\t\n\t\tint []posX = new int[4];\n\t\tint []posY = new int[4];\n\t\tfor (int i = 1; i <= 12; ++i) {\n\t\t\tint sx = Math.min(i, 7);\n\t\t\tint sy = Math.min(13 - i, 6);\n\t\t\twhile ((sy - 4 >= 0) && (sx - 4 >= 0)) {\n\t\t\t\tfor (int l = 0; l < 4; ++l) {\n\t\t\t\t\tposX[l] = sx - l;\n\t\t\t\t\tposY[l] = sy - l;\n\t\t\t\t}\n\t\t\t\tpruebaCuatroEnRaya(posX, posY);\n\t\t\t\tsy--; sx--;\n\t\t\t}\n\t\t}\n\t}",
"public boolean checkDiagonal() {\r\n\t\tif (p1[0] + p1[4] + p1[8] == 15)\r\n\t\t\treturn true;\r\n\t\telse if (p1[2] + p1[4] + p1[6] == 15)\r\n\t\t\treturn true;\r\n\t\telse if (p2[0] + p2[4] + p2[8] == 15)\r\n\t\t\treturn true;\r\n\t\telse if (p2[2] + p2[4] + p2[6] == 15)\r\n\t\t\treturn true;\r\n\t\treturn false;\r\n\t}",
"private boolean checkMainDiagonal() {\n int diagonalSum = 0;\n for (int i = 0; i < dimensions; i++) {\n diagonalSum += square[i + dimensions * i];\n }\n\n return diagonalSum == magicConst;\n }",
"void resDiagonale(){ \r\n for (int i = 0; i<N; i=i+nCarre) \r\n \tresCarre(i, i); \r\n }",
"public static void main(String[] args) {\n int[][] matrix = {{1,2}, {3,4}};\n // int[][] matrix = {{1,2}, {3,4}};\n// printMatrixDiagonal (matrix, matrix.length);\n int[] result = findDiagonalOrder (matrix);\n for ( int i:result ){\n System.out.println (i);\n }\n\n }",
"public boolean diag2(){\n\tboolean trouve=false;\n\tint i=0;\n\tObject tmp='@';\n\twhile(i<5 && !trouve){\n\t\tif(gc[i][gc.length-i-1]==tmp)\n\t\t\ttrouve=true;\n\t\telse\n\t\t\ti++;\n\t}\n\treturn trouve;\n}",
"private boolean checkSecondaryDiagonal() {\n int diagonalSum = 0;\n for (int i = 0; i < dimensions; i++) {\n diagonalSum += square[(dimensions - 1) * i + dimensions - 1];\n }\n\n return diagonalSum == magicConst;\n }",
"public boolean diagonalLeft(){\n\t\t\r\n\t\tfor (int j = 1; j < Board.length-1; j++){\r\n\t\t\tint k = Board.length-1-j;\r\n\t\t\t\tif (Board[j][k].charAt(2) != Board[j+1][k-1].charAt(2))\r\n\t\t\t\t\tbreak;\r\n\t\t\t\telse if (Board[j][k].charAt(2) == '_')\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tif ((j == Board.length-2) && (k == 1)){\r\n\t\t\t\t\tthis.winner = Board[j][k].charAt(2);\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public int[] findDiagonalOrder(int[][] matrix) {\n \n int n = matrix.length; if(n == 0) return new int[0];\n int m = matrix[0].length; if(m == 0) return new int[0];\n int i = 0, j = 0, idx = 0;\n int[] ret = new int[n*m];\n boolean up = true;\n while(i < n && j < m){\n ret[idx++] = matrix[i][j];\n if(up){\n if(inBound(i-1, n, j+1, m)){\n i = i-1; j = j+1;\n }else if(inBound(i, n, j+1, m)){ //try right\n j = j+1; up = !up;\n }else if(inBound(i+1, n, j, m)){ // try bot\n i = i+1; up = !up;\n }else{\n i++; j++; // hit end;\n }\n }else{\n if(inBound(i+1, n, j-1, m)){\n i = i+1; j = j-1;\n }else if(inBound(i+1, n, j, m)){ // try bot\n i = i+1; up = !up;\n }else if(inBound(i, n, j+1, m)){ // try right\n j = j+1; up = !up;\n }else{\n i++; j++; // hit end;\n }\n }\n }\n return ret;\n }",
"public abstract double getDiagonal();",
"static int diagonalDifference(int[][] matrix) {\n int ltr = 0;\n int rtl = 0;\n for (int i = 0; i < matrix.length; i++) {\n System.out.println(\"matrix[\" + i + \"][\" + i + \"]: \" + matrix[i][i]);\n ltr += matrix[i][i];\n System.out.println(\"matrix[ \" + (i) + \"][\" + (matrix.length - 1 - i) + \"]: \" + matrix[matrix.length - 1 - i][matrix.length - 1 - i]);\n rtl += matrix[i][matrix.length - 1 - i];\n }\n int result = ltr - rtl;\n return result < 0 ? result * -1 : result;\n }",
"public static void main(String[] args) {\n int[][] inp = new int[][] {\n {1,2,3},\n {5,6,7},\n {9,10,11}};\n \n int temp;\n \n\t for(int i = inp.length-1,j=0; i>=0 ; i--,j=0)\n {\n System.out.print(inp[i][j] + \" \");\n\t\t \n temp = i; // store old row where we started \n \n\t\t while(i+1 < inp.length && j+1 < inp[0].length)\n {\n System.out.print(inp[i+1][j+1] + \" \"); // keep print right diagonal\n i++;j++;\n }\n \n\t\t i = temp; // restore old row\n \n\t\t System.out.println();\n\t\t \n\t\t // special case - when we switch from processing row to processing column\n if(i == 0)\n {\n\t\t\t // now, column will go from 1 to inp[0].length-1\n\t\t\t \n for (int k = 1; k < inp[0].length; k++) {\n\n\t\t\t\t temp = k; // save old column\n \n\t\t\t\t System.out.print(inp[i][k] + \" \");\n\t\t\t\t \n\t\t\t\t // keep getting right diagonal\n while (i + 1 < inp.length && k + 1 < inp[0].length) {\n System.out.print(inp[i + 1][k + 1] + \" \");\n i++;\n k++;\n }\n \n\t\t\t\t k = temp;\n \n\t\t\t\t i = 0;\n \n\t\t\t\t System.out.println();\n\n }\n }\n }\n \n }",
"private boolean hayRayaDiagonal() {\n // Diagonal principal (i==j)\n Casilla[] diagonalPri = new Casilla[casillas.length];\n for (int i = 0; i < casillas.length; i++) {\n diagonalPri[i] = casillas[i][i];\n }\n if (linea(diagonalPri))\n return true;\n\n // Diagonal secundaria (i==(j=i-1))\n Casilla[] diagonalSec = new Casilla[casillas.length];\n for (int i = 0; i < casillas.length; i++) {\n diagonalSec[i] = casillas[i][casillas.length-1-i];\n }\n\n return linea(diagonalSec);\n }",
"public boolean isValiddiagonal(Square curB, Square preB) {\n boolean value = true;\n int xdistance = curB.getRow1() - preB.getRow1();\n int ydistance = curB.getCol1() - preB.getCol1();\n int i1;\n int j1 = 0;\n \n if ((ydistance != 0) && (xdistance != 0)) {\n if ((xdistance > 0) && (ydistance > 0)) { //move right down\n for (i1 = preB.getCol1(); i1 < curB.getCol1(); i1 += 1) {\n j1++;\n if (Board.squares[preB.getRow1() + j1][preB.getCol1() + j1].isOccupied()) {\n value = false;\n }\n }\n } else if ((xdistance > 0) && (ydistance < 0)) { //move left down\n for (i1 = curB.getCol1(); i1 < preB.getCol1(); i1 += 1) {\n j1++;\n if (Board.squares[preB.getRow1() + j1][preB.getCol1() - j1].isOccupied()) {\n value = false;\n System.out.println(value);\n }\n }\n } else if ((xdistance < 0) && (ydistance > 0)) { //move right up\n for (i1 = preB.getCol1(); i1 < curB.getCol1(); i1 += 1) {\n j1++;\n if (Board.squares[preB.getRow1() - j1][preB.getCol1() + j1].isOccupied()) {\n value = false;\n }\n }\n } else if ((xdistance < 0) && (ydistance < 0)) {\n for (i1 = curB.getCol1(); i1 < preB.getCol1(); i1 += 1) {\n j1++;\n if (Board.squares[preB.getRow1() - j1][preB.getCol1() - j1].isOccupied()) {\n value = false;\n }\n }\n } \n }\n return value;\n }",
"public boolean checkDiagonalWin(){\n\t\treturn true;\n\t}",
"boolean diagonalWin(){\n\t\tint match_counter=0;\n\t\tboolean flag=false;\n\t\tfor(int row=8; row>=3;row--){\n\t\t\tfor(int column=0;column<25;column++){\n\t\t\t\tif(Board[row][column]!='\\u0000'){\n\t\t\t\t\tif(Board[row][column]!='O'){\n\t\t\t\t\t\tif(Board[row][column]==Board[row-1][column+1]&& \n\t\t\t\t\t\t Board[row-1][column+1]== Board[row-2][column+2]&&\n\t\t\t\t\t\t Board[row-2][column+2]==Board[row-3][column+3]){\n\t\t\t\t\t\t\tflag=true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tflag=false;\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t}\n\t\t\tif (flag == true)\n\t\t\t\tbreak;\n\t\t}\n\t\treturn flag;\t\n\t}",
"private boolean isDiagonal(Worm worm1, Worm worm2){\n return Math.abs(worm1.position.x - worm2.position.x) == Math.abs(worm1.position.y - worm2.position.y);\n }",
"private static boolean isNotDiagonal(int[] chase, int i, int n) {\n\t\tfor(int j=0; j<chase.length; j++) {\n\t\t\tif(chase[j] != -1) {\n\t\t\t\tif(Math.abs(i - j) == Math.abs(n - chase[j]))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"@Test\n\tpublic void testDiagonalNeighbors() {\n\t\tPosition topLeft = new Position(0,0);\n\t\tPosition bottomRight = new Position(1,1);\n\n\t\tint distance = euclideanSquaredMetric.calculateCost(topLeft, bottomRight);\n\t\tassertEquals(2 * lateralDistanceWeight, distance);\n\n\t\tPosition topRight = new Position(0,1);\n\t\tPosition bottomLeft = new Position(1,0);\n\n\t\tdistance = euclideanSquaredMetric.calculateCost(topRight, bottomLeft);\n\t\tassertEquals(2*lateralDistanceWeight, distance);\n\n\t}",
"public static boolean checkDiagonal(){\nif(gamebd[0][0]==gamebd[1][1]&&gamebd[1][1]==gamebd[2][2]&&gamebd[0][0]>0)\r\n{\r\n\tif(gamebd[0][0]==player1)\r\n\t\tSystem.out.println(\"Player 1 won\");\r\n\telse\r\n\t\tSystem.out.println(\"Player 2 won\");\r\nreturn true;\t\t\r\n}\r\nif(gamebd[0][2]==gamebd[1][1]&&gamebd[1][1]==gamebd[2][0]&&gamebd[0][2]>0)\r\n{\r\n\tif(gamebd[0][2]==player1)\r\n\t\tSystem.out.println(\"Player 1 won\");\r\n\telse\r\n\t\tSystem.out.println(\"Player 2 won\");\r\n\treturn true;\t\r\n}\r\n\treturn false;\r\n}",
"public int downwardLeftDiag(int row, int col) {\n\t\tint count = 0;\n\t\tfor(int i = 0; i < board.length; i++) {\n\t\t\t\n\t\t\tif(row >= 0 && row < 8 && col >=0 && col <8) {\n\t\t\t\t\n\t\t\t\tif(board[row][col] != 1)\n\t\t\t\t\tcount++;\n\t\t\t\n\t\t\t\trow++; col--;\n\t\t\n\t\t\t}\n\t\t}\n\n\t\treturn count -1;\n\t\t\n\t}",
"static void TwoDimTrav(int[][] arr, int row, int col){\n\n int[] dr = new int[]{ -1, 1, 0, 0};\n int[] dc = new int[]{ 0, 0, 1, -1};\n\n for(int i = 0; i < 4; i++){\n int newRow = row + dr[i];\n int newCol = col + dc[i];\n\n if(newRow < 0 || newCol < 0 || newRow >= arr.length || newCol >= arr[0].length)\n continue;\n\n // do your code here\n\n }\n\n // All Directions\n // North, South, East, West, NW NE SW SE\n // dr = [ -1, 1, 0, 0 -1, -1, 1, 1 ]\n // dc = [ 0, 0, 1, -1 -1, 1, 1, -1 ]\n\n// int[] dr = new int[]{ -1, 1, 0, 0, -1, -1, 1, 1};\n// int[] dc = new int[]{ 0, 0, 1, -1, -1, 1, -1, 1};\n//\n// for(int i = 0; i < 8; i++){\n// int newRow = row + dr[i];\n// int newCol = col + dc[i];\n//\n// if(newRow < 0 || newCol < 0 || newRow >= arr.length || newCol >= arr[0].length)\n// continue;\n//\n// // do your code here\n//\n// }\n }",
"private boolean checkTopLeftDownDiag(char playerSymbol) {\n //checking the top left-bottom right diagonal\n for (int i = 0; i < N; i++) {\n if (grid[i][i].getSymbol() != playerSymbol) {\n return false;\n }\n }\n return true;\n }",
"private boolean checkDiagonalWin(BoardPosition lastPos){\r\n int i, j, k, countTop, countBottom;\r\n int check = 5;\r\n\r\n //checking for diagonals from top to bottom\r\n for(i = 0; i < (yMax-yMax)+5; i++){\r\n for(j = 0; j < (xMax / 2); j++){\r\n countTop = 0;\r\n for(k = 0; k < check; k++){\r\n if(grid[i+k][j+(2*k)] == lastPos.getPlayer()) {\r\n countTop++;\r\n }\r\n }\r\n if(countTop == win) {\r\n return true;\r\n }\r\n }\r\n }\r\n\r\n //checking for diagonals from bottom to top\r\n for(i = yMax-1; i > (yMax-yMax)+3; i--){\r\n for(j = 0; j < (xMax / 2); j++){\r\n countBottom = 0;\r\n for(k = 0; k < check; k++){\r\n if(grid[i-k][j+(2*k)] == lastPos.getPlayer()) {\r\n countBottom++;\r\n }\r\n }\r\n if(countBottom == win) {\r\n return true;\r\n }\r\n }\r\n }\r\n\r\n return false;\r\n }",
"public int sides1() {\n for (int row = 0; row < board.length; row++)\n for (int col = 0; col < board.length; col++) {\n // left-border (excluding corners - check 3 sides only)\n if (row != 0 && row != board.length - 1 && col == 0) {\n if (board[row - 1][col] != null && board[row][col + 1] != null && board[row + 1][col] != null\n && board[row][col] != null)\n if (board[row - 1][col].getPlayerNumber() != board[row][col].getPlayerNumber()\n && board[row - 1][col].getPlayerNumber() != board[row][col].getPlayerNumber() &&\n board[row][col + 1].getPlayerNumber() != board[row][col].getPlayerNumber())\n if (playersArray[board[row][col].getPlayerNumber()] != -3)\n return board[row][col].getPlayerNumber();\n\n }\n // right-border (excluding corners - check 3 sides only)\n if (row != 0 && row != board.length - 1 && col == board.length - 1) {\n if (board[row - 1][col] != null && board[row][col - 1] !=\n null && board[row + 1][col] != null&& board[row][col] != null)\n if (board[row - 1][col].getPlayerNumber() != board[row][col].getPlayerNumber()\n && board[row][col].getPlayerNumber() != board[row+1][col] .getPlayerNumber() &&\n board[row][col - 1].getPlayerNumber() != board[row][col].getPlayerNumber())\n if (playersArray[board[row][col].getPlayerNumber()] != -3)\n return board[row][col].getPlayerNumber();\n }\n // above-border (excluding corners - check 3 sides only)\n if (col != 0 && col != board.length - 1 && row == 0) {\n if (board[row][col - 1] != null && board[row][col + 1] !=\n null && board[row + 1][col] != null&& board[row][col] != null)\n if (board[row][col].getPlayerNumber() == board[row][col + 1].getPlayerNumber()\n && board[row + 1][col].getPlayerNumber() != board[row][col].getPlayerNumber() &&\n board[row][col - 1].getPlayerNumber() != board[row][col].getPlayerNumber())\n if (playersArray[board[row][col].getPlayerNumber()] != -3)\n return board[row][col].getPlayerNumber();\n }\n // bottom-border (excluding corners - check 3 sides only)\n if (col != 0 && col != board.length - 1 && row == board.length - 1) {\n if (board[row][col - 1] != null && board[row][col + 1] != null && board[row - 1][col] != null&&\n board[row][col]!= null)\n if (board[row][col].getPlayerNumber() != board[row][col + 1].getPlayerNumber()\n && board[row - 1][col].getPlayerNumber() != board[row][col].getPlayerNumber() &&\n board[row][col - 1].getPlayerNumber() != board[row][col].getPlayerNumber())\n return board[row][col - 1].getPlayerNumber();\n }\n\n }\n return -2;\n\n }",
"private int[] nextDiagWin(){ \r\n\t\t//left diagonal\r\n\t\tif (board[0][0] == board[1][1] && board[2][2] == '-' && board[0][0] != '-'){\r\n\t\t\tdiagWin[0] = 2; \r\n\t\t\tdiagWin[1] = 2;\r\n\t\t\treturn diagWin;\r\n\t\t}\r\n\t\telse if (board[1][1] == board[2][2] && board[0][0] == '-' && board[1][1] != '-'){\r\n\t\t\tdiagWin[0] = 0; \r\n\t\t\tdiagWin[1] = 0;\r\n\t\t\treturn diagWin;\r\n\t\t}\r\n\t\telse if (board[0][0] == board[2][2] && board[1][1] == '-' && board[0][0] != '-'){\r\n\t\t\tdiagWin[0] = 1; \r\n\t\t\tdiagWin[1] = 1;\r\n\t\t\treturn diagWin;\r\n\t\t}\r\n\t\t//right diagonal\r\n\t\telse if (board[0][2] == board[2][0] && board[1][1] == '-' && board[0][2] != '-'){\r\n\t\t\tdiagWin[0] = 1; \r\n\t\t\tdiagWin[1] = 1;\r\n\t\t\treturn diagWin;\r\n\t\t}\r\n\t\telse if (board[0][2] == board[1][1] && board[2][0] == '-' && board[0][2] != '-'){\r\n\t\t\tdiagWin[0] = 2; \r\n\t\t\tdiagWin[1] = 0;\r\n\t\t\treturn diagWin;\r\n\t\t}\t\t\r\n\t\telse if (board[1][1] == board[2][0] && board[0][2] == '-' && board[1][1] != '-'){\r\n\t\t\tdiagWin[0] = 0; \r\n\t\t\tdiagWin[1] = 2;\r\n\t\t\treturn diagWin;\r\n\t\t}\r\n\t\treturn diagWin;\r\n\t}",
"public Squarelotron mainDiagonalFlip(int ring);",
"private Cell get_bottom_left_diagnoal_cell(int row, int col) {\n return get_cell(++row, --col);\n }",
"public Squarelotron inverseDiagonalFlip(int ring);",
"private void checkDiagonal(Tile[][] chessBoard,int pawnX,int pawnY, char pawnColor) {\r\n\t\tint[] diagXList = {pawnX - 1, pawnX + 1};\r\n\t\tint direction;\r\n\t\tif (pawnColor == 'w') {\r\n\t\t\tdirection = 1;\r\n\t\t} else {\r\n\t\t\tdirection = -1;\r\n\t\t}\r\n\t\tfor (int diagX : diagXList) {\r\n\t\t\tif (diagX >= 0 && diagX <= 7) {\r\n\t\t\t\tint y = pawnY + direction;\r\n\t\t\t\tif (y >= 0 && y <= 7) {\r\n\t\t\t\t\tUnit unit = chessBoard[diagX][y].getPiece();\r\n\t\t\t\t\tif (unit != null) {\r\n\t\t\t\t\t\tchar color = unit.getColor();\r\n\t\t\t\t\t\tif (pawnColor != color){\r\n\t\t\t\t\t\t\tSystem.out.println(Integer.toString(diagX));\r\n\t\t\t\t\t\t\tMoves move = new Moves(diagX, y);\r\n\t\t\t\t\t\t\tinsertMove(move, moveList);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"protected static boolean hasMatchDiagonalNorth(final Board board, final int startCol, final int startRow, final int key)\r\n {\r\n int col = startCol;\r\n\r\n for (int row = startRow; row > startRow - MATCH_COUNT; row--)\r\n {\r\n //if we are out of bounds we don't meet the match criteria\r\n if (col >= board.getBoardKey()[0].length)\r\n return false;\r\n \r\n //if we are out of bounds we don't meet the match criteria\r\n if (row < 0)\r\n return false;\r\n\r\n //if the key does not match, return false\r\n if (board.getKey(col, row) != key)\r\n return false;\r\n \r\n //increase the column\r\n col++;\r\n }\r\n \r\n //there was nothing from preventing a match return true\r\n return true;\r\n }",
"public static int[] findDiagonalOrder(int[][] matrix){\n if( matrix == null || matrix.length == 0)\n return new int[0];\n int i = 0;\n int j =0;\n int k = 0;\n int size = matrix.length * matrix[0].length;\n int[] result = new int[size];\n boolean moveUp =true;\n while(k< size){\n\n if(moveUp){\n for(;i >=0 && j<= matrix[0].length-1;i--, j++){\n result[k] = matrix[i][j];\n k++;\n }\n // while moving up there are two conditions\n// 1. only row moves beyod 0 th row and column is in range (check for both row and column)\n //2. both row and column moves out ( check for column only)\n //case 1\n if(i<0 && j <= matrix[0].length-1){\n i = 0; // reset row to 0 and move down\n moveUp = !moveUp;\n }\n //case 2\n if(j == matrix[0].length){\n i = i+2; // reset row\n j--; // reduce column and move down\n moveUp = !moveUp;\n }\n\n }\n else\n {\n // moving down increment row and decrement column\n for(;j>=0 && i <= matrix.length - 1; i++, j-- ){\n result[k] = matrix[i][j];\n k++;\n }\n // while moving down there are two cases\n // 1. column goes out but rows in order (we need to check both)\n // 2. both column and row goes out (we can only have row check)\n if(j < 0 && i<= matrix.length-1){\n j = 0;\n moveUp = !moveUp;\n }\n if( i == matrix.length){\n j = j+2;\n i--;\n moveUp = !moveUp;\n }\n\n }\n\n\n }\n return result;\n }",
"static int diagonalDifference(int[][] arr) {\n int leftDiag=0;\n int rigthDiag=0;\n for(int i =0;i<arr.length;i++){\n for(int j=0;j<arr.length;j++){\n if(i==j){\n leftDiag+=arr[i][j];\n }\n if(i+j==arr.length-1){\n rigthDiag+=arr[i][j];\n }\n }\n }\n return Math.abs(leftDiag-rigthDiag);\n }",
"private int[] diagnalUpward(List<Integer> resList, int rowIdx, int colIdx, int[][] matrix) {\n int row = matrix.length;\n int col = matrix[0].length;\n\n while ((rowIdx >= 0 && rowIdx < row) && (colIdx >= 0 && colIdx < col)) {\n resList.add(matrix[rowIdx][colIdx]);\n rowIdx--;\n colIdx++;\n }\n rowIdx++;\n colIdx--;\n // Compute new starting point: try to go right, if reaches the end then go down.\n if (colIdx == col - 1) return new int[]{rowIdx + 1, colIdx};\n return new int[]{rowIdx, colIdx + 1};\n }",
"private static void rotateMatrix(int[][] matrix) {\n\n\t\t// Assume: the elements are integer, and are unique values so that the result\n\t\t// can be tested for correctness.\n\t\t// Question: are the dimensions square? i.e. row and column count are the same?\n\t\t// Assume Yes.\n\t\t// Question: Which direction should the array be rotated - Assume clockwise\n\n\t\t// Iterate from counter min to max - 1\n\t\t// Copy top row first cell into a temp variable.\n\t\t// Copy each corner into the next corner. Use temp variable to fill the last\n\t\t// corner\n\t\t// Decrement counter and perform for next set of cells\n\t\t// Repeat for inner layers.\n\n\t\t// Bounding Co-ordinates: matrix[min][min], matrix[min, max], matrix[max, max],\n\t\t// matrix[max, min]\n\t\t// Initially: min = 0, max = N-1 (i.e. 0 based array positions)\n\t\t// pos = min\n\t\t// While pos < max\n\t\t// temp = matrix[min][pos]\n\t\t// matrix[min][pos] = matrix[max - pos + min][min]\n\t\t// matrix[max - pos + min][min] = matrix[max][max - pos + min]\n\t\t// matrix[max][max - pos + min] = matrix[pos][max]\n\t\t// matrix[pos][max] = temp\n\t\t// Increment pos\n\t\t// Increment min and decrement max\n\t\t// Break when min >= max\n\t\t// For even N, the last grid will be a 2 X 2 matrix, for odd N, the last grid\n\t\t// will be a single cell\n\n\t\t// T.C. N/2 iterations of the while loop (for even N)\n\t\t// T.C. = (N - 1) + (N-3) + .. 1\n\t\t// [first calls executes 5 for loops, each N-1 times. last call executes 2*2\n\t\t// matrix. i.e. N-1 = 1]\n\t\t// = (N-1 + N-3 + .. + 1) = (N-1 + N-3 + ... + N-(N-1))\n\t\t// = (N*N/2 - (1 + 3 + .. + N-1))\n\t\t// Sum of n even no.s = n(n+1)\n\t\t// Sum of n odd no.s = N(N+1)/2 - n(n+1). Where N = Max of odd no. + 1\n\t\t// T.C. = (N*N/2 - (N(N+1)/2 - N/2 * (N/2 + 1)))\n\t\t// = ( N*N/2 - (N*N/2 + N/2 - N*N/4 - N/2)) = (N*N/4)\n\t\t// T.C = O(N*N), this is the best possible T.C as each element needs to be\n\t\t// visited once.\n\t\t// S.C. O(1)\n\n\t\tif (matrix == null || matrix.length == 0)\n\t\t\treturn;\n\n\t\tif (matrix.length != matrix[0].length)\n\t\t\tthrow new NotASquareMatrixException(\"Not a square matrix. Cannot be rotated in place.\");\n\n\t\tint min = 0;\n\t\tint max = matrix.length - 1;\n\t\tprint(matrix);\n\n\t\twhile (min < max) {\n\t\t\trotateCellsInALayer(matrix, min, max);\n\t\t\tprint(matrix);\n\t\t\tmin++;\n\t\t\tmax--;\n\t\t}\n\t}",
"public boolean percolates() {\n return uf.connected(n*n, n*n+1);\r\n }",
"private boolean testLeftDiagonal(Board board, char symbol)\n {\n for (int i = 0; i < size; i++)\n if (board.array[i][i] != symbol && board.array[i][i] != EMPTY)\n return false;\n return true;\n }",
"List<Integer> spiralOrderWalk(int[][] matrix) {\n List<Integer> result = new LinkedList<Integer>();\n int rows = matrix.length;\n if (rows == 0) {\n return result;\n }\n int cols = matrix[0].length;\n int[] dc = new int[] { 1, 0, -1, 0 };\n int[] dr = new int[] { 0, 1, 0, -1 };\n boolean[][] visited = new boolean[rows][cols];\n int dir = 0;\n int r = 0;\n int c = 0;\n while (isInside(r, c, rows, cols) && !visited[r][c]) {\n visited[r][c] = true;\n result.add(matrix[r][c]);\n int nr = r + dr[dir];\n int nc = c + dc[dir];\n if (isInside(nr, nc, rows, cols) && !visited[nr][nc]) {\n r = nr;\n c = nc;\n } else {\n dir = (dir + 1) % 4;\n r += dr[dir];\n c += dc[dir];\n }\n }\n return result;\n }",
"@Override\n\tpublic double diagonal() {\n\t\treturn getBase()*Math.sqrt(2);\n\t}",
"public static void main(String[] args) {\n boolean[][] board = new boolean[8][8];\n for(int i = 0; i < 8; i++) {\n for(int j = 0; j < 8; j++) {\n board [i][j] = false;\n }\n }\n int row = 3; //can be between -1 and 6 depending where you want first square (row - 2)\n int count = 1;\n int column = 1;\n int addedTrue = 0;\n \n while (count < 9) {\n for(int i = row + 1; i < 8; i++) { \n if(horizontal(board, i) && diagonal(board, column - 1, i)) {\n board[column - 1][i] = true;\n addedTrue++;\n break;\n } \n }\n if(addedTrue == 0) {\n column--;\n count--;\n for(int z = 0; z < 8; z++) {\n if(board[column - 1][z]) {\n row = z;\n board[column - 1][z] = false;\n }\n }\n }\n if(addedTrue == 1) {\n column++;\n count++;\n addedTrue = 0;\n row = -1;\n } \n /*printBoard(board);\n System.out.println(\"\\n\\n\");*/\n }\n printBoard(board);\n }",
"private boolean diagWin(){ \r\n\t\treturn ((checkValue (board[0][0],board[1][1],board[2][2]) == true) || \r\n\t\t\t\t(checkValue (board[0][2], board[1][1], board[2][0]) == true)); \r\n\t}",
"private Cell get_top_left_diagnoal_cell(int row, int col) {\n return get_cell(--row, --col);\n }",
"public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int n = scanner.nextInt();\n int[][] matrrix = new int[n][n];\n\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < n; j++) {\n matrrix[i][j] = scanner.nextInt();\n }\n }\n int mainDiagonal = 0, secondDiagonal = 0;\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < n; j++) {\n if (i == j) {\n mainDiagonal += matrrix[i][j];\n }\n if (Math.abs(i + j) == (n - 1)) {\n secondDiagonal += matrrix[i][j];\n }\n }\n }\n System.out.println(Math.abs(mainDiagonal - secondDiagonal));\n\n }",
"private void checkHorizontal() {\n\n for(int i = 0; i < stateArray.length; i++) {\n for (int j = 0; j < 2; j++){ // iterate only twice, because winning row\n \t // can be either 0-1-2-(3) or (0)-1-2-3\n if (check3Horizontal(i, j)){\n maskResultArray[stateArray[i][j]] = 1;\n maskArray[i][j] = 1;\n maskArray[i][j+1] = 1;\n maskArray[i][j+2] = 1;\n }\n\n }\n }\n\n }",
"public boolean percolates(){\r\n\t\treturn uf.connected(N * N, N * N + 1);\r\n\t}",
"private boolean checkLeftDiagonal(Board board, char symbol)\n {\n for (int i = 0; i < size; i++)\n if (board.array[i][i] != symbol)\n return false;\n return true;\n }",
"void ompleBlocsHoritzontals() {\r\n\r\n for (int i = 0; i < N; i = i + SRN) // for diagonal box, start coordinates->i==j \r\n {\r\n ompleBloc(i, i);\r\n }\r\n }",
"private boolean checkDiagonalForWinner(String mark,int buttonId)\n {\n \tint rows =3;\n \tint columns = 3;\n \tboolean winStatus=false;\n \tint columnNumber = buttonId%columns;\n \tint rownumber = buttonId/rows;\n \tint rowIndex= 0;\n \tint columnIndex = 0;\n \tint index;\n \tif(columnNumber==rownumber)\n \t{\n \t\t//int index; \n\t \twhile (rowIndex<rows)\n\t \t{\n\t \t\tindex = getIndex(rowIndex,columnIndex,columns);\n\t \t\tif(movesPlayed[index]!=mark|| movesPlayed[index]==\"\")\n\t \t\t{\n\t \t\t\treturn winStatus;\n\t \t\t}\n\t \t\telse\n\t \t\t{\n\t \t\t\trowIndex++;\n\t \t\t\tcolumnIndex++;\n\t \t\t}\n\t \t}\n\t \twinStatus=true;\n\t \treturn winStatus;\n \t}\n \t//Detect right to left diagonal\n \tint sum = columnNumber + rownumber;\n \tif(sum==rows-1)\n \t{\n \t\trowIndex = 0;\n \t\tcolumnIndex = columns-1;\n \t\twhile (rowIndex<rows)\n\t \t{\n\t \t\tindex = getIndex(rowIndex,columnIndex,columns);\n\t \t\tif(movesPlayed[index]!=mark|| movesPlayed[index]==\"\")\n\t \t\t{\n\t \t\t\treturn winStatus;\n\t \t\t}\n\t \t\telse\n\t \t\t{\n\t \t\t\trowIndex++;\n\t \t\t\tcolumnIndex--;\n\t \t\t}\n\t \t}\n\t \twinStatus=true;\n\t \treturn winStatus;\n \t}\n \t\n \treturn false;\n }",
"@Override\n\tpublic double calculaDiagonal() {\n\t\treturn 0;\n\t}",
"@Test\n\tpublic void testDiagonalIzquierda() {\n\n\t\ttablero.agregar(0, 0, jugador1);\n\t\ttablero.agregar(1, 2, jugador1);\n\t\ttablero.agregar(2, 1, jugador1);\n\n\t\tassertEquals(jugador1.getPieza(), reglas.getGanador(jugador1));\n\t}",
"private boolean winsByDiagonalTopRightToBottomLeft(char symbol){\n int max_diagonal_count = 0;\n\n // Iterates through diagonals from top right to bottom left\n for(int k = 0 ; k <= this.boardColumns - 1 + this.boardRows - 1; k++) {\n\n // Reset counter for each new diagonal\n int count = 0;\n\n // Iterates through values in the diagonal. The sum of their indices is equal to k (the index\n // of the column) so we can easily calculate i by iterating through j (up to and equal to k) and subtracting\n // j from k to get i.\n for(int j = 0 ; j <= k ; j++) {\n int i = k - j;\n\n // If i surpasses the number of available rows or j surpasses the number of available columns, we\n // break out the inner for loop. This happens when the num of rows and cols in the array are different\n if (i >= this.boardRows || j >= this.boardColumns){\n continue;\n }\n // Check if char symbol is equal to the element in the diagonal. If so, we increment count by 1 and update\n // max_diagonal_count if possible.\n if (symbol == this.gameBoard[i][j]){\n count+=1;\n if (count>max_diagonal_count){\n max_diagonal_count = count;\n }\n }\n // Otherwise, we reset the counter to 0\n else {\n count =0;\n }\n }\n }\n\n // If the max_diagonal_count is greater than or equal to tilesNeeded, then we have sufficient tiles in a diagonal\n // for char symbol to win so we return true. Otherwise, we return false.\n if (max_diagonal_count >= this.tilesNeeded){\n return true;\n }\n else {\n return false;\n }\n\n }",
"public boolean percolates() {\n \treturn weigtedJoin.connected(N * N, N * N + 1);\n }",
"public boolean percolates() {\n\t\treturn linearGrid.connected(0, 1);\n\t}",
"public static long cross_hatched(long W, long H) {\r\n long sum = 0;\r\n \r\n // horizontals\r\n for (long w = 1L; w <= W; w++) {\r\n for (long h = 1L; h <= H; h++) {\r\n sum += (W - w + 1) * (H - h + 1);\r\n //System.out.println(\"hSuma (\" + w + \"x\" + h + \") = \" + ((W - w + 1) * (H - h + 1))); \r\n }\r\n }\r\n \r\n // Diagonals\r\n for (long n = 1L; n <= Math.min(W, H) * 2; n++) {\r\n for (long m = 1L; m <= n; m++) {\r\n double ancho_alto = (n + m) / 2.0;\r\n\r\n // Ancho diagonal impar\r\n if (n % 2 == 1) {\r\n // empieza en Y = 0\r\n double cabenx = Math.floor(W - 0.5 - ancho_alto + 1);\r\n double cabeny = Math.floor(H - ancho_alto + 1);\r\n if (cabenx > 0.0 && cabeny > 0.0) {\r\n sum += cabenx * cabeny * ((n != m) ? 2 : 1);\r\n } \r\n // empieza en Y = 0.5\r\n cabenx = Math.floor(W - ancho_alto + 1);\r\n cabeny = Math.floor(H - 0.5 - ancho_alto + 1);\r\n if (cabenx > 0.0 && cabeny > 0.0) {\r\n sum += cabenx * cabeny * ((n != m) ? 2 : 1);\r\n }\r\n }\r\n // Ancho diagonal par\r\n else {\r\n // Empieza en Y = 0\r\n double cabenx = Math.floor(W - ancho_alto + 1);\r\n double cabeny = Math.floor(H - ancho_alto + 1);\r\n if (cabenx > 0.0 && cabeny > 0.0) {\r\n sum += cabenx * cabeny * ((n != m) ? 2 : 1);\r\n } \r\n // Empieza en Y = 0.5\r\n cabenx = Math.floor(W - 0.5 - ancho_alto + 1);\r\n cabeny = Math.floor(H - 0.5 - ancho_alto + 1);\r\n if (cabenx > 0.0 && cabeny > 0.0) {\r\n sum += cabenx * cabeny * ((n != m) ? 2 : 1);\r\n } \r\n }\r\n }\r\n }\r\n // Diagonals squared\r\n System.out.println(\"Suma (\" + W + \"x\" + H + \") = \" + sum);\r\n return sum;\r\n }",
"static int diagonalDifference(int[][] arr) {\n return Math.abs(leftDiagonalSum(arr) - rightDiagonalSum(arr));\n }",
"private boolean diagonalMatches(int player, boolean isFirst){\n int x = 0;\n int y = isFirst ? 0 : this.gameField.length() - 1;\n int increment = isFirst ? 1 : -1;\n\n boolean result = true;\n\n for (int i = 0; i < this.gameField.length(); i++) {\n if (this.gameField.getValue(x, y) != player){\n result = false;\n break;\n }\n x++;\n y = y + increment;\n }\n return result;\n }",
"public boolean percolates() {\n\t\treturn cellTree.connected(side * side, side * side + 1);\n\t}",
"public boolean isLegalDiag(MoveDirection dir){\r\n GamePosition curPos = currentGame.getCurrentPosition();\n\t\tPlayer white = currentGame.getWhitePlayer();\n\t\t\n\t\tPlayer toMove;\n\t\tPlayer oppo;\n\n\t\tint col, row;\n\t\tif(curPos.getPlayerToMove().equals(white)) {\n\t\t\n\t\t\tcol = curPos.getWhitePosition().getTile().getColumn();\n\t\t\trow = curPos.getWhitePosition().getTile().getRow();\n\t\t\t\n\t\t\ttoMove = white;\n\t\t\toppo = currentGame.getBlackPlayer();\n\t\t} else {\n\t\t\tcol = curPos.getBlackPosition().getTile().getColumn();\n\t\t\trow = curPos.getBlackPosition().getTile().getRow();\n\t\t\t\n\t\t\toppo = white;\n\t\t\ttoMove = currentGame.getBlackPlayer();\n\t\t}\n\t\t\n\t\tif (dir == MoveDirection.NorthEast) {\n\t\t\tif(col==9 || row ==1) return false;\n\t\t} else if(dir == MoveDirection.NorthWest) {\n\t\t\tif(col==1 || row ==1) return false;\n\t\t} else if(dir == MoveDirection.SouthEast) {\n\t\t\tif(col==9 || row ==9) return false;\n\t\t} else if(dir == MoveDirection.SouthWest) {\n\t\t\tif(col==1 || row ==9) return false;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\n\t\t//Tiles are drawn by row then by column. 0= row1 col1, \n\t\t\n\t\t//Checking the has opponent first\n\t\tboolean correct = false;\n\t\t//Check down\n\t\tif(QuoridorController.hasOpponent(1, 0)) {\n\t\t\tif(QuoridorController.noWallBlock(toMove, 1, 0)) {\n\t\t\t\tif(QuoridorController.noWallBlock(oppo, 1, 0) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t} else {\n\t\t\t\t\tif(QuoridorController.noWallBlock(oppo, 0, -1)) {\n\t\t\t\t\t\t//Jump diagonal- check left\n\t\t\t\t\t\tif(dir == MoveDirection.SouthWest) return true;\n\t\t\t\t\t\t\n\t\t\t\t\t} \n\t\t\t\t\tif(QuoridorController.noWallBlock(oppo, 0, 1)) {\n\t\t\t\t\t\t//Jump diagonal- check right\n\t\t\t\t\t\tif(dir == MoveDirection.SouthEast) return true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} \n\t\t//Check up\n\t\t} else if(QuoridorController.hasOpponent(-1, 0)) {\n\t\t\tif(QuoridorController.noWallBlock(toMove, -1, 0)) {\n\t\t\t\tif(QuoridorController.noWallBlock(oppo, -1, 0) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t} else {\n\t\t\t\t\tif(QuoridorController.noWallBlock(oppo, 0, -1)) {\n\t\t\t\t\t\t//Jump diagonal- check left\n\t\t\t\t\t\tif(dir == MoveDirection.NorthWest) return true;\n\t\t\t\t\t\t\n\t\t\t\t\t} \n\t\t\t\t\tif(QuoridorController.noWallBlock(oppo, 0, 1)) {\n\t\t\t\t\t\t//Jump diagonal- check right\n\t\t\t\t\t\tif(dir == MoveDirection.NorthEast) return true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} \n\t\t//Check right\n\t\t} else if(QuoridorController.hasOpponent(0, 1)) {\n\t\t\tif(QuoridorController.noWallBlock(toMove, 0, 1)) {\n\t\t\t\tif(QuoridorController.noWallBlock(oppo, 0, 1) ) {\n\t\t\t\t\t//Jump straight allowed\n\t\t\t\t\treturn false;\t\n\t\t\t\t} else {\n\t\t\t\t\tif(QuoridorController.noWallBlock(oppo, -1, 0)) {\n\t\t\t\t\t\t//Jump diagonal- check up\n\t\t\t\t\t\tif(dir == MoveDirection.NorthEast) return true;\n\t\t\t\t\t} \n\t\t\t\t\tif(QuoridorController.noWallBlock(oppo, 1, 0)) {\n\t\t\t\t\t\t//Jump diagonal- check down\n\t\t\t\t\t\tif(dir == MoveDirection.SouthEast) return true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t//Check left\n\t\t} else if(QuoridorController.hasOpponent(0, -1)) {\n\t\t\tif(QuoridorController.noWallBlock(toMove, 0, -1)) {\n\t\t\t\tif(QuoridorController.noWallBlock(oppo, 0, -1) ) {\n\t\t\t\t\t//Jump straight allowed\n\t\t\t\t\treturn false;\n\t\t\t\t} else {\n\t\t\t\t\tif(QuoridorController.noWallBlock(oppo, -1, 0)) {\n\t\t\t\t\t\t//Jump diagonal- check up\n\t\t\t\t\t\tif(dir == MoveDirection.NorthWest) return true;\n\t\t\t\t\t} \n\t\t\t\t\tif(QuoridorController.noWallBlock(oppo, 1, 0)) {\n\t\t\t\t\t\t//Jump diagonal- check down\n\t\t\t\t\t\tif(dir == MoveDirection.SouthWest) return true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\r\n }",
"public static void spiralTraversalAlternate(int[][] input){\n int k = 0;\n int l = 0;\n int m = input.length - 1;\n int n = input[0].length - 1;\n while(k <= m && l <= n){\n for(int j = l ; j <= n ; j++){\n System.out.print(input[k][j] + \" \");\n }\n k++;\n for(int i = k; i <= m ; i++){\n System.out.print(input[i][n] + \" \");\n }\n n--;\n if(k <= m){\n for(int j = n ; j >= l ; j--){\n System.out.print(input[m][j] + \" \");\n }\n m--;\n }\n if(l <= n){\n for(int i = m; i >= k; i--){\n System.out.print(input[i][l] + \" \");\n }\n l++;\n }\n }\n }",
"public boolean percolates() {\n return myUF.connected(n*n, n*n + 1);\n }",
"public Square[] adjacentCells() {\n\t\tArrayList<Square> cells = new ArrayList <Square>();\n\t\tSquare aux;\n\t\tfor (int i = -1;i <= 1; i++) {\n\t\t\tfor (int j = -1; j <= 1 ; j++) {\n\t\t\t\taux = new Square(tractor.getRow()+i, tractor.getColumn()+j); \n\t\t\t\tif (isInside(aux) && abs(i+j) == 1) { \n\t\t\t\t\tcells.add(getSquare(aux));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn cells.toArray(new Square[cells.size()]);\n\t}",
"public static boolean AIWinOnDiagonal(char[][] displayBoard, char c) {\r\n\t\tboolean b = false;\r\n\t\tint n = displayBoard.length;//n is the length of the array\r\n\t\tchar[] diagonal1 = new char[displayBoard.length];//build a 1 dimensional array, and it's length equal to n\r\n\t\t//when the diagonal is from top left to bottom right\r\n\t\tfor(int i=0; i<displayBoard.length; i++) {\r\n\t\t\t\tdiagonal1[i] = displayBoard[i][i];\r\n\t\t\t\tint countO = countCharacters(diagonal1, 'o');//number of 'o' in a diagonal\r\n\t\t\t\tint countX = countCharacters(diagonal1, 'x');//number of 'x' in a diagonal\r\n\t\t\t\tif(countO==n-1&&countX==0) {\r\n\t\t\t\t\tb = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\tif(b==true) {\r\n\t\t\t\tint numCell = lookForCell(diagonal1);//find an empty cell in a diagonal\r\n\t\t\t\twriteOnBoard(displayBoard, c, numCell, numCell);//put the character in the empty cell\r\n\t\t\t\treturn b;\r\n\t\t\t\t}\r\n\t\t\t\tdiagonal1 = new char[displayBoard.length];\r\n\t\t//when the diagonal is from top right to bottom left\r\n\t\tchar[] diagonal2 = new char[displayBoard.length];\r\n\t\tfor(int i=0; i<displayBoard.length; i++) {\r\n\t\t\t\tdiagonal2[i] = displayBoard[i][displayBoard.length-1-i];\r\n\t\t\t\tint countO = countCharacters(diagonal2, 'o');//number of 'o' in a diagonal\r\n\t\t\t\tint countX = countCharacters(diagonal2, 'x');//number of 'x' in a diagonal\r\n\t\t\t\tif(countO==n-1&&countX==0) {\r\n\t\t\t\t\tb = true;\r\n\t\t\t\t}\r\n\t\t}\r\n\t\t\t\tif(b==true) {\r\n\t\t\t\tint numCell = lookForCell(diagonal2);//find an empty cell in a diagonal\r\n\t\t\t\twriteOnBoard(displayBoard, c, numCell, displayBoard.length-numCell-1);//put the character in the empty cell\r\n\t\t\t\treturn b;\r\n\t\t\t\t}\r\n\t\t\t\tdiagonal2 = new char[displayBoard.length];\r\n\t\treturn b;//return the value of b\r\n\t}",
"@Override\n\tpublic List<Cell> calcNeighbors(int row, int col) {\n\t\tList<Cell> neighborLocs = new ArrayList<>();\n\t\tint shift_constant = 1 - 2*((row+col) % 2);\n\t\tif(!includesDiagonals) {\n\t\t\tfor(int a = col - 1; a <= col + 1; a++) {\n\t\t\t\tif(a == col)\n\t\t\t\t\taddLocation(row + shift_constant,a,neighborLocs);\n\t\t\t\telse \n\t\t\t\t\taddLocation(row,a,neighborLocs);\n\t\t\t}\n\t\t\treturn neighborLocs;\n\t\t}\n\t\tfor(int b = col - 2; b <= col + 2; b++) {\n\t\t\tfor(int a = row; a != row + 2*shift_constant; a += shift_constant) {\n\t\t\t\tif(a == row && b == col)\n\t\t\t\t\tcontinue;\n\t\t\t\taddLocation(a,b,neighborLocs);\n\t\t\t}\n\t\t}\n\t\tfor(int b = col -1; b <= col + 1; b++) {\n\t\t\taddLocation(row - shift_constant,b,neighborLocs);\n\t\t}\n\t\treturn neighborLocs;\n\t}",
"public AntiClockwiseSpiralIterator(E[][] array){\n list = new ArrayList<E>();\n row = array.length;\n column = array[0].length;\n\n int total = row * column;\n int counter = 0;\n\n while(x < row && y < column){\n if(counter == total)\n break;\n\n for(int i = x; i < row; ++i){\n list.add(array[i][y]);\n counter++;\n }\n y++;\n\n if(counter == total)\n break;\n\n for(int i = y; i < column; ++i){\n list.add(array[row-1][i]);\n counter++;\n }\n row--;\n\n if(counter == total)\n break;\n\n if(x < row){\n for(int i = row-1; i >= x; --i){\n list.add(array[i][column-1]);\n counter++;\n }\n column--;\n }\n\n if(counter == total)\n break;\n\n if(y < column){\n for(int i = column-1; i >= y; --i){\n list.add(array[x][i]);\n counter++;\n }\n x++;\n }\n }\n\n iterator = list.iterator();\n }",
"private static long sumOfDiagonalsInSquareSpiral(int m) {\n assert m % 2 == 1 : \"Square matrix must be of odd numbered size!\";\n long sum = 0;\n final List<Integer> coefficients = Lists.newArrayList(4, 3, 8, -9);\n final int denominator = 6;\n for (int coefficient : coefficients) {\n sum = sum * m + coefficient;\n }\n return sum / denominator;\n }",
"public boolean isDiagonal(CoordinateImpl coordinate) {\n return Math.abs(coordinate.rank - rank) == Math.abs(coordinate.file - file);\n }",
"private boolean checkDiagonals(final int posLine, final int posColumn, final int boardIcon, final int incLine, final int incColumn) {\n\t\tboolean validTop = false;\n\t\tboolean validBottom = false;\n\t\tvalidTop = checkDiagonalsAux(posLine, posColumn, boardIcon, incLine, incColumn);\n\t\tvalidBottom = checkDiagonalsAux(posLine, posColumn, boardIcon, incLine * -1, incColumn * -1);\n\t\treturn validTop && validBottom;\n\t}",
"public boolean checkDiagonal1(int column, int row, Array a){\n\t\tfor(int i = 0; i < word.length; i++){\n\t\t\tif(a.getCharAt(column + i, row + i) != ' ' && a.getCharAt(column + i, row + i) != word[i]){\n\t\t\t\treturn false;\n\t\t\t}\t\n\t\t}\n\t\treturn true;\n\t}",
"static boolean checkForDiagonalPositions(int i, int j, String[][] board, boolean playerWins) {\r\n\t\tif ((board[i][j].equals(board[0][2]) && board[0][2].equals(\"*\") && board[i][j].equals(board[1][1])\r\n\t\t\t\t&& board[1][1].equals(\"*\") && board[i][j].equals(board[2][0]) && board[2][0].equals(\"*\"))\r\n\t\t\t\t|| (board[i][j].equals(board[0][0]) && board[0][0].equals(\"*\") && board[i][j].equals(board[1][1])\r\n\t\t\t\t\t\t&& board[1][1].equals(\"*\") && board[i][j].equals(board[2][2]) && board[2][2].equals(\"*\"))) {\r\n\t\t\tplayerWins = true;\r\n\t\t}\r\n\t\treturn playerWins;\r\n\t}",
"private Cell scanFirstDiagonal(Figure value) {\n Figure oppositeValue = game.getOppositeFigure(value);\n int emptyString = 0;\n int emptyRow = 0;\n int emptyCnt = 0;\n int row = 0;\n for (int string = 0; string < game.getFieldSize(); string++) {\n Figure fieldValue = game.getFieldValue(string,row);\n if (fieldValue.equals(oppositeValue)) {\n emptyCnt = 0;\n break;\n } else if (fieldValue.equals(EMPTY)) {\n emptyCnt++;\n emptyRow = row;\n emptyString = string;\n }\n row++;\n }\n if (emptyCnt == 1) {\n return new Cell(emptyString, emptyRow);\n }\n return scanSecondDiagonal(value);\n }",
"public int[] findDiagonalOrder(int[][] matrix) {\n if (matrix == null || matrix.length == 0) {\n return new int[0];\n }\n\n int mRows, nCols;\n mRows = matrix.length;\n nCols = matrix[0].length;\n\n int[] result = new int[mRows * nCols];\n int x = 0, y = 0; // current coordinates for traversing in matrix\n int direction = 0; // 0: top right, 1: bottom left\n\n // used for moving left, right, down and top\n // fancy way but very systematic\n int[][] delta = { { -1, 1 }, { 1, -1 } };\n\n for (int i = 0; i < mRows * nCols; i++) {\n // store current\n result[i] = matrix[x][y];\n\n // update x and y\n x += delta[direction][0];\n y += delta[direction][1];\n\n // handle cases where we hit edges\n if (x >= mRows) {\n x = mRows - 1;\n y += 2;\n direction = flipDirection(direction);\n }\n\n if (y >= nCols) {\n y = nCols - 1;\n x += 2;\n direction = flipDirection(direction);\n }\n\n if (x < 0) {\n x = 0;\n direction = flipDirection(direction);\n }\n\n if (y < 0) {\n y = 0;\n direction = flipDirection(direction);\n }\n }\n return result;\n }",
"public boolean isSelfCrossing(int[] x) {\n for(int i = 0; i <= x.length - 1; i ++){\n // Case 1 where arrow i goes across arrow i - 3\n if(i >= 3 && x[i] >= x[i - 2] && x[i - 1] <= x[i - 3]) return true;\n // Case 2 where arrow i goes across arrow i - 4\n if(i >= 4 && x[i] + x[i - 4] >= x[i - 2] && x[i - 1] == x[i - 3]) return true;\n // Case 3 where arrow goes across arrow i - 5\n if(i >= 5 && x[i - 1] + x[i - 5] >= x[i - 3] && x[i] + x[i - 4] >= x[i - 2]\n && x[i - 2] >= x[i - 4] && x[i - 1] <= x[i - 3]) return true;\n }\n return false;\n }",
"public static void main(String[] args) {\n // **\r\n\r\n int rows = 6;\r\n int columns = 4;\r\n int i;\r\n int j;\r\n\r\n for (i = 1; i <= rows; i++) {\r\n //System.out.print(\"*\");\r\n //this inner loop runs its course (completely) for EACH TIME the outer loop runs.\r\n for (j = 1; j <= columns; j++) {\r\n if (j == 1 || j == columns || i == 1 || i == rows) {\r\n System.out.print(\"*\");\r\n } else\r\n System.out.print(\"#\");\r\n }\r\n //System.out.print(\"*\");\r\n System.out.println();\r\n }\r\n }",
"public static int diagonalDifference(List<List<Integer>> arr) {\n int pDia = 0;\n int sDia = 0;\n int counter = arr.size();\n for (int i = 0; i < arr.size(); i++) {\n List<Integer> row = arr.get(i);\n\n pDia = pDia + row.get(i);\n counter = counter-1;\n sDia = sDia + row.get(counter);\n }\n return Math.abs(pDia-sDia) ;\n }",
"public static boolean diagonalJudge(String playerMarker, int row, int column){\n\n boolean victoryFlag = false;\n\n int subRow = 0;\n int subColumn = 0;\n int victoryCounter = 0;\n\n // Checking first Diagonal\n // North West\n\n subRow = row;\n subColumn = column;\n\n // Store the player's latest move's coordinates\n\n winList.add(subColumn);\n winList.add(subColumn);\n\n while ( subRow >= 0 && subColumn >= 0 && !victoryFlag ){\n\n subRow--;\n subColumn--;\n\n if ( subRow >= 0 && subColumn >= 0 ){\n\n if ( gameBoard[subRow][subColumn].equals(playerMarker) ){\n winList.add(subRow);\n winList.add(subColumn);\n victoryCounter++;\n\n if ( victoryCounter == 3){\n victoryFlag = true;\n }\n }\n\n else{\n break;\n }\n }\n }\n\n // South East\n\n subRow = row;\n subColumn = column;\n\n while ( subRow < 6 && subColumn < 7 && !victoryFlag ){\n\n subRow++;\n subColumn++;\n\n if ( subRow < 6 && subColumn < 7 ){\n\n if ( gameBoard[subRow][subColumn].equals(playerMarker) ){\n winList.add(subRow);\n winList.add(subColumn);\n victoryCounter++;\n\n if ( victoryCounter == 3){\n victoryFlag = true;\n }\n }\n\n else{\n break;\n }\n }\n }\n\n if ( !victoryFlag ){\n winList.clear(); // reset the list, if no one won\n }\n else{\n winDirection = \"Left Diagonal\";\n }\n\n // Checking the other diagonal\n // North East\n\n victoryCounter = 0;\n subRow = row;\n subColumn = column;\n winList.add(subRow);\n winList.add(subColumn);\n\n while ( subRow >= 0 && subColumn < 7 && !victoryFlag ){\n\n subRow--;\n subColumn++;\n\n if ( subRow >= 0 && subColumn < 7 ){\n\n if ( gameBoard[subRow][subColumn].equals(playerMarker) ){\n winList.add(subRow);\n winList.add(subColumn);\n victoryCounter++;\n\n if ( victoryCounter == 3){\n winDirection = \"Right Diagonal\";\n victoryFlag = true;\n }\n }\n\n else{\n break;\n }\n }\n }\n\n // South East\n\n subRow = row;\n subColumn = column;\n\n while ( subRow < 6 && subColumn >= 0 && !victoryFlag ){\n\n subRow++;\n subColumn--;\n\n if ( subRow <= 5 && subColumn >= 0 ){\n\n if ( gameBoard[subRow][subColumn].equals(playerMarker) ){\n winList.add(subRow);\n winList.add(subColumn);\n victoryCounter++;\n\n if ( victoryCounter == 3){\n winDirection = \"Right Diagonal\";\n victoryFlag = true;\n }\n }\n\n else{\n break;\n }\n }\n }\n\n if ( !victoryFlag ){\n winList.clear();\n }\n\n return victoryFlag;\n }",
"public boolean percolates() {\n for (int i = 0; i < size; i++) {\r\n if (flowGrid[size * (size - 1) + i] < size) { // if any of the bottom row points at any of the index in the top row\r\n return true;\r\n }\r\n }\r\n return false;\r\n }",
"public static boolean userWinOnDiagonal(char[][] displayBoard, char c) {\r\n\t\t\tboolean b = false;\r\n\t\t\tint n = displayBoard.length;//n is the length of the array\r\n\t\t\tchar[] diagonal1 = new char[displayBoard.length];//let the length of new 1 dimensional array equals to n\r\n\t\t\t//when the diagonal is from top left to bottom right\r\n\t\t\tfor(int i=0; i<displayBoard.length; i++) {\r\n\t\t\t\t\tdiagonal1[i] = displayBoard[i][i];\r\n\t\t\t\t\tint countO = countCharacters(diagonal1, 'o');//number of 'o' in a diagonal\r\n\t\t\t\t\tint countX = countCharacters(diagonal1, 'x');//number of 'x' in a diagonal\r\n\t\t\t\t\tif(countX==n-1&&countO==0) {\r\n\t\t\t\t\t\tb = true;\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\t\tif(b==true) {\r\n\t\t\t\t\tint numCell = lookForCell(diagonal1);//find an empty cell in a diagonal\r\n\t\t\t\t\twriteOnBoard(displayBoard, c, numCell, numCell);//put the character in the empty cell\r\n\t\t\t\t\treturn b;\r\n\t\t\t\t\t}\r\n\t\t\t\r\n\t\t\t//when the diagonal is from top right to bottom left\r\n\t\t\tchar[] diagonal2 = new char[displayBoard.length];\r\n\t\t\tfor(int i=0; i<displayBoard.length; i++) {\r\n\t\t\t\t\tdiagonal2[i] = displayBoard[i][displayBoard.length-1-i];\r\n\t\t\t\t\tint countO = countCharacters(diagonal2, 'o');//number of 'o' in a diagonal\r\n\t\t\t\t\tint countX = countCharacters(diagonal2, 'x');//number of 'x' in a diagonal\r\n\t\t\t\t\tif(countX==n-1&&countO==0) {\r\n\t\t\t\t\t\tb = true;\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\t\tif(b==true) {\r\n\t\t\t\t\tint numCell = lookForCell(diagonal2);//find an empty cell in a diagonal\r\n\t\t\t\t\twriteOnBoard(displayBoard, c, numCell, displayBoard.length-1-numCell);//put the character in the empty cell\r\n\t\t\t\t\treturn b;\r\n\t\t\t\t\t}\r\n\t\t\treturn b;\t\r\n\t\t}",
"private boolean hayRayaHorizontal() {\n for (Casilla[] casilla : casillas) {\n if (linea(casilla))\n return true;\n }\n\n return false;\n }",
"public int downwardRightDiag(int row, int col) {\n\t\tint count = 0;\n\t\tfor(int i = 0; i < board.length; i++) {\n\t\t\t\n\t\t\tif(row >= 0 && row < 8 && col >=0 && col <8) {\n\t\t\t\t\n\t\t\t\tif(board[row][col] != 1)\n\t\t\t\t\tcount++;\n\t\t\t\n\t\t\t\trow++; col++;\n\t\t\t}\n\t\t}\n\t\n\t\treturn count -1;\n\n\t\t\n\t}",
"private boolean checkBottomLeftUpDiag(char playerSymbol) {\n int i = 0;\n for (int j = N - 1; j >= 0; j--) {\n if (grid[j][i].getSymbol() != playerSymbol)\n return false;\n i++;\n }\n return true;\n }",
"public boolean percolates(){\n\t //special case for n=1:\n\t if(n==1 && numOpen==0){\n\t return false;\n\t }\n\t //this seems very inefficient.. maybe fix\n\t //way to prevent backwash\n\t for(int i= (n*n -n)+1; i <= n*n; i++){\n\t if(grid.connected(0, i)){\n\t return true;\n\t }\n\t }\n\t\treturn false;\n\t}",
"public static List<Integer> spiralTraverse(int[][] array) {\n List<Integer> result = new ArrayList<>();\n int row, r=0, R=array.length-1;\n int col, c=0, C=array[0].length-1;\n\n while(r<=R && c<=C) {\n for(col=c; col<=C; col++) {\n result.add(array[r][col]);\n }\n\n for(row=r+1; row<=R; row++) {\n result.add(array[row][C]);\n }\n\n for(col=C-1; col>=c; col--) {\n if(r==R) {\n break;\n }\n result.add(array[R][col]);\n }\n\n for(row=R-1; row>r; row--) {\n if(c==C) {\n break;\n }\n result.add(array[row][c]);\n }\n\n r++;\n c++;\n R--;\n C--;\n }\n\n return result;\n }",
"public boolean percolates() {\n // bottom row (grid[n - 1][0] ... grid[n - 1][n - 1])\n for (int j = 1; j <= size; j++) {\n // StdOut.println(\"j: \"+j+\" isOpen: \"+ isOpen(size, j) +\n // \" isFull: \" + isFull(size, j));\n if (isFull(size, j)) {\n return true;\n }\n }\n return false;\n }",
"private static void printInCircle(ArrayList<Integer> list, int[][] matrix, int rows, int cols, int index) {\n if (rows <= 0 || cols <= 0) {\n return;\n }\n\n int endX = cols - 1 - index;\n int endY = rows - 1 - index;\n // from left to right\n for (int i = index; i <= endX; i++) {\n list.add(matrix[index][i]);\n }\n // if print up to down, there must be more than 1 rows(endY - index)>=1\n // from up to down\n if ((endY - index) >= 1) {\n for (int i = index + 1; i <= endY; i++) {\n list.add(matrix[i][endX]);\n }\n }\n // if print right to left, there must be more than 1 rows(endY - index) >= 1 and more than 1 cols (endX - index) >= 1\n // from right to left\n if ((endY - index) >= 1 && (endX - index) >= 1) {\n for (int i = endX - 1; i >= index; i--) {\n list.add(matrix[endY][i]);\n }\n }\n // if print down to up, there must be more than 2 rows(endY - index)>=2 and more than 1 cols (endX - index) >= 1\n // from down to up\n if ((endY - index) >= 2 && (endX - index) >= 1) {\n for (int i = endY - 1; i > index; i--) {\n list.add(matrix[i][index]);\n }\n }\n }",
"public static int find_land (int a [][], int x, int y){\r\n int count_land = 0;\r\n for (int i = 0; i < x; i++){\r\n for (int j = 0; j < y; j++){\r\n if (a[i][j] > 0){\r\n count_land ++;\r\n //x[i][j] = 0;\r\n check_island(i, j);\r\n }\r\n }\r\n }\r\n return count_land;\r\n }",
"@Override\n\tpublic List<Cell> getDiagonalNeighbors(Cell cell) {\n\t\tList<Cell> neighbors = new ArrayList<Cell>();\n\t\tint northEast, northWest, southEast, southWest;\n\t\t\n\t\tnorthEast = getNorthEastCell(cell);\n\t\tnorthWest = getNorthWestCell(cell);\n\t\tsouthEast = getSouthEastCell(cell);\n\t\tsouthWest = getSouthWestCell(cell);\n\t\t\n\t\tif (northEast != -1) { neighbors.add(getCellList().get(northEast)); }\n\t\tif (northWest != -1) { neighbors.add(getCellList().get(northWest)); }\n\t\tif (southEast != -1) { neighbors.add(getCellList().get(southEast)); }\n\t\tif (southWest != -1) { neighbors.add(getCellList().get(southWest)); }\n\t\t\n\t\treturn neighbors;\n\t}",
"public static void test(String args[]) {\n int[][] input = {{1,1,1,1,1,1,1,0},{1,0,0,0,0,1,1,0},{1,0,1,0,1,1,1,0},{1,0,0,0,0,1,0,1},{1,1,1,1,1,1,1,0}};\n int[][] input2 = {{0,0,1,0,0},{0,1,0,1,0},{0,1,1,1,0}};\n int[][] input3 = {{1,1,1,1,1,1,1},\n {1,0,0,0,0,0,1},\n {1,0,1,1,1,0,1},\n {1,0,1,0,1,0,1},\n {1,0,1,1,1,0,1},\n {1,0,0,0,0,0,1},\n {1,1,1,1,1,1,1}};\n System.out.println(closedIsland(input));\n System.out.println(closedIsland(input2));\n System.out.println(closedIsland(input3));\n }",
"@Override\n\tpublic boolean linear(InternalCoordinate c) {\n\t\tif (x == c.getX()) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// The two diagonals\n\t\tint tmpx = x;\n\t\tint tmpy = y;\n\t\tif (isDown(x, y)) {\n\t\t\t// Down right\n\t\t\tif (c.getY() > y) {\n\t\t\t\twhile (tmpx > c.getX() || tmpy < c.getY()) {\n\t\t\t\t\ttmpx += isDown(tmpx, tmpy) ? 0 : -1;\n\t\t\t\t\ttmpy += isDown(tmpx, tmpy) ? 1 : 0;\n\t\t\t\t\t\n\t\t\t\t\tif (tmpx == c.getX() && tmpy == c.getY()) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\t//Down left\n\t\t\t} else if (c.getY() < y) {\n\t\t\t\twhile (tmpx > c.getX() || tmpy > c.getY()) {\n\t\t\t\t\ttmpx += isDown(tmpx, tmpy) ? 0 : -1;\n\t\t\t\t\ttmpy += isDown(tmpx, tmpy) ? -1 : 0;\n\t\t\t\t\t\n\t\t\t\t\tif (tmpx == c.getX() && tmpy == c.getY()) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t} else {\n\t\t\t// Up right\n\t\t\tif (c.getY() > y) {\n\t\t\t\twhile (tmpx < c.getX() || tmpy < c.getY()) {\n\t\t\t\t\ttmpx += isDown(tmpx, tmpy) ? 1 : 0;\n\t\t\t\t\ttmpy += isDown(tmpx, tmpy) ? 0 : 1;\n\t\t\t\t\t\n\t\t\t\t\tif (tmpx == c.getX() && tmpy == c.getY()) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\t//Up left\n\t\t\t} else if (c.getY() < y) {\n\t\t\t\twhile (tmpx < c.getX() || tmpy > c.getY()) {\n\t\t\t\t\ttmpx += isDown(tmpx, tmpy) ? 1 : 0;\n\t\t\t\t\ttmpy += isDown(tmpx, tmpy) ? 0 : -1;\n\t\t\t\t\t\n\t\t\t\t\tif (tmpx == c.getX() && tmpy == c.getY()) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t\t\n\t\treturn false;\n\t}",
"public boolean diagonalRight(){\n\t\t\r\n\t\tfor (int j = 1; j < Board.length-1; j++){\r\n\t\t\t\tint k = j-1;\t\t\t\t\r\n\t\t\t\tif (Board[j][k].charAt(2) != Board[j+1][k+1].charAt(2))\r\n\t\t\t\t\tbreak;\r\n\t\t\t\telse if (Board[j][k].charAt(2) == '_')\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tif ((j == Board.length-2) && (k == Board.length-3)){\r\n\t\t\t\t\tthis.winner = Board[j][k].charAt(2);\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public boolean percolates() {\n\t\tint top = uf.find(0);\n\t\tint bottom = uf.find(size * size + 1);\n\t\treturn top == bottom;\n\t}",
"public boolean percolates(){\n return uf.connected(ufSize - 2, ufSize - 1);\n }",
"public static void m11() {\r\n\tint size =4;\r\n\tfor(int i=size;i>=-size;i--) {\r\n\t\t\r\n\t\tfor(int j=1;j<=Math.abs(i);j++) {\r\n\t\t\t System.out.print(\" \");\r\n\t\t }\r\n\t\tchar ch = 'A';\r\n\t\tfor(int k =size;k>=Math.abs(i) ;k--) {\r\n\t\t\tSystem.out.print(ch);\r\n\t\t\tch++;\r\n\t\t}\r\n\t\t System.out.println();\r\n\t}\r\n}",
"public boolean checkDiagonal2(int column, int row, Array a){\n\t\tfor(int i = 0; i < word.length; i++){\n\t\t\tif(a.getCharAt(column + i, row - i) != ' ' && a.getCharAt(column + i, row - i) != word[i]){\n\t\t\t\treturn false;\n\t\t\t}\t\n\t\t}\n\t\treturn true;\n\t}",
"public static int noDiagSum(int[][] a) {\r\n\t\tint rowNum = a.length;\r\n\t\tint colNum = a[0].length;\r\n\t\tint sum = 0;\r\n\t\tfor (int i = 0; i < rowNum; i++) {\r\n\t\t\tfor (int j = 0; j < colNum; j++) {\r\n\t\t\t\tif (i != j) {\r\n\t\t\t\t\tsum += a[i][j];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn sum;\r\n\t}",
"private static void checkDiagonals(int pos, int color) {\n check(1, pos, ColorFrames.BOARD_DIM + 1, color);\n check(ColorFrames.BOARD_DIM, pos, ColorFrames.BOARD_DIM - 1, color);\n }"
] | [
"0.64345443",
"0.6360097",
"0.63319933",
"0.62240547",
"0.6221835",
"0.6194357",
"0.6178562",
"0.61449414",
"0.61132514",
"0.6099488",
"0.60666794",
"0.6051031",
"0.5979004",
"0.5922812",
"0.59095216",
"0.58799237",
"0.58695024",
"0.5839167",
"0.5837347",
"0.58357286",
"0.5809122",
"0.5797556",
"0.578009",
"0.5713099",
"0.57101566",
"0.57043374",
"0.5703687",
"0.56907",
"0.5672901",
"0.5667921",
"0.5666205",
"0.56443495",
"0.56441915",
"0.56065696",
"0.55964947",
"0.5595698",
"0.5583293",
"0.55597585",
"0.5536291",
"0.5525806",
"0.55224055",
"0.55201715",
"0.5512701",
"0.55103886",
"0.54972446",
"0.548512",
"0.54840696",
"0.54836977",
"0.5482333",
"0.54592067",
"0.54384065",
"0.5437337",
"0.543537",
"0.542446",
"0.5421657",
"0.54185724",
"0.5406252",
"0.5405138",
"0.5403844",
"0.540185",
"0.5383336",
"0.5382311",
"0.53779656",
"0.5372819",
"0.5371135",
"0.5367695",
"0.5360089",
"0.5359496",
"0.5345718",
"0.53412",
"0.5336894",
"0.5325496",
"0.5298613",
"0.52881116",
"0.5287908",
"0.52852184",
"0.5279568",
"0.52775633",
"0.52769303",
"0.52745",
"0.5269175",
"0.52625257",
"0.5246512",
"0.52337813",
"0.52325886",
"0.52256393",
"0.5218368",
"0.5211116",
"0.5209841",
"0.5197968",
"0.5196377",
"0.5192807",
"0.51911587",
"0.5187094",
"0.51845974",
"0.51772696",
"0.5176087",
"0.51739216",
"0.5169973",
"0.51634806",
"0.5161024"
] | 0.0 | -1 |
Get the current default connection from the Integrity client. | public IntegrityConnection getDefaultConnection() throws IntegrityExceptionEx
{
try
{
Command cmd = new Command(Command.IM, "servers");
Response resp = _cmdRunner.execute(cmd);
if (resp.getWorkItemListSize() > 0) // Connected to something.
{
WorkItemIterator wkit = resp.getWorkItems();
boolean found = false;
while (wkit.hasNext() && !found)
{
WorkItem wk = wkit.next();
if (wk.getField("default").getBoolean().booleanValue())
{
String h = wk.getField("hostname").getString();
int p = wk.getField("portnumber").getInteger().intValue();
String u = wk.getField("username").getString();
_log.message("Found default connection " + u + "@" + h + ":" + p);
return new IntegrityConnection(h, p, u);
}
}
}
return null;
} catch (APIException ex)
{
throw IntegrityExceptionEx.create("Could not get the default api connection", ex);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public JupiterConnector getDefault() {\n if (defaultConnection == null) {\n defaultConnection = new JupiterConnector(this,\n DEFAULT_NAME,\n redis.getPool(DEFAULT_NAME),\n fallbackPools.computeIfAbsent(DEFAULT_NAME, this::fetchFallbackPool));\n }\n\n return defaultConnection;\n }",
"private MongoClient getDefaultConnection() {\n\t\tthis.mongoClient = new MongoClient();\n\t\treturn this.mongoClient;\n\t}",
"public DockerClient getDefaultConnection() {\n return connections.computeIfAbsent(DEFAULT_CONNECTION, id -> {\n DockerClientConfig config = null;\n\n if (SystemUtils.IS_OS_MAC_OSX) {\n config = DefaultDockerClientConfig.createDefaultConfigBuilder()\n .withDockerHost(\"unix:///var/run/docker.sock\")\n .build();\n }\n if (SystemUtils.IS_OS_LINUX) {\n config = DefaultDockerClientConfig.createDefaultConfigBuilder()\n .withDockerHost(\"unix:///var/run/docker.sock\")\n .build();\n }\n if (SystemUtils.IS_OS_WINDOWS) {\n config = DefaultDockerClientConfig.createDefaultConfigBuilder()\n .withDockerHost(\"tcp://localhost:2376\")\n .withDockerTlsVerify(true)\n .withDockerTlsVerify(\"1\")\n .build();\n }\n\n return DockerClientBuilder.getInstance(config).build();\n });\n }",
"public JCoConnection getDefaultJCoConnection() throws BackendException;",
"protected IXConnection getConnection() {\n return eloCmisConnectionManager.getConnection(this.getCallContext());\n }",
"public String getConnection()\n {\n return this.connection;\n }",
"public static Connection getConnection() {\n\t\treturn null;\n\t}",
"public static Connection getConnection() {\n\t\treturn null;\r\n\t}",
"public IBrowserConnection getSelectedConnection()\n {\n return selectedConnection;\n }",
"public Connection ObtenirConnexion(){return cn;}",
"private Connection getConn(){\n \n return new util.ConnectionPar().getConn();\n }",
"public static Connection getConnection() {\n\treturn null;\n}",
"public String getConnectionId() {\n return connectionId;\n }",
"public String getConnection();",
"public static Connection getConnection(DSLContext context) {\n ConnectionProvider provider = context.configuration().connectionProvider();\n if (provider instanceof DefaultConnectionProvider) {\n return ((DefaultConnectionProvider) provider).acquire();\n } else {\n return null;\n }\n }",
"public Connection getConnection() {\r\n\tConnection result = null;\r\n\tif (isConnected()) {\r\n\t result = conn;\r\n\t}\r\n\treturn result;\r\n }",
"public String getConnectionId() {\n return this.connectionId;\n }",
"public static Connection getConn() {\n return conn;\n }",
"public IRemoteConnection getConnection() {\n \t\treturn fSelectedConnection;\n \t}",
"@Nullable\n public String getConnectionUser()\n {\n return connectionUser;\n }",
"java.lang.String getConnectionId();",
"java.lang.String getConnectionId();",
"java.lang.String getConnectionId();",
"public long getConnectionId() {\n return connectionId;\n }",
"public static Connection getConnection() {\n return singleInstance.createConnection();\n }",
"public static Client getCurrentClient(){\r\n return currClient;\r\n }",
"public long getConnectionId() {\n return connId;\n }",
"public String getConnectionName() {\n return connectionName;\r\n }",
"public Connection getConn()\n\t{\n\t\treturn this.conn;\n\t}",
"@Override\r\n\tpublic Connection getConnection() {\n\t\treturn null;\r\n\t}",
"public static Connect getConnect() {\n\t\treturn connection;\n\t}",
"public String getConnectionName() {\n return this.connectionName;\n }",
"public Connection getConn()\r\n\t{\r\n\t\treturn this.conn;\r\n\t}",
"public Connection getConnection(){\n\t\tif(connection == null){\r\n\t\t\tinitConnection();\r\n\t\t}\r\n\t\treturn connection;\r\n\t}",
"private static Connection getDefaultInitConnection(final Context c) throws SQLException {\n try {\n final DataSource initDs =\n (DataSource) c.lookup(GlobalConfigurationEngineBean.DEFAULT_DS_INIT);\n return initDs.getConnection();\n } catch (NamingException e) {\n if (LOG.isErrorEnabled()) {\n LOG.error(\"Default configuration schema not initialized, but could not find \" +\n GlobalConfigurationEngineBean.DEFAULT_DS_INIT);\n // continue, the caller will get a related exception when creating a connection anyway\n }\n return null;\n }\n }",
"@SuppressWarnings(\"WeakerAccess\")\n public static PilosaClient defaultClient() {\n return PilosaClient.withURI(URI.defaultURI());\n }",
"public static Connection getConnection() {\n\t\t\n\t\treturn conn;\n\t}",
"public Client getCurrentClient() {\n return currentClient;\n }",
"public Connection getConnection()\n\t{\n\t\treturn connection;\n\t}",
"public Connection getConnection() {\n\t\treturn this.connection;\n\t}",
"public Connection getConn() {\r\n return conn;\r\n }",
"public IConnection getConnection () { \n\t\treturn connection;\n\t}",
"public Connection getConnection(){\r\n\t\treturn connection;\r\n\t}",
"Connection getConnection() {\n\t\treturn connection;\n\t}",
"public Connection getConnection()\n\t{\n\t\treturn wConn;\n\t}",
"public Connection getConnection() {\r\n return connection;\r\n }",
"public Connection getConnection() {\r\n return connection;\r\n }",
"private Client findClient() {\n if ( key != null )\n return clientConnections.getConnection(key);\n else { //use keyCluster to find client\n return clientConnections.getConnection( keyCluster.getCluster(), keyCluster.getIndex());\n }\n }",
"public Connection getConnection(){\n try{\n if(connection == null || connection.isClosed()){\n connection = FabricaDeConexao.getConnection();\n return connection;\n } else return connection;\n } catch (SQLException e){throw new RuntimeException(e);}\n }",
"public Connection getConnection() {\n return connection;\n }",
"protected RunDataClient getCurrentClient() {\r\n\t\tif (!(calcSystem instanceof ExpressionCalc)) return null;\r\n\t\treturn ((ExpressionCalc)calcSystem).getCurrentClient();\r\n\t}",
"public Connection getConnection() {\n this.connect();\n return this.connection;\n }",
"public Connection getConnection() {\n \t\treturn this.connect;\n \t}",
"public Connection getConnection();",
"public Connection getConnection();",
"public Connection getConnection();",
"public Connection getConnection() {\n return conn;\n }",
"public Connection getConnection() {\n return conn;\n }",
"protected Connection getConnection () {\n \t\treturn connection;\n \t}",
"public synchronized CuratorFramework getLocalConnection() throws IOException\n {\n if ( localConnection == null )\n {\n CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder()\n .connectString(\"localhost:\" + configManager.getConfig().getInt(IntConfigs.CLIENT_PORT))\n .sessionTimeoutMs(arguments.connectionTimeOutMs * 10)\n .connectionTimeoutMs(arguments.connectionTimeOutMs)\n .retryPolicy(new ExponentialBackoffRetry(1000, 3));\n\n if ( arguments.aclProvider != null )\n {\n builder = builder.aclProvider(arguments.aclProvider);\n }\n\n localConnection = builder.build();\n localConnection.start();\n }\n return localConnection;\n }",
"public static Connection getConnection() {\n if (connection == null) {\n try {\n connect();\n } catch (IOException e) {\n if (sc != null) {\n sc.log(\"connect \", e);\n }\n }\n }\n if (connection == null) {\n if (sc != null) {\n sc.log(\"BigtableHelper-No Connection\");\n }\n }\n return connection;\n }",
"public Connection getConnection() {\n try {\n return ds.getConnection();\n } catch (SQLException e) {\n System.err.println(\"Error while connecting to database: \" + e.toString());\n }\n return null;\n }",
"public Connection getConn() {return conn;}",
"String getConnection();",
"String getConnection();",
"String getConnection();",
"String getConnection();",
"public Connection getDbConnect() {\n return dbConnect;\n }",
"private Connection getConnection() {\n if ( conn==null ) {\n conn = Util.getConnection( \"root\", \"\" );\n }\n return conn;\n }",
"public\n Connection getConnection();",
"@Override\r\n\tpublic Database getDefaultDatabase() {\r\n\t\treturn databases.getDatabase( \"default\" );\r\n\t}",
"public T caseDefaultConnection(DefaultConnection object) {\n\t\treturn null;\n\t}",
"public static Connection getConnection() {\n\n if (concount<conns-1) {\n concount++;\n } else {\n concount=0;\n }\n return con_pool[concount];\n }",
"protected Connection getConnection() {\r\n\t\treturn getProcessor().getConnection();\r\n\t}",
"public Connection getConnection() {\n if(connection == null) throw new RuntimeException(\"Attempt to get database connection before it was initialized\");\n return connection;\n }",
"public long connectionId()\n {\n return connectionId;\n }",
"public final int getConnectionType()\n\t{\n\t\treturn connType;\n\t}",
"public static Connection getConnection() {\n \t\treturn connPool.getConnection();\n \t}",
"public static Connection GetConnection_s() {\n try {\n return connectionPool.getConnection(); \n } catch (SQLException e) {\n return null;\n }\n }",
"public static Connection getConnection() {\n\t\ttry {\n\t\t\treturn DBUtil.getInstance().ds.getConnection();\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\n\t}",
"io.netifi.proteus.admin.om.Connection getConnection(int index);",
"@Override\n public Connection getConnection() {\n boolean createNewConnection = false;\n Connection returnConnection = null;\n synchronized (connections) { //Lock the arraylist\n if (connections.isEmpty()) { //Check if any connections available\n createNewConnection = true; //If not, create new one\n } else {\n returnConnection = connections.get(0); //Get first available one\n connections.remove(0); //And remove from list\n }\n }\n if (createNewConnection) { //If new connection needed\n returnConnection = createConnection();\n }\n return returnConnection;\n }",
"public Connection getCon() {\r\n return con;\r\n }",
"public Connection getMyConnection(){\n return myConnection;\n }",
"public ConnectionType getConnectionType(){\n\t return connectionType; \n }",
"public DatabaseConnection getDatabaseConnection() {\n return query.getDatabaseConnection();\n }",
"@Override\n public String getConnection() {\n Object ref = connection_;\n if (ref instanceof String) {\n return (String) ref;\n } else {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n connection_ = s;\n return s;\n }\n }",
"@Override\n public String getConnection() {\n Object ref = connection_;\n if (ref instanceof String) {\n return (String) ref;\n } else {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n connection_ = s;\n return s;\n }\n }",
"@Override\n public String getConnection() {\n Object ref = connection_;\n if (ref instanceof String) {\n return (String) ref;\n } else {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n connection_ = s;\n return s;\n }\n }",
"@Override\n public String getConnection() {\n Object ref = connection_;\n if (ref instanceof String) {\n return (String) ref;\n } else {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n connection_ = s;\n return s;\n }\n }",
"public String getConnection() {\n Object ref = connection_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n connection_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }",
"public String getConnection() {\n Object ref = connection_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n connection_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }",
"public String getConnection() {\n Object ref = connection_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n connection_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }",
"public String getConnection() {\n Object ref = connection_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n connection_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }",
"public static Connector GetConnection(){\n\t\ttry{\n\t\t\tif(c_connection == null){\n\t\t\t\tc_connection = new Connector();\n\t\t\t}\n\t\t\treturn c_connection;\n\t\t}catch (Exception e) {\n\t\t\tSystem.out.println(e);\n\t\t\treturn null;\n\t\t}\n\t}",
"private C4Client getClientFromConnectionController() {\n FXMLLoader loader = new FXMLLoader();\n loader.setLocation(getClass().getResource(\"connection.fxml\"));\n try {\n loader.load();\n } catch (IOException error) {\n System.out.println(\"There is an error while passing the Socket between controllers: \" + error);\n }\n ConnectionController connection = loader.getController();\n // Getting the Socket Object\n return connection.getClient();\n }",
"public Connexion getConnexion() {\n\t\treturn cx;\n\t}",
"protected Connection getConnection() {\n return con;\n }",
"public Socket getConnection() {\n return connection;\n }",
"public Integer getConnection(int index) {\n\t\treturn connections.get(index);\n\t}"
] | [
"0.6768037",
"0.67610794",
"0.6729616",
"0.6664584",
"0.6454768",
"0.643824",
"0.6411359",
"0.6388387",
"0.63875717",
"0.6379377",
"0.63478714",
"0.6273444",
"0.626618",
"0.62354666",
"0.6235412",
"0.62151414",
"0.6214712",
"0.6202091",
"0.61860454",
"0.6159012",
"0.61574626",
"0.61574626",
"0.61574626",
"0.61538",
"0.6142925",
"0.6131107",
"0.61296755",
"0.61078674",
"0.6095963",
"0.60908586",
"0.6087047",
"0.6082621",
"0.6081241",
"0.6080919",
"0.60736454",
"0.6053673",
"0.6053434",
"0.6047756",
"0.6045934",
"0.60424095",
"0.6034585",
"0.6028921",
"0.6019213",
"0.601411",
"0.60053897",
"0.59722733",
"0.59722733",
"0.59706455",
"0.5965792",
"0.5965281",
"0.59515417",
"0.5949504",
"0.5948255",
"0.5929385",
"0.5929385",
"0.5929385",
"0.5927126",
"0.5927126",
"0.59209734",
"0.5916392",
"0.5905115",
"0.5877013",
"0.58683515",
"0.5862799",
"0.5862799",
"0.5862799",
"0.5862799",
"0.5860416",
"0.58531123",
"0.5842702",
"0.58425856",
"0.5834871",
"0.58244765",
"0.5820551",
"0.5811531",
"0.58098954",
"0.58080804",
"0.5806711",
"0.5796022",
"0.5791221",
"0.5786596",
"0.5782114",
"0.5760381",
"0.57600254",
"0.57459146",
"0.5743429",
"0.5738871",
"0.5738871",
"0.5738871",
"0.5738871",
"0.5727286",
"0.5727286",
"0.5727286",
"0.5727286",
"0.5720924",
"0.5713018",
"0.5712298",
"0.57120085",
"0.57085747",
"0.5703581"
] | 0.772498 | 0 |
Set the command runners defaults to those found in the connection. The connection is typically derived from a call to getDefaultConnection. | public void setRunnerDefaultFromConnection(IntegrityConnection conn)
{
_log.message("Setting command runner defaults " + conn.toString());
_cmdRunner.setDefaultHostname(conn.getHost());
_cmdRunner.setDefaultPort(conn.getPort());
_cmdRunner.setDefaultUsername(conn.getUser());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void initializeDefaultCommands()\n {\n m_chassis.setDefaultCommand(m_inlineCommands.m_driveWithJoystick);\n // m_intake.setDefaultCommand(null);\n m_chamber.setDefaultCommand(new ChamberIndexBalls());\n // m_launcher.setDefaultCommand(null);\n // m_climber.setDefaultCommand(null);\n // m_controlPanel.setDefaultCommand(null);\n }",
"public void initDefaultCommand() {\n setDefaultCommand(new IdentifyBestTarget());\n }",
"@Override\r\n\tprotected void initDefaultCommand() {\n\t\tsetDefaultCommand(new DriveWithJoysticks());\r\n\t}",
"public void initDefaultCommand() {\n\t\tsetDefaultCommand(new UserDriveCommand());\n\t}",
"@Override\n public void initDefaultCommand() {\n setDefaultCommand(new DriveWithJoy());\n }",
"public void initDefaultCommand() {\n\t\tsetDefaultCommand(new HatchExtenderCommand());\n\t}",
"public void initDefaultCommand() {\n \tsetDefaultCommand(new TestCommandEye());\n }",
"public void initDefaultCommand() {\n super.setDefaultCommand(new DriveJoystick());\n }",
"public void initDefaultCommand() {\n \tsetDefaultCommand(new Drive());\n }",
"public void initDefaultCommand() {\n setDefaultCommand(new TankDrive());\n }",
"public void initDefaultCommand() {\n\t\tsetDefaultCommand(new Intake());\n\t}",
"public void initDefaultCommand() {\n // Set the default command for a subsystem here.\n //setDefaultCommand(new MySpecialCommand());\n \tsetDefaultCommand(new DriveWithJoyStickCommand()); // TBD for Commandbased programming\n }",
"@Override\n public void initDefaultCommand() {\n setDefaultCommand(new DriveTrainDefault());\n }",
"public void initDefaultCommand() {\n\t\tsetDefaultCommand(new JoystickLiftCommand());\n\t}",
"public void initDefaultCommand() {\r\n setDefaultCommand(new TankDrive());\r\n }",
"public void initDefaultCommand() {\n\n setDefaultCommand(new DriveWithJoystick());\n\n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DEFAULT_COMMAND\n }",
"public void initDefaultCommand() {\n // Set the default command for a subsystem here.\n \tsetDefaultCommand(new DriveWithJoystick());\n }",
"public void initDefaultCommand() {\n\t}",
"protected void initDefaultCommand() {\n\t\tsetDefaultCommand(CommandBase.scs);\r\n\t}",
"public void initDefaultCommand() {\n }",
"public void initDefaultCommand() {\n }",
"public void initDefaultCommand() {\n }",
"public void initDefaultCommand() {\n }",
"public void initDefaultCommand() {\n }",
"public void initDefaultCommand() {\n }",
"public void initDefaultCommand() {\n }",
"public void initDefaultCommand() {\n }",
"public void initDefaultCommand() {\n }",
"public void initDefaultCommand() {\n }",
"public void initDefaultCommand() {\n }",
"public void initDefaultCommand() {\n }",
"public void initDefaultCommand() {\n }",
"public void initDefaultCommand() {\n }",
"public void initDefaultCommand() {\n }",
"public void initDefaultCommand() {\n }",
"public void initDefaultCommand() {\n }",
"public void initDefaultCommand() {\n }",
"public void initDefaultCommand() {\n }",
"public void initDefaultCommand() {\n }",
"public void initDefaultCommand() {\n }",
"public void initDefaultCommand() {\n }",
"public void initDefaultCommand() {\n }",
"public void initDefaultCommand() {\n }",
"public void initDefaultCommand() {\n }",
"protected void initDefaultCommand() {\n \t\t\n \t}",
"public void initDefaultCommand() {\n\t\tsetDefaultCommand(new JoystickDrive());\n\t}",
"public void initDefaultCommand() {\r\n // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DEFAULT_COMMAND\r\n setDefaultCommand(new drive_w_joysticks());\r\n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DEFAULT_COMMAND\r\n\t\r\n // Set the default command for a subsystem here.\r\n //setDefaultCommand(new MySpecialCommand());\r\n }",
"public void initDefaultCommand() {\n \n }",
"public void initDefaultCommand() {\n \tsetDefaultCommand(new SetPlungerMove());\n // Set the default command for a subsystem here.\n //setDefaultCommand(new MySpecialCommand());\n }",
"public void initDefaultCommand()\n {\n }",
"public void initDefaultCommand() {\n \n }",
"public void initDefaultCommand()\n\t{\n\t}",
"public void initDefaultCommand() {\n // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DEFAULT_COMMAND\n\n setDefaultCommand(new EnableLight());\n\n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DEFAULT_COMMAND\n\n // Set the default command for a subsystem here.\n // setDefaultCommand(new MySpecialCommand());\n }",
"public void initDefaultCommand() {\n // Set the default command for a subsystem here.\n setDefaultCommand(new GearPickupClampIn());\n }",
"private void setDefaultConfiguration(){\n\t\tthis.setProperty(\"DefaultNodeCapacity\", \"5\");\n\t\tthis.setProperty(\"ReplicaNumber\", \"3\");\n\t\tthis.setProperty(\"JobReattemptTimes\", \"2\");\n\t\tthis.setProperty(\"ReducerCount\", \"3\");\n\t}",
"public void initDefaultCommand() {\r\n // Set the default command for a subsystem here.\r\n //setDefaultCommand\r\n }",
"public void initDefaultCommand() {\n // Set the default command, if any, for a subsystem here. Example:\n // setDefaultCommand(new MySpecialCommand());\n }",
"@Override\n public void initDefaultCommand() {\n }",
"@Override\n public void initDefaultCommand() {\n }",
"@Override\n public void initDefaultCommand() {\n }",
"@Override\n public void initDefaultCommand() {\n }",
"@Override\n public void initDefaultCommand() {\n }",
"@Override\n public void initDefaultCommand() {\n }",
"@Override\n public void initDefaultCommand() {\n setDefaultCommand(new Climb());\n }",
"@Override\n public void initDefaultCommand() {\n\n setDefaultCommand(new UserDrive());\n\n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DEFAULT_COMMAND\n\n // Set the default command for a subsystem here.\n }",
"public void initDefaultCommand() {\n\t\t// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DEFAULT_COMMAND\n\n\n\t\t// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DEFAULT_COMMAND\n\n\t\t// Set the default command for a subsystem here.\n\t\t// setDefaultCommand(new MySpecialCommand());\n\t}",
"public void initDefaultCommand() {\n // Set the default command for a subsystem here.\n //setDefaultCommand(new MySpecialCommand());\n \tsetDefaultCommand(new VelocityDriveCommand());\n }",
"public void initDefaultCommand() {\n // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DEFAULT_COMMAND\n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DEFAULT_COMMAND\n\t\n // Set the default command for a subsystem here.\n //setDefaultCommand(new MySpecialCommand());\n }",
"public void initDefaultCommand() {\n // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DEFAULT_COMMAND\n setDefaultCommand(new joystickDrive());\n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DEFAULT_COMMAND\n\t\n // Set the default command for a subsystem here.\n //setDefaultCommand(new MySpecialCommand());\n \n \n \n }",
"public void initDefaultCommand() {\n // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DEFAULT_COMMAND\n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DEFAULT_COMMAND\n\t\n // Set the default command for a subsystem here.\n //setDefaultCommand(new MySpecialCommand());\n }",
"public void initDefaultCommand() \n {\n }",
"public void initDefaultCommand() {\n \tsetDefaultCommand(new ArmManual());\n }",
"public void initDefaultCommand() {\n \tsetDefaultCommand(new SetCanMove());\n // Set the default command for a subsystem here.\n //setDefaultCommand(new MySpecialCommand());\n }",
"@Override\n public void initDefaultCommand() {\n }",
"@Override\n public void initDefaultCommand() {\n }",
"@Override\n public void initDefaultCommand() {\n }",
"@Override\n public void initDefaultCommand() {\n }",
"@Override\n public void initDefaultCommand() {\n }",
"@Override\n public void initDefaultCommand() {\n }",
"@Override\n public void initDefaultCommand() {\n }",
"@Override\n public void initDefaultCommand() {\n Robot.driveTrain.setDefaultCommand(new xboxDrive());\n // Set the default command for a subsystem here.\n // setDefaultCommand(new MySpecialCommand());\n }",
"@Override\n public void initDefaultCommand() {\n }",
"public void initDefaultCommand() {\n \tsetDefaultCommand(new SparkControl());\n }",
"public void initDefaultCommand() {\n\t\t// Don't do anything\n }",
"public void initDefaultCommand() {\n // Set the default command for a subsystem here.\n //setDefaultCommand(new MySpecialCommand());\n }",
"public void initDefaultCommand() {\n // Set the default command for a subsystem here.\n //setDefaultCommand(new MySpecialCommand());\n }",
"public void initDefaultCommand() {\n // Set the default command for a subsystem here.\n //setDefaultCommand(new MySpecialCommand());\n }",
"public void initDefaultCommand() {\n // Set the default command for a subsystem here.\n //setDefaultCommand(new MySpecialCommand());\n }",
"void setBotOptions(DefaultBotOptions botOptions){\n this.botOptions = botOptions;\n }",
"@Override\n public void initDefaultCommand() {\n setDefaultCommand(new GroupIntakeDefault());\n }",
"public void initDefaultCommand() {\r\n // Set the default command for a subsystem here.\r\n //setDefaultCommand(new MySpecialCommand());\r\n }",
"@Override\n\tprotected void initDefaultCommand() {\n\n\t}",
"@Override\n\tprotected void initDefaultCommand() {\n\n\t}",
"public void initDefaultCommand() {\n\n // Set the default command for a subsystem here.\n // setDefaultCommand(new MySpecialCommand());\n\n }",
"public void initDefaultCommand() {\n // Set the default command for a subsystem here.\n // setDefaultCommand(new MySpecialCommand());\n }",
"@Override\r\n\tprotected void initDefaultCommand() {\n\t\t\r\n\t}",
"@Override\n\tprotected void initDefaultCommand() {\n\t\tsetDefaultCommand(new ReverseBatterShot());\n\t}",
"@Override\n public void initDefaultCommand() {\n setDefaultCommand(new IntakeDrive());\n }",
"public void initDefaultCommand() {\n // Set the default command for a subsystem here.\n //setDefaultCommand(new MySpecialCommand());\n \t\n }",
"public void initDefaultCommand() {\n \tsetDefaultCommand(new boxChange());\n }"
] | [
"0.60890657",
"0.5993636",
"0.59299207",
"0.5833481",
"0.5794384",
"0.5741531",
"0.57410276",
"0.57395893",
"0.5714085",
"0.5699332",
"0.56936854",
"0.5693374",
"0.568034",
"0.5665584",
"0.5656385",
"0.5634622",
"0.56174403",
"0.56113535",
"0.5604455",
"0.5603472",
"0.5603472",
"0.5603472",
"0.5603472",
"0.5603472",
"0.5603472",
"0.5603472",
"0.5603472",
"0.5603472",
"0.5603472",
"0.5603472",
"0.5603472",
"0.5603472",
"0.5603472",
"0.5603472",
"0.5603472",
"0.5603472",
"0.5603472",
"0.5603472",
"0.5603472",
"0.5603472",
"0.5603472",
"0.5603472",
"0.5603472",
"0.5603472",
"0.5586896",
"0.5584123",
"0.5582634",
"0.55763376",
"0.55515337",
"0.55479646",
"0.55387074",
"0.55340654",
"0.54766965",
"0.5465391",
"0.54522884",
"0.5436396",
"0.5428375",
"0.5423649",
"0.5423649",
"0.5423649",
"0.5423649",
"0.5423649",
"0.5423649",
"0.5411266",
"0.5406543",
"0.54039884",
"0.5403268",
"0.54002494",
"0.53961337",
"0.5392745",
"0.5385529",
"0.5375205",
"0.5372057",
"0.5362258",
"0.5362258",
"0.5362258",
"0.5362258",
"0.5362258",
"0.5362258",
"0.5362258",
"0.5355002",
"0.53383124",
"0.5334396",
"0.5332056",
"0.53174126",
"0.53174126",
"0.53174126",
"0.53174126",
"0.5312906",
"0.5292542",
"0.52884585",
"0.52754474",
"0.52754474",
"0.52683616",
"0.5266663",
"0.52639294",
"0.52619284",
"0.52515984",
"0.5251497",
"0.52508336"
] | 0.7498608 | 0 |
Run the application using Spring Boot and an embedded servlet engine. | public static void main(String[] args) {
// Tell server to look for accounts-server.properties or
// accounts-server.yml
System.setProperty("spring.config.name", "weather-server");
SpringApplication.run(WeatherServer.class, args);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main(String[] args){\n // app.run(args);\r\n new SpringApplicationBuilder(MainApplication.class).web(true).run(args);\r\n }",
"public void run() {\n final Server server = new Server(8081);\n\n // Setup the basic RestApplication \"context\" at \"/\".\n // This is also known as the handler tree (in Jetty speak).\n final ServletContextHandler context = new ServletContextHandler(\n server, CONTEXT_ROOT);\n final ServletHolder restEasyServlet = new ServletHolder(\n new HttpServletDispatcher());\n restEasyServlet.setInitParameter(\"resteasy.servlet.mapping.prefix\",\n APPLICATION_PATH);\n restEasyServlet.setInitParameter(\"javax.ws.rs.Application\",\n \"de.kad.intech4.djservice.RestApplication\");\n context.addServlet(restEasyServlet, CONTEXT_ROOT);\n\n\n try {\n server.start();\n server.join();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }",
"public static void main(String[] args){\n// ApplicationContext ctx = new SpringApplicationBuilder()\n// .sources(SpringBootApplication.class)\n// .web(false) // 没错,把项目设置成web环境\n// .run(args);\n SpringApplication.run(SpringBootApplication.class, args);\n }",
"public static void main(String[] args) {\n\t\tnew SpringApplicationBuilder(Application.class).web(true).run(args);\n\t}",
"public static void main(String[] args) {\n \tlogger.info(\"Start application spring boot\");\n SpringApplication.run(ApplicationConfiguration.class, args);\n }",
"public static void main(String[] args) {\n AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();\n ctx.register(ApplicationConfig.class);\n ctx.register(ApplicationContext.class);\n ctx.register(PersistenceContext.class);\n ctx.register(ProductionContext.class);\n ctx.register(SwaggerConfig.class);\n\n SpringApplication.run(Application.class);\n }",
"public static void main(String[] args) throws Exception {\n\n\t\tServer server = new Server(8080);\n\n\t\tWebAppContext bb = new WebAppContext();\n\t\tbb.setServer(server);\n\n\t\tbb.addFilter(GuiceFilter.class, \"/*\", EnumSet.allOf(DispatcherType.class));\n\n\t\tServletHolder holder = bb.addServlet(ServletContainer.class, \"/*\");\n\t\tholder.setInitParameter(\"javax.ws.rs.Application\", \"net.ludeke.rest.jersey.MyApplication\");\n\n\t\tbb.addServlet(holder, \"/*\");\n\t\tbb.setContextPath(\"/\");\n\t\tbb.setWar(\"src/main/webapp\");\n\n\t\tserver.setHandler(bb);\n\n\t\ttry {\n\t\t\tSystem.out.println(\">>> STARTING EMBEDDED JETTY SERVER, PRESS ANY KEY TO STOP\");\n\t\t\tserver.start();\n\t\t\twhile (System.in.available() == 0) {\n\t\t\t\tThread.sleep(5000);\n\t\t\t}\n\t\t\tserver.stop();\n\t\t\tserver.join();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(100);\n\t\t}\n\t}",
"public static void main(final String[] args) throws Exception {\n\t\tServer server = new Server(8181);\n\n\t\t// Register and map the dispatcher servlet\n\t\tfinal ServletHolder servletHolder = new ServletHolder(new CXFServlet());\n\t\tfinal ServletContextHandler context = new ServletContextHandler();\n\t\tcontext.setContextPath(\"/\");\n\t\tcontext.addServlet(servletHolder, \"/rest/*\");\n\t\tcontext.addEventListener(new ContextLoaderListener());\n\t\tcontext.setInitParameter(\"contextClass\", AnnotationConfigWebApplicationContext.class.getName());\n\t\tcontext.setInitParameter(\"contextConfigLocation\", AppConfig.class.getName());\n\n\t\tfinal ResourceHandler resource_handler = new ResourceHandler();\n\t\tresource_handler.setDirectoriesListed(true);\n\t\tresource_handler.setWelcomeFiles(new String[] { \"index.html\" });\n\n\t\t// Try to find the webapp files in source\n\t\tFile basePath = new File(\"./src/main/webapp/logiclodge-webapp/\");\n\t\tif (basePath.exists()) {\n\t\t\tresource_handler.setBaseResource(new PathResource(basePath));\n\t\t} else {\n\t\t\t// Otherwise grab them from the classpath (usually inside the jar)\n\t\t\tresource_handler.setResourceBase(new ClassPathResource(\"logiclodge-webapp\").getURI().toString());\n\t\t}\n\n\t\tfinal HandlerList handlers = new HandlerList();\n\t\thandlers.setHandlers(new Handler[] { resource_handler, context });\n\t\tserver.setHandler(handlers);\n\t\tserver.start();\n\t\tserver.join();\n\t}",
"public static void main(String[] args) throws Exception {\n\t\tConfigurableApplicationContext c = SpringApplication.run(WebParserRestApplication.class, args); \n\t}",
"public static void main(String[] args) {\n\t\tSpringApplication.run(ApiApplication.class, args);\n\t}",
"public static void main(String[] args) throws Exception {\n SpringApplication.run(Application.class, args);\n }",
"public static void main(String[] args) throws Exception {\n SpringApplication.run(Application.class, args);\n }",
"public static void main(String[] args) {\n new SpringApplicationBuilder(Bootstrap.class).web(false).run(args);\n }",
"public static void main(String[] args) {\n SpringApplication.run(Application.class, args);\n }",
"public static void main(String[] args) {\n SpringApplication.run(TicketServiceApplication.class, args);\n }",
"public static void main(String[] args) {\n SpringApplication.run(TechprudentApplication.class, args);\n }",
"public static void main(String[] args) {\n ConfigurableApplicationContext ctx = SpringApplication\n .run(ApplicationStart.class, args);\n }",
"public static void main(String[] args) {\n SpringApplication.run(Application.class, args);\n }",
"public static void main(String[] args) {\n SpringApplication.run(Application.class, args);\n }",
"public static void main(String[] args) {\n SpringApplication.run(Application.class, args);\n }",
"public static void main(String[] args) {\n SpringApplication.run(Application.class, args);\n }",
"public static void main(String[] args) {\n\n SpringApplication.run(Application.class, args);\n // AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();\n }",
"public static void main(String[] args) throws Exception {\n URL webRootLocation = MainView.class.getResource(\"/webapp/\"); //src/masin\n URI webRootUri = webRootLocation.toURI();\n\n WebAppContext context = new WebAppContext();\n context.setBaseResource(Resource.newResource(webRootUri));\n context.setContextPath(\"/\");\n context.setAttribute(\"org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern\", \".*\");\n context.setConfigurationDiscovered(true);\n context.setConfigurations(new Configuration[]{\n new AnnotationConfiguration(),\n new WebInfConfiguration(),\n new WebXmlConfiguration(),\n new MetaInfConfiguration()\n });\n context.getServletContext().setExtendedListenerTypes(true);\n context.addEventListener(new ServletContextListeners());\n\n Server server = new Server(8080);\n server.setHandler(context);\n server.start();\n server.join();\n }",
"public static void main(String[] args) {\n SpringApplication.run(WebclientApplication.class, args);\n }",
"public static void main(String[] args) { \n\t\t//we are calling a static method and passing it the name of the class where we have our Main method.\t\t\n\t\tSpringApplication.run(CourseApiApp.class, args);\n\t}",
"public static void main(String[] args) {\n\t\tSpringApplication.run(SpringbootApplication.class, args);\n\t}",
"public static void main(String[] args) {\n\t\tlogger.info(\"Initializing Spring boot\");\r\n\t\tSpringApplication.run(TesterMain.class, args);\r\n\t\tlogger.info(\"Spring boot initialized\");\r\n\r\n\t}",
"public static void main(String[] args) {\n\t\tSpringApplication.run(HimalayanKitchenBackendStarter.class, args);\t\t\n\t}",
"public static void main(String[] args) {\n\t\tSpringApplication.run(StwwmakerApplication.class, args);\n\t}",
"public static void main(final String[] args) throws Exception {\n Resource.setDefaultUseCaches(false);\n Integer SERVER_PORT = Integer.parseInt(ManejadorPropiedades.leerPropiedad(\"app_cfg.properties\", \"app.port\"));\n String SERVER_HOST = ManejadorPropiedades.leerPropiedad(\"app_cfg.properties\", \"app.host\");\n String CONTEXT_PATH = ManejadorPropiedades.leerPropiedad(\"app_cfg.properties\", \"app.context_path\");\n \n final Server server = new Server(SERVER_PORT);\n System.setProperty(AppConfig.SERVER_PORT, SERVER_PORT.toString());\n System.setProperty(AppConfig.SERVER_HOST, SERVER_HOST);\n System.setProperty(AppConfig.CONTEXT_PATH, CONTEXT_PATH);\n \n\n // Configuring Apache CXF servlet and Spring listener \n final ServletHolder servletHolder = new ServletHolder(new CXFServlet());\n final ServletContextHandler context = new ServletContextHandler();\n context.setContextPath(\"/\");\n context.addServlet(servletHolder, \"/\" + CONTEXT_PATH + \"/*\");\n context.addEventListener(new ContextLoaderListener());\n context.setInitParameter(\"contextClass\", AnnotationConfigWebApplicationContext.class.getName());\n context.setInitParameter(\"contextConfigLocation\", AppConfig.class.getName());\n \n FilterHolder filterHolder = context.addFilter(CrossOriginFilter.class,\"/*\",EnumSet.allOf(DispatcherType.class));\n filterHolder.setInitParameter(CrossOriginFilter.ALLOWED_ORIGINS_PARAM,\"*\");\n filterHolder.setInitParameter(CrossOriginFilter.ALLOWED_HEADERS_PARAM,\"Content-Type,Authorization,X-Requested-With,Content-Length,Accept,Origin\");\n filterHolder.setInitParameter(CrossOriginFilter.ALLOWED_METHODS_PARAM,\"GET,PUT,POST,DELETE,OPTIONS\");\n filterHolder.setInitParameter(CrossOriginFilter.PREFLIGHT_MAX_AGE_PARAM,\"5184000\");\n filterHolder.setInitParameter(CrossOriginFilter.ALLOW_CREDENTIALS_PARAM,\"true\");\n\n\n // Configuring Swagger as static web resource\n final ServletHolder swaggerHolder = new ServletHolder(new DefaultServlet());\n final ServletContextHandler swagger = new ServletContextHandler();\n swagger.setContextPath(\"/swagger\");\n swagger.addServlet(swaggerHolder, \"/*\");\n swagger.setResourceBase(new ClassPathResource(\"/webapp\").getURI().toString());\n\n final HandlerList handlers = new HandlerList();\n handlers.addHandler(swagger);\n handlers.addHandler(context);\n\n server.setHandler(handlers);\n server.start();\n server.join();\n }",
"public static void main(String[] args) {\n SpringApplication.run(MyLotoApplication.class, args);\n }",
"public static void main(String[] args) {\n\n SpringApplication app = new SpringApplication(Main.class);\n app.run(args);\n// SpringApplication.run(Main.class);\n }",
"public static void main(String [] args) {\n context = new AnnotationConfigApplicationContext(Config.class);\n // For the destroy method to work.\n context.registerShutdownHook();\n\n\n //TestService service = (TestService) context.getBean(\"test_service\");\n //PollingConsumer consumer = (PollingConsumer) context.getBean(\"test_consumer\");\n\n // Start tcp and flash servers\n Map<String, Initializer> initializers = context.getBeansOfType(Initializer.class);\n if (initializers != null) {\n for(Initializer initializer : initializers.values()) {\n initializer.initialize();\n }\n }\n\n NettyManager manager = context.getBean(NettyManager.class);\n try\n {\n manager.startServer();\n }\n catch (Exception e)\n {\n e.printStackTrace();\n }\n }",
"public static void main(String[] args) {\n /* Find the Application Class */\n SpringApplication.run(HelloWorldDemoApplication.class, args);\n }",
"public static void main(String[] args) {\n\t\tSpringApplication.run(Application.class, args);\n\n\t\t\n\t}",
"public void run() {\n\t\tport(8080);\n\n\t\t// Main Page, welcome\n\t\tget(\"/\", (request, response) -> \"Welcome!\");\n\n\t\t// Date\n\t\tget(\"/date\", (request, response) -> {\n\t\t\tDate d = new Date(\"frida.org\", Calendar.getInstance().get(Calendar.YEAR),\n\t\t\t\t\tCalendar.getInstance().get(Calendar.MONTH), Calendar.getInstance().get(Calendar.DAY_OF_MONTH));\n\t\t\treturn om.writeValueAsString(d);\n\t\t});\n\n\t\t// Time\n\t\tget(\"/time\", (request, response) -> {\n\t\t\tTime t = new Time(\"frida.org\", Calendar.getInstance().get(Calendar.HOUR),\n\t\t\t\t\tCalendar.getInstance().get(Calendar.MINUTE), Calendar.getInstance().get(Calendar.SECOND));\n\t\t\treturn om.writeValueAsString(t);\n\t\t});\n\t}",
"public static void main(final String[] args) throws Exception {\n new ApiApplication().run(args);\n }",
"public static void main(String[] args) {\n SpringApplication.run(DriverClass.class, args);\n }",
"public static void main(String[] args) {\n SpringApplication.run(ArtworkApplication.class, args);\n }",
"public static void main(String[] args) {\n\t\tSpringApplication.run(Application.class, args);\n\t}",
"public static void main(String[] args) {\n\t\tSpringApplication.run(Application.class, args);\n\t}",
"public static void main(String[] args) {\n\t\tSpringApplication.run(CodeCrawlerServiceApplication.class, args);\n\t}",
"public static void main(String[] args) {\n\n\t\t//Start Elasticsearch\n\t\tstartConnect();\n\n\t\tSpringApplication.run(KnowledgeHubApplication.class, args);\n\n\t}",
"public static void main(String[] args) {\n \n SpringApplication.run(App.class, args);\n }",
"public static void main(String[] args) {\n\n SpringApplication.run(SpringBootApplicationBootStrap.class);\n }",
"public static void startServlet() throws Exception {\n Server server = new Server(8081);\n\n log.info(\"configuring and starting servlet\");\n ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);\n context.setContextPath(\"/\");\n server.setHandler(context);\n\n DbProductQueryService dbProductQueryService = new DbProductQueryService();\n\n context.addServlet(new ServletHolder(new AddProductServlet(dbProductQueryService)), \"/add-product\");\n log.info(\"added AddProductServlet\");\n context.addServlet(new ServletHolder(new GetProductsServlet(dbProductQueryService)), \"/get-products\");\n log.info(\"added GetProductsServlet\");\n context.addServlet(new ServletHolder(new QueryServlet(dbProductQueryService)), \"/query\");\n log.info(\"added QueryServlet\");\n\n\n server.start();\n log.info(\"servlet started successfully\");\n server.join();\n }",
"public static void main(String[] args) throws Exception {\n String webPortStr = System.getenv(\"PORT\");\r\n int webPort = (webPortStr != null && !webPortStr.isEmpty()) ? Integer.parseInt(webPortStr) : 8080;\r\n \r\n String baseDir = System.getProperty(\"app.base.dir\"); \r\n if(baseDir == null || baseDir.isEmpty()) {\r\n \tthrow new IllegalArgumentException(\"the property \\\"app.base.dir\\\" is not set. Make sure to set it using -Dapp.base.dir=<BASEDIR> .\");\r\n }\r\n \r\n TomcatWrapper tomcat = new TomcatWrapper(webPort, baseDir+\"/war/\", System.getProperty(\"java.io.tmpdir\")); \r\n tomcat.addWebApp(\"/\", new File(baseDir+LOCATION).getAbsolutePath());\r\n \r\n logger.info(\"configuring app with basedir: {}\" , new File(baseDir+LOCATION).getAbsolutePath());\r\n \r\n tomcat.start(); \r\n }",
"public static void runFromServlet() {\n isRunningFromServlet.set(true);\n }",
"public static void main(String[] args) {\n\n URL.setURLStreamHandlerFactory(new OurURLStreamHandlerFactory());\n\n new SpringApplicationBuilder(FileDownloaderLauncher.class)\n .web(WebApplicationType.NONE)\n .run(args);\n }",
"public static void main(String[] args) {\n SpringApplication.run(SpringBootGiftApplication.class, args);\n }",
"public static void main(String[] args) {\n SpringApplication.run(TacoCloudApplication.class, args);\n }",
"public static void main(String[] args) {\n\t\tApplicationContext context = SpringApplication.run(SpringbootIn10StepsApplication.class, args);\n\t\t//**SpringApplication.run(...)**\n\t\t//Used to run a Spring Context. Also, \"run\" returns an ApplicationContext.\n\n\n\t\tfor (String name : context.getBeanDefinitionNames()) {\n\t\t\tSystem.out.println(name);\n\t\t}\t// We can see from this that the auto-configuration wires in 120+ beans!!\n\t}",
"public static void main(String[] args) {\n\t\tSpringApplication.run(MongoEmbeddedApplication.class, args);\n\t}",
"public static void main(String[] args) throws Exception {\n\t\tSpringApplication.run(new Class[]{HelloSpringBootApplication.class, InitializeData.class}, args);\n\t\t//initializeData.run(args);\n\t}",
"public static void main(String[] args) {\n\t\tJavalin app = Javalin.create(config -> {\n\t\t\t//This hosts the static html file on the server\n\t\t\tconfig.addStaticFiles(\"/\", Location.CLASSPATH);\n\t\t});\n\t\t\n\t\tControllerException ctrl = new ControllerException(new ServiceException());\n\t\tctrl.registerEndpoint(app);\n\t\t\n\t\tapp.start(8080);\n\t}",
"public static void main(String[] args) {\n\n\t\t\n\t\t/* CommandLineRunner and ApplicationRunner, to run specific pieces of code when an application is fully started.\n\t\t These interfaces get called just before run() once SpringApplication completes.\n\t\t \n\t\t CommandLineRunner - provides access to application arguments as string array.\n\t\t \n\t\t ApplicationRunner wraps the raw application arguments and exposes the ApplicationArguments interface,\n\t\t which has many convinent methods to work with arguments,*/\n\t\t \n\t\t //You just need to register them as Beans in the application context. Then, Spring will automatically pick them up.\n\t\t\n\n\t\tSpringApplication.run(Demo3JpaApplication.class, args);\n\t}",
"public static void main(String[] args) {\n SpringApplication.run(SensorDataStorageMicroservice.class, args);\n }",
"public RunMe() throws IOException {\n\n\t\t// Load data\n\t\tloadDataMap();\n\t\t\n\t\t// Start server\n\t\tcfg = createFreemarkerConfiguration();\n\t\tsetPort(8081);\n\t\tinitializeRoutes();\n\t}",
"public static void main(String[] args) {\n SpringApplication.run(BaseLoginApplication.class, args);\n }",
"public static void main(String[] args) {\n new SpringApplicationBuilder().sources(BaseApplication.class, CrondApplication.class).run(args);\n }",
"public static void main(String[] args) {\n\t\tSpringApplication.run(SpringCloudConfigServerApplication.class, args);\n\t}",
"public static void main(String[] args) {\n\r\n\t\tSpringApplication.run(EmployerRest.class, args);\r\n\r\n\t}",
"@Override\n public void start() throws LifecycleException {\n logger.info(\"Start http server ... \");\n\n\n try {\n // create a resource config that scans for JAX-RS resources and providers\n final ResourceConfig rc = new ResourceConfig()\n .packages(PACKAGES_SCAN) // packages path for resources loading\n .property(MvcFeature.TEMPLATE_BASE_PATH, FREEMARKER_BASE) // config freemarker view files's base path\n .register(LoggingFeature.class)\n .register(FreemarkerMvcFeature.class)\n .register(JettisonFeature.class)\n .packages(\"org.glassfish.jersey.examples.multipart\")\n .register(MultiPartFeature.class)\n .registerInstances(new ApplicationBinder()); //\n\n // create and start a new instance of grizzly http server\n // exposing the Jersey application at BASE_URI\n httpServer = GrizzlyHttpServerFactory.createHttpServer(URI.create(BASE_URI), rc);\n\n // Set StaticHttpHandler to handle http server's static resources\n String htmlPath = this.getClass().getResource(HTML_BASE).getPath(); // TODO, 部署后要根据实际目录修正!classes 同级目录下的 html 目录\n HttpHandler handler = new StaticHttpHandler(htmlPath);\n httpServer.getServerConfiguration().addHttpHandler(handler, \"/\");\n\n logger.info(\"Jersey app started with WADL available at {} application.wadl\\n \", BASE_URI);\n } catch (Exception e) {\n throw new LifecycleException(e); // just convert to self defined exception\n }\n }",
"public static void main(String[] args){\n\t\tAnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(MyConfig.class);\n\t\t//applicationContext.addApplicationListener(new MyApplicationStartListener());\n\t\tapplicationContext.setParent(new ClassPathXmlApplicationContext(\"WEB-INF/application-context.xml\"));\n\t\tapplicationContext.start();\n\t\t\n\t\tHelloWorld helloWorld = (HelloWorld) applicationContext.getBean(\"helloWorld\");\n\t\thelloWorld.sayHello();\n\t\t\n\t\t/*BookJdbcTemplate bookJdbcTemplate = new BookJdbcTemplate();\n\t\tJdbcTemplate jdbcTemplate = (JdbcTemplate) applicationContext.getBean(\"jdbcTemplate\");\n\t\tbookJdbcTemplate.setJdbcTemplate(jdbcTemplate);\n\t\tSystem.out.println(\"Total pages are: \" + bookJdbcTemplate.getTotalPages((long)11));\n\t\tlogger.debug(\"Total pages are: \" + bookJdbcTemplate.getTotalPages((long)11));*/\n\t}",
"public static void main(String[] args) {\n\t\tSpringApplication.run(AnzEngineeringApplication.class, args);\n\t}",
"public static void main(String[] args) {\r\n\r\n\t \tSystem.setProperty(\"spring.config.name\", \"sandun-personal-project\");\r\n\t\tSpringApplication.run(ApplicationServer.class, args);\r\n\t}",
"public static void main(String[] args) {\n\t\tSystem.out.println(\"*** START MAIN() ***\");\n\t\tSpringApplication.run(BeshstoreApplication.class, args);\n\t\tSystem.out.println(\"*** END MAIN() ***\");\n\t}",
"public static void main(String[] args) {\n\t\tSpringApplication.run(FinderApplication.class, args);\n\t}",
"@Bean\n public TomcatServletWebServerFactory servletWebServerFactory() {\n return new TomcatServletWebServerFactory() {\n\n @Override\n protected void prepareContext(Host host,\n ServletContextInitializer[] initializers) {\n super.prepareContext(host, initializers);\n StandardContext child = new StandardContext();\n child.addLifecycleListener(new Tomcat.FixContextListener());\n child.setPath(\"/cloudfoundryapplication\");\n ServletContainerInitializer initializer = getServletContextInitializer(\n getContextPath());\n child.addServletContainerInitializer(initializer, Collections.emptySet());\n child.setCrossContext(true);\n host.addChild(child);\n }\n\n };\n }",
"public static void main(String[] args) {\n\t\tSpringApplication.run(ResturantAppApplication.class, args);\n\t}",
"public static void main(String[] args) throws Exception {\n Application app = new Application();\r\n\r\n // Plug the server resource.\r\n app.setInboundRoot(HelloServerResource.class);\r\n\r\n // Instantiating the HTTP server and listening on port 8111\r\n new Server(Protocol.HTTP, 8111, app).start();\r\n }",
"public static void main(String[] args) {\n\t\tSpringApplication.run(JokesApplication.class, args);\n\t}",
"public static void main(String[] args) {\n\n SpringApplication.run(main.class, args);\n }",
"public static void main(String[] args) {\n\t\tSpringApplication.run(FilesystemApplication.class, args);\n\t}",
"public static void main(String[] args) {\n\t\tSpringApplication.run(PhtemperApplication.class, args);\n\t}",
"@Override\n public void onStartup(ServletContext sc) throws ServletException {\n AnnotationConfigWebApplicationContext rootApplicationContext = new AnnotationConfigWebApplicationContext();\n rootApplicationContext.register(RootAppConfig.class);\n sc.addListener(new ContextLoaderListener(rootApplicationContext));\n \n //kreiraj web application kontekst koji se vezuje za dispatcher servlet\n AnnotationConfigWebApplicationContext webApplicationContext = new AnnotationConfigWebApplicationContext();\n webApplicationContext.register(MvcConfig.class);\n \n //konfigurisanje dispatcher servlet-a\n ServletRegistration.Dynamic dispatcher = sc\n .addServlet(\"dispatcher\", new DispatcherServlet(webApplicationContext));\n dispatcher.addMapping(\"/\");\n dispatcher.setLoadOnStartup(1);\n }",
"public void run(){\n\t\t// Stop servlets\n\t\ttry{\n\t\t\tserver.stop();\n\t\t}catch(Exception e){}\n\t}",
"public static void main(String[] args) {\n\t\tSpringApplication.run(JwtAuthenticationApplication.class, args);\n\t\t\n\t}",
"public static void main(String[] args) throws IOException {\n ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);\n context.setContextPath(\"/\");\n\n // Establish DB connection first\n\n // now start the server\n System.out.println(\"=== Initializing server on port \" + PORT);\n\n Server jettyServer = new Server(PORT);\n jettyServer.setHandler(context);\n\n if (LOG_REQUESTS) {\n RequestLog requestLog = new RipLogger();\n jettyServer.setRequestLog(requestLog);\n }\n\n ServletHolder jerseyServlet = context.addServlet(ServletContainer.class, \"/sudoku/*\");\n jerseyServlet.setInitOrder(0);\n jerseyServlet.setInitParameter(\"jersey.config.server.provider.packages\", \"com.shadedreality.rest\");\n\n try {\n jettyServer.start();\n jettyServer.dumpStdErr();\n jettyServer.join();\n } catch (Exception e) {\n System.err.println(\"Uncaught Exception in server: \"+e);\n }\n finally {\n jettyServer.destroy();\n }\n }",
"@BeforeAll\n public static void start() throws Exception {\n server = new Server(0);\n ((QueuedThreadPool)server.getThreadPool()).setMaxThreads(20);\n ServletContextHandler context = new ServletContextHandler();\n context.setContextPath(\"/foo\");\n server.setHandler(context);\n context.addServlet(new ServletHolder(TestServlet.class), \"/bar\");\n context.addServlet(new ServletHolder(TimeOutTestServlet.class), \"/timeout\");\n ((ServerConnector)server.getConnectors()[0]).setHost(\"localhost\");\n server.start();\n originalPort = ((ServerConnector)server.getConnectors()[0]).getLocalPort();\n LOG.info(\"Running embedded servlet container at: http://localhost:{}\", originalPort);\n // This property needs to be set otherwise CORS Headers will be dropped\n // by HttpUrlConnection\n System.setProperty(\"sun.net.http.allowRestrictedHeaders\", \"true\");\n }",
"public static void main(String[] args) {\n new HttpService(getHttpServiceDefinition(8080)).start();\n }",
"public static void main(String[] args) {\n SpringApplication.run(PayeemanagementApplication.class, args);\n }",
"public static void main(final String[] args) {\n\t\tServer server = new Server();\n\t\tSocketConnector connector = new SocketConnector();\n\t\tconnector.setPort(9090);\n\t\tserver.setConnectors(new Connector[] {connector});\n\n\t\tWebAppContext context = new WebAppContext();\n\t\tcontext.setServer(server);\n\t\tcontext.setContextPath(\"/biomedcalib\");\n\t\tcontext.setWar(\"src/main/webapp\");\n\n\t\tserver.addHandler(context);\n\t\ttry {\n\t\t\tserver.start();\n\t\t} catch (Exception e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t}",
"private void startWebApp(Handler<AsyncResult<HttpServer>> next) {\n Router router = Router.router(vertx);\n\n router.route(\"/assets/*\").handler(StaticHandler.create(\"assets\"));\n router.route(\"/api/*\").handler(BodyHandler.create());\n\n router.route(\"/\").handler(this::handleRoot);\n router.get(\"/api/timer\").handler(this::timer);\n router.post(\"/api/c\").handler(this::_create);\n router.get(\"/api/r/:id\").handler(this::_read);\n router.put(\"/api/u/:id\").handler(this::_update);\n router.delete(\"/api/d/:id\").handler(this::_delete);\n\n // Create the HTTP server and pass the \"accept\" method to the request handler.\n vertx.createHttpServer().requestHandler(router).listen(8888, next);\n }",
"public static void main(String[] args) {\n new SpringApplicationBuilder().sources(CustomGcmEncryptorDemoApplication.class).run(args);\n }",
"public static void main(String[] args) {\n\t\tSpringApplication.run(ManolitoBackApplication.class, args);\n\t\t//SpringApplication.run(ManolitoBackApplication.class, \"--debug\");\n\t\n\t}",
"public static void main(String[] args) {\n\t\tSystem.setProperty(\"spring.config.name\", \"registration-server\");\n\t\t//SpringApplication.run(RegistrationServer.class, args);\n\t\t\n\t\t new SpringApplicationBuilder(RegistrationServer.class)\n .properties(\"spring.config.name:registration-server\").build().run(args);\n\t}",
"public static void main(final String[] args) {\n\n SpringApplication.run(TestdataAdminApplication.class, args);\n }",
"public static void main(String[] args) {\n CustomSystemPropertiesConfiguration.INSTANCE\n .configApplicationShortName(APP_SHORT_NAME);\n checkConfigPathPrefix();\n checkClusterName();\n SpringBootApplicationRunner.run(EurekaServerApplication.class, BannerPrinter.create(), args);\n }",
"public static void main(String[] args) {\n \tEmbeddedServers.add(EmbeddedServers.Identifiers.JETTY, (Routes routeMatcher, StaticFilesConfiguration staticFilesConfiguration, boolean hasMultipleHandler) -> {\r\n JettyHandler handler = setupHandler(routeMatcher, staticFilesConfiguration, hasMultipleHandler);\r\n customJettyServerFactory serv = new customJettyServerFactory();\r\n return new EmbeddedJettyServer(serv, handler);\r\n });\r\n \t\r\n \tport(80);\r\n \t\r\n \tOptions op = new Options();\r\n \top.setOptions(args);\r\n \t//LabelCreator labels = new LabelCreator(op);\r\n\r\n \t\r\n \tstaticFiles.location(\"/public\"); // Static (web accessible) files (e.g. CSS files etc.) can be placed in src/main/resources/public \r\n \tstaticFiles.header(\"Access-Control-Allow-Origin\", \"*\"); // static files can be accessed from anywhere\r\n \tstaticFiles.header(\"Access-Control-Allow-Headers\", \"*\"); // static files can be accessed from anywhere\r\n \t\r\n \t// any empty action will be redirected to the API documentation\r\n \tredirect.any(\"/\", \"/labels/\"+API_VERSION+\"/\");\r\n \tredirect.any(\"/labels\", \"/labels/\"+API_VERSION+\"/\");\r\n \tredirect.any(\"/labels/\", \"/labels/\"+API_VERSION+\"/\");\t\r\n \tredirect.any(\"/labels/\"+API_VERSION, \"/labels/\"+API_VERSION+\"/\");\r\n \t\r\n \toptions(\"/*\", (req, res) -> {\r\n \t\tString accessControlRequestHeaders = req.headers(\"Access-Control-Request-Headers\");\r\n \t\tif (accessControlRequestHeaders != null) {\r\n \t\t\tres.header(\"Access-Control-Allow-Headers\", accessControlRequestHeaders);\r\n \t\t}\r\n\r\n \t\tString accessControlRequestMethod = req.headers(\"Access-Control-Request-Method\");\r\n \t\tif (accessControlRequestMethod != null) {\r\n \t\t\tres.header(\"Access-Control-Allow-Methods\", accessControlRequestMethod);\r\n \t\t}\r\n\r\n return \"OK\";\r\n \t});\r\n \t\r\n \ttry {\r\n\t\t\t// Build swagger json description\r\n\t\t\tfinal String swaggerJson = SwaggerParser.getSwaggerJson(APP_PACKAGE);\r\n\t\t\tget(\"/labels/\"+API_VERSION+\"/\", (req, res) -> { // TODO: redirect the Swagger JSON to a Swagger UI instance instead of returning it e.g. redirect.any(\"/test\", \"http://petstore.swagger.io\");\r\n\t\t\t\tres.header(\"Content-Type\", \"application/json\");\r\n\t\t\t\treturn swaggerJson;//.replace(oldChar, newChar);\r\n\t\t\t});\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.err.println(e);\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n \t\r\n \t// Routes other than default Swagger documentation\r\n \tpath(\"/labels\", () -> {\r\n \t\tpath(\"/\"+API_VERSION, () -> {\r\n\t \t\t\r\n \t\t\tget(\"/static/*\", (req, res) -> {\r\n \t \t\t\r\n \t\t\t\t AccessStatic c = new AccessStatic(op, req, res);\r\n \t\t return c.result();\r\n \t\t\t});\r\n \t\t\t\r\n \t\t\tpost(\"/\", (req, res) -> {\r\n \t\t\t\t\r\n \t\t\t\tif(req.queryParams(\"template\")==null || req.queryParams(\"template\").isEmpty())\r\n \t\t\t\t{\t\r\n \t\t\t\t\t//res.redirect(\"/labels/\"+API_VERSION+\"/template/choose\", 303);\r\n \t\t\t\t\tTemplateCreator tmpl = new TemplateCreator(op);\r\n\t\t\t \t//tmpl.baseURL = \"http://\"+req.host();\r\n\t\t\t \ttmpl.target = tmpl.baseURL+ req.pathInfo();\r\n\t\t\t \ttmpl.origReq = req;\r\n\t\t\t \t\r\n\t\t\t \treturn tmpl.chooseTemplateForm();\r\n \t\t\t\t}\r\n \t\t\t\telse {\r\n \t\t\t\t\tString format = req.queryParams(\"format\");\r\n \t\t\t\t\tString data = req.queryParams(\"data\");\r\n \t\t\t\t\t//op.baseURL = \"http://\"+req.host() + req.pathInfo();\r\n \t\t\t\t\t//op.baseURL = op.baseURL + req.pathInfo();\r\n \t\t\t\t\t\r\n \t\t\t\t\tif(format==null || format.isEmpty())\r\n \t\t\t\t\t\tformat=\"html\";\r\n \t\t\t\t\t\r\n\t \t\t\t\tif(format.equalsIgnoreCase(\"html\"))\r\n\t \t\t\t\t\ttry {\r\n\t \t\t\t\t\t\t CreateHTML c = new CreateHTML(op, req, res);\r\n\t \t\t\t\t String re = c.result();\r\n\t \t\t\t\t return re;\r\n\t \t\t\t\t\t} catch (Exception e) {\r\n\t \t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t \t\t\t\t\t\te.printStackTrace();\r\n\t \t\t\t\t\t}\r\n\t \t\t\t\t \r\n\t \t\t\t\tif(format.equalsIgnoreCase(\"pdf\"))\r\n\t \t\t\t\t\ttry {\r\n\t \t\t\t\t\t\tCreatePDF c = new CreatePDF(op, req, res);\r\n\t \t\t\t\t return c.result();\r\n\t \t\t\t\t\t} catch (Exception e) {\r\n\t \t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t \t\t\t\t\t\te.printStackTrace();\r\n\t \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t\t\treturn \"3rror\";\r\n \t\t\t});\r\n \t\t\t\r\n \t\t\tget(\"/tmp\", (req, res) -> {\r\n \t \t\t\r\n \t\t\t\t AccessTmp c = new AccessTmp(op, req, res);\r\n \t\t return c.result();\r\n \t\t });\r\n \t\t\t\r\n \t\t\ttry {\r\n\t\t\t\t\tCreatePDFRoute.route(op);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t \r\n \t\t\ttry {\r\n\t\t\t\t\tCreateHTMLRoute.route(op);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t \r\n \t\t\ttry {\r\n\t\t\t\t\tAccessTmpRoute.route(op);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t \r\n\t\t // TODO: Metadata about existing templates\r\n\t\t // @route /templates/ \t\t=> get a list of all existing templates\r\n\t\t // @route /template/{id} \t\t=> get a specific template with unique list of included placeholders and path to html file\r\n\t\t \r\n \t\t\tpath(\"/template\", () -> {\r\n\t\t\t get(\"/show\", (req, res) -> {\r\n\t\t\t\t\t \r\n\t\t\t \tres.header(\"Content-Type\", \"text/html\");\r\n\t\t\t \t\r\n\t\t\t if(req.queryParams(\"template\")!=null)\r\n\t\t\t\t\t\t\top.templateFile = op.templateDir+\"/\"+req.queryParams(\"template\");\r\n\t\t\t \r\n\t\t\t String html = \"\";\r\n\t\t\t File file = new File(op.templateFile);\r\n\t\t\t\t\t FileInputStream fis;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t if(file.exists()) {\r\n\t\t\t\t\t\t\tfis = new FileInputStream(file);\r\n\t\t\t\t\t\t byte[] data = new byte[(int) file.length()];\r\n\t\t\t\t\t\t\tfis.read(data);\r\n\t\t\t\t\t\t fis.close();\r\n\t\t\t\t\t\t html = new String(data, \"UTF-8\");\r\n\t\t\t\t\t };\r\n\t\t\t\t\t res.body(html);\r\n\t\t\t\t\t \r\n\t\t\t\t\t return res.body();\r\n\t\t\t });\r\n\t\t\t \r\n\t\t\t get(\"/show/all\", (req, res) -> {\r\n\t\t\t \t\r\n\t\t\t \tres.header(\"Content-Type\", \"application/json\");\r\n\t\t\t \tres.body(new TemplateCreator(op).getTemplates().toString());\r\n\t\t\t \treturn res.body();\r\n\t\t\t });\r\n\t\t\t \r\n\t\t\t \r\n \t\t\t});\r\n\t\t \r\n\t\t get(\"/check\", (req, res)-> {\r\n\t\t \t\r\n\t\t \t byte[] bytes = Files.readAllBytes(Paths.get(\"templates/submit.html\")); \r\n\t\t\t HttpServletResponse raw = res.raw();\r\n\t\t\t\r\n\t\t\t raw.getOutputStream().write(bytes);\r\n\t\t\t raw.getOutputStream().flush();\r\n\t\t\t raw.getOutputStream().close();\r\n\t\t\t \r\n\t\t\t return res.raw();\r\n\t\t \t\r\n\t\t });\r\n\t\t \r\n\t\t // TODO: set option for configuring Allow-Origin through config.ini\r\n\t\t\t\tbefore((req, res) -> {\r\n\t\t\t\t\tres.header(\"Access-Control-Allow-Origin\", \"*\");\r\n\t\t\t\t\tres.header(\"Access-Control-Allow-Headers\", \"Content-Type,Authorization,X-Requested-With,Content-Length,Accept,Origin,\");\r\n\t\t\t\t});\r\n\t\t \r\n\t\t // TODO: make template editable (e.g. with (static) implementation of WYSIWYG Aloha Editor (http://alohoeditor.org))\r\n\t\t // get(\"/template/edit\", (req, res) -> {\r\n\t\t //\t\t@param Sting template: name of the template\r\n\t\t // }\r\n\t\t \r\n\t\t // TODO: save template (e.g. by sending the (full) DOM of the template edited by Aloha Editor (http://alohoeditor.org))\r\n\t\t // get(\"/template/save\", (req, res) -> {\r\n\t\t //\t\t@param String template: name of the (new) template\r\n\t\t //\t\t@param Boolean overwrite: what to do if template name already exists \r\n\t\t // }\r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t /* get(\"/json\", (req, res) -> {\r\n\t\t \r\n\t\t byte[] bytes = Files.readAllBytes(Paths.get(\"templates/data.json\")); \r\n\t\t HttpServletResponse raw = res.raw();\r\n\t\t\r\n\t\t raw.addHeader(\"Content-Type\", \"application/json\");\r\n\t\t raw.getOutputStream().write(bytes);\r\n\t\t raw.getOutputStream().flush();\r\n\t\t raw.getOutputStream().close();\r\n\t\t\r\n\t\t return res.raw();\r\n\t\t \r\n\t\t \t });\r\n\t\t */\r\n\t \t});\r\n \t});\r\n \t\r\n \tif(op.debug)\r\n \t\tenableDebugScreen(); \r\n }",
"public static void main(String[] args) {\n\n SpringApplication.run(CoronavirusAPIApplication.class, args);\n }",
"public static void main(String[] args) {\n startApplication();\n }",
"public static void main(String[] args) {\n staticFiles.location(\"/public\"); // Static files\n get(\"/hello\", (req, res) -> \"Hello World\");\n System.out.println(\"http://localhost:4567/hello\");\n }",
"public static void main(String[] args) {\n\t\tSpringApplication.run(PatyalApplication.class, args);\n\t}",
"@PostConstruct\n public void init() throws SQLException, IOException {\n Server.createWebServer(\"-webPort\", \"1777\").start();\n\n\n }",
"public static void main(String[] args) {\n LOGGER.info(Application.STARTUP.message());\n SpringApplication.run(RoleServiceApplication.class, args);\n }",
"public static void main(String[] args) {\n\t\tSpringApplication.run(SpringSocialApplication.class, args);\n\t}",
"public static void main(String[] args) {\n\n\t\tConfigurableApplicationContext context =new SpringApplicationBuilder(\n\t\t\t\tApplication.class).headless(false).run(args);\n\n\t\tnew Simple2();\n\t}",
"public static void main(String[] args) {\n\t\t SpringApplication.run(YueHeMain.class, args);\r\n\t}",
"public static void main(String[] args) {\n SpringApplication.run(NetflixZuulApiGatewayServerApplication.class, args);\n }"
] | [
"0.66772383",
"0.6510733",
"0.6342585",
"0.6257453",
"0.618954",
"0.6095858",
"0.60347307",
"0.6026154",
"0.60245717",
"0.5980793",
"0.59618396",
"0.59618396",
"0.59458065",
"0.59322244",
"0.59028673",
"0.5847758",
"0.5832146",
"0.58321285",
"0.58321285",
"0.58321285",
"0.58321285",
"0.58288646",
"0.58226335",
"0.58095235",
"0.58016247",
"0.57988316",
"0.5792679",
"0.5766999",
"0.5763493",
"0.5741206",
"0.5718671",
"0.5717349",
"0.57155913",
"0.5711968",
"0.5708658",
"0.5705306",
"0.56946373",
"0.5687287",
"0.5660027",
"0.5656379",
"0.5656379",
"0.56392735",
"0.56353635",
"0.56340677",
"0.56311244",
"0.5611602",
"0.56097525",
"0.5584962",
"0.5582113",
"0.55448866",
"0.5535546",
"0.55290574",
"0.55260223",
"0.5517395",
"0.54974055",
"0.5492347",
"0.54838276",
"0.54828817",
"0.5476553",
"0.5462294",
"0.54598916",
"0.5459521",
"0.54402363",
"0.5435336",
"0.5434212",
"0.5418768",
"0.5417906",
"0.5405981",
"0.54058576",
"0.5404189",
"0.5401556",
"0.53967065",
"0.5391884",
"0.5383285",
"0.53674555",
"0.5351017",
"0.5317487",
"0.53024495",
"0.529713",
"0.52888715",
"0.5284595",
"0.52821857",
"0.5272201",
"0.5267422",
"0.525886",
"0.5255383",
"0.52542365",
"0.5239516",
"0.5236516",
"0.5234139",
"0.5231384",
"0.5230897",
"0.52263546",
"0.52257276",
"0.5223172",
"0.52213496",
"0.5218291",
"0.52182174",
"0.5194491",
"0.51881"
] | 0.54931545 | 55 |
TODO Autogenerated method stub | @Override
public boolean addUser(User user) {
Object object = null;
boolean flag = false;
try {
object = client.insert("addUser", user);
System.out.println("添加学生信息的返回值:" + object);
} catch (SQLException e) {
e.printStackTrace();
}
if (object != null) {
flag = true;
}
return flag;
} | {
"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 boolean deleteUser(int id) {
boolean flag = false;
Object object = null;
try {
object = client.delete("deleteUserById", id);
System.out.println("删除学生信息的返回值:" + object + ",这里返回的是影响的行数");
} catch (SQLException e) {
e.printStackTrace();
}
if (object != null) {
flag = true;
}
return flag;
} | {
"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 boolean updateUser(User user) {
boolean flag = false;
Object object = false;
try {
object = client.update("updateStudent", user);
System.out.println("更新学生信息的返回值:" + object + ",返回影响的行数");
} catch (SQLException e) {
e.printStackTrace();
}
if (object != null) {
flag = true;
}
return flag;
} | {
"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 List<User> selectAllUser() {
List<User> users = null;
try {
users = client.queryForList("selectAllUser");
} catch (SQLException e) {
e.printStackTrace();
}
return users;
} | {
"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 List<User> selectUserByName(String name) {
List<User> users = null;
try {
users = client.queryForList("selectUserByName", name);
} catch (SQLException e) {
e.printStackTrace();
}
return users;
} | {
"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 User selectUserById(int id) {
User user = null;
try {
user = (User) client.queryForObject("selectUserById", id);
} catch (SQLException e) {
e.printStackTrace();
}
return user;
} | {
"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 |
Broadcast SERVICE_READY_ACTION to inform that this service is now monitoring for beacons. | private void broadcastReadyAction() {
Log.d(TAG, "broadcastReadyAction start");
final Intent intent = new Intent();
intent.setAction(BeaconsMonitoringService.SERVICE_READY_ACTION);
getBaseContext().sendBroadcast(intent);
Log.d(TAG, "broadcastReadyAction end");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void onIBeaconServiceConnect();",
"@Override\n public void onServiceConnected(ComponentName className,\n IBinder service) {\n HomeActivityWatcherService.MyBinder binder = (HomeActivityWatcherService.MyBinder) service;\n mWatcherService = binder.getService();\n mBound = true;\n }",
"public void onCreate() {\n\t\tSystem.out.println(\"This service is called!\");\n\t\tmyBluetoothAdapter= BluetoothAdapter.getDefaultAdapter();\n\t\tmyBluetoothAdapter.enable();\n\t\tSystemClock.sleep(5000);\n\t\tif (myBluetoothAdapter.isEnabled()){\n\t\t\tSystem.out.println(\"BT is enabled...\");\n\t\t\tdiscover = myBluetoothAdapter.startDiscovery();\n\t\t}\n\t\tSystem.out.println(myBluetoothAdapter.getScanMode());\n\t\t\n\t\tSystem.out.println(\"Discovering: \"+myBluetoothAdapter.isDiscovering());\n\t\t//registerReceiver(bReceiver, new IntentFilter(BluetoothDevice.ACTION_FOUND));\n\t\tIntentFilter filter1 = new IntentFilter(BluetoothDevice.ACTION_FOUND);\n\t\tIntentFilter filter2 = new IntentFilter(BluetoothAdapter.ACTION_DISCOVERY_FINISHED);\n\t\tthis.registerReceiver(bReceiver, filter1);\n\t\tthis.registerReceiver(bReceiver, filter2);\n\t\t//registerReceiver(bReceiver, new IntentFilter(BluetoothAdapter.ACTION_DISCOVERY_FINISHED));\n\t}",
"@Override\n public void onServiceConnected(ComponentName componentName, IBinder service) {\n mNanoBLEService = ((NanoBLEService.LocalBinder) service).getService();\n\n //initialize bluetooth, if BLE is not available, then finish\n if (!mNanoBLEService.initialize()) {\n finish();\n }\n\n //Start scanning for devices that match DEVICE_NAME\n final BluetoothManager bluetoothManager =\n (BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE);\n mBluetoothAdapter = bluetoothManager.getAdapter();\n mBluetoothLeScanner = mBluetoothAdapter.getBluetoothLeScanner();\n if(mBluetoothLeScanner == null){\n finish();\n Toast.makeText(NewScanActivity.this, \"Please ensure Bluetooth is enabled and try again\", Toast.LENGTH_SHORT).show();\n }\n mHandler = new Handler();\n if (SettingsManager.getStringPref(mContext, SettingsManager.SharedPreferencesKeys.preferredDevice, null) != null) {\n preferredDevice = SettingsManager.getStringPref(mContext, SettingsManager.SharedPreferencesKeys.preferredDevice, null);\n scanPreferredLeDevice(true);\n } else {\n scanLeDevice(true);\n }\n }",
"public boolean isServiceReady();",
"public void onServiceConnected(ComponentName className, IBinder service) {\n\t\t\tmBoundService = ((LocalService.LocalBinder) service).getService();\r\n\r\n\t\t\t// Wenn während des Setups der Service noch nicht fertig geladen\r\n\t\t\t// ist, wird solange Warte-Overlay angezeigt\r\n\t\t\t// Wenn der Service fertig ist wird das Overlay ausgeblendet\r\n\r\n\t\t\t// if (OverlayActivity.isCreated) {\r\n\t\t\t// OverlayActivity.getInstance().dismiss();\r\n\t\t\t// }\r\n\t\t\tSetupSearchDevicesFragment fragment = (SetupSearchDevicesFragment) getFragmentById(\"SetupSearchDevicesFragment\");\r\n\t\t\tif (fragment.isVisible()) {\r\n\t\t\t\tfragment.initViewBluetooth();\r\n\t\t\t}\r\n\r\n\t\t\t// Tell the user about this for our demo.\r\n\t\t\tLog.i(TAG, \"Service connected with app...\");\r\n\t\t\t// Toast.makeText(MainActivity.this, \"Service connected.\", Toast.LENGTH_SHORT).show();\r\n\r\n\t\t\t// Verbinde mit gespeichertem Device (falls noch keine Verbindung\r\n\t\t\t// besteht)\r\n\t\t\tif (mSharedPrefs.getConnectivityType() == 1) { // BEI BT\r\n\r\n\t\t\t\tfinal ConnectionInterface connection = mBoundService.getConnection();\r\n\t\t\t\tif (connection != null) {\r\n\t\t\t\t\tif (!connection.isConnected()) {\r\n\r\n\t\t\t\t\t\t// OnConnectedListener\r\n\t\t\t\t\t\tconnection.setOnConnectedListener(new OnConnectedListener() {\r\n\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\tpublic void onConnectedListener(String deviceName) {\r\n\r\n\t\t\t\t\t\t\t\tconnection.registerDisconnectHandler();\r\n\r\n\t\t\t\t\t\t\t\tif (mSharedPrefs.getDeviceMode() == 1) { // ELTERN\r\n\t\t\t\t\t\t\t\t\t// HELLO Nachricht senden\r\n\t\t\t\t\t\t\t\t\tString msg = mContext.getString(R.string.BABYFON_MSG_CONNECTION_HELLO) + \";\"\r\n\t\t\t\t\t\t\t\t\t\t\t+ mSharedPrefs.getHostAddress() + \";\" + mSharedPrefs.getPassword();\r\n\t\t\t\t\t\t\t\t\tconnection.sendMessage(msg);\r\n\r\n\t\t\t\t\t\t\t\t\tmSharedPrefs.setRemoteOnlineState(true);\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\r\n\t\t\t\t\t\tif (mSharedPrefs.getDeviceMode() == 1) { // ELTERN\r\n\t\t\t\t\t\t\tif (mSharedPrefs.getRemoteAddress() != null) { // Gespeichertes Gerät\r\n\t\t\t\t\t\t\t\t// Verbinde\r\n\t\t\t\t\t\t\t\tmBoundService.connectTo(mSharedPrefs.getRemoteAddress());\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else if (mSharedPrefs.getDeviceMode() == 0) { // BABY\r\n\t\t\t\t\t\t\t// Warte auf Verbindung\r\n\t\t\t\t\t\t\tmBoundService.startServer();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}",
"@Override\n public void onBeaconServiceConnect() {\n beaconManager.setRangeNotifier(new RangeNotifier() {\n @Override\n public void didRangeBeaconsInRegion(final Collection<Beacon> beacons, Region region) {\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n if (beacons.size() > 0) {\n for (Beacon beacon : beacons) mBeaconList.addBeacon(beacon);\n mBeaconList.notifyDataSetChanged();\n }\n }\n });\n }\n });\n\n try {\n beaconManager.startRangingBeaconsInRegion(new Region(\"myRangingUniqueId\", null, null, null));\n } catch (RemoteException e) {\n Log.d(TAG, \"Exception caught in ServiceConnect\");\n }\n }",
"@Override\n\tpublic void onBeaconServiceConnect() {\n\t\tbeaconManager.setRangeNotifier(new RangeNotifier() {\n\t\t\t@Override\n\t\t\tpublic void didRangeBeaconsInRegion(Collection<Beacon> beacons,\n\t\t\t\t\tRegion region) {\n\t\t\t\tif (beacons.size() > 0) {\n\t\t\t\t\tLog.i(TAG_SEARCHING_ACTIVITY_LOG, \"Found \" + beacons.size()\n\t\t\t\t\t\t\t+ \"beacons\");\n\t\t\t\t\tfor (Iterator<Beacon> bIterator = beacons.iterator(); bIterator\n\t\t\t\t\t\t\t.hasNext();) {\n\t\t\t\t\t\tfinal Beacon beacon = bIterator.next();\n\t\t\t\t\t\tif (isGimbalTag(beacon)) {\n\t\t\t\t\t\t\tString major = beacon.getId2().toString();\n\t\t\t\t\t\t\tif(Double.parseDouble(major) == 100){\n\t\t\t\t\t\t\t\t// generate the HashMap key, which is the\n\t\t\t\t\t\t\t\t// combination of tag's UUID, Major and Minor; But\n\t\t\t\t\t\t\t\t// you can always choose your own key\n\t\t\t\t\t\t\t\tfinal String key = new StringBuilder()\n\t\t\t\t\t\t\t\t\t\t.append(beacon.getId1())\n\t\t\t\t\t\t\t\t\t\t.append(beacon.getId2())\n\t\t\t\t\t\t\t\t\t\t.append(beacon.getId3()).toString();\n\t\t\t\t\t\t\t\tdiscoveredBeaconMap.put(key, beacon);\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\tupdateDiscoveredList();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\ttry {\n\t\t\tbeaconManager.startRangingBeaconsInRegion(new Region(\n\t\t\t\t\t\"myRangingUniqueId\", null, null, null));\n\t\t} catch (RemoteException e) {\n\t\t}\n\t}",
"@Override\n public void onServiceConnected(ComponentName name, IBinder service) {\n System.out.println(\"绑定成功\");\n }",
"@Override\n public void onReady() {\n if (Notificare.shared().isNotificationsEnabled()) {\n Notificare.shared().enableNotifications();\n }\n // Check if location updates are enabled, by default they are not.\n if (Notificare.shared().isLocationUpdatesEnabled()) {\n Notificare.shared().enableLocationUpdates();\n if (NotificarePushLibPlugin.getPluginSetting(\"enableBeacons\")) {\n Notificare.shared().enableBeacons();\n }\n }\n }",
"@Override\n\t\t\tpublic void onServiceConnected(ComponentName name, IBinder service) {\n\t\t\t}",
"public void onServiceConnected();",
"public void onServiceConnected(ComponentName className, IBinder service) {\n\t mBoundAutopilotService = new Messenger(service);\n\t //mCallbackText.setText(\"Attached.\");\n\n\t // We want to monitor the service for as long as we are\n\t // connected to it.\n\t try {\n\t Message msg = Message.obtain(null, autopilotService.MSG_REGISTER_CLIENT);\n\t msg.replyTo = mMessenger;\n\t mBoundAutopilotService.send(msg);\n\n\t // Give it some value as an example.\n\t //msg = Message.obtain(null, autopilotService.MSG_ECHO, this.hashCode(), 0);\n\t //mBoundAutopilotService.send(msg);\n\t msg = Message.obtain(null, autopilotService.MSG_IS_SERVICE_RUNNING, 0, 0);\n\t mBoundAutopilotService.send(msg);\n\t Log.i(\"anemoi\", \"Here 0\");\n\t } catch (RemoteException e) {\n\t // In this case the service has crashed before we could even\n\t // do anything with it; we can count on soon being\n\t // disconnected (and then reconnected if it can be restarted)\n\t // so there is no need to do anything here.\n\t }\n\t Log.i(\"anemoi\", \"Buuu\");\n\t }",
"@Override\r\n\tprotected void onServiceConnected() {\n\t\taccessibilityServiceInfo.eventTypes = AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED;\r\n \r\n // If you only want this service to work with specific applications, set their\r\n // package names here. Otherwise, when the service is activated, it will listen\r\n // to events from all applications.\r\n //info.packageNames = new String[]\r\n //{\"com.appone.totest.accessibility\", \"com.apptwo.totest.accessibility\"};\r\n \r\n // Set the type of feedback your service will provide.\r\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {\r\n \taccessibilityServiceInfo.feedbackType = AccessibilityServiceInfo.FEEDBACK_ALL_MASK;\r\n } else {\r\n \taccessibilityServiceInfo.feedbackType = AccessibilityServiceInfo.FEEDBACK_GENERIC;\r\n } \r\n \r\n // Default services are invoked only if no package-specific ones are present\r\n // for the type of AccessibilityEvent generated. This service *is*\r\n // application-specific, so the flag isn't necessary. If this was a\r\n // general-purpose service, it would be worth considering setting the\r\n // DEFAULT flag.\r\n \r\n // info.flags = AccessibilityServiceInfo.DEFAULT;\r\n \r\n accessibilityServiceInfo.notificationTimeout = 100;\r\n \r\n this.setServiceInfo(accessibilityServiceInfo);\r\n\t}",
"private void setupConnStateBroadcastReceiver() {\n connStateBroadcastReceiver = new BroadcastReceiver() {\n @Override\n public void onReceive(Context context, Intent intent) {\n if (\"com.example.loravisual.CONNECTION_STATE_CHANGED\".equals(intent.getAction())) {\n final Handler handler = new Handler(Looper.getMainLooper());\n final Runnable runnable = new Runnable() {\n public void run() {\n connected = intent.getBooleanExtra(\"com.example.loravisual.CONNECTION_STATE\", false);\n if (connected) {\n Toast.makeText(context, \"connected to device\", Toast.LENGTH_SHORT).show();\n getSupportActionBar().setSubtitle(getString(R.string.connected));\n ready = true;\n } else {\n Toast.makeText(context, \"disconnected\", Toast.LENGTH_SHORT).show();\n getSupportActionBar().setSubtitle(getString(R.string.disconnected));\n ready = false;\n }\n }\n };\n handler.postDelayed(runnable, 2000); // waiting time equivalent to the time in onServicesDiscovered for other BLE connections\n }\n }\n };\n IntentFilter filter = new IntentFilter(\"com.example.loravisual.CONNECTION_STATE_CHANGED\");\n registerReceiver(connStateBroadcastReceiver, filter);\n }",
"@Override\r\n\t\tpublic void onServiceConnected(ComponentName name, IBinder service) {\r\n\t\t\tRestartAppService.MyBinder mBinder = (RestartAppService.MyBinder) service;\r\n\t\t\tmBinder.startRestartTask(App.this);\r\n\t\t}",
"@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 }",
"@Override\n public void onServiceConnected(ComponentName className,\n IBinder service) {\n ConnectionService.ConnectionBinder binder = (ConnectionService.ConnectionBinder) service;\n mService = binder.getService();\n mBound = true;\n }",
"@Override\n\t\tpublic void onServiceConnected(ComponentName className, IBinder service) {\n\t\t\tMediaPlayerService.LocalMPBinder binder = (MediaPlayerService.LocalMPBinder) service;\n\t\t\tmService = binder.getService();\n\t\t\tmBound = true;\n\t\t\tif (mService.isAutoPlayCase() && getBooleanPreference(getString(R.string.autoplay_switch), false) && mSavedStationDefinition != null)\n\t\t\t\tdoClickOnStopPlayButton(/*getPlayStopButton(), */false);\n\t\t\tsynchronizePlayPauseButton();\n\t\t\tFragmentManager fm = getSupportFragmentManager();\n\t\t\tif (fm != null) {\n\t\t\t\tList<Fragment> fragments = fm.getFragments();\n\t\t\t\tif(fragments != null) {\n\t\t\t\t\tfor (Fragment fragment : fragments) {\n\t\t\t\t\t\tif (fragment != null) {\n\t\t\t\t\t\t\tif (fragment instanceof FavoriteStationsFrame) {\n\t\t\t\t\t\t\t\t((FavoriteStationsFrame) fragment).synchronizeOnServiceConnected(mService);// do something\n\t\t\t\t\t\t\t\tLog.e(\"MTA:onServ.Conn.\", \"FSF:synchronizeOnServiceConnected\");\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tLog.e(\"MTA:onServ.Conn.\", className.toString());\n\t\t}",
"@Override\r\n public void onServiceConnected(ComponentName name, IBinder service) {\n mServiceHandle = ((RecorderService.RecorderBinder) service).getService();\r\n // The observable to observe to for each state change.\r\n mStateChangeHandler = ((RecorderService.RecorderBinder) service)\r\n .observeStateChanges() // Method we declared, returns an observable we can observe.\r\n .distinctUntilChanged() // Not needed, but if someone (in the future of course) requests the current state, we don't want to update the textview twice.\r\n .subscribe(recorderState -> {\r\n mStateText.setText(recorderState.toString());\r\n switch (recorderState) {\r\n case STARTED:\r\n mIsRunning = true;\r\n ((TextView) getContentView().findViewById(R.id.screen_recorder_record_button)).setText(\"Stop\");\r\n break;\r\n case STOPPED:\r\n mIsRunning = false;\r\n ((TextView) getContentView().findViewById(R.id.screen_recorder_record_button)).setText(\"Start\");\r\n }\r\n });\r\n }",
"@Override\n\t\tpublic void onServiceConnected(ComponentName name, IBinder service) {\n\t\t\tib = service;\n\t\t\tSystem.out.println(\"DEBUG>>>ServiceConnection.\");\n\t\t}",
"public void onServiceConnected(ComponentName className, IBinder service) {\n \tmServiceMessenger = new Messenger(service);\r\n // We want to monitor the service for as long as we are\r\n // connected to it.\r\n try {\r\n Message message = Message.obtain(null, WATCHiTServiceInterface.REGISTER_CLIENT);\r\n message.replyTo = mMessenger;\r\n mServiceMessenger.send(message);\r\n } catch (RemoteException e) {\r\n // In this case the service has crashed before we could even\r\n // do anything with it; we can count on soon being\r\n // disconnected (and then reconnected if it can be restarted)\r\n // so there is no need to do anything here.\r\n }\r\n // Toast.makeText(MainActivity.this, R.string.remote_service_bound, Toast.LENGTH_SHORT).show();\r\n }",
"public void onServiceConnected(ComponentName className, IBinder binder) {\n\t\tLog.i(this.getClass().getSimpleName(), \"onServiceConnected: \"\n\t\t\t\t+ className.toShortString());\n\n\t\tBtBinder b = (BtBinder) binder;\n\t\tbtService = b.getService();\n\t\tboolean is_set = btService.setListener(getBtListener());\n\n\t\tif (is_set) {\n\t\t\t// Get state if listener wasn't already attached.\n\t\t\tIntent serviceIntent = new Intent(this, BTService.class)\n\t\t\t\t\t.setAction(BTService.ACTION_GET_STATE);\n\t\t\tstartService(serviceIntent);\n\t\t}\n\n\t\tToast.makeText(BaseAct.this, R.string.btservice_connected,\n\t\t\t\tToast.LENGTH_SHORT).show();\n\t}",
"public void onScanViewReady() {\n\t\tupdateGuiState();\n\n\t\tif (!mInitialised) {\n\t\t\t// Broadcast receiver\n\t\t\tregisterReceiver(mReceiver, mFilter);\n\n\t\t\tif (mBtAdapter.isEnabled()) {\n\t\t\t\t// Start straight away\n\t\t\t\tstartBluetoothLeService();\n\t\t\t} else {\n\t\t\t\t// Request BT adapter to be turned on\n\t\t\t\tIntent enableIntent = new Intent(\n\t\t\t\t\t\tBluetoothAdapter.ACTION_REQUEST_ENABLE);\n\t\t\t\tstartActivityForResult(enableIntent, REQ_ENABLE_BT);\n\t\t\t}\n\t\t\tmInitialised = true;\n\t\t} else {\n\t\t\t// mScanView.notifyDataSetChanged();\n\t\t}\n\t}",
"@Override\n public void onServiceConnected(ComponentName className,\n IBinder service) {\n LocalBinder binder = (LocalBinder) service;\n mService = binder.getService();\n mBound = true;\n }",
"@Override\n public int onStartCommand(Intent intent, int flags, int startId) {\n\n LocalBroadcastManager.getInstance(this).registerReceiver(mMessageReceiver,\n new IntentFilter(\"location-update\"));\n\n Log.d(\"MyWeatherService\", \"started\");\n return START_STICKY;\n }",
"public void onServiceConnected(ComponentName arg0, IBinder service) {\n\t\t\tLog.d(\"ShimmerService\", \"Service connected\");\n\t\t\tLocalBinder binder = (ShimmerService.LocalBinder) service;\n\t\t\tmService = binder.getService();\n\t\t\tmServiceBind = true;\n\t\t\tmService.setHandlerMain(mHandler);\n\t\t\t// update the view\n\t\t}",
"@Override\n public void onBeaconServiceConnect() {\n beaconManager.addRangeNotifier(new RangeNotifier() {\n @Override\n public void didRangeBeaconsInRegion(Collection<Beacon> beacons,Region region) {\n Log.i(\"beacon\",\"Beacon Size:\"+beacons.size());\n Log.i(\"beaconManager\",\"beaconRanging\");\n if (beacons.size() > 0) {\n Iterator<Beacon> beaconIterator = beacons.iterator();\n while (beaconIterator.hasNext()) {\n Beacon beacon = beaconIterator.next();\n logBeaconData(LBD.Find_Loc(beacon,2));\n }\n }\n }\n\n });\n try {\n beaconManager.startRangingBeaconsInRegion(new Region(\"myRangingUniqueId\",\n null, null, null));\n } catch (RemoteException e) {\n e.printStackTrace();\n }\n\n }",
"@SuppressLint(\"NewApi\")\n @Override\n public void onServiceConnected(ComponentName name, IBinder service) {\n bleService = ((BleService.LocalBinder) service).getService();\n if (!bleService.init()) {\n finish();\n }\n bleService.connect(Home_Fragment.Device_Address);\n mpd = ProgressDialog.show(Dialog_Activity.this, null, \"正在连接设备...\");\n Log.i(\"DeviceConnect\", \"onServiceConnected: \");\n }",
"@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\t\tthis.registerReceiver(battInfoRec, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));\n\t\t\n\t}",
"private void initializeBLEService(IBinder service) {\n mBluetoothLeService = ((BluetoothLeService.LocalBinder) service).getService();\n if (!mBluetoothLeService.initialize()) {\n Log.e(TAG, \"Unable to initialize Bluetooth\");\n }\n\n mActivity.registerReceiver(mGattUpdateReceiver, makeGattUpdateIntentFilter());\n // Automatically connects to the device upon successful start-up initialization.\n// mActivity.runOnUiThread(new Runnable() {\n// @Override\n// public void run() {\n// mBluetoothLeService.connect(mDeviceAddress);\n//\n// }\n// });\n mBluetoothLeService.connect(mDeviceAddress);\n }",
"@Override\n public void onServiceConnected(ComponentName className,\n IBinder service) {\n BinderService.LocalBinder binder = (BinderService.LocalBinder) service;\n mService = binder.getService();\n mBound = true;\n }",
"public void onServiceConnected(ComponentName className, IBinder service) {\n // Following the example above for an AIDL interface,\n // this gets an instance of the IRemoteInterface, which we can use to call on the service\n wsService = IWindscribeInterface.Stub.asInterface(service);\n System.out.println(\"on service connected in activity (#\"+myPid()+\")\");\n try {\n wsService.startVPN(\"LOL\");\n Event res = wsService.sendAndReceive(new Event(\"to service from activity\"));\n System.out.println(\"from service in activity:\"+res);\n\n } catch (RemoteException e) {\n e.printStackTrace();\n }\n }",
"@Override\n\t\tpublic void onServiceConnected(ComponentName name, IBinder service) {\n\t\t\tLocalBinder binder = (LocalBinder)service;\n\t\t\tmService = binder.getService();\n\t\t\t//Toast.makeText(SyncServiceActivity.this, \"onServiceConnected=>\"+mService, Toast.LENGTH_SHORT).show();\n\t\t\t\n\t\t}",
"@Override\n public void onServiceConnected(ComponentName name, IBinder service) {\n\n // Sets the binder for the service.\n SSMusicService.SSMusicBinder binder = (SSMusicService.SSMusicBinder) service;\n musicService = binder.getService();\n serviceBound = true; // Indicates that the service is bounded.\n }",
"@Override\n public void startMonitoring() {\n beaconManager.getBeaconParsers().add(new BeaconParser().\n setBeaconLayout(\"m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24\"));\n beaconManager.bind(this);\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n // Android M Permission check
\n if (this.checkSelfPermission(android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n final AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(\"This app needs location access\");\n builder.setMessage(\"Please grant location access so this app can detect beacons.\");\n builder.setPositiveButton(android.R.string.ok, null);\n builder.setOnDismissListener(new DialogInterface.OnDismissListener() {\n\n public void onDismiss(DialogInterface dialog) {\n requestPermissions(new String[]{android.Manifest.permission.ACCESS_COARSE_LOCATION}, PERMISSION_REQUEST_COARSE_LOCATION);\n }\n });\n builder.show();\n }\n }\n }",
"@Override\n\t\t\t\tpublic void onServiceConnected(ComponentName p1, IBinder p2)\n\t\t\t\t{\n\t\t\t\t}",
"private void enableBtmon() {\n System.out.println(\"Starting Btmon Service...\");\n try {\n btmonProcess = new ProcessBuilder(\"/usr/bin/btmon\").start();\n InputStreamReader inputStream = new InputStreamReader(btmonProcess.getInputStream());\n int size;\n char buffer[] = new char[1024];\n while ((size = inputStream.read(buffer, 0, 1024)) != -1) {\n // System.out.println(\" --- Read ----\");\n String data = String.valueOf(buffer, 0, size);\n processBeaconMessage(data);\n // Thread.sleep(1000);\n }\n } catch (IOException ex ) {\n ex.printStackTrace();\n } catch (Exception ex ) {\n ex.printStackTrace();\n } finally {\n if (btmonProcess != null)\n btmonProcess.destroy();\n }\n }",
"@Override\n\t\tpublic void onServiceConnected(ComponentName name, IBinder service) {\n\t\t\tmBinder = (Stub) service;\n\t\t\tLog.d(TAG, \"mBinder init\");\n\t\t}",
"public void onServiceConnected(ComponentName className,\n\t\t\t\tIBinder service) {\n\t\t\tLocalBinder binder = (LocalBinder) service;\n\t\t\tconnService = binder.getService();\n\t\t\tconnServiceBound = true;\n\t\t}",
"@Override\n public void onServiceConnected(ComponentName className,\n IBinder service) {\n ServerService.LocalBinder binder = (ServerService.LocalBinder) service;\n mService = binder.getService();\n mBound = true;\n }",
"@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\tLog.e(\"androidtalk\", \"service created\") ;\n\t\tSystem.out.println(\"androidtalk-service created\") ;\n\t\t\n\t}",
"public void onServiceConnected(ComponentName param1, IBinder param2) {\n }",
"public void onServiceConnected(ComponentName className, IBinder service) {\n imService = ((FriendLocationService.IMBinder)service).getService(); \r\n \r\n \r\n }",
"@Override\n public void onServiceConnected(ComponentName className,\n IBinder service) {\n GrcBoxBinder binder = (GrcBoxBinder) service;\n grcBoxCli = binder.getService();\n mBound = true;\n \t\t\n \t\tif(!grcBoxCli.isRegistered()){\n \t\t\tgrcBoxCli.register(getResources().getString(R.string.app_name));\n \t\t}\n\t\t\tfor(GrcBoxRule rule: pendingRules){\n\t\t\t\tnew NewRuleTask(\"\").execute(rule);\n\t\t\t}\n\t\t\tpendingRules.clear();\n }",
"public void onServiceConnected() {\r\n\t\tapiEnabled = true;\r\n\r\n\t\t// Display the list of calls\r\n\t\tupdateList();\r\n }",
"public void onServiceConnected(ComponentName className, IBinder service) {\n mService = new Messenger(service);\n mBound = true;\n }",
"public void onServiceConnected(ComponentName className, IBinder service) {\n mService = new Messenger(service);\n mBound = true;\n }",
"private void initService() {\n connection = new AppServiceConnection();\n Intent i = new Intent(this, AppService.class);\n boolean ret = bindService(i, connection, Context.BIND_AUTO_CREATE);\n Log.d(TAG, \"initService() bound with \" + ret);\n }",
"@Override\n public void onServiceConnected(ComponentName name, IBinder service) {\n MediaPlayerService.LocalBinder binder = (MediaPlayerService.LocalBinder) service;\n player = binder.getService();\n serviceBound = true;\n\n\n //Toast.makeText(QuranListenActivity.this, \"Service Bound\", Toast.LENGTH_SHORT).show();\n }",
"@Override\n\tpublic void onReceive(Context arg0, Intent arg1) {\n\t\tif(arg1==null || arg1.getAction()==null)\n\t\t\treturn;\n\t\tif (arg1.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) {\n\t\t\tIntent startIntent = new Intent();\n\t\t\tstartIntent.setClass(arg0, MointorServices.class);\n\t\t\targ0.startService(startIntent);\n\t\t}\n\t}",
"@Override\n public void onDnsSdServiceAvailable(String instanceName, String registrationType, WifiP2pDevice sourceDevice) {\n Log.i(TAG, \"BonjourServiceAvailable: \\ninstanceName: \" + instanceName + \"\\n \" + sourceDevice.toString());\n }",
"@Override\n public void onCreate() {\n super.onCreate();\n // Check if Google Map API Services is Available\n if (servicesOK()) {\n Log.d(Constants.SERVICE_STARTED, Constants.GOOGLE_MAP_ONLINE);\n // build google map client and connect\n buildGoogleApiClient();\n mGoogleApiClient.connect();\n }\n }",
"private void registerForBatteryStatus()\n\t{\n\t\tif(!isReceiverRegistered)\n\t\t{\n\t\t\tLogger.D(TAG, \"registerForBatteryStatus async\");\n\t\t\tActivity activity = RhodesActivity.safeGetInstance();\n\t\t\tif(activity != null)\n\t\t\t{\n\t\t\t\tactivity.registerReceiver(this, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));\n\t\t\t\tactivity.registerReceiver(this, new IntentFilter(Intent.ACTION_BATTERY_LOW));\n\t\t\t\tisReceiverRegistered = true;\n\t\t\t}\n\t\t\telse Logger.E(TAG, \"Could not communicate with main Activity\");\n\t\t}\n\t}",
"@Override\n public void onServiceConnected(ComponentName name, IBinder service) {\n MediaPlayerService.LocalBinder binder = (MediaPlayerService.LocalBinder) service;\n player = binder.getService();\n serviceBound = true;\n player.setCallbacks(MainActivity.this);\n\n //Toast.makeText(MainActivity.this, \"Service Bound\", Toast.LENGTH_SHORT).show();\n }",
"@Override\n\tprotected void initAsService() {\n\t\tif (log.isDebugEnabled()) {\n\t\t\tlog.debug(\"Initiating service...\");\n\t\t}\n\t\trunnerFuture = activityRunner.schedule(this::scanModulesHealth, 500, TimeUnit.MILLISECONDS);\n\t}",
"@Override\r\n\t\tpublic void onServiceConnected(ComponentName className, IBinder service) {\n\t\t\ttry {\r\n\t\t\t\tmSpiderX = SpiderX.Stub.asInterface(service);\r\n\t\t\t\tif(mSpiderX != null && spiderCallback != null){\r\n\t\t\t\t\tmSpiderX.setSpiderCallBack(spiderCallback);\r\n\t\t\t\t}\r\n\t\t\t\tfor(EventBus handler:mEventBus){\r\n\t\t\t\t\thandler.onEvent(TYPE_SERVICEBINDER_SUCESS,\"\",\"\");\r\n\t\t\t\t}\r\n\t\t\t} catch (RemoteException e) {\r\n\t\t\t\tLog.d(TAG, \" \"+e);\r\n\t\t\t}\r\n\t\t}",
"void doBindService() {\n\t\tbindService(new Intent(this, eidService.class), mConnection, Context.BIND_AUTO_CREATE);\n//\t\tLog.i(\"Convert\", \"At doBind2.\");\n\n\t\tmIsBound = true;\n\t\n\t\tif (mService != null) {\n//\t\t\tLog.i(\"Convert\", \"At doBind3.\");\n\t\t\ttry {\n\t\t\t\t//Request status update\n\t\t\t\tMessage msg = Message.obtain(null, eidService.MSG_UPDATE_STATUS, 0, 0);\n\t\t\t\tmsg.replyTo = mMessenger;\n\t\t\t\tmService.send(msg);\n\t\t\t\tLog.i(\"Convert\", \"At doBind4.\");\n\t\t\t\t//Request full log from service.\n\t\t\t\tmsg = Message.obtain(null, eidService.MSG_UPDATE_LOG_FULL, 0, 0);\n\t\t\t\tmService.send(msg);\n\t\t\t} catch (RemoteException e) {}\n\t\t}\n//\t\tLog.i(\"Convert\", \"At doBind5.\");\n\t}",
"@Override\n public void onCreate() {\n HandlerThread thread = new HandlerThread(\"ServiceStartArguments\", THREAD_PRIORITY_BACKGROUND);\n thread.start();\n Log.d(\"LOG19\", \"DiscoveryService onCreate\");\n\n this.mLocalBroadCastManager = LocalBroadcastManager.getInstance(this);\n // Get the HandlerThread's Looper and use it for our Handler\n mServiceLooper = thread.getLooper();\n\n mServiceHandler = new ServiceHandler(mServiceLooper);\n }",
"@Override\n public int onStartCommand(Intent intent, int flags, int startId) {\n Toast.makeText(this, R.string.start_location_updates, Toast.LENGTH_SHORT).show();\n Log.d(Constants.SERVICE_STARTED, Constants.SERVICE_STARTED);\n return START_STICKY;\n }",
"@Override\n\t\tpublic void onServiceConnected(ComponentName name, IBinder service) {\n\n\t\t\tYC_SERVICE_BINDER = IYCService.Stub.asInterface(service);\n\n\t\t}",
"@Override\n public void onServiceConnected(ComponentName name, IBinder service) {\n MyService.LocalBinder binder = (MyService.LocalBinder) service;\n myService = binder.getService();\n isBound = true;\n\n }",
"@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\n\t\tlogMessage(\"onCreate\");\n\t\tsetContentView(R.layout.main);\n\n\t\tCheckBox enableCheckBox = (CheckBox) findViewById(R.id.ServiceEnableCB);\n\t\t\n\t\t// Check Service Status\n\t\tboolean perfEnabled = AutoBTUtil.readPreference(this);\n\t\tif (perfEnabled) {\n\t\t\tenableCheckBox.setChecked(true);\n\t\t\tstartMainService();\n\t\t} else {\n\t\t\tenableCheckBox.setChecked(false);\n\t\t\tstopMainService();\n\t\t}\n\t\tenableCheckBox\n\t\t\t\t.setOnCheckedChangeListener(new ServiceEnableCheckBoxChangeListener());\n\t}",
"private void checkUSBConnectionOnStartUp(){\n //Notification and icon\n NotificationCompat.Builder builder = new NotificationCompat.Builder(this, \"765\");\n Intent chargingStatus = registerReceiver(powerConnectionReceiver, filter);\n int plugged = chargingStatus.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1);\n isPowerConnected = plugged == BatteryManager.BATTERY_PLUGGED_AC || plugged == BatteryManager.BATTERY_PLUGGED_USB;\n if(SensorService.isPowerConnected){\n builder.setContentTitle(\"Earthquake Detection Enabled\")\n .setSmallIcon(R.drawable.ic_earthquake)\n .setAutoCancel(true);\n // Main Activity icon change: StateBroadcast\n sendBroadcast(new Intent().setAction(EARTHQUAKE_STATE));\n }\n else{\n builder.setContentTitle(\"Fall Detection Enabled\")\n .setSmallIcon(R.drawable.ic_falling_man)\n .setAutoCancel(true);\n // Main Activity icon change: StateBroadcast\n sendBroadcast(new Intent().setAction(STANDING_STATE));\n }\n notificationManager = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);\n notificationManager.notify(1, builder.build());\n }",
"@Override\n public void onServiceConnected(ComponentName name, IBinder service) {\n RemoteControlService.LocalBinder binder = (RemoteControlService.LocalBinder) service;\n binder.getService( ).startIfNotStarted( );\n }",
"@Override\r\n public void onCreate() {\r\n Log.d(TAG, \"on service create\");\r\n }",
"private void processStart() {\n // broadcast HELLO to every neighbors\n for(int i = 0; i < this.nextAvailPort; i++) {\n if(this.ports[i].getRemoteRouterDesc() == null) {\n continue;\n }\n\n SOSPFPacket helloPak = SOSPFPacket.createHelloPak(this.routerDesc, this.ports[i].getRemoteRouterDesc());\n this.ports[i].send(helloPak);\n\n this.ports[i].initializeHeartbeat();\n }\n }",
"public void onStart(){ \r\n\t\t//ensure bluetooth is enabled \r\n\t\tensureBluetoothIsEnabled();\r\n\t\tsuper.onStart(); \t\r\n\t}",
"void doBindService() {\r\n\r\n bindService(new Intent(MainActivity.this, CurrentLocationUtil.class),\r\n connection, // ServiceConnection object\r\n Context.BIND_AUTO_CREATE); // Create service if not\r\n\r\n isBound = true;\r\n\r\n }",
"@Override\n public void onServiceConnected(ComponentName name, IBinder service) {\n TimerService.TimerBinder binder = (TimerService.TimerBinder)service;\n mService = binder.getService();\n mBound = true;\n // Ensure the service is not in the foreground when bound\n mService.background();\n }",
"@Override\n\t\tpublic void onServiceConnected(ComponentName name, IBinder service) {\n\t\t\tmsgService = ((MyService.MsgBinder) service).getService();\n\t\t\t// recieve callback progress\n\t\t\tmsgService.SetOnProgressListner(new OnProgressListner() {\n\n\t\t\t\t@Override\n\t\t\t\tpublic void onProgress(int progress) {\n\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\tmProgressBar.setProgress(progress);\n\t\t\t\t}\n\t\t\t});\n\t\t}",
"@Override\n public void onServiceConnected(ComponentName className,\n IBinder service) {\n LocalService.LocalBinder binder = (LocalService.LocalBinder) service;\n mService = binder.getService();\n mBound = true;\n }",
"@Override\n public void onServiceConnected(ComponentName className,\n IBinder service) {\n LocalService.LocalBinder binder = (LocalService.LocalBinder) service;\n mService = binder.getService();\n mBound = true;\n }",
"@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.test_service_activity);\n\n\t\tIntent intent = new Intent(\n\t\t\t\t\"com.demo.androidontheway.testservice.MSG_ACTION\");\n\t\tbindService(intent, conn, Context.BIND_AUTO_CREATE);\n\n\t\tmProgressBar = (ProgressBar) findViewById(R.id.pro_service);\n\t\tButton mButton = (Button) findViewById(R.id.btn_start_service);\n\t\tmButton.setOnClickListener(new OnClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// start download at service\n\t\t\t\tmsgService.startDownLoad();\n\t\t\t}\n\t\t});\n\t}",
"private void startService() {\n\n if (!mAlreadyStartedService ) {\n\n //mMsgView.setText(R.string.msg_location_service_started);\n\n //Start location sharing service to app server.........\n Intent intent = new Intent(this, LocationMonitoringService.class);\n startService(intent);\n\n mAlreadyStartedService = true;\n //Ends................................................\n }\n }",
"@Override\n public void onServiceConnected(ComponentName name, IBinder service) {\n Log.d(\"service\", \"onServiceConnected() \" + name.getClassName());\n mMyServ = ((MyService.LocalBinder) service).getService();\n }",
"@Override\n public void onConnected(Bundle bundle) {\n Log.i(TAG, \"location service connected\");\n }",
"public void addReadyListener(ComponentSystemEventListener listener) {\n listeners.add(listener);\n }",
"@Override\r\n\t\t\tpublic void onServiceConnected(ComponentName name, IBinder service)\r\n\t\t\t{\n\t\t\t\tSystem.out.println(\"connect\");\r\n\t\t\t\tService_DealCloseReport mService = ((myBinder)service).getService();\r\n\t\t\t}",
"@Override\n\tpublic void onCreate() {\n\t\tnotifyServiceReceiver = new NotifyServiceReceiver();\n\t\tsuper.onCreate();\n\t}",
"@Override\n\tpublic void onCreate() {\n\t\tLog.i(TAG, \"service on create\");\n\t\tsuper.onCreate();\n\t}",
"void onSystemReady();",
"@Override\n public void onCreate() {\n if (messageServiceUtil == null)\n messageServiceUtil = new MessageServiceUtil();\n messageServiceUtil.startMessageService(this);\n keepService2();\n }",
"public void NotificationService(RBeacon rBeacon, Context context){\n\t\tif(rBeacon.status.equals(\"exit\")){\n\t\t\tBeaconNotification.Notification(rBeacon.locationId,\"exit\",context);\n\t\t}\n\t\telse{\n\t\t\tif(rBeacon.lastNotificationTime == null){\n\t\t\t\trBeacon.lastNotificationTime = Calendar.getInstance();\n\t\t\t\tBeaconNotification.Notification(rBeacon.locationId,\"entry\",context);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tCalendar temp1 =(Calendar)rBeacon.lastNotificationTime.clone();\n\t\t\t\tSharedPreferences preferences = context.getSharedPreferences(RBeacon.BEACON_NOTIFICATION_CREDENTIALS,0);\n\t\t\t\ttemp1.add(Calendar.SECOND, preferences.getInt(\"DUPLICATE_BEACON_MIN_DELAY\",0));\n\t\t \tCalendar CurrentTime = Calendar.getInstance();\n\t\t \tint status = temp1.compareTo(CurrentTime);\n\t\t\t\tif(status<0){\n\t\t\t\t\trBeacon.lastNotificationTime = Calendar.getInstance();\n\t\t\t\t\tBeaconNotification.Notification(rBeacon.locationId,\"entry\",context);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"@Override\n\tpublic void onReceive(Context context, Intent intent) {\n\t\tString action = intent.getAction();\n\t\tif (Intent.ACTION_BOOT_COMPLETED.equals(action)) {\n\t\t\t//\n\t\t\tIntent intent2 = new Intent();\n\t\t\tintent2.setClass(context, TrafficService.class);\n\t\t\tcontext.startService(intent2);\n\t\t}\n\t}",
"@Override\n public void onServiceConnected(ComponentName name, IBinder service) {\n Service_GPSInternal.LocalBinder binder = (Service_GPSInternal.LocalBinder) service;\n mGPSTrackingService = binder.getService();\n mGPSServiceBounded = true;\n mGPSTrackingService.setOnServiceListener(mGPSListener);\n }",
"public void connectService() {\n log_d( \"connectService()\" );\n\t\t// no action if debug\n if ( BT_DEBUG_SERVICE ) {\n\t\t\ttoast_short( \"No Action in debug\" );\n \treturn;\n }\n\t\t// connect the BT device at once\n\t\t// if there is a device address. \n\t\tString address = getPrefAddress();\n\t\tif ( isPrefUseDevice() && ( address != null) && !address.equals(\"\") ) {\n\t \tBluetoothDevice device = mBluetoothAdapter.getRemoteDevice( address );\n\t \tif ( mBluetoothService != null ) {\n\t \t log_d( \"connect \" + address );\n\t \tmBluetoothService.connect( device );\n\t }\n\t\t// otherwise\n\t\t// send message for the intent of the BT device list\n\t\t} else {\n\t\t\tnotifyDeviceList();\n\t\t}\n\t}",
"public void listen()\n {\n service = new BService (this.classroom, \"tcp\");\n service.register();\n service.setListener(this);\n }",
"@Override\n public void onReceive(Context context, Intent intent) {\n Log.i(\"--All\", \"Boot Wakeful\");\n Toast.makeText(context, \"Boot Wakeful\", Toast.LENGTH_LONG).show();\n Intent startServiceIntent = new Intent(context, LaunchedService.class);\n startWakefulService(context, startServiceIntent);\n\n }",
"@Override\n protected void onStart() {\n super.onStart();\n\n if (mBangingTunesItent == null) {\n mBangingTunesItent = new Intent(this, BangingTunes.class);\n final boolean bindIndicator = bindService(mBangingTunesItent, mServiceConnection, Context.BIND_AUTO_CREATE);\n final ComponentName componentName = startService(mBangingTunesItent);\n }\n }",
"@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tbattInfoRec = new BroadcastReceiver() {\n\t\t\t@Override\n\t\t\tpublic void onReceive(Context context, Intent intent) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tif(intent.getAction().equals(Intent.ACTION_BATTERY_CHANGED)) {\n\t\t\t\t\tInteger a = intent.getIntExtra(BatteryManager.EXTRA_STATUS, -1);\n\t\t\t\t\tInteger b = intent.getIntExtra(BatteryManager.EXTRA_HEALTH, -1);\n\t\t\t\t\tresult[0] = a.toString();\n\t\t\t\t\tresult[1] = b.toString();\n\t\t\t\t\tflag[0] = true;\n\t\t\t\t\tgetChargeInfo();\n\t\t\t\t\t\n\t\t\t\t\tif(flag[0] && flag[1]) {\n\t\t\t\t\t\tString content = \"\";\n\t\t\t\t\t\tfor(int i = 0 ; i < result.length; i++) {\n\t\t\t\t\t\t\tcontent += result[i];\n\t content += (i == result.length - 1) ? \"\" :\"|\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t((AutoMMI)getApplication()).recordResult(TAG, content, \"2\");\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t}\n\t\t};\n\t}",
"@Override\n public void onCreate() {\n if (mReceiver == null) {\n mReceiver = new HeadsetPluggedReceiver();\n }\n\n //checking for the headset trigger is active or not...\n if (SettingsHelper.getPrefBool(getBaseContext(), Constants.PREF_IS_HEADSET_TRIGGER_ACTIVE, false)) {\n Logger.d(\"HEADSET: 1+ headset tasks active. Starting headset monitor\");\n getBaseContext().registerReceiver(mReceiver, new IntentFilter(Intent.ACTION_HEADSET_PLUG));\n } else {\n Logger.d(\"No Headset triggers found\");\n this.stopSelf();\n }\n }",
"@Override\n protected void onStarted() {\n\n super.onStarted();\n\n // No need for discovery services in Archive mode\n if (mIsArchive) return; //TODO: maybe remove this line - should be caught by the NETWORK_NONE case\n\n\n switch (mNetworkType) {\n case BabbleService.NETWORK_NONE:\n Log.i(TAG, \"NONE / Archive\");\n return;\n case BabbleService.NETWORK_WIFI:\n Log.i(TAG, \"WIFI / MDNS\");\n mAdvertiser = new MdnsAdvertiser(mGroupDescriptor, sDiscoveryPort, mAppContext);\n break;\n case BabbleService.NETWORK_P2P:\n Log.i(TAG, \"P2P\");\n mAdvertiser = P2PService.getInstance(mAppContext);\n break;\n }\n\n // mMdnsAdvertiser = new MdnsAdvertiser(mGroupDescriptor, sDiscoveryPort, mAppContext);\n\n Log.i(TAG, \"onStarted: Port \"+sDiscoveryPort);\n\n mHttpPeerDiscoveryServer = new HttpPeerDiscoveryServer(sDiscoveryPort, mBabbleNode); //TODO: use next available port?\n try {\n mHttpPeerDiscoveryServer.start();\n mAdvertiser.advertise(); // start mDNS advertising if server started\n mAdvertising = true;\n } catch (IOException ex) {\n //Probably the port is in use, we'll continue without the discovery service\n }\n }",
"@Override\n public IBinder onBind(Intent intent) {\n if(DEBUG)Log.d(TAG, \"onBind\");\n serviceConnected = true;\n Toast.makeText(getApplicationContext(), \"binding\", Toast.LENGTH_SHORT).show();\n return mMessenger.getBinder();\n }",
"@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\n\t\tif (leaved) {\n\t\t\tleaved = false;\n\t\t\tsendRequest();\n\t\t}\n\n\t\tregisterReceiver(broadcastReceiver, new IntentFilter(Constants.BROADCAST_ACTION));\n\t}",
"@Override\r\n\tpublic void run() {\n\t\tIntent intent = new Intent(\"android.intent.action.BOOT_COMPLETED\"); \r\n\t\tresolveInfo = context.getPackageManager().queryBroadcastReceivers(intent, 0);\r\n\t}",
"@Override\n public void onReceive(Context context, Intent intent) {\n String action = intent.getAction();\n //开机启动\n if(action.equals(\"android.intent.action.BOOT_COMPLETED\")){\n// Intent intent0 = context.getPackageManager().getLaunchIntentForPackage(context.getPackageName());\n// intent0.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n// context.startActivity(intent0);\n Intent intent1 = new Intent(context ,ScanService.class);\n // 启动指定Server\n context.startService(intent1);\n }\n }",
"@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState){\n\t\tmStart.setOnClickListener(new OnClickListener(){\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\tif (receiver==null) {\n\t\t\t\t\treceiver = new myReceiver();\n\t\t\t\t\tIntentFilter filter=new IntentFilter();\n\t\t\t\t\tfilter.addAction(\"com.chris.hadoop v\");\n\t\t\t\t\tmActivity.registerReceiver(receiver, filter);\n\t\t\t\t}\n\t\t\t\tIntent intent=new Intent(getActivity(),trafficMonitorService.class);\n\t\t\t\tmActivity.startService(intent);\n\t\t\t\tToast.makeText(mActivity,\" \",Toast.LENGTH_SHORT).show();\n\t\t\t}\n\t\t});\n\t\tmStop.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\tif (receiver!=null) {\n\t\t\t\t\tmActivity.unregisterReceiver(receiver);\n\t\t\t\t\treceiver=null;\n\t\t\t\t}\n\t\t\t\tIntent intent=new Intent(mActivity,trafficMonitorService.class);\n\t\t\t\tmActivity.stopService(intent);\n\t\t\t\tToast.makeText(mActivity, \"ֹͣ\",Toast.LENGTH_SHORT).show();\n\t\t\t}\n\t\t\t\n\t\t});\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}",
"public void startService() {\r\n Log.d(LOG, \"in startService\");\r\n startService(new Intent(getBaseContext(), EventListenerService.class));\r\n startService(new Intent(getBaseContext(), ActionService.class));\r\n getListenerService();\r\n\r\n }",
"@Subscribe(threadMode = ThreadMode.MAIN, sticky = true)\n public void onCaptureServiceConnectionStateChange(ConnectionStateEvent event) {\n Log.d(TAG, \"onService() called with: event = [\" + event + \"]\");\n if (socketSnack != null) {\n socketSnack.dismiss();\n }\n\n TextView tv = findViewById(R.id.main_service_status);\n\n ConnectionState state = event.getState();\n mCaptureClient = event.getClient();\n\n if (state.hasError()) {\n Log.d(TAG, \"CaptureServiceConnectionStateChange with error : \" + state.getError());\n setText(tv, COLOR_ERROR, \"Error\");\n\n CaptureError error = state.getError();\n if (error.getCode() == CaptureError.COMPANION_NOT_INSTALLED) {\n // Prompt to install\n socketSnack = Snackbar.make(findViewById(R.id.main_content),\n \"Socket Mobile Companion must be installed to use your scanner\",\n Snackbar.LENGTH_INDEFINITE);\n socketSnack.setAction(\"Install\", new View.OnClickListener() {\n @Override public void onClick(View v) {\n // Install\n Capture.installCompanion(v.getContext());\n socketSnack.dismiss();\n }\n });\n socketSnack.show();\n } else if (error.getCode() == CaptureError.SERVICE_NOT_RUNNING) {\n // The first time you receive this error, the client may still be disconnecting.\n // Wait until the client is disconnected before attempting to restart\n if (state.isDisconnected()) {\n if (Capture.notRestartedRecently()) {\n Capture.restart(this);\n } else {\n // Something is seriously wrong\n socketSnack = Snackbar.make(findViewById(R.id.main_content),\n \"Please restart Companion and this app\",\n Snackbar.LENGTH_INDEFINITE);\n socketSnack.show();\n }\n }\n } else if (error.getCode() == CaptureError.BLUETOOTH_NOT_ENABLED) {\n socketSnack = Snackbar.make(findViewById(R.id.main_content),\n \"Bluetooth must be enabled to use your scanner\",\n Snackbar.LENGTH_INDEFINITE);\n socketSnack.setAction(\"Enable\", new View.OnClickListener() {\n @Override public void onClick(View v) {\n // Enable Bluetooth - requires BLUETOOTH permission\n startActivity(new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE));\n }\n });\n socketSnack.show();\n } else {\n socketSnack = Snackbar.make(findViewById(R.id.main_content), error.getMessage(),\n Snackbar.LENGTH_INDEFINITE);\n socketSnack.show();\n }\n } else {\n // Connection has been established. You will be notified when a device is connected and ready.\n // do something or do nothing\n switch (state.intValue()) {\n case ConnectionState.CONNECTING:\n setText(tv, COLOR_PENDING,\"Connecting\");\n break;\n case ConnectionState.CONNECTED:\n setText(tv, COLOR_PENDING,\"Connected\");\n break;\n case ConnectionState.READY:\n setText(tv, COLOR_READY,\"Ready\");\n break;\n case ConnectionState.DISCONNECTING:\n setText(tv, COLOR_PENDING,\"Disconnecting\");\n break;\n case ConnectionState.DISCONNECTED:\n setText(tv, COLOR_IDLE, \"Disconnected\");\n }\n }\n }"
] | [
"0.62322706",
"0.6172145",
"0.606287",
"0.5888429",
"0.58478254",
"0.5836148",
"0.5834863",
"0.5806974",
"0.5797838",
"0.5761465",
"0.5717421",
"0.57060426",
"0.5631631",
"0.5568756",
"0.55410266",
"0.5508395",
"0.55025154",
"0.5487961",
"0.5486029",
"0.5485145",
"0.54586893",
"0.5448358",
"0.5420585",
"0.54047596",
"0.5402041",
"0.53955096",
"0.53940684",
"0.53899187",
"0.5382437",
"0.53793997",
"0.53674656",
"0.53622127",
"0.5344983",
"0.5341404",
"0.53385943",
"0.53330266",
"0.53306973",
"0.53225625",
"0.5316712",
"0.5315256",
"0.5312789",
"0.5306728",
"0.5304198",
"0.5277757",
"0.5265153",
"0.5254206",
"0.52518344",
"0.52518344",
"0.524404",
"0.523721",
"0.5231491",
"0.5226185",
"0.52239734",
"0.52237207",
"0.5220747",
"0.52144986",
"0.5212787",
"0.5204731",
"0.52002484",
"0.5196537",
"0.51954615",
"0.5184705",
"0.51824486",
"0.5140191",
"0.5136756",
"0.51351047",
"0.51330596",
"0.5132567",
"0.5106702",
"0.510254",
"0.510215",
"0.5097525",
"0.5097525",
"0.50949913",
"0.5088698",
"0.50846636",
"0.5079678",
"0.507477",
"0.5073457",
"0.5064568",
"0.50466335",
"0.50439584",
"0.50378704",
"0.50375426",
"0.50365955",
"0.5032825",
"0.50305575",
"0.5026111",
"0.5023097",
"0.50194156",
"0.50131893",
"0.5011376",
"0.5003555",
"0.500125",
"0.4997272",
"0.4988928",
"0.49888143",
"0.4981245",
"0.49808398",
"0.4980355"
] | 0.82489604 | 0 |
Created by 1 on 09.04.2016. | public interface ReaderAdapter {
String readChinese(String text);
String readEnglish(String text);
String readUrdu(String text);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void perish() {\n \n }",
"private stendhal() {\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"private static void cajas() {\n\t\t\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"public final void mo51373a() {\n }",
"public Pitonyak_09_02() {\r\n }",
"public void mo38117a() {\n }",
"Petunia() {\r\n\t\t}",
"public void mo4359a() {\n }",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\n public void memoria() {\n \n }",
"private void poetries() {\n\n\t}",
"@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\n\t}",
"@Override\n\tpublic void create () {\n\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void jugar() {\n\t\t\n\t}",
"@Override\n\tpublic void create() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n protected void getExras() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n public void func_104112_b() {\n \n }",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"private Rekenhulp()\n\t{\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo12930a() {\n }",
"private UsineJoueur() {}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"@Override\n\tpublic void dibuja() {\n\t\t\n\t}",
"public void mo55254a() {\n }",
"@Override\n\tpublic void create() {\n\n\t}",
"public static void listing5_14() {\n }",
"@Override\n public int getOrder() {\n return 0;\n }",
"public void create() {\n\t\t\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"public contrustor(){\r\n\t}",
"public void mo21877s() {\n }",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n void init() {\n }",
"private TMCourse() {\n\t}",
"@Override\n public void init() {\n }",
"@Override\n public int getSize() {\n return 1;\n }",
"public void mo6081a() {\n }",
"public void mo1531a() {\n }",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\r\n\tpublic void create() {\n\r\n\t}",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n public void init() {}",
"@Override\n public int getOrder() {\n return 4;\n }",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"public void mo9848a() {\n }",
"@Override\n public void init() {\n\n }",
"@Override\n public void init() {\n\n }",
"@Override\r\n\tpublic void create() {\n\t\t\r\n\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"private void kk12() {\n\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}"
] | [
"0.58109176",
"0.57105994",
"0.56745005",
"0.56583405",
"0.56145597",
"0.5592694",
"0.5573087",
"0.5558605",
"0.555386",
"0.555386",
"0.5544163",
"0.5524545",
"0.55165714",
"0.5512773",
"0.5495727",
"0.54489195",
"0.5447729",
"0.544528",
"0.544528",
"0.5436215",
"0.54313284",
"0.54286003",
"0.5415881",
"0.54072875",
"0.53924215",
"0.53699136",
"0.5368542",
"0.5311213",
"0.5309125",
"0.52997607",
"0.5291414",
"0.5274354",
"0.5266471",
"0.526595",
"0.5261621",
"0.5253758",
"0.5251093",
"0.5243794",
"0.5233904",
"0.523181",
"0.52191705",
"0.52191705",
"0.52191705",
"0.52191705",
"0.52191705",
"0.52191705",
"0.52191705",
"0.52183205",
"0.5215189",
"0.5211767",
"0.5202437",
"0.5200446",
"0.5195195",
"0.5181944",
"0.5179677",
"0.516839",
"0.5163908",
"0.5163908",
"0.5163908",
"0.5163908",
"0.5163908",
"0.5158002",
"0.51548845",
"0.5150837",
"0.5148388",
"0.51450884",
"0.51285285",
"0.5126652",
"0.5123261",
"0.51225764",
"0.5115095",
"0.51131666",
"0.51117367",
"0.51112485",
"0.51084507",
"0.50895053",
"0.50892323",
"0.5085461",
"0.50834507",
"0.50809056",
"0.5074983",
"0.50749075",
"0.50749075",
"0.50749075",
"0.50691485",
"0.5061778",
"0.50601953",
"0.5054953",
"0.50545096",
"0.50545096",
"0.50545096",
"0.5052421",
"0.5052421",
"0.5052421",
"0.5051963",
"0.50490415",
"0.50490415",
"0.50465006",
"0.5044388",
"0.50440615",
"0.50420946"
] | 0.0 | -1 |
Emit the calculated score to downstream. | public void calculateScores(OutputCollector collector, List<T> observationList) {
List<ScorePackage> packageList = getScores(observationList);
for (ScorePackage scorePackage : packageList) {
collector.emit(new Values(scorePackage.getId(), scorePackage.getScore(), scorePackage.getObj()));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void emit() {\n counter.increment(METRIC_VALUE);\n }",
"@Override\n\tpublic void inputScore() {\n\n\t}",
"@Override\r\n\t\t\t\tpublic void run() {\n\t\t\t\t\tString msg = \"score@\";\r\n\t\t\t\t\tmsg += changeRank(duiduipeng);\r\n\t\t\t\t\tmsg += changeRank(ddt);\r\n\t\t\t\t\tmsg += changeRank(tuixiangzi);\r\n\t\t\t\t\tmsg += changeRank(feiji);\r\n\t\t\t\t\t//System.out.println(msg);\r\n\t\t\t\t\tsendToAll(msg);\r\n\t\t\t\t}",
"@Override\n\tpublic void printScore() {\n\n\t}",
"void updateScore () {\n scoreOutput.setText(Integer.toString(score));\n }",
"public void hitAlienScore() {\r\n //Add 5 to the score\r\n score += 5;\r\n System.out.println(\"Current Score = \"+score);\r\n }",
"@Override\n\tpublic double getTotalScore() {\n\t\treturn score;\n\t}",
"@Override\n\tpublic void readScore() {\n\t\t\n\t}",
"@Override\n\tpublic void readScore() {\n\t\t\n\t}",
"public double getScore() {\r\n return score;\r\n }",
"public abstract float getScore();",
"@Override\r\n\tpublic double getScore() {\n\t\treturn score;\r\n\t}",
"@Override\n public int getScore() {\n return score;\n }",
"public int getScore() { return score; }",
"@Override\n public int getScore() {\n return totalScore;\n }",
"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}",
"public void addScore()\n {\n score += 1;\n }",
"public static void score() {\n\t\tSystem.out.println(\"SCORE: \");\n\t\tSystem.out.println(player1 + \": \" + score1);\n\t\tSystem.out.println(player2 + \": \" + score2);\n\t}",
"@Override\r\n\tpublic double getScore() \r\n\t{\r\n\t\treturn this._totalScore;\r\n\t}",
"private void printScore() {\r\n View.print(score);\r\n }",
"public Float getScore() {\n return score;\n }",
"public int getScore() {return score;}",
"@Override\npublic void update(int score) {\n\t\n}",
"public float getScore() {\n return score;\n }",
"public float getScore(){return score;}",
"public synchronized void setScore(Integer score) {\n this.score += score;\n }",
"public void setScore(int score) { this.score = score; }",
"public void setScore(int score)\n\t{\n\t\tthis.score += score;\n\t}",
"private void updateScore() {\n\t\tscoreString.updateString(Integer.toString(score));\n\t}",
"public int score() {\n return score;\n }",
"protected abstract void calcScores();",
"public void calcScore(int score) {\r\n\t\tif (initFinish)\r\n\t\t\tthis.score += score * this.multy;\r\n\t\t// TODO delete\r\n//\t\tSystem.out.println(\"score: \" + this.score + \"multy: \" + this.multy);\r\n\t}",
"@Override\n public void passScore(int score) {\n this.score = score;\n scoreFragment.setData(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 }",
"int getScore() {\n return score;\n }",
"void emit(TrackerPayload payload);",
"public Double getScore() {\n return this.score;\n }",
"public Double getScore() {\n return this.score;\n }",
"@Override\r\n public void calculate() {\r\n TextOutput();\r\n }",
"public int getScore()\n {\n return score;\n }",
"public int getScore() {\r\n return score;\r\n }",
"public int getScore() {\r\n return score;\r\n }",
"public int getScore() {\r\n return score;\r\n }",
"public static void incrementScore() {\n\t\tscore++;\n\t}",
"public int getScore() {\n return score;\n }",
"public int getScore() {\n return score;\n }",
"public void updateScore(int score){ bot.updateScore(score); }",
"float getScore();",
"float getScore();",
"@Override\n\tpublic void submitScoreGPGS(float score) {\n\t}",
"public double getScore() {\r\n return mScore;\r\n }",
"public int getScore() {\n return score;\n }",
"protected abstract List<Integer> doEmit(OUT flinkTuple);",
"public int getScore(){ return this.score; }",
"public int getScore(){\n return this.score;\n }",
"public void setScore(double score) {\r\n this.score = score;\r\n }",
"public void setScore(int score) {this.score = score;}",
"public abstract double sentimentScore(Message message);",
"public int getScore ()\r\n {\r\n\treturn score;\r\n }",
"public int getScore(){\r\n\t\treturn score;\r\n\t}",
"public int getScore(){\r\n\t\treturn score;\r\n\t}",
"public void updateScore() {\n\n Main.rw.readFile();\n setScore(Main.rw.getStackInfo());\n\n\n }",
"public int getTotalScore(){\r\n return totalScore;\r\n }",
"protected final void calcScore()\n {\n\n m_score = SCORE_OTHER;\n\n if (null == m_targetString)\n calcTargetString();\n }",
"@Override\n\tpublic void saveScore() {\n\t\t\n\t}",
"public float getScore() {\r\n\t\treturn score;\r\n\t}",
"@Override\r\n public boolean accept (ScoreVisitor visitor)\r\n {\r\n return visitor.visit(this);\r\n }",
"@Override\n\tpublic void saveScore() {\n\n\t}",
"Float getScore();",
"@Override\n public void emitOutput() {\n }",
"public int getTotalScore(){\n return totalScore;\n }",
"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 long getScore() {\n return score_;\n }",
"public long getScore() {\n return score_;\n }",
"public int getScore()\n {\n return score; \n }",
"public int getScore(){\n\t\treturn score;\n\t}",
"public int getScore(){\n\t\treturn score;\n\t}",
"@Override\n public void onTimer(long timestamp, OnTimerContext context, Collector<ProcessedScore> out) throws Exception {\n flipSide();\n\n // Emit all saved processed scores. This is pretty expensive\n Iterable<ProcessedScore> savedProcessedScores = savedProcessedScoresState.get();\n for (ProcessedScore processedScore : savedProcessedScores) {\n out.collect(processedScore);\n }\n // Clear out all saved processed scores for releasing space\n savedProcessedScoresState.clear();\n }",
"public float getScore() {\n\t\treturn score;\n\t}",
"public void calculateScore() {\n for (Sequence seq: currentSeq) {\n double wordWeight = Retriever.getWeight(seq);\n String token = seq.getToken();\n int size = seq.getRight() - seq.getLeft() + 1;\n int titleCount = getCount(token.toLowerCase(), title.toLowerCase());\n if (titleCount != 0) {\n setMatch(size);\n setTitleContains(true);\n }\n int lowerCount = getCount(token.toLowerCase(), lowerContent);\n if (lowerCount == 0) {\n// scoreInfo += \"Token: \" + token + \" Original=0 Lower=0 WordWeight=\" + wordWeight + \" wordTotal=0\\n\";\n continue;\n }\n int originalCount = getCount(token, content);\n lowerCount = lowerCount - originalCount;\n if (lowerCount != 0 || originalCount != 0) {\n setMatch(size);\n }\n double originalScore = formula(wordWeight, originalCount);\n double lowerScore = formula(wordWeight, lowerCount);\n final double weight = 1.5;\n double addedScore = weight * originalScore + lowerScore;\n// scoreInfo += \"Token: \" + token + \" Original=\" + originalScore + \" Lower=\" + lowerScore +\n// \" WordWeight=\" + wordWeight + \" wordTotal=\" + addedScore + \"\\n\";\n dependencyScore += addedScore;\n }\n currentSeq.clear();\n }",
"public void setScore(Float score) {\n this.score = score;\n }",
"public int getScore(){return score;}",
"public int getScore(){return score;}",
"public void addOneToScore() {\r\n score++;\r\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 }",
"public void setScore(float value) {\n this.score = value;\n }",
"public void setScore(Double score) {\n this.score = score;\n }",
"public int getScore()\r\n\t{\r\n\t\treturn score;\r\n\t}",
"public int getScore()\r\n\t{\r\n\t\treturn score;\r\n\t}",
"public int getScore() {\r\n \treturn score;\r\n }",
"public int getScore() {\n return this.score;\n }",
"public int getScore()\n {\n return currentScore;\n }",
"public void incrementScore(int val) {\n score += val;\n }",
"public void setScore(float score) {\n this.score = score;\n }",
"public int getScore() {\n return currentScore;\n }",
"public int getScore()\n {\n // put your code here\n return score;\n }",
"public long getScore() {\n return score_;\n }",
"public long getScore() {\n return score_;\n }",
"public double getScore() {\n\t\t\treturn this.score;\n\t\t}",
"public void addScore(int score) {\n currentScore += score;\n }"
] | [
"0.64131284",
"0.6226742",
"0.6084205",
"0.6071431",
"0.6006169",
"0.59668195",
"0.5945137",
"0.5938547",
"0.5938547",
"0.58238393",
"0.5823194",
"0.5822209",
"0.58104086",
"0.5796177",
"0.5780892",
"0.5761501",
"0.576144",
"0.57300466",
"0.5724904",
"0.5716374",
"0.57047683",
"0.5674155",
"0.5671897",
"0.5654529",
"0.56544775",
"0.5653418",
"0.5632781",
"0.56253076",
"0.5623145",
"0.5622552",
"0.5620165",
"0.5601176",
"0.5599357",
"0.55733156",
"0.5572358",
"0.5572003",
"0.5565823",
"0.5565823",
"0.55618674",
"0.5561427",
"0.5560446",
"0.5560446",
"0.5560446",
"0.55583584",
"0.555196",
"0.555196",
"0.5540612",
"0.5524485",
"0.5524485",
"0.5522908",
"0.55189884",
"0.55169064",
"0.551295",
"0.55097616",
"0.5506555",
"0.55028224",
"0.549134",
"0.549121",
"0.54836756",
"0.5481896",
"0.5481896",
"0.5475878",
"0.54754454",
"0.54700947",
"0.5466182",
"0.5465082",
"0.54597396",
"0.5458317",
"0.5448445",
"0.54474175",
"0.54463875",
"0.54456",
"0.54421914",
"0.54421914",
"0.5439594",
"0.5434181",
"0.5434181",
"0.54269886",
"0.5423173",
"0.54151666",
"0.5411948",
"0.54095435",
"0.54095435",
"0.540825",
"0.5406027",
"0.5402376",
"0.5390338",
"0.53888035",
"0.53888035",
"0.53858715",
"0.5377327",
"0.53713834",
"0.5370129",
"0.5364718",
"0.5363859",
"0.53541887",
"0.5335933",
"0.5335933",
"0.53353155",
"0.53251266"
] | 0.56686705 | 23 |
Calculate the data instance anomaly score for given data instances and directly send to downstream. | public abstract List<ScorePackage> getScores(List<T> observationList); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static double calcError(Instances data, Instances data2) {\n\t\t// calculate the total l1 norm of the class values of the two data sets \n\t\tdouble error = 0;\n\t\tfor (int i=0; i < data.numInstances(); ++i) {\n\t\t\terror += Math.abs(data.instance(i).classValue() - data2.instance(i).classValue());\t\t\t\n\t\t}\n\t\treturn error;\n\t}",
"private void analyze() {\n\t\tdouble org = 0;\n\t\tdouble avgIndPerDoc = 0;\n\t\tdouble avgTotalPerDoc = 0;\n\n\t\tfor (Instance instance : instanceProvider.getInstances()) {\n\n\t\t\tint g = 0;\n\t\t\tSet<AbstractAnnotation> orgM = new HashSet<>();\n\n//\t\t\torgM.addAll(instance.getGoldAnnotations().getAnnotations());\n//\t\t\tg += instance.getGoldAnnotations().getAnnotations().size();\n\n\t\t\tfor (AbstractAnnotation instance2 : instance.getGoldAnnotations().getAnnotations()) {\n\n\t\t\t\tResult r = new Result(instance2);\n\n\t\t\t\t{\n////\t\t\t\t\tList<AbstractAnnotation> aa = Arrays.asList(r.getTrend());\n//\t\t\t\t\tList<AbstractAnnotation> aa = Arrays.asList(r.getInvestigationMethod());\n////\t\t\t\t\tList<AbstractAnnotation> aa = new ArrayList<>(\n////\t\t\t\t\t\t\tr.getDefinedExperimentalGroups().stream().map(a -> a.get()).collect(Collectors.toList()));\n//\n//\t\t\t\t\torgM.addAll(aa);\n//\t\t\t\t\tg += aa.size();\n\t\t\t\t}\n\n\t\t\t\t{\n\t\t\t\t\t/**\n\t\t\t\t\t * props of exp\n\t\t\t\t\t */\n\t\t\t\t\tfor (DefinedExperimentalGroup instance3 : r.getDefinedExperimentalGroups()) {\n\n//\t\t\t\t\tList<AbstractAnnotation> aa = Arrays.asList(instance3.getOrganismModel());\n//\t\t\t\t\tList<AbstractAnnotation> aa = new ArrayList<>(instance3.getTreatments());\n//\t\t\t\t\t\tList<AbstractAnnotation> aa = Arrays.asList(instance3.getInjury());\n\n\t\t\t\t\t\tList<AbstractAnnotation> ab = Arrays.asList(instance3.getInjury());\n\n\t\t\t\t\t\tList<AbstractAnnotation> aa = ab.stream().filter(i -> i != null)\n\t\t\t\t\t\t\t\t.map(et -> et.asInstanceOfEntityTemplate()).map(et -> new Injury(et))\n\t\t\t\t\t\t\t\t.filter(i -> i != null).flatMap(i -> i.getDeliveryMethods().stream())\n\t\t\t\t\t\t\t\t.filter(i -> i != null).collect(Collectors.toList());\n\n\t\t\t\t\t\taa.addAll(instance3.getTreatments().stream().filter(i -> i != null)\n\t\t\t\t\t\t\t\t.map(et -> et.asInstanceOfEntityTemplate()).map(et -> new Treatment(et))\n\t\t\t\t\t\t\t\t.filter(i -> i != null).map(i -> i.getDeliveryMethod()).filter(i -> i != null)\n\t\t\t\t\t\t\t\t.collect(Collectors.toList()));\n\n//\t\t\t\t\t\tList<AbstractAnnotation> aa = ab.stream().filter(i -> i != null)\n//\t\t\t\t\t\t\t\t.map(et -> et.asInstanceOfEntityTemplate()).map(et -> new Injury(et))\n//\t\t\t\t\t\t\t\t.filter(i -> i != null).flatMap(i -> i.getAnaesthetics().stream())\n//\t\t\t\t\t\t\t\t.filter(i -> i != null).collect(Collectors.toList());\n\n//\t\t\t\t\t\tList<AbstractAnnotation> aa = ab.stream().filter(i -> i != null)\n//\t\t\t\t\t\t\t\t.map(et -> et.asInstanceOfEntityTemplate()).map(et -> new Injury(et))\n//\t\t\t\t\t\t\t\t.filter(i -> i != null).map(i -> i.getInjuryDevice()).filter(i -> i != null)\n//\t\t\t\t\t\t\t\t.collect(Collectors.toList());\n\n\t\t\t\t\t\t// List<AbstractAnnotation> aa = ab.stream().filter(i -> i != null)\n//\t\t\t\t\t\t\t\t.map(et -> et.asInstanceOfEntityTemplate()).map(et -> new Injury(et))\n//\t\t\t\t\t\t\t\t.filter(i -> i != null).map(i -> i.getInjuryLocation()).filter(i -> i != null)\n//\t\t\t\t\t\t\t\t.collect(Collectors.toList());\n\n\t\t\t\t\t\torgM.addAll(aa);\n\t\t\t\t\t\tg += aa.size();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tavgIndPerDoc += orgM.size();\n\t\t\tavgTotalPerDoc += g;\n\n\t\t\torg += ((double) orgM.size()) / (g == 0 ? 1 : g);\n//\t\t\tSystem.out.println(((double) orgM.size()) / g);\n\n\t\t}\n\t\tSystem.out.println(\"avgTotalPerDoc = \" + avgTotalPerDoc / instanceProvider.getInstances().size());\n\t\tSystem.out.println(\"avgIndPerDoc = \" + avgIndPerDoc / instanceProvider.getInstances().size());\n\t\tSystem.out.println(\"org = \" + org);\n\t\tSystem.out.println(\"avg. org = \" + (org / instanceProvider.getInstances().size()));\n\t\tSystem.out.println(new DecimalFormat(\"0.00\").format(avgTotalPerDoc / instanceProvider.getInstances().size())\n\t\t\t\t+ \" & \" + new DecimalFormat(\"0.00\").format(avgIndPerDoc / instanceProvider.getInstances().size())\n\t\t\t\t+ \" & \" + new DecimalFormat(\"0.00\").format(org / instanceProvider.getInstances().size()));\n\t\tSystem.exit(1);\n\n\t\tStats.countVariables(0, instanceProvider.getInstances());\n\n\t\tint count = 0;\n\t\tfor (SlotType slotType : EntityType.get(\"Result\").getSlots()) {\n\n\t\t\tif (slotType.isExcluded())\n\t\t\t\tcontinue;\n\t\t\tcount++;\n\t\t\tSystem.out.println(slotType.name);\n\n\t\t}\n\t\tSystem.out.println(count);\n\t\tSystem.exit(1);\n\t}",
"private double crossValidate(Instances data) throws Exception {\r\n\t\tbuildClassifier(data);\r\n\r\n\t\tdouble correct = 0;\r\n\t\tfor (int i = 0; i < data.numInstances(); ++i) {\r\n\t\t\tif (classifyInstance(i) == data.get(i).classValue()) {\r\n\t\t\t\t++correct;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn correct / data.numInstances();\r\n\t}",
"public void calculateMetrics(){\n //precision\n precisionFinal = precision.stream().mapToDouble(f -> f).sum()/precision.size();\n System.out.print(\"Precision: \");\n System.out.println(precisionFinal);\n //recall\n recallFinal = recall.stream().mapToDouble(f -> f).sum()/recall.size();\n System.out.print(\"Recall: \");\n System.out.println(recallFinal);\n //fMeasures\n fMeausureFinal = fMeasures.stream().mapToDouble(f -> f).sum()/fMeasures.size();\n System.out.print(\"Fmeasure: \");\n System.out.println(fMeausureFinal);\n\n //MAP\n mapFinal = apRes.stream().mapToDouble(d->d).sum()/apRes.size();\n System.out.print(\"Mean Avarage Precision: \");\n System.out.println(mapFinal);\n \n mapLimitedFinal = apResRankedTopLimited.stream().mapToDouble(d->d).sum()/apResRankedTopLimited.size();\n System.out.print(\"Mean Precision at rank 10: \");\n System.out.println(mapLimitedFinal);\n \n //NDCG\n ndcgResultsFinal =0;\n ndcgResults.stream().forEach(l-> {\n //it is always true, only added to ensure that doesnt' break with another examples where some queries doens't have results.\n if(l.size()>0){\n ndcgResultsFinal= l.get(l.size()-1)+ndcgResultsFinal;\n }\n });\n ndcgResultsFinal=ndcgResultsFinal/ndcgResults.size();\n \n System.out.print(\"NDCG: \");\n System.out.println(ndcgResultsFinal);\n }",
"private static void analyzeData(Instances inputData, \n\t\t\tClassifierID method, String outputFileName) throws Exception\n\t{\n\t\tPrintWriter pw = null;\n\t\t\n\t\ttry\n\t\t{\n\t\t\tSystem.out.println(\"Method: \" + method.name());\n\t\t\t\n\t\t\tint[] results = new int[inputData.size()];\n\n\t\t\t// Load the local resource\n\t\t\t// This allows the file to be packaged inside the Jar\t\n\t\t\tInputStream is = SimpleSpamAnalysisApp.class.\n\t\t\t\t\tgetResourceAsStream(classifiers[method.ordinal()]);\n\t\t\n\t\t\t// Generate the classifier from model\n\t\t\tClassifier classifier = (Classifier) SerializationHelper.read(is);\n\t\t\t\n\t\t\tint numInstances = inputData.size();\n\t\t\t\n\t\t\t// Compute the expected value of each instance\n\t\t\tfor(int i=0; i<numInstances; i++)\n\t\t\t{\n\t\t\t\tresults[i] = (int)classifier.classifyInstance(inputData.get(i));\n\t\t\t}\n\n\t\t\t// Output the results to the file\n\t\t\tpw = new PrintWriter(outputFileName);\n\t\t\tfor(int r : results)\n\t\t\t\tpw.println(r);\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tthrow e;\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\t// Make sure the file stream is closed\n\t\t\tif(pw != null)\n\t\t\t\tpw.close();\n\t\t}\n\t}",
"public static ArrayList<TestInstanceCount> countDataFromInstances(List<TestDataInstance> inputData) {\n \n long count_A0B0 = 0;\n long count_A0B1 = 0;\n long count_A1B0 = 0;\n long count_A1B1 = 0;\n \n for(TestDataInstance data : inputData) {\n if(data.getValueA() == 0 && data.getValueB() == 0) {\n count_A0B0++;\n } else if(data.getValueA() == 0 && data.getValueB() == 1) {\n count_A0B1++;\n } else if(data.getValueA() == 1 && data.getValueB() == 0) {\n count_A1B0++;\n } else if(data.getValueA() == 1 && data.getValueB() == 1) {\n count_A1B1++;\n }\n }\n // results list\n ArrayList<TestInstanceCount> countData = new ArrayList<TestInstanceCount>();\n \n // create count objects\n TestInstanceCount c1 = new TestInstanceCount();\n c1.setAssignmentVarA(0);\n c1.setAssignmentVarB(0);\n c1.setAssignmentCount(count_A0B0);\n countData.add(c1);\n c1 = null;\n \n TestInstanceCount c2 = new TestInstanceCount();\n c2.setAssignmentVarA(0);\n c2.setAssignmentVarB(1);\n c2.setAssignmentCount(count_A0B1);\n countData.add(c2);\n c2 = null;\n \n TestInstanceCount c3 = new TestInstanceCount();\n c3.setAssignmentVarA(1);\n c3.setAssignmentVarB(0);\n c3.setAssignmentCount(count_A1B0);\n countData.add(c3);\n c3 = null;\n \n TestInstanceCount c4 = new TestInstanceCount();\n c4.setAssignmentVarA(1);\n c4.setAssignmentVarB(1);\n c4.setAssignmentCount(count_A1B1);\n countData.add(c4);\n c4 = null;\n \n return countData;\n }",
"@Override\n protected void onAfterSplitBrainHealed(HazelcastInstance[] instances) {\n mergeLifecycleListener.await();\n\n assertContainsCounterStatsEventually(true, instances[0], instances[1]);\n assertContainsCounterStatsEventually(false, instances[2]);\n }",
"public List<DataInstance> augmentTrainingData(List<DataInstance> origTrainInstances) {\n Map<String, List<DataInstance>> docInstanceMap = new HashMap<>();\n Set<Attribute> possibleAttributes = new HashSet<>();\n Attribute analyzedN = null;\n Attribute outcomeValue = null;\n for (DataInstance instance : origTrainInstances) {\n String docName = instance.getX().getDocNames().iterator().next();\n List<DataInstance> docDataInstances = docInstanceMap.computeIfAbsent(docName, k -> new ArrayList<>());\n docDataInstances.add(instance);\n if (analyzedN == null || outcomeValue == null) {\n for (ArmifiedAttributeValuePair avp : instance.getX().getAllPairs()) {\n if (avp.getAttribute().getName().equals(\"Individual-level analysed\")) {\n analyzedN = avp.getAttribute();\n }\n }\n outcomeValue = instance.getY().getAttribute();\n }\n }\n if (analyzedN == null || outcomeValue == null) throw new RuntimeException(); // we don't want this to happen\n // loop over documents\n List<DataInstance> retInstances = new ArrayList<>();\n for (Map.Entry<String, List<DataInstance>> docInstancesEntry : docInstanceMap.entrySet()) {\n // not the case always but we'll take the smallest outcome to be our 'control'\n final List<DataInstance> instances = docInstancesEntry.getValue();\n int minInd = -1;\n double minValue = 1000.0;\n for (int i = 0; i < instances.size(); i++) {\n if (instances.get(i).getYNumeric() < minValue) {\n minInd = i;\n minValue = instances.get(i).getYNumeric();\n }\n }\n // control values\n final DataInstance controlInstance = instances.get(minInd);\n retInstances.add(controlInstance);\n final double controlOutcomeValue = controlInstance.getYNumeric() / 100; // convert from percentage\n int controlN = checkNumberParticipants(controlInstance, analyzedN);\n final double controlEvents = controlOutcomeValue * controlN;\n for (int i = 0; i < instances.size(); i++) {\n if (i == minInd)\n continue;\n final DataInstance experimentalInstance = instances.get(i);\n retInstances.add(experimentalInstance);\n final double experimentalOutcomeValue = experimentalInstance.getYNumeric() / 100; // convert from percentage\n int experimentalN = checkNumberParticipants(experimentalInstance, analyzedN);\n if (controlN == -1) {\n if (experimentalN == -1) {\n // if we find no number of participants, skip\n continue;\n } else {\n // if only missing control participants, assume same as experimental\n controlN = experimentalN;\n }\n } else {\n if (experimentalN == -1) {\n // if only missing experimental participants, assume same as contorl\n experimentalN = controlN;\n }\n }\n final double experimentalEvents = experimentalOutcomeValue * experimentalN;\n if (controlEvents < 1 && experimentalEvents < 1) { // probably means problem in annotation\n continue;\n }\n final double stdError = Math.sqrt(controlEvents * (controlN - controlEvents) / Math.pow(controlN, 3) +\n experimentalEvents * (experimentalN - experimentalEvents) / Math.pow(experimentalN, 3));\n final double stdDev = stdError / Math.sqrt(1.0 / controlN + 1.0 / experimentalN);\n final NormalDistribution experimentalDistribution = new NormalDistribution(experimentalOutcomeValue, stdDev);\n int sampleSize = (int) Math.ceil(Math.sqrt(experimentalN)); // try different functions for good sample size\n for (int j = 0; j < sampleSize; j++) {\n final double sample = experimentalDistribution.sample() * 100; // convert to percentage\n if (sample < 0 || sample > 100) continue;\n final ArmifiedAttributeValuePair y = experimentalInstance.getY();\n final DataInstance sampleInstance = new DataInstance(experimentalInstance.getX(), new ArmifiedAttributeValuePair(y.getAttribute(), \"\" + sample, y.getDocName(), y.getArm(), y.getContext(), y.getPageNumber()));\n retInstances.add(sampleInstance);\n }\n }\n }\n System.out.println(\"Original # insts: \" + origTrainInstances.size() + \" new # insts: \" + retInstances.size());\n return retInstances;\n }",
"public double getAnomalyScore() {\n\t\treturn anomalyScore;\n\t}",
"public Double getTotalAnomalyPercentage();",
"@Override\n public double classifyInstance(Instance instance) throws Exception {\n\n\n\n int numAttributes = instance.numAttributes();\n int clsIndex = instance.classIndex();\n boolean hasClassAttribute = true;\n int numTestAtt = numAttributes -1;\n if (numAttributes == m_numOfInputNeutrons) {\n hasClassAttribute = false; // it means the test data doesn't has class attribute\n numTestAtt = numTestAtt+1;\n }\n\n for (int i = 0; i< numAttributes; i++){\n if (instance.attribute(i).isNumeric()){\n\n double max = m_normalization[0][i];\n double min = m_normalization[1][i];\n double normValue = 0 ;\n if (instance.value(i)<min) {\n normValue = 0;\n m_normalization[1][i] = instance.value(i); // reset the smallest value\n }else if(instance.value(i)> max){\n normValue = 1;\n m_normalization[0][i] = instance.value(i); // reset the biggest value\n }else {\n if (max == min ){\n if (max == 0){\n normValue = 0;\n }else {\n normValue = max/Math.abs(max);\n }\n }else {\n normValue = (instance.value(i) - min) / (max - min);\n }\n }\n instance.setValue(i, normValue);\n }\n }\n\n double[] testData = new double[numTestAtt];\n\n\n\n\n\n int index = 0 ;\n\n if (!hasClassAttribute){\n\n for (int i =0; i<numAttributes; i++) {\n testData[i] = instance.value(i);\n }\n }else {\n for (int i = 0; i < numAttributes; i++) {\n\n if (i != clsIndex) {\n\n testData[index] = instance.value(i);\n\n index++;\n }\n }\n }\n\n\n\n DenseMatrix prediction = new DenseMatrix(numTestAtt,1);\n for (int i = 0; i<numTestAtt; i++){\n prediction.set(i, 0, testData[i]);\n }\n\n DenseMatrix H_test = generateH(prediction,weightsOfInput,biases, 1);\n\n DenseMatrix H_test_T = new DenseMatrix(1, m_numHiddenNeurons);\n\n H_test.transpose(H_test_T);\n\n DenseMatrix output = new DenseMatrix(1, m_numOfOutputNeutrons);\n\n H_test_T.mult(weightsOfOutput, output);\n\n double result = 0;\n\n if (m_typeOfELM == 0) {\n double value = output.get(0,0);\n result = value*(m_normalization[0][classIndex]-m_normalization[1][classIndex])+m_normalization[1][classIndex];\n //result = value;\n if (m_debug == 1){\n System.out.print(result + \" \");\n }\n }else if (m_typeOfELM == 1){\n int indexMax = 0;\n double labelValue = output.get(0,0);\n\n if (m_debug == 1){\n System.out.println(\"Each instance output neuron result (after activation)\");\n }\n for (int i =0; i< m_numOfOutputNeutrons; i++){\n if (m_debug == 1){\n System.out.print(output.get(0,i) + \" \");\n }\n if (output.get(0,i) > labelValue){\n labelValue = output.get(0,i);\n indexMax = i;\n }\n }\n if (m_debug == 1){\n\n System.out.println(\"//\");\n System.out.println(indexMax);\n }\n result = indexMax;\n }\n\n\n\n return result;\n\n\n }",
"public Instances[] processDistancesAndIndices(Instances instances) throws Exception {\n \n int seriesLength = instances.numAttributes()-(instances.classIndex()>=0?1:0);\n \n if(windowSize < 3){\n throw new Exception(\"Error: window must be at least 3. You have specified \"+windowSize);\n }\n \n if(windowSize > seriesLength){\n throw new Exception(\"Error: window must be smaller than the number of attributes. Window length: \"+windowSize+\", series length: \"+seriesLength);\n }\n \n if(seriesLength/4 < windowSize){\n throw new Exception(\"Error: the series length must be at least 4 times larger than the window size to satisfy the exclusion zone criteria for trivial matches. These instances have a series length of \"+seriesLength+\"; the maximum window size is therefore \"+(seriesLength/4)+\" and you have specified \"+windowSize);\n }\n \n SingleInstanceMatrixProfile mpIns;\n Instances outputDistances = this.determineOutputFormat(instances);\n Instances outputIndices = this.determineOutputFormat(instances);\n Instance outDist, outIdx;\n \n this.distances = new double[instances.numInstances()][];\n this.indices = new int[instances.numInstances()][];\n \n for(int a = 0; a < seriesLength-windowSize+1; a++){\n outputIndices.renameAttribute(a, \"idx_\"+a);\n }\n outputIndices.setRelationName(outputIndices.relationName()+\"_indices\");\n \n for(int ins = 0; ins < instances.numInstances(); ins++){\n mpIns = new SingleInstanceMatrixProfile(instances.get(ins),this.windowSize, this.stride);\n outDist = new DenseInstance(outputDistances.numAttributes());\n outIdx = new DenseInstance(outputIndices.numAttributes());\n \n distances[ins] = mpIns.distances;\n indices[ins] = mpIns.indices;\n \n for(int i = 0; i < mpIns.distances.length; i++){\n outDist.setValue(i, mpIns.distances[i]);\n outIdx.setValue(i, mpIns.indices[i]);\n }\n \n if(instances.classIndex() >=0){\n outDist.setValue(mpIns.distances.length, instances.instance(ins).classValue());\n outIdx.setValue(mpIns.indices.length, instances.instance(ins).classValue());\n }\n \n outputDistances.add(outDist);\n outputIndices.add(outIdx);\n }\n return new Instances[]{outputDistances,outputIndices};\n }",
"public void calculateAverage() {\n\n if (turn == 1) {\n p1.setTotalScore(p1.getTotalScore() + turnScore);\n\n p1.setTotalDarts(p1.getTotalDarts() + 1);\n\n float p1Average = p1.getTotalScore() / p1.getTotalDarts();\n p1.setAverage(p1Average);\n\n } else if (turn == 2) {\n p2.setTotalDarts(p2.getTotalDarts() + 1);\n p2.setTotalScore(p2.getTotalScore() + turnScore);\n\n float p2Average = p2.getTotalScore() / p2.getTotalDarts();\n p2.setAverage(p2Average);\n }\n\n\n }",
"public int defaultAnomaly(int total);",
"private void calculateOutputs(Instance instance, Hashtable<NeuralNode, Double> nodeValues) {\r\n\t\tfor (OutputNode output : outputs) {\r\n\t\t\toutput.getValue(instance, nodeValues);\r\n\t\t}\r\n\t}",
"public interface AnomalyRate{\r\n\t\tpublic int calculAnomaly(int total, int freq); // anomaly rate of ngram present in model\r\n\t\tpublic int defaultAnomaly(int total); // anomaly rate by default\r\n\t}",
"@Override\n\tprotected Instances process(Instances arg0) throws Exception {\n\t\tInstances result = new Instances(determineOutputFormat(arg0), 0);\n\t\tInstances data = lrinstance.instances;\n\t\tdouble val = this.lrinstance.ConvertValue2Double(indexofattribute, value);\n\t\t\n\t\tfor(int i=0;i<data.numInstances();i++)\n\t\t{\n\t\t\tInstance ins = data.get(i);\n\t\t\t//System.out.println(ins.value(indexofattribute)+\" \"+val);\n\t\t\tif(ins.value(indexofattribute)==val)\n\t\t\t{\n\t\t\t\tresult.add(ins);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t\t\n\t}",
"private double[] calculateScores(LACInstance testInstance) throws Exception\n\t{\n\t\tList<Integer> testInstanceFeatures = new ArrayList<Integer>();\n\t\ttestInstanceFeatures.addAll(testInstance.getIndexedFeatures());\n\t\tCollections.sort(testInstanceFeatures);\n\t\t\n\t\tList<LACRule> allRulesForFeatures = new ArrayList<LACRule>(10000);\n\t\tint[] numPatterns = {0};\n\t\tfor(int i = 0; i < testInstanceFeatures.size(); i++)\n\t\t{\n\t\t\tList<Integer> featCombination = new ArrayList<Integer>();\n\t\t\tfeatCombination.add(testInstanceFeatures.get(i));\n\t\t\textractRules(featCombination, testInstanceFeatures, allRulesForFeatures, numPatterns);\n\t\t}\n\t\t\n\t\tint numClasses = trainingSet.getAllClasses().size();\n\t\tdouble[] scores = new double[numClasses];\n\t\tint numRules = allRulesForFeatures.size();\n\t\tif (numRules > 0)\n\t\t{\n\t\t\tfor (int i = 0; i < numRules; i++)\n\t\t\t{\n\t\t\t\tLACRule rule = allRulesForFeatures.get(i);\n\t\t\t\tscores[rule.getPredictedClass()] = scores[rule.getPredictedClass()] + rule.getConfidence();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tscores = null;\n\t\t}\n\t\t\n\t\treturn scores;\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 }",
"private void analyzeData(){\n input1 = ihd1.getOutput();\n input2 = ihd2.getOutput();\n\n output1 = (input1 > IHD_limit);\n output2 = (input2 > IHD_limit);\n }",
"public void calculateScores(OutputCollector collector, List<T> observationList) {\n List<ScorePackage> packageList = getScores(observationList);\n for (ScorePackage scorePackage : packageList) {\n collector.emit(new Values(scorePackage.getId(), scorePackage.getScore(), scorePackage.getObj()));\n }\n }",
"private void handleAnalysis()\n {\n try {\n InstanceInfo instances = scaler.getInstanceInfo(serviceRef);\n if (handleMemoryLoadIssues(instances)) {\n return;\n }\n governor.recordInstances(serviceRef, instances);\n ScalingAction action;\n if (firstRun) {\n LOG.info(\"Performing initial scaling checks for service {}\", serviceRef);\n action = handleFirstRun(instances);\n firstRun = false;\n } else {\n LOG.debug(\"Scaling checks for service {}\", serviceRef);\n action = analyser.analyseWorkload(instances);\n }\n\n action = governor.govern(serviceRef, action);\n\n switch (action.getOperation()) {\n case SCALE_UP:\n scaleUp(instances, action.getAmount());\n break;\n case SCALE_DOWN:\n scaleDown(instances, action.getAmount());\n break;\n case NONE:\n default:\n break;\n }\n } catch (ScalerException e) {\n LOG.warn(\"Failed analysis run for service {}\", serviceRef, e);\n }\n }",
"protected void postRun() {\r\n\t\tthis.calculateFlowBandwidthHops();\r\n\t\tdouble abt = this.ABT();\r\n\t\tdouble agt = this.AGT();\r\n\t\tthis.metrics.add(new ResultMetric(\"ABT\", abt));\r\n\t\tthis.metrics.add(new ResultMetric(\"AGT\", agt));\r\n\t\tthis.metrics.add(new ResultMetric(\"Hops\", this.Hops()));\r\n\t\tthis.metrics.add(new ResultMetric(\"AveHops\", this.Hops()\r\n\t\t\t\t/ this.flows.size()));\r\n\t\tthis.metrics.add(new ResultMetric(\"SuccCount\", this.successfulCount));\r\n\t\tthis.metrics.add(new ResultMetric(\"FailCount\", this.failedCount));\r\n\t\tthis.metrics.add(new ResultMetric(\"ServerNum\", this.dcn\r\n\t\t\t\t.getServerUUIDs().size()));\r\n\t\tthis.metrics.add(new ResultMetric(\"ThroughputPerLink\", abt\r\n\t\t\t\t/ this.dcn.linkCount()));\r\n\t}",
"@SuppressWarnings(\"unchecked\")\n @Override\n public synchronized void processIncoming(Data data) throws WekaException {\n if (isStopRequested()) {\n return;\n }\n\n if (getStepManager().isStreamFinished(data)) {\n // done\n // notify downstream steps of end of stream\n Data d = new Data(data.getConnectionName());\n getStepManager().throughputFinished(d);\n return;\n }\n\n getStepManager().throughputUpdateStart();\n if (m_plotListeners.size() > 0) {\n if (getStepManager().numIncomingConnectionsOfType(\n StepManager.CON_INSTANCE) > 0) {\n Instance instance =\n (Instance) data.getPayloadElement(StepManager.CON_INSTANCE);\n if (m_reset) {\n m_reset = false;\n List<String> legendEntries = new ArrayList<String>();\n int i;\n for (i = 0; i < instance.dataset().numAttributes() && i < 10; i++) {\n legendEntries.add(instance.dataset().attribute(i).name());\n }\n m_instanceWidth = i;\n\n for (PlotNotificationListener l : m_plotListeners) {\n l.setLegend(legendEntries, 0.0, 1.0);\n }\n }\n\n double[] dataPoint = new double[m_instanceWidth];\n for (int i = 0; i < dataPoint.length; i++) {\n if (!instance.isMissing(i)) {\n dataPoint[i] = instance.value(i);\n }\n }\n for (PlotNotificationListener l : m_plotListeners) {\n l.acceptDataPoint(dataPoint);\n }\n\n } else if (getStepManager().numIncomingConnectionsOfType(\n StepManager.CON_CHART) > 0) {\n if (m_reset) {\n m_reset = false;\n double min =\n data.getPayloadElement(StepManager.CON_AUX_DATA_CHART_MIN, 0.0);\n double max =\n data.getPayloadElement(StepManager.CON_AUX_DATA_CHART_MAX, 1.0);\n List<String> legend =\n (List<String>) data\n .getPayloadElement(StepManager.CON_AUX_DATA_CHART_LEGEND);\n for (PlotNotificationListener l : m_plotListeners) {\n l.setLegend(legend, min, max);\n }\n }\n double[] dataPoint =\n (double[]) data\n .getPayloadElement(StepManager.CON_AUX_DATA_CHART_DATA_POINT);\n for (PlotNotificationListener l : m_plotListeners) {\n l.acceptDataPoint(dataPoint);\n }\n }\n }\n getStepManager().throughputUpdateEnd();\n }",
"@Test\r\n\tpublic void driverGroups75MoreAnnouncementsThanAvg() {\r\n\r\n\t\tfinal Object testingData[][] = {\r\n\r\n\t\t\t// testingData[i][0] -> usernamed of the logged Actor.\r\n\t\t\t// testingData[i][1] -> expected Exception.\r\n\r\n\t\t\t{\r\n\t\t\t\t// + 1) An administrator displays the statistics\r\n\t\t\t\t\"admin\", null\r\n\t\t\t}, {\r\n\t\t\t\t// - 2) An unauthenticated actor tries to display the statistics\r\n\t\t\t\tnull, IllegalArgumentException.class\r\n\t\t\t}, {\r\n\t\t\t\t// - 3) A visitor displays the statistics\r\n\t\t\t\t\"visitor1\", IllegalArgumentException.class\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tfor (int i = 0; i < testingData.length; i++) {\r\n\r\n\t\t\tthis.startTransaction();\r\n\r\n\t\t\tthis.templateGroups75MoreAnnouncementsThanAvg((String) testingData[i][0], (Class<?>) testingData[i][1]);\r\n\r\n\t\t\tthis.rollbackTransaction();\r\n\t\t\tthis.entityManager.clear();\r\n\t\t}\r\n\r\n\t}",
"@Override\n public double classifyInstance(Instance testdata) {\n // get a copy of testdata Instance with only the matched attributes\n Instance ntest = this.mm.getMatchedTestInstance(testdata);\n\n double ret = 0.0;\n try {\n ret = this.classifier.classifyInstance(ntest);\n }\n catch (Exception e) {\n e.printStackTrace();\n throw new RuntimeException(e);\n }\n\n return ret;\n }",
"private double computeEntropy(Instances data) throws Exception {\n\n double [] classCounts = new double[data.numClasses()];\n Enumeration instEnum = data.enumerateInstances();\n while (instEnum.hasMoreElements()) {\n Instance inst = (Instance) instEnum.nextElement();\n classCounts[(int) inst.classValue()]++;\n }\n double entropy = 0;\n for (int j = 0; j < data.numClasses(); j++) {\n if (classCounts[j] > 0) {\n entropy -= classCounts[j] * Utils.log2(classCounts[j]);\n }\n }\n entropy /= (double) data.numInstances();\n return entropy + Utils.log2(data.numInstances());\n }",
"@Override\r\n protected Comparable<?> _update(IAlgorithmContext state, IDataElement[] measurementList) throws AlgorithmExecutionException {\n \tdouble avValue = 0.0;\r\n \tint inputs = measurementList.length; \r\n \tboolean rightInputs = true;\r\n \tString type = (String)state.getContextParameter(\"type\"); //Retrieve algorithm's type\r\n \t\r\n \t//Check values that come inside the formatter\r\n \tfor(int i=0; i<measurementList.length ; i++) {\r\n \t\tif(measurementList[i] == null || measurementList[i].getValue() == null) {\r\n \t\t\trightInputs = false; //If one input is empty\r\n \t\t\t\r\n \t\t\tif(type.equalsIgnoreCase(\"hard\"))\r\n \t\t\t\tbreak;\r\n \t\t}\r\n \t}\r\n \t\r\n \tif(type.equalsIgnoreCase(\"hard\")) { //All input streams must give a value\r\n \t\tif(!rightInputs) {\r\n \t\t\t//throw new AlgorithmExecutionException(getType() +\" algorithm in \"+type+\" mode--> All input streams must be present and valid\");\r\n \t\t\tSystem.out.println(\"[AV] WARNING: Algorithm in \"+type+\" mode--> All input streams must be present and not \\\"null\\\"\");\r\n \t\t\treturn null;\r\n \t\t}\r\n \t\t//Input streams must be more than 1 in \"hard\" mode of MultiMean algorithm\r\n \tif(inputs < 2) {\r\n \t\t//throw new AlgorithmExecutionException(\"Algorithm \"+getType()+\" must have 2 or more input streams in \"+type+\" mode\");\t\r\n \t\tSystem.out.println(\"[AV] WARNING: Algorithm must have 2 or more input streams in \"+type+\" mode\");\r\n \t\t\treturn null;\r\n \t}\r\n \t\r\n \t//If all input streams have a value, check if they are all numbers\r\n \t\tfor (IDataElement d : measurementList) {\r\n\t\t\t\tComparable<?> value=d.getValue();\r\n\r\n\t\t\t\tif (value instanceof Number) {\r\n\t\t\t\t\tavValue = avValue + (Double)value;\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//throw new AlgorithmExecutionException(getType() +\" algorithm in \"+type+\" mode--> Invalid data value detected(\"+value+\"). Value must be Double\");\r\n\t\t\t\t\tSystem.out.println(\"[AV] WARNING: Algorithm in \"+type+\" mode--> Invalid data value detected(\"+value+\"). Value must be Double\");\r\n\t \t\t\treturn null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n \t} else { //Take into consideration only the available (not null) input streams as long as they are more than 0\r\n \t\tif(inputs == 0) { //If there is no input in current condition\r\n \t\t\t//throw new AlgorithmExecutionException(getType() +\" algorithm in \"+type+\" mode--> We must have at least 1 input stream\");\r\n \t\t\tSystem.out.println(\"[AV] WARNING: Algorithm in \"+type+\" mode--> At least 1 input stream must have a not \\\"null\\\" value\");\r\n \t\t\treturn null;\r\n \t\t}\r\n \t\t\r\n \t\t//If some input streams have a value, check if they are all numbers\r\n \t\tfor (IDataElement d : measurementList) {\r\n\t\t\t\t\r\n \t\t\tif(d!=null && d.getValue()!=null) { //Do not take into account \"null\" input streams\r\n \t\t\t\tComparable<?> value=d.getValue();\r\n\r\n \t\t\t\tif (value instanceof Number) {\r\n \t\t\t\t\tavValue = avValue + (Double)value;\t\t\r\n \t\t\t\t} else {\r\n \t\t\t\t\t//throw new AlgorithmExecutionException(getType() +\" algorithm in \"+type+\" mode--> Invalid data value detected(\"+value+\"). Value must be Double\");\r\n \t\t\t\t\tSystem.out.println(\"[AV] WARNING: Algorithm in \"+type+\" mode--> Invalid data value detected(\"+value+\"). Value must be Double\");\r\n \t \t\t\treturn null;\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t}\r\n \t\r\n \tavValue = avValue * (1.0 / (double) inputs);\r\n \t\r\n \t//System.out.println(\"[AV] OUTPUT: \"+avValue);\r\n\t\treturn avValue;\r\n }",
"private AggResult parse(MeasuredData measuredData, AggResult dest) {\n measuredData.data.computeIfPresent(MetricNames.SEND_QUEUE, (comp, data) -> {\n parseQueueResult((Map<String, Number>) data, dest.getSendQueueResult());\n return data;\n });\n measuredData.data.computeIfPresent(MetricNames.RECV_QUEUE, (comp, data) -> {\n parseQueueResult((Map<String, Number>) data, dest.getRecvQueueResult());\n return data;\n });\n if (firstTasks.contains(measuredData.task)) {\n measuredData.data.computeIfPresent(MetricNames.DURATION, (comp, data) -> {\n dest.addDuration(((Number) data).longValue());\n return data;\n });\n }\n if (rawTopo.get_spouts().containsKey(measuredData.component)) {\n Map<String, Object> data = (Map<String, Object>) measuredData.data.get(MetricNames.COMPLETE_LATENCY);\n if (data != null) {\n data.forEach((stream, elementStr) -> {\n String[] elements = ((String) elementStr).split(\",\");\n int cnt = Integer.valueOf(elements[0]);\n if (cnt > 0) {\n double val = Double.valueOf(elements[1]);\n double val_2 = Double.valueOf(elements[2]);\n ((SpoutAggResult) dest).getCompletedLatency().computeIfAbsent(stream, (k) -> new CntMeanVar())\n .addAggWin(cnt, val, val_2);\n }\n });\n }\n } else {\n Map<String, Object> data = (Map<String, Object>) measuredData.data.get(MetricNames.TASK_EXECUTE);\n if (data != null) {\n data.forEach((stream, elementStr) -> {\n String[] elements = ((String) elementStr).split(\",\");\n int cnt = Integer.valueOf(elements[0]);\n if (cnt > 0) {\n double val = Double.valueOf(elements[1]);\n double val_2 = Double.valueOf(elements[2]);\n ((BoltAggResult) dest).getTupleProcess().computeIfAbsent(stream, (k) -> new CntMeanVar())\n .addAggWin(cnt, val, val_2);\n }\n });\n }\n }\n return dest;\n }",
"private void calculateAverages(){\n for (int i=0; i<40; i=i+4){\n totalGoalsScored1 += Integer.parseInt(vectorResults[i]);\n }\n averageGoalsScored1 = totalGoalsScored1/numberItems;\n //Total and average scored goals of team 2\n for (int i=2; i<40; i=i+4){\n totalGoalsScored2 += Integer.parseInt(vectorResults[i]);\n }\n averageGoalsScored2 = totalGoalsScored2/numberItems;\n //Total and average received goals of team 1\n for (int i=1; i<40; i=i+4){\n totalGoalsReceived1 += Integer.parseInt(vectorResults[i]);\n }\n averageGoalsReceived1 = totalGoalsReceived1/numberItems;\n //Total and average received goals of team 2\n for (int i=3; i<40; i=i+4){\n totalGoalsReceived2 += Integer.parseInt(vectorResults[i]);\n }\n averageGoalsReceived2 = totalGoalsReceived2/numberItems;\n }",
"public void run() throws Exception {\r\n\r\n\r\n LibSVM svm = new LibSVM();\r\n String svmOptions = \"-S 0 -K 2 -C 8 -G 0\"; //Final result: [1, -7 for saveTrainingDataToFileHybridSampling2 ]\r\n svm.setOptions(weka.core.Utils.splitOptions(svmOptions));\r\n System.out.println(\"SVM Type and Keranl Type= \" + svm.getSVMType() + svm.getKernelType());//1,3 best result 81%\r\n // svm.setNormalize(true);\r\n\r\n\r\n// load training data from .arff file\r\n ConverterUtils.DataSource source = new ConverterUtils.DataSource(\"C:\\\\Users\\\\hp\\\\Desktop\\\\SVM implementation\\\\arffData\\\\balancedTrainingDataUSSMOTE464Random.arff\");\r\n System.out.println(\"\\n\\nLoaded data:\\n\\n\" + source.getDataSet());\r\n Instances dataFiltered = source.getDataSet();\r\n dataFiltered.setClassIndex(0);\r\n\r\n // gridSearch(svm, dataFiltered);\r\n Evaluation evaluation = new Evaluation(dataFiltered);\r\n evaluation.crossValidateModel(svm, dataFiltered, 10, new Random(1));\r\n System.out.println(evaluation.toSummaryString());\r\n System.out.println(evaluation.weightedAreaUnderROC());\r\n double[][] confusionMatrix = evaluation.confusionMatrix();\r\n for (int i = 0; i < 2; i++) {\r\n for (int j = 0; j < 2; j++) {\r\n System.out.print(confusionMatrix[i][j] + \" \");\r\n\r\n }\r\n System.out.println();\r\n }\r\n System.out.println(\"accuracy for crime class= \" + (confusionMatrix[0][0] / (confusionMatrix[0][1] + confusionMatrix[0][0])) * 100 + \"%\");\r\n System.out.println(\"accuracy for other class= \" + (confusionMatrix[1][1] / (confusionMatrix[1][1] + confusionMatrix[1][0])) * 100 + \"%\");\r\n System.out.println(\"accuracy for crime class= \" + evaluation.truePositiveRate(0) + \"%\");\r\n System.out.println(\"accuracy for other class= \" + evaluation.truePositiveRate(1) + \"%\");\r\n\r\n\r\n }",
"public double calcAvgError(Instances insatnces) {\n\n // Using the same code from DecisionTree.java\n\n double sumError = 0;\n for (int i = 0; i < insatnces.numInstances(); i++) {\n Instance currentInstance = insatnces.instance(i);\n sumError += Math.abs(regressionPrediction(currentInstance) - currentInstance.classValue());\n }\n return sumError / (double) insatnces.numInstances();\n }",
"@Test\r\n\tpublic void driverExhibitions10MoreSponsorhipsThanAvg() {\r\n\r\n\t\tfinal Object testingData[][] = {\r\n\r\n\t\t\t// testingData[i][0] -> usernamed of the logged Actor.\r\n\t\t\t// testingData[i][1] -> expected Exception.\r\n\r\n\t\t\t{\r\n\t\t\t\t// + 1) An administrator displays the statistics\r\n\t\t\t\t\"admin\", null\r\n\t\t\t}, {\r\n\t\t\t\t// - 2) An unauthenticated actor tries to display the statistics\r\n\t\t\t\tnull, IllegalArgumentException.class\r\n\t\t\t}, {\r\n\t\t\t\t// - 3) A visitor displays the statistics\r\n\t\t\t\t\"visitor1\", IllegalArgumentException.class\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tfor (int i = 0; i < testingData.length; i++) {\r\n\r\n\t\t\tthis.startTransaction();\r\n\r\n\t\t\tthis.templateExhibitions10MoreSponsorhipsThanAvg((String) testingData[i][0], (Class<?>) testingData[i][1]);\r\n\r\n\t\t\tthis.rollbackTransaction();\r\n\t\t\tthis.entityManager.clear();\r\n\t\t}\r\n\r\n\t}",
"@Test\r\n\tpublic void driverAvgMinMaxStdDayPassesPerMuseum() {\r\n\r\n\t\tfinal Object testingData[][] = {\r\n\r\n\t\t\t// testingData[i][0] -> usernamed of the logged Actor.\r\n\t\t\t// testingData[i][1] -> expected Exception.\r\n\r\n\t\t\t{\r\n\t\t\t\t// + 1) An administrator displays the statistics\r\n\t\t\t\t\"admin\", null\r\n\t\t\t}, {\r\n\t\t\t\t// - 2) An unauthenticated actor tries to display the statistics\r\n\t\t\t\tnull, IllegalArgumentException.class\r\n\t\t\t}, {\r\n\t\t\t\t// - 3) A visitor displays the statistics\r\n\t\t\t\t\"visitor1\", IllegalArgumentException.class\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tfor (int i = 0; i < testingData.length; i++) {\r\n\r\n\t\t\tthis.startTransaction();\r\n\r\n\t\t\tthis.templateAvgMinMaxStdDayPassesPerMuseum((String) testingData[i][0], (Class<?>) testingData[i][1]);\r\n\r\n\t\t\tthis.rollbackTransaction();\r\n\t\t\tthis.entityManager.clear();\r\n\t\t}\r\n\r\n\t}",
"public double Score(Instances data, C45Attribute att) {\r\n Instances[] splitData = SplitData(data,att);\r\n double score=0;\r\n for (int j = 0; j < splitData.length; j++) {\r\n if (splitData[j].numInstances() > 0) {\r\n score+=numMajorityClass(splitData[j]);\r\n }\r\n }\r\n return score;\r\n }",
"private void calculateOverall()\n {\n ArrayList<Integer> average = new ArrayList<Integer>(1);\n ArrayList<Integer> median = new ArrayList<Integer>(1);\n ArrayList<Integer> mode = new ArrayList<Integer>();\n ArrayList<Integer> stdDev = new ArrayList<Integer>(1);\n \n int avg = 0;\n int med = 90;\n int mod = 90;\n int dev = 0;\n \n int[] modeArray = new int[100];\n \n for (int i = 0; i < 100; i++) {\n \tmodeArray[i] = 0;\n }\n \n for (Integer score : allScores) {\n \tavg += score;\n \tmodeArray[score]++;\n }\n \n for (int i = 0; i < 100; i++) {\n \tif (modeArray[i] > mod) {\n \t\tmod = modeArray[i];\n \t}\n }\n \n avg = avg / allScores.size();\n \n Collections.sort(allScores);\n med = allScores.get(allScores.size() / 2);\n \n for (Integer score : allScores) {\n \tdev += Math.pow(score - avg, 2);\n }\n dev = (int)Math.floor(Math.sqrt(dev / allScores.size()));\n\n // TODO: Perform the actual calculations here\n average.add(avg);\n median.add(med);\n mode.add(mod);\n stdDev.add(dev);\n\n this.overallAnalytics.put(\"Average\", average);\n this.overallAnalytics.put(\"Median\", median);\n this.overallAnalytics.put(\"Mode\", mode);\n this.overallAnalytics.put(\"Standard Deviation\", stdDev);\n }",
"public Long metricValue() {\n\t\t// Keep a list free from redundant subjects, that is with all its unique\n\t\t// elements\n\t\tList<ComparableSubject> lstUniqueSubjects = new ArrayList<ComparableSubject>();\n\t\tboolean isCurSubjectUnique;\n\t\tlong countCompared = 0;\n\t\tint mapSize = pMapSubjects.size();\n\t\tlogger.debug(\"Starting metric value computation, with \" + mapSize + \"instances...\");\n\n\t\t// int i = 0;\n\t\t// Compare each of the subjects with the ones already recognized as unique...\n\t\tfor (ComparableSubject curSubject : pMapSubjects.values()) {\n\t\t\tisCurSubjectUnique = true;\n\t\t\t// i++;\n\t\t\t// int z = 0;\n\t\t\tfor (ComparableSubject curUniqueSubject : lstUniqueSubjects) {\n\t\t\t\t// and if the subject currently examined is equivalent to one of the existing\n\t\t\t\t// unique subjects, do not regard it as unique, continue with the next one\n\t\t\t\tif (curSubject.isEquivalentTo(curUniqueSubject)) {\n\t\t\t\t\tisCurSubjectUnique = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// z++;\n\t\t\t\t// if ((z % 10000) == 0) System.out.println(\"compared \"+i + \"/\" + z);\n\t\t\t}\n\n\t\t\t// if ((i % 1000 == 0)) System.out.println(\"compared \"+i);\n\n\t\t\t// Finally, if the current subject is not equivalent to any of\n\t\t\t// the existing unique subjects, add it as unique\n\t\t\tif (isCurSubjectUnique) {\n\t\t\t\tlstUniqueSubjects.add(curSubject);\n\t\t\t}\n\n\t\t\tcountCompared++;\n\t\t\tif ((countCompared % 50000) == 0) {\n\t\t\t\tlogger.debug(\"Estimated value with \" + countCompared + \" compared instances: \"\n\t\t\t\t\t\t+ (((double) lstUniqueSubjects.size()) / ((double) mapSize)));\n\t\t\t}\n\t\t}\n\n\t\t// Compute metric value\n\t\t// long metricValue = ((long)lstUniqueSubjects.size()) /\n\t\t// ((long)pMapSubjects.size());\n\t\tlong metricValue = (((long) pMapSubjects.size()) > 0)\n\t\t\t\t? ((long) lstUniqueSubjects.size()) / ((long) pMapSubjects.size())\n\t\t\t\t: 0;\n\t\t// If any subject is equivalent to another, it will not be part of the list of\n\t\t// unique subjects, then\n\t\t// the size of this list is the \"Count of Unique Subjects\" required to calculate\n\t\t// the metric\n\t\treturn metricValue;\n\t}",
"@Override\n\tpublic int electoralRepReport(int[] data) {\n\t\tfor(int i=0; i < data.length; i++){\n\t\t\trepVotes+= (data[i] - (data[i]*0.02));\n\t\t\tdemVotes+= data[i]*0.02;\n\t\t}\n\t\treturn repVotes;\n\t}",
"@Override\r\n\tpublic void calculateFinalData() {\n\t\tfor(TeamPO oneTeam:teams.getAllTeams()){\r\n\t\t\toneTeam.calculateTeamDataInOneSeason();\r\n\t\t}\r\n\t}",
"public static void calculateResults(ArrayList<Record> records) throws Exception{\r\n\t\tfor(Record record : records)\r\n\t\t{\r\n\t\t\tInteger score = 0;\r\n\r\n\t\t\t// 100m\r\n\t\t\tscore += calculateTrackScore((float)25.434, 18, (float)1.81, record.getHundredMResult());\r\n\r\n\t\t\t//long jump\r\n\t\t\tscore += calculateJumpScore((float)0.1435, 220, (float)1.4, record.getLongJumpResult());\r\n\r\n\t\t\t// shot put\r\n\t\t\tscore += calculateThrowScore((float)51.39, (float)1.5, (float)1.05, record.getShotPutResult());\r\n\r\n\t\t\t// high jump\r\n\t\t\tscore += calculateJumpScore((float)0.8465, 75, (float)1.42, record.getHighJumpResult());\r\n\r\n\t\t\t// 400 m\r\n\t\t\tscore += calculateTrackScore((float)1.53775, 82, (float)1.81,\r\n\t\t\t\t\tUtils.minutesToSeconds(record.getFourHundredMResult()));\r\n\r\n\t\t\t// 110 m hurdles\r\n\t\t\tscore += calculateTrackScore((float)5.74352, (float)28.5, (float)1.92, record.getOneHundredTenResult());\r\n\r\n\t\t\t// Discus throw\r\n\t\t\tscore += calculateThrowScore((float)12.91, 4, (float)1.10, record.getDiscusResult());\r\n\r\n\t\t\t// pole vault\r\n\t\t\tscore += calculateJumpScore((float)0.2797, 100, (float)1.35, record.getPoleVaultResult());\r\n\r\n\t\t\t// javelin throw\r\n\t\t\tscore += calculateThrowScore((float)10.14, 7, (float)1.08, record.getJavelinResult());\r\n\r\n\t\t\t// 1500 m\r\n\t\t\tscore += calculateTrackScore((float)0.03768, 480, (float)1.85,\r\n\t\t\t\t\tUtils.minutesToSeconds(record.getThousandFiveHundredResult()));\r\n\r\n\t\t\trecord.setScore(score);\r\n\t\t}\r\n\t}",
"public void average(){\n\t\tfor(PlayerWealthDataAccumulator w : _wealthData.values()){\n\t\t\tw.average();\n\t\t}\n\t}",
"private void doMatchesStats(int week){\r\n \r\n \r\n List<FantasyMatch> fMatches = fmatchBean.findByWeek(week);\r\n for(int i = 0; i < fMatches.size(); i++){\r\n FantasyMatch fm = fMatches.get(i);\r\n FantasyTeam team1 = fm.getTeam1();\r\n FantasyTeam team2 = fm.getTeam2();\r\n int team1Points = 0, team2Points = 0;\r\n \r\n team1Points += retrievePoints(fm.getTeam1QB(), week);\r\n team2Points += retrievePoints(fm.getTeam2QB(), week);\r\n \r\n team1Points += retrievePoints(fm.getTeam1RB1(), week);\r\n team2Points += retrievePoints(fm.getTeam2RB1(), week);\r\n\r\n team1Points += retrievePoints(fm.getTeam1RB2(), week);\r\n team2Points += retrievePoints(fm.getTeam2RB2(), week);\r\n\r\n team1Points += retrievePoints(fm.getTeam1WR1(), week);\r\n team2Points += retrievePoints(fm.getTeam2WR1(), week);\r\n\r\n team1Points += retrievePoints(fm.getTeam1WR2(), week);\r\n team2Points += retrievePoints(fm.getTeam2WR2(), week);\r\n\r\n team1Points += retrievePoints(fm.getTeam1WRRB(), week);\r\n team2Points += retrievePoints(fm.getTeam2WRRB(), week);\r\n\r\n team1Points += retrievePoints(fm.getTeam1TE(), week);\r\n team2Points += retrievePoints(fm.getTeam2TE(), week);\r\n\r\n team1Points += retrievePoints(fm.getTeam1K(), week);\r\n team2Points += retrievePoints(fm.getTeam2K(), week);\r\n\r\n team1Points += retrievePoints(fm.getTeam1DEF(), week);\r\n team2Points += retrievePoints(fm.getTeam2DEF(), week);\r\n \r\n fm.setTeam1Points(team1Points);\r\n fm.setTeam2Points(team2Points);\r\n \r\n if(team1Points > team2Points){\r\n team1.setWins(team1.getWins() + 1);\r\n team2.setLosses(team2.getLosses() + 1);\r\n }\r\n if(team1Points == team2Points){\r\n team1.setDraws(team1.getDraws() + 1);\r\n team2.setDraws(team2.getDraws() + 1);\r\n }\r\n if(team1Points < team2Points){\r\n team1.setLosses(team1.getLosses() + 1);\r\n team2.setWins(team2.getWins() + 1);\r\n }\r\n \r\n team1.setPointsFor(team1.getPointsFor() + team1Points);\r\n team1.setPointsAgainst(team1.getPointsAgainst() + team2Points);\r\n \r\n team2.setPointsFor(team2.getPointsFor() + team2Points);\r\n team2.setPointsAgainst(team2.getPointsAgainst() + team1Points);\r\n \r\n fmatchBean.edit(fm);\r\n ftBean.edit(team1);\r\n ftBean.edit(team2);\r\n }\r\n \r\n List<FantasyLeague> leagues = flBean.findAll();\r\n for(int i = 0; i < leagues.size(); i++){\r\n List<FantasyTeam> teams = ftBean.findByLeague(leagues.get(i));\r\n \r\n //DO SORTING BY WINS\r\n Collections.sort(teams, new TeamWinComparator());\r\n \r\n for(int j = 0; j < teams.size(); j++){\r\n FantasyTeam team = teams.get(j);\r\n team.setPreviousRank(team.getRank());\r\n team.setRank(j + 1); \r\n }\r\n }\r\n \r\n }",
"@Test\r\n\tpublic void driverAvgMinMaxStdPricePrivateDayPasses() {\r\n\r\n\t\tfinal Object testingData[][] = {\r\n\r\n\t\t\t// testingData[i][0] -> usernamed of the logged Actor.\r\n\t\t\t// testingData[i][1] -> expected Exception.\r\n\r\n\t\t\t{\r\n\t\t\t\t// + 1) An administrator displays the statistics\r\n\t\t\t\t\"admin\", null\r\n\t\t\t}, {\r\n\t\t\t\t// - 2) An unauthenticated actor tries to display the statistics\r\n\t\t\t\tnull, IllegalArgumentException.class\r\n\t\t\t}, {\r\n\t\t\t\t// - 3) A visitor displays the statistics\r\n\t\t\t\t\"visitor1\", IllegalArgumentException.class\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tfor (int i = 0; i < testingData.length; i++) {\r\n\r\n\t\t\tthis.startTransaction();\r\n\r\n\t\t\tthis.templateAvgMinMaxStdPricePrivateDayPasses((String) testingData[i][0], (Class<?>) testingData[i][1]);\r\n\r\n\t\t\tthis.rollbackTransaction();\r\n\t\t\tthis.entityManager.clear();\r\n\t\t}\r\n\r\n\t}",
"private synchronized void evaluate(int indexOfInterest) {\r\n\r\n switch (indexOfInterest) {\r\n case 0: //evaluating values on the X axis\r\n if ((Math.abs(peakValue) >= 1.3) && (Math.abs(peakValue) <= 3.2) && !goodScoreUpdated && !mediumScoreUpdated && !badScoreUpdated) {\r\n scoreListener.onScoreTypeChangeForEvent(ScoreType.GOOD, event.getEventType());\r\n goodScoreUpdated = true;\r\n }\r\n if ((Math.abs(peakValue) > 3.2) && (Math.abs(peakValue) <= 4.2) && !mediumScoreUpdated && !badScoreUpdated) {\r\n\r\n event.setScoreToMedium();\r\n scoreListener.onScoreTypeChangeForEvent(ScoreType.MEDIUM, event.getEventType());\r\n currentScoreTypeForEvent = ScoreType.MEDIUM;\r\n mediumScoreUpdated = true;\r\n }\r\n if ((Math.abs(peakValue) > 4.2) && !badScoreUpdated) {\r\n\r\n event.setScoreToBad();\r\n scoreListener.onScoreTypeChangeForEvent(ScoreType.BAD, event.getEventType());\r\n currentScoreTypeForEvent = ScoreType.BAD;\r\n badScoreUpdated = true;\r\n }\r\n\r\n case 1: //evaluating values on the Y axis\r\n if (event.getEventType().equals(DrivingEventType.BRAKE)) {\r\n if ((Math.abs(peakValue) >= 1.75) && (Math.abs(peakValue) <= 3.3) && !goodScoreUpdated && !mediumScoreUpdated && !badScoreUpdated) {\r\n scoreListener.onScoreTypeChangeForEvent(ScoreType.GOOD, event.getEventType());\r\n goodScoreUpdated = true;\r\n }\r\n if ((Math.abs(peakValue) > 3.3) && (Math.abs(peakValue) <= 5.5) && !mediumScoreUpdated && !badScoreUpdated) {\r\n\r\n event.setScoreToMedium();\r\n scoreListener.onScoreTypeChangeForEvent(ScoreType.MEDIUM, event.getEventType());\r\n currentScoreTypeForEvent = ScoreType.MEDIUM;\r\n mediumScoreUpdated = true;\r\n }\r\n if ((Math.abs(peakValue) > 5.5) && !badScoreUpdated) {\r\n\r\n event.setScoreToBad();\r\n scoreListener.onScoreTypeChangeForEvent(ScoreType.BAD, event.getEventType());\r\n currentScoreTypeForEvent = ScoreType.BAD;\r\n badScoreUpdated = true;\r\n }\r\n } else if (event.getEventType().equals(DrivingEventType.ACCELERATION)) {\r\n if ((Math.abs(peakValue) >= 0.9) && (Math.abs(peakValue) <= 2.5) && !goodScoreUpdated && !mediumScoreUpdated && !badScoreUpdated) {\r\n\r\n scoreListener.onScoreTypeChangeForEvent(ScoreType.GOOD, event.getEventType());\r\n goodScoreUpdated = true;\r\n }\r\n if ((Math.abs(peakValue) > 2.5) && (Math.abs(peakValue) <= 3.3) && !mediumScoreUpdated && !badScoreUpdated) {\r\n\r\n event.setScoreToMedium();\r\n scoreListener.onScoreTypeChangeForEvent(ScoreType.MEDIUM, event.getEventType());\r\n currentScoreTypeForEvent = ScoreType.MEDIUM;\r\n mediumScoreUpdated = true;\r\n }\r\n if ((Math.abs(peakValue) > 3.3) && !badScoreUpdated) {\r\n\r\n event.setScoreToBad();\r\n scoreListener.onScoreTypeChangeForEvent(ScoreType.BAD, event.getEventType());\r\n currentScoreTypeForEvent = ScoreType.BAD;\r\n badScoreUpdated = true;\r\n }\r\n }\r\n }\r\n }",
"public void calculations(){\n\n int temp_size1 = fight_list.get(0).t1.members.size();\n int[] t1_counter = new int[temp_size1 + 1]; //counter for deaths: 0, 1, 2..., party size.\n float t1_avg = 0; //Average number of deaths.\n\n //We don't need to calculate for t2 right now, because t2 is just monsters.\n //temp_size = fight_list.get(0).t2.members.size();\n //int[] t2_counter = new int[temp_size + 1];\n\n for(FightResult fig : this.fight_list){\n int i = 0;\n while(i != fig.t1_deaths){\n i++;\n }\n t1_counter[i]++;\n t1_avg += fig.t1_deaths;\n }//end for\n\n System.out.println(t1_avg);\n System.out.println(Float.toString(t1_avg/fight_list.size()) + \" / \" + Integer.toString(temp_size1));\n\n String axis = \"# of deaths: \\t\";\n int axis_int = 0;\n String t1_results = \"Happened: \\t\";\n for(int i : t1_counter){\n axis += Integer.toString(axis_int++) + \"\\t\";\n t1_results += Integer.toString(i) + \"\\t\";\n }//end for\n System.out.println(axis);\n System.out.println(t1_results);\n\n float tpk_amount = t1_counter[temp_size1]; //by taking the size, we take the item at the end of the array. In this case, the number where everyone dies.\n tpk_amount = (tpk_amount/fight_list.size())*100;\n System.out.println(\"Probability of TPK: \" + Float.toString(tpk_amount) + \" %.\");\n\n System.out.println(\"\\n--------\\n\");\n }",
"@Override\n public void update(Instance instance, Attribute label) {\n for (Attribute att : instance.getAtts()) {\n AttStat attStat = attStats.get(att.getAttributeInfo());\n if (attStat != null)\n attStat.update(att, label);\n }\n numData += 1;\n }",
"public void calcAvg(){\n\t\taverage = hits/atbat;\n\t\t\n\t}",
"protected abstract void calcScores();",
"private void update(Instance instance) throws Exception {\n\n if (instance.classIsMissing()) {\n return;\n }\n\n instance.replaceMissingValues(m_MissingVector);\n m_Train.add(instance);\n\n /* Update the minimum and maximum for all the attributes */\n updateMinMax(instance);\n\n /* update the mutual information datas */\n updateMI(instance);\n\n /* Nearest Exemplar */\n Exemplar nearest = nearestExemplar(instance);\n\t\n /* Adjust */\n if(nearest == null){\n Exemplar newEx = new Exemplar(this, m_Train, 10, instance.classValue());\n newEx.generalise(instance);\n initWeight(newEx);\n addExemplar(newEx);\n return;\n }\n adjust(instance, nearest);\n\n /* Generalise */\n generalise(instance);\n }",
"private double computeInfoGain(Instances data)\n throws Exception {\n\n double infoGain = computeEntropy(data);\n Instances[] splitData = m_localModel.split(data);\n for (int j = 0; j < m_localModel.numSubsets(); j++) {\n if (splitData[j].numInstances() > 0) {\n infoGain -= ((double) splitData[j].numInstances() /\n (double) data.numInstances()) *\n computeEntropy(splitData[j]);\n }\n }\n return infoGain;\n }",
"public double getScore() {\n int as = this.attributes.size(); // # of attributes that were matched\n\n // we use thresholding ranking approach for numInstances to influence the matching score\n int instances = this.train.numInstances();\n int inst_rank = 0;\n if (instances > 100) {\n inst_rank = 1;\n }\n if (instances > 500) {\n inst_rank = 2;\n }\n\n return this.p_sum + as + inst_rank;\n }",
"@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 doWork() throws OperatorException {\n\t\tExampleSet eSet = exampleSetInput.getData(ExampleSet.class);\n\t\teSet.recalculateAllAttributeStatistics();\n\t\tDataStatistics statistics = new DataStatistics();\n\t\tIterator<Attribute> i = eSet.getAttributes().allAttributes();\n\t\twhile (i.hasNext()) {\n\t\t\tstatistics.addInfo(eSet, i.next());\n\t\t}\n\t\texampleSetOutput.deliver(eSet);\n\t\tstatisticsOutput.deliver(statistics);\n\t}",
"public void computeLogLikelihood(double[] betas, Instances instances) {\n //Basic implementation done in the prior class.\n super.computelogLikelihood(betas, instances);\n }",
"public static ArrayList<ArrayList<ArrayList<Double>>> assignScoreToQueries() {\r\n\t\t\r\n\t\tArrayList<ArrayList<ArrayList<Double>>> allQueries = Queries.createQueries();\r\n\t\tArrayList<ArrayList<String>> dataset = ReadInDataset.finalDataset;\r\n\t\tint Counter = 0;\r\n\t\tDouble Score = 0.0;\r\n\t\tDecimalFormat df = new DecimalFormat(\"#.####\");\r\n\t\tdf.setRoundingMode(RoundingMode.CEILING); // round up to 4 decimal places\r\n\t\t\r\n\t\t\r\n\t\t// initially assign to each query a score of 0\r\n\t\t\r\n\t\tfor (int i = 0; i < allQueries.size(); i++) {\r\n\t\t\tArrayList<Double> zero = new ArrayList<Double>();\r\n\t\t\tzero.add(0.0);\r\n\t\t\tallQueries.get(i).add(zero);}\r\n\t\t\r\n\t\t// go through each query and check how many entries of the dataset it matches\r\n\t\t// with each match increase the score\r\n\t\t\r\n\t\tfor (int i = 0; i < allQueries.size(); i++) { // for each query\r\n\t\t\tfor(int b=0; b < dataset.size(); b++) { // for each dataset\r\n\t\t\t\tCounter = 0; \r\n\t\t\t\tfor (int a=0; a < allQueries.get(i).size()-1; a++) { // for each query clause\r\n\t\t\t\t//check if the query criteria match the dataset and increase the Score accordingly\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t //this counter ensures that all query requirements are met in order to increase the score\r\n\t\t\t\t\tif (a != allQueries.get(i).size() - 1) {\t\t\t\t\t\t // ensure that Score entry is not involved in Query Matching\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// take min and max from query along with an entry from the dataset, convert to a double of 4 decimal places\r\n\t\t\t\t\t\tdouble minPoint1 = allQueries.get(i).get(a).get(0);\r\n\t\t\t\t\t\tString minPoint2 = df.format(minPoint1);\r\n\t\t\t\t\t\tdouble minPoint = Double.parseDouble(minPoint2);\r\n\t\t\t\t\t\tdouble maxPoint1 = allQueries.get(i).get(a).get(1);\r\n\t\t\t\t\t\tString maxPoint2 = df.format(maxPoint1);\r\n\t\t\t\t\t\tdouble maxPoint = Double.parseDouble(maxPoint2);\r\n\t\t\t\t\t\tdouble dataPoint1 = Double.parseDouble(dataset.get(b).get(a+1));\r\n\t\t\t\t\t\tString dataPoint2 = df.format(dataPoint1);\r\n\t\t\t\t\t\tdouble dataPoint = Double.parseDouble(dataPoint2);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ( dataPoint<= maxPoint && dataPoint >= minPoint) { Counter++; \r\n\t\t\t\t\t//\tSystem.out.println(\"min:\" + minPoint+\" max: \"+maxPoint+\" data: \"+dataPoint+ \" of Query: \" + b+ \"| Query Match!\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {//System.out.println(minPoint+\" \"+maxPoint+\" \"+dataPoint+ \" of \" + b);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\tif (Counter==(Queries.getDimensions())/2) { // if counter equals the dimensions of the query then increase score\r\n\t\t\t\t\tScore = allQueries.get(i).get(allQueries.get(i).size()-1).get(0);\r\n\t\t\t\t\tallQueries.get(i).get(allQueries.get(i).size()-1).set(0, Score+1.00); \r\n\t\t\t\t\t}}\r\n\t\t\t\t \r\n\t\t\t\t}\r\n\t\t//\tSystem.out.println(\"Score = \" + allQueries.get(i).get(allQueries.get(i).size()-1).get(0));\r\n\t\t}\t\r\n\t\treturn allQueries;\r\n\t}",
"private void evaluateData () {\n long rows = DatabaseUtils.longForQuery(sqliteDBHelper.openSqlDatabaseReadable(), \"SELECT COUNT(*) FROM \" + SqliteDBStructure.DATA_AGGREGATE\r\n + \" JOIN \" + SqliteDBStructure.INFO_AT_ACCESSTIME + \" ON \"\r\n + SqliteDBStructure.DATA_AGGREGATE + \".\" + SqliteDBStructure.ACCESS_TIME + \" = \" + SqliteDBStructure.INFO_AT_ACCESSTIME + \".\" + SqliteDBStructure.ACCESS_TIME, null);\r\n // calculate the amount of tasks (thread) depending on the MaxBatchSize\r\n tasks = rows >= MaxBatchSize? (int)(rows/MaxBatchSize + 1):1;\r\n // set the amount of finished tasks to 0\r\n finished = 0;\r\n // send the amount of task to the main activity so it can be displayed in the progress dialog\r\n sendTaskAmount(tasks + 1);\r\n // create a thread pool with tasks amount of threads\r\n final ExecutorService executorService = Executors.newFixedThreadPool(tasks);\r\n // create a list which holds all the tasks to be executed\r\n final List<ProcessingDataHandler> taskList = new LinkedList<>();\r\n // for each task create a batch of MaxBatchSize rows to evaluate\r\n for (int i = 0; i < tasks; i++) {\r\n // pass the offset (where to start) and the limit (how many rows)\r\n taskList.add(new ProcessingDataHandler(i*MaxBatchSize, MaxBatchSize));\r\n }\r\n // invoke all the task at once\r\n new Thread(new Runnable() {\r\n @Override\r\n public void run() {\r\n try {\r\n executorService.invokeAll(taskList);\r\n } catch (InterruptedException e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n }).start();\r\n\r\n updateProgressDialog();\r\n }",
"@Override\n\tpublic double distance(Instance first, Instance second,\n\t\t\tPerformanceStats stats) throws Exception {\n\t\treturn 0;\n\t}",
"@Override\n\tpublic void buildEvaluator(Instances data) throws Exception {\n\t\tthis.instances = data;\n\t}",
"@Override\n\tpublic Double operate(List<DataPoint<Short>> data) throws Exception {\n\t\tDouble max = Double.MIN_VALUE;\n\t\tfor (DataPoint<Short> point : data) {\n\t\t\tif (max.doubleValue() < point.getValue().doubleValue()) {\n\t\t\t\tmax = point.getValue().doubleValue();\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn max;\n\t}",
"@Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n gameData.setDayEastCounter((long)dataSnapshot.child(\"East\").child(\"Day\").child(\"Donations\").getValue());\n gameData.setDayNorthCounter((long)dataSnapshot.child(\"North\").child(\"Day\").child(\"Donations\").getValue());\n gameData.setDaySouthCounter((long)dataSnapshot.child(\"South\").child(\"Day\").child(\"Donations\").getValue());\n gameData.setDayWestCounter((long)dataSnapshot.child(\"West\").child(\"Day\").child(\"Donations\").getValue());\n\n gameData.setNightEastCounter((long)dataSnapshot.child(\"East\").child(\"Night\").child(\"Donations\").getValue());\n gameData.setNightNorthCounter((long)dataSnapshot.child(\"North\").child(\"Night\").child(\"Donations\").getValue());\n gameData.setNightSouthCounter((long)dataSnapshot.child(\"South\").child(\"Night\").child(\"Donations\").getValue());\n gameData.setNightWestCounter((long)dataSnapshot.child(\"West\").child(\"Night\").child(\"Donations\").getValue());\n\n //read donations per all area\n gameData.setEastTotal((long)dataSnapshot.child(\"East\").child(\"Donations\").getValue());\n gameData.setNorthTotal((long)dataSnapshot.child(\"North\").child(\"Donations\").getValue());\n gameData.setSouthTotal((long)dataSnapshot.child(\"South\").child(\"Donations\").getValue());\n gameData.setWestTotal((long)dataSnapshot.child(\"West\").child(\"Donations\").getValue());\n\n Log.d(\"GAME4\", \"done importing game stats update\" );\n\n gameData.computeGameStats();\n Log.d(\"GAME4\", \"done computing stats from updated data\");\n }",
"@Override\r\n\t\tpublic int calculAnomaly(int total, int freq) {\n\t\t\treturn (int) Math.round(Math.log((double)total/(double)freq));\r\n\r\n\r\n\t\t}",
"private void process () {\r\n\r\n ArrayList<String> anomaly;\r\n ArrayList<DataInfo> tmp = new ArrayList<>();\r\n int appState, screenState, screenOrientation, closeToObject, opID;\r\n long permissionCount;\r\n double scanDuration;\r\n String packageName, permission, accessTime;\r\n\r\n // get the data in the given scope (from offset, limit rows)\r\n Cursor cursor = sqliteDBHelper.get_data(\"SELECT \" + SqliteDBStructure.PACKAGE_NAME + \", \"\r\n + SqliteDBStructure.PERMISSION + \", \"\r\n + SqliteDBStructure.DATA_AGGREGATE + \".\" + SqliteDBStructure.ACCESS_TIME + \", \"\r\n + SqliteDBStructure.APP_STATE + \", \"\r\n + SqliteDBStructure.SCREEN_STATE + \", \"\r\n + SqliteDBStructure.SCREEN_ORIENTATION + \", \"\r\n + SqliteDBStructure.CLOSE_TO_OBJECT\r\n + \" FROM \" + SqliteDBStructure.DATA_AGGREGATE\r\n + \" JOIN \" + SqliteDBStructure.INFO_AT_ACCESSTIME + \" ON \"\r\n + SqliteDBStructure.DATA_AGGREGATE + \".\" + SqliteDBStructure.ACCESS_TIME + \" = \" + SqliteDBStructure.INFO_AT_ACCESSTIME + \".\" + SqliteDBStructure.ACCESS_TIME\r\n + \" LIMIT \" + limit + \" OFFSET \" + offset);\r\n\r\n try {\r\n if (cursor != null) {\r\n cursor.moveToFirst();\r\n\r\n while (!cursor.isAfterLast()) {\r\n packageName = cursor.getString(cursor.getColumnIndexOrThrow(SqliteDBStructure.PACKAGE_NAME));\r\n opID = cursor.getInt(cursor.getColumnIndexOrThrow(SqliteDBStructure.PERMISSION));\r\n permission = Permission.opIDToName(opID);\r\n accessTime = cursor.getString(cursor.getColumnIndexOrThrow(SqliteDBStructure.ACCESS_TIME));\r\n appState = cursor.getInt(cursor.getColumnIndexOrThrow(SqliteDBStructure.APP_STATE));\r\n screenState = cursor.getInt(cursor.getColumnIndexOrThrow(SqliteDBStructure.SCREEN_STATE));\r\n screenOrientation = cursor.getInt(cursor.getColumnIndexOrThrow(SqliteDBStructure.SCREEN_ORIENTATION));\r\n closeToObject = cursor.getInt(cursor.getColumnIndexOrThrow(SqliteDBStructure.CLOSE_TO_OBJECT));\r\n\r\n permissionCount = DatabaseUtils.longForQuery(sqliteDBHelper.getReadableDatabase(), \"SELECT COUNT(*) FROM \" + SqliteDBStructure.DATA_AGGREGATE + \" WHERE \" + SqliteDBStructure.PACKAGE_NAME + \" = '\" + packageName + \"' \" + \" AND \" + SqliteDBStructure.PERMISSION + \" = '\" + opID + \"';\", null);\r\n\r\n //Scan duration in Minutes\r\n scanDuration = (((double) stop_scan_time.getTime() + (double) start_scan_time.getTime()) / 1000 )/ 60;\r\n //check for anomaly by ruleset class\r\n anomaly = RuleSet.checkForAnomaly(packageName, permission, permissionCount, appState, screenState, screenOrientation, closeToObject, scanDuration, context);\r\n\r\n //Send data to server or save it locally, if no valid internet connection is available\r\n if (networking) {\r\n sendRawData(packageName, permission, accessTime, appState, screenState, screenOrientation, closeToObject);\r\n if (anomaly.get(0).equals(\"1\"))\r\n MyClient.POST_Anomaly(packageName, permission, anomaly.get(1), \"0\");\r\n } else {\r\n saveRawData(packageName, permission, accessTime, appState, screenState, screenOrientation, closeToObject);\r\n if (anomaly.get(0).equals(\"1\"))\r\n saveAnomaliesImage(packageName, permission, anomaly.get(1), 0);\r\n }\r\n\r\n // create a info object which holds all the necessary information about that data block and store it temporarily in a list\r\n DataInfo info = new DataInfo(packageName, Permission.opIDToDescription(opID), accessTime, permissionCount, anomaly.get(0), anomaly.get(1), scanTime, 0);\r\n tmp.add(info);\r\n\r\n // should the size of the temporary list exceeds MaxBatchSize, write list to the local DB and clear the temp list afterwards \r\n // technically this cannot happen but we are working with threads here so better be safe than sorry\r\n // temp list should not be to big, because we have have to hold task amount of temp list, with each containing around MaxBatchSize entries, in memory at the same time\r\n if (tmp.size() > MaxBatchSize) {\r\n bulkInsertIntoDataAnalyzing(tmp);\r\n tmp.clear();\r\n }\r\n\r\n cursor.moveToNext();\r\n }\r\n\r\n }\r\n } finally {\r\n if (cursor != null) {\r\n cursor.close();\r\n }\r\n }\r\n\r\n // write the data stored in the temp list to the local DB \r\n if (tmp.size() > 0) {\r\n bulkInsertIntoDataAnalyzing(tmp);\r\n tmp.clear();\r\n }\r\n // inform the progress dialog that a task has been finished\r\n updateProgressDialog();\r\n // decrease the amount of ongoing tasks by 1\r\n decreaseTasks();\r\n }",
"@Override\n\tvoid averageDistance() {\n\t\t\n\t}",
"@Override\n public void onNext(ComputeAverageResponse value) {\n System.out.println(\"Received a response from the server\");\n System.out.println(value.getAverage());\n //onNext will be called only once\n }",
"private float calculateSimilarityScore(int numOfSuspiciousNodesInA, int numOfSuspiciousNodesInB) {\n\t\t// calculate the similarity score\n\t\treturn (float) (numOfSuspiciousNodesInA + numOfSuspiciousNodesInB) \n\t\t\t\t/ (programANodeList.size() + programBNodeList.size()) * 100;\n\t}",
"public void aggregateResults()\n\t{\n\t\ttry {\n\t\t\tAggregateableEvaluation aggContNaive = new AggregateableEvaluation(this.evalNaiveBayesList.get(0));\n\t\t\tAggregateableEvaluation aggContSMO = new AggregateableEvaluation(this.evalSMOList.get(0));\n\t\t\tAggregateableEvaluation aggDonaNaive = new AggregateableEvaluation(this.evalNaiveBayesList.get(15));\n\t\t\tAggregateableEvaluation aggDonaSMO = new AggregateableEvaluation(this.evalSMOList.get(15));\n\t\t\tAggregateableEvaluation aggOffiNaive = new AggregateableEvaluation(this.evalNaiveBayesList.get(30));\n\t\t\tAggregateableEvaluation aggOffiSMO = new AggregateableEvaluation(this.evalSMOList.get(30));\n\t\t\tAggregateableEvaluation aggAdviNaive = new AggregateableEvaluation(this.evalNaiveBayesList.get(45));\n\t\t\tAggregateableEvaluation aggAdviSMO = new AggregateableEvaluation(this.evalSMOList.get(45));\n\t\t\tAggregateableEvaluation aggMultNaive = new AggregateableEvaluation(this.evalNaiveBayesList.get(60));\n\t\t\tAggregateableEvaluation aggMultSMO = new AggregateableEvaluation(this.evalSMOList.get(60));\n\t\t\tAggregateableEvaluation aggGoodNaive = new AggregateableEvaluation(this.evalNaiveBayesList.get(75));\n\t\t\tAggregateableEvaluation aggGoodSMO = new AggregateableEvaluation(this.evalSMOList.get(75));\n\t\t\t\n\n\t\t\tfor (int i = 1; i < 15; i++)\n\t\t\t{\n\t\t\t\taggContNaive.aggregate(this.evalNaiveBayesList.get(i));\n\t\t\t\taggContSMO.aggregate(this.evalSMOList.get(i));\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tfor (int i = 16; i < 30; i++)\n\t\t\t{\n\t\t\t\taggDonaNaive.aggregate(this.evalNaiveBayesList.get(i));\n\t\t\t\taggDonaSMO.aggregate(this.evalSMOList.get(i));\t\t\t\t\n\t\t\t}\n\n\t\t\tfor (int i = 31; i < 45; i++)\n\t\t\t{\n\t\t\t\taggOffiNaive.aggregate(this.evalNaiveBayesList.get(i));\n\t\t\t\taggOffiSMO.aggregate(this.evalSMOList.get(i));\t\t\t\t\n\t\t\t}\n\n\t\t\tfor (int i = 46; i < 60; i++)\n\t\t\t{\n\t\t\t\taggAdviNaive.aggregate(this.evalNaiveBayesList.get(i));\n\t\t\t\taggAdviSMO.aggregate(this.evalSMOList.get(i));\n\t\t\t}\n\n\t\t\tfor (int i = 61; i < 75; i++)\n\t\t\t{\n\t\t\t\taggMultNaive.aggregate(this.evalNaiveBayesList.get(i));\n\t\t\t\taggMultSMO.aggregate(this.evalSMOList.get(i));\n\t\t\t}\n\n\t\t\tfor (int i = 76; i < 90; i++)\n\t\t\t{\n\t\t\t\taggGoodNaive.aggregate(this.evalNaiveBayesList.get(i));\n\t\t\t\taggGoodSMO.aggregate(this.evalSMOList.get(i));\n\t\t\t}\n\n\t\t\tfor (int a = 0; a < 6; a++)\n\t\t\t{\n\t\t\t\tString aggregateText;\n\t\t\t\tswitch (a)\n\t\t\t\t{\n\t\t\t\tcase 0: aggregateText = \"ContinuingNewsAggregateResults.txt\"; break;\n\t\t\t\tcase 1: aggregateText = \"DonationsAggregateResults.txt\"; break;\n\t\t\t\tcase 2: aggregateText = \"OfficialAggregateResults.txt\"; break;\n\t\t\t\tcase 3: aggregateText = \"AdviceAggregateResults.txt\"; break;\n\t\t\t\tcase 4: aggregateText = \"MultimediaAggregateResults.txt\"; break;\n\t\t\t\tcase 5: aggregateText = \"GoodsAggregateResults.txt\"; break;\n\t\t\t\tdefault: aggregateText = \"CompleteAggregateResults.txt\";\n\t\t\t\t}\n\n\t\t\t\tBufferedWriter bw = new BufferedWriter(new FileWriter(aggregateText));\n\t\t\t\tbw.write(\"=== Summary of Naive Bayes ===\");\n\n\t\t\t\tswitch (a)\n\t\t\t\t{\n\t\t\t\tcase 0:\tbw.write(aggContNaive.toSummaryString());\n\t\t\t\tbw.write(aggContNaive.toClassDetailsString());\n\t\t\t\tbw.write(aggContNaive.toMatrixString()); break;\n\t\t\t\tcase 1:\tbw.write(aggDonaNaive.toSummaryString());\n\t\t\t\tbw.write(aggDonaNaive.toClassDetailsString());\n\t\t\t\tbw.write(aggDonaNaive.toMatrixString()); break;\n\t\t\t\tcase 2:\tbw.write(aggOffiNaive.toSummaryString());\n\t\t\t\tbw.write(aggOffiNaive.toClassDetailsString());\n\t\t\t\tbw.write(aggOffiNaive.toMatrixString()); break;\n\t\t\t\tcase 3:\tbw.write(aggAdviNaive.toSummaryString());\n\t\t\t\tbw.write(aggAdviNaive.toClassDetailsString());\n\t\t\t\tbw.write(aggAdviNaive.toMatrixString()); break;\n\t\t\t\tcase 4:\tbw.write(aggMultNaive.toSummaryString());\n\t\t\t\tbw.write(aggMultNaive.toClassDetailsString());\n\t\t\t\tbw.write(aggMultNaive.toMatrixString()); break;\n\t\t\t\tdefault:\tbw.write(aggGoodNaive.toSummaryString());\n\t\t\t\tbw.write(aggGoodNaive.toClassDetailsString());\n\t\t\t\tbw.write(aggGoodNaive.toMatrixString()); \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbw.write(\"=== Summary of SMO ===\");\n\n\t\t\t\tswitch (a)\n\t\t\t\t{\n\t\t\t\tcase 0:\tbw.write(aggContSMO.toSummaryString());\n\t\t\t\tbw.write(aggContSMO.toClassDetailsString());\n\t\t\t\tbw.write(aggContSMO.toMatrixString()); break;\n\t\t\t\tcase 1:\tbw.write(aggDonaSMO.toSummaryString());\n\t\t\t\tbw.write(aggDonaSMO.toClassDetailsString());\n\t\t\t\tbw.write(aggDonaSMO.toMatrixString()); break;\n\t\t\t\tcase 2:\tbw.write(aggOffiSMO.toSummaryString());\n\t\t\t\tbw.write(aggOffiSMO.toClassDetailsString());\n\t\t\t\tbw.write(aggOffiSMO.toMatrixString()); break;\n\t\t\t\tcase 3:\tbw.write(aggAdviSMO.toSummaryString());\n\t\t\t\tbw.write(aggAdviSMO.toClassDetailsString());\n\t\t\t\tbw.write(aggAdviSMO.toMatrixString()); break;\n\t\t\t\tcase 4:\tbw.write(aggMultSMO.toSummaryString());\n\t\t\t\tbw.write(aggMultSMO.toClassDetailsString());\n\t\t\t\tbw.write(aggMultSMO.toMatrixString()); break;\n\t\t\t\tdefault:\tbw.write(aggGoodSMO.toSummaryString());\n\t\t\t\tbw.write(aggGoodSMO.toClassDetailsString());\n\t\t\t\tbw.write(aggGoodSMO.toMatrixString()); \t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbw.close();\n\t\t\t}\n\n\n\t\t} catch (Exception e) {\n\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"private void upgradeImplicitAverageMonitoringRules()\r\n {\r\n if ( executeSql( \"update validationrule set lowoutliers = lowoutliers where validationruleid < 0\" ) < 0 )\r\n {\r\n return; // Already converted because lowoutlier fields are gone\r\n }\r\n\r\n // Just to be extra sure, we don't modify any expressions which already contain a call to AVG or STDDEV\r\n executeSql( \"INSERT INTO expressionsampleelement (expressionid, dataelementid) \" +\r\n \"SELECT ede.expressionid, ede.dataelementid \" +\r\n \"FROM expressiondataelement ede \" +\r\n \"JOIN expression e ON e.expressionid = ede.expressionid \" +\r\n \"JOIN validationrule v ON v.rightexpressionid = e.expressionid \" +\r\n \"WHERE v.ruletype='SURVEILLANCE' \" +\r\n \"AND e.expression NOT LIKE '%AVG%' and e.expression NOT LIKE '%STDDEV%';\" );\r\n\r\n executeSql( \"update expression set expression=\" + statementBuilder.concatenate( \"'AVG('\", \"expression\", \"')'\" ) +\r\n \" from validationrule where ruletype='SURVEILLANCE' AND rightexpressionid=expressionid \" +\r\n \"AND expression NOT LIKE '%AVG%' and expression NOT LIKE '%STDDEV%';\" );\r\n\r\n executeSql( \"ALTER TABLE validationrule DROP COLUMN highoutliers\" );\r\n executeSql( \"ALTER TABLE validationrule DROP COLUMN lowoutliers\" );\r\n\r\n log.info( \"Added explicit AVG calls to olid-style implicit average surveillance rules\" );\r\n }",
"public void outputData(MDCheckData checkData, List<MDCheckRequest> requests) {\n\t\tif (!isEnabled()) { return; }\n\t\tfor (MDCheckRequest mdCheckRequest : requests) {\n\t\t\tMDCheckCVRequest request = (MDCheckCVRequest) mdCheckRequest;\n\t\t\t// Output the results\n\t\t\tIPLocatorResults ipResults = request.ipLocatorResults;\n\t\t\tif ((ipResults != null) && ipResults.valid) {\n\t\t\t\t// output results\n\t\t\t\tif (!Const.isEmpty(outIPAddress)) {\n\t\t\t\t\trequest.addOutputData(ipResults.ipAddress);\n\t\t\t\t}\n\t\t\t\tif (!Const.isEmpty(outLatitude)) {\n\t\t\t\t\trequest.addOutputData(ipResults.latitude);\n\t\t\t\t}\n\t\t\t\tif (!Const.isEmpty(outLongitude)) {\n\t\t\t\t\trequest.addOutputData(ipResults.longitude);\n\t\t\t\t}\n\t\t\t\tif (!Const.isEmpty(outZip)) {\n\t\t\t\t\trequest.addOutputData(ipResults.zip);\n\t\t\t\t}\n\t\t\t\tif (!Const.isEmpty(outRegion)) {\n\t\t\t\t\trequest.addOutputData(ipResults.region);\n\t\t\t\t}\n\t\t\t\tif (!Const.isEmpty(outName)) {\n\t\t\t\t\trequest.addOutputData(ipResults.name);\n\t\t\t\t}\n\t\t\t\tif (!Const.isEmpty(outDomain)) {\n\t\t\t\t\trequest.addOutputData(ipResults.domain);\n\t\t\t\t}\n\t\t\t\tif (!Const.isEmpty(outCityName)) {\n\t\t\t\t\trequest.addOutputData(ipResults.cityName);\n\t\t\t\t}\n\t\t\t\tif (!Const.isEmpty(outCountry)) {\n\t\t\t\t\trequest.addOutputData(ipResults.country);\n\t\t\t\t}\n\t\t\t\tif (!Const.isEmpty(outAbbreviation)) {\n\t\t\t\t\trequest.addOutputData(ipResults.abbreviation);\n\t\t\t\t}\n\t\t\t\tif (!Const.isEmpty(outConnectionSpeed)) {\n\t\t\t\t\trequest.addOutputData(ipResults.connectionSpeed);\n\t\t\t\t}\n\t\t\t\tif (!Const.isEmpty(outConnectionType)) {\n\t\t\t\t\trequest.addOutputData(ipResults.connectionType);\n\t\t\t\t}\n\t\t\t\tif (!Const.isEmpty(outUTC)) {\n\t\t\t\t\trequest.addOutputData(ipResults.utc);\n\t\t\t\t}\n\t\t\t\tif (!Const.isEmpty(outContinent)) {\n\t\t\t\t\trequest.addOutputData(ipResults.continent);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t// If it was not valid then we need to add empty data to the output\n\t\t\t\trequest.outputDataSize += fieldsAdded;\n\t\t\t\trequest.outputData = RowDataUtil.resizeArray(request.outputData, request.outputDataSize);\n\t\t\t\t// TODO: Reroute this record to an invalid output stream?\n\t\t\t}\n\t\t\tif (ipResults != null) {\n\t\t\t\tif(AdvancedConfigurationMeta.isEnterprise(MDPropTags.MDLICENSE_PRODUCT_IpLocatorObject)) {\n\t\t\t\t\trequest.resultCodes.addAll(ipResults.resultCodes);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"private float averageBeat(){\n float avgBeat = 0f;\n List<Float> beatRed = DataManager.getInstance().getBeatRed();\n List<Float> beatIR = DataManager.getInstance().getBeatIR();\n\n for(int i = 0; i < beatRed.size() && i < beatIR.size(); i ++ ){\n chartFragment.addRedData(beatRed.get(i));\n chartFragment.addIRData(beatIR.get(i));\n avgBeat += beatRed.get(i);\n avgBeat += beatIR.get(i);\n }\n avgBeat = avgBeat / (beatRed.size() + beatIR.size());\n\n if (tcpTask != null )\n this.tcpTask.addData(\"\" + avgBeat);\n beatLabel.setText(\"Beat : \" + avgBeat);\n return avgBeat;\n }",
"private void calculateAvg() {\n\t\tDescriptiveStatistics stats = new DescriptiveStatistics();\n\t\tfor (QueryInfo oneQ : this.maxQueries) {\n\t\t\tstats.addValue(oneQ.getGapCount() * oneQ.getFrequency());\n\t\t}\n\t\tthis.avgGain = stats.getMean();\n\t\tthis.medianGain = stats.getPercentile(50);\n\t\tthis.quartiles = stats.getPercentile(75);\n\t}",
"public abstract void calculateSufficientStatistics();",
"private void iterativeDataPropertyMetrics() {\n\t}",
"private double[][] calculateValues() throws ExafsScanPointCreatorException {\n\t\tscanTimes= new ArrayList<> ();\n\t\tdouble[][] preEdgeEnergies = createStepArray(initialEnergy, aEnergy, preEdgeStep, preEdgeTime, false,\n\t\t\t\tnumberDetectors);\n\t\tscanTimes.add(new ExafsScanRegionTime(\"PreEdge\", preEdgeEnergies.length, new double[]{preEdgeTime}));\n\t\tdouble[][] abEnergies = convertABSteps(aEnergy, bEnergy, preEdgeStep, edgeStep, preEdgeTime);\n\t\tscanTimes.add(new ExafsScanRegionTime(\"AbEdge\", abEnergies.length, new double[]{preEdgeTime}));\n\n\t\tdouble[][] bcEnergies = createStepArray(bEnergy+edgeStep, cEnergy, edgeStep, edgeTime, false, numberDetectors);\n\t\tscanTimes.add(new ExafsScanRegionTime(\"BcEnergy\", bcEnergies.length, new double[]{edgeTime}));\n\t\t// if varying time the temporarily set the exafs time to a fixed value\n\t\tif (!exafsConstantTime)\n\t\t\texafsTime = exafsFromTime;\n\n\t\tdouble[][] exafsEnergies;\n\t\tif (exafsConstantEnergyStep)\n\t\t\texafsEnergies = createStepArray(cEnergy, finalEnergy, exafsStep, exafsTime, true, numberDetectors);\n\t\telse\n\t\t\texafsEnergies = calculateExafsEnergiesConstantKStep();\n\t\t// now change all the exafs times if they vary\n\t\tif (!exafsConstantTime)\n\t\t\texafsEnergies = convertTimes(exafsEnergies, exafsFromTime, exafsToTime);\n\n\t\t// Smooth out the transition between edge and exafs region.\n\t\tfinal double[][][] newRegions = createEdgeToExafsSteps(cEnergy, exafsEnergies, edgeStep, exafsTime);\n\t\tfinal double[][] edgeToExafsEnergies = newRegions[0];\n\t\tif(edgeToExafsEnergies != null)\n\t\t\tscanTimes.add(new ExafsScanRegionTime(\"EdgetoExafs\", edgeToExafsEnergies.length, new double[]{exafsTime}));\n\t\texafsEnergies = newRegions[1];\n\n\t\t// The edgeToExafsEnergies replaces the first EXAFS_SMOOTH_COUNT\n\n\t\t// merge arrays\n\t\tdouble []exafsRegionTimeArray = new double[exafsEnergies.length];\n\t\tint k =0;\n\t\tfor(double[] exafsEnergy : exafsEnergies)\n\t\t\texafsRegionTimeArray[k++ ] = exafsEnergy[1];\n\t\tscanTimes.add(new ExafsScanRegionTime(\"Exafs\", 1, exafsRegionTimeArray));\n\t\tdouble[][] allEnergies = (double[][]) ArrayUtils.addAll(preEdgeEnergies, abEnergies);\n\t\tallEnergies = (double[][]) ArrayUtils.addAll(allEnergies, bcEnergies);\n\t\tif (edgeToExafsEnergies != null)\n\t\t\tallEnergies = (double[][]) ArrayUtils.addAll(allEnergies, edgeToExafsEnergies);\n\t\tallEnergies = (double[][]) ArrayUtils.addAll(allEnergies, exafsEnergies);\n\t\treturn allEnergies;\n\t}",
"public static void main(String[] args) {\n\t\tAnalyse ana = new Analyse(20, 5);\r\n//\t\tArrayList<Map.Entry<Integer, Double>> current = ana.getNeighbor(\"\")\r\n//\t\tfor(int i = 0; i < ana.average.length; i++){\r\n//\t\t\tSystem.out.println(ana.average[i]);\r\n//\t\t}\r\n//\t\tfor (int i = 0; i < 5; i++) {\r\n//\t\t\tSystem.out.println(ana.heap.get(i).getValue());\r\n//\t\t}\r\n\t\tSystem.out.println(ana.similarity.size());\r\n//\t\tArrayList<Map.Entry<Integer, Double>> record = ana.getNeighbor(\"0155061224\");\r\n//\t\tSystem.out.println(ana.heap.size());\r\n//\t\tSystem.out.println(record.size());\r\n//\t\tfor(int i = 0; i < record.size(); i++){\r\n//\t\t\tSystem.out.println(record.get(i).getKey());\r\n//\t\t\tSystem.out.println(record.get(i).getValue());\r\n////\t\t\tSystem.out.println(ana.matrix[record.get(i).getKey()][ana.read.getItems().indexOf(3149)]);\r\n//\t\t}\r\n\t\tlong start = System.currentTimeMillis();\r\n\t\tSystem.out.println(\"score\" + ana.predictionBaseline(\"100\"));\r\n\t\tlong end = System.currentTimeMillis();\r\n\t\tSystem.out.println(end - start);\r\n//\t\tSystem.out.println(ana.predictionBaseline(\"0155061224\"));\r\n\t}",
"protected void sortCheck() {\n if (m_instances == null) {\n return;\n }\n \n if (m_simpleConfigPanel.isUsingANativeTimeStamp()) {\n String timeStampF = m_simpleConfigPanel.getSelectedTimeStampField();\n Attribute timeStampAtt = m_instances.attribute(timeStampF); \n if (timeStampAtt != null) {\n \n double lastNonMissing = Utils.missingValue();\n boolean ok = true;\n boolean hasMissing = false;\n for (int i = 0; i < m_instances.numInstances(); i++) {\n Instance current = m_instances.instance(i);\n \n if (Utils.isMissingValue(lastNonMissing)) {\n if (!current.isMissing(timeStampAtt)) {\n lastNonMissing = current.value(timeStampAtt);\n } else {\n hasMissing = true;\n }\n } else {\n if (!current.isMissing(timeStampAtt)) {\n if (current.value(timeStampAtt) - lastNonMissing < 0) {\n ok = false;\n break;\n }\n \n lastNonMissing = current.value(timeStampAtt);\n } else {\n hasMissing = true;\n }\n }\n }\n \n if (!ok && !hasMissing) {\n // ask if we should sort\n int result = JOptionPane.showConfirmDialog(ForecastingPanel.this, \n \"The data does not appear to be in sorted order of \\\"\"\n + timeStampF + \"\\\". Do you want to sort the data?\", \n \"Forecasting\", JOptionPane.YES_NO_OPTION);\n \n if (result == JOptionPane.YES_OPTION) {\n if (m_log != null) {\n m_log.statusMessage(\"Sorting data...\");\n }\n m_instances.sort(timeStampAtt);\n m_sortedCheck = true; \n }\n }\n \n if (!ok && hasMissing) {\n // we can't really proceed in this situation. We can't sort by the timestamp\n // because instances with missing values will be put at the end of the data.\n // The only thing we can do is to remove the instances with missing time\n // stamps but this is likely to screw up the periodicity and majorly impact\n // on results.\n \n int result = JOptionPane.showConfirmDialog(ForecastingPanel.this, \n \"The data does not appear to be in sorted order of \\\"\"\n + timeStampF + \"\\\". \\nFurthermore, there are rows with\\n\" +\n \t\t\"missing timestamp values. We can remove these\\n\" +\n \t\t\"rows and then sort the data but this is likely to\\n\" +\n \t\t\"result in degraded performance. It is strongly\\n\" +\n \t\t\"recommended that you fix these issues in the data\\n\" +\n \t\t\"before continuing. Do you want the system to proceed\\n\" +\n \t\t\"anyway by removing rows with missing timestamps and\\n\" +\n \t\t\"then sorting the data?\", \n \"Forecasting\", JOptionPane.YES_NO_OPTION);\n \n if (result == JOptionPane.YES_OPTION) {\n if (m_log != null) {\n m_log.statusMessage(\"Removing rows with missing time stamps and sorting data...\");\n }\n m_instances.deleteWithMissing(timeStampAtt);\n m_instances.sort(timeStampAtt);\n m_sortedCheck = true; \n }\n }\n }\n }\n }",
"private double calculateErrors(Instance instance, Hashtable<NeuralNode, Double> nodeValues) throws Exception {\r\n\t\tdouble ret = 0;\r\n\t\t\r\n\t\t// calculate errors for the network\r\n\t\tfor (InputNode input : inputs) {\r\n\t\t\tinput.getError(instance, nodeValues);\r\n\t\t}\r\n\t\t\r\n\t\tfor (OutputNode output : outputs) {\r\n\t\t\tdouble error = output.getError(instance, nodeValues);\r\n\t\t\tret += error * error;\r\n\t\t}\r\n\t\treturn ret;\r\n\r\n\t}",
"public double getMeanSquaredError(List<Instance> dataset){\r\n\t\tdouble total = 0;\r\n\t\tfor(Instance temp_example: dataset)\r\n\t\t{\r\n\t\t\tdouble O = calculateOutputForInstance(temp_example);\r\n\t\t\tdouble T = temp_example.output;\r\n\t\t\tdouble err = T - O;\r\n\t\t\ttotal += err*err;\r\n\t\t}\r\n\t\treturn total/dataset.size();\r\n\t}",
"public abstract double calcAvRating();",
"public double classifyInstance(Instance instance) throws Exception {\n\n /* check the instance */\n if (m_Train.equalHeaders(instance.dataset()) == false){\n throw new Exception(\"NNge.classifyInstance : Incompatible instance types !\");\n }\n\t\n Exemplar matched = nearestExemplar(instance); \n if(matched == null){\n throw new Exception(\"NNge.classifyInstance : NNge hasn't been trained !\");\n }\n return matched.classValue();\n }",
"public void analyzeData(){\n\t\tlinewidth = rt.getValue(\"Mean\", 1) - rt.getValue(\"Mean\", 0);\n\t\tRMS_edge_roughness = Math.sqrt((Math.pow(rt.getValue(\"StdDev\", 1), 2) + Math.pow(rt.getValue(\"StdDev\", 0), 2))/2); // this is the correct form\n\t\tif(rt.getValue(\"Max\",1) - rt.getValue(\"Min\", 1) > rt.getValue(\"Max\", 0) - rt.getValue(\"Min\", 0)){\n\t\t\tpkpk_edge_roughness = rt.getValue(\"Max\", 1) – rt.getValue(\"Min\", 1);\n\t\t}\n\t\telse{\n\t\t\tpkpk_edge_roughness = (rt.getValue(\"Max\", 0) – rt.getValue(\"Min\", 0));\n\t\t}\n\t\treturn;\n\t}",
"@Test(timeout = 4000)\n public void test017() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate((String) null);\n Evaluation evaluation0 = new Evaluation(instances0);\n GaussianProcesses gaussianProcesses0 = new GaussianProcesses();\n double[] doubleArray0 = new double[5];\n BinarySparseInstance binarySparseInstance0 = new BinarySparseInstance(1.0, doubleArray0);\n try { \n evaluation0.updateStatsForConditionalDensityEstimator(gaussianProcesses0, binarySparseInstance0, 680.667851151);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"weka.classifiers.functions.GaussianProcesses\", e);\n }\n }",
"private void EvalFitness(){\r\n _FitVal=0;\r\n for(int i=0; i<7;i++)\r\n for(int j=i+1;j<8;j++){\r\n if( _Data[i]==_Data[j]) _FitVal++;\r\n if(j-i==Math.abs(_Data[i]-_Data[j])) _FitVal++;\r\n }\r\n }",
"public void train() {\n\t\tfor (Instance ins : arrTrainInstances) {\n\t\t\tif (ins.scorePmi_E1E2 > largestPMI)\n\t\t\t\tlargestPMI = ins.scorePmi_E1E2;\n\t\t}\n\t\tSystem.out.println(\"Largest PMI: \" + largestPMI);\n\n\t\tfor (Instance ins : arrTrainInstances) {\n\t\t\tins.scorePmi_E1E2 = ins.scorePmi_E1E2 / largestPMI;\n\t\t}\n\n\t\tfor (Instance ins : arrTestInstances) {\n\t\t\tins.scorePmi_E1E2 = ins.scorePmi_E1E2 / largestPMI;\n\t\t}\n\n\t\tint sizeD0 = arrD0.size();\n\t\tint sizeD1 = arrD1.size();\n\t\tint sizeD2 = arrD2.size();\n\t\tint sizeD3 = arrD3.size();\n\n\t\tint sizeMin = Math.min(sizeD0, Math.min(sizeD1, Math\n\t\t\t\t.min(sizeD2, sizeD3)));\n\t\tSystem.out.println(\"sizeMin=\" + sizeMin);\n\n\t\tint n = instanceNums.length;\n\n\t\tboolean flag = false;\n\n\t\tint count = 0;\n\n\t\tfor (int i = 0; i < n; i++) {\n\n\t\t\tint k = instanceNums[i];\n\n\t\t\tif (k > sizeMin) {\n\t\t\t\tk = sizeMin;\n\t\t\t\tinstanceNums[i] = k;\n\t\t\t\tflag = true;\n\t\t\t}\n\n\t\t\tSystem.out.println(\"\\nk=\" + k);\n\n\t\t\tArrayList<Instance> arrSub0 = getInstances(arrD0, k);\n\t\t\tArrayList<Instance> arrSub1 = getInstances(arrD1, k);\n\t\t\tArrayList<Instance> arrSub2 = getInstances(arrD2, k);\n\t\t\tArrayList<Instance> arrSub3 = getInstances(arrD3, k);\n\n\t\t\tArrayList<Instance> arrTrains = new ArrayList<Instance>();\n\t\t\tarrTrains.addAll(arrSub0);\n\t\t\tarrTrains.addAll(arrSub1);\n\t\t\tarrTrains.addAll(arrSub2);\n\t\t\tarrTrains.addAll(arrSub3);\n\t\t\tCollections.shuffle(arrTrains);\n\n\t\t\tSystem.out.println(\"Training size: \" + arrTrains.size());\n\n\t\t\ttrain(arrTrains);\n\n\t\t\tdouble acc = test();\n\t\t\tacc = test();\n\n\t\t\taccuracies[i] = acc;\n\n\t\t\tcount++;\n\n\t\t\tif (flag == true)\n\t\t\t\tbreak;\n\n\t\t}\n\n\t\tfor (int i = 0; i < count; i++) {\n\t\t\tSystem.out.print(\" | \" + \"K=\" + instanceNums[i]);\n\t\t}\n\t\tSystem.out.println();\n\n\t\tfor (int i = 0; i < count; i++) {\n\n\t\t\tDecimalFormat df = new DecimalFormat(\"#.####\");\n\t\t\tString res = df.format(accuracies[i]);\n\t\t\tSystem.out.print(\" | \" + res);\n\t\t}\n\t\tSystem.out.println();\n\t}",
"public double[] distributionForInstance(Instance instance) throws Exception {\r\n\t\tif (configuration.getNominalToBinaryFilter()) {\r\n\t\t\tnominalToBinaryFilter.input(instance);\r\n\t\t\tinstance = nominalToBinaryFilter.output();\r\n\t\t}\r\n\r\n\t\tif (configuration.isNormalizeAttributes()) {\r\n\t\t\tfor (int noa = 0; noa < instance.numAttributes(); noa++) {\r\n\t\t\t\tif (noa != instance.classIndex()) {\r\n\t\t\t\t\tdouble oldValue = instance.value(noa);\r\n\t\t\t\t\t\r\n\t\t\t\t\tdouble value = configuration.normalizeAttribute(noa, oldValue);\r\n\t\t\t\t\tinstance.setValue(noa, value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// since node values are stored in current thread memory and not in neural network's instance memory, \r\n\t\t// hence that this code is enabled for concurrent execution - i.e. many threads will be able to\r\n\t\t// query the network for instance classification\r\n\t\tHashtable<NeuralNode, Double> nodeValues = new Hashtable<NeuralNode, Double>();\r\n\t\treset(nodeValues);\r\n\r\n\t\t// since all the output values are needed.\r\n\t\t// They are calculated manually here and the values collected.\r\n\t\tdouble[] theArray = new double[numClasses];\r\n\t\tfor (int classIndex = 0; classIndex < numClasses; classIndex++) {\r\n\t\t\ttheArray[classIndex] = outputs.get(classIndex).getValue(instance, nodeValues);\r\n\t\t}\r\n\t\tif (instance.classAttribute().isNumeric()) {\r\n\t\t\treturn theArray;\r\n\t\t}\r\n\r\n\t\t// now normalize the array\r\n\t\tdouble count = 0;\r\n\t\tfor (int noa = 0; noa < numClasses; noa++) {\r\n\t\t\tcount += theArray[noa];\r\n\t\t}\r\n\t\tif (count <= 0) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tfor (int noa = 0; noa < numClasses; noa++) {\r\n\t\t\ttheArray[noa] /= count;\r\n\t\t}\r\n\t\treturn theArray;\r\n\t}",
"double[] calculateProbabilities(LACInstance testInstance) throws Exception\n\t{\n\t\tdouble[] probs;\n\t\tdouble[] scores = calculateScores(testInstance);\n\t\t\n\t\tif(scores != null)\n\t\t{\n\t\t\tprobs = new double[scores.length];\n\t\t\tdouble scoreSum = 0.0;\n\t\t\tfor (int i = 0; i < scores.length; i++)\n\t\t\t{\n\t\t\t\tscoreSum += scores[i];\n\t\t\t}\n\t\t\t\n\t\t\tfor (int i = 0; i < scores.length; i++)\n\t\t\t{\n\t\t\t\tprobs[i] = scores[i] / scoreSum;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSet<Integer> allClasses = trainingSet.getAllClasses();\n\t\t\tprobs = new double[allClasses.size()];\n\t\t\tfor (Integer clazz : allClasses) \n\t\t\t{\n\t\t\t\tdouble count = trainingSet.getInstancesOfClass(clazz).size();\n\t\t\t\tprobs[clazz] = (count / ((double) trainingSet.length()));\n\t\t\t}\n\t\t}\n\n\t\treturn probs ;\n\t}",
"public Matrix2D executeSimilarity(List<DataObject> dataObjects) {\r\n\t\tint objectsCount = dataObjects.size();\r\n\t\tMatrix2D similarityMatrix = new Matrix2D(objectsCount);\r\n\t\t\r\n\t\tVideoMediaFile video1 = null;\r\n\t\tVideoMediaFile video2 = null;\r\n\t\t\r\n\t\tint p = 0;\r\n\t\tfor (int i = 0; i < objectsCount; i++) {\r\n\t\t\tfor (int j = i + 1; j < objectsCount; j++) {\r\n\t\t\t\tvideo1 = (VideoMediaFile) dataObjects.get(i);\r\n\t\t\t\tvideo2 = (VideoMediaFile) dataObjects.get(j);\r\n\t\t\t\t\r\n\t\t\t\tint similarValues = 0;\r\n\t\t\t\t\r\n\t\t\t\tint featureListSize = video1.getFeatureList().size();\r\n\t\t\t\tfor (int k = 0; k < featureListSize; k++) {\r\n\t\t\t\t\tMetaData video1MetaData = (MetaData) video1.getFeatureList().get(k);\r\n\t\t\t\t\tMetaData video2MetaData = (MetaData) video2.getFeatureList().get(k);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (video1MetaData.getId().equals(\"mediaDuration\") || \r\n\t\t\t\t\t\tvideo1MetaData.getId().equals(\"mediaFileSize\") ||\r\n\t\t\t\t\t\tvideo1MetaData.getId().equals(\"mediaBitrate\") ||\r\n\t\t\t\t\t\tvideo1MetaData.getId().equals(\"videoFramerate\") ||\r\n\t\t\t\t\t\tvideo1MetaData.getId().equals(\"timebase\")) {\r\n\t\t\t\t\t\tdouble v1 = Double.valueOf(video1MetaData.getValue()).doubleValue();\r\n\t\t\t\t\t\tdouble v2 = Double.valueOf(video2MetaData.getValue()).doubleValue();\r\n\t\t\t\t\t\tdouble v3;\r\n\t\t\t\t\t\tif (v1 >= v2)\r\n\t\t\t\t\t\t\tv3 = ((v1 / v2) - 1) * 100;\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tv3 = ((v2 / v1) - 1) * 100;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (v3 > 5.0)\r\n\t\t\t\t\t\t\tsimilarValues++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\telse if (video1MetaData.getId().equals(\"numberStreams\") || \r\n\t\t\t\t\t\tvideo1MetaData.getId().equals(\"videoWidth\") ||\r\n\t\t\t\t\t\tvideo1MetaData.getId().equals(\"videoHeight\")) {\r\n\t\t\t\t\t\tint v1 = Integer.valueOf(video1MetaData.getValue()).intValue();\r\n\t\t\t\t\t\tint v2 = Integer.valueOf(video2MetaData.getValue()).intValue();\r\n\t\t\t\t\t\tif (v1 == v2)\r\n\t\t\t\t\t\t\tsimilarValues++;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\telse if (video1MetaData.getId().equals(\"videoCodecType\") ||\r\n\t\t\t\t\t\tvideo1MetaData.getId().equals(\"audioCodecType\") ||\r\n\t\t\t\t\t\tvideo1MetaData.getId().equals(\"audioLanguage\") ||\r\n\t\t\t\t\t\tvideo1MetaData.getId().equals(\"samplerate\")) {\r\n\t\t\t\t\t\tString s1 = video1MetaData.getValue();\r\n\t\t\t\t\t\tString s2 = video1MetaData.getValue();\r\n\t\t\t\t\t\tif (s1.equals(s2))\r\n\t\t\t\t\t\t\tsimilarValues++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Calculate the similarity.\r\n\t\t\t\tdouble result = (double) similarValues / featureListSize;\r\n\t\t\t\tsimilarityMatrix.set(i, j, result);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.setProgress((double)++p/objectsCount);\r\n\t\t}\r\n\t\t\r\n\t\treturn similarityMatrix;\r\n\t}",
"public void updateToAverageOf(Vector<DataPoint> objects) { \t\n double[] average = new double[values.length];\n for (int i = 0; i < objects.size(); i++) {\n \t//POEY comment: position is a calculated value of a pixel\n Position position = objects.elementAt(i).position;\n for (int j = 0; j < average.length; j++) {\n average[j] += position.values[j];\n }\n }\n for (int i = 0; i < average.length; i++) {\n \t//POEY comment: objects.size() = the number of members in a cluster\n average[i] /= objects.size();\n }\n values = average;\n }",
"public static void main(String[] args) throws IOException, InterruptedException, Household.InvalidHouseholdException, Matching.HouseholdAlreadyMatchedException, HousingMarket.FreeSpaceException, Matching.HouseAlreadyMatchedException, Matching.HouseholdLinkedToMultipleException, Matching.HouseholdLinkedToHouseholdException, DynamicMatching.TooManyTimestepsException, Matching.HouseLinkedToMultipleException, MatchingEvaluator.HouseholdIncomeTooHighException, CycleFinder.FullyExploredVertexDiscoveredException, Matching.PreferredNoHouseholdlessHouseException, Matching.HouseLinkedToHouseException {\n String inputFileName = \"../../Data/Input/test2.csv\";\n String outputfolder = \"../../Data/Output/Scores/\";\n\n int nTimes = 50; // Amount of matchings generated per configuration.\n long allowedRunningTime = 1_000; // Time an experiment for _nTimes_ matchings is allowed to run.\n int maxVal = 150; // Maximum lineCount.\n float timestepRatio = 2/3f; // Ratio of time-steps in a dynamic matching that have not yet been taken.\n // Uses H or F, whichever is lowest.\n // ---------------------------------------------------------------------------------------------------\n\n\n int[] startLines = new int[50];\n int counter = 0;\n for (int i = 0; i < 50; i++) {\n startLines[i] = counter;\n counter = counter + (1000 - maxVal) / nTimes; // == 17 with maxVal == 150 & nTimes == 50.\n }\n\n ArrayList<Double> envRatios = new ArrayList<>(Arrays.asList(0.5, 0.75, 1.0, 1.25, 1.5));\n\n ArrayList<Integer> lineCounts = new ArrayList<>(Arrays.asList(5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 20, 25, 30, 35, 40, 45, 50, 75, 100, 125, 150));\n// ArrayList<Integer> lineCounts = new ArrayList<>(Arrays.asList(5, 6, 7, 8, 9, 10, 11, 12));\n// ArrayList<Integer> lineCounts = new ArrayList<>(Arrays.asList(20, 25, 30, 35, 40, 45, 50, 75, 100, 125, 150));\n\n Experimenter experimenter = new Experimenter(inputFileName, outputfolder, allowedRunningTime, nTimes, startLines, envRatios, lineCounts, timestepRatio);\n experimenter.runExperiments();\n }",
"public void process()\n {\n for (int i = 0; i <= names.length-1; i++)\n {\n int x = 0;\n System.out.println(\"\");\n System.out.print(names[i] + \" had test scores of \");\n for (int j = 0; j <= scores[0].length-1; j++)\n {\n System.out.print(scores[i][j] + \", \");\n \n x += scores[i][j];\n \n }\n System.out.print(\" Test average is \" + x/4 + \".\");\n }\n System.out.println(\"\");\n findL();\n findH();\n findAvg();\n }",
"public static void main(String[] args) {\n String fileName = \"data1.txt\";\n \n \n //Load the data from the dataset file\n dataSet = getDataSet(fileName);\n \n //Setting up the output file\n String outputFileName = \"\";\n if (fileName.indexOf(\".\") > 0) {\n outputFileName = fileName.substring(0, fileName.lastIndexOf(\".\"));\n }\n \n createFile(outputFileName+\".csv\");\n \n //log the time the algorithm started\n long startTime = System.currentTimeMillis();\n \n //Placeholder of the fittest individual\n fittestIndividual = new Individual(GENE_SIZE, NUM_RULES, COND_LEN);\n fittestIndividual.generateRulebase(); \n \n //Setup the mating pool\n matingPool = setupArray(POP_SIZE, NUM_RULES, GENE_SIZE, COND_LEN);\n \n //used to run the GA multiple times without doing it manually\n //set to 1 because we want to run the GA once\n for (int a = 0; a < 1; a++) {\n currentBest = new Individual(GENE_SIZE, NUM_RULES, COND_LEN);\n currentBest.generateRulebase();\n\n //Generate a population\n generatePopulation();\n\n //Initial calculation of the fitness\n calculateFitness(population);\n\n for (int i = 0; i < GENERATION; i++) {\n average = 0; //reset the average\n currentBestArray[i] = currentBest.getFitness();\n \n tournamentSelect(population);\n\n //Calculate the fitness of the mating pool\n calculateFitness(matingPool);\n\n //Perfrom crossover on the mating pool\n crossover(matingPool);\n\n //Mutation\n mutation(matingPool);\n\n //Calculate the fitness of the mating pool\n calculateFitness(matingPool);\n\n //Evaluate the current population\n for (Individual individual : matingPool) {\n if (individual.getFitness() > currentBest.getFitness()) {\n currentBest = new Individual(individual);\n }\n average = average + individual.getFitness();\n }\n \n\n //Replace the population with the new generation\n for (int j = 0; j < POP_SIZE; j++) {\n population[j] = new Individual(matingPool[j]);\n }\n \n averageArray[i] = average / POP_SIZE;\n }\n \n //Check whether the current best is fitter than the global fittest individual\n if (currentBest.fitness > fittestIndividual.fitness) {\n fittestIndividual = new Individual(currentBest);\n //copy the fittest individuals performance\n fittestArray = Arrays.copyOf(currentBestArray, currentBestArray.length);\n }\n }\n\n System.out.println(\"Best fitness generated for the dataset: \" + fittestIndividual.fitness);\n \n //output the rules\n printRules(fittestIndividual.getRulebase());\n \n //Save the performance data into the output file\n for (int i = 0; i < fittestArray.length; i++) {\n addToFile(i, fittestArray[i], averageArray[i]);\n }\n \n //close the file\n close();\n \n //Evaluate the fitness agaisnt the dataset\n calculateFitness(fittestIndividual);\n double accuracyPercentage = ((double) 100 / dataSet.size()) * fittestIndividual.fitness;\n System.out.format(\"%.2f%% accuracy on the datase set.\\n\", accuracyPercentage);\n \n //Log the duration it took\n long duration = System.currentTimeMillis() - startTime;\n System.out.println(\"Completed in \" + String.format(\"%02d min, %02d.%02d sec\",\n TimeUnit.MILLISECONDS.toMinutes(duration),\n TimeUnit.MILLISECONDS.toSeconds(duration)\n - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(duration)),\n TimeUnit.MILLISECONDS.toMillis(duration) - TimeUnit.SECONDS.toMillis(TimeUnit.MILLISECONDS.toSeconds(duration))\n ));\n }",
"public void doValidation(int currentRound)\n {\n getData(currentRound);\n// System.out.println(\"training unterminated ones\");\n kMeans.setItems(trainingData.get(0));\n kMeans.k=k1;\n kMeans.init();\n List<Cluster> unterminatedClusters=kMeans.doCluster();\n for (int i=0;i<unterminatedClusters.size();i++)\n {\n unterminatedClusters.get(i).label=0;\n }\n \n// System.out.println(\"training terminated ones\");\n kMeans.setItems(trainingData.get(1));\n kMeans.k=k2;\n kMeans.init();\n List<Cluster> terminatedClusters=kMeans.doCluster();\n for (int i=0;i<terminatedClusters.size();i++)\n {\n terminatedClusters.get(i).label=1;\n }\n \n List<Cluster> clusters=new ArrayList<Cluster>();\n clusters.addAll(unterminatedClusters);\n clusters.addAll(terminatedClusters);\n kMeans.setClusters(clusters);\n int[] corrects=new int[2];\n int[] counts=new int[2];\n for (int i=0;i<2;i++)\n {\n corrects[i]=0;\n counts[i]=0;\n }\n for (Item item:testData)\n {\n int label=kMeans.getNearestCluster(item).label;\n counts[label]++;\n if (label==item.type)\n {\n corrects[item.type]++;\n }\n }\n correctness+=corrects[1]*1.0/counts[1];\n correctCount+=corrects[1];\n// for (int i=0;i<2;i++)\n// System.out.println(\"for type \"+i+\": \" +corrects[i]+\" correct out of \"+counts[i]+\" in total (\"+corrects[i]*1.0/counts[i]+\")\");\n }",
"@Override\n public int[] schedule(TestInstance testInstance, int[] minizincSolution) {\n\n long start = System.currentTimeMillis();\n\n int numAgents = testInstance.numAgents;\n int numJobs = testInstance.numJobs;\n //Initialize some testers for later\n CondorcetConsistencyTester condorsetTests = new CondorcetConsistencyTester(numJobs, numAgents);\n SumOfTardinessTester sumOfTardTests = new SumOfTardinessTester(numJobs, numAgents);\n ParetoEfficiencyTester paretoTests = new ParetoEfficiencyTester(numJobs, numAgents);\n\n // Initialize the scores with all 0\n Scores scores = new Scores(numJobs);\n\n //PART 1\n // This double loop compares each job with all the others\n for(int i = 0; i < numJobs - 1; i++) {\n for (int j = i + 1; j < numJobs; j++) {\n\n int counter_i = 0;\n int counter_j = 0;\n // Now we count how many times the job with ID=i comes before the job with ID=j\n // For all preferences\n // If job with ID=i comes before the job with ID=j\n for (Preference preference : testInstance.preferences)\n if (preference.isBefore(i, j))\n counter_i++; // Increment the number of agents preferring i over j\n else counter_j++; // Increment the number of agents preferring j over i\n\n\n int p_i = testInstance.processingTimes[i];\n int p_j = testInstance.processingTimes[j];\n\n // The threshold of job i, as given by our definition\n // This rule is the main and only way the processing times of the\n // jobs are taken into account for the final \"true\" ranking\n float threshold = (float)(p_i * numAgents) / (float)(p_i + p_j);\n\n if (counter_i == threshold) { //If the number of votes equals the threshold for job i,\n // the same applies for job j and its corresponding threshold, because math, so give both of them a point\n scores.addOne(i);\n scores.addOne(j);\n } else if (counter_i > threshold) { //Give a point to job i for surpassing the threshold\n scores.addOne(i);\n } else { //Give a point to job j for surpassing its threshold (again, because math)\n scores.addOne(j);\n }\n\n // Store the votes each job got against the other\n CondorcetConsistencyTester.votes[i][j] = counter_i;\n CondorcetConsistencyTester.votes[j][i] = counter_j;\n\n }\n }\n\n //Sort the jobs in descending order, based on the score they obtained\n ArrayList scheduleArrayList = scores.sorted();\n\n //Transform the sorted list of jobs into an array\n int[] schedule = new int[numJobs];\n for(int i = 0; i < numJobs; i++){\n schedule[i] = (int)scheduleArrayList.get(i);\n }\n\n// boolean isThereWinner = condorsetTests.isThereCondorcetWinner();\n// System.out.println(\"isThereWinner: \" + isThereWinner);\n// boolean isCondorcetWinner = condorsetTests.testCondorcetWinner(schedule);\n// System.out.println(\"isCondorcetWinner: \" + isCondorcetWinner);\n// System.out.println(\"--------------------------------------------------------------------\");\n// System.out.println(\"PTA violations before: \" + condorsetTests.countPTACondorcetViolations(schedule, testInstance.processingTimes));\n// System.out.println(\"Sum of Tardiness before: \" + sumOfTardTests.calculateSumOfTardiness(schedule, testInstance.preferences, testInstance.processingTimes));\n// System.out.println(\"--------------------------------------------------------------------\");\n// int[] agentTardiness = sumOfTardTests.getAgentTardiness();\n// System.out.println(\"Tardiness per agent (before): \" + Arrays.toString(agentTardiness));\n// System.out.println(\"Gini Index (before): \" + GiniIndexTester.getIndex(agentTardiness, numAgents));\n\n\n //PART 2 - Make our schedule Condorcet-consistent\n //First cell of the \"results\" array represents consistency,\n //second cell represents index to start the next search from (optimization purposes)\n int[] results = new int[2];\n //While our schedule is not Condorcet-consistent\n while (results[0] == 0) {\n //Search for swaps that will render the schedule Condorcet-consistent\n results = condorsetTests.testCondorcetConsistency(schedule, results[1]);\n //If schedule has become Condorcet-consistent\n if (results[0] == 1)\n System.out.println(\"Schedule: \" + Arrays.toString(schedule));\n }\n\n //Runtime\n long end = System.currentTimeMillis();\n long ourRuntime = end - start;\n System.out.println(\"OUR TOTAL RUNTIME: \" + ourRuntime + \" ms\");\n\n Statistics.myRuntime.add(ourRuntime);\n Statistics.numAgents.add(testInstance.numAgents);\n Statistics.numJobs.add(testInstance.numJobs);\n\n //PTA-Violations\n double myPercPTA = ((double)condorsetTests.countPTACondorcetViolations(schedule, testInstance.processingTimes)) / (numJobs * numJobs /2);\n System.out.println(\"PTA violations % for our solution: \" + myPercPTA);\n Statistics.myPTAviolations.add(myPercPTA);\n if (minizincSolution != null) {\n double mznPercPTA = ((double) condorsetTests.countPTACondorcetViolations(minizincSolution, testInstance.processingTimes) / (numJobs * numJobs /2));\n System.out.println(\"PTA violations % for MINIZINC: \" + mznPercPTA);\n Statistics.mznPTAviolations.add(mznPercPTA);\n }\n\n //Sum-of-tardiness and tardiness per agent\n int mySum = sumOfTardTests.calculateSumOfTardiness(schedule, testInstance.preferences, testInstance.processingTimes);\n System.out.println(\"Sum of Tardiness for our solution: \" + mySum);\n int[] agentTardiness = sumOfTardTests.getAgentTardiness();\n\n int mznSum = 0;\n int[] agentTardinessMinizinc = null;\n if (minizincSolution != null) {\n mznSum = sumOfTardTests.calculateSumOfTardiness(minizincSolution, testInstance.preferences, testInstance.processingTimes);\n System.out.println(\"Sum of Tardiness for MINIZINC: \" + mznSum);\n agentTardinessMinizinc = sumOfTardTests.getAgentTardiness();\n }\n\n Statistics.mySumOfTardiness.add(mySum);\n if (minizincSolution != null) {\n Statistics.mznSumOfTardiness.add(mznSum);\n }\n\n System.out.println(\"Tardiness per agent: \" + Arrays.toString(agentTardiness));\n\n //Pareto efficiency\n System.out.println(\"Pareto Efficient schedule: \" + paretoTests.isScheduleParetoEfficient(schedule));\n //System.out.println(\"Pareto Efficiency per agent: \" + Arrays.toString(paretoTests.agentParetoEfficiency(agentTardiness)));\n\n //Gini index\n double myIndex = GiniIndexTester.getIndex(agentTardiness, numAgents);\n System.out.println(\"Gini Index for our solution: \" + myIndex);\n Statistics.myGiniIndex.add(myIndex);\n\n if (minizincSolution != null) {\n double mznIndex = GiniIndexTester.getIndex(agentTardinessMinizinc, numAgents);\n System.out.println(\"Gini Index for MINIZINC: \" + mznIndex);\n Statistics.mznGiniIndex.add(mznIndex);\n }\n\n return schedule;\n\n\n }",
"public DoubleMatrix2D start(Instances data) {\n\t\tDoubleMatrix2D distanceMatrix = Methods.createDistanceMatrix(data);\n\t\tdouble baselineCosts = Methods.baselineMatrixNormal(distanceMatrix);\n\t\t// Create graph from the given dataset\n\t\tgraph = Methods.createGraph(data, distanceMatrix, 1.0);\n\n\t\tif (Parameters.DEBUG) {\n\t\t\tSystem.out.println(\"BaselineCosts: \" + baselineCosts);\n\t\t\tSystem.out.println(\"Instances \" + data.numInstances());\n\t\t\tSystem.out.println(\"Edges \" + graph.getEdgeCount());\n\t\t}\n\t\t// Calculates the codingCosts of the adjacencymatrix\n\t\tdouble graphCodingCosts = Methods.codingCostsGraph(graph);\n\t\tdouble regressionError = Methods.Regression(graph, distanceMatrix, data).getSumSquaredErrors();\n\t\tint k = (int) Math.log(data.numInstances());\n\t\twhile ((graphCodingCosts + regressionError) * 1.5 < baselineCosts) {\n\t\t\tfor (int i = 0; i < distanceMatrix.columns(); i++) {\n\t\t\t\tList<Pair> orderOfAddedEdges = MethodsKNN.createOrderedList(distanceMatrix.viewColumn(i), i);\n\t\t\t\tfor (int j = 0; j < k; j++) {\n\t\t\t\t\tint column = orderOfAddedEdges.get(j).getX();\n\t\t\t\t\tint row = orderOfAddedEdges.get(j).getY();\n\t\t\t\t\tgraph.addEdge(new MyLink(distanceMatrix.get(i, j)), data.instance(column), data.instance(row));\n\t\t\t\t}\n\t\t\t}\n\t\t\t//update\n\t\t\tregressionError = Methods.Regression(graph, distanceMatrix, data).getSumSquaredErrors();\n\t\t\tgraphCodingCosts = Methods.codingCostsGraph(graph);\n\t\t\tif (Parameters.DEBUG) {\n\t\t\t\tSystem.out.println(\"Graphkodierungskosten: \" + graphCodingCosts + \" k \" + k + \" coding \"\n\t\t\t\t\t\t+ regressionError);\t\n\t\t\t}\n\t\t\tk++;\n\t\t}\n\t\treturn Methods.fromGraphToSimMatrix(data, graph, distanceMatrix);\n\t}",
"private void updateTableData() {\n if (articles.size() == 0) {\n return; // no agent data yet !!!!\n }\n for (int i = 0; i < articles.size(); i++) {\n NewsArticle article = (NewsArticle) articles.elementAt(i);\n String score = \"0.0\";\n\n switch (filterType) {\n case FilterAgent.USE_KEYWORDS:\n score = String.valueOf(article.getKeywordScore());\n break ;\n case FilterAgent.USE_CLUSTERS:\n score = String.valueOf(article.getClusterScore());\n break ;\n case FilterAgent.USE_PREDICTED_RATING:\n score = String.valueOf(article.getPredictedRating()) ;\n break ;\n }\n data[i][COL_SCOREID] = score;\n }\n return;\n }",
"private double loss(Instance instance) {\r\n // set the input value in the input nodes from the training instance\r\n for (int j = 0; j < instance.attributes.size(); j++) {\r\n inputNodes.get(j).setInput(instance.attributes.get(j));\r\n }\r\n\r\n //set the target value in output nodes\r\n for (int j = 0; j < instance.classValues.size(); j++) {\r\n outputNodes.get(j).setTargetValue((double) instance.classValues.get(j));\r\n }\r\n\r\n // calculate values for hidden nodes\r\n for (int j = 0; j < hiddenNodes.size(); j++) {\r\n // for each hidden node\r\n Node hiddenNode = hiddenNodes.get(j);\r\n hiddenNode.calculateOutput();\r\n }\r\n\r\n double sumOfExponents = 0.0;\r\n //calculate values for output nodes\r\n for (int j = 0; j < outputNodes.size(); j++) {\r\n // for each output node\r\n Node outputNode = outputNodes.get(j);\r\n outputNode.calculateOutput();\r\n sumOfExponents += outputNode.getOutput();\r\n }\r\n\r\n //update output values of output nodes\r\n for (int j = 0; j < outputNodes.size(); j++) {\r\n Node outputNode = outputNodes.get(j);\r\n outputNode.updateOutputValue(sumOfExponents);\r\n }\r\n\r\n double lossPerInstance = 0.0;\r\n for (int j = 0; j < instance.classValues.size(); j++) {\r\n double y = (double) instance.classValues.get(j);\r\n Node outputNode = outputNodes.get(j);\r\n lossPerInstance = lossPerInstance + (-1) * y * Math.log(outputNode.getOutput());\r\n }\r\n\r\n return lossPerInstance;\r\n }",
"@Override\n\tpublic void updateStatistics(Instance inst) {\n\t\t// Update the statistics for this node\n\t\t// number of instances passing through the node\n\t\tnodeStatistics.addToValue(0, 1);\n\t\t// sum of y values\n\t\tnodeStatistics.addToValue(1, inst.classValue());\n\t\t// sum of squared y values\n\t\tnodeStatistics.addToValue(2, inst.classValue()*inst.classValue());\n\t\t\t\t\n\t\tthis.perceptron.trainOnInstance(inst);\n\t\tif (this.predictionFunction != 1) { //Train target mean if prediction function is not Perceptron\n\t\t\tthis.targetMean.trainOnInstance(inst);\n\t\t}\n\t}",
"public void findAvg()\n {\n for(int i = 0; i <= scores.length-1; i++)\n {\n for (int j = 0; j <= scores[0].length-1; j++)\n {\n total += scores[i][j];\n }\n }\n System.out.println(\"The class average test score is \" + \n total/24 + \".\");\n }",
"public interface ErrorMeasure {\r\n\r\n /**\r\n * Measure the errors for the given output and target\r\n * @param output the output\r\n * @param example the example\r\n * @return the errors\r\n */\r\n public abstract double value(Instance output, Instance example);\r\n\r\n}",
"@Test\n public void test02() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate((String) null);\n Evaluation evaluation0 = new Evaluation(instances0);\n double[] doubleArray0 = new double[6];\n evaluation0.updateNumericScores(doubleArray0, doubleArray0, '\\u0086');\n assertEquals(Double.POSITIVE_INFINITY, evaluation0.meanPriorAbsoluteError(), 0.01D);\n }",
"@Test\r\n\tpublic void driverAvgMinMaxStdMuseumsPerDirector() {\r\n\r\n\t\tfinal Object testingData[][] = {\r\n\r\n\t\t\t// testingData[i][0] -> usernamed of the logged Actor.\r\n\t\t\t// testingData[i][1] -> expected Exception.\r\n\r\n\t\t\t{\r\n\t\t\t\t// + 1) An administrator displays the statistics\r\n\t\t\t\t\"admin\", null\r\n\t\t\t}, {\r\n\t\t\t\t// - 2) An unauthenticated actor tries to display the statistics\r\n\t\t\t\tnull, IllegalArgumentException.class\r\n\t\t\t}, {\r\n\t\t\t\t// - 3) A visitor displays the statistics\r\n\t\t\t\t\"visitor1\", IllegalArgumentException.class\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tfor (int i = 0; i < testingData.length; i++) {\r\n\r\n\t\t\tthis.startTransaction();\r\n\r\n\t\t\tthis.templateAvgMinMaxStdMuseumsPerDirector((String) testingData[i][0], (Class<?>) testingData[i][1]);\r\n\r\n\t\t\tthis.rollbackTransaction();\r\n\t\t\tthis.entityManager.clear();\r\n\t\t}\r\n\r\n\t}",
"@Override\n public double calculateError(final MLDataSet data) {\n\n switch (getSVMType()) {\n case SupportVectorClassification:\n case NewSupportVectorClassification:\n case SupportVectorOneClass:\n return EncogUtility.calculateClassificationError(this, data);\n case EpsilonSupportVectorRegression:\n case NewSupportVectorRegression:\n return EncogUtility.calculateRegressionError(this, data);\n default:\n return EncogUtility.calculateRegressionError(this, data);\n }\n\n\n }"
] | [
"0.546881",
"0.5429799",
"0.54273915",
"0.5372718",
"0.5308267",
"0.52917343",
"0.5229963",
"0.5194399",
"0.51538527",
"0.5110027",
"0.5077769",
"0.50542706",
"0.5047306",
"0.5040963",
"0.50178784",
"0.4998335",
"0.4977386",
"0.49191168",
"0.49177873",
"0.4909658",
"0.49085826",
"0.4905736",
"0.4898947",
"0.48908964",
"0.48782134",
"0.48651376",
"0.48559305",
"0.48445588",
"0.4839236",
"0.48389328",
"0.48298258",
"0.47680506",
"0.47633705",
"0.47613004",
"0.47567034",
"0.4736",
"0.47316837",
"0.47281212",
"0.47163188",
"0.47162133",
"0.47083607",
"0.4699043",
"0.4685227",
"0.46804342",
"0.4672151",
"0.4668343",
"0.46679464",
"0.46510524",
"0.46481004",
"0.4636356",
"0.46270844",
"0.46228892",
"0.46225953",
"0.4618781",
"0.46026227",
"0.46017438",
"0.45911413",
"0.45899674",
"0.45899045",
"0.4584916",
"0.4582976",
"0.45822558",
"0.45803657",
"0.45792112",
"0.4578018",
"0.45648235",
"0.45612583",
"0.45580286",
"0.45499024",
"0.4539234",
"0.4527423",
"0.45251054",
"0.45200783",
"0.45197785",
"0.451821",
"0.45110175",
"0.45084324",
"0.45006782",
"0.45002326",
"0.4498969",
"0.44956505",
"0.4491268",
"0.44911346",
"0.44899762",
"0.4484439",
"0.44736156",
"0.44679546",
"0.4460514",
"0.44579893",
"0.44496006",
"0.4449143",
"0.44473395",
"0.44435975",
"0.4442288",
"0.4436753",
"0.44342136",
"0.44307163",
"0.44266322",
"0.44256115",
"0.4424883",
"0.44198638"
] | 0.0 | -1 |
Recursive solution Time complexity O(n), space complexity O(n) because of recursion. | public boolean isSymmetric1(TreeNode root) {
if (root == null) return true;
return compare(root.left, root.right);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static int solve(int n) \n\t{ \n\t // base case \n\t if (n < 0) \n\t return 0; \n\t if (n == 0) \n\t return 1; \n\t \n\t return solve(n-1) + solve(n-3) + solve(n-5); \n\t}",
"private static int betterSolution(int n) {\n return n*n*n;\n }",
"public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\n\t\tint a[] = {2,1,3,-4,-2};\n\t\t//int a[] = {1 ,2, 3, 7, 5};\n\t\tboolean found = false;\n\t\t\n\t\t//this will solve in o n^2\n\t\tfor(int i = 0 ; i < a.length ; i++){\n\t\t\tint sum = 0;\n\t\t\tfor(int j = i ; j< a.length ; j++){\n\t\t\t\tsum += a[j] ;\n\t\t\t\tif(sum == 0){\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tif(found)\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t\n\t\t// link : https://www.youtube.com/watch?v=PSpuM9cimxA&list=PLKKfKV1b9e8ps6dD3QA5KFfHdiWj9cB1s&index=49\n\t\tSystem.out.println(found + \" found\");\n\t\tfound = false;\n\t\t//solving with O of N with the help sets\n\t\t// x + 0 = y\n\t\tSet<Integer> set = new HashSet<>();\n\t\tint sum = 0;\n\t\tfor(int element : a){\n\t\t\tset.add(sum);\n\t\t\tsum += element;\n\t\t\tif(set.contains(sum)){\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\tSystem.out.println(set);\n\t\t\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t\tfound = false;\n\t\t// when the sum of subarray is K\n\t\t\n\t\t//solving with O of N with the help sets\n\t\t//x + k = y >>>\n\t\tSet<Integer> set1 = new HashSet<>();\n\t\tint k = 12;\n\t\tint summ = 0;\n\t\tfor(int element : a){\n\t\t\tset1.add(summ);\n\t\t\tsumm += element;\n\t\t\tif(set1.contains(summ - k)){ // y - k = x(alredy presnt or not)\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(set1);\n\t\tSystem.out.println();\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t}",
"static int recursiva1(int n)\n\t\t{\n\t\tif (n==0)\n\t\t\treturn 10; \n\t\tif (n==1)\n\t\t\treturn 20; \n\t\treturn recursiva1(n-1) - recursiva1 (n-2);\t\t\n\t\t}",
"private boolean dfs(int n, int[] P) { // 0 is empty, 1 is false, 2 is true\n if (P[n] != 0) {\n if (P[n] == 1) {\n return false;\n }\n else {\n return true;\n }\n }\n\n if (n == 1) {\n P[1] = 2;\n //return true;\n }\n else if (n == 2) {\n P[2] = 2;\n //return true;\n }\n else if (n == 3) {\n P[3] = 1;\n //return false;\n }\n else {\n boolean res = dfs(n-2, P) && dfs(n-3, P) || dfs(n-3, P) && dfs(n-4, P);\n P[n] = res ? 2 : 1;\n }\n\n return P[n] == 2;\n\n //P[n] = P[n-2] + P[n-3] == 4 || P[n-3] + P[n-4] == 4 ? 2 : 1;\n //boolean res = dfs(n-2, P) && dfs(n-3, P) || dfs(n-3, P) && dfs(n-4, P);\n //P[n] = res ? 2 : 1;\n //return res;\n }",
"int help(int n, int k, int[][] map) {\n if (n <= 0 || k < 0) return 0;\n if (0 == k) return 1;\n if (1 == k) return n - 1;\n if (map[n][k] > 0) return map[n][k];\n long sum = 0;\n for (int i = 1; i <= k; i ++) {\n for (int j = 0; j < n; j ++) {\n// System.out.println(\"i = \" + i + \", j = \" + j + \", j - i = \" + (j - i) + \", j + i = \" + (j + i) + \", f0 = \" + (n - j + i - 1) + \", f1 = \" + (n - j - i - 1) + \", k - i = \" + (k - i));\n int g = 0, g0 = 0, g1 = 0;\n if (j - i >= 0) {\n g += help(n - j + i - 1, k - i, map);\n sum += g;\n// System.out.println(\"g0 = \" + g0 + \", g1 = \" + g1 + \", g = \" + g + \", sum = \" + sum);\n// System.out.println(\"-\");\n }\n }\n\n }\n// System.out.println(\"sum = \" + sum + \" ----\");\n map[n][k] = (int)sum;\n return (int)sum;\n }",
"static int recursiva2(int n)\n\t\t{\n\t\t\tif (n==0)\n\t\t\treturn 10; \n\t\t\tif (n==1)\n\t\t\treturn 20;\n\t\t\tif (n==2)\n\t\t\treturn 30;\n\t\t\t\n\t\t\treturn recursiva2(n-1) + recursiva2 (n-2) * recursiva2 (n-3); \n\t\t}",
"private static long calc1()\n {\n final int min = 1000;\n final int max = 10000;\n\n // initialize\n List<List<Integer>> m = new ArrayList<>();\n for (int k = 0; k < end; k++) {\n List<Integer> list = new ArrayList<Integer>();\n int n = 1;\n while (k >= start) {\n int p = pkn(k, n);\n if (p >= max) {\n break;\n }\n if (p >= min) {\n list.add(p);\n }\n n++;\n }\n m.add(list);\n }\n\n boolean[] arr = new boolean[end];\n arr[start] = true;\n\n List<Integer> solutions = new ArrayList<>();\n List<Integer> list = m.get(start);\n for (Integer first : list) {\n LinkedList<Integer> values = new LinkedList<>();\n values.add(first);\n f(m, arr, values, 1, solutions);\n // we stop at the first solution found\n if (!solutions.isEmpty()) {\n break;\n }\n }\n\n // solutions.stream().forEach(System.out::println);\n int res = solutions.stream().reduce(0, Integer::sum);\n return res;\n }",
"static int solveMemo(int n) \n\t{ \n\t // base case \n\t if (n < 0) \n\t return 0; \n\t if (n == 0) \n\t return 1; \n\t \n\t // checking if already calculated \n\t if (dp[n]!=-1) \n\t return dp[n]; \n\t \n\t // storing the result and returning \n\t return dp[n] = solveMemo(n-1) + solveMemo(n-3) + solveMemo(n-5); \n\t}",
"public int recursive(int n) {\r\n //base case: return n if <= 1\r\n if (n <= 1) {\r\n return n;\r\n }\r\n //else return result of of two previous #s being added to each other\r\n return recursive(n - 1) + recursive(n - 2);\r\n }",
"public static int solution(int[] arr) {\n int n = arr.length;\n for (int i = 0; i < n; i++) {\n while (arr[i] != i + 1 && arr[i] < n && arr[i] > 0) {\n int temp = arr[i];\n if (temp == arr[temp - 1])\n break;\n arr[i] = arr[temp - 1];\n arr[temp - 1] = temp;\n }\n }\n for (int i = 0; i < n; i++)\n if (arr[i] != i + 1)\n return i + 1;\n return n + 1;\n }",
"public static int solveEfficient(int n) {\n if (n == 0 || n == 1)\n return 1;\n\n int n1 = 1;\n int n2 = 1;\n int sum = 0;\n\n for (int i = 2; i <= n; i++) {\n sum = n1 + n2;\n n1 = n2;\n n2 = sum;\n }\n return sum;\n }",
"static int sum(int n) {\n\t\tif(n==1) \n\t\t\treturn 1;\n\t\treturn n+sum(n-1);\n\t}",
"public static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tint t = s.nextInt();\n\t\twhile(t-->0)\n\t\t{\n\t\t\tint n = s.nextInt();\n\t\t\tint k = s.nextInt();\n\t\t\tint[] arr = new int[n];\n\t\t\tfor(int i=0;i<n;i++)\n\t\t\t\tarr[i] = s.nextInt();\n\t\t\tArrays.sort(arr);\n\t\t\tint[][] dp = new int[k+1][n+1];\n\t\t\tfor(int i=0;i<=k;i++)\n\t\t\t\tfor(int j=0;j<=n;j++)\n\t\t\t\t{\n\t\t\t\t\tif(i==0)\n\t\t\t\t\t\tdp[i][j] = 0;\n\t\t\t\t\telse if(j==0)\n\t\t\t\t\t\tdp[i][j] = -1;\n\t\t\t\t\telse if(i-arr[j-1]>=0)\n\t\t\t\t\t{\n\t\t\t\t\t\tint val1 = dp[i-arr[j-1]][j-1];\n\t\t\t\t\t\tint val2 = dp[i][j-1];\n\t\t\t\t\t\tif(val1!=-1 && val2!=-1)\n\t\t\t\t\t\t\tdp[i][j] = Math.min(1+val1,val2);\n\t\t\t\t\t\telse if(val1!=-1)\n\t\t\t\t\t\t\tdp[i][j] = 1+val1;\n\t\t\t\t\t\telse if(val2!=-1)\n\t\t\t\t\t\t\tdp[i][j] = val2;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdp[i][j] = -1;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif(dp[i][j-1]==-1)\n\t\t\t\t\t\t\tdp[i][j] = -1;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdp[i][j] = dp[i][j-1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tif(dp[k][n]!=-1)\n\t\t\t\tSystem.out.println(dp[k][n]);\n\t\t\telse\n\t\t\t\tSystem.out.println(\"impossible\");\n\t\t}\n\t}",
"public int generalSolution(int n, Set<Integer> x) {\n\t\treturn generalSolutionRecurse(n+1, x);\n\t}",
"private static int helper(TreeNode root, TreeNode p, TreeNode q, List<TreeNode> ans) {\n if (root == null)\n return 0;\n int sum = 0;\n if (root.val == p.val || root.val == q.val)\n ++sum;\n int leftSum = helper(root.left, p, q, ans);\n int rightSum = helper(root.right, p, q, ans);\n sum += leftSum + rightSum;\n if (sum == 2 && leftSum < 2 && rightSum < 2)\n ans.add(root);\n return sum;\n }",
"private static int recursion(int x) {\n\t\tif(x == 1) return 0;\n\n\t\tif(dp[x] != -1) return dp[x];\n\t\tint result = Integer.MAX_VALUE;\n\n\t\tif(x % 3 == 0) result = Math.min(recursion(x / 3), result);\n\t\tif(x % 2 == 0) result = Math.min(recursion(x >> 1), result);\n\t\tif(x >= 1) result = Math.min(recursion(x - 1), result);\n\n\t\treturn dp[x] = result + 1;\n\t}",
"public List<List<Integer>> threeSum(int[] nums) {\n List<List<Integer>> result = new ArrayList<>(nums.length);\n\n // Prepare\n Arrays.sort(nums);\n// int firstPositiveIndex = 0;\n// int negativeLength = 0;\n// List<Integer> numsFiltered = new ArrayList<>();\n// for (int i = 0; i < nums.length; i++) {\n// if (i == 0 || i == 1 || nums[i] == 0 || (nums[i] != nums[i-2])) {\n// numsFiltered.add(nums[i]);\n// if ((nums[i] >= 0) && (firstPositiveIndex == 0)) {\n// firstPositiveIndex = numsFiltered.size() - 1;\n// }\n// if ((nums[i] <= 0)) {\n// negativeLength = numsFiltered.size();\n// }\n// }\n// }\n// nums = numsFiltered.stream().mapToInt(i->i).toArray();\n\n // Func\n\n for(int i=0; (i < nums.length) && (nums[i] <= 0); i++) {\n if (i != 0 && nums[i] == nums[i-1]) {\n continue;\n }\n for(int j=i+1; j<nums.length; j++) {\n if (j != i+1 && nums[j] == nums[j-1]) {\n continue;\n }\n for(int k=nums.length-1; (k>j) && nums[k] >= 0; k--) {\n if (k != nums.length-1 && nums[k] == nums[k+1]) {\n continue;\n }\n int sum = nums[i]+nums[j]+nums[k];\n if (sum > 0) {\n continue;\n } else if (sum < 0) {\n break;\n }\n\n List<Integer> ok = new ArrayList<>();\n ok.add(nums[i]);\n ok.add(nums[j]);\n ok.add(nums[k]);\n result.add(ok);\n break;\n }\n }\n }\n\n// System.out.println(\"Finish time = \" + (System.nanoTime() - start) / 1_000_000);\n// System.out.println(\"result size = \" + result.size());\n\n return result;\n }",
"static BigInteger findSum(BigInteger n) {\n if (n.equals(BigInteger.ZERO))\n return BigInteger.ZERO;\n BigInteger TWO = BigInteger.valueOf(2);\n\n BigInteger sum = BigInteger.ZERO;\n sum = sum.add(\n n.multiply(n.add(BigInteger.ONE))\n .divide(TWO)\n );\n\n BigInteger flooredN = findFraction(n);\n sum = sum.add(\n n.multiply(flooredN)\n );\n\n sum = sum.subtract(\n flooredN.multiply(flooredN.add(BigInteger.ONE))\n .divide(TWO)\n );\n\n sum = sum.subtract(findSum(flooredN));\n\n return sum;\n }",
"static long factorialRecurse(int n) {\r\n if (n == 0 || n == 1) {\r\n return 1;\r\n }\r\n return factorialRecurse(n - 1) * n;\r\n }",
"private static int minCoins_my_way_one_coin_of_one_value_case(int[] coins, int startIndex, int endIndex, int amount) {\n\n if (coins.length == 0) return 0;\n\n if (startIndex == endIndex) {\n int currentCoin = coins[startIndex];\n\n if (currentCoin == amount) { // coins=(8) amount=8\n return 1;\n }\n if (currentCoin > amount) { // coins=(9) amount=8\n return 0;\n }\n if (currentCoin < amount) { // coins=(1) amount=8\n return 0; // this code changes when you can use infinite number of same coin\n }\n }\n\n // IMPORTANT:\n // Even though, amount is changing in recursive call, you don't need an exit condition for amount because amount will never become 0 or less than 0\n // amount is changing in recursive call when currentCoin < amount and it is doing amount-currentCoin. It means that amount will never become 0 or less than 0\n /*\n if (amount == 0) {\n return 0;\n }\n */\n\n int currentCoin = coins[startIndex];\n\n int minUsingCurrentCoin = 0;\n\n if (currentCoin == amount) {// coins=(8,9) amount=8\n // WRONG - if you see recursive call, you are trying to use remaining array (8) to make amount (8)\n // You are trying to make full amount using remaining array. It means that you will not be including currentCoin in coins that can make full amount.\n // Here, code should be all about including currentCoin in computation.\n /*\n minUsingCurrentCoin = 1\n int minUsingRemainingCoinsToMakeFullAmount = minCoins_my_way_one_coin_of_one_value_case(coins,startIndex+1, endIndex, amount)\n if(minUsingRemainingCoinsToMakeFullAmount > 0) {\n minUsingCurrentCoin = 1 + minUsingRemainingCoinsToMakeFullAmount\n }*/\n\n minUsingCurrentCoin = 1;\n } else if (currentCoin > amount) {// coins=(9,8) amount=8\n minUsingCurrentCoin = 0;\n // WRONG - if you see recursive call, you are trying to use remaining array (8) to make amount (8)\n // You are trying to make full amount using remaining array. It means that you will not be including currentCoin in coins that can make full amount.\n // Here, code should be all about including currentCoin in computation.\n // minUsingCurrentCoin = 0 + minCoins_my_way_one_coin_of_one_value_case(coins,startIndex+1, endIndex, amount);\n } else {\n /*\n case 1:\n coins = (1,6) amount=8\n currentCoin=1\n 1<8\n coinsRequiredUsingRemainingCoins=(6) to make amount (8-1=7) = 0\n coinsRequiredUsingRemainingCoinsAndAmount is 0, so by including current coin (1), you will not be able to make amount=8\n so, you cannot use (1) to make amount=8\n case 2:\n coins = (1,7) amount=8\n currentCoin=1\n 1<6\n coinsRequiredUsingRemainingCoins (7) And Amount (8-1=7) = 1\n so, coinsRequiredUsingCurrentCoin = 1 + coinsRequiredUsingRemainingCoinsAndAmount = 2\n\n */\n // this code changes when you can use infinite number of same coin\n int minUsingRestOfCoinsAndRestOfAmount = minCoins_my_way_one_coin_of_one_value_case(coins, startIndex + 1, endIndex, amount - currentCoin);\n if (minUsingRestOfCoinsAndRestOfAmount == 0) {\n minUsingCurrentCoin = 0;\n } else {\n minUsingCurrentCoin = 1 + minUsingRestOfCoinsAndRestOfAmount;\n }\n\n }\n\n // coins = (8,6) amount=8\n // minUsingCurrentCoin 8 to make amount 8 = 1\n // minWaysUsingRestOfTheCoins (6) to make amount 8 = 0\n // so, you cannot just blindly return Math.min(minUsingCurrentCoin, minWaysUsingRestOfTheCoins)\n // it will return 0 instead of 1\n int minWaysUsingRestOfTheCoins = minCoins_my_way_one_coin_of_one_value_case(coins, startIndex + 1, endIndex, amount);\n\n if (minWaysUsingRestOfTheCoins == 0 && minUsingCurrentCoin > 0) {\n return minUsingCurrentCoin;\n } else if (minWaysUsingRestOfTheCoins > 0 && minUsingCurrentCoin == 0) {\n return minWaysUsingRestOfTheCoins;\n }\n return Math.min(minUsingCurrentCoin, minWaysUsingRestOfTheCoins);\n\n }",
"@SuppressWarnings(\"Main Logic\")\n void solve() {\n n = ii();\n m = ii();\n a = iia(n);\n int from[] = new int[n - 1];\n int to[] = new int[n - 1];\n for (int i = 0; i < n - 1; i++) {\n from[i] = ii() - 1;\n to[i] = ii() - 1;\n }\n g = packU(n, from, to, n - 1);\n int[][] pars = parents3(g, 0);\n par = pars[0];\n int[] ord = pars[1];\n dep = pars[2];\n spar = logstepParents(par);\n subTree = new int[n];\n dfs(0, -1);\n pointer = 1;\n baseArray = new int[n + 1];\n chainNo = 0;\n chainInHead = new int[n];\n Arrays.fill(chainInHead, -1);\n posInBase = new int[n];\n chainInInd = new int[n];\n HLD(0, -1);\n makeTree();\n out.println(Arrays.toString(baseArray));\n out.println(Arrays.toString(a));\n for (int q = 0; q < m; q++) {\n int type = ii();\n if (type == 1) {\n int u = ii() - 1, v = ii() - 1;\n query(u, v);\n out.println(\"DONE\");\n } else {\n int u = ii(), v = ii();\n // update\n }\n }\n }",
"public static int f2(int N) { \n int x = 0; //O(1)\n for(int i = 0; i < N; i++) // O(n)\n // O(n)`\n for(int j = 0; j < i; j++) \n x++;\n return x;\n }",
"public int[] squareUp(int n) {\r\n int[]arreglo=new int[(n*n)]; // O(1)\r\n if(n==0){ // O(1)\r\n return arreglo; // O(1)\r\n }\r\n for(int i=n-1;i<arreglo.length;i=i+n){ // O(n)\r\n for (int j=i;j>=i-(i/n);j--){ // O(1)\r\n arreglo[j]=1+(i-j); // O(1)\r\n }\r\n }\r\n return arreglo; // O(1)\r\n}",
"private int calc(int x, int n, int i, int sum) {\n int ways = 0;\n\n // Calling power of 'i' raised to 'n'\n int p = (int) Math.pow(i, n);\n while (p + sum < x) {\n // Recursively check all greater values of i\n ways += calc(x, n, i + 1,\n p + sum);\n i++;\n p = (int) Math.pow(i, n);\n }\n\n // If sum of powers is equal to x\n // then increase the value of result.\n if (p + sum == x)\n ways++;\n\n // Return the final result\n return ways;\n }",
"int solve(int p, int current) {\n int id = getId(p, current);\n if (p >= 0 && memo.containsKey(id)) {\n return memo.get(id);\n }\n List<Integer> adjList = adj.get(current);\n int n = adjList.size();\n if (n == 0) {\n throw new RuntimeException();\n }\n if ((n == 2 && p >= 0) || (n == 1 && p < 0)) {\n // should cut the nodes under current\n int ans = getDepth(p, current) - 1;\n // System.out.println(\"ans(\" + p + \",\" + current + \")=\" + ans);\n memo.put(id, ans);\n return ans;\n }\n if (n == 1) {\n // System.out.println(\"ans(\" + p + \",\" + current + \")=nochild\");\n return 0;\n }\n int ans = Integer.MAX_VALUE;\n\n for (int i = 0; i < n; i++) {\n int a = adjList.get(i);\n if (a == p) {\n continue;\n }\n for (int j = i + 1; j < n; j++) {\n int b = adjList.get(j);\n if (b == p) {\n continue;\n }\n // try a & b combo\n int tmp = solve(current, a);\n tmp += solve(current, b);\n for (int k = 0; k < n; k++) {\n int c = adjList.get(k);\n if (c != a && c != b && c != p) {\n tmp += getDepth(current, c);\n }\n }\n ans = Math.min(ans, tmp);\n }\n }\n memo.put(id, ans);\n // System.out.println(\"ans(\" + p + \",\" + current + \")=\" + ans);\n return ans;\n }",
"private static void backtrackHelper(TreeNode current, int targetSum, List<TreeNode> path, List<List<Integer>> allPaths){\n if(current.left == null && current.right == null){\n if(targetSum == current.val){\n List<Integer> tempResultList = new ArrayList<>();\n // for(TreeNode node: path){\n // tempResultList.add(node.val);\n // }\n tempResultList.addAll(path.stream().mapToInt(o -> o.val).boxed().collect(Collectors.toList()));\n tempResultList.add(current.val);\n\n allPaths.add(tempResultList); // avoid reference puzzle\n }\n return;\n }\n\n // loop-recursion (Here only 2 choices, so we donot need loop)\n if(current.left != null){\n path.add(current);\n backtrackHelper(current.left, targetSum - current.val, path, allPaths);\n path.remove(current);\n }\n\n if(current.right != null){\n path.add(current);\n backtrackHelper(current.right, targetSum - current.val, path, allPaths);\n path.remove(current);\n }\n }",
"public int solution(int N) {\n\n int l = 0; // 2*l - r\n int r = 1; // 2*r - l\n\n return search(l, r, N);\n }",
"public static int f1(int N) {\n int x = 0; //O(1)\n for(int i = 0; i < N; i++) // O(n) \n x++; \n return x; \n \n }",
"private static void recursiveFixedSumPairs(/* determine parameters here */){\r\n\t\t// complete this method\r\n\t\t\r\n\t}",
"private static void findNumbers(int[] candidates, int sum,\n List<List<Integer>> res, List<Integer> r, int i) {\n if (sum < 0) {\n return;\n }\n\n // if we get exact answer\n if (sum == 0) {\n List<Integer> r2 = new ArrayList<>(r);\n if (!res.contains(r2)) {\n res.add(r2);\n }\n return;\n }\n\n // Recur for all remaining elements that have value smaller than sum.\n while (i < candidates.length - 1) {\n i++;\n\n // Till every element in the array starting from i which can contribute to the sum\n r.add(candidates[i]); // add them to list\n\n // recur for next numbers\n findNumbers(candidates, sum - candidates[i], res, r, i);\n\n // remove number from list (backtracking)\n r.remove(r.size() - 1);\n }\n }",
"static long findSum(int N)\n\t{\n\t\tif(N==0) return 0;\n\t\treturn (long)((N+1)>>1)*((N+1)>>1)+findSum((int)N>>1);\n\t\t\n\t}",
"public static int calculate()\n {\n final List<Integer> oneToNine = IntStream.iterate(1, n -> n + 1)\n .limit(9)\n .boxed()\n .collect(toList());\n final List<List<Integer>> permutations = HeapPermutations.of(oneToNine);\n\n // System.out.println(permutations.size());\n //2- for each permutation\n // a. find all breaking 2 points to break\n // b. check first two sections' third is equal to the last section\n // c. if yes, add combintion to result, otherwise skip\n\n return permutations.stream()\n .flatMap(toTriples()) //find all combinations xx X yy = zz\n .filter(isPandigital()) // allow pandigital tripes through\n .map(Triple::getThird) // get the product\n .distinct() // get distinct products only given the problem statement does not allow repetition (see hint)\n .mapToInt(i -> i) // convert to primitive\n .sum(); // and finally get the sum\n }",
"int fact(int n) {\n if (n <= 1)\n return 1;\n else\n return n * fact(n-1);\n}",
"int solve() {\n dp[0][0] = 1;\n IntStream.rangeClosed(1, m).forEach(i ->\n IntStream.rangeClosed(0, n).forEach(j ->\n dp[i][j] = j - i >= 0 ?\n (dp[i - 1][j] + dp[i][j - i]) % M :\n dp[i - 1][j]));\n return dp[m][n];\n }",
"public static Tree solve() {\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n Map<Integer, Set<Integer>> map = new HashMap<Integer,Set<Integer>>();\n int[] valArr = new int[n];\n int[] colArr = new int[n];\n for(int i =0;i<n;i++){\n valArr[i] = scan.nextInt();\n }\n for(int i =0;i<n;i++){\n colArr[i] = scan.nextInt();\n }\n for(int i=0;i<n-1;i++){\n //10^10 / 1024/ 1024/1024, 10GB\n int a = scan.nextInt()-1;\n int b = scan.nextInt()-1;\n \n //Tree[] treeArr = new Tree[n];\n if(map.containsKey(a)){\n map.get(a).add(b);\n }else{\n Set<Integer> set = new HashSet<Integer>();\n set.add(b);\n map.put(a,set);\n }\n //case 1-2, 2-1\n if(map.containsKey(b)){\n map.get(b).add(a);\n }else{\n Set<Integer> set = new HashSet<Integer>();\n set.add(a);\n map.put(b,set);\n } \n }\n Set<Integer> visited = new HashSet<Integer>();\n Tree root =buildTree(map,0,0,valArr,colArr);\n return root;\n }",
"static public int solve(int n,int A[])\n {\n int freqArr[] = new int[1001];\n int dp[] = new int[1001];\n\n for(int i=0; i<n; i++){\n freqArr[A[i]]++;\n }\n\n dp[0] = 0;\n dp[1] = freqArr[1] > 0 ? freqArr[1] : 0;\n\n for(int i=2; i<=1000; i++){\n dp[i] = Math.max(dp[i-2] + i*freqArr[i], dp[i-1]);\n }\n return dp[1000];\n }",
"private int dfsInOrderIterativeSol(TreeNode root, int k) {\n // Corner Case\n if (root == null) {\n return 0;\n }\n\n Stack<TreeNode> stack = new Stack<>();\n TreeNode node = root;\n int countNum = 0;\n\n while (!stack.isEmpty() || node != null) {\n if (node != null) {\n stack.push(node); // just like the recursion\n node = node.left;\n } else {\n TreeNode curNode = stack.pop();\n countNum++;\n if (countNum == k) {\n return curNode.val;\n }\n node = curNode.right;\n }\n }\n return 0;\n\n // // push nodes till the left end\n // while (root != null) {\n // stack.push(root);\n // root = root.left;\n // }\n\n // while (k != 0) {\n // TreeNode curNode = stack.pop();\n // k -= 1;\n // if (k == 0) {\n // return curNode.val;\n // }\n\n // TreeNode rightNode = curNode.right;\n // // push the right node till the left end still!!!\n // while(rightNode != null) {\n // stack.push(rightNode);\n // rightNode = rightNode.left;\n // }\n // }\n\n // return 0; // never hit if k is valid and root is not null\n }",
"public static void main(String[] args) {\n\n pairsSum();\n\n printAllSubArrays();\n\n tripletZero();\n\n // int[][] sub = subsets();\n\n PairsSum sum = new PairsSum();\n int[] arr = { 10, 1, 2, 3, 4, 5, 6, 1 };\n boolean flag = sum.almostIncreasingSequence(arr);\n System.out.println(flag);\n\n String s = \"\";\n for (int i = 0; i < 100000; i++) {\n // s += \"CodefightsIsAwesome\";\n }\n long start = System.currentTimeMillis();\n // int k = subStr(s, \"IsA\");\n System.out.println(System.currentTimeMillis() - start);\n // System.out.println(k);\n\n String[] a = { \"aba\", \"aa\", \"ad\", \"vcd\", \"aba\" };\n String[] b = sum.allLongestStrings(a);\n System.out.println(Arrays.deepToString(b));\n\n List<String> al = new ArrayList<>();\n al.toArray();\n\n Map<Integer, Integer> map = new HashMap<>();\n Set<Integer> keySet = map.keySet();\n for (Integer integer : keySet) {\n\n }\n\n String st = reverseBracksStack(\"a(bc(de)f)g\");\n System.out.println(st);\n\n int[] A = { 1, 2, 3, 2, 2, 3, 3, 33 };\n int[] B = { 1, 2, 2, 2, 2, 3, 2, 33 };\n\n System.out.println(sum.isIPv4Address(\"2.2.34\"));\n\n Integer[] AR = { 5, 3, 6, 7, 9 };\n int h = sum.avoidObstacles(AR);\n System.out.println(h);\n\n int[][] image = { { 36, 0, 18, 9 }, { 27, 54, 9, 0 }, { 81, 63, 72, 45 } };\n int[][] im = { { 7, 4, 0, 1 }, { 5, 6, 2, 2 }, { 6, 10, 7, 8 }, { 1, 4, 2, 0 } };\n int[][] res = sum.boxBlur(im);\n\n for (int i = 0; i < res.length; i++) {\n for (int j = 0; j < res[0].length; j++) {\n System.out.print(res[i][j] + \" \");\n }\n System.out.println();\n }\n\n boolean[][] ms = { { true, false, false, true }, { false, false, true, false }, { true, true, false, true } };\n int[][] mines = sum.minesweeper(ms);\n for (int i = 0; i < mines.length; i++) {\n for (int j = 0; j < mines[0].length; j++) {\n System.out.print(mines[i][j] + \" \");\n }\n System.out.println();\n }\n\n System.out.println(sum.variableName(\"var_1__Int\"));\n\n System.out.println(sum.chessBoard());\n\n System.out.println(sum.depositProfit(100, 20, 170));\n\n String[] inputArray = { \"abc\", \"abx\", \"axx\", \"abx\", \"abc\" };\n System.out.println(sum.stringsRearrangement(inputArray));\n\n int[][] queens = { { 1, 1 }, { 3, 2 } };\n int[][] queries = { { 1, 1 }, { 0, 3 }, { 0, 4 }, { 3, 4 }, { 2, 0 }, { 4, 3 }, { 4, 0 } };\n boolean[] r = sum.queensUnderAttack(5, queens, queries);\n\n }",
"private final int m()\n\t { int n = 0;\n\t int i = 0;\n\t while(true)\n\t { if (i > j) return n;\n\t if (! cons(i)) break; i++;\n\t }\n\t i++;\n\t while(true)\n\t { while(true)\n\t { if (i > j) return n;\n\t if (cons(i)) break;\n\t i++;\n\t }\n\t i++;\n\t n++;\n\t while(true)\n\t { if (i > j) return n;\n\t if (! cons(i)) break;\n\t i++;\n\t }\n\t i++;\n\t }\n\t }",
"@Override\n public String solve() {\n int LIMIT = 50 * NumericHelper.ONE_MILLION_INT;\n int[] nCount = new int[LIMIT+1];\n for(long y = 1; y<= LIMIT; y++) {\n for(long d= (y+3)/4; d<y; d++) { // +3 is to make d atleast 1\n long xSq = (y+d) * (y+d);\n long ySq = y * y;\n long zSq = (y-d) * (y-d);\n\n long n = xSq - ySq - zSq;\n\n if(n<0) {\n continue;\n }\n\n if(n>=LIMIT) {\n break;\n }\n\n\n nCount[(int)n]++;\n\n }\n }\n\n int ans = 0;\n for(int i = 1; i<LIMIT; i++) {\n if(nCount[i] == 1) {\n //System.out.print(i +\",\");\n ans++;\n }\n }\n\n return Integer.toString(ans);\n }",
"static void solveKTUtil(int x, int y, int movei,\n int sol[][], int xMove[],\n int yMove[], List<int[][]> result) {\n int k, next_x, next_y;\n if (movei == N * N){\n \tresult.add(copy(sol));\n return ;\n }\n\n /* Try all next moves from the current coordinate\n x, y */\n for (k = 0; k < 8; k++) {\n next_x = x + xMove[k];\n next_y = y + yMove[k];\n if (isSafe(next_x, next_y, sol)) {\n sol[next_x][next_y] = movei;\n solveKTUtil(next_x, next_y, movei + 1,\n sol, xMove, yMove, result);\n \n sol[next_x][next_y] = -1;// backtracking\n }\n }\n\n \n }",
"public static void main(String args[] ) throws Exception {\n Scanner scanner = new Scanner(System.in);\n int n = scanner.nextInt();\n int[] seqArray = new int[n];\n for (int i = 0; i < n; i++) {\n seqArray[i] = scanner.nextInt();\n }\n // getSeqValue(seqArray); //this method is an accepted one on Hackerrank but time complexity is not order n; i.e. !O(n);\n getLinearOrderY(seqArray); // trying to get O(n) time complexity;\n }",
"public int[] solution(String S, int[] P, int[] Q) {\n \n int[][] result = new int[S.length()][4];\n int[] returnResult = new int[P.length];\n \n //how many different solutions exist?\n //'A' [0], [0] - 1 solution\n //'AG' [0, 0, 1], [0, 1, 1] - 3\n // 'AGT' [0,0,0,1,1,2], [0,1,1,2,2,2] - 6\n // 10\n // 15\n // 21\n \n //Prefix Sum - calculation\n \n for (int i = 1; i< S.length()+1; i++){\n \n if (i == 1){\n switch (S.substring(i-1, i)){\n case \"A\": result[i-1][0] = 1;\n break;\n case \"C\": result[i-1][1] = 1;\n break;\n case \"G\": result[i-1][2] = 1;\n break;\n case \"T\": result[i-1][3] = 1;\n break;\n }\n }else{\n int a = 0;\n switch (S.substring(i-1, i)){\n case \"A\": a = 0;\n break;\n case \"C\": a= 1;\n break;\n case \"G\": a =2;\n break;\n case \"T\": a =3;\n break;\n }\n result[i-1][a] = 1 + result[i-2][a];\n result[i-1][(a+1)%4] = result[i-2][(a+1)%4];\n result[i-1][(a+2)%4] = result[i-2][(a+2)%4];\n result[i-1][(a+3)%4] = result[i-2][(a+3)%4];\n }\n\n }\n \n /*\n for (double i : result){\n System.out.println(i);\n }\n */\n \n //A = 1, G = 2, C = 3, T = 4\n //when A found return 1 and move to next computation.\n // P[k] <= Q[K]\n int lowerBound = 0;\n int upperBound = 0;\n for (int i = 0; i < P.length; i++){\n lowerBound = P[i];\n upperBound = Q[i];\n \n int[] toEvaluate = new int[4];\n\n //System.out.println(lowerBound);\n if (lowerBound == 0){\n toEvaluate[0]= result[upperBound][0];\n toEvaluate[1]= result[upperBound][1];\n toEvaluate[2]= result[upperBound][2];\n toEvaluate[3]= result[upperBound][3];\n }else{\n toEvaluate[0]= result[upperBound][0] - result[lowerBound-1][0]; \n toEvaluate[1]= result[upperBound][1] - result[lowerBound-1][1];\n toEvaluate[2]= result[upperBound][2] - result[lowerBound-1][2];\n toEvaluate[3]= result[upperBound][3] - result[lowerBound-1][3];\n }\n \n /*\n for (int eval : toEvaluate){\n System.out.println(eval);\n \n }\n */\n if (toEvaluate[0] > 0) {returnResult[i] = 1;\n }else if (toEvaluate[1] > 0) {returnResult[i] = 2;\n }else if (toEvaluate[2] > 0) {returnResult[i] = 3;\n }else if (toEvaluate[3] > 0) {returnResult[i] = 4;\n }\n \n }\n \n return returnResult; \n }",
"void solve() throws IOException {\n int[] nk = ril(2);\n int n = nk[0];\n int k = nk[1];\n int[] p = ril(n);\n int[] b = ril(k);\n for (int i = 0; i < n; i++) p[i]--;\n for (int i = 0; i < k; i++) b[i]--;\n\n int[] numToIdx = new int[n];\n for (int i = 0; i < n; i++) numToIdx[p[i]] = i;\n\n boolean[] remove = new boolean[n];\n Arrays.fill(remove, true);\n for (int bi : b) remove[bi] = false;\n List<Integer> toRemove = new ArrayList<>(n - k);\n for (int i = 0; i < n; i++) if (remove[i]) toRemove.add(i);\n Collections.sort(toRemove);\n\n int[] prevSmaller = new int[n];\n prevSmaller[0] = -1;\n int prevIdx = remove[p[0]] ? -1 : 0;\n for (int i = 1; i < n; i++) {\n int j = prevIdx;\n while (j != -1 && p[i] < p[j]) j = prevSmaller[j];\n prevSmaller[i] = j;\n if (!remove[p[i]]) prevIdx = i;\n }\n int[] nextSmaller = new int[n];\n nextSmaller[n-1] = n;\n prevIdx = remove[p[n-1]] ? n : n-1;\n for (int i = n-2; i >= 0; i--) {\n int j = prevIdx;\n while (j != n && p[i] < p[j]) j = nextSmaller[j];\n nextSmaller[i] = j;\n if (!remove[p[i]]) prevIdx = i;\n }\n\n int[] init = new int[n];\n Arrays.fill(init, 1);\n SegmentTree st = new SegmentTree(init);\n long ans = 0;\n for (int x : toRemove) {\n int idx = numToIdx[x];\n int l = prevSmaller[idx] + 1;\n int r = nextSmaller[idx] - 1;\n ans += st.query(l, r+1);\n st.modify(idx, 0);\n }\n pw.println(ans);\n }",
"public static void solve(int n, List<Integer> a) {\n Collections.sort(a);\n Collections.reverse(a);\n double sum = a.stream().mapToDouble(num -> Double.valueOf(num)).sum();\n double currentN = Double.valueOf(n);\n double currentSum = sum;\n for(Integer next : a)\n {\n double nextDouble = Double.valueOf(next);\n if(nextDouble<=currentSum/currentN)\n {\n break;\n }\n currentSum -= nextDouble;\n currentN--;\n }\n System.out.println(currentSum/currentN);\n\n\n }",
"private static int dfs( int n, int level, int min ) {\n\n if (n == 0 || level >= min) return level; //returns only number of perfect squares\n\n for (int i = (int) Math.sqrt(n); i > 0; i--) { //Math.sqrt = same as prime-sieve of prime numbers\n\n min = dfs(n - ((int) Math.pow(i, 2)), level + 1, min);\n\n }\n return min;\n }",
"public int solution(int[] A) {\n ArrayList<Integer> fibonacci = new ArrayList<>();\n\n fibonacci.add(0); // note: f(0) = 0 (as in the quesion)\n fibonacci.add(1);\n // note: using \"while\" is better than \"for\" (avoid errors)\n\n while (true) {\n int temp1 = fibonacci.get(fibonacci.size() - 1);\n int temp2 = fibonacci.get(fibonacci.size() - 2);\n\n fibonacci.add(temp1 + temp2);\n\n // if already bigger than length, then break;\n if (temp1 + temp2 > A.length) {\n break;\n }\n }\n\n // reverse \"List\": from big to small\n Collections.reverse(fibonacci);\n\n // use \"queue\" with \"point\"\n // point(x,y) = point(\"position\", \"number of steps\")\n ArrayList<Point> queue = new ArrayList<>();\n\n queue.add(new Point(-1, 0)); // position:-1, steps:0\n\n // index: the current index for queue element\n int index = 0;\n while (true) {\n // cannot take element from queue anymore\n if (index == queue.size()) {\n return -1;\n }\n\n // take element from queue\n Point current = queue.get(index);\n\n // from big to small\n for (Integer n : fibonacci) {\n int nextPosition = current.x + n;\n\n // case 1: \"reach the other side\"\n if (nextPosition == A.length) {\n // return the number of steps\n return current.y + 1;\n }\n\n // case 2: \"cannot jump\"\n // note: nextPosition < 0 (overflow, be careful)\n else if ((nextPosition > A.length) || (nextPosition < 0) || (A[nextPosition] == 0)) {\n // note: do nothing\n }\n\n // case 3: \"can jump\" (othe cases)\n else {\n // jump to next position, and step+1\n Point temp = new Point(nextPosition, current.y + 1);\n // add to queue\n queue.add(temp);\n\n A[nextPosition] = 0; // key point: for high performance~!!\n }\n }\n\n index++; // take \"next element\" from queue\n }\n }",
"void h(List<List<Integer>> r, List<Integer> t, int n, int s){ \n for(int i = s; i*i <= n; i++){\n if(n % i != 0) continue; \n t.add(i);\n t.add(n / i);\n r.add(new ArrayList<>(t));\n t.remove(t.size() - 1);\n h(r, t, n/i, i);\n t.remove(t.size() - 1);\n }\n }",
"static int recursion(int steps, int arrLen, int index, int[][] dp) {\n\n if (steps == 0 && index == 0) {\n return 1;\n }\n\n // extra base condition is index> steps , because we cannot return from there at all.\n if (steps == 0 || index < 0 || index >= arrLen || index > steps) return 0;\n\n if (dp[steps][index] != -1) return dp[steps][index];\n\n int ans = 0;\n\n // we can go either left , right or stay there itself.\n ans = (ans + recursion(steps - 1, arrLen, index, dp)) % MOD;\n ans = (ans + recursion(steps - 1, arrLen, index + 1, dp)) % MOD;\n ans = (ans + recursion(steps - 1, arrLen, index - 1, dp)) % MOD;\n dp[steps][index] = ans % MOD;\n return dp[steps][index];\n }",
"private int dfs(int[][] matrix, int i, int j, int d) {\n if (i < 0 || j < 0 || i == matrix.length || j == matrix[0].length || matrix[i][j] != 0)\n return 0;\n if (dp[i][j][d] > 0) return dp[i][j][d];\n timeComplexityCount++;\n maxI = Math.max(maxI, i);\n int res;\n if (d == 1)\n res = Math.max(dfs(matrix, i, j + 1, 1), dfs(matrix, i, j + 1, 2));\n else if (d == 0)\n res = Math.max(dfs(matrix, i, j - 1, 0), dfs(matrix, i, j - 1, 2));\n else\n res = Math.max(dfs(matrix, i + 1, j, 0), Math.max(dfs(matrix, i + 1, j, 1), dfs(matrix, i + 1, j, 2)));\n dp[i][j][d] = res + 1;\n return res + 1;\n }",
"public static int ulam(int n) {\n\n List<Integer> list = new ArrayList<>();\n list.add(1);\n list.add(2);\n\n int i = 3;\n while (list.size() < n) {\n\n int count = 0;\n for (int j = 0; j < list.size() - 1; j++) {\n\n for (int k = j + 1; k < list.size(); k++) {\n if (list.get(j) + list.get(k) == i)\n count++;\n if (count > 1)\n break;\n }\n if (count > 1)\n break;\n }\n if (count == 1)\n list.add(i);\n i++;\n }\n return list.get(n - 1);\n }",
"static int[] find2(int a[]){\r\n int sum = a[0];\r\n int pro = a[0];\r\n for(int i=1;i<a.length;i++){\r\n sum += a[i];\r\n pro += a[i]*a[i];\r\n }\r\n int s = (n*(n+1))/2 - sum;\r\n int p = (n*(n+1)*(2*n+1))/6 - pro;\r\n return solveSP(s, p);\r\n }",
"private boolean solve(int i, int j){\n\t\tif(j == 9){\n\t\t\tj = 0;\n\t\t\ti++;\n\t\t}\n\t\tif(i == 9){\n\t\t\treturn true;\n\t\t} else if(sudoku[i][j] != 0 && !check(i, j, sudoku[i][j])){\n\t\t\t\treturn false;\n\t\t} else if(sudoku[i][j] != 0){\n\t\t\t\treturn solve(i, j+1);\n\t\t} else {\n\t\t\tfor(int n = 1; n <= 9; n++){\n\t\t\t\tif(check(i, j, n)){\n\t\t\t\t\tsudoku[i][j] = n;\n\t\t\t\t\tif(!solve(i, j+1)){\n\t\t\t\t\t\tsudoku[i][j] = 0;\n\t\t\t\t\t}else {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"private int helperM(int[] a, int s, int e, Integer[][] memo) {\n if (s == e) return a[s];\n if (memo[s][e] != null) return memo[s][e];\n int c1 = a[s] - helperM(a, s + 1, e, memo);\n int c2 = a[e] - helperM(a, s, e - 1, memo);\n memo[s][e] = Math.max(c1, c2);\n return memo[s][e];\n }",
"public static int recursionSum(int[] num, int n) {\n if (n <= 2)\n System.out.println(num[n]);\n if (n <= 0)\n return 0;\n return recursionSum(num, n - 1) + num[n - 1];\n }",
"public int solve(int n) {\n return n & ~(n - 1);\n }",
"public void DFS(List<List<Integer>> result, List<Integer> temp, int n, int start){\n for(int i = start; i * i <= n; i++){\n //we skip undividable factor\n if(n%i != 0) continue;\n \n //found a pair of factor, we can add them to temp list to build a valid factor combination\n List<Integer> copy = new ArrayList<Integer>(temp);\n //since i <= n/i, we will add i first, then n/i\n copy.add(i);\n copy.add(n/i);\n result.add(copy);\n \n //then we try to decompose larger n/i factor, and our later factors shall not be > i, since i has been inserted into list \n temp.add(i);\n DFS(result, temp, n/i, i);\n temp.remove(temp.size() - 1);\n }\n }",
"private static int combinationRecursive(int n, int k) {\n\t\tif (k == 0 || n == k) {\n\t\t\treturn 1;\n\t\t} else {\n\t\t\treturn (int)(n/(double)k) * combinationRecursive(n-1, k-1);\n\t\t}\n\t}",
"private int helper(int[] nums, int left, int right) {\n if (left == right) return nums[left];\n\n int mid = (left + right) / 2;\n\n int leftSum = helper(nums, left, mid);\n int rightSum = helper(nums, mid + 1, right);\n int crossSum = crossSum(nums, left, right, mid);\n\n return Math.max(Math.max(leftSum, rightSum), crossSum);\n }",
"static int recurseMaxStolenValue(int[] values,int i){\r\n\t if(i >= values.length) return 0;\r\n\t if(i == values.length -1) return values[values.length-1];\r\n\t \r\n\t return Math.max( values[i] + recurseMaxStolenValue(values,i+2)\r\n\t ,values[i+1] + recurseMaxStolenValue(values,i+3)\r\n\t );\r\n\t /*\r\n\t *Approach #2 for Recursion --> This approach won't work to convert to DP,but recursion yields right result\r\n\t */\r\n\t \r\n\t /*\r\n\t if(i >= values.length) return 0; \r\n\t int result1 = values[i]+recurseMaxStolenValue(values,i+2);\r\n\t int result2 = recurseMaxStolenValue(values,i+1);\r\n\t return (Math.max(result1,result2));\r\n\t */\r\n\t \r\n\t }",
"static int[] OnepassSol1(int[]a, int n){\r\n Map<Integer, Integer> map = new HashMap<>();\r\n for (int i = 0; i < a.length; i++) {\r\n int complement = n - a[i];\r\n if (map.containsKey(complement)) {\r\n return new int[] { map.get(complement), i };\r\n }\r\n map.put(a[i], i);\r\n }\r\n int[] ans = {-1,-1};\r\n return ans;\r\n }",
"public int solution(int[] A)\n {\n \n if(A.length == 0 && A.length == 1)\n return 0;\n \n int currentOneSum = 0;\n int totalOneSum = 0;\n int currentZeros = 0;\n \n for (int i = 0; i < A.length; i++)\n \n if(A[i] == 1)\n \n currentOneSum++;\n \n if(A[i] == 0 || i == A.length-1)\n \n totalOneSum += currentZeros * currentOneSum;\n currentOneSum = 0;\n currentZeros++;\n \n return Math.abs(totalOneSum) <= Math.pow(10,9) ? totalOneSum : -1;\n \n }",
"public static int frog(int n, int [] h){\n\n int dp[] = new int [n];\n\n dp[0] = 0;\n dp[1] = Math.abs(h[1] - h[0]);\n\n for(int i = 2; i < n ; i ++){\n\n dp[i] = Math.min(dp [i - 2] + Math.abs(h[i] - h[i - 2]), dp[i - 1] + Math.abs(h[i] - h[i - 1]));\n\n\n\n }\n //print(dp);\n return dp[n - 1];\n }",
"private static int minCoins_my_way_infinite_coins_of_one_value_case(int[] coins, int startIndex, int endIndex, int amount) {\n\n if (coins.length == 0) return 0;\n\n if (startIndex == endIndex) {\n int currentCoin = coins[startIndex];\n\n if (currentCoin == amount) {// coins=(8) amount=8\n return 1;\n }\n if (currentCoin > amount) {// coins=(9) amount=8\n return 0;\n }\n if (currentCoin < amount) {\n // IMPORTANT: This code assumes that you can use only 1 coin of the same value (you can't use infinite number of coins of the same value).\n //return 0;\n\n // This code assumes that you can use infinite number of coins of the same value.\n // e.g. currentCoin=1 and amount=8, then 8 coins of 1s can be used\n if (amount % currentCoin == 0) { // coins=(1) amount=8 should return 8 because you can use 8 coins of value 1 to make amount=8\n return amount / currentCoin;\n }\n return 0; // coins=(3) amount=8 should return 0 because you can't use 1 or more coins of value 3 to make amount=8\n }\n }\n\n // IMPORTANT\n // You don't need any coin to make amount=0\n // By seeing recursive call, you will figure out that amount can reach to 0. So, you need an exit condition for amount==0\n if (amount == 0) {\n return 0;\n }\n\n int currentCoin = coins[startIndex];\n\n int minUsingCurrentCoin = 0;\n\n if (currentCoin == amount) {\n minUsingCurrentCoin = 1;\n } else if (currentCoin > amount) {\n minUsingCurrentCoin = 0;\n } else {\n /*\n if currentCoin=1 and amount=8, then maxNumberOfCoinsThatCanBeUsedToMakeAmount will be 8.\n if currentCoin=3 and amount=8, then maxNumberOfCoinsThatCanBeUsedToMakeAmount be 2\n you need to consider both these situations for coming up with the correct code\n\n Case 1:\n coins = (1,6) amount=8\n currentCoin=1. So, maxNumberOfCoinsThatCanBeUsedToMakeAmount = 8\n\n coin numberOfCurrentCoins(i) amountConsumedByCurrentCoin coinsUsedFromRemaining totalCoinsUsed\n remaining coins amount\n 1 1 1 (6) 7 = 0 0 (when you cannot make remaining amount using remaining coins, then you cannot make total amount including current coin also)\n 1 2 2 (6) 6 = 1 2+1=3\n 1 3 3 (6) 5 = 0 0\n 1 4 4 (6) 4 = 0 0\n 1 5 5 (6) 3 = 0 0\n 1 6 6 (6) 2 = 0 0\n 1 7 7 (6) 1 = 0 0\n 1 8 8 (6) 0 = 0 8 (special condition - even though you could not make remaining amount using remaining coins, you could make total amount using current coin)\n\n Case 2:\n coins = (3,6) amount=8\n currentCoin=3. So, maxNumberOfCoinsThatCanBeUsedToMakeAmount = 2\n\n coin numberOfCurrentCoins(i) amountConsumedByCurrentCoin coinsUsedFromRemaining totalCoinsUsed\n remaining coins amount\n 3 1 3 (6) 3 = 0 0 (when you cannot make remaining amount using remaining coins, then you cannot make total amount including current coin also)\n 3 2 6 (6) 2 = 0 0\n\n */\n int maxNumberOfCoinsThatCanBeUsedToMakeAmount = amount / currentCoin;\n\n int min = 0;\n\n for (int i = 1; i <= maxNumberOfCoinsThatCanBeUsedToMakeAmount; i++) {\n int amountConsumedByCurrentCoin = i * currentCoin;\n\n int minFromRemaining = minCoins_my_way_infinite_coins_of_one_value_case(coins, startIndex + 1, endIndex, amount - amountConsumedByCurrentCoin);\n\n if (minFromRemaining == 0) {// If I could not make remaining amount using remaining coins, then I cannot make total amount including current coin (except one special condition)\n if (amountConsumedByCurrentCoin == amount) {// special condition - even though you could not make remaining amount using remaining coins, you could make total amount using current coin\n min = i;\n } else {\n min = 0;\n }\n } else {\n min = i + minFromRemaining;\n }\n\n if (minUsingCurrentCoin == 0 && min > 0) {\n minUsingCurrentCoin = min;\n } else if (minUsingCurrentCoin > 0 && min == 0) {\n // don't change minUsingCurrentCoin\n } else {\n if (min < minUsingCurrentCoin) {\n minUsingCurrentCoin = min;\n }\n }\n }\n }\n\n int minWaysUsingRestOfTheCoins = minCoins_my_way_infinite_coins_of_one_value_case(coins, startIndex + 1, endIndex, amount);\n\n if (minWaysUsingRestOfTheCoins == 0 && minUsingCurrentCoin > 0) {\n return minUsingCurrentCoin;\n } else if (minWaysUsingRestOfTheCoins > 0 && minUsingCurrentCoin == 0) {\n return minWaysUsingRestOfTheCoins;\n }\n return Math.min(minUsingCurrentCoin, minWaysUsingRestOfTheCoins);\n\n }",
"public static int solve() {\n FactorizationSieve sieve = new FactorizationSieve(LIMIT + 1);\n int[] abundants = new int[LIMIT + 1];\n int k = 0;\n\n for (int n = 1; n <= LIMIT; n++)\n if (sieve.sigma(1, n) > n + n)\n abundants[k++] = n;\n\n // Sum pair of abundant numbers\n BitSet absums = new BitSet(LIMIT + 1);\n for (int i = 0; i < k; i++) {\n for (int j = i; j < k; j++) {\n int n = abundants[i] + abundants[j];\n if (n > LIMIT)\n break;\n absums.set(n);\n }\n }\n\n // Find all numbers that cannot be written as the sum of two abundant numbers\n int res = 0;\n for (int n = 1; n <= LIMIT; n++)\n if (!absums.get(n))\n res += n;\n return res;\n }",
"public static boolean solve(int[][] board) {\nfor (int x=0; x<9; x++) {\n for (int y=0; y<9; y++) {\nif (board[x][y] == 0) {\n \n // Try each possibile value in this space\n // and see if the rest of the puzzle can be filled in.\n for (board[x][y]=1; board[x][y]<=9; board[x][y]++) {\n if (isLegal(board) && solve(board)) {\n return true;\n }\n }\n \n // There is no value that we can put in the first\n // empty space that was found, so the puzzle is\n // unsolvable given the values put in up to this\n // point.\n board[x][y] = 0;\n return false;\n}\n }\n}\n \n// There were no empty spaces to fill in, so the\n// puzzle must be solved.\nreturn true;\n }",
"private int recursiveTopDown(int[] price, int n) {\n if( n== 0) return 0;\n int ans = Integer.MIN_VALUE;\n\n for (int i = 0; i < n; i++) {\n ans = Math.max(ans, price[i] + recursiveTopDown(price, n - 1 - i));\n }\n return ans;\n }",
"private static int recursiveFibDP(int n) {\n\n Integer[] table = new Integer[n + 1];\n if(table[n]==null){\n if (n <= 1) {\n table[n] = n;\n }\n else {\n table[n] =recursiveFibDP(n-1)+recursiveFibDP(n-2);\n }\n }\n return table[n];\n }",
"private static int numberOfWaysRecursive(int n) {\n\t\tif(n<0)\n\t\t\treturn 0;\n\t\tif(n==0)\n\t\t\treturn 1;\n\t\telse\n\t\t\treturn numberOfWaysRecursive(n-1) + numberOfWaysRecursive(n-2) + numberOfWaysRecursive(n-3);\n\t}",
"static int[] sol1(int[]a, int n){\r\n\t\tMap <Integer,Integer> map= new HashMap();\r\n\t\tfor (int i = 0; i< a.length; i++){\r\n\t\t\tmap.put(a[i],i);\r\n\t\t}\r\n\t\tArrays.sort(a);\r\n\t\tint i = 0; \r\n\t\tint j = a.length -1;\r\n\t\twhile (i <= j){\r\n\t\t\tif(a[i]+a[j]>n) j--;\r\n\t\t\telse if (a[i]+a[j]<n) i++;\r\n\t\t\telse break;\r\n\t\t}\r\n\t\tint[] ans= {map.get(a[i]),map.get(a[j])};\r\n\t\treturn ans;\r\n\t}",
"private int optimize() {\n\t\t// items: Items sorted by value-to-weight ratio for linear relaxation\n\t\t// t: the decision vector being tested at each node\n\t\t// ws, vs, is, bs: stacks of weight, value, item id, whether bring item\n\t\t// p: stack pointer; i, b, weight, value: loop caches; best: max search\n\t\t// ss: stack size: Always <=2 children on stack for <=n-1 parents\n\t\tItem[] items = new Item[n];\n\t\tint ss = 2 * n;\n\t\tint[] itemsSorted = new int[n], t = new int[n], ws = new int[ss],\n\t\t\tvs = new int[ss], is = new int[ss], bs = new int[ss];\n\t\tint i, b, weight, value, best = 0, p = 0;\n\n\t\tfor (int j = 0; j < n; j++)\n\t\t\titems[j] = new Item(j);\n\t\tArrays.sort(items);\n\t\tfor (int j = 0; j < n; j++)\n\t\t\titemsSorted[j] = items[j].i();\n\t\titems = null; // For garbage collection.\n\n\t\t// Push item 0 onto the stack with and without bringing it.\n\t\tws[p] = 0; vs[p] = 0; is[p] = 0; bs[p] = 1; p++;\n\t\tws[p] = 0; vs[p] = 0; is[p] = 0; bs[p] = 0; p++;\n\n\t\twhile (p > 0) {\n\t\t\tp--; // Pop the latest item off the stack\n\t\t\ti = is[p]; b = bs[p];\n\t\t\tweight = ws[p] + w[i] * b;\n\t\t\tif (weight > k)\n\t\t\t\tcontinue;\n\t\t\tvalue = vs[p] + v[i] * b;\n\t\t\tif (bound(i, weight, value, itemsSorted) < best)\n\t\t\t\tcontinue;\n\t\t\tbest = Math.max(value, best);\n\t\t\tt[i] = b;\n\t\t\tif (i < n - 1) { // Push children onto stack w/ & w/o bringing item\n\t\t\t\tws[p] = weight; vs[p] = value; is[p] = i + 1; bs[p] = 1; p++;\n\t\t\t\tws[p] = weight; vs[p] = value; is[p] = i + 1; bs[p] = 0; p++;\n\t\t\t}\n\t\t\telse if (value >= best)\n\t\t\t\tSystem.arraycopy(t, 0, x, 0, n);\n\t\t}\n\t\treturn best;\n\t}",
"private static int solution2(String s) {\r\n int n = s.length();\r\n int ans = 0;\r\n for (int i = 0; i < n; i++)\r\n for (int j = i + 1; j <= n; j++)\r\n if (allUnique(s, i, j)) ans = Math.max(ans, j - i);\r\n return ans;\r\n }",
"public static int factorialiterativa(int n){\n if(n>0){\r\n factorialrecursiva(n-1);//LLAMO A LA RECURSIVA\r\n }else {\r\n return 1;\r\n }\r\nreturn factorialrecursiva(n-1);\r\n }",
"public void solution() {\n\t\t\n\t}",
"public static void main(String[] args){\n\t\t\n\t\tfor (int i = 0; i<999999;i++) results.add(0);\t\n\n\t\tsetChain(1L);\n\t\tboolean switcher = true;\n\t\t//while switch=true ... and once chain length is added to, switch = false\n \t\tlong best = 0L;\n\t\tint index=0;\n\t\t\t\n\t\tfor (long j = 1L; j < 1000000L; j++) {\n\n\t\t\tsetCur((int)j);\n\n\t\t\tfindChain(j);//} catch(Exception e){System.out.println(\"stackOverFlow :D\");}\n\t\t\tif (getChain() > best) {best = getChain(); index=getCur();}\n\t\t\t//now store results for later use if we come across that number.\n\t\t\tresults.set(getCur()-1, (int)getChain());\t\n\t\t\tsetChain(1L); //reset\n\t\t\t/* \t\n\t\t\tswitcher=true;\n\t\t\tint i = j;\n\t\t\twhile (switcher) {\n\n\t\t\t\tif (i==1) {//results.add(chainLength); \n\t\t\t\t\tif (chainLength > best) { best=chainLength; index = j;}\n\t\t\t \tchainLength=1; switcher=false;}\n\t\n\t\t\t\telse { i=recurse(i); chainLength++; }\t\n\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t*/\n//\t\t }\n\t\t}\n\t\tSystem.out.println(index);\n\t}",
"private static void dfsBribe(int n, List<Integer>[] ch, long[] w) {\n if (ch[n].size() == 0){\n In[n] = w[n];\n OutD[n] = Long.MAX_VALUE;\n OutU[n] = 0;\n }\n //recurrance case: non.leaf, do dfs for all subordinates then calculate In, OutUp & OutDown.\n else{\n for (int c:ch[n])\n dfsBribe(c, ch, w); //running once for each child thereby O(N)\n In[n] = w[n];\n for (int c:ch[n]){ //O(N) running time\n In[n] += OutU[c];\n OutU[n] += Math.min(In[c], OutD[c]);\n OutD[n] += Math.min(In[c], OutD[c]);\n }\n OutD[n] += delta(n, ch); //add delta for no in Children\n }\n\n }",
"int catalan(int n) { \n int res = 0; \n \n // Base case \n if (n <= 1) { \n return 1; \n } \n for (int i = 0; i < n; i++) { \n res += catalan(i) * catalan(n - i - 1); \n } \n return res; \n }",
"@Override\n \tpublic Solution solve() {\n \t\tfor (int i = 0; i < n; i++) {\n \t\t\tnest[i] = generator.getSolution();\n \t\t}\n \n \t\tfor (int t = 0; t < maxGeneration; t++) { // While (t<MaxGeneration) or\n \t\t\t\t\t\t\t\t\t\t\t\t\t// (stop criterion)\n \t\t\t// Get a cuckoo randomly (say, i) and replace its solution by\n \t\t\t// performing random operations;\n \t\t\tint i = r.nextInt(n);\n \t\t\tSolution randomNest = nest[i];\n \t\t\t//FIXME: randomNest = solutionModifier.modify(nest[i]);\n \n \t\t\t// Evaluate its quality/fitness\n \t\t\tint fi = randomNest.f();\n \n \t\t\t// Choose a nest among n (say, j) randomly;\n \t\t\tint j = r.nextInt(n);\n \t\t\tint fj = f[j];\n \n \t\t\tif (fi > fj) {\n \t\t\t\tnest[i] = randomNest;\n \t\t\t\tf[i] = fi;\n \t\t\t}\n \n \t\t\tsort();\n \t\t\t// A fraction (pa) of the worse nests are abandoned and new ones are built;\n\t\t\tfor(i = n-toAbandon; i<n; i++) {\n \t\t\t\tnest[i] = generator.getSolution();\n \t\t\t}\n \t\t\t\n \t\t\t// Rank the solutions/nests and find the current best;\n \t\t\tsort();\n \t\t}\n \n \t\treturn nest[0];\n \t}",
"public int solution(int[] A) {\n\t \n\t int n = A.length;\n\t int N =0;\n\t for(int i=0;i<n;i++){\n\t N += A[i];\n\t }\n\t boolean[][] P = new boolean[N/2+1][n+1];\n\t for(int i=0;i<n;i++){\n\t P[0][i] = true;\n\t }\n\t \n\t for(int i = 1;i<=N/2;i++)\n\t for(int j = 1;j<=n;j++)\n\t if(A[j-1]<=i)\n\t P[i][j] = P[i][j-1] || P[i - A[j - 1]][ j - 1];\n\t else\n\t P[i][j] = P[i][j-1];\n\t if (P[N/2][n] == true)\n\t return 1;\n\t else \n\t return 0;\n\t }",
"int countSusbset(int n, int w){\n //i.e target sum achieved\n if(w == 0){\n return 1;\n }\n \n //if sum not achieved and no items left\n if(n == 0){\n return 0;\n }\n \n //if item is gretart than target weight, we have to exclude it\n if(arr[n-1] > w){\n return countSusbset(n-1, w)\n }else{ \n return countSusbset(n-1, w) + countSusbset(n-1, w - arr[n-1]);\n }\n}",
"private int dfs(int[][] matrix, int i, int j, int last, int[][] memo) {\n if (i < 0 || i >= matrix.length || j < 0 || j >= matrix[0].length || matrix[i][j] <= last) {\n return 0;\n }\n if (memo[i][j] != 0) {\n return memo[i][j];\n }\n int maxLength = 0;\n maxLength = Math.max(maxLength, dfs(matrix, i - 1, j, matrix[i][j], memo));\n maxLength = Math.max(maxLength, dfs(matrix, i + 1, j, matrix[i][j], memo));\n maxLength = Math.max(maxLength, dfs(matrix, i, j - 1, matrix[i][j], memo));\n maxLength = Math.max(maxLength, dfs(matrix, i, j + 1, matrix[i][j], memo));\n memo[i][j] = maxLength + 1;\n return memo[i][j];\n }",
"private static int coinExchange(int N, int[] S, int n) {\n\t\tif (N == 0)\n\t\t\treturn 1;\n\n\t\t// If N is less than 0 then no solution exists\n\t\tif (N < 0)\n\t\t\treturn 0;\n\n\t\t// If there are no coins and N is greater than 0, then no solution exist\n\t\tif (n <= 0 && N >= 1)\n\t\t\treturn 0;\n\n\t\tif (memo[n][N] != 0) {\n\t\t\tmemoHits++;\n\t\t\treturn memo[n][N];\n\t\t}\n\n\t\trecursionHits++;\n\n\t\tint retval = coinExchange(N - S[n - 1], S, n) + coinExchange(N, S, n - 1);\n\t\tmemo[n][N] = retval;\n\t\treturn retval;\n\t}",
"private void solve(int[][] solution, int row, int column) {\n\t\tif (row == boardsize) {\n\t\t\tSystem.out.println(\"Found solution\");\n\t\t\tsolutionfound = true;\n\t\t\tprintSolution(solution);\n\t\t\treturn;\n\t\t}\n\t\tSystem.out.println(\"Finding solution for [\" + row + \"][\" + column + \"]\");\n\t\t//printSolution(solution);\n\n\t\t// only try a solution for the position that are not set from the beginning\n\t\t// try the numbers from 1 to 9 as a solution\n\t\tfor (int n = 1; n < 10; n++) {\n\t\t\tif (solutionfound) { break; }\n\t\t\t// no predefined number on the board\n\t\t\tif (board[row][column] == 0) {\n\t\t\t\tsolution[row][column] = n;\n\t\t\t}\n\t\t\tSystem.out.println(\"Trying with [\" + n + \"] for [\" + row + \"][\" + column + \"]\");\n\t\t\t// check whether we have found a solution\n\t\t\tif (isConsitent(solution)) {\n\t\t\t\tif (column == boardsize - 1) { // we have reached the end of a row\n\t\t\t\t\tsolve(solution, row + 1, 0); // continue on the next row\n\t\t\t\t} else {\n\t\t\t\t\tsolve(solution, row, column + 1); // we still work in the same row, advance the column\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// reset to zero for the backtracking case\n\t\t\t\tsolution[row][column] = 0;\n\t\t\t}\n\t\t}\n\t}",
"public List<Integer> diffWaysToCompute(String input) {\n List<Integer> result=new ArrayList<>();\n if(input==null||input.length()==0) return result;\n List<String> ops=new ArrayList<>();\n for(int i=0; i<input.length(); i++){\n int j=i;\n while(j<input.length()&&Character.isDigit(input.charAt(j)))\n j++;\n ops.add(input.substring(i, j));\n if(j!=input.length()) ops.add(input.substring(j, j+1));\n i=j;\n }\n int N=(ops.size()+1)/2; //num of integers\n ArrayList<Integer>[][] dp=(ArrayList<Integer>[][]) new ArrayList[N][N];\n for(int d=0; d<N; d++){\n if(d==0){\n for(int i=0; i<N; i++){\n dp[i][i]=new ArrayList<>();\n dp[i][i].add(Integer.valueOf(ops.get(i*2)));\n }\n continue;\n }\n for(int i=0; i<N-d; i++){\n dp[i][i+d]=new ArrayList<>();\n for(int j=i; j<i+d; j++){\n ArrayList<Integer> left=dp[i][j], right=dp[j+1][i+d];\n String operator=ops.get(j*2+1);\n for(int leftNum:left)\n for(int rightNum:right){\n if(operator.equals(\"+\"))\n dp[i][i+d].add(leftNum+rightNum);\n else if(operator.equals(\"-\"))\n dp[i][i+d].add(leftNum-rightNum);\n else\n dp[i][i+d].add(leftNum*rightNum);\n }\n }\n }\n }\n return dp[0][N-1];\n}",
"private static boolean findEqualSumSubsetBottomUp(int[] arr, int n) {\n\t\tint sum=0;\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tsum+=arr[i];\n\t\t}\n\t\tif(sum%2==1) {\n\t\t\treturn false;\n\t\t}\n \t\treturn findEqualSumBottomUp(arr,n,sum/2);\n\t}",
"static long numWays(int index, int m, int n, int[] arr) {\n long count = 0;\n\n\n if (n == 0 || index == (m - 1)) {\n if (index == (m - 1)) {\n arr[index] = n;\n }\n// for (int x : arr) {\n// System.out.print(x + \",\");\n// }\n// System.out.println();\n return 1;\n }\n\n if (n < 0 || index >= m) {\n return 0;\n }\n\n\n String key = index(arr, index, m, n);\n if (dp.containsKey(key)) {\n return dp.get(key);\n }\n\n\n for (int i = 0; i <= n; i++) {\n arr[index] = i;\n count += numWays(index + 1, m, n - i, arr);\n// for (int j = index + 1; j < arr.length; j++) {\n// arr[j] = 0;\n// }\n }\n\n dp.put(key, count % prime);\n return count % prime;\n }",
"protected int sumRecursive(int a, int b){\n if (b == 0){\n return a;\n } else {\n if (b > 0){\n return sumRecursive(a + 1, b - 1);\n } else {\n return sumRecursive(a - 1, b + 1);\n }\n }\n }",
"private static int solution(final int[] A)\n {\n Arrays.sort(A);\n\n for(int i=0; i<A.length - 1; i=i+2)\n {\n if (A[i] != A[i + 1])\n {\n return A[i];\n }\n }\n\n return A[A.length - 1];\n }",
"public static void main(String[] args)\n {\n Scanner sc = new Scanner(System.in);\n int sum = sc.nextInt();\n int N = sc.nextInt();\n sc.nextLine();\n int [][] arr = new int[N][2];\n for(int i = 0;i<N;i++)\n {\n arr[i][0] = sc.nextInt();\n arr[i][1] = sc.nextInt();\n sc.nextLine();\n }\n //Arrays.sort(arr, new Comparator<int[]>() {\n // @Override\n // public int compare(int[] o1, int[] o2) {\n // return o1[1]-o2[1]; //按第二列价值排个序。\n // }\n //});\n int [][] dp = new int[N+1][sum+1];\n int [][] path = new int[N+1][sum+1];\n for(int i = 1;i<=N;i++)\n {\n for(int j = 1;j<=sum;j++)\n {\n if(j<arr[i-1][0])\n dp[i][j] = dp[i-1][j];\n else\n {\n if(dp[i-1][j]<dp[i-1][j-arr[i-1][0]]+arr[i-1][1])\n path[i][j] = 1;\n dp[i][j] = Math.max(dp[i-1][j],dp[i-1][j-arr[i-1][0]]+arr[i-1][1]);\n }\n }\n }\n System.out.println(dp[N][sum]);\n\n int i = N;\n int j = sum;\n while (i>0&&j>0)\n {\n if(path[i][j]==1)\n {\n System.out.print(1+\" \");\n j -=arr[i-1][0];\n }\n else\n {\n i--;\n System.out.print(0+\" \");\n }\n }\n\n\n // 改进版。只使用一维数组。\n // int [] f = new int[sum+1];\n // for(int i = 0;i<N;i++)\n // {\n // for (int j = sum;j>=0;j--)\n // {\n // if(j>=arr[i][0])\n // f[j] = Math.max(f[j], f[j-arr[i][0]]+arr[i][1]);\n // }\n // }\n // System.out.println(f[sum]);\n\n }",
"private static int f(int n, int complete, int other, int[] arr) {\n if(n<=0)\n return 0;\n int res=0;\n ArrayList<Integer>list=new ArrayList<Integer>();\n for(int a:arr)\n if(a>0)\n list.add(a);\n int brr[]=new int[list.size()];\n for(int i=0;i<brr.length;i++)\n brr[i]=list.get(i);\n while(brr.length!=0){\n int index=0;\n for(int i=1;i<brr.length;i++)\n if(brr[index]<brr[i])\n index=i;\n for(int i=0;i<brr.length;i++){\n if(index==i)\n brr[i]-=complete;\n else\n brr[i]-=other;\n }\n list=new ArrayList<Integer>();\n for(int a:brr)\n if(a>0)\n list.add(a);\n brr=new int[list.size()];\n for(int i=0;i<brr.length;i++)\n brr[i]=list.get(i);\n res++;\n }\n return res;\n }",
"public static void main(String[] args) {\n\t\tint a[]= {15,3,7,1,9,2};\n\t\tsubarraysum(a,11);//Time complexity O(n^2) space O(1)\n\n\t\tsubarraysum_reducecomplexity(a,11,a.length); //Time complexity O(n) space O(1)\n\n\t}",
"public int solution(Tree T) {\n if(T==null)\n return 0;\n int minValue=T.x;\n \n dfs(T,minValue);\n return count;\n }",
"public boolean canPartition(int[] nums) {\n int sum = 0;\n int n = nums.length;\n for (int num : nums) sum += num;\n // sum cannot be splitted evenly\n if ((sum & 1) == 1) return false;\n int target = sum / 2;\n \n // dp[i][j] represents whether 0~i-1 numbers can reach\n // weight capacity j\n boolean[][] dp = new boolean[n+1][target+1];\n \n for (int i = 1; i <= n; i++) dp[i][0] = true;\n for (int j = 1; j <= target; j++) dp[0][j] = false;\n dp[0][0] = true;\n \n for (int i = 1; i <= n; i++) {\n for (int j = 1; j <= target; j++) {\n // if don't pick current number\n dp[i][j] = dp[i-1][j];\n if (j >= nums[i-1]) {\n dp[i][j] = dp[i][j] || dp[i-1][j-nums[i-1]];\n }\n }\n }\n return dp[n][target];\n \n \n // Solution2: optimizing to save space\n // https://leetcode.com/problems/partition-equal-subset-sum/discuss/90592/01-knapsack-detailed-explanation/94996\n int sum = 0;\n int n = nums.length;\n for (int num : nums) sum += num;\n if ((sum & 1) == 1) return false;\n int target = sum / 2;\n boolean[] dp = new boolean[target+1];\n dp[0] = true;\n for (int num : nums) {\n // here is the trick to save space\n // because we have to update dp[j] based on \n // previous dp[j-num] and dp[j] from previous loop.\n // if we update dp from left to right\n // we first update smaller dp which is dp[j-num]\n // then we won't be able to get original dp[j-num] and dp[j]\n // from previous loop, and eventually we get the wrong\n // answer. But if we update dp from right to left\n // we can assure everything is based on previous state\n for (int j = target; j >= num; j--) {\n // if (j >= num) {\n dp[j] = dp[j] || dp[j-num];\n // }\n }\n }\n return dp[target];\n }",
"public String solve(long n, long a, long b, long c, long d, long x0, long y0, long m)\n {\n long[] count = new long[9];\n long x = x0;\n long y = y0;\n for (long t = 0; t < n; t++)\n {\n// System.out.println(x + \", \" + y);\n int i = (int) (x % 3) * 3 + (int) (y % 3);\n count[i]++;\n x = (a * x + b) % m;\n y = (c * y + d) % m;\n }\n\n long totalCount = 0;\n for (int i1 = 0; i1 < 9; i1++)\n {\n long count1 = count[i1];\n if (count1 == 0)\n {\n continue;\n }\n count[i1]--;\n for (int i2 = i1; i2 < 9; i2++)\n {\n long count2 = count[i2];\n if (count2 == 0)\n {\n continue;\n }\n count[i2]--;\n int x1 = i1 / 3;\n int y1 = i1 % 3;\n int x2 = i2 / 3;\n int y2 = i2 % 3;\n int x3 = (3 - (x1 + x2) % 3) % 3;\n int y3 = (3 - (y1 + y2) % 3) % 3;\n int i3 = (x3 % 3) * 3 + (y3 % 3);\n long count3 = count[i3];\n if (i3 >= i2 && count3 > 0)\n {\n // either i1==i2==i3 OR i1!=i2!=i3; you can never have only two i's the same.\n if (i1 == i2 && i2 == i3)\n {\n totalCount += calcCombinations(count1);//the first count value is the genuine count for that x,y coordinate.\n }\n else\n {\n totalCount += count1 * count2 * count3;\n }\n }\n count[i2]++;\n }\n count[i1]++;\n }\n\n return String.valueOf(totalCount);\n }",
"static int coinChangeProblem1(int[] coins,int sum){\n int n = coins.length;\n int[][] dp = new int[n+1][sum+1];\n\n for(int j = 1;j<=sum;j++){\n dp[0][j] = 0;\n }\n for(int i = 0;i<=n;i++){\n dp[i][0] = 1;\n }\n\n for(int i = 1;i<=n;i++){\n for(int j = 1;j<=sum;j++){\n if(coins[i-1]<=j){\n dp[i][j] = dp[i-1][j] + dp[i][j-coins[i-1]];\n }else dp[i][j] = dp[i-1][j];\n }\n }\n return dp[n][sum];\n }",
"protected abstract int solve(List<Integer> myList);",
"public static void dynamicProgramming2(int[][] myArray){ \t\r\n\t\tint countNode = myArray.length;\r\n\t\tint rows = myArray[0].length;\r\n\t\tif(rows != countNode) {\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t\t\r\n \tint[] cost = new int[countNode];\r\n \tint[] prev = new int[countNode];\r\n \tboolean[] visited = new boolean[countNode];\r\n \t\r\n \tfor(int i = 0; i < countNode; i++) {\r\n \t\tcost[i] = myArray[0][i];\r\n \t\tprev[i] = 0;\r\n \t\tvisited[i] = false;\r\n \t}\r\n \t\r\n \tint cur = 0; \t\r\n \twhile(true)\r\n \t{\r\n \t\tfor(int i = cur; i < countNode; i++)\r\n \t\t{\r\n \t\t\tif(myArray[cur][i] + cost[cur] < cost[i])\r\n \t\t\t{\r\n \t\t\t\tcost[i] = myArray[cur][i] + cost[cur];\r\n \t\t\t\tprev[i] = cur;\r\n \t\t\t}\r\n \t\t}\r\n \t\t\r\n \t\tvisited[cur] = true;\r\n \t\tif(AllVisited(visited)) break;\r\n \t\t\r\n \t\t// Choose the node which is not visited yet\r\n \t\t// and has the minimum cost so far.\r\n \t\tint min = Integer.MAX_VALUE;\r\n \t\tfor(int i = 0; i < countNode; i++){\r\n \t\t\tif(!visited[i] && cost[i] < min) {\r\n \t\t\t\tcur = i;\r\n \t\t\t\tmin = cost[i];\r\n \t\t\t}\r\n \t\t}\r\n \t}\r\n \tSystem.out.println(\"Dynamic Programming2:\");\r\n \tSystem.out.println(\"Minimum Cost to go from 1 to \" + countNode + \" is \" + cost[countNode - 1]);\r\n \tStack<Integer> s = new Stack<Integer>();\r\n \tint traveller = countNode - 1;\r\n \ts.push(countNode);\r\n \twhile(traveller != 0)\r\n \t{\r\n \t\ts.push(prev[traveller] + 1);\r\n \t\ttraveller = prev[traveller];\r\n \t}\r\n \t\r\n \tStringBuilder sb = new StringBuilder();\r\n \twhile(!s.empty())\r\n \t{\r\n \t\tsb.append(s.pop());\r\n \t\tif (!s.empty()) {\r\n \t\tsb.append(\" -> \");\r\n \t\t}\r\n \t}\r\n \t\r\n \tSystem.out.println(\"Path from 1 to end is \" + sb.toString()); \r\n \tSystem.out.println();\r\n }",
"static boolean subSetSumProblem(int[] arr,int sum){\n// init\n int n = arr.length;\n boolean[][] dp = new boolean[n+1][sum+1];\n\n for (int j = 0;j<=sum;j++){\n dp[0][j] = false;\n }\n\n for (int i = 0;i<=n;i++){\n dp[i][0] = true;\n }\n\n for (int i = 1;i<=n;i++){\n for (int j = 1;j<=sum;j++){\n if (arr[i-1] <= j){\n dp[i][j] = dp[i-1][j] || dp[i-1][j-arr[i-1]];\n }else{\n dp[i][j] = dp[i-1][j];\n }\n }\n }\n return dp[n][sum];\n }",
"public int solution(int[] A) {\n int L = A.length;\n int[] B = new int[L+1];\n for(int i=0; i<L; i++) {\n int t = A[i];\n B[t-1] = t;\n }\n for(int j=0; j<L; j++) {\n if(B[j] == 0) {\n return j+1;\n }\n }\n return 0;\n }",
"int backTrack(int[] nums, int targetSum, int startIndex, int computedSum, int[][] dp) {\n if (startIndex == nums.length) {\n if (targetSum == computedSum) {\n return 1;\n\n }\n return 0;\n } else {\n\n int add = backTrack(nums, targetSum, startIndex + 1, computedSum + nums[startIndex], dp);\n\n int subtract = backTrack(nums, targetSum, startIndex + 1, computedSum - nums[startIndex], dp);\n dp[startIndex][computedSum] = add + subtract;\n return dp[startIndex][computedSum];\n }\n\n }"
] | [
"0.7026614",
"0.66346157",
"0.6514104",
"0.64243066",
"0.6301366",
"0.6264188",
"0.62639624",
"0.62382853",
"0.6216481",
"0.6212849",
"0.61681426",
"0.615851",
"0.6138438",
"0.6132395",
"0.60932815",
"0.60627425",
"0.60367304",
"0.60156035",
"0.6002495",
"0.59630424",
"0.5962595",
"0.5951708",
"0.595015",
"0.59311736",
"0.5921016",
"0.5918453",
"0.5908297",
"0.5908271",
"0.5897331",
"0.5884458",
"0.585119",
"0.5846606",
"0.5822046",
"0.5815173",
"0.58097637",
"0.5799472",
"0.57885194",
"0.5787628",
"0.5783074",
"0.57751524",
"0.5774102",
"0.5771231",
"0.57701176",
"0.5760943",
"0.57569677",
"0.57535654",
"0.57518375",
"0.57517225",
"0.57473624",
"0.57091206",
"0.5701412",
"0.56976104",
"0.56958437",
"0.56894296",
"0.56877464",
"0.5686886",
"0.56837255",
"0.5673009",
"0.5666789",
"0.5652176",
"0.5641846",
"0.56409085",
"0.5634066",
"0.5633138",
"0.5620284",
"0.56180793",
"0.5617877",
"0.5614497",
"0.56119883",
"0.56073695",
"0.56034815",
"0.5603169",
"0.5588029",
"0.5586411",
"0.5580892",
"0.5579973",
"0.55731875",
"0.55719715",
"0.5571293",
"0.55695736",
"0.55688125",
"0.5560419",
"0.55587083",
"0.55441093",
"0.55423594",
"0.5541004",
"0.5539734",
"0.55397004",
"0.553906",
"0.55382943",
"0.55299854",
"0.5527743",
"0.5526528",
"0.55262166",
"0.5524602",
"0.5517106",
"0.5510928",
"0.55005556",
"0.54998165",
"0.54995763",
"0.5497743"
] | 0.0 | -1 |
using preorder tree traversal. | private boolean compare(TreeNode leftRoot, TreeNode rightRoot) {
// Good shortcut
//if(left==null || right==null) return left==right;
if (leftRoot == null && rightRoot == null) return true;
if (leftRoot == null || rightRoot == null) return false;
if (leftRoot.val != rightRoot.val) return false;
boolean isOutersEqual = compare(leftRoot.left, rightRoot.right);
boolean isInnersEqual = compare(leftRoot.right, rightRoot.left);
return isOutersEqual && isInnersEqual;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void preorder()\r\n {\r\n preorder(root);\r\n }",
"public void preorder()\n {\n preorder(root);\n }",
"public void preorder()\n {\n preorder(root);\n }",
"public void preorder() {\n\t\tpreorder(root);\n\t}",
"@Override\r\n\tpublic List<Node<T>> getPreOrderTraversal() {\r\n\t\tList<Node<T>> lista = new LinkedList<Node<T>>();// La lista para el\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// recursivo\r\n\t\treturn auxiliarRecorridoPre(raiz, lista);\r\n\t}",
"private E[] getPreOrderLeftSubTree(E[] inOrderTraversal,E[] preOrderTraversal) {\n\t\treturn null;\n\t}",
"public void preorderTraverse(){\n\t\tpreorderHelper(root);\n\t\tSystem.out.println();\n\t}",
"public void traversePreOrder() {\n\t\tpreOrder(this);\n\t}",
"public void preOrderTraversal() {\n beginAnimation();\n treePreOrderTraversal(root);\n stopAnimation();\n\n }",
"public void preOrderTraversal(){\n System.out.println(\"preOrderTraversal\");\n\n Stack<Node> stack = new ArrayStack();\n\n if(root!=null){\n stack.push(root);\n }\n while(!stack.isEmpty()) {\n Node node = stack.pop();\n System.out.print(node.getData() + \" \");\n\n if (node.getRight() != null) {\n stack.push(node.getRight());\n }\n if (node.getLeft() != null) {\n stack.push(node.getLeft());\n }\n }\n System.out.println();\n }",
"public void preorder() {\n root.preorder();\n System.out.println(\"\");\n }",
"public void PreOrder() {\n\t\tPreOrder(root);\n\t}",
"public void preOrder() {\n preOrder(root);\n }",
"void preorder(Node root){\n if(root!=null){\n System.out.print(root.data+\" \");\n preorder(root.left);\n preorder(root.right);\n }\n\n }",
"public void preTraverse() {\n // ensure not an empty tree\n while (root != null) {\n \n }\n }",
"public void preOrder() {\r\n\t\tSystem.out.print(\"PRE: \");\r\n\r\n\t\tpreOrder(root);\r\n\t\tSystem.out.println();\r\n\r\n\t}",
"public void visitPreorder(Visitor<T> visitor) { if (root != null) root.visitPreorder(visitor); }",
"private static <N> void preOrderTraversal(TreeNode<N> node, TreeNodeVisitor<N> visitor) throws TreeNodeVisitException {\r\n\t\t\r\n\t\tvisitor.visitNode(node);\r\n\t\r\n\t\tif(node.hasChildren()){\r\n\t\t\tfor(TreeNode<N> childNode : node.getChildren()){\r\n\t\t\t\tpreOrderTraversal(childNode, visitor);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}",
"public void preorderTraversal() \n { \n preorderTraversal(header.rightChild); \n }",
"public static void preorderTraversal(Node root)\r\n {\r\n if (root == null) {\r\n return;\r\n }\r\n \r\n System.out.print(root.data + \" \");\r\n preorderTraversal(root.left);\r\n preorderTraversal(root.right);\r\n }",
"public static void preorder(Node root){\n\t\tif(root != null){\n\t\t\tSystem.out.println(root.toString());\n\t\t\tinorder(root.getLeft());\n\t\t\tinorder(root.getRight());\n\t\t}\n\t}",
"void preOrder(Node node) \n { \n if (node != null) \n { \n System.out.print(node.key + \" \"); \n preOrder(node.left); \n preOrder(node.right); \n } \n }",
"public void preOrder(){\n preOrder(root);\n System.out.println();\n }",
"private void preOrder(Node node) {\n\t\tif(null == node) return;\n\t\t\n\t\t//Print node\n\t\tSystem.out.println(node.data);\n\t\t\n\t\t//Go to left child node\n\t\tpreOrder(node.left);\n\t\t\n\t\t//Go to right child node\n\t\tpreOrder(node.right);\n\t}",
"private E[] getInOrderLeftSubTree(E[] inOrderTraversal,\n\t\t\tE[] preOrderTraversal) {\n\t\treturn null;\n\t}",
"static void preOrderTraversal(Node root) {\n if (root == null) {\n return;\n }\n System.out.print(root.data + \" \");\n preOrderTraversal(root.left);\n preOrderTraversal(root.right);\n }",
"private void preOrdertraverse(Node root){\n System.out.println(root.value);\n for(var child : root.getChildren())\n preOrdertraverse(child); //recursively travels other childrens in current child\n }",
"public void preOrder (Node root)\n\t{\n\t \n\t if(root == null)\n\t {\n\t\t return;\n\t }\n\t \n\t addValToPreorder(root);\n\t \n\t //get all of the left nodes\n\t preOrder(root.leftNode());\n\t //get all of the right nodes\n\t preOrder(root.rightNode()); \n\t \n\t}",
"public void preOrderTraversal(TreeNode<T> root) {\n\t\tif (null == root) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tSystem.out.println(root);\n\t\t\tpreOrderTraversal(root.getLeftChild());\n\t\t\tpreOrderTraversal(root.getRightChild());\n\t\t}\n\t}",
"public void preOrderTraversal() {\n preOrderThroughRoot(root);\n System.out.println();\n }",
"protected void preorder(TreeNode<E> root) {\n if (root == null) {\n return;\n }\n System.out.print(root.element + \" \");\n preorder(root.left);\n preorder(root.right);\n }",
"public String preorderTraverse(){\r\n\t\t\r\n\t\t//the recursive call to the private method\r\n\t\t//StringBuffer is used because it is passed by reference\r\n\t\t//StringBuffer can be changed in recursive calls\r\n\t\treturn preorderTraverse(this, new StringBuffer(\"\"));\r\n\t}",
"public void preOrder(BinarySearchTreeNode<T> node)\r\n {\r\n if(node==null)\r\n {\r\n return;\r\n }\r\n System.out.println(node.getElement());\r\n preOrder(node.getLeft());\r\n preOrder(node.getRight());\r\n }",
"protected void preorder(TreeNode<E> root) {\r\n\t\tif (root == null)\r\n\t\t\treturn;\r\n\t\tSystem.out.print(root.element + \" \");\r\n\t\tpreorder(root.left);\r\n\t\tpreorder(root.right);\r\n\t}",
"private void preorderHelper(Node<E> root){\n\t\tif(root != null){\n\t\t\tSystem.out.print(root.item.toString() + \" \");\n\t\t\tpreorderHelper(root.left);\n\t\t\tpreorderHelper(root.right);\n\t\t}\n\t}",
"public static void main(String[] args) {\n TreeNode root = new TreeNode(3);\n root.left = new TreeNode(9);\n root.right = new TreeNode(20);\n root.right.left = new TreeNode(15);\n root.right.right = new TreeNode(7);\n System.out.println(new Solution().preorderTraversal(null));\n }",
"protected void preorder(node root){\n if(root == null)\n return;\n\n System.out.print(root.data + \" \");\n preorder(root.left);\n preorder(root.right);\n }",
"private static boolean preOrderTraversal(Node current) {\n //Break if the node is null\n if(current == null) {\n return false;\n }\n //Recursively check the current node, then the left child, then finally the right child\n else {\n preorder.add(current);\n preOrderTraversal(current.getLeftChild());\n preOrderTraversal(current.getRightChild());\n }\n return true;\n }",
"public void preorder(Node node){\n\t\tif(node == nil){\n\t\t\treturn;\n\t\t}\n\t\tSystem.out.println(\" ID: \" + node.id + \" Colour: \" + node.colour + \" Count: \" + node.count);\n\t\tpreorder(node.left);\n\t\tpreorder(node.right);\n\t}",
"private void preOrder(Node root) {\r\n\r\n\t\tif (root == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (preOrderCount < 20) {\r\n\r\n\t\t\tSystem.out.print(\"< \" + root.getData() + \" > \");\r\n\t\t\t//System.out.println(\" Count: \" + preOrderCount);\r\n\t\t\tpreOrderCount++;\r\n\t\t\tpreOrder(root.getlChild());\r\n\t\t\tpreOrder(root.getrChild());\r\n\t\t}\r\n\r\n\t}",
"public Iterator<T> preorderIterator() { return new PreorderIterator(root); }",
"static void preOrderWithoutRecursion(Node root) {\n Stack<Node> stack = new Stack<>();\n stack.push(root);\n while (!stack.isEmpty()) {\n Node node = stack.peek();\n System.out.print(node.data + \" \");\n stack.pop();\n\n if (node.right != null) {\n stack.push(node.right);\n }\n if (node.left != null) {\n stack.push(node.left);\n }\n }\n }",
"private String traversePreOrder(BinaryNode<T> root) {\n preOrderTrav += root.getData() + \" -> \";\n if (root.getLeftNode() != null) { // traverse left\n traversePreOrder(root.getLeftNode());\n }\n if (root.getRightNode() != null) { // traverse right\n traversePreOrder(root.getRightNode());\n }\n return preOrderTrav;\n }",
"public void preOrder(TreeNode root){\n\t\t//Change place of temp\n\t\tSystem.out.println(root.toString());\n\t\tif(root.getLeft()!= null){\n\t\t\tpreOrder(root.getLeft());\n\t\t}\n\t\tif(root.getMiddle()!=null){\n\t\t\tpreOrder(root.getMiddle());\n\t\t}\n\t\tif(root.getRight()!= null){\n\t\t\tpreOrder(root.getRight());\n\t\t}\n\t}",
"private void preOrderTraversal(int index) {\n if (array[index] == null) {\n return;\n }\n // print the node\n System.out.print(array[index] + \", \");\n //call recursively the method on left child\n preOrderTraversal(2 * index + 1);\n //call recursively the method on right child\n preOrderTraversal(2 * index + 2);\n }",
"void preOrderTraversal(OO8BinaryTreeNode node) {\n\t\tif(node==null)\n\t\t\treturn;\n\t\tSystem.out.print(node.getValue() + \" \");\n\t\tpreOrderTraversal(node.getLeftNode());\n\t\tpreOrderTraversal(node.getRightNode());\n\t}",
"public void preOrderTraverseTree(Node focusNode) {\n if (focusNode != null) { // recursively traverse left child nodes first than right\n\n System.out.println(focusNode); // print recursively pre-order traversal (or return!)\n\n preOrderTraverseTree(focusNode.leftChild);\n\n preOrderTraverseTree(focusNode.rightChild);\n\n }\n }",
"private void treePreOrderTraversal(final Node currNode) {\n int numChildren = getNumChildren();\n\n // Returns if currNode is null.\n if (currNode == null) return;\n\n // Adds this Node to the stack.\n queueStackAddAnimation(currNode, \"Exploring \" + currNode.key,\n AnimationParameters.ANIM_TIME);\n\n // Highlights the current Node.\n queueNodeSelectAnimation(currNode, \"Current Node \" + currNode.key,\n AnimationParameters.ANIM_TIME);\n\n // Explores left subtree.\n for (int i = 0; i < numChildren / 2; ++i)\n treePreOrderTraversal(currNode.children[i]);\n\n // Explores right subtree.\n for (int i = numChildren / 2; i < numChildren; ++i)\n treePreOrderTraversal(currNode.children[i]);\n\n // Removes this Node from the stack.\n queueListPopAnimation(\"Finished exploring \" + currNode.key,\n AnimationParameters.ANIM_TIME);\n\n }",
"private static void preOrder(Node root) {\n\t\tif (root == null)\n\t\t\treturn;\n\t\tSystem.out.print(root.data + \" \");\n\t\tpreOrder(root.left);\n\t\tpreOrder(root.right);\n\t}",
"private void preorderHelper(TreeNode<T> node){\n if(node == null)\n return;\n\n System.out.printf(\"%s \" , node.data);\n preorderHelper(node.leftNode);\n preorderHelper(node.rightNode);\n }",
"public static void main(String[] args) {\n\n\t\tTreeNode node1 = new TreeNode(1);\n TreeNode node2 = new TreeNode(2);\n TreeNode node3 = new TreeNode(3);\n TreeNode node4 = new TreeNode(4);\n TreeNode node5 = new TreeNode(5);\n TreeNode node6 = new TreeNode(6);\n TreeNode node7 = new TreeNode(7);\n node1.left = node2;\n node1.right = node3;\n node2.left = node4;\n node2.right = node5;\n node3.left = node6;\n node4.left = node7;\n \n System.out.println(preorderTraversalIterative(node1));\n System.out.println(preorderTraversalRecursive(node1));\n \n\t\t\n\t\t\n\t\t\n\t}",
"public void visitPreorder(Visitor<T> visitor) {\n visitor.visit(value);\n if (left != null) left.visitPreorder(visitor);\n if (right != null) right.visitPreorder(visitor);\n }",
"public static void preOrder(Node root) {\n if (root == null)\n return;\n System.out.print(root.data + \" \");\n preOrder(root.left);\n preOrder(root.right);\n\n }",
"public void preOrder(Node root) {\n if (root != null) {\n System.out.print(root.getData() + \" \");\n preOrder(root.getLeftChild());\n preOrder(root.getRightChild());\n }\n }",
"public static List<Node> preOrderTraversal(BinarySearchTree BST) {\n preorder = new LinkedList<Node>();\n preOrderTraversal(BST.getRoot());\n return preorder;\n }",
"public static void preOrder(TreeNode node) {\n if (node == null) {\n return;\n }\n System.out.print(node.data + \" \");\n preOrder(node.left);\n preOrder(node.right);\n }",
"public void preOrder(Node root) {\n if(root!=null) {\n System.out.print(root.data + \" \");\n preOrder(root.left);\n preOrder(root.right);\n }\n }",
"public static void preOrder(Node node) {\n if (node == null) {\n return;\n }\n System.out.print(node.data + \" \");\n preOrder(node.left);\n preOrder(node.right);\n }",
"public void preOrderDepthFirstTraversal(NodeVisitor action){\n\t\tif(this.getElement()==null)\n\t\t\treturn;\n\n\t\taction.visit(this.getElement());\n\t\tthis.left.preOrderDepthFirstTraversal(action);\n\t\tthis.right.preOrderDepthFirstTraversal(action);\n\t}",
"public void preorder(TreeNode root) {\n\n\t\tTreeNode current = root;\n\n\t\twhile (current != null) {\n\n\t\t\t// no elements on the left that are less than the current; add it to result.\n\t\t\tif (current.left == null) {\n\t\t\t\tcurrent = current.right;\n\t\t\t}\n\n\t\t\t// start processing the left subtree.\n\t\t\telse {\n\n\t\t\t\tTreeNode predecessor = current.left;\n\n\t\t\t\t// find rightmost value of current's left subtree.\n\t\t\t\twhile (predecessor.right != null && predecessor.right != current.right) {\n\t\t\t\t\tpredecessor = predecessor.right;\n\t\t\t\t}\n\n\t\t\t\t// if no thread between current and its predecessor, add it and add current\n\t\t\t\t// val to the result.\n\t\t\t\tif (predecessor.right == null) {\n\t\t\t\t\tpredecessor.right = current.right;\n\t\t\t\t\tcurrent.right = current.left;\n\t\t\t\t\tcurrent.left = null;\n\t\t\t\t\tcurrent = current.right;\n\t\t\t\t}\n\t\t\t\t// current's left subtree has been processed; remove the thread.\n\t\t\t\telse {\n\t\t\t\t\tcurrent = current.right;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}",
"@Test\n\tvoid tesPreorder() {\n\t\tHeap<Integer, Integer> treap = createTreeHeap();\n\t\t//root, left, right\n\t\tassertEquals(\"[5, 4, 2, 1, 3]\", treap.preOrder());\n\t}",
"public TreeNode createFromPreOrder(int[] preorder, int[] inorder) {\n //will solve this recursively by finding the root of each tree and appending it to the other by traversing\n //the preorder array in order and searching for an element in the inorder traversal\n\n\n return helper(preorder, inorder, 0, 0, inorder.length - 1);\n\n }",
"public static void preOrder(TreeNode node) {\n\t\tif(node == null) return;\n\t\t\n\t\tSystem.out.print(node.value + \" \");\n\t\tpreOrder(node.left);\n\t\tpreOrder(node.right);\t\n\t}",
"private String preorderTraverse(BinarySearchTree curr, StringBuffer treeAsString){\r\n\t\t\r\n\t\t//Get node\r\n\t\ttreeAsString.append(curr.getRoot().toString() + \" \");\r\n\t\t\r\n\t\t//Get leftChild\r\n\t\tif(curr.getLeftChild() != null){\r\n\t\t\tpreorderTraverse(curr.getLeftChild(), treeAsString);\r\n\t\t}\r\n\t\t\r\n\t\t//get rightChild\r\n\t\tif(curr.getRightChild() != null){\r\n\t\t\tpreorderTraverse(curr.getRightChild(), treeAsString);\r\n\t\t}\r\n\t\t\r\n\t\t//return\r\n\t\treturn treeAsString.toString();\r\n\t}",
"@Override\n\tpublic void preorder() {\n\n\t}",
"public List<Integer> preorderTraversal(TreeNode root) {\n ArrayList<Integer> returnList = new ArrayList<Integer>();\n LinkedList<TreeNode> stack = new LinkedList<TreeNode>();\n \n while(root !=null || !stack.isEmpty()){\n if(root != null){\n stack.push(root);\n returnList.add(root.val);\n root = root.left;\n }else{\n root = stack.pop();\n root = root.right;\n }\n }\n return returnList;\n }",
"public void traversePreOrder(Node node) {\n\t\tif (node != null) {\n\t\t\tSystem.out.print(\" \" + node.value);\n\t\t\ttraversePreOrder(node.left);\n\t\t\ttraversePreOrder(node.right);\n\t\t}\n\t}",
"private void preOrder(HomogeneusNode root) {\n\n if (root != null) {\n System.out.printf(\"%d\", root.getData());\n preOrder(root.getLeft());\n preOrder(root.getRight());\n }\n }",
"public static void preOrder(Node n) {\n\t\tif (n == null)\n\t\t\treturn;\n\t\tSystem.out.println(n.getData());\n\t\tpreOrder(n.getLeft());\n\t\tpreOrder(n.getRight());\n\t}",
"private void preorderLeftOnly(Node root) {\r\n if (this != null && !ifLeaf(root))\r\n System.out.print(root.value + \">\");\r\n if (root.left != null)\r\n preorderLeftOnly(root.left);\r\n }",
"private void preorderSubtree(Position<E> p, List<Position<E>> snapshot) {\n snapshot.add(p);\n for (Position<E> c : children(p)) {\n preorderSubtree(c, snapshot); \n \n }\n }",
"private void preOrderTraversalRec(final Node root){\n if(root == null){\n return;\n }\n System.out.print(root.getData() + \" \");\n preOrderTraversalRec(root.getLeft());\n preOrderTraversalRec(root.getRight());\n }",
"private <E> void preOrder(Node root,Action<Integer,E> action) {\n\t\tif(root==null)\n\t\t\treturn;\n\t\t\n\t\t//System.out.println(root.value);\n\t\taction.execute(root.value);\n\n\t\tpreOrder(root.left,action);\n\t\t\n\t\tpreOrder(root.right,action);\n\t\t\n\t}",
"public List<Integer> preorderTraversalRecursive(TreeNode root) {\n if(root == null){\n return rst;\n }\n\n rst.add(root.val);\n preorderTraversalRecursive(root.left);\n preorderTraversalRecursive(root.right);\n return rst;\n }",
"private void traversePreOrder(BinaryNode<AnyType> curr, int indent) {\n\t\tfor(int i = 0; i < indent; i++) {\n\t\t\tSystem.out.print(\"\\t\");\n\t\t}\n\t\tSystem.out.println(curr.element);\n\t\tfor (int i = 0; i < curr.duplicate.size(); i++) {\n\t\t\tSystem.out.println(curr.duplicate.get(i).element);\n\t\t}\n\t\tif (curr.left != null) {\n\t\t\ttraversePreOrder(curr.left, indent + 1);\n\t\t}\n\n\t\tif (curr.right != null) {\n\t\t\ttraversePreOrder(curr.right, indent + 1);\n\t\t}\n\t}",
"public void printIterativePreorderTraversal() {\r\n\t\tprintIterativePreorderTraversal(rootNode);\r\n\t}",
"public void preorderTraverseTree(Node focusNode) {\n\n\t\tif (focusNode != null) {\n\n\t\t\tSystem.out.print(focusNode.data + \" \");\n\n\t\t\tpreorderTraverseTree(focusNode.left);\n\t\t\tpreorderTraverseTree(focusNode.right);\n\n\t\t}\n\n\t}",
"public static void main(String[] args)\r\n {\r\n \r\n int[] preorder = { 1, 2, 4, 5, 3, 6, 8, 9, 7 };\r\n int[] isLeaf = { 0, 0, 1, 1, 0, 0, 1, 1, 1 };\r\n \r\n // construct the tree\r\n Node root = constructTree(preorder, isLeaf);\r\n \r\n // print the tree in preorder fashion\r\n System.out.print(\"Preorder Traversal of the constructed tree is: \");\r\n preorderTraversal(root);\r\n }",
"static void preOrderTraversalStackOptimised(Node root) {\n Stack<Node> stack = new Stack<>();\n Node curr = root;\n while (curr != null || !stack.isEmpty()) {\n\n while (curr != null) {\n System.out.print(curr.data + \" \");\n if (curr.right != null) {\n stack.push(curr.right);\n }\n curr = curr.left;\n }\n\n if (!stack.isEmpty()) {\n curr = stack.pop();\n }\n }\n }",
"public List<T> preorder() {\n ArrayList<T> list = new ArrayList<T>();\n if (root != null) {\n list.add(root.getData());\n preorderHelper(list, root);\n }\n return list;\n }",
"private void preOrder(int node, int[] parents) {\n currTour.add(node + 1);\n Queue<Integer> children = findChildren(node, parents);\n while(!children.isEmpty()) {\n preOrder(children.remove(), parents);\n }\n }",
"public void preOrder(Node localRoot)\r\n\t{\r\n\t\tif(localRoot != null)\r\n\t\t{\r\n\t\t\tSystem.out.print(localRoot.data+\" \");\r\n\t\t\tpreOrder(localRoot.leftChild);\r\n\t\t\tpreOrder(localRoot.rightChild);\r\n\t\t}\r\n\t}",
"public void printPreorder() {\n System.out.print(\"preorder:\");\n printPreorder(overallRoot);\n System.out.println();\n }",
"private void preOrderTraversal(StringBuilder sb) {\n sb.append(data + \" \");\n\n if (left != null) {\n left.preOrderTraversal(sb);\n }\n\n if (right != null) {\n right.preOrderTraversal(sb);\n }\n }",
"public static void preorderBinaryTree(BinaryTreeNode t) {\n p = t;\r\n top = -1;\r\n i = 0;\r\n\r\n while (p != null || top != -1) {\r\n if (p != null) {\r\n visitBinTreeNode(p);\r\n\r\n s[++top] = p; //push(p,s)\r\n if (p.getLeftTree() != null) {\r\n p = p.getLeftTree();\r\n } else {\r\n System.out.print(\")\");\r\n i++;\r\n p = p.getRightTree();\r\n }\r\n } else {\r\n do {\r\n q = s[top];\r\n top--;\r\n if (top != -1) {//is s is not empty\r\n BinaryTreeNode newTop = s[top];\r\n rtptr = newTop.getRightTree();\r\n } else {\r\n rtptr = null;\r\n }\r\n } while (top != -1 && q == rtptr);\r\n\r\n p = rtptr;\r\n\r\n if (i < n) {\r\n i++;\r\n System.out.print(\")\");\r\n }\r\n }\r\n }\r\n }",
"public void printTreePreOrder(Node node)\n {\n if (node == null)\n {\n return;\n }\n\n System.out.print(node.item + \" \");\n printTreePreOrder(node.left);\n printTreePreOrder(node.right);\n\n }",
"private void preorderTraverseForToString(Node node) {\n\t\tif (node == null)\n\t\t\treturn;\n\n\t\tthis.order += node + \"\\n\";\n\n\t\t// walk trough left sub-tree\n\t\tpreorderTraverseForToString(node.left);\n\t\t// walk trough right sub-tree\n\t\tpreorderTraverseForToString(node.right);\n\t}",
"void printPreorder(Node node) {\n if (node == null)\n return;\n\n /* first print data of node */\n System.out.print(node.key + \" \");\n\n /* then recur on left sutree */\n printPreorder(node.left);\n\n /* now recur on right subtree */\n printPreorder(node.right);\n }",
"void preOrder(Node Node) {\n if (Node != null) {\n System.out.print(Node.key + \" \");\n preOrder(Node.left);\n preOrder(Node.right);\n }\n }",
"private void buildTreeTraversals(BinaryNode parent, List<E> inOrder, List<E> preOrder, Boolean onLeft){\n if (!(inOrder.size() <= 0 || preOrder.size() <= 0)) {\n BinaryNode newParent;\n if (parent == null) {\n root = new BinaryNode<>(preOrder.get(0), null, null, null);\n newParent = root;\n } else{\n newParent = new BinaryNode<>(preOrder.get(0), null, null, parent);\n if (onLeft) parent.left = newParent;\n else parent.right = newParent;\n }\n\n List<E> inOrderL = split(inOrder, preOrder.get(0), true);\n List<E> inOrderR = split(inOrder, preOrder.get(0), false);\n List<E> preOrderL = preOrder.subList(1, inOrderL.size() + 1);\n List<E> preOrderR = preOrder.subList(inOrderL.size() + 1, preOrder.size());\n buildTreeTraversals(newParent, inOrderL, preOrderL, true);\n buildTreeTraversals(newParent, inOrderR, preOrderR, false);\n }\n }",
"public void printPreorder() {\n if (myRoot == null) {\n System.out.println(\"(empty tree)\");\n } else {\n myRoot.printPreorder();\n System.out.println();\n }\n }",
"public void printPreorder() {\n if (myRoot == null) {\n System.out.println(\"(empty tree)\");\n } else {\n myRoot.printPreorder();\n System.out.println();\n }\n }",
"static ArrayList<Integer> preorder(Node root)\n {\n ArrayList<Integer> output_arr=new ArrayList<>();\n if(root==null){\n return null;\n }\n Stack<Node> stack=new Stack<>();\n stack.add(root);\n \n while(!stack.isEmpty()){\n Node currentnode=stack.pop();\n output_arr.add(currentnode.data);\n if(currentnode.right!=null){\n stack.add(currentnode.right);\n }\n if(currentnode.left!=null){\n stack.add(currentnode.left);\n }\n \n }\n return output_arr;\n }",
"public void inorder()\n {\n inorderRec(root);\n }",
"@Override\r\n\tpublic List<Node<T>> getInOrderTraversal() {\r\n\t\tList<Node<T>> lista = new LinkedList<Node<T>>();// Lista para el\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// recursivo\r\n\t\tlista = auxiliarRecorridoIn(raiz, lista, raiz);\r\n\t\treturn lista;\r\n\t}",
"public static List<TreeNode> preOrderIterative(TreeNode rootNode) {\n\t\tList<TreeNode> output = new ArrayList<>();\n\t\tStack<TreeNode> stack = new Stack<TreeNode>();\n\t\tif (rootNode == null) {\n\t\t\treturn output;\n\t\t}\n\t\tstack.push(rootNode);\n\t\twhile (!stack.empty()) {\n\t\t\tTreeNode node = stack.pop();\n\t\t\toutput.add(node);\n\t\t\tif (node.right != null)\n\t\t\t\tstack.push(node.right);\n\t\t\tif (node.right != null)\n\t\t\t\tstack.push(node.left);\n\t\t}\n\t\treturn output;\n\t}",
"ArrayList<Integer> preOrder(Node root)\n {\n // Code\n ArrayList<Integer> result = new ArrayList<Integer>();\n\n if (root == null) {\n return null;\n }\n Stack<Node> stack = new Stack<Node>();\n stack.push(root);\n // Node newNode = root;\n\n while (stack.empty() == false) {\n Node mynode = stack.peek();\n result.add(mynode.data);\n //System.out.print(mynode.data + \" \");\n stack.pop();\n\n if (mynode.right != null) {\n stack.push(mynode.right);\n }\n if(mynode.left != null){\n stack.push(mynode.left);\n }\n\n }\n return result;\n }",
"public void buildTreeTraversals(E[] inOrder, E[] preOrder) {\n\n if (inOrder.length <= 0 || preOrder.length <= 0) System.out.println(\"Empty In-order or pre-order list given, silly goose!\");\n else {\n\n List<E> preorder = new ArrayList<>();\n List<E> inorder = new ArrayList<>();\n for (int i = 0; i < preOrder.length; i++) {\n preorder.add(preOrder[i]);\n inorder.add(inOrder[i]);\n }\n buildTreeTraversals(null, inorder, preorder, true);\n }\n }",
"private void preOrder(BSTNode<K,V> node, List<Entry<K,V>> list) throws NullPointerException {\n\t\tif (root == null) {\n\t\t\tthrow new NullPointerException();\n\t\t}\n\t\tif (root != null) {\n\t\t\tlist.add(new Entry<K,V>(node.key, node.value));\n\t\t\t\n\t\t\tif (node.left != null) {\n\t\t\t\tpreOrder(node.left, list);\n\t\t\t}\n\t\t\t\n\t\t\tif (node.right != null) {\n\t\t\t\tpreOrder(node.right, list);\n\t\t\t}\n\t\t}\n\t}",
"public ArrayList<Integer> preorderTraversal(TreeNode root) {\n ArrayList<Integer> list = new ArrayList<>();\n Stack<TreeNode> stack = new Stack<>();\n\n if (root == null)\n return list;\n\n stack.push(root);\n list.add(root.val);\n while (!stack.empty()) {\n TreeNode current = stack.peek();\n if (current.left == null && current.right == null) {\n stack.pop();\n }\n\n if (current.left != null) {\n stack.push(current.left);\n list.add(current.left.val);\n current.left = null;\n } else if (current.right != null) {\n stack.push(current.right);\n list.add(current.right.val);\n current.right = null;\n }\n }\n\n return list;\n }",
"public ArrayList<Integer> preorderTraversal(TreeNode a) {\n\n ArrayList<Integer> result = new ArrayList<>();\n\n if (a == null) return result;\n\n Stack<TreeNode> stack = new Stack();\n TreeNode current = a;\n\n // Push the root node onto the stack\n stack.push(current);\n\n while (!stack.isEmpty()) {\n // pop a node off of the stack\n TreeNode node = stack.pop();\n result.add(node.val);\n\n // push the right and left nodes onto the stack\n if (node.right != null) {\n stack.push(node.right);\n }\n\n if (node.left != null) {\n stack.push(node.left);\n }\n }\n\n return result;\n }"
] | [
"0.8698069",
"0.85139006",
"0.85139006",
"0.83053946",
"0.8178513",
"0.8127014",
"0.80881226",
"0.8082901",
"0.8057734",
"0.801996",
"0.7943258",
"0.7921807",
"0.790939",
"0.7873538",
"0.7854395",
"0.7826006",
"0.78218764",
"0.7817202",
"0.78084314",
"0.7804781",
"0.7794548",
"0.778486",
"0.7761677",
"0.7714261",
"0.76974714",
"0.76711106",
"0.7663726",
"0.76535684",
"0.7651417",
"0.7648797",
"0.7646236",
"0.76247966",
"0.76199716",
"0.7609456",
"0.7603688",
"0.75895005",
"0.7581469",
"0.75063336",
"0.7493202",
"0.748835",
"0.7477717",
"0.7477618",
"0.7474873",
"0.74734837",
"0.7470165",
"0.7427287",
"0.741233",
"0.74076855",
"0.73956424",
"0.73938805",
"0.7364147",
"0.7331381",
"0.73280054",
"0.73212606",
"0.7319721",
"0.731347",
"0.729079",
"0.72867656",
"0.7274403",
"0.72695816",
"0.72576624",
"0.72552025",
"0.72462547",
"0.72379404",
"0.7232104",
"0.72300637",
"0.7229758",
"0.7212915",
"0.7211063",
"0.7196634",
"0.7194821",
"0.719352",
"0.71877295",
"0.71813685",
"0.71685475",
"0.71606797",
"0.71481144",
"0.71406907",
"0.7122577",
"0.7115503",
"0.71083355",
"0.7092084",
"0.7080804",
"0.7073518",
"0.7068912",
"0.7054058",
"0.7053528",
"0.70408314",
"0.7037189",
"0.70368916",
"0.70321476",
"0.70321476",
"0.7028727",
"0.70251817",
"0.70083284",
"0.7003653",
"0.69932437",
"0.69847655",
"0.6982843",
"0.6982354",
"0.69744825"
] | 0.0 | -1 |
Iterative solution, Time complexity O(n), space complexity O(n). same solution using one Queue. | public boolean isSymmetric(TreeNode root) {
if (root == null) return true;
Queue<TreeNode> ql = new LinkedList<>();
Queue<TreeNode> qr = new LinkedList<>();
ql.add(root.left);
qr.add(root.right);
while (!ql.isEmpty() && !qr.isEmpty()) {
TreeNode l = ql.remove();
TreeNode r = qr.remove();
if (l == null && r == null) continue;
if (l == null || r == null) return false;
if (l.val != r.val) return false;
ql.add(l.left);
ql.add(l.right);
qr.add(r.right);
qr.add(r.left);
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void popCostlyOperation(){\r\n Queue<Integer> queue=new LinkedList<>();\r\n Queue<Integer> supportQueue=new LinkedList<>();\r\n for(int i=0;i<10;++i){\r\n while(!queue.isEmpty())\r\n supportQueue.add(queue.poll());\r\n\r\n queue.add(i*i);\r\n while(!supportQueue.isEmpty())\r\n queue.add(supportQueue.poll());\r\n\r\n System.out.println(queue);\r\n System.out.println();\r\n }\r\n\r\n\r\n System.out.println(\"The pop operation\");\r\n while(!queue.isEmpty()){\r\n System.out.println(queue);\r\n while(!queue.isEmpty())supportQueue.add(queue.poll());\r\n System.out.println(supportQueue.poll());\r\n while(!supportQueue.isEmpty())queue.add(supportQueue.poll());\r\n }\r\n\r\n }",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int T = sc.nextInt();\n for(int i = 0 ; i < T; i++) {\n int n = sc.nextInt();\n int a = sc.nextInt();\n int b = sc.nextInt();\n PriorityQueue<Integer> queue = new PriorityQueue<Integer>();\n int[][] m = new int[n][n];\n //n^2 * log(n)\n for(int row = 0; row < n; row++) {\n for(int col = 0; col < n; col++) {\n if(row == 0 && col == 0 && n != 1) {\n continue;\n }else if(row == 0) {\n m[row][col] = m[row][col - 1] + a;\n }else if(col == 0) {\n m[row][col] = m[row-1][col] + b;\n }else {\n m[row][col] = m[row-1][col-1] + a + b;\n }\n\n if(row + col == (n -1)) {\n pool.add(m[row][col]); //log(n)\n }\n }\n }\n //O(n*log(n))\n for (Integer item:pool) {\n queue.add(item); //O(logn)\n }\n while(!queue.isEmpty()) {\n System.out.print(queue.poll() + \" \"); //O(1)\n }\n System.out.println();\n queue.clear();\n pool.clear();\n }\n }",
"public int solution(List<Integer> queue) throws Exception {\n Map<Integer, Integer> queuePositions = IntStream.range(0, queue.size())\n .boxed()\n .collect(toMap(queue::get, i -> i));\n\n int numOfBribes = 0;\n int fixQueueIndex = 0;\n Map<Integer, Integer> bribeMap = new HashMap<>();\n\n while (fixQueueIndex < queue.size()) {\n int nextIndex = queuePositions.get(fixQueueIndex + 1);\n\n boolean isAtRightPosition = nextIndex == fixQueueIndex;\n\n while(!isAtRightPosition) {\n queuePositions.put(queue.get(nextIndex), nextIndex - 1);\n queuePositions.put(queue.get(nextIndex - 1), nextIndex );\n\n Collections.swap(queue, nextIndex - 1, nextIndex);\n\n Integer briber = queue.get(nextIndex);\n numOfBribes++;\n\n if(bribeMap.containsKey(briber)) {\n bribeMap.put(briber, bribeMap.get(briber) + 1);\n } else {\n bribeMap.put(briber, 1);\n }\n if(bribeMap.get(briber) > 2) {\n System.out.println(\"Too Chaotic\");\n return -1;\n }\n\n nextIndex--;\n\n isAtRightPosition = nextIndex == fixQueueIndex;\n }\n\n fixQueueIndex++;\n }\n\n return numOfBribes;\n }",
"public static void main(String[] args) throws IOException{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n int n = Integer.parseInt(br.readLine());\n Queue<Integer> queue = new LinkedList<Integer>();\n for(int i=1;i<=n;i++) {\n queue.offer(i);\n }\n while(queue.size() != 1) {\n queue.remove();\n queue.offer(queue.poll());\n }\n System.out.println(queue.poll());\n }",
"public static void pushCostlyOperation(){\r\n Queue<Integer> queue=new LinkedList<>();\r\n Queue<Integer> supportQueue=new LinkedList<>();\r\n Queue<Integer> testQueue=new LinkedList<>();\r\n for(int i=0;i<10;++i){\r\n while(!queue.isEmpty())\r\n supportQueue.add(queue.poll());\r\n\r\n queue.add(i*i);\r\n testQueue.add(i*i);\r\n while(!supportQueue.isEmpty())\r\n queue.add(supportQueue.poll());\r\n\r\n System.out.println(queue);\r\n System.out.println(testQueue);\r\n System.out.println();\r\n }\r\n }",
"private Queue<Integer> breadthSearch(int i, int j, Queue<Integer> queue, Queue<Integer> path) {\n while(queue.size() != 0) {\n queue.poll();\n }//while\n return new LinkedList();\n }",
"public interface Queue {\n /***** Setting class functions *******/\n\n /* Add element to end of queue function\n * PRE: elem != null && queue != null\n * POST: queue[size] = elem && size` = size + 1 && other imutabled\n */\n void enqueue(Object elem);\n\n /* Delete and return first element in queue function\n * PRE: size > 0\n * POST: R = queue[0] && queue[i] = queue[i + 1] && size` = size - 1 && other imutabled\n */\n Object dequeue();\n\n /* Add element to begin of queue\n * PRE: elem != null\n * POST: queue[i] = queue[i - 1](size >= i > 0) && queue[0] = elem && size` = size + 1 && other imutabled\n */\n void push(Object elem);\n\n /* Delete and return last element in queue function\n * PRE: size > 0\n * POST: R = queue[size - 1] && size` = size - 1 && other imutabled\n */\n Object remove();\n\n /***** Getting class functions *******/\n\n /* Get first element of queue function\n * PRE: size > 0\n * POST: R = queue[0] && all elements imutabled\n */\n Object element();\n\n /* Get last element of queue function\n * PRE: size > 0\n * POST: R = queue[size - 1] && all elements imutabled\n */\n Object peek();\n\n /* Get size function\n * PRE: True\n * POST: R = size && all imutabled\n */\n int size();\n\n /* Check for empty queue function\n * PRE: True\n * POST: R = (size == 0) && all imutabled\n */\n boolean isEmpty();\n\n /* Delete all elements from queue function\n * PRE: True\n * POST: size = 0\n */\n void clear();\n\n /******* Modification *******/\n /* Create queue with elements like predicate\n * PRE: correct predicate && queue != null\n * POST: all imutabled && R = {R[0]...R[new_size] : new_size <= size && predicate(R[i]) = 1 && R - the same type of queue}\n * : && exist sequence i[0] ... i[k] (i[0] < ... < i[k]) : R[it] = queue[i[it]](0 <= it < k) && k - max\n */\n Queue filter(Predicate predicate);\n\n /* Create queue with elements like predicate\n * PRE: correct function && queue != null\n * POST: all imutabled && R = {y[i] | y[i] = function(queue[i])} size(R) = size(queue) && R is the same type of queue\n */\n Queue map(Function function);\n}",
"public int solution(int[] A) {\n ArrayList<Integer> fibonacci = new ArrayList<>();\n\n fibonacci.add(0); // note: f(0) = 0 (as in the quesion)\n fibonacci.add(1);\n // note: using \"while\" is better than \"for\" (avoid errors)\n\n while (true) {\n int temp1 = fibonacci.get(fibonacci.size() - 1);\n int temp2 = fibonacci.get(fibonacci.size() - 2);\n\n fibonacci.add(temp1 + temp2);\n\n // if already bigger than length, then break;\n if (temp1 + temp2 > A.length) {\n break;\n }\n }\n\n // reverse \"List\": from big to small\n Collections.reverse(fibonacci);\n\n // use \"queue\" with \"point\"\n // point(x,y) = point(\"position\", \"number of steps\")\n ArrayList<Point> queue = new ArrayList<>();\n\n queue.add(new Point(-1, 0)); // position:-1, steps:0\n\n // index: the current index for queue element\n int index = 0;\n while (true) {\n // cannot take element from queue anymore\n if (index == queue.size()) {\n return -1;\n }\n\n // take element from queue\n Point current = queue.get(index);\n\n // from big to small\n for (Integer n : fibonacci) {\n int nextPosition = current.x + n;\n\n // case 1: \"reach the other side\"\n if (nextPosition == A.length) {\n // return the number of steps\n return current.y + 1;\n }\n\n // case 2: \"cannot jump\"\n // note: nextPosition < 0 (overflow, be careful)\n else if ((nextPosition > A.length) || (nextPosition < 0) || (A[nextPosition] == 0)) {\n // note: do nothing\n }\n\n // case 3: \"can jump\" (othe cases)\n else {\n // jump to next position, and step+1\n Point temp = new Point(nextPosition, current.y + 1);\n // add to queue\n queue.add(temp);\n\n A[nextPosition] = 0; // key point: for high performance~!!\n }\n }\n\n index++; // take \"next element\" from queue\n }\n }",
"public static void main(String[] args) throws NumberFormatException, IOException {\n\r\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\r\n\t\tint T = Integer.parseInt(br.readLine());\r\n\t\tStringTokenizer st;\r\n\t\tfor (int test_case = 1; test_case <= T; test_case++) {\r\n\t\t\tst = new StringTokenizer(br.readLine());\r\n\t\t\tN = Integer.parseInt(st.nextToken());\r\n\t\t\tK = Integer.parseInt(st.nextToken());\r\n\t\t\tst = new StringTokenizer(br.readLine());\r\n\t\t\tlist = new ArrayList[N + 1];\r\n\t\t\tfor (int i = 1; i <= N; i++) {\r\n\t\t\t\tlist[i] = new ArrayList<Integer>();\r\n\t\t\t}\r\n\t\t\tfor (int i = 1; i <= N; i++) {\r\n\t\t\t\tint k = Integer.parseInt(st.nextToken());\r\n\t\t\t\tlist[k].add(i);\r\n\t\t\t}\r\n//\t\t\tfor (int i = 1; i <= N; i++) {\r\n//\t\t\t\tfor (int j = 0; j < list[i].size(); j++)\r\n//\t\t\t\t\tSystem.out.print(i + \", \" + list[i].get(j) + \" \");\r\n//\t\t\t}\r\n//\t\t\tSystem.out.println();\r\n\r\n\t\t\tQueue<Integer> q;\r\n//\t\t\tfor(int i = 1; i<=N;i++) {\r\n//\t\t\t\tif(list[i].size()==0) {\r\n//\t\t\t\t\tq.add(i);\r\n//\t\t\t\t}\r\n//\t\t\t}\r\n\t\t\tint visited[];\r\n\t\t\tint answer = 0;\r\n\t\t\tfor (int i = 1; i <= N; i++) {// 각 굴에 대해서 인원 센다\r\n\t\t\t\tq = new LinkedList<Integer>();\r\n\t\t\t\tvisited = new int[N + 1];\r\n\t\t\t\tint count = K;\r\n//\t\t\t\tfor (int j = 1; j < K; j++) {// 지날 수 있는 굴의 최대갯수 K\r\n\t\t\t\tif (list[i].size() < 1) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tint idx;\r\n\t\t\t\tfor (int u = 0; u < list[i].size(); u++) {\r\n\t\t\t\t\tidx = list[i].get(u);\r\n\t\t\t\t\tq.add(idx);\r\n\t\t\t\t}\r\n\t\t\t\twhile (count > 0 && !q.isEmpty()) {\r\n\t\t\t\t\tidx = q.poll();\r\n\r\n\t\t\t\t\tfor (int m = 0; m < list[idx].size(); m++) {\r\n\r\n\t\t\t\t\t\tint dd = list[idx].get(m);\r\n\t\t\t\t\t\tif (visited[dd] == 0 && dd != i) {\r\n\t\t\t\t\t\t\tvisited[dd] = 1;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tq.add(list[idx].get(m));\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcount--;\r\n\r\n\t\t\t\t}\r\n//\t\t\t\t}\r\n\t\t\t\tfor (int e = 1; e <= N; e++) {\r\n\t\t\t\t\tif (visited[e] == 1)\r\n\t\t\t\t\t\tanswer++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tSystem.out.println(\"#\" + test_case + \" \" + answer);\r\n\r\n\t\t}\r\n\r\n\t}",
"k value.\nFor 2nd tallest group (and the rest), insert each one of them into (S) by k value. So on and so forth.\n\npublic class Solution {\n public int[][] reconstructQueue(int[][] people) {\n Arrays.sort(people,new Comparator<int[]>() {\n @Override\n public int compare(int[] o1, int[] o2){\n return o1[0] != o2[0]? -o1[0] + o2[0]: o1[1] - o2[1];\n }\n });\n\n List<int[]> res = new ArrayList<>();\n for (int[] cur : people) {\n res.add(cur[1], cur); \n }\n return res.toArray(new int[people.length][]);\n }",
"public static void main(String[] args) {\n Queue<Queue<Integer>> queues = new Queue<>(QUEUE_COUNT);\n // create and insert game queues\n for (int i = 0; i < QUEUE_COUNT; i++) {\n // our capacity is 7\n Queue<Integer> q = new Queue<>(QUEUE_CAPACITY);\n queues.enqueue(q);\n }\n\n boolean turn = true; // true -> player 1, false -> player 2\n boolean allFull;\n while (true) {\n allFull = true; // reset\n\n // user plays\n int randomQueue = randQueue();\n int randomNumber = randNumber();\n\n // if random selected queue is full, select another\n while (queues.elementAt(randomQueue).isFull())\n randomQueue = randQueue();\n\n // enqueue number to selected queue\n queues.elementAt(randomQueue).enqueue(randomNumber);\n\n // print current state to screen\n System.out.println(\"\\nUser\" + (turn ? 1 : 2) + \":\");\n for (int qi = 0; qi < QUEUE_COUNT; qi++) {\n Queue<Integer> q = queues.elementAt(qi);\n System.out.println(\"Q\" + (qi + 1) + \" \" + q.toString());\n }\n\n // SEQUENCES\n // =========\n\n // flag for indicating if any sequence is encountered during search\n boolean hasSequence = false;\n\n // HORIZONTAL SEQUENCES\n for (int i = 0; i < QUEUE_COUNT; i++) {\n Queue<Integer> q = queues.elementAt(i);\n if (q.size() < 3)\n continue;\n\n for (int j = 1; j < q.size() - 1; j++) {\n // skip first and last element and check through windows across queue, sized 3\n if (isSequence(q.elementAt(j - 1), q.elementAt(j), q.elementAt(j + 1))) {\n hasSequence = true;\n break;\n }\n }\n\n // already found a sequence? stop.\n if (hasSequence)\n break;\n }\n\n // no need to play further or check the terminal conditions\n if (hasSequence) {\n allFull = false;\n break;\n }\n\n // VERTICAL SEQUENCES\n\n // find smallest queue\n int minLength = 999;\n for (int i = 0; i < QUEUE_COUNT; i++)\n if (queues.elementAt(i).size() < minLength)\n minLength = queues.elementAt(i).size();\n\n for (int i = 0; i < minLength; i++) {\n if (isSequence(queues.elementAt(0).elementAt(i), queues.elementAt(1).elementAt(i), queues.elementAt(2).elementAt(i))) {\n hasSequence = true;\n break;\n }\n }\n\n if (hasSequence) {\n allFull = false;\n break;\n }\n\n // are queues full?\n for (int i = 0; i < QUEUE_COUNT; i++) {\n allFull = allFull && queues.elementAt(i).isFull();\n }\n\n if (allFull) {\n break;\n }\n\n turn = !turn;\n }\n\n System.out.println();\n if (allFull) {\n System.out.println(\"Tie!\");\n } else {\n System.out.println(\"winner: User\" + (turn ? 1 : 2));\n }\n }",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tQueue<Point> que = new LinkedList<>();\n\t\tn = sc.nextInt();\n\t\tm = sc.nextInt();\n\t\tint result=0;\n\t\tboolean b = true;\n\t\tint [][] arr = new int[m][n];\n\t\tfor(int i=0;i<m;i++) {\n\t\t\tfor(int j=0;j<n;j++) {\n\t\t\t\tarr[i][j] = sc.nextInt();\n\t\t\t\tif(arr[i][j]==1) {\n\t\t\t\t\tque.add(new Point(i,j,0));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\twhile(!que.isEmpty()) {\n\t\t\tPoint temp = que.poll();\n\t\t\tfor(int i=0;i<4;i++) {\n\t\t\t\tint r = temp.x+dirs[i][0];\n\t\t\t\tint c = temp.y+dirs[i][1];\n\t\t\t\tif(isin(r,c) && arr[r][c]==0) {\n\t\t\t\t\tarr[r][c] = 1;\n\t\t\t\t\tque.add(new Point(r,c,temp.cnt+1));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(que.isEmpty()) {\n\t\t\t\tresult = temp.cnt;\n\t\t\t}\n\t\t}\n\t\tfor(int i=0;i<m;i++) {\n\t\t\tfor(int j=0;j<n;j++) {\n\t\t\t\tif(arr[i][j]==0) {\n\t\t\t\t\tb = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(b) {\n\t\t\tSystem.out.println(result);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t}",
"public void move(){\n\t\tint y, z;\n\t\t\n\t\tif(queueArrayGetValue(1) == null && (queueArrayGetValue(2) == null || queueArrayGetValue(3) == null)){\n\t\t\tif(queueArrayGetValue(2) == null && queueArrayGetValue(3) != null){\n\t\t\t\tqueueArraySetKeyValue(1, queueArrayGetKey(3), queueArrayGetValue(3));\n\t\t\t\tqueueArraySetKeyValue(3, null, null);\n\t\t\t}else if(queueArrayGetValue(2) != null && queueArrayGetValue(3) == null){\n\t\t\t\tqueueArraySetKeyValue(1, queueArrayGetKey(2), queueArrayGetValue(2));\n\t\t\t\tqueueArraySetKeyValue(2, null, null);\n\t\t\t}\n\t\t}else{\n\t\t\touterloop:\n\t\t\tfor(int i = 1; i < queueArrayLength(); i++){\n\t\t\t\tif(queueArrayGetValue(i) == null){\n\t\t\t\t\ty = i * 2;\n\t\t\t\t\tz = i * 2 + 1;\n\t\t\t\t\tif(y >= queueArrayLength()){\n\t\t\t\t\t\tbreak outerloop;\n\t\t\t\t\t}else if(z >= queueArrayLength()){\n\t\t\t\t\t\tqueueArraySetKeyValue(i, queueArrayGetKey(y), queueArrayGetValue(y));\n\t\t\t\t\t\tqueueArraySetKeyValue(y, null, null);\n\t\t\t\t\t\tbreak outerloop;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif(lessThan(y,z)){\n\t\t\t\t\t\t\tqueueArraySetKeyValue(i, queueArrayGetKey(y), queueArrayGetValue(y));\n\t\t\t\t\t\t\tqueueArraySetKeyValue(y, null, null);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tqueueArraySetKeyValue(i, queueArrayGetKey(z), queueArrayGetValue(z));\n\t\t\t\t\t\t\tqueueArraySetKeyValue(z, null, 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}",
"static Queue<Integer> reverseQueueUsingRecursion(Queue<Integer> queue)\n {\n int data;\n if (queue.isEmpty())\n {\n return queue;\n }\n else\n {\n data = queue.poll();\n //queue.remove();\n queue = reverseQueueUsingRecursion(queue);\n queue.add(data);\n return queue;\n }\n }",
"public static LinkedQueue makeQueueOfQueues(LinkedQueue q) {\n // Replace the following line with your solution.\n LinkedQueue overall = new LinkedQueue();\n while (!q.isEmpty())\n {\n try \n {\n LinkedQueue single = new LinkedQueue();\n single.enqueue(q.dequeue());\n overall.enqueue(single);\n } \n catch (QueueEmptyException e) \n {\n // TODO Auto-generated catch block\n e.printStackTrace();\n } \n }\n \n return overall;\n }",
"public static void main(String args[]) throws Exception\t{\n Scanner sc = new Scanner(new FileInputStream(\"disposal_sample.txt\"));\n\n int T = sc.nextInt();\n for(int test_case = 0; test_case < T; test_case++) {\n\n int N = sc.nextInt();\n int M = sc.nextInt();\n\n\n int[] d = new int[N];\n Queue<Integer> Q = new LinkedList<>();\n int sum = 0;\n int len = 10000;\n\n\n for(int i=0;i<N;i++){\n int input = sc.nextInt();\n Q.add(input);\n sum += input;\n while(sum >= M){\n int size = Q.size();\n\n if(len > size)\n len = size;\n sum -= Q.remove();\n }\n }\n if(len == 10000)\n len = 0;\n\n\n /*\n for(int i=0;i<N;i++) {\n d[i] = sc.nextInt();\n }\n int front = 0;\n int back = 0;\n int sum = d[back];\n int len = Integer.MAX_VALUE;\n\n while(true) {\n\n if(sum < M){\n if(back == N-1)\n break;\n back++;\n sum += d[back];\n\n }\n else{\n if(front == back){\n len = 1;\n break;\n }\n\n int tempLen = (back - front)+1;\n if(len > tempLen) {\n len = tempLen;\n }\n sum -= d[front];\n front++;\n }\n\n }*/\n Answer = len;\n System.out.println(\"Case #\"+(test_case+1));\n System.out.println(Answer);\n }\n }",
"public interface Queue {\n\tpublic Set getGatheredElements();\n\tpublic Set getProcessedElements();\n\tpublic int getQueueSize(int level);\n\tpublic int getProcessedSize();\n\tpublic int getGatheredSize();\n\tpublic void setMaxElements(int elements);\n\tpublic Object pop(int level);\n\tpublic boolean push(Object task, int level);\n\tpublic void clear();\n}",
"public static void main(String[] args) {\n\t\tScanner sc= new Scanner(System.in);\r\n\t\tSystem.out.println(\"Enter the number of queens\");\r\n\t\tint n=sc.nextInt();\r\n\t\tint[] X= new int[n];\r\n\t\tint k=0;\r\n\t\tfor(int i=0;i<n;i++) {\r\n\t\t\tX[i]=0;\r\n\t\t}\r\n\t\twhile(k>=0) {\r\n\t\t\tX[k]=X[k]+1;\r\n\t\t\twhile(X[k]<=n && !place(k,X)) {\r\n\t\t\t\tX[k]=X[k]+1;\r\n\t\t\t}\r\n\t\t\tif(X[k]<=n) {\r\n\t\t\t\tif(k==n-1) {\r\n\t\t\t\t\tfor(int m=0;m<n;m++) {\r\n\t\t\t\t\t\tSystem.out.print(X[m]+\" \");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tk=k+1;\r\n\t\t\t\t\tX[k]=0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tk=k-1;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in, \"utf-8\");\n CircularLinkedList<String> q = new CircularLinkedList<String>();\n while (sc.hasNext()) {\n q.append(sc.next());\n System.out.println(\"Elements in queue:\\t\\t\\t\" + q);\n System.out.println(\"Number of elements in queue:\\t\\t\" + q.size());\n }\n while (! q.isEmpty()) {\n System.out.println(\"Returned element from queue:\\t\\t\" + q.getFirst());\n System.out.println(\"Elements in queue:\\t\\t\\t\" + q);\n System.out.println(\"Number of elements in queue:\\t\\t\" + q.size());\n }\n\n sc = new Scanner(System.in, \"utf-8\");\n while (sc.hasNext()) {\n q.prepend(sc.next());\n System.out.println(\"Elements in queue:\\t\\t\\t\" + q);\n System.out.println(\"Number of elements in queue:\\t\\t\" + q.size());\n }\n while (! q.isEmpty()) {\n System.out.println(\"Returned element from queue:\\t\\t\" + q.getLast());\n System.out.println(\"Elements in queue:\\t\\t\\t\" + q);\n System.out.println(\"Number of elements in queue:\\t\\t\" + q.size());\n }\n }",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tStack<Integer> st = new Stack<Integer>();\n\t\tQueue<Integer> que = new LinkedList<Integer>();\n\t\tArrayList<Integer> path = new ArrayList<>();\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint v = sc.nextInt();\n\t\tint [][] arr= new int [n+1][n+1];\n\t\tboolean [] visit = new boolean[n+1];\n\t\tfor(int i=0;i<m;i++) {\n\t\t\tint a = sc.nextInt();\n\t\t\tint b = sc.nextInt();\n\t\t\tarr[a][b] = 1;\n\t\t\tarr[b][a] = 1;\n\t\t}\n\t\tst.push(v);\n\t\twhile(!st.isEmpty()) {\n\t\t\tint temp = st.pop();\n\t\t\tif(visit[temp]) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tpath.add(temp);\n\t\t\tvisit[temp] = true;\n\t\t\tfor(int i=n;i>0;i--) {\n\t\t\t\tif(arr[temp][i]==1 && !visit[i]) {\n\t\t\t\t\tst.push(i);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=0;i<path.size();i++) {\n\t\t\tSystem.out.print(path.get(i)+\" \");\n\t\t}\n\t\tSystem.out.println();\n\t\tArrays.fill(visit, false);\n\t\tpath = new ArrayList<>();\n\t\tque.add(v);\n\t\twhile(!que.isEmpty()) {\n\t\t\tint temp = que.poll();\n\t\t\tif(visit[temp]) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tpath.add(temp);\n\t\t\tvisit[temp] = true;\n\t\t\tfor(int i=1;i<=n;i++) {\n\t\t\t\tif(arr[temp][i]==1 && !visit[i]) {\n\t\t\t\t\tque.add(i);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=0;i<path.size();i++) {\n\t\t\tSystem.out.print(path.get(i)+\" \");\n\t\t}\n\t}",
"public static void Operation(int q) {\n\t\tScanner scan=new Scanner(System.in);\n\t\tString str;\n\t\tfor (int i = 0; i < q; i++)\n\t\t{\n\t\t\tstr=scan.nextLine();\n\t\t\tif(str.contains(\"PUSH\"))\n\t\t\t{\n\t\t\t\tString[] op=str.split(\" \");\n\t\t\t\tInteger x=Integer.valueOf(op[1]);\n\t\t\t\tfor (int j = 0; j < op.length; j++) {\n\t\t\t\t\tSystem.out.println(j+\" \"+op[j]);\n\t\t\t\t}\n\t\t\t\tSystem.out.println(x);\n\t\t\t\tqueue.add(x);\n\t\t\t\t\n\t\t\t}else if(str.equals(\"TOP\"))\n\t\t\t{\n\t\t\t\tif(queue.size()==0)\n\t\t\t\t\tSystem.out.println(\"-1\");\n\t\t\t\telse\n\t\t\t\t\tqueue.iterator();\n\t\t\t}else if(str.equals(\"POP\")){\n\t\t\t\tif(queue.size()==0)\n\t\t\t\t\tSystem.out.println(\"-1\");\n\t\t\t\telse\n\t\t\t\t\tqueue.remove();\n\t\t\t}\n\t\t\telse if(str.equals(\"SIZE\")) {\n\t\t\t\tSystem.out.println(queue.size());\n\t\t\t}else if(str.equals(\"ClEAR\"))\n\t\t\t{\n\t\t\t\tqueue.clear();\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"public static void main(String[] args) {\n Queue<Integer> queue = new LinkedListQueue<>();\n\n for (int i = 0; i < 21; i++) {\n queue.enqueue(i);\n System.out.println(queue);\n }\n\n for (int i = 0; i < 16; i++) {\n queue.dequeue();\n System.out.println(queue);\n }\n System.out.println(queue);\n }",
"void processQueue();",
"void runQueue();",
"public static void main(String[] args) {\n CircleArrayQueue circleArrayQueue = new CircleArrayQueue(4);\n circleArrayQueue.addQueue(1);\n circleArrayQueue.addQueue(2);\n circleArrayQueue.addQueue(3);\n System.out.println(circleArrayQueue.getQueue());\n circleArrayQueue.showQueue();\n// System.out.println(circleArrayQueue.getQueue());\n// System.out.println(circleArrayQueue.getQueue());\n circleArrayQueue.addQueue(4);\n circleArrayQueue.showQueue();\n\n System.out.println(circleArrayQueue.getQueue());\n circleArrayQueue.showQueue();\n\n circleArrayQueue.addQueue(5);\n circleArrayQueue.showQueue();\n System.out.println(circleArrayQueue.getQueue());\n circleArrayQueue.showQueue();\n\n circleArrayQueue.addQueue(5);\n circleArrayQueue.showQueue();\n// System.out.println(circleArrayQueue.getQueue());\n }",
"public interface Queue<T> {\n\n /**\n * Current queue size\n * @return size as int\n */\n int size();\n\n /**\n * Checks if the the queue is empty\n * @return true if the list is empty\n */\n boolean isEmpty();\n\n /**\n * Adding an element to the queue\n * @param t element to add\n */\n void enqueue(T t);\n\n /**\n * Return and removes the first element in the queue\n * @return the removed element\n * @throws IndexOutOfBoundsException if queue is empty\n */\n T dequeue();\n\n /**\n * Return (without removing) first element in queue\n * @return the first element in queue\n * @throws IndexOutOfBoundsException if the queue is empty\n *\n */\n T first();\n\n /**\n * Return (without removing) last element in queue\n * @return last element in queue\n * @throws IndexOutOfBoundsException if the queue is empty\n */\n T last();\n\n /**\n * Return a string representation of the queue content.\n * @return String of queue\n */\n String toString();\n\n /**\n * Element iterator.\n * @return Iterates over elements in queue\n */\n Iterator iterator();\n\n}",
"static int deQueue(Queue q) {\r\n int x;\r\n\r\n /* If both stacks are empty then error */\r\n if (q.stack1.isEmpty() && q.stack2.isEmpty()) {\r\n System.out.println(\"Q is empty\");\r\n System.exit(0);\r\n }\r\n\r\n /*\r\n * Move elements from stack1 to stack 2 only if\r\n * stack2 is empty\r\n */\r\n if (q.stack2.isEmpty()) {\r\n while (!q.stack1.isEmpty()) {\r\n x = pop(q.stack1);\r\n push(q.stack2, x);\r\n }\r\n }\r\n x = pop(q.stack2);\r\n return x;\r\n }",
"@Test\n public void queue() {\n\n Queue<String> q = new LinkedList<>();\n q.offer(\"1\");\n q.offer(\"2\");\n q.offer(\"3\");\n System.out.println(q.offer(\"4\"));\n System.out.println(q.add(\"2\"));\n System.out.println(q.toString());\n System.out.println(\"peek \" + q.peek()); // 1, peek() means get the first element in the queue\n System.out.println(\"size \" + q.size()); // 4\n System.out.println(\"poll \" + q.poll()); // 1\n System.out.println(\"size \" + q.size()); // 3\n\n\n }",
"public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String line = null;\n while (!(line = br.readLine()).equals(\"#\")){\n String[] l = line.split(\" \");\n register(Integer.parseInt(l[1]),Integer.parseInt(l[2]));\n }\n\n int K = Integer.parseInt(br.readLine());\n int size = K * s.size();\n pq = new PriorityQueue<pair<Long, Integer>>(size, new Comparator<pair<Long, Integer>>() {\n @Override\n public int compare(pair<Long, Integer> o1, pair<Long, Integer> o2) {\n return (int)(o1.x- o2.x);\n }\n });\n// System.out.println(K);\n List<Long> list = new ArrayList<Long>();\n for(pair<Integer, Integer> p: s){\n long idx = p.y;\n long limit = (K+1)* (p.y);\n// System.out.println(idx+\"-\"+K);\n while(idx < limit){\n// System.out.println(idx+\"--\"+p.x);\n pq.add(new pair<Long, Integer>(idx, p.x));\n idx += p.y;\n }\n }\n for(int ix = K; ix>0; ix--){\n System.out.println(pq.poll().y);\n }\n // print K times. each time may have differenet queue numbers\n\n// for(pair<Integer, Integer> p: pq){\n// System.out.println(p.toString());\n// }\n }",
"public static void main(String[] args) {\n Queue queue = new Queue();\n // Inserting elements in Circular Queue\n queue.enQueue(24);\n queue.enQueue(94);\n queue.enQueue(6);\n queue.enQueue(18);\n queue.enQueue(20);\n queue.enQueue(19);\n queue.enQueue(11);\n\n // Display elements present in Circular Queue\n queue.displayQueue();\n\n // Deleting elements from Circular Queue\n System.out.println(\"Deleted value = \" + queue.deQueue());\n System.out.println(\"Deleted value = \" + queue.deQueue());\n\n // Remaining elements in Circular Queue\n queue.displayQueue();\n\n queue.enQueue(1);\n queue.enQueue(92);\n queue.displayQueue();\n }",
"public int useQueue(){\t\r\n\t\t//save the top of the queue\r\n\t\tint top = queue[0];\r\n\t\t//move the queue up 1 space\r\n\t\tfor (int x = 0; x < queue.length - 1; x++){\r\n\t\t\tqueue[x] = queue[x+1];\r\n\t\t}\r\n\t\t//generate a new value at the bottom of the queue\r\n\t\tqueue[queue.length-1] = random.nextInt(10);\r\n\t\treturn top;\r\n\t}",
"int minOperations(int[] arr) {\n // Write your code here\n Set<String> set = new HashSet<>();//store visited string\n Queue<String> queue = new LinkedList<>(); // store next strs\n int counter = 0;\n\n queue.offer(getKey(arr));\n set.add(getKey(arr));\n\n while (!queue.isEmpty()) {\n int size = queue.size();\n List<String> curs = new ArrayList<>();\n while (size > 0) {\n curs.add(queue.poll());\n size--;\n }\n\n for(String cur : curs) {\n if (isIncreasing(cur)) {\n return counter;\n }\n\n for(int i = 0; i < cur.length(); i++) {\n String next = reverseString(cur, i);\n if (!set.contains(next)) {\n set.add(next);\n queue.offer(next);\n }\n }\n }\n\n counter++;\n }\n\n return counter;\n }",
"public static void main(String[] args) {\n Queue<QueueData> q1 = new LinkedList<>();\n List<String> testArList = new ArrayList<>();\n testArList.add(0, \"1\");\n for (int i = 0; i < 10; i++){\n // ArrayList의 add와 같은 기능을 가졌다.\n // 하지만, 자료구조의 특성상, 특정 인덱스에 add하는 메소드는 없다.\n q1.add(new QueueData(i, (int) (Math.random() * 1000)));\n }\n System.out.println(q1);\n // peek() : 0번째 인덱스 즉 head에 해당하는 데이터를 살펴본다. 해당 데이터가 없을 경우\n // null이 출력된다. 검색된 데이터는 삭제되지 않고 그대로 남는다.\n System.out.println(q1.peek());\n System.out.println(\"peek\");\n System.out.println(q1);\n\n // element() : peek과 동일한 기능을 가졌지만, 차이점은 해당 데이터가 없을때,\n // 예외처리를 해준다.\n System.out.println(q1.element());\n System.out.println(\"element\");\n System.out.println(q1);\n\n // Enqueue : 추가\n q1.offer(new QueueData(q1.size(), (int) (Math.random() * 1000))); // 실패시 예외발생\n System.out.println(\"offer\");\n System.out.println(q1);\n q1.add(new QueueData(q1.size(), (int) (Math.random() * 1000))); // 실패시 false 리턴\n System.out.println(\"add\");\n System.out.println(q1);\n\n // Dequeue : 삭제\n q1.remove(); // 삭제 실패시, 예외 발생\n System.out.println(\"remove\");\n System.out.println(q1);\n System.out.println(\"poll\");\n q1.poll(); // 실패시 false 리턴\n System.out.println(q1);\n \n // 조건부 삭제\n System.out.println(\"remove if idx % 10 == 0\");\n q1.removeIf(queueData -> queueData.idx % 10 == 0);\n System.out.println(q1);\n\n // priority Queue(우선순위 큐)\n // 가장 가중치가 낮은 순서로 poll, peek()을 할 수 있는 자료구조다.\n // Min Heap로 데이터를 sort 시켜놓고 출력하는 자료구조.\n // 데이터의 크기를 뒤죽박죽 아무렇게 넣어도 의도에 따라 오름차순 혹은 내림차순으로\n // poll(), peek() 할 수 있다.\n Queue<QueueData> pQueue = new PriorityQueue<>();\n pQueue.add(new QueueData(0, (int) (Math.random() * 1000)));\n pQueue.add(new QueueData(9, (int) (Math.random() * 1000)));\n pQueue.add(new QueueData(2, (int) (Math.random() * 1000)));\n pQueue.add(new QueueData(5, (int) (Math.random() * 1000)));\n pQueue.add(new QueueData(4, (int) (Math.random() * 1000)));\n\n System.out.println(pQueue.poll());\n System.out.println(pQueue.poll());\n System.out.println(pQueue.poll());\n System.out.println(pQueue.poll());\n System.out.println(pQueue.remove()); // 더이상 삭제할 수 없을 때, 예외처리(프로그램 종료)\n System.out.println(pQueue.poll()); // 더이상 삭제할 수 없을 때, null 출력\n System.out.println(pQueue.size());\n }",
"public void interleave(Queue<Integer> q) {\n\tif(q.size() % 2 == 1) {\n\t\t\tthrow new IllegalArgumentException();\n\t} // after this point, guaranteed queue is even size\n\tStack<Integer> s = new ArrayStack<Integer>();\n\twhile(!q.isEmpty()) {\n\t\ts.push(q.dequeue());\n\t}\n\twhile(!s.isEmpty()) {\n\t\tq.enqueue(s.pop());\n\t}\n\twhile(!q.isEmpty()) {\n\t\ts.push(q.dequeue());\n\t} // all contents are in original order top-bot inside of stack\n\t// t[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]b\n\tint times = s.size(); // temp for correct bounds\n\tfor(int i = 0; i < times / 2; i++) { // we are splitting by two, so we only iterate 1/2 times\n\t\tq.enqueue(s.pop());\n\t} // after this point, we have queue f[1, 2, 3, 4, 5]b stack t[6, 7, 8, 9, 10]b\n\t// This closely recreates the process described by the spec. \n\t// We can just follow along at this point. The spec says 1 should be right next to 6\n\t// 2 should be right next to 7\n\t// 3 next to 8\n\t// We can see from here that we simply add 1 to the back and add 6 to the back of the queue\n\t// then we add 2 to the back of the queue and 7 to the back of the queue\n\t// then we add 3 back and 8 back\n\t// etc. This can be summarized as\n\t// q.add(q.remove());\n\t// q.add(s.pop());\n\t// And we only want to do this until all are interleaved, which is while !s.empty\n\twhile(!s.isEmpty()) {\n\t\tq.enqueue(q.dequeue());\n\t\tq.enqueue(s.pop());\n\t}\n\t// at this point, interleaved, correct orientation\n}",
"public void breadthFirstSearch(){\n Deque<Node> q = new ArrayDeque<>(); // In an interview just write Queue ? Issue is java 8 only has priority queue, \n // meaning I have to pass it a COMPARABLE for the Node class\n if (this.root == null){\n return;\n }\n \n q.add(this.root);\n while(q.isEmpty() == false){\n Node n = (Node) q.remove();\n System.out.print(n.val + \", \");\n if (n.left != null){\n q.add(n.left);\n }\n if (n.right != null){\n q.add(n.right);\n }\n }\n }",
"void enqueue(int x, int p){\n for(int i=0;i<size;i++){\n if(values[i]==(-1)){\n values[i] = x;\n priorities[i] = p;\n break;\n }\n }\n }",
"static int findFrequency(Queue<Integer> q, int k){\n \n // return Collections.frequency(q, k);\n return (int) q.stream().filter(e-> e== k).count();\n }",
"void dequeue(){\n if(isEmpty()!=1){\n\n for(int i=0;i<size-1;i++){\n values[i] = values[i+1];\n }\n\n values[size-1] = (-1);\n }\n }",
"private void shift(){\n if (queue.length < 1){\n throw new Error(\"Table self destruction!\");\n }\n if (size <= 0){\n return;\n }\n\n if (queue[0] == null){\n E best = null;\n int bestAT = -1;\n for (int x = 0 ; x < queue.length; x++){\n E cur = (E)queue[x];\n if (cur == null){\n continue;\n }\n if (best == null || cur.compareTo(best) > 0){\n best = cur;\n bestAT = x;\n }\n }\n // Not put best at front;\n queue[bestAT] = null;\n queue[0] = best;\n }\n\n }",
"@Test\r\n\tpublic void permutationsTestSize2() throws BoundedQueueException {\r\n\t\tbq.enqueue(1);\r\n\t\tbq.enqueue(2);\r\n\t\tassertEquals(\"Permutations output\",\"[[1, 2], [2, 1]]\",\tbq.permutations().toString());\r\n\t}",
"public static boolean iterativeSolution(TreeNode p, TreeNode q)\n\t{\n\t\tStack<TreeNode> s = new Stack();\n\t\ts.push(p);\n\t\ts.push(q);\n\t\t\n\t\twhile(!s.isEmpty())\n\t\t{\n\t\t\tp = s.pop();\n\t\t\tq = s.pop();\n\t\t\t\n\t\t\tif(p == null && q == null)\n\t\t\t\tcontinue;//terminate this round\n\t\t\tif(p == null || q == null)\n\t\t\t\treturn false;//trim\n\t\t\tif(p.val != q.val)\n\t\t\t\treturn false;//trim\n\t\t\t\n\t\t\ts.push(p.left);\n\t\t\ts.push(q.left);\n\n\t\t\ts.push(p.right);\n\t\t\ts.push(q.right);\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"static boolean checkSorted(int n) \r\n\t{ \r\n\t\tStack<Integer> st = \r\n\t\t\t\t\tnew Stack<Integer>(); \r\n\t\tint expected = 1; \r\n\t\tint fnt; \r\n\t\r\n\t\t// while given Queue \r\n\t\t// is not empty. \r\n\t\twhile (q.size() != 0) \r\n\t\t{ \r\n\t\t\tfnt = q.peek(); \r\n\t\t\tq.poll(); \r\n\t\r\n\t\t\t// if front element is \r\n\t\t\t// the expected element \r\n\t\t\tif (fnt == expected) \r\n\t\t\t\texpected++; \r\n\t\r\n\t\t\telse\r\n\t\t\t{ \r\n\t\t\t\t// if stack is empty, \r\n\t\t\t\t// push the element \r\n\t\t\t\tif (st.size() == 0) \r\n\t\t\t\t{ \r\n\t\t\t\t\tst.push(fnt); \r\n\t\t\t\t} \r\n\t\r\n\t\t\t\t// if top element is less than \r\n\t\t\t\t// element which need to be \r\n\t\t\t\t// pushed, then return fasle. \r\n\t\t\t\telse if (st.size() != 0 && \r\n\t\t\t\t\t\tst.peek() < fnt) \r\n\t\t\t\t{ \r\n\t\t\t\t\treturn false; \r\n\t\t\t\t} \r\n\t\r\n\t\t\t\t// else push into the stack. \r\n\t\t\t\telse\r\n\t\t\t\t\tst.push(fnt); \r\n\t\t\t} \r\n\t\r\n\t\t\t// while expected element are \r\n\t\t\t// coming from stack, pop them out. \r\n\t\t\twhile (st.size() != 0 && \r\n\t\t\t\tst.peek() == expected) \r\n\t\t\t{ \r\n\t\t\t\tst.pop(); \r\n\t\t\t\texpected++; \r\n\t\t\t} \r\n\t\t} \r\n\t\t\r\n\t\t// if the final expected element \r\n\t\t// value is equal to initial Queue \r\n\t\t// size and the stack is empty. \r\n\t\tif (expected - 1 == n && \r\n\t\t\t\tst.size() == 0) \r\n\t\t\treturn true; \r\n\t\r\n\t\treturn false; \r\n\t}",
"public interface Queue<T extends Object> {\n\n\t/**\n\t * Method to return the queue iterator\n\t * \n\t * @return Queue Iterator\n\t */\n\tpublic Iterator<T> getIterator();\n\n\t/**\n\t * Method to peek the queue face\n\t * \n\t * @return front data\n\t */\n\tpublic T peek();\n\n\t/**\n\t * Method to pop from front of the queue\n\t * \n\t * @return front data\n\t */\n\tpublic T pop();\n\n\t/**\n\t * Push method for inserting Integer data at end of the queue\n\t * \n\t * @param data\n\t */\n\tpublic void push(T data);\n\n\t/**\n\t * Push method for inserting Long data at end of the queue\n\t * \n\t * @param data\n\t */\n\t// public void push(Long data);\n\n\t/**\n\t * Push method for inserting Double data at end of the queue\n\t * \n\t * @param data\n\t */\n\t// public void push(Double data);\n\n\t/**\n\t * Push method for inserting String data at end of the queue\n\t * \n\t * @param data\n\t */\n\t// public void push(String data);\n}",
"public static void main(String[] args) \n\t{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint T;\n\t\t//show(10000);\n\n\t\tT=sc.nextInt();\n\t\tint N;\n\t\tint[] P;\n\t\tint[] Pa;\n\n\t\t/*\n\t\t 여러 개의 테스트 케이스가 주어지므로, 각각을 처리합니다.\n\t\t */\n\n\t\tfor(int test_case = 1; test_case <= T; test_case++)\n\t\t{\n\t\t\tanswer=0;\n\t\t\t//tree = new HashMap<Integer,Integer>();\n\t\t\t//Q=new LinkedList<Integer>();\n\n\t\t\tN=sc.nextInt();\n\t\t\tP=new int[N];\n\t\t\tPa=new int[N];\n\n\t\t\t//tree.put(0, 0);\n\t\t\t//System.out.println(Pa[124]);\n\t\t\tPa[0]=0;\n\t\t\tP[0]=0;\n\t\t\tfor(int i=1;i<N;i++) {\n\t\t\t\tP[i] = sc.nextInt()-1;\n\t\t\t\t//tree.put(i, (tree.get(P[i]))+1);\n\t\t\t\t\n\t\t\t\tPa[i]=Pa[P[i]]+1;\n\t\t\t}\n\t\t\tenQueue(N,P,0,0,0,Pa);\n\t\t\t//answer=dfs(0,P);\n\n\t\t\tSystem.out.println(\"#\"+test_case+\" \"+answer);\n\t\t}\n\t}",
"public static void queueVsStack() {\n\n Queue<String> collection1 = new PriorityQueue<>();\n collection1.add(\"banana\");\n collection1.add(\"orange\");\n collection1.add(\"apple\");\n\n //what will be printed\n System.out.println(collection1.iterator().next());\n\n Deque<String> collection2 = new ArrayDeque<>();\n collection2.addFirst(\"banana\");\n collection2.addFirst(\"apple\");\n collection2.addFirst(\"orange\");\n\n //what will be printed\n System.out.println(collection2.iterator().next());\n\n }",
"private void traversal(List<Node> result, Queue<Node> q ) {\n\t\twhile(!q.isEmpty()) {\r\n\t\t\tNode head = q.poll();\r\n\t\t\tresult.add(head);\r\n\t\t\tif(head.left != null) {\r\n\t\t\t\tq.add(head.left);\r\n\t\t\t}\r\n\t\t\tif(head.right != null) {\r\n\t\t\t\tq.add(head.right);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public ListNode1 solve(ListNode1[] lists){\n Queue<ListNode1> pq = new PriorityQueue<>(Comparator.comparingInt(a -> a.val)); //작은거 부터 뽑아냄\n ListNode1 head = new ListNode1(0); //하나씩 뽑아낸걸 담아둘 list\n ListNode1 res = head; //최종적으로 정렬된 값들이 들어있는 list (처음에는 head와 같이 0을 가짐)\n\n /*//1-2\n Queue<ListNode1> pq1 = new PriorityQueue<>(new Comparator<ListNode1>() {\n @Override\n public int compare(ListNode1 o1, ListNode1 o2) {\n return o1.val-o2.val;\n }\n });\n //1-3\n Queue<ListNode1> pq2 = new PriorityQueue<>(Comp);*/\n\n //2. for while\n for(ListNode1 list : lists){\n if(list != null)\n pq.offer(list); //list 들을 일단 다 넣기(첫 번째 숫자 기준 오름차순 정렬)\n //[1,4,5] - [1,3,4] - [2,6] 순서로 pq 에 들어감\n }\n while(!pq.isEmpty()){\n //pq = [1,4,5]-[1,3,4]-[2,6] >> [1,3,4]-[2,6]-[4,5] >> [2,6]-[3,4]-[4,5] >> [3,4]-[4,5]-[6] >> [4]-[4,5]-[6]\n ListNode1 node = pq.poll(); //리스트 별로 하나씩 빼기 ([1,4,5] > [1,3,4] > [2,6] > [3,4] > [4]\n //System.out.println(\"node.val = \" + node.val);\n res.next = node; //res = [0,'1',4,5] > [1,'1',3,4] > [1,'2',6] > [2,'3',4]\n res = res.next; //res = [1] > [1] > [2] > [3]\n\n if(node.next != null){\n pq.offer(node.next); //[1,4,5] >> [4,5] | [1,3,4] >> [3,4] | [2,6] >> [6] | [3,4] >> [4]\n }\n }\n\n return head.next;\n }",
"public static void main(String[] args) {\n\t\tQueue<Integer> queue = new LinkedList<>();\n\t\t// Add elements\n\t\tqueue.offer(10);\n\t\tqueue.offer(2);\n\t\tqueue.offer(3);\n\t\tqueue.offer(4);\n\t\tqueue.offer(5);\n\t\tqueue.offer(6);\n\t\tqueue.offer(9);\n\t\t// Remove an element from the [front]\n\t\tqueue.poll();\n\t\t// Take a look at the front element\n\t\tint frontElement = queue.peek();\n\t\t// Get the size of the queue\n\t\tint queueSize = queue.size();\n\t\t// Determine whether the queue is empty\n\t\tboolean isEmptyQueue = queue.isEmpty();\n\t\tSystem.out.println(\"A Queue: front element is \" + frontElement + \" with size of \" + queueSize);\n\t\t\n\t\tSystem.out.println(maxInQueue1(queue));\n\t\tSystem.out.println(maxInQueue2(queue));\n\n\t\t// Create an empty stack [Double end queue]\n\t\tDeque<Integer> stack = new LinkedList<>();\n\t\t// Add elements\n\t\tstack.push(1);\n\t\tstack.push(2);\n\t\tstack.push(3);\n\t\tstack.push(4);\n\t\tstack.push(5);\n\t\t// Remove an element from the [top]\n\t\tstack.pop();\n\t\t// Take a look at the [top] element\n\t\tint topElement = stack.peek();\n\t\t// Get the size of the stack\n\t\tint stackSize = stack.size();\n\t\t// Determine whether the queue is empty\n\t\tboolean isEmptyStack = stack.isEmpty();\n\t\tSystem.out.println(\n\t\t\t\t\"A stack(implemented with deque): top element is \" + topElement + \" with size of \" + stackSize);\n\t\n\t\tSystem.out.println(sumOfStack1(stack)); // 10\n\t\tSystem.out.println(sumOfStack2(stack)); // 10, also clear the stack.\n\t\tSystem.out.println(sumOfStack1(stack)); // 0\n\t\tSystem.out.println(9_0000_0012); // 0\n\t}",
"void enqueue(Node n) {\n if (queueSet.contains(n)) {\n return;\n }\n queueSet.add(n);\n queue.addFirst(n);\n }",
"public static void main(String[] args) {\n\t\tCreate_queue new_queue= new Create_queue();\n\t\tnew_queue.enqueu(12);\n\t\tnew_queue.enqueu(5);\n\t\tnew_queue.enqueu(36);\n\t\tnew_queue.enqueu(5);\n\t\tSystem.out.println(new_queue);\n\t\tnew_queue.dequeu();\n\t\tSystem.out.println(new_queue);\n\t\tnew_queue.enqueu(10);\n\t\tnew_queue.enqueu(8);\n\t\tnew_queue.enqueu(2);\n\t\tnew_queue.enqueu(14);\n\t\tSystem.out.println(new_queue);\n\t\tnew_queue.dequeu();\n\t\tnew_queue.dequeu();\n\t\tSystem.out.println(new_queue);\n\t\tSystem.out.println(new_queue);\n\t\tnew_queue.enqueu(32);\n\t\tnew_queue.enqueu(11);\n\t\tnew_queue.enqueu(21);\n\t\tnew_queue.enqueu(44);\n\t\tnew_queue.enqueu(46);\n\t\tSystem.out.println(new_queue);\n\t\tnew_queue.enqueu(50);\n\t\tSystem.out.println(new_queue);\n\t\tnew_queue.dequeu();\n\t\tSystem.out.println(new_queue);\n\t\tnew_queue.enqueu(100);\n\t\tSystem.out.println(new_queue);\n\t\tSystem.out.println(new_queue.peek());\n\t\tnew_queue.dequeu();\n\t\tSystem.out.println(new_queue.peek());\n\t\t\n\t\t\n\t}",
"public void enqueueRear(int n);",
"public static void breadthFirstSearch (HashMap<String, Zpair> stores,\n HashSet<Zpair> visited,\n List<Integer> sortedQueue) {\n List<String> q = new ArrayList<String>();\n q.add(\"Q\");\n // k=0\n //int k = 0;\n while(q.size() != 0) {\n //if(k == 21) {\n // System.exit(20);\n // }\n List<StringBuffer> path = new ArrayList<StringBuffer>(); // this is the return string\n List<String> q1 = new ArrayList<String>();\n int size = q.size();\n //System.out.println(k);\n for(int i = 0; i < size; i++) {\n //printList(q);\n path.add(ZMethods.stringPop(q));\n execute(path.get(i), stores, visited, q1, sortedQueue);\n }\n copyStringBuffer(q1,q);\n //k++;\n }\n }",
"public static void main(String [] args){\n int q ;\n int a;\n int b;\n int n;\n int i =0;\n int sum;\n \n \n Scanner input = new Scanner (System.in);\n \n q = input.nextInt();\n while (i < q ){\n a = input.nextInt();\n b = input.nextInt();\n n = input.nextInt();\n sum = (int) (a + b*Math.pow(2, 0));\n for (int j =0 ; j <= (n-1) ; j++){\n sum = (int) (sum + b*Math.pow(2, j+1));\n System.out.print(sum + \" \");\n }\n \n i++; \n }\n }",
"void printqueue()\n\t{\n\t\tint i;\n\t\tif(!isEmpty())\n\t\t{\n\t\t\tfor(i=front;i<=rear;i++)\n\t\t\t\tSystem.out.print(queue[i]+\" \");\n\t\t\tSystem.out.println();\n\n\t\t}\n\t}",
"public void printQueue();",
"public static void main(String[] args) {\n\t\tQueue<Integer> q = new LinkedList<Integer>();\n\t\tq.add(5);\n\t\tq.add(3);\n\t\tq.add(1);\n for(Integer a : q){\n System.out.println(a);\n }\n q.peek();\n q.poll();\n q.remove();\n Iterator<Integer> t = q.iterator();\n\t\twhile(t.hasNext()){\n\t\t System.out.println(t.next());\n }\n\n\n\n\t}",
"private void re_queue() {\n\n Queue<String> queue = new LinkedList<>();\n queue.offer(\"我\");\n queue.offer(\"爱\");\n queue.offer(\"刷\");\n queue.offer(\"题\");\n queue.offer(\"呵呵\");\n\n System.out.println(\"*********queue*********\");\n System.out.println(queue);\n System.out.println(\"*********queue*********\");\n System.out.println(\"查看队首元素,不改变队列结构:\" + queue.peek());\n System.out.println(queue.size());\n System.out.println(\"*********queue*********\");\n System.out.println(\"取出队首元素,改变队列结构:\" + queue.poll());\n System.out.println(queue.size());\n System.out.println(\"*********queue*********\");\n while (queue.size() > 0) {\n System.out.println(queue.poll());\n System.out.println(queue);\n }\n }",
"@Test\n public void test() {\n int queueSize = 10;\n\n String numbers[] = new String[queueSize];\n\n for (int i = 0; i < numbers.length; i++)\n numbers[i] = String.format(\"%02d\", ((int) (Math.random() * 100)));\n\n Queue queue = new CircularArrayQueue();\n\n // Fill the Circular Queue\n for (String number : numbers)\n queue.add(number);\n\n System.out.println(\"Queue Size: \" + queue.size());\n\n queue.print();\n\n String var = \"\";\n\n var = (String) queue.remove();\n\n System.out.println(\"Dequeue: \" + var + \" : new queue size: \" + queue.size());\n\n queue.add(var);\n System.out.println(\"Re-enqueue: \" + var + \" : new queue size: \" + queue.size());\n\n // Clear the Circular Queue\n while (queue.size() > 1)\n System.out.println(\"Dequeue: \" + queue.remove() + \" : New queue Size: \" + queue.size());\n\n System.out.println(\"Final Queue Size: \" + queue.size());\n }",
"Queue<IMotion> addToQueue(Queue<IMotion> motionQueue);",
"public static void main(String[] args) {\n RandomizedQueue<Integer> rq = new RandomizedQueue<>();\n\n StdOut.println(rq.size());\n\n rq.enqueue(1);\n rq.enqueue(2);\n rq.enqueue(3);\n rq.enqueue(4);\n\n for (Integer i : rq) {\n StdOut.println(i);\n }\n\n StdOut.println(rq.isEmpty());\n\n StdOut.println(rq.sample());\n StdOut.println(rq.sample());\n StdOut.println(rq.size());\n\n StdOut.println(rq.dequeue());\n StdOut.println(rq.size());\n\n for (Integer i : rq) {\n StdOut.println(i);\n }\n\n StdOut.println(rq.dequeue());\n StdOut.println(rq.dequeue());\n StdOut.println(rq.dequeue());\n\n StdOut.println(rq.isEmpty());\n\n try {\n StdOut.println(rq.dequeue());\n } catch (java.util.NoSuchElementException exception) {\n StdOut.println(exception.getMessage());\n }\n }",
"public interface Queue<T>\r\n{\r\n /**\r\n * Insert item at the back of the queue.\r\n * @param item insert item at the back of the queue\r\n */\r\n public void push(T item);\r\n\r\n /**\r\n * Remove the element at the front of the queue and return its value.\r\n * @return value of the element removed from the front of the queue.\r\n * @throws <tt>NoSuchElementException</tt> if the queue is empty.\r\n */\r\n public T pop();\r\n\r\n /**\r\n * Return the value of the element at the front of the queue.\r\n * @return value of element at the front of the queue.\r\n * @throws <tt>NoSuchElementException</tt> if the queue is empty.\r\n */\r\n public T peek();\r\n\r\n /**\r\n * Return a boolean value that indicates whether the queue is empty. Return\r\n * true if empty and false if not empty.\r\n * @return true if the queue is empty and false otherwise.\r\n */\r\n public boolean isEmpty();\r\n\r\n /**\r\n * Return the number of elements currently in the queue.\r\n * @return number of elements in the queue.\r\n */\r\n public int size();\r\n}",
"public static void showNodeQueue(AYQueue<Node> q)\n {\n for (int i = 0; i < q.size(); i++)\n {\n Node node = q.dequeue();\n System.out.format(\"Element #%d = [%s]%n\", i, node.getNodeID());\n q.enqueue(node);\n } //for\n\n }",
"static void printFifthElementFromStart(Queue<Integer> queue) {\n // Write your code here\n int iSize = queue.size();\n if(iSize<6){\n System.out.println(\"There are not enough elements in the queue\");\n return;\n }\n int iCounter = iSize - 4;\n int n = 1;\n\n while (n<iCounter) {\n queue.remove();\n n++;\n }\n\n System.out.println(queue.peek());\n }",
"public static void main(String arg[]) {\n// q.add('a');\n// q.add('b');\n// q.add('c');\n// q.add('d');\n// System.out.println(q);\n// System.out.println(q.size());\n// System.out.println(q.peek());\n// System.out.println(q.remove());\n// System.out.println(q);\n// System.out.println(q.isEmpty());\n\n// Queue<Character> q=new LinkedList<>();\n// System.out.println(q.isEmpty());\n// q.add('a');\n// q.add('b');\n// q.add('c');\n// q.add('d');\n// System.out.println(q);\n// System.out.println(q.size());\n// System.out.println(q.peek());\n// System.out.println(q.remove());\n// System.out.println(q);\n// System.out.println(q.isEmpty());\n\n Queue numbers = new LinkedList();\n List(numbers);\n\n // Write your code here\n // You should only add some numbers, dequeue, or peek to change the elements in the queue\n // so that the queue becomes [1,4,9,14,15]\n System.out.println(numbers);\n\n numbers.remove();\n numbers.add(1);\n\n System.out.println(numbers);\n }",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint T = sc.nextInt();\n\t\tfor (int t = 0; t < T; t++) {\n\t\t\tint N = sc.nextInt();\n\t\t\tint M = sc.nextInt();\n\t\t\tQueue<text> queue = new LinkedList<>();\n\t\t\tPriorityQueue<Integer> pq = new PriorityQueue<Integer>(Collections.reverseOrder());\n\t\t\tfor (int i = 0; i < N; i++) {\n\t\t\t\tint input = sc.nextInt();\n\t\t\t\tqueue.offer(new text(input, i));\n\t\t\t\tpq.offer(input);\n\t\t\t}\n//\t\t\tPriorityQueue<Integer> rq = new PriorityQueue<Integer>(pq.size(), Collections.reverseOrder());\n\t\t\tint idx = 0;\n\t\t\tboolean ok = false;\n\t\t\twhile(true) {\n\t\t\t\tint max = pq.poll();\n\t\t\t\tfor (int i = 0; i < queue.size(); i++) {\n\t\t\t\t\ttext now = queue.poll();\n\t\t\t\t\tif(now.pri == max) {\n\t\t\t\t\t\tidx++;\n\t\t\t\t\t\tif(now.order == M) {\n\t\t\t\t\t\t\tok = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}else {\n\t\t\t\t\t\tqueue.add(now);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(ok)\tbreak;\n\t\t\t}\n\t\t\tSystem.out.println(idx);\n\t\t}\n\t}",
"public solution_622(int k) {\n queue = new Integer[k];\n this.head = 0;\n this.tail = 0;\n }",
"public static void main(String[] args) {\n Queue<Integer> q = new LinkedList<Integer>();\n q.add(10);\n q.add(5);\n q.add(15);\n System.out.println(q.peek());\n System.out.println(q.poll());\n System.out.println(q.peek());\n System.out.println(q.size());\n }",
"public static void main(String[] args) {\n int[] test = {1,2,3,4,5,6,7,8,9,10};\n Queue testing = new Queue(test);\n int[] pulled = new int[3];\n pulled[0] = testing.pop();\n pulled[1] = testing.pop();\n pulled[0] = testing.pop();\n System.out.println(\"pulled \" + pulled[0] + \" \" + pulled[1] + \" \" + pulled[2]);\n testing.push(pulled);\n testing.iter();\n }",
"private void workOnQueue() {\n }",
"public void greedyBFS(String input)\r\n\t{\r\n\t\tNode root_gbfs = new Node (input);\r\n\t\tNode current = new Node(root_gbfs.getState());\r\n\t\t\r\n\t\tNodeComparator gbfs_comparator = new NodeComparator();\r\n\t\tPriorityQueue<Node> queue_gbfs = new PriorityQueue<Node>(12, gbfs_comparator);\r\n\t\tArrayList<String> visited = new ArrayList<String>();\r\n\t\tArrayList<String> children = new ArrayList<String>();\r\n\t\t\r\n\t\tint nodes_popped = 0;\r\n\t\tint pqueue_max_size = 0;\r\n\t\tint pq_size = 0;\r\n\t\t\r\n\t\tcurrent.cost = 0;\r\n\t\tcurrent.total_cost = 0;\r\n\t\t\r\n\t\twhile(!goal_gbfs)\r\n\t\t{\r\n\t\t\tvisited.add(current.getState());\r\n\t\t\tchildren = Successor.findChildren(current.getState());\r\n\t\t\t\r\n\t\t\tfor (String a : children)\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\tif (visited.contains(a))\r\n\t\t\t\t{\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNode nino = new Node(a);\r\n\t\t\t\t\tcurrent.children_nodes.add(nino);\r\n\t\t\t\t\tvisited.add(nino.getState());\r\n\t\t\t\t\t\r\n\t\t\t\t\tint cost = isCost(current.getState(), nino.getState());\r\n\t\t\t\t\tnino.cost = cost;\r\n\t\t\t\t\tnino.parent = current;\r\n\t\t\t\t\tint greedy_cost = greedybfsCost(nino.getState(), root_gbfs.getState());\r\n\t\t\t\t\tnino.setTotalCost(greedy_cost);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (!queue_gbfs.contains(nino))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tqueue_gbfs.add(nino);\r\n\t\t\t\t\t\tpq_size++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Repeated State checking. Removing the same node from PQ if the path cost is less then the current one \r\n\t\t\t\t\telse if (queue_gbfs.contains(nino))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tfor (Node original : queue_gbfs)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (original.equals(nino))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tNode copy = original;\r\n\t\t\t\t\t\t\t\tif (nino.getTotalCost() < copy.getTotalCost())\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tqueue_gbfs.remove(copy);\r\n\t\t\t\t\t\t\t\t\tqueue_gbfs.add(nino);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcurrent = queue_gbfs.poll();\r\n\t\t\tnodes_popped++;\r\n\t\t\t\r\n\t\t\tif (pq_size > pqueue_max_size)\r\n\t\t\t{\r\n\t\t\t\tpqueue_max_size = pq_size;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tpq_size--;\r\n\t\t\tgoal_gbfs = isGoal(current.getState());\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tgoal_gbfs = false;\r\n\t\tSystem.out.println(\"GBFS Solved!!\");\r\n\t\tSolution.performSolution(current, root_gbfs, nodes_popped, pqueue_max_size);\r\n\t}",
"public void bfs(Queue<Integer> queue, int visited[]) {\n if (queue.isEmpty()) {\n return;\n }\n\n int root = queue.poll();\n\n if (visited[root] == 1) {\n bfs(queue, visited);\n return;//alreadu into consideration\n }\n\n\n System.out.printf(\"Exploring of node %d has started\\n\", root);\n visited[root] = 1;\n\n\n for (int i = 0; i < adjMatrix[root].size(); i++) {\n if (visited[adjMatrix[root].get(i)] == 1 || visited[adjMatrix[root].get(i)] == 2) {\n continue;\n }\n queue.add(adjMatrix[root].get(i));\n }\n bfs(queue, visited);\n System.out.printf(\"Exploring of node %d has end\\n\", root);\n visited[root] = 2;\n }",
"public static void main(String args[] ) throws Exception {\n Scanner s = new Scanner(System.in);\n int N = s.nextInt();\n\n int[] arr = new int[N];\n \n int relationNumber = s.nextInt();\n\n for (int i = 0; i < N; i++) {\n arr[i] = s.nextInt();\n }\n \n for(int j = 0; j < relationNumber; j++){\n relation.put(s.nextInt(), s.nextInt()); \n }\n \n queue.add(arr[0]);\n findRelationWithKey(arr[0]);\n System.out.println(counter);\n }",
"public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int N = scanner.nextInt(), M = scanner.nextInt();\n int[][] graph = new int[N + 1][N + 1];\n\n for (int i = 0; i < M; i++) {\n int from = scanner.nextInt(), to = scanner.nextInt();\n int weight = scanner.nextInt();\n graph[from][to] = weight;\n }\n \n int[][][] dp = new int[N + 1][N + 1][N + 1];\n\n for (int i = 1; i <= N; i++) {\n for (int j = 1; j <= N; j++) {\n if (graph[i][j] != 0) {\n dp[0][i][j] = graph[i][j];\n } else {\n dp[0][i][j] = Integer.MAX_VALUE;\n }\n }\n }\n \n for (int k = 0; k <= N; k++) {\n for (int i = 1; i <= N; i++) {\n dp[k][i][i] = 0;\n }\n }\n\n for (int k = 1; k <= N; k++) {\n for (int i = 1; i <= N; i++) {\n for (int j = 1; j <= N; j++) {\n if (dp[k - 1][i][k] != Integer.MAX_VALUE && dp[k - 1][k][j] != Integer.MAX_VALUE) {\n dp[k][i][j] = Math.min(dp[k - 1][i][j], dp[k -1][i][k] + dp[k -1][k][j]);\n } else {\n dp[k][i][j] = dp[k - 1][i][j];\n }\n }\n }\n }\n\n int Q = scanner.nextInt();\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < Q; i++) {\n int from = scanner.nextInt(), to = scanner.nextInt();\n int res = dp[N][from][to] == Integer.MAX_VALUE ? -1 : dp[N][from][to];\n sb.append(res).append('\\n');\n }\n System.out.println(sb.toString());\n }",
"public void pop() {\n int size = q.size();\n for(int i = 1; i<size;i++){\n q.offer(q.poll());\n }\n q.poll();\n }",
"private static void tester(APQueue<String> q) {\n q.push(\"c++\");\n q.push(\"python\");\n q.push(\"java\");\n System.out.println(\"Should be 3: \" + q.size());\n \n System.out.println();\n \n System.out.println(\"Should be c++: \" + q.peek());\n System.out.println(\"Should be 3: \" + q.size());\n \n System.out.println();\n \n System.out.println(\"Should be c++: \" + q.pop());\n System.out.println(\"Should be 2: \" + q.size());\n \n System.out.println();\n \n System.out.println(\"Should be python: \" + q.peek());\n System.out.println(\"Should be 2: \" + q.size());\n \n System.out.println();\n \n System.out.println(\"Should be python: \" + q.pop());\n System.out.println(\"Should be 1: \" + q.size());\n \n System.out.println();\n \n System.out.println(\"Should be java: \" + q.peek());\n System.out.println(\"Should be 1: \" + q.size());\n \n System.out.println();\n \n System.out.println(\"Should be java: \" + q.pop());\n System.out.println(\"Should be 0: \" + q.size());\n \n System.out.println();\n }",
"private Queue(){\r\n\t\tgenerateQueue();\r\n\t}",
"@Test\r\n\tpublic void permutationsTestSize5() throws BoundedQueueException {\r\n\t\tbq.enqueue(1);\r\n\t\tbq.enqueue(2);\r\n\t\tbq.enqueue(3);\r\n\t\tbq.enqueue(4);\r\n\t\tbq.enqueue(5);\r\n\t\tbq.permutations();\r\n\t}",
"myQueue(int size){\n }",
"public static int[][] optimalBST2(double[] p,double[] q, int num){\n double[][] e = new double[num+2][num+2];//子树期望代价\n double[][] w = new double[num+2][num+2];//子树总概率\n //why e and w is two bigger than num?\n //because when i==j, e[i][i-1] + e[i+1][j] + w[i][j];\n\n int[][] root = new int[num+1][num+1];//记录根节点\n //root[i][j] -- 用来存放i-j组成的最优二叉查找树的根节点\n\n //init--初始化\n for(int i=1; i<num+2; i++){\n e[i][i-1] = q[i-1];\n w[i][i-1] = q[i-1];\n }\n\n for(int d = 0; d<num; d++){\n //插入个数 : 0 - num-1, 从0开始\n for(int i=1; i<=num-d; i++){\n //起始下标 : 1 - num, 从1开始\n int j = i + d;\n e[i][j] = 9999;\n w[i][j] = w[i][j-1] + p[j] + q[j];//\n\n //because of root[i][j-1] <= root[i][j] <= root[i+1][j]\n //so why?\n //\n //进行优化!!!\n if(i == j){\n root[i][j] = i;\n e[i][j] = e[i][i-1] + e[i+1][i] + w[i][i];\n }else{\n for(int k=root[i][j-1]; k<=root[i+1][j]; k++){\n //中间下标\n double temp = e[i][k-1] + e[k+1][j] + w[i][j];\n if(temp < e[i][j]){\n e[i][j] = temp;\n //找到小的,记录下来\n root[i][j] = k;\n }\n\n }\n }\n }\n }\n return root;\n }",
"@Override\n public void solve(Problem p) {\n Queue queue = new LinkedList();\n queue.add(p);\n closeList.add(p);\n\n while (!queue.isEmpty()) {\n\n Problem node = (Problem) queue.remove();\n if (node.isAnswer()) {\n printPath(node);\n return;\n }\n// System.out.println(node);\n node.generateNodes();\n nodesExpanded++;\n for (Iterator<Problem> it = node.nodes.iterator(); it.hasNext();) {\n nodesSeen++;\n Problem problem = it.next();\n if (closeList.contains(problem)) {\n continue;\n }\n problem.visited = true;\n problem.distanceTraveled = node.distanceTraveled + 1;\n// System.out.println(problem.distanceTraveled);\n// System.out.println(problem);\n queue.add(problem);\n closeList.add(problem);\n }\n maxNodes = Math.max(maxNodes, queue.size());\n }\n \n }",
"public static void main(String[] args) {\n\t\tQueue<Integer> queue = new LinkedList<>();\r\n\r\n for (int i=0;i<5;i++) {\r\n \tqueue.add(i);\r\n }\r\n \r\n System.out.println(\"Elements in queue: \" + queue);\r\n\r\n int objectRemoved = queue.remove();\r\n System.out.println(\"Removed Object from the Queue: \" + objectRemoved);\r\n\r\n \r\n int headQueue = queue.peek();\r\n System.out.println(\"Head of queue: \" + headQueue);\r\n\r\n int queueSize = queue.size();\r\n System.out.println(\"Size of queue: \" + queueSize);\t\r\n\r\n\t\t \r\n\t}",
"public static void main(String[] args) {\n int N, Q;\n int a, x, y;\n int lastAnswer = 0;\n\n Scanner sc = new Scanner(System.in);\n N = sc.nextInt();\n Q = sc.nextInt();\n\n ArrayList<ArrayList<Integer>> seqList = new ArrayList<ArrayList<Integer>>(N);\n ArrayList<Integer> seq;\n for (int i = 0; i < N; i++) {\n seq = new ArrayList<Integer>();\n seqList.add(seq);\n }\n for (int i = 0; i < Q; i++) {\n seq = new ArrayList<Integer>();\n a = sc.nextInt();\n x = sc.nextInt();\n y = sc.nextInt();\n\n seq = seqList.get((x ^ lastAnswer) % N);\n if (a == 1) {\n seq.add(y);\n } else if(a == 2) {\n lastAnswer = seq.get(y % seq.size());\n System.out.println(lastAnswer);\n }\n\n }\n }",
"public static void main(String[] args) {\n MyQueue queue = new MyQueue();\n student obj1 = new student();\n obj1.setName(\"shashank\");\n obj1.setRoll(6);\n queue.enqueue(obj1);\n student obj2 = new student();\n obj2.setName(\"prashant\");\n obj2.setRoll(2);\n queue.enqueue(obj2);\n student obj = new student();\n obj.setName(\"maneesh\");\n obj.setRoll(10);\n queue.enqueue(obj);\n student obj4 = new student();\n obj4.setName(\"shreya\");\n obj4.setRoll(4);\n queue.enqueue(obj);\n System.out.println(\"the size queue is = \" + queue.getSize());\n queue.sortList();\n queue.traverse();\n }",
"public static String deQueue(Queue q){ \n String front = q.names[0]; //Store the front element to be returned and printed if wanted \n if (q.queuesize != 0){ //IF the queue is not empty \n for (int i = 0; i < q.queuesize; i++){ //For the all of the non zero elements in the queue\n q.names[i] = q.names[i+1]; // Overwrite the first element to get rid of it and shove all of the others up 1\n }\n q.queuesize -=1; //Decrease the size by 1 as someone left \n }\n else{\n System.out.print(\"Empty Queue\"); //State the queue is empty and nothing can be removed\n }\n return front; //Return the element that was once in front - This can be printed \n }",
"public static int[][] optimalBST(double[] p,double[] q, int num){\n double[][] e = new double[num+2][num+2];//子树期望代价\n double[][] w = new double[num+2][num+2];//子树总概率\n //why e and w is two bigger than num?\n //because when i==j, e[i][i-1] + e[i+1][j] + w[i][j];\n //when i = 1 or j = num, so e[1][0]、e[num+1][num]\n //here w can use the size of num+1, but in order not to so much complexity in init to judge i\n //so add a bigger w is look good!\n\n int[][] root = new int[num+1][num+1];//记录根节点\n //root[i][j] -- 用来存放i-j组成的最优二叉查找树的根节点\n\n //init--初始化\n for(int i=1; i<num+2; i++){\n e[i][i-1] = q[i-1];\n w[i][i-1] = q[i-1];\n }\n\n for(int d = 0; d<num; d++){\n //插入个数 : 0 - num-1, 从0开始\n for(int i=1; i<=num-d; i++){\n //起始下标 : 1 - num, 从1开始\n int j = i + d;\n e[i][j] = 9999;\n w[i][j] = w[i][j-1] + p[j] + q[j];//\n for(int k=i; k<=j; k++){\n //中间下标\n double temp = e[i][k-1] + e[k+1][j] + w[i][j];\n if(temp < e[i][j]){\n e[i][j] = temp;\n //找到小的,记录下来\n System.out.println(\"i--> \"+i+\", j--> \"+j);\n root[i][j] = k;\n }\n }\n }\n }\n return root;\n }",
"T poll(){\n if(isEmpty()){\n return null;\n }\n T temp = (T) queueArray[0];\n for(int i=0; i<tail-1;i++){\n queueArray[i] = queueArray[i+1];\n }\n tail--;\n return temp;\n }",
"public interface UnboundedQueue<T> {\n \n\t/**\n\t * This method inserts a generic type element to the back of the Queue, increasing the\n\t * size by one. \n\t * \n\t * @param o Generic type to be added to the back of the Queue.\n\t */\n public void insert(T o);\n \n /**\n * This method removes a generic type element from the front of the Queue thereby decreasing the\n * size by one. Throws an EmptyQueueException if the Queue is empty and there is no\n * element to remove.\n * \n * @return Object removed from the front of the Queue\n * @throws EmptyQueueException if Queue is empty and there is no object to remove\n */\n public T remove() throws EmptyQueueException;\n \n /**\n * This method makes a copy of the element at the front of the Queue. Size stays the same.\n * \n * @return copy of the element at the front of the Queue.\n * @throws EmptyQueueException thrown if the Queue is empty and there is no elment at the front\n */\n public T front() throws EmptyQueueException;\n \n /**\n * This method returns true if the Queue has a front element and therefore is \n * not empty.\n * \n * @return true if the Queue has a front element\n */\n public boolean hasFront();\n \n /**\n * This method returns the number of elements currently stored in the structure (Queue).\n * \n * \n * @return int number of elements stored in the Queue\n */\n public int size();\n\n /**\n * This method creates a String representation of the Queue.\n * \n * @return String which represents the Queue\n */\n public String toString();\n \n}",
"public NodeBase<V> dequeue() {\r\n \tif(!isEmpty()){\r\n \tNodeBase<V> min=queue[0];\r\n \tint j=0;\r\n for(int i=0;i<currentSize;i++){\r\n \t if(min.getPriority()>queue[i].getPriority()){\r\n \t\t min=queue[i];\r\n \t\t j=i;\r\n \t }\r\n }\r\n for(int x=j;x<currentSize-1;x++){\r\n \t queue[x]=queue[x+1];\r\n }\r\n \r\n currentSize--;\r\n \r\n return min;\r\n \t}\r\n \telse{\r\n \t\treturn null;\r\n \t}\r\n }",
"public static void main(String[] args) {\n\t\t\n\t\tPriorityBlockingQueue<Integer> obj = new PriorityBlockingQueue<Integer>();\n\t\t\n\t\t/*for(int i=9;i<=99;i=i+9)\n\t\t{\n\t\t\tobj.offer(i);\n\t\t}\n\t\t\n\t\tSystem.out.println(obj);\n\t\t\n\t\tSystem.out.println(\"Removing First Element :\"+ obj.poll());\n\t\t\n\t\tSystem.out.println(obj);\n\t\t\n\t\tSystem.out.println(\"Removing First Element :\"+ obj.poll());\n\t\t\n\t\tSystem.out.println(obj);*/\n\t\t\n//\t\tfor (int i = 7; i <=84; i=i+7) {\n//\t\t\tobj.offer(i);\n//\t\t}\n\t\t\n\t\tobj.offer(5);\n\t\tobj.offer(2);\n\t\tobj.offer(13);\n\t\tobj.offer(7);\n\t\tobj.offer(12);\n\t\tobj.offer(3);\n\t\t\n\t\tSystem.out.println(obj);\n\t\t\n\t\tSystem.out.println(\"First Element :\"+obj.peek());\n\t\t\n\t\tSystem.out.println(\"Removed First Element :\"+obj.poll());\n\t\t\n\t\tSystem.out.println(\"Now First Element :\"+obj.peek());\n\t\t\n\t\tSystem.out.println(obj);\n\t\t\n\t\tSystem.out.println(\"Removed First Element :\"+obj.poll());\n\t\t\n\t\tSystem.out.println(obj);\n\n\t}",
"private void generateQueue(){\r\n\t\tqueue = new int[5];\r\n\t\tfor (int x = 0; x < queue.length; x++){\r\n\t\t\tqueue[x] = random.nextInt(9);\r\n\t\t}\r\n\t}",
"public static void mst(int n)\r\n {\r\n \r\n boolean[]visited=new boolean[n+1];\r\n \r\n //sort queue with considering weight as a key\r\n PriorityQueue<Node>queue=new PriorityQueue<>(new Comparator<Node>(){\r\n public int compare(Node n1,Node n2)\r\n {\r\n return n1.weight-n2.weight;\r\n }\r\n });\r\n \r\n visited[1]=true;\r\n \r\n for(Edge e:list[1])\r\n {\r\n queue.add(new Node(e.weight,e.vertex,1));\r\n }\r\n \r\n while(queue.size()!=0)\r\n {\r\n Node node=queue.poll();\r\n \r\n int weight=node.weight;\r\n int curr=node.curr;\r\n int parent=node.parent;\r\n \r\n if(visited[curr])\r\n continue;\r\n \r\n visited[curr]=true;\r\n arr.add(new Node(weight,curr,parent));\r\n ans+=weight;\r\n \r\n for(Edge e:list[curr])\r\n {\r\n queue.add(new Node(e.weight,e.vertex,curr));\r\n }\r\n \r\n }\r\n \r\n }",
"public static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tint t = s.nextInt();\n\t\twhile(t-->0)\n\t\t{\n\t\t\tint n = s.nextInt();\n\t\t\tint k = s.nextInt();\n\t\t\tint[] arr = new int[n];\n\t\t\tfor(int i=0;i<n;i++)\n\t\t\t\tarr[i] = s.nextInt();\n\t\t\tArrays.sort(arr);\n\t\t\tint[][] dp = new int[k+1][n+1];\n\t\t\tfor(int i=0;i<=k;i++)\n\t\t\t\tfor(int j=0;j<=n;j++)\n\t\t\t\t{\n\t\t\t\t\tif(i==0)\n\t\t\t\t\t\tdp[i][j] = 0;\n\t\t\t\t\telse if(j==0)\n\t\t\t\t\t\tdp[i][j] = -1;\n\t\t\t\t\telse if(i-arr[j-1]>=0)\n\t\t\t\t\t{\n\t\t\t\t\t\tint val1 = dp[i-arr[j-1]][j-1];\n\t\t\t\t\t\tint val2 = dp[i][j-1];\n\t\t\t\t\t\tif(val1!=-1 && val2!=-1)\n\t\t\t\t\t\t\tdp[i][j] = Math.min(1+val1,val2);\n\t\t\t\t\t\telse if(val1!=-1)\n\t\t\t\t\t\t\tdp[i][j] = 1+val1;\n\t\t\t\t\t\telse if(val2!=-1)\n\t\t\t\t\t\t\tdp[i][j] = val2;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdp[i][j] = -1;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif(dp[i][j-1]==-1)\n\t\t\t\t\t\t\tdp[i][j] = -1;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdp[i][j] = dp[i][j-1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tif(dp[k][n]!=-1)\n\t\t\t\tSystem.out.println(dp[k][n]);\n\t\t\telse\n\t\t\t\tSystem.out.println(\"impossible\");\n\t\t}\n\t}",
"public static void main(String[] args) {\n\t\tQueue<Integer> q = new Queue<>(10);\n\t\tfor(int i=0; i<10; i++){\n\t\t\tq.enqueue(i);\n\t\t}\n\t\tSystem.out.println(q.isEmpty());\n\t}",
"void enqueue(Node n) {\r\n\t\tEntry add = new Entry(n);\r\n\t\tlast.prev.nextSet(add);\r\n\t\tadd.prevSet(last.prev);\r\n\t\tadd.nextSet(last);\r\n\t\tlast.prevSet(add);\r\n\t\tlength++;\r\n\t}",
"static int[] bfs(int n, int m, int[][] edges, int s) {\r\n \r\n HashSet<Integer> aList[] = new HashSet[n];\r\n // Array of the nodes of the tree\r\n\r\n Queue<Integer> bfsQueue = new LinkedList();\r\n\r\n boolean visited[] = new boolean[n];\r\n // check if a node is visited or not\r\n\r\n\r\n int cost[] = new int[n];\r\n // cost to travel from one node to other\r\n\r\n for (int i = 0; i < n; i++) {\r\n // intialising the values\r\n visited[i] = false;\r\n cost[i] = -1;\r\n\r\n aList[i] = new HashSet<Integer>();\r\n // Each element of aList is a Set\r\n // To store the neighbouring nodes of a particular node\r\n }\r\n\r\n for (int i = 0; i < m; i++) {\r\n // let node[i] <--> node[j]\r\n\r\n // adding node[j] to neighbours list of node[i]\r\n aList[edges[i][0] - 1].add(edges[i][1] - 1);\r\n\r\n // adding node[i] to neighbours list of node[j]\r\n aList[edges[i][1] - 1].add(edges[i][0] - 1);\r\n }\r\n\r\n //\r\n s = s - 1;\r\n bfsQueue.add(s);\r\n visited[s] = true;\r\n cost[s] = 0;\r\n //\r\n \r\n \r\n while (!bfsQueue.isEmpty()) {\r\n \r\n int curr = bfsQueue.poll();\r\n // takes the last element of the queue\r\n \r\n for (int neigh : aList[curr]) { // iterating the neighbours of node 'curr'\r\n if (!visited[neigh]) { // checking if node neigh id already visited during the search\r\n visited[neigh ] = true;\r\n bfsQueue.add(neigh); //add the node neigh to bfsqueue\r\n cost[neigh] = cost[curr] + 6; \r\n }\r\n }\r\n }\r\n\r\n int result[] = new int[n-1];\r\n\r\n for (int i=0, j=0; i<n && j<n-1; i++, j++) {\r\n if (i == s){\r\n i++;\r\n }\r\n result[j] = cost[i];\r\n }\r\n \r\n return result;\r\n }",
"public E poll() {\n\t\twhile (true) {\n\t\t\tlong f = front.get();\n\t\t\tint i = (int)(f % elements.length());\n\t\t\tE x = elements.get(i);\n\t\t\t//Did front change while we were reading x?\n\t\t\tif (f != front.get())\n\t\t\t\tcontinue;\n\t\t\t//Is the queue empty?\n\t\t\tif (f == rear.get())\n\t\t\t\treturn null; //Don't retry; fail the poll.\n\n\t\t\tif (x != null) {//Is the front nonempty?\n\t\t\t\tif (elements.compareAndSet(i, x, null)) {//Try to remove an element.\n\t\t\t\t\t//Try to increment front. If we fail, other threads will\n\t\t\t\t\t//also try to increment before any further removals, so we\n\t\t\t\t\t//don't need to loop.\n\t\t\t\t\tfront.compareAndSet(f, f+1);\n\t\t\t\t\treturn x;\n\t\t\t\t}\n\t\t\t} else //front empty. Try to help other threads.\n\t\t\t\tfront.compareAndSet(f, f+1);\n\n\t\t\t//If we get here, we failed at some point. Try again.\n\t\t}\n\t}",
"public E dequeue(){\n if (isEmpty()) return null;\n E answer = arrayQueue[front];\n arrayQueue[front] = null;\n front = (front +1) % arrayQueue.length;\n size--;\n return answer;\n }",
"public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n int n = in.nextInt();\n int k = in.nextInt();\n int q = in.nextInt();\n\n int a[] = new int[n];\n for(int a_i=0; a_i < n; a_i++){\n a[a_i] = in.nextInt();\n }\n\n int fist;\n int last;\n\n //brute force will get timeout\n for(int i = 0; i< k; i++){\n fist = a[0];\n last = a[n-1];\n a[0] = last;\n for (int j = 1; j<n; j++){\n last = a[j];\n a[j] = fist;\n fist = last;\n }\n }\n\n for(int a0 = 0; a0 < q; a0++){\n System.out.println(a[in.nextInt()]);\n }\n\n\n }",
"public static void main(String args[]) {\r\n /* Create a queue with items 1 2 3 */\r\n Queue q = new Queue();\r\n q.stack1 = new Stack<>();\r\n q.stack2 = new Stack<>();\r\n enQueue(q, 1);\r\n enQueue(q, 2);\r\n enQueue(q, 3);\r\n\r\n /* Dequeue items */\r\n System.out.print(deQueue(q) + \" \");\r\n System.out.print(deQueue(q) + \" \");\r\n System.out.println(deQueue(q) + \" \");\r\n }",
"public static LinkedQueue mergeSortedQueues(LinkedQueue q1, LinkedQueue q2) {\n // Replace the following line with your solution.\n LinkedQueue bigQueue = new LinkedQueue();\n while (!q1.isEmpty() && !q2.isEmpty())\n {\n try\n {\n Object qOneItem = q1.front();\n Object qTwoItem = q2.front();\n if (((Comparable) qOneItem).compareTo(qTwoItem) > 0)\n {\n bigQueue.enqueue(q2.dequeue());\n }\n else if (((Comparable) qOneItem).compareTo(qTwoItem) < 0)\n {\n bigQueue.enqueue(q1.dequeue()); \n }\n else\n {\n bigQueue.enqueue(q1.dequeue()); \n bigQueue.enqueue(q2.dequeue());\n }\n }\n catch (QueueEmptyException e)\n {\n e.printStackTrace(); \n }\n }\n \n if (!q1.isEmpty())\n {\n bigQueue.append(q1);\n }\n if (!q2.isEmpty())\n {\n bigQueue.append(q2);\n }\n \n return bigQueue;\n }",
"public int solution2(int[] nums, int k) {\n PriorityQueue<Integer> pq = new PriorityQueue<Integer>();\n \n for (int i : nums) {\n pq.offer(i);\n \n if (pq.size() > k) {\n pq.poll();\n }\n }\n \n \n return pq.peek();\n }"
] | [
"0.6648536",
"0.659787",
"0.6543091",
"0.6441007",
"0.6418337",
"0.6368613",
"0.6364871",
"0.634881",
"0.6266047",
"0.62418604",
"0.614316",
"0.6081756",
"0.600223",
"0.5997164",
"0.5992701",
"0.5929807",
"0.5885382",
"0.5872084",
"0.58640003",
"0.58333474",
"0.5833062",
"0.5798047",
"0.5780449",
"0.5775832",
"0.573213",
"0.5718512",
"0.56937504",
"0.5691089",
"0.5687443",
"0.5679044",
"0.5676631",
"0.56695294",
"0.5668551",
"0.56674284",
"0.5644966",
"0.5644716",
"0.56434226",
"0.5635624",
"0.56285113",
"0.56205845",
"0.56194013",
"0.5617227",
"0.5611641",
"0.5608087",
"0.5593794",
"0.5591448",
"0.5589485",
"0.5588611",
"0.55881065",
"0.55709136",
"0.5570109",
"0.5546279",
"0.55163187",
"0.54999804",
"0.5499922",
"0.54990596",
"0.549718",
"0.5495782",
"0.54910254",
"0.5484287",
"0.547922",
"0.5471858",
"0.54706305",
"0.546378",
"0.54591906",
"0.5457793",
"0.5451763",
"0.5449308",
"0.54456866",
"0.54408187",
"0.5438425",
"0.5426862",
"0.54237366",
"0.5419153",
"0.54179096",
"0.54138243",
"0.5409546",
"0.540883",
"0.54078174",
"0.54077345",
"0.5402187",
"0.5386934",
"0.5378672",
"0.5376509",
"0.537489",
"0.53732955",
"0.5366837",
"0.5365096",
"0.53573924",
"0.5355915",
"0.5351708",
"0.53467053",
"0.53454334",
"0.53437865",
"0.5342316",
"0.5341636",
"0.53360355",
"0.5334517",
"0.53331834",
"0.53299797",
"0.532602"
] | 0.0 | -1 |
This method is added as a shutdown hook to the runtime. | public void run(){
// Stop servlets
try{
server.stop();
}catch(Exception e){}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void shutdown() {\n\t}",
"public void shutdown()\n {\n // todo\n }",
"@Override\n\tpublic void shutdown()\n\t{\n\t}",
"@Override\n public void shutdown() {\n }",
"@Override\n public void shutdown() {\n }",
"@Override\n public void shutdown() {\n }",
"@Override\n\t\tprotected void shutdown() {\n\n\t\t}",
"@Override\n\tpublic void shutdown() {\n\t}",
"@Override\n\tpublic void shutdown() {\n\t}",
"@Override\n\tpublic void shutdown() {\n\t\t\n\t}",
"@Override\n\tpublic void shutdown() {\n\n\t}",
"public void shutdown() {\n\t\t\n\t}",
"public void shutdown() {\n }",
"public static void shutdown() {\n\t\t// Ignore\n\t}",
"@Override\n public void shutdown()\n {\n // nothing to do\n }",
"@Override\n public void shutdown() {\n }",
"public void shutdown() {\n/* 188 */ this.shutdown = true;\n/* */ }",
"public void shutdown() {\n // no-op\n }",
"public void abnormalShutDown() {\n\t}",
"public void shutdown()\n {\n // nothing to do here\n }",
"@Override\n public void shutDown() {\n }",
"public void shutdown() {\n // For now, do nothing\n }",
"protected void shutdown() {\n\r\n }",
"@Override\n protected void shutDown() {\n }",
"public void shutdown() {\n shutdown(false);\n }",
"@Override\n public void shutdownNow() {\n }",
"public void shutdown() {\n this.isShutdown = true;\n }",
"public void shutdown() {\r\n System.exit(0);\r\n }",
"public void shutDown()\n {\n // Runtime.getRuntime().removeShutdownHook(shutdownListener);\n //shutdownListener.run();\n }",
"@Override\n\tprotected void shutdown() throws Throwable {\n\t\t\n\t}",
"public void shutdown();",
"public void shutdown();",
"public void shutdown();",
"public void shutdown();",
"@Override\n public void shutdown() {\n // Do nothing.\n }",
"protected abstract void shutdown();",
"@Override\n protected void shutdown() {\n super.shutdown();\n // Now perform any other shutdown tasks you need.\n // ...\n }",
"@Override\r\n\tprotected void shutdownSpecific() {\n\r\n\t}",
"public abstract void shutdown();",
"public abstract void shutdown();",
"public abstract void shutdown();",
"public abstract void shutdown();",
"public void shutdown()\n\t{\n\t\t; // do nothing\n\t}",
"public void cleanShutDown () {\n shutdown = true;\n }",
"void shutdown() throws Exception;",
"public void shutdown(){\n \tSystem.out.println(\"SHUTTING DOWN..\");\n \tSystem.exit(0);\n }",
"public void shutdownNow() {\n }",
"@Override\n protected void shutdownService() {\n }",
"void shutdown();",
"void shutdown();",
"void shutdown();",
"void shutdown();",
"void shutdown();",
"void shutdown();",
"void shutdown();",
"void shutdown();",
"void shutdown();",
"void shutdown();",
"void shutdown();",
"void shutdown();",
"void shutdown();",
"void shutdown();",
"void shutdown();",
"void shutdown();",
"void shutdown();",
"@Override\r\n\tpublic void shutdown() {\n\t\tunRigisterMBean();\r\n\t}",
"@Override\n\tprotected void onShutdown(ApplicationEvent event) {\n\t\t\n\t}",
"public static void shutdown ()\n\t{\n\t\tif (m_interpreter != null)\n\t\t{\n\t\t\tm_console.dispose ();\n\t\t\tm_interpreter.cleanup ();\n\t\t}\n\t}",
"@AfterClass\n public static void shutdown()\n {\n }",
"public synchronized void shutdown() {\n try {\n stop();\n } catch (Exception ex) {\n }\n \n try {\n cleanup();\n } catch (Exception ex) {\n }\n }",
"public static void shutdown()\n\t{\n\t\tinstance = null;\n\t}",
"public void shutdown()\n {\n shutdown = true;\n cil.shutdown();\n }",
"@Override\r\n protected void shutdownInternal() {\r\n service.stop();\r\n }",
"public void shutdown() {\n\t\tInput.cleanUp();\n\t\tVAO.cleanUp();\n\t\tTexture2D.cleanUp();\n\t\tResourceLoader.cleanUp();\n\t}",
"public static void bgfx_shutdown() {\n long __functionAddress = Functions.shutdown;\n invokeV(__functionAddress);\n }",
"protected void shutdown()\n throws SwiftletException {\n if (config == null)\n return;\n if (traceSpace.enabled) traceSpace.trace(getName(), \"shutdown ...\");\n rlgroups.clear();\n groups.clear();\n users.clear();\n publicRLGroup = null;\n publicGroup = null;\n authenticationOff = true;\n config = null;\n if (traceSpace.enabled) traceSpace.trace(getName(), \"shutdown: done.\");\n }",
"@Override\n public String shutdown() {\n instance.shutdown();\n return \"ok\";\n }",
"public static void shutdown() {\n resetCache();\n listeningForChanges = false;\n }",
"@Programmatic\n public void shutdown() {\n LOG.info(\"shutting down {}\", this);\n\n cache.clear();\n }",
"public void shutDown();",
"public void shutdown() {\n this.dontStop = false;\n }",
"public void shutdown()\r\n {\r\n debug(\"shutdown() the application module\");\r\n\r\n // Shutdown all the Timers\r\n shutdownWatchListTimers();\r\n // Save Our WatchLists\r\n saveAllVectorData();\r\n // Our Container vectors need to be emptied and clear. \r\n modelVector.removeAllElements();\r\n modelVector = null;\r\n\r\n tableVector.removeAllElements();\r\n tableVector = null;\r\n\r\n // Delete any additional Historic Data that is Serialized to disk\r\n expungeAllHistoricFiles();\r\n\r\n // Shutdown the task that monitors the update tasks\r\n if ( this.monitorTask != null )\r\n {\r\n this.monitorTask.cancel();\r\n this.monitorTask = null;\r\n }\r\n // Null out any reference to this data that may be present\r\n stockData = null;\r\n debug(\"shutdown() the application module - complete\");\r\n\r\n }",
"void internalShutdown() {\n\t\tsynchronized(this.hookedPlugins) {\n\t\t\tIterator<String> it = this.hookedPlugins.keySet().iterator();\n\t\t\twhile (it.hasNext()) {\n\t\t\t\tString id = it.next(); \n\t\t\t\tPluginLogListener listener = this.hookedPlugins.get(id);\n\t\t\t\tlistener.dispose(); \n\t\t\t}\n\t\t\tthis.hookedPlugins.clear(); \n\t\t}\t\n\t\tthis.hierarchy.shutdown();\n\t}",
"@Override\n public void postEnvCall() {\n shutdown(this.getEnvironment());\n }",
"public synchronized void terminate () {\n shutdown = true;\n }",
"@Override\n public void shutdown() throws PluginException {\n\n }",
"@AfterClass\n public void stop() throws Exception {\n super.finalize();\n }",
"private void registerShutdownHook()\n {\n Runtime.getRuntime().addShutdownHook( new Thread()\n {\n @Override\n public void run()\n {\n db.shutdown();\n }\n } );\n }",
"public synchronized void shutDown() {\n\t state.shutDown();\n\t}",
"public void shutdown() {\r\n //shut down MbModule\r\n super.shutdown();\r\n }",
"@AfterClass\n public static void afterClass() throws Throwable\n {\n // Shutdown embedded\n embedded.shutdown();\n\n // Set embedded to null\n embedded = null;\n }",
"public void shutdown(){\n\t\tAndroidSensorDataManagerSingleton.cleanup();\n\t}",
"void shutDown();",
"@AfterClass\n public static void shutDown() {\n // \"override\" parent shutDown\n }",
"private void registerShutdownHook() {\n Runtime.getRuntime().addShutdownHook(new Thread(\"Metastore Janitor Shutdown Hook\"){\n\n @Override\n public void run() {\n log.info(\"Shutting down all threads\");\n \n synchronized(tasks) {\n for(AbstractDynamoDBTask task : tasks) {\n task.running = false;\n }\n }\n \n synchronized(futures) {\n for(Future future: futures) {\n try {\n future.get();\n } catch (Exception ex) {\n log.error(\"\",ex);\n }\n }\n }\n \n executor.shutdown();\n }\n \n });\n }",
"@Override\r\n\tpublic void onTerminate() {\n\t\tsuper.onTerminate();\r\n\t}",
"public void Shutdown()\n {\n eventLoopGroup.shutdownGracefully();\n }",
"@Test\n public void testShutdownHook() {\n JVMUtils.closeAtShutdown(() -> {\n });\n }",
"@Override\n\tpublic void shutdown() throws IOException\n\t{\n\t\t\n\t}",
"private static void registerShutdownHook() {\r\n\t\t// Registers a shutdown hook for the Neo4j instance so that it\r\n\t // shuts down nicely when the VM exits (even if you \"Ctrl-C\" the\r\n\t // running application).\r\n\t Runtime.getRuntime().addShutdownHook( new Thread()\r\n\t {\r\n\t @Override\r\n\t public void run()\r\n\t {\r\n\t _db.shutdown();\r\n\t }\r\n\t } );\r\n\t\t\r\n\t}",
"@Override\n\tpublic void shutdown() throws IOException {\n\n\t}"
] | [
"0.8536924",
"0.8497699",
"0.84873885",
"0.84860116",
"0.84860116",
"0.84860116",
"0.8461015",
"0.84208137",
"0.84208137",
"0.84188986",
"0.83614045",
"0.83571434",
"0.8352906",
"0.8322628",
"0.8296565",
"0.828805",
"0.8287676",
"0.82542413",
"0.82188755",
"0.8126988",
"0.80682707",
"0.80607635",
"0.80566573",
"0.80456626",
"0.79709816",
"0.7958777",
"0.78998643",
"0.78912514",
"0.78806615",
"0.78771764",
"0.78450626",
"0.78450626",
"0.78450626",
"0.78450626",
"0.7828893",
"0.7807107",
"0.7763942",
"0.77479035",
"0.7719539",
"0.7719539",
"0.7719539",
"0.7719539",
"0.7713809",
"0.7660654",
"0.7626045",
"0.75876653",
"0.75628567",
"0.75409603",
"0.7521607",
"0.7521607",
"0.7521607",
"0.7521607",
"0.7521607",
"0.7521607",
"0.7521607",
"0.7521607",
"0.7521607",
"0.7521607",
"0.7521607",
"0.7521607",
"0.7521607",
"0.7521607",
"0.7521607",
"0.7521607",
"0.7521607",
"0.75090325",
"0.7504861",
"0.74693936",
"0.7464545",
"0.74502397",
"0.7427737",
"0.7417858",
"0.7417009",
"0.7412325",
"0.7390888",
"0.7362083",
"0.73570037",
"0.7356775",
"0.733515",
"0.7333778",
"0.7315066",
"0.7304602",
"0.72939056",
"0.7273688",
"0.7269847",
"0.7262742",
"0.7256058",
"0.7252486",
"0.7209328",
"0.72074693",
"0.72058994",
"0.7204919",
"0.7171261",
"0.7168833",
"0.715687",
"0.7108241",
"0.71046555",
"0.7103612",
"0.70975304",
"0.70931554",
"0.7092931"
] | 0.0 | -1 |
1. Read from json | private void setConfiguration(JSONObject config) throws JSONException{
if(config.has("api")){
JSONObject obj=config.getJSONObject("api");
if(obj.has("bind")){
bind=obj.getString("bind");
}
if(obj.has("port")){
port=obj.getInt("port");
}
}
if(config.has("streams")){
JSONObject obj=config.getJSONObject("streams");
if(obj.has("port")){
streamPort=obj.getInt("port");
}
if(obj.has("host")){
streamHost=obj.getString("host");
}
}
// 2. Overlay environment variables
Map<String,String>env=System.getenv();
if(env.containsKey("BIND")){
bind=env.get("BIND");
}
if(env.containsKey("PORT")){
port=Integer.parseInt(env.get("PORT"));
}
if(env.containsKey("STREAMSHOST")){
streamHost=env.get("STREAMSHOST");
}
if(env.containsKey("STREAMSPORT")){
streamPort=Integer.parseInt(env.get("STREAMSPORT"));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract Object read(@NonNull JsonReader reader) throws IOException;",
"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 }",
"@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 Books readJSON(){\n Gson gson = new GsonBuilder().create();\n Books books = new Books();\n try {\n books = gson.fromJson(new JsonReader(new FileReader(\"books.json\")), Books.class);\n } catch (IOException e){\n e.printStackTrace();\n }\n return books;\n }",
"Gist deserializeGistFromJson(String json);",
"<T> T readJson(FsPath path, Class<T> clazz);",
"public void ReadJson() {\n System.out.println(\"Read Json Method in the Mother Class\");\n }",
"public void deserialize(JsonObject src);",
"private static JSONObject fileReader(String path) throws Exception{\r\n return (JSONObject) jsonParser.parse(new String(Files.readAllBytes(Paths.get(path))));\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}",
"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 }",
"@Test\n public void readSystemObjectClassMedicine() throws UnsupportedEncodingException, IOException {\n ISystemObject object = Factory.createObject(\"Medicine\");\n testJson = gson.toJson(object);\n\n //convert string to input stream\n InputStream inputStream = new ByteArrayInputStream(testJson.getBytes(Charset.forName(\"UTF-8\")));\n //convert inputstream to jsonReader\n JsonReader reader = new JsonReader(new InputStreamReader(inputStream, \"UTF-8\"));\n\n //read json string into resultant\n ISystemObject actual = DataHandler.readSystemObjectClass(reader);\n\n //compare results \n assertEquals(\"Fails to return Medicine properly\", object.getClass(), actual.getClass());\n }",
"public abstract void fromJson(JSONObject jsonObject);",
"public native Object parse( Object json, String texturePath );",
"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 }",
"@Test\n public void readSystemObjectClassDoctorFeedback() throws UnsupportedEncodingException, IOException {\n ISystemObject object = Factory.createObject(\"DoctorFeedback\");\n testJson = gson.toJson(object);\n\n //convert string to input stream\n InputStream inputStream = new ByteArrayInputStream(testJson.getBytes(Charset.forName(\"UTF-8\")));\n //convert inputstream to jsonReader\n JsonReader reader = new JsonReader(new InputStreamReader(inputStream, \"UTF-8\"));\n\n //read json string into resultant\n ISystemObject actual = DataHandler.readSystemObjectClass(reader);\n\n //compare results \n assertEquals(\"Fails to return DoctorFeedback properly\", object.getClass(), actual.getClass());\n }",
"public native Object parse( Object json );",
"public DtResponse readInfoGralJsonStream(InputStream in) throws IOException {\n InputStreamReader isReader = new InputStreamReader(in);\n //Creating a BufferedReader object\n BufferedReader breader = new BufferedReader(isReader);\n StringBuffer sb = new StringBuffer();\n String str;\n while((str = breader.readLine())!= null){\n sb.append(str);\n }\n Log.i(TAG, sb.toString());\n JsonReader reader = new JsonReader(new StringReader(sb.toString()));\n List<DtResponse> res = null;\n try {\n return readRESTMessage(reader);\n } finally {\n reader.close();\n }\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 }",
"@Test\n public void readSystemObjectClassPrescription() throws UnsupportedEncodingException, IOException {\n ISystemObject object = Factory.createObject(\"Prescription\");\n testJson = gson.toJson(object);\n\n //convert string to input stream\n InputStream inputStream = new ByteArrayInputStream(testJson.getBytes(Charset.forName(\"UTF-8\")));\n //convert inputstream to jsonReader\n JsonReader reader = new JsonReader(new InputStreamReader(inputStream, \"UTF-8\"));\n\n //read json string into resultant\n ISystemObject actual = DataHandler.readSystemObjectClass(reader);\n\n //compare results \n assertEquals(\"Fails to return Prescription properly\", object.getClass(), actual.getClass());\n }",
"private Object readJSON() throws JSONException\n {\n switch(read(3))\n {\n case zipObject:\n return readObject();\n case zipArrayString:\n return readArray(true);\n case zipArrayValue:\n return readArray(false);\n case zipEmptyObject:\n return new JSONObject();\n case zipEmptyArray:\n return new JSONArray();\n case zipTrue:\n return Boolean.TRUE;\n case zipFalse:\n return Boolean.FALSE;\n default:\n return JSONObject.NULL;\n }\n }",
"@Test\n public void readSystemObjectClassAppointment() throws UnsupportedEncodingException, IOException {\n ISystemObject object = Factory.createObject(\"Appointment\");\n testJson = gson.toJson(object);\n\n //convert string to input stream\n InputStream inputStream = new ByteArrayInputStream(testJson.getBytes(Charset.forName(\"UTF-8\")));\n //convert inputstream to jsonReader\n JsonReader reader = new JsonReader(new InputStreamReader(inputStream, \"UTF-8\"));\n\n //read json string into resultant\n ISystemObject actual = DataHandler.readSystemObjectClass(reader);\n\n //compare results \n assertEquals(\"Fails to return Appointment properly\", object.getClass(), actual.getClass());\n }",
"private <T> T getObjectFromJsonObject(JSONObject j, Class<T> clazz) throws IOException {\n ObjectMapper mapper = new ObjectMapper();\n T t = null;\n t = mapper.readValue(j.toString(), clazz);\n\n return t;\n }",
"public String readJson() {\n\t\t\tif (lastReadChar == ']') {\n\t\t\t\tSystem.out.println(\"Nunca deberia llegar a aca si usa hasNext()\");\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t// Si fue una coma, busco el siguiente '{'\n\t\t\twhile (read()!= '{');\n\t\t\t\n\t\t\tStringBuilder jsonText = new StringBuilder();\n\t\t\tjsonText.append((char) '{');\n\t\t\tlastReadChar = read();\n\t\t\t\n\t\t\twhile (lastReadChar != '}') { \n\t\t\t\tjsonText.append((char) lastReadChar);\n\t\t\t\tlastReadChar = read();\n\t\t\t} jsonText.append('}');\n\t\t\t\n\t\t\t// To satisfy Invariant: find the next ']' or ','\n\t\t\twhile (lastReadChar != ']' && lastReadChar != ',') lastReadChar = read(); \n\t\t\t\n\t\t\t//System.out.println(\"Analizando : \" + jsonText.toString());\n\t\t\treturn jsonText.toString();\n\t\t}",
"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 @NotNull T read(@NotNull final JsonObject object) throws JsonException;",
"public static void readJSON() throws IOException {\n\t\tBufferedReader br = new BufferedReader(new FileReader(f));\n\t\tString line;\n\t\tif((line = br.readLine()) != null) {\n\t\t\tString [] flightStates = parseJSON(line);\n\t\t\tfor(String state : flightStates) {\n\t\t\t\tFlightState fs = new FlightState(state);\n\t\t\t\tsendToKafka(fs);\n\t\t\t}\n\t\t}\n\t\tbr.close();\n\t}",
"@Test\n public void readUserClassPatient() throws UnsupportedEncodingException, IOException {\n testJson = gson.toJson(Factory.createUser(\"Patient\"));\n\n //convert string to input stream\n InputStream inputStream = new ByteArrayInputStream(testJson.getBytes(Charset.forName(\"UTF-8\")));\n //convert inputstream to jsonReader\n JsonReader reader = new JsonReader(new InputStreamReader(inputStream, \"UTF-8\"));\n\n //read json string into resultant\n IUser actual = DataHandler.readUserClass(reader);\n\n //compare results \n assertEquals(\"Fails to return Patient properly\", Factory.createUser(\"Patient\").getClass(), actual.getClass());\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 }",
"private JSONObject readJSONFile(Path path) throws ExtensionManagementException {\n\n if (Files.exists(path) && Files.isRegularFile(path)) {\n try {\n String jsonString = FileUtils.readFileToString(path.toFile(), UTF8);\n return new JSONObject(jsonString);\n } catch (JSONException e) {\n throw new ExtensionManagementException(\"Error while parsing JSON file: \" + path, e);\n } catch (IOException e) {\n throw new ExtensionManagementException(\"Error while reading JSON file: \" + path, e);\n }\n } else {\n throw new ExtensionManagementException(\"JSON file not found: \" + path);\n }\n }",
"@Override\r\n\tpublic void read(Json json, JsonValue jsonData) {\n\t\tsuper.read(json, jsonData);\r\n\t\tSystem.out.println(\"enemyData = \"+jsonData);\r\n\t}",
"@Test\n public void readSystemObjectClassMedicineOrderRequest() throws UnsupportedEncodingException, IOException {\n ISystemObject object = Factory.createObject(\"MedicineOrderRequest\");\n testJson = gson.toJson(object);\n\n //convert string to input stream\n InputStream inputStream = new ByteArrayInputStream(testJson.getBytes(Charset.forName(\"UTF-8\")));\n //convert inputstream to jsonReader\n JsonReader reader = new JsonReader(new InputStreamReader(inputStream, \"UTF-8\"));\n\n //read json string into resultant\n ISystemObject actual = DataHandler.readSystemObjectClass(reader);\n\n //compare results \n assertEquals(\"Fails to return MedicineOrderRequest properly\", object.getClass(), actual.getClass());\n }",
"private FieldDocument _fromJson (String json) {\n try {\n FieldDocument fd = this.mapper.readValue(json, FieldDocument.class);\n return fd;\n }\n catch (IOException e) {\n log.error(\"File json not found or unmappable: {}\",\n e.getLocalizedMessage());\n };\n return (FieldDocument) null;\n }",
"@Test\n public void readUserClassDoctor() throws UnsupportedEncodingException, IOException {\n testJson = gson.toJson(Factory.createUser(\"Doctor\"));\n\n //convert string to input stream\n InputStream inputStream = new ByteArrayInputStream(testJson.getBytes(Charset.forName(\"UTF-8\")));\n //convert inputstream to jsonReader\n JsonReader reader = new JsonReader(new InputStreamReader(inputStream, \"UTF-8\"));\n\n //read json string into resultant\n IUser actual = DataHandler.readUserClass(reader);\n\n //compare results \n assertEquals(\"Fails to return Doctor properly\", Factory.createUser(\"Doctor\").getClass(), actual.getClass());\n }",
"public Tamagotchi read() throws IOException {\n String jsonData = readFile(source);\n JSONObject jsonObject = new JSONObject(jsonData);\n return tamagotchiToJson(jsonObject);\n }",
"@Test\n public void readSystemObjectClassAccDelRequest() throws UnsupportedEncodingException, IOException {\n ISystemObject object = Factory.createObject(\"AccountDeletionRequest\");\n testJson = gson.toJson(object);\n\n //convert string to input stream\n InputStream inputStream = new ByteArrayInputStream(testJson.getBytes(Charset.forName(\"UTF-8\")));\n //convert inputstream to jsonReader\n JsonReader reader = new JsonReader(new InputStreamReader(inputStream, \"UTF-8\"));\n\n //read json string into resultant\n ISystemObject actual = DataHandler.readSystemObjectClass(reader);\n\n //compare results \n assertEquals(\"Fails to return AccountDeletionRequest properly\", object.getClass(), actual.getClass());\n }",
"@Test\n public void readSystemObjectClassAppointmentRequest() throws UnsupportedEncodingException, IOException {\n ISystemObject object = Factory.createObject(\"AppointmentRequest\");\n testJson = gson.toJson(object);\n\n //convert string to input stream\n InputStream inputStream = new ByteArrayInputStream(testJson.getBytes(Charset.forName(\"UTF-8\")));\n //convert inputstream to jsonReader\n JsonReader reader = new JsonReader(new InputStreamReader(inputStream, \"UTF-8\"));\n\n //read json string into resultant\n ISystemObject actual = DataHandler.readSystemObjectClass(reader);\n\n //compare results \n assertEquals(\"Fails to return AppointmentRequest properly\", object.getClass(), actual.getClass());\n }",
"public T read(JsonReader in) throws IOException {\n\t return null;\n\t }",
"@Test\n public void readUserClassSecretary() throws UnsupportedEncodingException, IOException {\n testJson = gson.toJson(Factory.createUser(\"Secretary\"));\n\n //convert string to input stream\n InputStream inputStream = new ByteArrayInputStream(testJson.getBytes(Charset.forName(\"UTF-8\")));\n //convert inputstream to jsonReader\n JsonReader reader = new JsonReader(new InputStreamReader(inputStream, \"UTF-8\"));\n\n //read json string into resultant\n IUser actual = DataHandler.readUserClass(reader);\n\n //compare results \n assertEquals(\"Fails to return Secretary properly\", Factory.createUser(\"Secretary\").getClass(), actual.getClass());\n }",
"public String parseJSON(){\r\n String json = null;\r\n try{\r\n InputStream istream = context.getAssets().open(\"restaurantopeninghours.json\");\r\n int size = istream.available();\r\n byte[] buffer = new byte[size];\r\n istream.read(buffer);\r\n istream.close();\r\n json = new String(buffer, \"UTF-8\");\r\n }catch (IOException ex){\r\n ex.printStackTrace();\r\n return null;\r\n }\r\n return json;\r\n }",
"String getJSON();",
"GistUser deserializeUserFromJson(String json);",
"TorrentJsonParser getJsonParser();",
"public JSONObject read(InputStream uploadedInputStream);",
"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 }",
"public void loadJson(String json) throws Exception {\r\n\t\tsetJsonToken(SimpleJson.textToHashMap(json));\r\n\t}",
"@Override\n\t\tpublic Item read(JsonReader in) throws IOException {\n\t\t\tthrow new UnsupportedOperationException(\"Not implemented\");\n\t\t}",
"String getJson();",
"String getJson();",
"String getJson();",
"@Test\n public void readSystemObjectClassAccCrRequest() throws UnsupportedEncodingException, IOException {\n ISystemObject object = Factory.createObject(\"AccountCreationRequest\");\n testJson = gson.toJson(object);\n\n //convert string to input stream\n InputStream inputStream = new ByteArrayInputStream(testJson.getBytes(Charset.forName(\"UTF-8\")));\n //convert inputstream to jsonReader\n JsonReader reader = new JsonReader(new InputStreamReader(inputStream, \"UTF-8\"));\n\n //read json string into resultant\n ISystemObject actual = DataHandler.readSystemObjectClass(reader);\n\n //compare results \n assertEquals(\"Fails to return AccountCreationRequest properly\", object.getClass(), actual.getClass());\n }",
"private static FluidIngredient deserializeObject(JsonObject json) {\n if (json.entrySet().isEmpty()) {\n return EMPTY;\n }\n\n // fluid match\n if (json.has(\"name\")) {\n // don't set both, obviously an error\n if (json.has(\"tag\")) {\n throw new JsonSyntaxException(\"An ingredient entry is either a tag or an fluid, not both\");\n }\n\n // parse a fluid\n return FluidMatch.deserialize(json);\n }\n\n // tag match\n if (json.has(\"tag\")) {\n return TagMatch.deserialize(json);\n }\n\n throw new JsonSyntaxException(\"An ingredient entry needs either a tag or an fluid\");\n }",
"List<Gist> deserializeGistsFromJson(String json);",
"private void readObject() {}",
"private void readObject() {}",
"private void readObject() {}",
"@VisibleForTesting\n interface JsonReader {\n /**\n * Returns the contents of the JSON file that is pointed to by the given {@code resId} as\n * a string.\n *\n * @param context The current Context.\n * @param resId The resource id of the JSON file.\n * @return A string representation of the file or {@code null} if an error occurred.\n */\n @Nullable\n String jsonFileToString(Context context, @RawRes int resId);\n }",
"@Test\n public void readSystemObjectClassMessage() throws UnsupportedEncodingException, IOException {\n ISystemObject object = Factory.createObject(\"Message\");\n testJson = gson.toJson(object);\n\n //convert string to input stream\n InputStream inputStream = new ByteArrayInputStream(testJson.getBytes(Charset.forName(\"UTF-8\")));\n //convert inputstream to jsonReader\n JsonReader reader = new JsonReader(new InputStreamReader(inputStream, \"UTF-8\"));\n\n //read json string into resultant\n ISystemObject actual = DataHandler.readSystemObjectClass(reader);\n\n //compare results \n assertEquals(\"Fails to return Message properly\", object.getClass(), actual.getClass());\n }",
"public static String readJsonObject(String filename) {\r\n\t\tBufferedReader br = null;\r\n\t\tFileReader fr = null;\r\n\t\tStringBuilder sb = new StringBuilder();\r\n\t\tString sCurrentLine;\r\n\t\ttry {\r\n\r\n\t\t\tfr = new FileReader(filename);\r\n\t\t\tbr = new BufferedReader(fr);\r\n\t\t\t\r\n\t\t\twhile ((sCurrentLine = br.readLine()) != null) {\r\n\t\t\t\tsb.append(sCurrentLine);\r\n\t\t\t}\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tif (br != null)\r\n\t\t\t\t\tbr.close();\r\n\t\t\t\tif (fr != null)\r\n\t\t\t\t\tfr.close();\r\n\t\t\t} catch (IOException ex) {\r\n\t\t\t\tex.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn sb.toString();\r\n\t}",
"@GetMapping(\"/getJson\")\r\n\tpublic HashMap<String, Object> getJsonValue() throws IOException {\n\r\n\t\tHashMap<String, Object> globalVariable = null;\r\n\t\tObjectMapper mapper = new ObjectMapper();\r\n\t\tString path = \"rules/backUp.json\";\r\n\r\n\t\tResourceLoader resource = new DefaultResourceLoader();\r\n\t\torg.springframework.core.io.Resource resource2 = resource.getResource(\"classpath:\" + path);\r\n\r\n\t\tReader reader = new InputStreamReader(resource2.getInputStream());\r\n\t\tSystem.out.println(\"reader ouput \" + reader.toString());\r\n\t\tString fileData = FileCopyUtils.copyToString(reader);\r\n\t\tSystem.out.println(\" filedate is \" + fileData);\r\n\r\n\t\tTypeReference<HashMap<String, Object>> typeRef = new TypeReference<HashMap<String, Object>>() {\r\n\t\t};\r\n\t\tHashMap<String, Object> readValue = mapper.readValue(fileData, typeRef);\r\n\t\treturn readValue;\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 JSONArray readFromJSON(){\n\n JSONArray jsonArray=null;\n\n try {\n InputStream inputStream =context.getResources().getAssets().open(FILE_NAME);\n int size = inputStream.available();\n byte[] data = new byte[size];\n inputStream.read(data);\n inputStream.close();\n String json = new String(data, \"UTF-8\");\n jsonArray = new JSONArray(json);\n } catch (IOException e) {\n e.printStackTrace();\n } catch (JSONException e) {\n e.printStackTrace();\n }\n return jsonArray;\n }",
"public void fromJSON(String json) throws JSONException;",
"List<GistComment> deserializeCommentsFromJson(String json);",
"@Test\n void getAndFormatJson() {\n g.getJsonFromGitHub();\n String json = g.getJsonString();\n\n boolean isValid;\n try {\n new Gson().fromJson(json, Object.class);\n isValid = true;\n } catch(com.google.gson.JsonSyntaxException ex) {\n isValid = false;\n }\n assertTrue(isValid, \"Invalid JSON\");\n }",
"@Override\r\n\tpublic void parseJson(JSONObject json) {\n\t\tif(json == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\ttry {\r\n\t\t\ttype = getInt(json,d_type);\r\n\t\t} catch(Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"public final native JSONLoaderObject parse(JavaScriptObject json,String texturePath)/*-{\r\n\treturn this.parse(json,texturePath);\r\n\t}-*/;",
"public static Level readJson(String jsonName) {\n\n InputStream levelInputStream;\n try {\n levelInputStream = new FileInputStream(jsonName);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n return null;\n }\n JsonReader levelReader = Json.createReader(levelInputStream);\n\n JsonObject fileObject = levelReader.readObject();\n JsonObject levelInfo = fileObject.getJsonObject(\"Level Info\");\n JsonObject tiles = fileObject.getJsonObject(\"Tiles\");\n JsonArray rows = (JsonArray) tiles.get(\"rows\");\n\n int rowCount = levelInfo.getInt(\"rowCount\");\n int colCount = levelInfo.getInt(\"columnCount\");\n JsonArray enemies = (JsonArray) levelInfo.get(\"Enemies\");\n Position playerStart = new Position(levelInfo.getInt(\"playerX\"), levelInfo.getInt(\"playerY\"));\n\n AbstractTile[][] tileArray = new AbstractTile[colCount][rowCount];\n\n Iterator<JsonValue> rowsIterator = rows.iterator();\n\n while (rowsIterator.hasNext()) {\n // Convert from jsonValue to jsonObject, then get the array of tiles\n JsonObject currentRowObject = (JsonObject) rowsIterator.next();\n JsonArray currentRow = (JsonArray) currentRowObject.get(\"objects\");\n\n // Iterate through each row of tiles\n Iterator<JsonValue> currentRowIterator = currentRow.iterator();\n while (currentRowIterator.hasNext()) {\n JsonObject currentTile = (JsonObject) currentRowIterator.next();\n JsonValue type = currentTile.get(\"Tile Type\");\n JsonValue row = currentTile.get(\"row\");\n JsonValue column = currentTile.get(\"column\");\n JsonValue rotated = currentTile.get(\"Rotation\");\n boolean isRotated = false;\n if (rotated.toString().equals(\"\\\"Horizontal\\\"\")) {\n isRotated = false;\n } else if (rotated.toString().equals(\"\\\"Vertical\\\"\")) {\n isRotated = true;\n }\n String tileName = type.toString();\n int tileRow = stringToInt(row.toString());\n int tileColumn = stringToInt(column.toString());\n AbstractTile tileObject;\n if (tileName.equals(\"\\\"Key\\\"\")) {\n JsonValue colour = currentTile.get(\"Colour\");\n String tileColour = colour.toString();\n tileColour = tileColour.substring(1, tileColour.length() - 1);\n tileObject = new Key(tileColour);\n } else if (tileName.equals(\"\\\"ExitPortal\\\"\")) {\n tileObject = new ExitPortal();\n } else if (tileName.equals(\"\\\"ExitLock\\\"\")) {\n tileObject = new ExitLock(isRotated);\n } else if (tileName.equals(\"\\\"InfoField\\\"\")) {\n JsonValue infoText = currentTile.get(\"InfoText\");\n String tileInfoText = infoText.toString();\n tileObject = new InfoField(tileInfoText);\n } else if (tileName.equals(\"\\\"LockedDoor\\\"\")) {\n JsonValue colour = currentTile.get(\"Colour\");\n String tileColour = colour.toString();\n tileColour = tileColour.substring(1, tileColour.length() - 1);\n tileObject = new LockedDoor(isRotated, tileColour);\n } else if (tileName.equals(\"\\\"Treasure\\\"\")) {\n tileObject = new Treasure();\n } else if (tileName.equals(\"\\\"DeathTile\\\"\")) {\n tileObject = new DeathTile();\n } else if (tileName.equals(\"\\\"Wall\\\"\")) {\n tileObject = new Wall();\n // Free tile\n } else {\n tileObject = new FreeTile();\n }\n tileArray[tileColumn][tileRow] = tileObject;\n }\n }\n\n ArrayList<AbstractActor> enemiesArrayList = new ArrayList<AbstractActor>();\n\n Iterator<JsonValue> enemiesIterator = enemies.iterator();\n JsonObject currentEnemyObject;\n\n while (enemiesIterator.hasNext()) {\n AbstractActor currentEnemy;\n currentEnemyObject = (JsonObject) enemiesIterator.next();\n int xstartPos = currentEnemyObject.getInt(\"startingX\");\n int ystartPos = currentEnemyObject.getInt(\"startingY\");\n JsonValue aiType = currentEnemyObject.get(\"AI Type\");\n int tickSpeed = currentEnemyObject.getInt(\"Tick Speed\");\n JsonValue movement = currentEnemyObject.get(\"Movement String\");\n\n Position aiStartPos = new Position(xstartPos, ystartPos);\n\n String aiTypeString = aiType.toString();\n String movementString = movement.toString();\n aiTypeString = aiTypeString.substring(1, aiTypeString.length() - 1);\n movementString = movementString.substring(1, movementString.length() - 1);\n\n if (aiTypeString.equals(\"PatternEnemy\")) {\n currentEnemy = new PatternEnemy(aiStartPos, tickSpeed, movementString);\n enemiesArrayList.add(currentEnemy);\n } else if (aiTypeString.equals(\"StalkerEnemy\")) {\n currentEnemy = new StalkerEnemy(aiStartPos, tickSpeed);\n enemiesArrayList.add(currentEnemy);\n }\n\n }\n\n Player returnPlayer = new Player(playerStart);\n Set<AbstractActor> returnEnemies = new HashSet<AbstractActor>();\n returnEnemies.addAll(enemiesArrayList);\n int maxTime = levelInfo.getInt(\"timeLimit\");\n Level returnLevel = new Level(maxTime, returnPlayer, tileArray, returnEnemies);\n return returnLevel;\n\n }",
"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 }",
"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 void parseJSON(String response)\n {\n try\n {\n // Using orj.json, get the file string and convert it to an object\n JSONObject object = (JSONObject) new JSONTokener(response).nextValue();\n\n // The Winnipeg Transit JSON results usually have nested values\n // We can identify the request by the first key of the first level\n\n // The method names() will retrieve an JSONArray with the key names\n JSONArray objectNames = object.names();\n\n // Retrieve the first key of the first level\n String firstKey = objectNames.getString(0);\n\n if (firstKey.equals(\"status\"))\n {\n parseStatus(object.getJSONObject(firstKey));\n }\n else if (firstKey.equals(\"stop-schedule\"))\n {\n parseStopSchedule(object.getJSONObject(firstKey));\n }\n }\n catch (JSONException e)\n {\n e.printStackTrace();\n }\n }",
"private Map<String, Object> readMap(String json) {\n if (StringUtils.isBlank(json)) {\n return new HashMap<>();\n }\n try {\n return new ObjectMapper().readValue(json, HashMap.class);\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }",
"private static ConfigImpl loadJson(Path path) throws IOException {\n final ConfigImpl ret;\n try (FileInputStream stream = new FileInputStream(path.toFile())) {\n try (InputStreamReader reader = new InputStreamReader(stream, UTF_8)) {\n ret = loadJson(reader);\n }\n }\n return ret;\n }",
"public static void main(String[] args) throws IOException{ \n\t\tJsonReader reader = Json.createReader(new FileReader(\"testjson/abcde.json\")); \n\t\tJsonObject jsonob = reader.readObject();\n\t\tSystem.out.println(jsonob.toString());\n\t\tRowColStore parser= new RowColStore(10*1000*1000,\"testjson/abcde.layout\");\n\t\tint objid = 1;\n\t\tparser.insertObject(objid,jsonob,null);\n\t\tparser.insertObject(2,jsonob,null);\n\t\tparser.insertObject(3,jsonob,null);\n\t\t// populate the table \n\n\t\tSystem.out.println(\"get the result out \\n\");\n\t\t// objid, keystr,valstr,valnum,valbool - 5 bytes \n\t\t// read it out \n\t//\tparser.getObject(2);\n\t}",
"private JSONObject readJsonFromUrl(String url) throws IOException, JSONException {\r\n\t\tInputStream is = new URL(url).openStream();\r\n\t\ttry {\r\n\t\t\tBufferedReader rd = new BufferedReader(new InputStreamReader(is, Charset.forName(\"UTF-8\")));\r\n\t\t\tString jsonText = readAll(rd);\r\n\t\t\tJSONObject json = new JSONObject(jsonText);\r\n\t\t\treturn json;\r\n\t\t} finally { //finally will always execute, if an try block exists. Doesnt matter if there is an Exception or not.\r\n\t\t\tis.close();\r\n\t\t}\r\n\t}",
"GistComment deserializeCommentFromJson(String json);",
"@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 }",
"private void readObject() {\n }",
"@Test\r\n public void testRevisionParser() {\r\n JsonParser parser = new JsonParser();\r\n InputStream inputstream = getClass().getClassLoader().getResourceAsStream(\"sample.json\");\r\n assert inputstream != null;\r\n Reader reader = new InputStreamReader(inputstream);\r\n JsonElement rootElement = parser.parse(reader);\r\n JsonObject rootObject = rootElement.getAsJsonObject();\r\n JsonObject pages = rootObject.getAsJsonObject(\"query\").getAsJsonObject(\"pages\");\r\n JsonArray array = null;\r\n for (Map.Entry<String, JsonElement> entry : pages.entrySet()) {\r\n JsonObject entryObject = entry.getValue().getAsJsonObject();\r\n array = entryObject.getAsJsonArray(\"revisions\");\r\n Assert.assertNotNull(array);\r\n }\r\n System.out.println(array);\r\n\r\n }",
"private String loadJSONFromAsset(){\n String json = null;\n AssetManager assetManager = getAssets();\n try{\n InputStream IS = assetManager.open(\"datosFases.json\");\n int size = IS.available();\n byte[] buffer = new byte[size];\n IS.read(buffer);\n IS.close();\n json = new String(buffer,\"UTF-8\");\n\n } catch (IOException ex){\n ex.printStackTrace();\n return null;\n }\n\n return json;\n }",
"private static JSONTile parse(String configFile) {\n Gson gson = new Gson();\n\n try (BufferedReader reader = new BufferedReader(\n new InputStreamReader(new FileInputStream(configFile), StandardCharsets.UTF_8))) {\n return gson.fromJson(reader, JSONTile.class);\n } catch (IOException e) {\n throw new IllegalArgumentException(\"Error when reading file: \" + configFile, e);\n }\n }",
"public String loadJSONFromAsset() {\n String json = null;\n try {\n json = new String(buffer, \"UTF-8\");\n } catch (UnsupportedEncodingException e1) {\n e1.printStackTrace();\n }\n\n return json;\n }",
"public void parseJSONData(Object JSONdata){\n\n\t}",
"T fromJson(Object source);",
"public void loadFromSource(Object aSrc)\n{\n WebURL url = WebURL.getURL(aSrc);\n String jsonText = url.getText();\n loadFromString(jsonText);\n}",
"Map<String, Object> parseToMap(String json);",
"@Test\n public void embedded() throws IOException {\n String obj = \"{\\\"authors\\\":[\\\"Ted\\\", \\\"Mark\\\"],\\\"date\\\": {\\\"year\\\":2013,\\\"month\\\":9}}\";\n JsonLexer l = new JsonLexer(new StringReader(obj));\n JsonParser p = new JsonParser(l);\n Map<String, Object> m = p.parseObject();\n assertEquals(2, m.size());\n\n @SuppressWarnings(\"unchecked\")\n List<String> authors = (List<String>)m.get(\"authors\");\n assertEquals(2, authors.size());\n assertEquals(\"Ted\", authors.get(0));\n assertEquals(\"Mark\", authors.get(1));\n\n @SuppressWarnings(\"unchecked\")\n Map<String, Object> date = (Map<String, Object>)m.get(\"date\");\n assertEquals(2, date.size());\n assertEquals(2013L, date.get(\"year\"));\n assertEquals(9L, date.get(\"month\"));\n }",
"@Test\n public void readUserClassAdmin() throws UnsupportedEncodingException, IOException {\n testJson = gson.toJson(Factory.createUser(\"Administrator\"));\n\n //convert string to input stream\n InputStream inputStream = new ByteArrayInputStream(testJson.getBytes(Charset.forName(\"UTF-8\")));\n //convert inputstream to jsonReader\n JsonReader reader = new JsonReader(new InputStreamReader(inputStream, \"UTF-8\"));\n\n //read json string into resultant\n IUser actual = DataHandler.readUserClass(reader);\n\n //compare results \n assertEquals(\"Fails to return user class properly\", Factory.createUser(\"Administrator\").getClass(), actual.getClass());\n }",
"public static void readFile(String filename) {\n JSONParser jsonParser = new JSONParser();\n try (Reader reader = new FileReader(filename)) {\n JSONObject jo = (JSONObject) jsonParser.parse(reader);\n\n SHORT_PERIOD = (int) (long) jo.get(\"shortPeriod\");\n LONG_PERIOD = (int) (long) jo.get(\"longPeriod\");\n AVG_AMOUNT_PERIOD = (int) (long) jo.get(\"avgAmountPeriod\");\n SESSION_INTERVAL = (int) (long) jo.get(\"sessionInterval\");\n\n\n } catch (IOException | ParseException e) {\n e.printStackTrace();\n }\n }",
"private static User getUserFromJson(String userJson) throws Exception {\n verifyJsonFormatting(userJson);\n ObjectMapper objectMapper = new ObjectMapper();\n return objectMapper.readValue(userJson, User.class);\n }",
"@Test\n public void verifyJsonBackWardCompatible() throws IOException, URISyntaxException, ParseException {\n\n ObjectMapper mapper = new ObjectMapper();\n\n String origJsonDataFile = UserTest.class.getSimpleName() + \"_noDesc.json\";\n String jsonData = ApiTestUtil.readJSONFile(origJsonDataFile);\n\n User u = mapper.readValue(jsonData, User.class);\n assertEquals( Integer.valueOf(56239), u.getId());\n\n String targetJson = mapper.writeValueAsString(u);\n JSONObject json = ApiTestUtil.convertJSONStr2Obj(targetJson);\n JSONObject expectedJson = ApiTestUtil.convertJSONStr2Obj(jsonData);\n\n ApiTestUtil.verifyJson((Map<String, Object>)json, (Map<String, Object>)expectedJson);\n\n }",
"public void load(JSONObject obj);",
"public void convert() throws IOException {\n URL url = new URL(SERVICE + City + \",\" + Country + \"&\" + \"units=\" + Type + \"&\" + \"APPID=\" + ApiID);\n BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));\n String line = reader.readLine();\n // Pobieranie JSON\n\n // Wyciąganie informacji z JSON\n //*****************************************************************\n //Temp\n if (!StringUtils.isBlank(line)) {\n int startIndex = line.indexOf(\"{\\\"temp\\\"\") + 8;\n int endIndex = line.indexOf(\",\\\"feels_like\\\"\");\n temperature = line.substring(startIndex, endIndex);\n // System.out.println(temperature);\n }\n //Min temp\n if (!StringUtils.isBlank(line)) {\n int startIndex = line.indexOf(\",\\\"temp_min\\\"\") + 12;\n int endIndex = line.indexOf(\",\\\"temp_max\\\"\");\n temperatureMin = line.substring(startIndex, endIndex);\n // System.out.println(temperatureMin);\n }\n //Max temp\n if (!StringUtils.isBlank(line)) {\n int startIndex = line.indexOf(\"\\\"temp_max\\\":\") + 11;\n int endIndex = line.indexOf(\",\\\"pressure\\\"\");\n temperatureMax = line.substring(startIndex, endIndex);\n //System.out.println(temperatureMax);\n }//todo dodaj więcej informacji takich jak cisnienie i takie tam\n //*****************************************************************\n }",
"void validateJson();",
"protected List<Product> readJsonStream(FileInputStream fi) {\n\t\tJsonReader reader = new JsonReader(new InputStreamReader(fi));\n\n\t\ttry {\n\n\t\t\treturn readProductArray(reader);\n\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\treader.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}",
"public void retrieveData(){\n\t\tloaderImage.loadingStart();\n\t\tJsonClient js = new JsonClient();\n\t\tjs.retrieveData(JSON_URL, this);\n\t}",
"public static void main(String[] args) {\n\t\tStorageEntity sto = new StorageEntity();\r\n\t\tsto.setProductid(1);\r\n\t\tsto.setSkuid(1);\r\n\t\tsto.setSku(\"TEST\");\r\n\t\tsto.setQtycan(10);\r\n\t\tsto.setQty(12);\r\n\t\t// JAVA对象转JSONObject\r\n\t\tJSONObject json = JSONObject.parseObject(sto.toString());\r\n\t\tSystem.out.println(json.toString());\r\n\r\n\t\t// JSONObjectString转JAVA对象\r\n\t\tStorageEntity sto2 = JSONObject.parseObject(json.toJSONString(), StorageEntity.class);\r\n\t\tSystem.out.println(sto2.toString());\r\n\t\t// JSONObject转JAVA对象\r\n\t\tsto2 = JSONObject.toJavaObject(json, StorageEntity.class);\r\n\t\tSystem.out.println(sto2.toString());\r\n\t\tSystem.out.println(JSON.parseObject(json.toString(), TreeMap.class));\r\n\r\n\t\t// JSONArrayString转List\r\n\t\tList<StorageEntity> stos = new ArrayList<StorageEntity>();\r\n\t\tstos.add(sto);\r\n\t\tsto = new StorageEntity();\r\n\t\tsto.setProductid(2);\r\n\t\tsto.setSkuid(2);\r\n\t\tsto.setSku(\"TEST2\");\r\n\t\tsto.setQtycan(20);\r\n\t\tsto.setQty(22);\r\n\t\tstos.add(sto);\r\n\t\tList<StorageEntity> stos2 = JSONArray.parseArray(stos.toString(), StorageEntity.class);\r\n\t\tSystem.out.println(stos2);\r\n\t\tJSONArray j = JSONArray.parseArray(stos2.toString());\r\n\t\tSystem.out.println(j);\r\n\r\n\t\t// json转带有Bean和List参数的java对象\r\n\t\tStorageGetResponse storages = new StorageGetResponse();\r\n\t\tstorages.setResult(stos);\r\n\t\tstorages.setCode(100);\r\n\t\tstorages.getDetail().setDesc(\"test\");\r\n\t\tstorages.getDetail().setDescription(\"测试\");\r\n\t\tStorageGetResponse storage = JSONObject.parseObject(storages.toString(), StorageGetResponse.class);\r\n\t\tSystem.out.println(storage);\r\n\r\n\t\t// 将JSONArray文件转换为List\r\n\t\tSystem.out.println(FileUtil.filetoListFromJSONArray(\"D:/Document/test.json\", BaseRequest.class));\r\n\t}",
"private static JSONObject readJsonFromUrl(String url) throws IOException, JSONException {\n\t\tInputStream is = new URL(url).openStream();\n\t\ttry {\n\t\t\tBufferedReader rd = new BufferedReader(new InputStreamReader(is, Charset.forName(\"UTF-8\")));\n\t\t\tString jsonText = readAll(rd);\n\t\t\tJSONObject json = new JSONObject(jsonText);\n\t\t\treturn json;\n\t\t} finally {\n\t\t\tis.close();\n\t\t}\n\t}",
"@Override\n public PvCard read(JsonReader in) throws IOException {\n try {\n return readPvCard(in); //or\n// return readPvCardViaTypeToken(in); // getting a PvCard object , use {@Link TypeToken}\n } finally {\n in.close();\n }\n }",
"@Test\n public void testFromJson() {\n String rawTxJson = \"{\\n\" +\n \" \\\"tx_id\\\": \\\"88367f8df0e3bbb0027b1133b3de36ab779e26af00fc256bde7228c9727d20ef\\\",\\n\" +\n \" \\\"version\\\": 1,\\n\" +\n \" \\\"size\\\": 236,\\n\" +\n \" \\\"time_range\\\": 1521625823,\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"type\\\": \\\"spend\\\",\\n\" +\n \" \\\"asset_id\\\": \\\"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\\\",\\n\" +\n \" \\\"asset_definition\\\": {},\\n\" +\n \" \\\"amount\\\": 100000000000,\\n\" +\n \" \\\"control_program\\\": \\\"0014f54622eeb837e39d359f7530b6fbbd7256c9e73d\\\",\\n\" +\n \" \\\"address\\\": \\\"sm1q74rz9m4cxl3e6dvlw5ctd7aawftvneeaqsuq3v\\\",\\n\" +\n \" \\\"spent_output_id\\\": \\\"34d739d5020d7e92477222b652e8fbe08467f5eb03700ce2ef57752930b05ff1\\\",\\n\" +\n \" \\\"input_id\\\": \\\"4ae0a25ea92e8c2749099576a234e7dfacb643597545873549c5000ba83fdd9a\\\"\\n\" +\n \" }\\n\" +\n \" ],\\n\" +\n \" \\\"outputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"type\\\": \\\"control\\\",\\n\" +\n \" \\\"id\\\": \\\"8a511581e2fb6986abc3be3bbd842434f642db7c56a1fc5c4c7adf93c750e9a4\\\",\\n\" +\n \" \\\"position\\\": 0,\\n\" +\n \" \\\"asset_id\\\": \\\"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\\\",\\n\" +\n \" \\\"asset_definition\\\": {},\\n\" +\n \" \\\"amount\\\": 99959999500,\\n\" +\n \" \\\"control_program\\\": \\\"00144453a011caf735428d0291d82b186e976e286fc1\\\",\\n\" +\n \" \\\"address\\\": \\\"sm1qg3f6qyw27u659rgzj8vzkxrwjahzsm7pyjen5j\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"type\\\": \\\"control\\\",\\n\" +\n \" \\\"id\\\": \\\"03b6ac529c2d1c7d422a7c063d74893e8ca2003b2b3368c27d0ede2d2f6ea3ba\\\",\\n\" +\n \" \\\"position\\\": 1,\\n\" +\n \" \\\"asset_id\\\": \\\"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\\\",\\n\" +\n \" \\\"asset_definition\\\": {},\\n\" +\n \" \\\"amount\\\": 500,\\n\" +\n \" \\\"control_program\\\": \\\"0014613908c28df499e3aa04e033100efaa24ca8fd01\\\",\\n\" +\n \" \\\"address\\\": \\\"sm1qvyus3s5d7jv782syuqe3qrh65fx23lgpzf33em\\\"\\n\" +\n \" }\\n\" +\n \" ],\\n\" +\n \" \\\"fee\\\": 40000000\\n\" +\n \" }\";\n RawTransaction decodedTx = RawTransaction.fromJson(rawTxJson);\n System.out.println(decodedTx.toJson());\n }",
"public String loadJSONFromAsset(Context context) {\n json = null;\n try {\n InputStream is = getApplicationContext().getAssets().open(\"techdrop.json\");\n int size = is.available();\n byte[] buffer = new byte[size];\n is.read(buffer);\n is.close();\n json = new String(buffer, \"UTF-8\");\n } catch (IOException ex) {\n ex.printStackTrace();\n return null;\n }\n return json;\n }"
] | [
"0.71090853",
"0.69922364",
"0.68872875",
"0.6731171",
"0.6713229",
"0.6598767",
"0.65959084",
"0.6583266",
"0.65578794",
"0.65556747",
"0.65263784",
"0.6523337",
"0.65222555",
"0.6494757",
"0.6493124",
"0.64748937",
"0.64748293",
"0.6437212",
"0.64137495",
"0.63764054",
"0.63734215",
"0.6370033",
"0.63548696",
"0.63363963",
"0.6329773",
"0.63134027",
"0.6301727",
"0.6297741",
"0.6279943",
"0.6265223",
"0.6260203",
"0.6253494",
"0.62198853",
"0.62120366",
"0.6209856",
"0.62037224",
"0.6170229",
"0.6165816",
"0.6150265",
"0.6148269",
"0.61452043",
"0.61357874",
"0.61296487",
"0.6126383",
"0.6125709",
"0.6125569",
"0.6125512",
"0.6112917",
"0.6112917",
"0.6112917",
"0.608528",
"0.60786206",
"0.60699683",
"0.6053231",
"0.6053231",
"0.6053231",
"0.60416985",
"0.60372394",
"0.6020946",
"0.60135597",
"0.6008586",
"0.5993385",
"0.5990499",
"0.5985803",
"0.5971274",
"0.5970519",
"0.5956206",
"0.59556955",
"0.59417456",
"0.59417444",
"0.5941617",
"0.59314144",
"0.5930902",
"0.59112394",
"0.59105974",
"0.59087723",
"0.5903504",
"0.58982563",
"0.5896952",
"0.58957416",
"0.5884641",
"0.5874765",
"0.5872338",
"0.5872163",
"0.58614594",
"0.58593905",
"0.58593386",
"0.5856813",
"0.5849537",
"0.5843163",
"0.58315486",
"0.58253086",
"0.5823211",
"0.5823155",
"0.5817416",
"0.5813579",
"0.5807173",
"0.58012843",
"0.57955545",
"0.5793139",
"0.578227"
] | 0.0 | -1 |
Utility method to read the contents of a text file | private String readFully(String filename) throws IOException{
BufferedReader reader = new BufferedReader(new FileReader(filename));
StringBuilder buf=new StringBuilder();
char[] data=new char[8192];
int num=reader.read(data);
while(num>-1){
buf.append(data,0,num);
num=reader.read(data);
}
return buf.toString();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"String readText(FsPath path);",
"private void ReadTextFile(String FilePath) {\n\t\t\n\t\t\n\t}",
"public String readTextFromFile()\n\t{\n\t\tString fileText = \"\";\n\t\tString filePath = \"/Users/zcon5199/Documents/\";\n\t\tString fileName = filePath + \"saved text.txt\";\n\t\tFile inputFile = new File(fileName);\n\t\t\n\t\ttry\n\t\t{\n\t\t\tScanner fileScanner = new Scanner(inputFile);\n\t\t\twhile(fileScanner.hasNext())\n\t\t\t{\n\t\t\t\tfileText += fileScanner.nextLine() + \"\\n\";\n\t\t\t}\n\t\t\t\n\t\t\tfileScanner.close();\n\t\t\t\n\t\t}\n\t\tcatch(FileNotFoundException fileException)\n\t\t{\n\t\t\tJOptionPane.showMessageDialog(baseFrame, \"the file is not here :/\");\n\t\t}\n\t\t\n\t\treturn fileText;\n\t}",
"public void readTextFile(String path) throws IOException {\n FileReader fileReader=new FileReader(path);\n BufferedReader bufferedReader=new BufferedReader(fileReader);\n String value=null;\n while((value=bufferedReader.readLine())!=null){\n System.out.println(value);\n }\n }",
"public String getFileText(String filePath) {\n String fileText = \"\"; \n \n File myFile = new File(filePath);\n Scanner myReader; \n \n try {\n myReader = new Scanner(myFile);\n \n while(myReader.hasNext()) {\n fileText+= myReader.nextLine() + \"\\n\"; \n }\n \n } catch (FileNotFoundException ex) {\n logger.log(Level.SEVERE, \"Error getting text from text file\", ex.getMessage()); \n }\n \n return fileText; \n }",
"public static String readTextStream(String filename) throws IOException {\n StringBuffer sb = new StringBuffer();\n BufferedReader fileReader = new BufferedReader(new InputStreamReader(FileHelper.class.getClassLoader().getResourceAsStream(filename)));\n FileHelper.read(sb, fileReader);\n return sb.toString();\n }",
"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 }",
"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}",
"private static String readTextFile(File file) throws IOException {\n return Files.lines(file.toPath()).collect(Collectors.joining(\"\\n\"));\n }",
"public List<String> readFileContents(String filePath) throws APIException;",
"public String readFileContents(String filename) {\n return null;\n\n }",
"@Test\n\tpublic void testReadTxtFile() throws FileNotFoundException {\n\t\tFileParser fp = new FileParser();\n\t\tArrayList<String> parsedLines = fp.readTxtFile(\"test.txt\");\n\t\tassertEquals(\"This is a test file\", parsedLines.get(0));\n\t\tassertEquals(\"University of Virginia\", parsedLines.get(1));\n\n\t\tArrayList<String> parsedWords = fp.readTxtFile(\"test1.txt\");\n\t\tassertEquals(\"test\", parsedWords.get(0));\n\t\tassertEquals(\"file\", parsedWords.get(1));\n\t}",
"public String readText(String _filename) {\r\n\t\treturn readText(_filename, \"text\", (java.net.URL) null);\r\n\t}",
"public String[] openFile() throws IOException\n\t{\n\t\t//Creates a FileReader and BufferedReader to read from the file that you pass it\n\t\tFileReader fr = new FileReader(path);\n\t\tBufferedReader textReader = new BufferedReader(fr);\n\t\t\n\t\t//Set the variable to the number of lines in the text file through the function in this class that is defined below\n\t\tnumberOfLines = readLines();\n\t\t//Creates an array of strings with size of how many lines of data there are in the file\n\t\tString[] textData = new String[numberOfLines];\n\t\t\n\t\t//Loop to read the lines from the text file for the song data\n\t\tfor (int i = 0; i < numberOfLines; i++)\n\t\t{\n\t\t\t//Read data from song file and into the string list\n\t\t\ttextData[i] = textReader.readLine();\n\t\t}\n\t\t\n\t\t//Close the BufferedReader that was opened\n\t\ttextReader.close();\n\t\t\n\t\t//Return the read data from the text file in the form of a string array\n\t\treturn textData;\n\t}",
"public static String readTextFile(File file) throws IOException {\n StringBuffer sb = new StringBuffer();\n BufferedReader fileReader = new BufferedReader(new FileReader(file));\n FileHelper.read(sb, fileReader);\n return sb.toString();\n }",
"private String readFile(String file) throws IOException {\n StringBuilder contentBuilder = new StringBuilder();\n\n try (Stream<String> stream = Files.lines(Paths.get(file), StandardCharsets.UTF_8)) {\n stream.forEach(s -> contentBuilder.append(s));\n }\n\n return contentBuilder.toString();\n\n }",
"public String readFile(File file) {\r\n\t\tString line;\r\n\t\tString allText = \"\";\r\n\r\n\t\ttry (BufferedReader br = new BufferedReader(new FileReader(file))) {\r\n\r\n\t\t\twhile ((line = br.readLine()) != null) {\r\n\r\n\t\t\t\tallText += line + \"\\n\";\r\n\r\n\t\t\t}\r\n\r\n\t\t} catch (FileNotFoundException e) {\r\n\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\treturn allText;\r\n\t}",
"public String ReadFile() throws IOException {\n File file = context.getFilesDir();\n File textfile = new File(file + \"/\" + this.fileName);\n\n FileInputStream input = context.openFileInput(this.fileName);\n byte[] buffer = new byte[(int)textfile.length()];\n\n input.read(buffer);\n\n return new String(buffer);\n }",
"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 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 static String getTextFromFile(File file) {\n InputStream fis = null;\n InputStreamReader isr = null;\n BufferedReader bufferedReader = null;\n StringBuilder sb = new StringBuilder(\"\");\n try {\n fis = new FileInputStream(file);\n isr = new InputStreamReader(fis);\n bufferedReader = new BufferedReader(isr);\n String line;\n while ((line = bufferedReader.readLine()) != null) sb.append(line);\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n if (fis != null && isr != null && bufferedReader != null) {\n try {\n fis.close();\n isr.close();\n bufferedReader.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n return sb.toString();\n }",
"public void readFile();",
"public abstract TextDocument getTextDocumentFromFile(String path) throws FileNotFoundException, IOException;",
"List readFile(String pathToFile);",
"public static String readFile(String path) {\n String contents = \"\";\n try {\n BufferedReader br = new BufferedReader(new FileReader(path));\n\n StringBuilder sb = new StringBuilder();\n String line = br.readLine();\n while (line != null) {\n sb.append(line);\n sb.append(System.lineSeparator());\n line = br.readLine();\n }\n contents = sb.toString();\n br.close();\n } catch (Exception e) {\n System.out.println(e.toString());\n System.exit(1);\n }\n return contents;\n }",
"@Override\n\tpublic void ReadTextFile() {\n\t\t// Using Buffered Stream I/O\n\t\ttry (BufferedInputStream in = new BufferedInputStream(new FileInputStream(inFileStr))) {\n\t\t\tbyte[] contents = new byte[bufferSize];\n\t\t\tstartTime = System.nanoTime();\n\t\t\tint bytesCount;\n\t\t\twhile ((bytesCount = in.read(contents)) != -1) {\n\t\t\t\tsnippets.add(new String(contents));\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 String read() {\n\t\tStringBuffer text = new StringBuffer((int)file.length());\n\t\ttry {\n\t\t\tFileReader fr = new FileReader(file);\n\t\t\tBufferedReader b = new BufferedReader(fr);\n\t\t\tboolean eof = false;\n\t\t\tString line;\n\t\t\tString ret = \"\\n\";\n\t\t\twhile (!eof) {\n\t\t\t\tline = b.readLine();\n\t\t\t\tif (line == null) {\n\t\t\t\t\teof = true;\n\t\t\t\t} else {\n\t\t\t\t\ttext.append(line);\n\t\t\t\t\ttext.append(ret);\n\t\t\t\t}\n\t\t\t}\n\t\t\tb.close();\n\t\t} catch (IOException e) {\n\t\t\tthrow new IllegalArgumentException(\"File \" + file.getName() +\n\t\t\t\t\" is unreadable : \" + e.toString());\n\t\t}\n\t\treturn text.toString();\n\t}",
"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 }",
"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 }",
"@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 static String readTextFile(File file) {\n\n\t\tBufferedInputStream bis = null;\n\t\tFileInputStream fis = null;\n\t\tStringBuffer sb = new StringBuffer();\n\t\ttry {\n\t\t\t// FileInputStream to read the file\n\t\t\tfis = new FileInputStream(file);\n\n\t\t\t/*\n\t\t\t * Passed the FileInputStream to BufferedInputStream For Fast read\n\t\t\t * using the buffer array.\n\t\t\t */\n\t\t\tbis = new BufferedInputStream(fis);\n\n\t\t\t/*\n\t\t\t * available() method of BufferedInputStream returns 0 when there\n\t\t\t * are no more bytes present in the file to be read\n\t\t\t */\n\t\t\twhile (bis.available() > 0) {\n\t\t\t\tsb.append((char) bis.read());\n\t\t\t}\n\n\t\t} catch (FileNotFoundException fnfe) {\n\t\t\tSystem.out.println(\"The specified file not found\" + fnfe);\n\t\t} catch (IOException ioe) {\n\t\t\tSystem.out.println(\"I/O Exception: \" + ioe);\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (bis != null && fis != null) {\n\t\t\t\t\tfis.close();\n\t\t\t\t\tbis.close();\n\t\t\t\t}\n\t\t\t} catch (IOException ioe) {\n\t\t\t\tSystem.out.println(\"Error in InputStream close(): \" + ioe);\n\t\t\t}\n\t\t}\n\t\treturn sb.toString();\n\n\t}",
"public String textExtractor(String filePath) {\n\n StringBuilder textBuilder = new StringBuilder();\n try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(getClass().getResourceAsStream(\"/\" + filePath), \"UTF-8\"))) {\n while (bufferedReader.ready()) {\n textBuilder.append(bufferedReader.readLine()).append(\"/n\");\n }\n\n } catch (IOException exc) {\n exc.printStackTrace();\n }\n return textBuilder.toString();\n }",
"public static String readFileContent(String fileName){\r\n String str=null;\r\n BufferedReader reader=null;\r\n try {\r\n reader=new BufferedReader(new FileReader(fileName));\r\n str=reader.readLine();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }finally{\r\n if(reader!=null){\r\n try {\r\n reader.close();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n }\r\n return str;\r\n }",
"@SuppressWarnings(\"unused\")\n private String readFile(File f) throws IOException {\n BufferedReader reader = new BufferedReader(new FileReader(f));\n String line = reader.readLine();\n StringBuilder builder = new StringBuilder();\n while (line != null) {\n builder.append(line).append('\\n');\n line = reader.readLine();\n }\n reader.close();\n return builder.toString();\n }",
"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 }",
"public String getContents(File file) {\n\t //...checks on file are elided\n\t StringBuilder contents = new StringBuilder();\n\t \n\t try {\n\t //use buffering, reading one line at a time\n\t //FileReader always assumes default encoding is OK!\n\t BufferedReader input = new BufferedReader(new FileReader(file));\n\t try {\n\t String line = null; \n\n\t while (( line = input.readLine()) != null){\n\t contents.append(line);\n\t contents.append(\"\\r\\n\");\t }\n\t }\n\t finally {\n\t input.close();\n\t }\n\t }\n\t catch (IOException ex){\n\t log.error(\"Greska prilikom citanja iz fajla: \"+ex);\n\t }\n\t \n\t return contents.toString();\n\t}",
"private static void ReadText(String path) {\n\t\t//reads the file, throws an error if there is no file to open\n\t\ttry {\n\t\t\tinput = new Scanner(new File(path));\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Error opening file...\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t\tString line; //stores the string of text from the .txt file\n\t\tString parsedWord; //Stores the word of the parsed word\n\t\tint wordLength; //Stores the length of the word\n\t\tint lineNum = 1; //Stores the number of line\n\t\ttry {\n\t\t\t//loops while there is still a new line in the .txt file\n\t\t\twhile ((line = input.nextLine()) != null) {\n\t\t\t\t//separates the lines by words\n\t\t\t\tStringTokenizer st = new StringTokenizer(line);\n\t\t\t\t//loops while there are still more words in the line\n\t\t\t\twhile (st.hasMoreTokens()) {\n\t\t\t\t\tparsedWord = st.nextToken();\n\t\t\t\t\twordLength = parsedWord.length();\n\t\t\t\t\t//Regex gets rid of all punctuation\n\t\t\t\t\tif (parsedWord.matches(\".*\\\\p{Punct}\")) {\n\t\t\t\t\t\tparsedWord = parsedWord.substring(0, wordLength - 1);\n\t\t\t\t\t}\n\t\t\t\t\t//add the word to the list\n\t\t\t\t\twordList.add(parsedWord);\n\t\t\t\t\tlineList.add(lineNum);\n\t\t\t\t}\n\t\t\t\tlineNum++;\n\t\t\t}\n\t\t} catch (NoSuchElementException e) {\n\t\t\t//Do nothing\n\t\t}\n\t\tinput.close();\n\t}",
"public String[] getFile() throws IOException {\n\t\n\t\n\ttry {\n\tFileReader reader = new FileReader(path);\n\tBufferedReader textReader = new BufferedReader(reader); // creates buffered file reader again\n\t\n\tint numberOfLines = getLines(); // calls the method above to know how many lines there are\n\tString[ ] textData = new String[numberOfLines]; //creates an array the size of the amount of lines the file has\n\t\n\tfor (int i=0; i < numberOfLines; i++) {\n\t\ttextData[ i ] = textReader.readLine(); // go through file and read each line into its own array space\n\t\t}\n\t\n\ttextReader.close( ); //reader is done\n\treturn textData; // return array\n\t} catch (IOException e) {\n\t\tString[] exceptionString = new String[1];\n\t\texceptionString[0] = \"nothing\";\n\t\treturn exceptionString;\n\t}\n}",
"private static String getText(IFile file) throws CoreException, IOException {\n\t\tInputStream in = file.getContents();\n\t\tByteArrayOutputStream out = new ByteArrayOutputStream();\n\t\tbyte[] buf = new byte[1024];\n\t\tint read = in.read(buf);\n\t\twhile (read > 0) {\n\t\t\tout.write(buf, 0, read);\n\t\t\tread = in.read(buf);\n\t\t}\n\t\treturn out.toString();\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 }",
"private static String readFileContents(File file) throws FileNotFoundException {\n StringBuilder fileContents = new StringBuilder((int) file.length());\n\n try (Scanner scanner = new Scanner(file)) {\n while (scanner.hasNext()) {\n fileContents.append(scanner.next());\n }\n return fileContents.toString();\n }\n }",
"public String readFile(){\n\t\tString res = \"\";\n\t\t\n\t\tFile log = new File(filePath);\n\t\tBufferedReader bf = null;\n\t\t\n\t\ttry{\n\t\t\tbf = new BufferedReader(new FileReader(log));\n\t\t\tString line = bf.readLine();\n\t\t\n\t\t\n\t\t\twhile (line != null){\n\t\t\t\tres += line+\"\\n\";\n\t\t\t\tline = bf.readLine();\n\t\t\t}\n\t\t\n\t\t\treturn res;\n\t\t}\n\t\tcatch(Exception oops){\n\t\t\tSystem.err.println(\"There was an error reading the file \"+oops.getStackTrace());\n\t\t\treturn \"\";\n\t\t}\n\t\tfinally{\n\t\t\ttry {\n\t\t\t\tbf.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.err.println(\"There was an error closing the read Buffer \"+e.getStackTrace());\n\t\t\t}\n\t\t}\n\t}",
"private static String readFile(String path) throws IOException {\n\t\ttry (BufferedReader br = new BufferedReader(new FileReader(new File(path)))) {\n\t\t\tStringBuilder input = new StringBuilder();\n\t\t\tString tmp; while ((tmp = br.readLine()) != null) input.append(tmp+\"\\n\");\n\t\t\treturn input.toString();\n\t\t}\n\t}",
"public String readFileContent(File file) {\n StringBuilder fileContentBuilder = new StringBuilder();\n if (file.exists()) {\n String stringLine;\n try {\n FileReader fileReader = new FileReader(file);\n BufferedReader bufferedReader = new BufferedReader(fileReader);\n while ((stringLine = bufferedReader.readLine()) != null) {\n fileContentBuilder.append(stringLine + \"\\n\");\n }\n bufferedReader.close();\n fileReader.close();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n return fileContentBuilder.toString();\n }",
"private List<String> readFile(String path) throws IOException {\n return Files.readAllLines (Paths.get (path), StandardCharsets.UTF_8);\n }",
"private static List<String> readFile(File file) throws IOException {\n return Files.readAllLines(file.toPath());\n }",
"private static List<String> readFile(File file) throws IOException {\n return Files.readAllLines(file.toPath());\n }",
"private static BufferedReader getFileContents(String path) throws FileNotFoundException{\n\t\tFile file = new File(path);\n\t\treturn new BufferedReader(new FileReader(file));\t\n\t}",
"public static ArrayList<String> textToStr(String path) throws IOException {\n ArrayList<String> lines = new ArrayList<>();\n try{\n File file = new File(path);\n FileReader fr = new FileReader(file);\n BufferedReader bufr = new BufferedReader(fr);\n String line = \"\";\n while((line = bufr.readLine()) != null){\n if(line.trim() != null && line.trim().length() > 0){\n lines.add(line.trim());\n }\n }\n return lines;\n }\n catch (Exception e){\n System.out.println(\"The path is wrong or the input file does not exist. Try again.\\n\");\n return null;\n }\n }",
"static Stream<String> readIn(File file) \r\n\t{\r\n\t\ttry \r\n\t\t{\r\n\t\t\treturn Files.readAllLines(file.toPath()).stream();\r\n\t\t} \r\n\t\tcatch (IOException ioe) \r\n\t\t{\r\n\t\t\tthrow new UncheckedIOException(ioe);\r\n\t\t}\r\n\t}",
"public List<String> readFile() {\n \n try {\n ensureFileExists();\n return Files.readAllLines(filePath);\n } catch (FileNotFoundException ex) {\n return new ArrayList<>();\n } catch (IOException ex) {\n ex.printStackTrace();\n return new ArrayList<>();\n }\n }",
"public String read(File file) throws IOException {\n\t\t\tInputStream is = null;\r\n\t\t\tis = new FileInputStream(file);\r\n\t\t\t\r\n\t\t\tAccessTextFile test = new AccessTextFile();\r\n//\t\t\tInputStream is = new FileInputStream(\"E:\\\\test.txt\");\r\n\t\t\tStringBuffer buffer = new StringBuffer();\r\n\t\t\ttest.readToBuffer(buffer, is);\r\n\t\t\tSystem.out.println(buffer); // 将读到 buffer 中的内容写出来\r\n\t\t\tis.close();\t\t\r\n\t\t\treturn buffer.toString();\r\n\t\t }",
"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 String readFromFile() throws IOException {\n return br.readLine();\n }",
"public String readFileIntoString(String filepath) throws IOException;",
"public static String readFile(final String name) {\n FileReader fileReader = null;\n final StringBuilder contents = new StringBuilder();\n try {\n final File file = new File(name);\n if (!file.exists()) {\n throw new IllegalArgumentException(\"File \" + name + \" does not exist\");\n }\n fileReader = new FileReader(file);\n final BufferedReader reader = new BufferedReader(fileReader);\n String inputLine = reader.readLine();\n while (inputLine != null) {\n contents.append(inputLine).append(\"\\n\");\n inputLine = reader.readLine();\n }\n reader.close();\n } catch (final IOException i1) {\n LOG.severe(\"Can't open file:\" + name);\n }\n return contents.toString();\n }",
"public String readFile(String filePath)\n {\n String result = \"\";\n try {\n\n FileReader reader = new FileReader(filePath);\n Scanner scanner = new Scanner(reader);\n\n while(scanner.hasNextLine())\n {\n result += scanner.nextLine();\n }\n reader.close();\n }\n catch(FileNotFoundException ex)\n {\n System.out.println(\"File not found. Please contact the administrator.\");\n }\n catch (Exception ex)\n {\n System.out.println(\"Some error occurred. Please contact the administrator.\");\n }\n return result;\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 }",
"public String readFile(String filename)\n {\n StringBuilder texts = new StringBuilder();\n \n try \n {\n FileReader inputFile = new FileReader(filename);\n Scanner parser = new Scanner(inputFile);\n \n while (parser.hasNextLine())\n {\n String line = parser.nextLine();\n texts.append(line + \";\");\n }\n \n inputFile.close();\n parser.close();\n return texts.toString();\n \n }\n \n catch(FileNotFoundException exception) \n {\n String error = filename + \" not found\";\n System.out.println(error);\n return error;\n }\n \n catch(IOException exception) \n {\n String error = \"Unexpected I/O error occured\";\n System.out.println(error); \n return error;\n } \n }",
"public static void reading(String fileName)\n {\n\n }",
"public static String readFileAsString(String filePath, String encoding) {\n\t\tbyte[] buffer = new byte[(int) new File(filePath).length()];\n\t\tBufferedInputStream f = null;\n\t\ttry {\n\t\t\tFile file = new File(filePath);\n\t\t\tfor (int attempt = 0; attempt < 3; attempt++) {\n\t\t\t\tif (file.exists()) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tThread.sleep(2);\n\t\t\t}\n\n\t\t\tif (!file.exists()) {\n\t\t\t\tSystem.err.println(\"\\nfile not found: \" + filePath);\n\t\t\t\tthrow new FileNotFoundException(\"Could not find file: \" + filePath);\n\t\t\t}\n\n\t\t\tf = new BufferedInputStream(new FileInputStream(filePath));\n\t\t\tf.read(buffer);\n\t\t} catch (IOException e) {\n\t\t\tthrow new UncheckedExecutionException(e);\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tif (f != null)\n\t\t\t\ttry {\n\t\t\t\t\tf.close();\n\t\t\t\t} catch (IOException ignored) {\n\t\t\t\t}\n\t\t}\n\t\tString contents = null;\n\t\ttry {\n\t\t\tcontents = new String(buffer, encoding);\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn contents;\n\t}",
"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 static List<String> readIn(String filename) throws Exception {\r\n Path filePath = new File(filename).toPath();\r\n Charset charset = Charset.defaultCharset(); \r\n List<String> stringList = Files.readAllLines(filePath, charset);\r\n\r\n return stringList;\r\n }",
"public void readFromFile() {\n\n\t}",
"String[] readFile(String path) {\n ArrayList<String> list = new ArrayList<>();\n String[] output = null;\n Scanner reader;\n File file;\n\n try {\n file = new File(path);\n reader = new Scanner(file);\n while (reader.hasNextLine()) {\n list.add(reader.nextLine());\n }\n output = new String[list.size()];\n for (int i = 0; i < list.size(); i++) output[i] = list.get(i);\n reader.close();\n } catch (FileNotFoundException e) {\n System.out.println(\"File not found exception\");\n }\n return output;\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(s -> contentBuilder.append(s));\n }\n\n return contentBuilder.toString();\n }",
"public static String getText(File file) {\n\t try {\n\t StringBuilder builder = new StringBuilder();\n\t BufferedReader input = new BufferedReader(new FileReader(file));\n\t try {\n\t String lineSeparator = System.getProperty(\"line.separator\");\n\t if (lineSeparator == null) {\n\t lineSeparator = \"\\n\";\n\t }\n\t for (String line; (line = input.readLine()) != null; ) {\n\t builder.append(line);\n\t builder.append(lineSeparator);\n\t }\n\t return builder.toString();\n\t } finally {\n\t input.close();\n\t }\n\t } catch (Exception e) {\n\t throw new RuntimeException(e.getMessage(), e);\n\t }\n\t }",
"public void readText(String filename) throws IOException{\n\t\t\n\t\tif(sentences == null){\n\t\t\tsentences = new ArrayList<Sentence>();\n\t\t}\n\t\t\n\t\t//read from file\n\t\tFileInputStream inputStream = new FileInputStream(filename);\n\t\tDataInputStream stream = new DataInputStream(inputStream);\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(stream));\n\t\tString line;\n\t\twhile((line = reader.readLine()) != null){\n\t\t\tsentences.add(new Sentence(line));\n\t\t}\n\t\treader.close();\n\t\tstream.close();\n\t\tinputStream.close();\n\t\t\n\t\t\n\t}",
"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 }",
"protected String openReadFile(Path filePath) throws IOException{\n\t\tString line;\n\t\tStringBuilder sb = new StringBuilder();\n\t\t// Read the document\n\t\tBufferedReader reader = Files.newBufferedReader(filePath, ENCODING);\n\t\t// Append each line in the document to our string\n\t\twhile ((line = reader.readLine()) != null) {\n\t\t\tsb.append(line);\n\t\t\tsb.append(\"\\n\"); // readLine discards new-row characters, re-append them.\n\t\t}\n\t\tif(sb.length() != 0){\n\t\t\tsb.deleteCharAt(sb.length()-1); // However last line doesn't contain one, remove it.\n\t\t}\n\t\treader.close();\n\t\treturn new String(sb.toString());\n\t}",
"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}",
"static void read()\n\t\t{\n\n\n\t\t\tString content=new String();\n\t\t\ttry {\n\t\t\t\tFile file=new File(\"Dic.txt\");\n\t\t\t\tScanner scan=new Scanner(file);\n\t\t\t\twhile(scan.hasNextLine()) {\n\t\t\t\t\tcontent=scan.nextLine();\n\t\t\t\t//\tSystem.out.println(content);\n\n\t\t\t\t//\tString [] array=content.split(\" \");\n\t\t\t\t\tlist.add(content.trim());\n\n\t\t\t\t}\n\t\t\t\tscan.close(); \n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tSystem.out.println(e);\n\t\t\t}\n\n\n\t\t}",
"String[] readFile(File file) {\n ArrayList<String> list = new ArrayList<>();\n String[] output = null;\n Scanner reader = null;\n try {\n if (file.isFile()) {\n reader = new Scanner(file);\n while (reader.hasNextLine()) {\n list.add(reader.nextLine());\n }\n }\n } catch (FileNotFoundException e) {\n System.out.println(\"File not found exception\");\n }\n output = new String[list.size()];\n for (int i = 0; i < list.size(); i++) output[i] = list.get(i);\n reader.close();\n return output;\n }",
"public static String readFileAsString(String fileName) {\n String text = \"\";\n\n try {\n text = new String(Files.readAllBytes(Paths.get(fileName)));\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n return text;\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 static String readFile(String fileName) throws IOException {\n\t\tReader reader = new FileReader(fileName);\n\n\t\ttry {\n\t\t\t// Create a StringBuilder instance\n\t\t\tStringBuilder sb = new StringBuilder();\n\n\t\t\t// Buffer for reading\n\t\t\tchar[] buffer = new char[1024];\n\n\t\t\t// Number of read chars\n\t\t\tint k = 0;\n\n\t\t\t// Read characters and append to string builder\n\t\t\twhile ((k = reader.read(buffer)) != -1) {\n\t\t\t\tsb.append(buffer, 0, k);\n\t\t\t}\n\n\t\t\t// Return read content\n\t\t\treturn sb.toString();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\treader.close();\n\t\t\t} catch (IOException ioe) {\n\t\t\t\t// Ignore\n\t\t\t}\n\t\t}\n\t}",
"public static String readFile(String path) throws IOException {\n BufferedReader reader = new BufferedReader(new FileReader(path));\n\n String line;\n StringBuilder builder = new StringBuilder();\n\n while ((line = reader.readLine()) != null) {\n builder.append(line);\n }\n\n return builder.toString();\n }",
"public List<String> getFileContent() {\r\n\t\tTextFileProcessor proc = new TextFileProcessor();\r\n\t\tthis.processFile(proc);\r\n\t\treturn proc.strList;\r\n\t}",
"static public String getContents(File aFile) {\n\t\tStringBuilder contents = new StringBuilder();\r\n\r\n\t\ttry {\r\n\t\t\t// use buffering, reading one line at a time\r\n\t\t\t// FileReader always assumes default encoding is OK!\r\n\t\t\tBufferedReader input = new BufferedReader(new FileReader(aFile));\r\n\t\t\ttry {\r\n\t\t\t\tString line = null; // not declared within while loop\r\n\t\t\t\t/*\r\n\t\t\t\t * readLine is a bit quirky : it returns the content of a line\r\n\t\t\t\t * MINUS the newline. it returns null only for the END of the\r\n\t\t\t\t * stream. it returns an empty String if two newlines appear in\r\n\t\t\t\t * a row.\r\n\t\t\t\t */\r\n\t\t\t\twhile ((line = input.readLine()) != null) {\r\n\t\t\t\t\tcontents.append(line);\r\n\t\t\t\t\tcontents.append(System.getProperty(\"line.separator\"));\r\n\t\t\t\t}\r\n\t\t\t} finally {\r\n\t\t\t\tinput.close();\r\n\t\t\t}\r\n\t\t} catch (IOException ex) {\r\n\t\t\tex.printStackTrace();\r\n\t\t}\r\n\t\treturn contents.toString();\r\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(contentBuilder::append);\n }\n return contentBuilder.toString();\n }",
"public static String[] readFile(String fn) {\n\n try {\n\n FileReader fr = new FileReader(fn); // read the file\n // store contents in a buffer\n BufferedReader bfr = new BufferedReader(fr);\n // an string array list for storing each line of content\n ArrayList<String> content = new ArrayList<String>();\n String p = null; // temper string for passing each line of contents\n while ((p = bfr.readLine()) != null) {\n content.add(p);\n }\n\n // String array for storing content\n String[] context = new String[content.size()];\n\n for (int i = 0; i < content.size(); i++) {\n context[i] = content.get(i);\n }\n\n bfr.close(); // close the buffer\n return context;\n\n } catch (FileNotFoundException e) {\n System.out.println(\"File not found: \" + e.getMessage());\n System.exit(0);\n } catch (IOException e) {\n // TODO Auto-generated catch block\n System.out.println(\"I/O Ooops: \" + e.getMessage());\n System.exit(0);\n }\n\n // If an exception occurred we will get to here as the return statement\n // above was not executed\n // so setup a paragraphs array to return which contains the empty string\n String[] context = new String[1];\n context[0] = \"\";\n return context;\n\n }",
"public String[] read()\n {\n ArrayList<String> input = new ArrayList<String>();\n try\n {\n dir = new File(contextRef.getFilesDir(), filename);\n if (dir.exists())\n {\n Scanner contacts = new Scanner(dir);\n while (contacts.hasNextLine())\n {\n input.add(contacts.nextLine());\n }\n contacts.close();\n }\n }catch (Exception ex)\n {\n //debug(\"read file contents failure\");\n debug = \"test read failure\";\n }\n return input.toArray(new String[1]);\n }",
"public 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}",
"public static String read(String path) {\r\n\t\t\r\n\t\t// open the file\r\n\t\tFile file = new File(path);\r\n\t\t\r\n\t\t\r\n\t\t// if the file does not exist return null\r\n\t\tif (!file.exists())\r\n\t\t\treturn null;\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tString content = \"\";\r\n\t\t\r\n\t\t// write to the file\r\n\t\ttry {\r\n\t\t\t// open stream\r\n\t\t\tFileReader fReader = new FileReader(file);\r\n\t\t\tBufferedReader bufferedReader = new BufferedReader(fReader);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t// read all the content of the file\r\n\t\t\tString current = bufferedReader.readLine();\r\n\t\t\twhile (current != null) {\r\n\t\t\t\tcontent = content.concat(current + \"\\n\");\r\n\t\t\t\tcurrent = bufferedReader.readLine();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// close anything was opened\r\n\t\t\tbufferedReader.close();\r\n\t\t\tfReader.close();\r\n\r\n\t\t} catch (Exception e) {\r\n\r\n\t\t}\r\n\t\t\r\n\t\treturn content;\r\n\t}",
"private static String ReadFile(String filePath) {\n StringBuilder sb = new StringBuilder();\n try {\n BufferedReader r = new BufferedReader(new FileReader(filePath));\n String line;\n while ((line = r.readLine()) != null) {\n sb.append(line);\n }\n } catch (Exception e) {\n System.out.println(e.getStackTrace());\n }\n return sb.toString();\n\n }",
"public static String readWholeText(FileSystem filesystem, String file) throws PathNotFoundException, AccessDeniedException, NotAFileException\n\t{\n\t\ttry {\n\t\t\treturn new String(readWhole(filesystem, file), \"UTF-8\");\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn \"\";\n\t\t}\n\t}",
"public static String readFile(String filePath) throws IOException {\n\t\tString text = \"\";\n\t\tBufferedReader br = new BufferedReader(new FileReader(filePath));\n\t\ttry {\n\n\t\t\tint intch;\n\t\t\twhile ((intch = br.read()) != -1) {\n\t\t\t\ttext += (char) intch;\n\t\t\t}\n\t\t} finally {\n\t\t\tbr.close();\n\t\t}\n\t\treturn text;\n\t}",
"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 }",
"private static ArrayList<String> readFile() throws ApplicationException {\r\n\r\n ArrayList<String> bookList = new ArrayList<>();\r\n\r\n File sourceFile = new File(FILE_TO_READ);\r\n try (BufferedReader input = new BufferedReader(new FileReader(sourceFile))) {\r\n\r\n if (sourceFile.exists()) {\r\n LOG.debug(\"Reading book data\");\r\n String oneLine = input.readLine();\r\n\r\n while ((oneLine = input.readLine()) != null) {\r\n\r\n bookList.add(oneLine);\r\n\r\n }\r\n input.close();\r\n } else {\r\n throw new ApplicationException(\"File \" + FILE_TO_READ + \" does not exsit\");\r\n }\r\n } catch (IOException e) {\r\n LOG.error(e.getStackTrace());\r\n }\r\n\r\n return bookList;\r\n\r\n }",
"public Vector<String> read(String path) throws FileNotFoundException, IOException {\n file = new File(path);\n fread = new FileReader(file);\n buf = new BufferedReader(fread);\n\n String temp;\n Vector<String> working = new Vector<String>();\n\n while (true) {\n temp = buf.readLine();\n\n if (temp == null) {\n break;\n } else {\n working.add(temp);\n }\n }\n\n return working;\n }",
"protected String readFile(InputStream inStream) throws IOException {\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(inStream));\r\n\t\tString text = \"\";\r\n\t\tString line = \"\";\r\n\t\twhile ((line = reader.readLine()) != null) {\r\n\t\t\tif (line.matches(\"\\\\s\")) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\ttext = text + \" \" + line;\r\n\t\t}\r\n\t\treader.close();\r\n\t\treturn text;\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 }",
"@SuppressWarnings(\"resource\")\n\tpublic static String readData(String filePath) {\n\n\t\tFile data = new File(filePath); // sets the file data to be the data in the text file\n\t\tBufferedReader br = null; // creates a reference to a buffered reader called 'br' that is not pointing anywhere\n\n\t\tFileReader fr; // creates a reference to a filereader called 'fr'\n\t\ttry {\n\t\t\tfr = new FileReader(data); // creates a new filereader instance\n\t\t\tbr = new BufferedReader(fr); // creates a new bufferedreader\n\t\t\t\t\t\t\t\t\t\t\t// instance\n\t\t\tString line; // create a new String called 'line'\n\t\t\t// ArrayList<String> list = new ArrayList<>();\n\t\t\tString totalInput = \"$\"; // creates a new String called 'totalInput' which is empty\n\n\t\t\twhile ((line = br.readLine()) != null) { // start a while loop that will continue until there is not text left\n\t\t\t\ttotalInput += line + \"-\"; // updates the totalInput String to include the next line of text read in from the file and then start a new line\n\t\t\t}\n\t\t\treturn totalInput; // when the while loop finishes returns the totalInput String\n\t\t}\n\n\t\tcatch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"File not found: \" + data.toString());\n\t\t}\n\n\t\tcatch (IOException e) {\n\t\t\tSystem.out.println(\"Unable to read file: \" + data.toString());\n\t\t}\n\n\t\tfinally {\n\t\t\t\n\t\t}\n\t\treturn null;\n\n\t}",
"public String readFile(String str) {\n\t\t FileReader fileReader;\n\t BufferedReader bufferedReader;\n\t StringBuilder text=new StringBuilder();\n\t \n\t try {\n\t fileReader = new FileReader(str);\n \t bufferedReader = new BufferedReader(fileReader);\n \t String line = null;\n\n \t while((line = bufferedReader.readLine()) != null) \n \t {\n text.append(line+\"\\n\");\n } \n \tbufferedReader.close();\n\t }\n\t \tcatch(FileNotFoundException ex) {\n\t System.out.println(\"Unable to open file '\" + str + \"'\"); \n\t \t}\n\t catch(IOException ex) {\n\t System.out.println(\"Error reading file '\"+ str + \"'\"); \n\t }\n\t catch(Exception ex) {\n\t System.out.println(\"Error \" + ex.getMessage() + \"'\");\n\t ex.printStackTrace();\n\t \n\t }\n\t \n\t\treturn text.toString();\n\t}",
"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 readFile(final File file) throws IOException\n\t{\n\t\tfinal BufferedReader input = new BufferedReader(new InputStreamReader(\n\t\t\t\tnew FileInputStream(file), FILE_CHARSET_NAME));\n\t\ttry\n\t\t{\n\t\t\tfinal StringBuilder contents = new StringBuilder(BUFFER_SIZE);\n\n\t\t\t// copy from input stream\n\t\t\tfinal char[] charBuffer = new char[BUFFER_SIZE];\n\t\t\tint len;\n\t\t\twhile ((len = input.read(charBuffer)) > 0)\n\t\t\t{\n\t\t\t\tcontents.append(charBuffer, 0, len);\n\t\t\t}\n\n\t\t\treturn contents.toString();\n\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tinput.close();\n\t\t}\n\t}",
"public String read() throws Exception {\r\n\t\tBufferedReader reader = null;\r\n\t\tStringBuffer sb = new StringBuffer();\r\n\t\ttry {\r\n\t\t\tif (input==null) input = new FileInputStream(file);\r\n\t\t\treader = new BufferedReader(new InputStreamReader(input,charset));\r\n\t\t\tchar[] c= null;\r\n\t\t\twhile (reader.read(c=new char[8192])!=-1) {\r\n\t\t\t\tsb.append(c);\r\n\t\t\t}\r\n\t\t\tc=null;\r\n\t\t} catch (Exception e) {\r\n\t\t\tthrow e;\r\n\t\t} finally {\r\n\t\t\treader.close();\r\n\t\t}\r\n\t\treturn sb.toString().trim();\r\n\t}",
"public String readFileBufferedReader() {\n String result = \"\";\n BufferedReader in = null;\n try {\n in = new BufferedReader(new FileReader(new File(ALICE_PATH)));\n\n for (String x = in.readLine(); x != null; x = in.readLine()) {\n result = result + x + '\\n';\n }\n\n } catch (IOException e) {\n }\n\n if(in != null)try {\n in.close();\n } catch (IOException e) {\n }\n\n return result;\n }",
"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 }",
"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}",
"private String getFileContent(java.io.File fileObj) {\n String returned = \"\";\n try {\n java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.FileReader(fileObj));\n while (reader.ready()) {\n returned = returned + reader.readLine() + lineSeparator;\n }\n } catch (FileNotFoundException ex) {\n JTVProg.logPrint(this, 0, \"файл [\" + fileObj.getName() + \"] не найден\");\n } catch (IOException ex) {\n JTVProg.logPrint(this, 0, \"[\" + fileObj.getName() + \"]: ошибка ввода/вывода\");\n }\n return returned;\n }"
] | [
"0.76173323",
"0.73238444",
"0.7266607",
"0.7265411",
"0.7254088",
"0.7248244",
"0.72470343",
"0.72157806",
"0.7098897",
"0.70762306",
"0.70554835",
"0.702229",
"0.69141376",
"0.6847902",
"0.6828666",
"0.68165016",
"0.6814422",
"0.6768964",
"0.6757109",
"0.675529",
"0.67437017",
"0.67059773",
"0.6701574",
"0.6697438",
"0.6696467",
"0.6686268",
"0.66775906",
"0.6670442",
"0.66639215",
"0.66495085",
"0.66492885",
"0.66383284",
"0.6637711",
"0.6627873",
"0.66258246",
"0.6620164",
"0.66030157",
"0.6588406",
"0.65780175",
"0.65778214",
"0.654888",
"0.6547361",
"0.6542854",
"0.6533357",
"0.65142924",
"0.65118814",
"0.65118814",
"0.6507183",
"0.6492245",
"0.64842916",
"0.64825153",
"0.64789927",
"0.64717793",
"0.64699507",
"0.6469374",
"0.64679563",
"0.645895",
"0.64585054",
"0.64524984",
"0.64401066",
"0.6436823",
"0.64361495",
"0.6435746",
"0.643411",
"0.6429367",
"0.64253044",
"0.6418639",
"0.64144415",
"0.64130765",
"0.64106077",
"0.6409167",
"0.64031035",
"0.63980156",
"0.63661534",
"0.6353707",
"0.6351872",
"0.6351695",
"0.63439715",
"0.632724",
"0.6324516",
"0.63242286",
"0.6318961",
"0.63170266",
"0.6310809",
"0.6309608",
"0.63095266",
"0.6283851",
"0.6278764",
"0.6263873",
"0.62626845",
"0.6256527",
"0.6232086",
"0.6207926",
"0.62071455",
"0.620368",
"0.61984545",
"0.61950284",
"0.619383",
"0.6190741",
"0.6189489",
"0.6187027"
] | 0.0 | -1 |
Setup and start the Jetty servlet container | private void startServlets(){
try{
server = new Server();
ServerConnector c = new ServerConnector(server);
c.setIdleTimeout(15000);
c.setAcceptQueueSize(256);
c.setPort(port);
if(!bind.equals("*")){
c.setHost(bind);
}
ServletContextHandler handler = new ServletContextHandler(server,"/", true, false);
ServletHolder servletHolder = new ServletHolder(StatusServlet.class);
handler.addServlet(servletHolder, "/status/*");
servletHolder = new ServletHolder(SampleAPIServlet.class);
handler.addServlet(servletHolder, "/sample/*");
servletHolder = new ServletHolder(FileServlet.class);
handler.addServlet(servletHolder, "/*");
FileServlet.sourceFolder="./site";
server.addConnector(c);
server.start();
}catch(Exception e){
e.printStackTrace();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@BeforeAll\n public static void start() throws Exception {\n server = new Server(0);\n ((QueuedThreadPool)server.getThreadPool()).setMaxThreads(20);\n ServletContextHandler context = new ServletContextHandler();\n context.setContextPath(\"/foo\");\n server.setHandler(context);\n context.addServlet(new ServletHolder(TestServlet.class), \"/bar\");\n context.addServlet(new ServletHolder(TimeOutTestServlet.class), \"/timeout\");\n ((ServerConnector)server.getConnectors()[0]).setHost(\"localhost\");\n server.start();\n originalPort = ((ServerConnector)server.getConnectors()[0]).getLocalPort();\n LOG.info(\"Running embedded servlet container at: http://localhost:{}\", originalPort);\n // This property needs to be set otherwise CORS Headers will be dropped\n // by HttpUrlConnection\n System.setProperty(\"sun.net.http.allowRestrictedHeaders\", \"true\");\n }",
"private void initialize() throws IOException, ServletException, URISyntaxException {\n\n LOG.info(\"Initializing the internal Server\");\n Log.setLog(new Slf4jLog(Server.class.getName()));\n\n /*\n * Create and configure the server\n */\n this.server = new Server();\n this.serverConnector = new ServerConnector(server);\n this.serverConnector.setReuseAddress(Boolean.TRUE);\n\n LOG.info(\"Server configure ip = \" + DEFAULT_IP);\n LOG.info(\"Server configure port = \" + DEFAULT_PORT);\n\n this.serverConnector.setHost(DEFAULT_IP);\n this.serverConnector.setPort(DEFAULT_PORT);\n this.server.addConnector(serverConnector);\n\n /*\n * Setup the basic application \"context\" for this application at \"/iop-node\"\n */\n this.servletContextHandler = new ServletContextHandler(ServletContextHandler.SESSIONS);\n this.servletContextHandler.setContextPath(JettyEmbeddedAppServer.DEFAULT_CONTEXT_PATH);\n this.server.setHandler(servletContextHandler);\n\n /*\n * Initialize webapp layer\n */\n WebAppContext webAppContext = new WebAppContext();\n webAppContext.setContextPath(JettyEmbeddedAppServer.DEFAULT_CONTEXT_PATH);\n\n URL webPath = JettyEmbeddedAppServer.class.getClassLoader().getResource(\"web\");\n LOG.info(\"webPath = \" + webPath.getPath());\n\n webAppContext.setResourceBase(webPath.toString());\n webAppContext.setContextPath(JettyEmbeddedAppServer.DEFAULT_CONTEXT_PATH+\"/web\");\n webAppContext.addBean(new ServletContainerInitializersStarter(webAppContext), true);\n webAppContext.setWelcomeFiles(new String[]{\"index.html\"});\n webAppContext.addFilter(AdminRestApiSecurityFilter.class, \"/rest/api/v1/admin/*\", EnumSet.of(DispatcherType.REQUEST));\n webAppContext.setInitParameter(\"org.eclipse.jetty.servlet.Default.dirAllowed\", \"false\");\n servletContextHandler.setHandler(webAppContext);\n server.setHandler(webAppContext);\n\n /*\n * Initialize restful service layer\n */\n ServletHolder restfulServiceServletHolder = new ServletHolder(new HttpServlet30Dispatcher());\n restfulServiceServletHolder.setInitParameter(\"javax.ws.rs.Application\", JaxRsActivator.class.getName());\n restfulServiceServletHolder.setInitParameter(\"resteasy.use.builtin.providers\", \"true\");\n restfulServiceServletHolder.setAsyncSupported(Boolean.TRUE);\n webAppContext.addServlet(restfulServiceServletHolder, \"/rest/api/v1/*\");\n\n this.server.dump(System.err);\n\n }",
"public static void startServlet() throws Exception {\n Server server = new Server(8081);\n\n log.info(\"configuring and starting servlet\");\n ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);\n context.setContextPath(\"/\");\n server.setHandler(context);\n\n DbProductQueryService dbProductQueryService = new DbProductQueryService();\n\n context.addServlet(new ServletHolder(new AddProductServlet(dbProductQueryService)), \"/add-product\");\n log.info(\"added AddProductServlet\");\n context.addServlet(new ServletHolder(new GetProductsServlet(dbProductQueryService)), \"/get-products\");\n log.info(\"added GetProductsServlet\");\n context.addServlet(new ServletHolder(new QueryServlet(dbProductQueryService)), \"/query\");\n log.info(\"added QueryServlet\");\n\n\n server.start();\n log.info(\"servlet started successfully\");\n server.join();\n }",
"public void run() {\n final Server server = new Server(8081);\n\n // Setup the basic RestApplication \"context\" at \"/\".\n // This is also known as the handler tree (in Jetty speak).\n final ServletContextHandler context = new ServletContextHandler(\n server, CONTEXT_ROOT);\n final ServletHolder restEasyServlet = new ServletHolder(\n new HttpServletDispatcher());\n restEasyServlet.setInitParameter(\"resteasy.servlet.mapping.prefix\",\n APPLICATION_PATH);\n restEasyServlet.setInitParameter(\"javax.ws.rs.Application\",\n \"de.kad.intech4.djservice.RestApplication\");\n context.addServlet(restEasyServlet, CONTEXT_ROOT);\n\n\n try {\n server.start();\n server.join();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }",
"private void setupJspHandler(WebAppContext context) throws IOException {\n JettyJasperInitializer sci = new JettyJasperInitializer();\n\n ServletContainerInitializersStarter sciStarter = new ServletContainerInitializersStarter(context);\n ContainerInitializer initializer = new ContainerInitializer(sci, null);\n List<ContainerInitializer> initializers = new ArrayList<ContainerInitializer>();\n initializers.add(initializer);\n context.setAttribute(\"org.eclipse.jetty.containerInitializers\", initializers);\n context.addBean(sciStarter, true);\n System.setProperty(\"org.apache.jasper.compiler.disablejsr199\",\"false\");\n\n // Set Classloader of Context to be sane (needed for JSTL)\n // JSP requires a non-System classloader, this simply wraps the\n // embedded System classloader in a way that makes it suitable\n // for JSP to use\n ClassLoader jspClassLoader = new URLClassLoader(new URL[0], this.getClass().getClassLoader());\n context.setClassLoader(jspClassLoader);\n\n // Add JSP Servlet (must be named \"jsp\")\n ServletHolder holderJsp = new ServletHolder(\"jsp\", JettyJspServlet.class);\n holderJsp.setInitOrder(0);\n holderJsp.setInitParameter(\"logVerbosityLevel\",\"INFO\");\n holderJsp.setInitParameter(\"fork\",\"false\");\n holderJsp.setInitParameter(\"xpoweredBy\",\"false\");\n holderJsp.setInitParameter(\"compilerTargetVM\",\"1.8\");\n holderJsp.setInitParameter(\"compilerSourceVM\",\"1.8\");\n holderJsp.setInitParameter(\"keepgenerated\",\"true\");\n context.addServlet(holderJsp, \"*.jsp\");\n }",
"public static void main(String[] args) throws IOException {\n ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);\n context.setContextPath(\"/\");\n\n // Establish DB connection first\n\n // now start the server\n System.out.println(\"=== Initializing server on port \" + PORT);\n\n Server jettyServer = new Server(PORT);\n jettyServer.setHandler(context);\n\n if (LOG_REQUESTS) {\n RequestLog requestLog = new RipLogger();\n jettyServer.setRequestLog(requestLog);\n }\n\n ServletHolder jerseyServlet = context.addServlet(ServletContainer.class, \"/sudoku/*\");\n jerseyServlet.setInitOrder(0);\n jerseyServlet.setInitParameter(\"jersey.config.server.provider.packages\", \"com.shadedreality.rest\");\n\n try {\n jettyServer.start();\n jettyServer.dumpStdErr();\n jettyServer.join();\n } catch (Exception e) {\n System.err.println(\"Uncaught Exception in server: \"+e);\n }\n finally {\n jettyServer.destroy();\n }\n }",
"private static void initJspContext(WebAppContext webapp) throws IOException {\n File tempDir = new File(System.getProperty(\"java.io.tmpdir\"));\n File scratchDir = new File(tempDir.toString(),\"embedded-jetty-jsp\");\n\n if (!scratchDir.exists()) {\n if (!scratchDir.mkdirs()) {\n throw new IOException(\"Unable to create scratch directory: \" + scratchDir);\n }\n }\n\n webapp.setAttribute(\"javax.servlet.context.tempdir\",scratchDir);\n webapp.setAttribute(InstanceManager.class.getName(), new SimpleInstanceManager());\n \n\n //Ensure the jsp engine is initialized correctly\n JettyJasperInitializer sci = new JettyJasperInitializer();\n ServletContainerInitializersStarter sciStarter = new ServletContainerInitializersStarter(webapp);\n ContainerInitializer initializer = new ContainerInitializer(sci, null);\n List<ContainerInitializer> initializers = new ArrayList<ContainerInitializer>();\n initializers.add(initializer);\n\n webapp.setAttribute(\"org.eclipse.jetty.containerInitializers\", initializers);\n webapp.addBean(sciStarter, true);\n\n // Add JSP Servlet (must be named \"jsp\")\n ServletHolder holderJsp = new ServletHolder(\"jsp\",JspServlet.class);\n holderJsp.setInitOrder(0);\n holderJsp.setInitParameter(\"logVerbosityLevel\",\"DEBUG\");\n holderJsp.setInitParameter(\"fork\",\"false\");\n holderJsp.setInitParameter(\"xpoweredBy\",\"false\");\n holderJsp.setInitParameter(\"compilerTargetVM\",\"1.7\");\n holderJsp.setInitParameter(\"compilerSourceVM\",\"1.7\");\n holderJsp.setInitParameter(\"keepgenerated\",\"true\");\n webapp.addServlet(holderJsp,\"*.jsp\");\n //context.addServlet(holderJsp,\"*.jspf\");\n //context.addServlet(holderJsp,\"*.jspx\");\n\t}",
"public static void main(String[] args) throws Exception {\n URL webRootLocation = MainView.class.getResource(\"/webapp/\"); //src/masin\n URI webRootUri = webRootLocation.toURI();\n\n WebAppContext context = new WebAppContext();\n context.setBaseResource(Resource.newResource(webRootUri));\n context.setContextPath(\"/\");\n context.setAttribute(\"org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern\", \".*\");\n context.setConfigurationDiscovered(true);\n context.setConfigurations(new Configuration[]{\n new AnnotationConfiguration(),\n new WebInfConfiguration(),\n new WebXmlConfiguration(),\n new MetaInfConfiguration()\n });\n context.getServletContext().setExtendedListenerTypes(true);\n context.addEventListener(new ServletContextListeners());\n\n Server server = new Server(8080);\n server.setHandler(context);\n server.start();\n server.join();\n }",
"@Override\n public void start() throws LifecycleException {\n logger.info(\"Start http server ... \");\n\n\n try {\n // create a resource config that scans for JAX-RS resources and providers\n final ResourceConfig rc = new ResourceConfig()\n .packages(PACKAGES_SCAN) // packages path for resources loading\n .property(MvcFeature.TEMPLATE_BASE_PATH, FREEMARKER_BASE) // config freemarker view files's base path\n .register(LoggingFeature.class)\n .register(FreemarkerMvcFeature.class)\n .register(JettisonFeature.class)\n .packages(\"org.glassfish.jersey.examples.multipart\")\n .register(MultiPartFeature.class)\n .registerInstances(new ApplicationBinder()); //\n\n // create and start a new instance of grizzly http server\n // exposing the Jersey application at BASE_URI\n httpServer = GrizzlyHttpServerFactory.createHttpServer(URI.create(BASE_URI), rc);\n\n // Set StaticHttpHandler to handle http server's static resources\n String htmlPath = this.getClass().getResource(HTML_BASE).getPath(); // TODO, 部署后要根据实际目录修正!classes 同级目录下的 html 目录\n HttpHandler handler = new StaticHttpHandler(htmlPath);\n httpServer.getServerConfiguration().addHttpHandler(handler, \"/\");\n\n logger.info(\"Jersey app started with WADL available at {} application.wadl\\n \", BASE_URI);\n } catch (Exception e) {\n throw new LifecycleException(e); // just convert to self defined exception\n }\n }",
"public static void main(String[] args) throws Exception {\n\n\t\tServer server = new Server(8080);\n\n\t\tWebAppContext bb = new WebAppContext();\n\t\tbb.setServer(server);\n\n\t\tbb.addFilter(GuiceFilter.class, \"/*\", EnumSet.allOf(DispatcherType.class));\n\n\t\tServletHolder holder = bb.addServlet(ServletContainer.class, \"/*\");\n\t\tholder.setInitParameter(\"javax.ws.rs.Application\", \"net.ludeke.rest.jersey.MyApplication\");\n\n\t\tbb.addServlet(holder, \"/*\");\n\t\tbb.setContextPath(\"/\");\n\t\tbb.setWar(\"src/main/webapp\");\n\n\t\tserver.setHandler(bb);\n\n\t\ttry {\n\t\t\tSystem.out.println(\">>> STARTING EMBEDDED JETTY SERVER, PRESS ANY KEY TO STOP\");\n\t\t\tserver.start();\n\t\t\twhile (System.in.available() == 0) {\n\t\t\t\tThread.sleep(5000);\n\t\t\t}\n\t\t\tserver.stop();\n\t\t\tserver.join();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(100);\n\t\t}\n\t}",
"@Override\n public void onStartup(ServletContext servletContext) throws ServletException {\n this.addServlet(servletContext);\n }",
"@PostConstruct\n public void init() throws SQLException, IOException {\n Server.createWebServer(\"-webPort\", \"1777\").start();\n\n\n }",
"public void initEasyJWeb() {\r\n\t\tlogger.info(I18n.getLocaleMessage(\"core.execute.EasyJWeb.initialization.applications\"));\r\n\t\tif (resourceLoader == null) {\r\n\t\t\tif (servletContext != null)\r\n\t\t\t\tresourceLoader = new ServletContextResourceLoader(\r\n\t\t\t\t\t\tservletContext);\r\n\t\t\telse\r\n\t\t\t\tresourceLoader = new FileResourceLoader();\r\n\t\t}\r\n\t\tinitContainer();\r\n\t\tFrameworkEngine.setWebConfig(webConfig);// 初始化框架工具\r\n\t\tFrameworkEngine.setContainer(container);// 在引擎中安装容器\r\n\t\tAjaxUtil.setServiceContainer(new AjaxServiceContainer(container));// 初始化Ajax容器服务\r\n\t\tinitTemplate(); // 初始化模版\r\n\t\tinvokeApps();// 在应用启动的时候启动一些配置好的应用\r\n\t\thaveInitEasyJWeb = true;\r\n\t\tlogger.info(I18n.getLocaleMessage(\"core.EasyJWeb.initialized\"));\r\n\t}",
"public void init() throws ServletException {\n\t\t// Put your code here\n\t\t try {\n\t Startup startup = new Startup();\n\t startup.init();\n\t startup.start();\n\t \n\t log.info(\"中转系统已成功启动!\");\n\t } catch (Throwable t) {\n\t log.error(LogFormatter.formatMsg(\"servlet\", \"start failed.\"), t);\n\t }\n\t}",
"private void startWebApp(Handler<AsyncResult<HttpServer>> next) {\n Router router = Router.router(vertx);\n\n router.route(\"/assets/*\").handler(StaticHandler.create(\"assets\"));\n router.route(\"/api/*\").handler(BodyHandler.create());\n\n router.route(\"/\").handler(this::handleRoot);\n router.get(\"/api/timer\").handler(this::timer);\n router.post(\"/api/c\").handler(this::_create);\n router.get(\"/api/r/:id\").handler(this::_read);\n router.put(\"/api/u/:id\").handler(this::_update);\n router.delete(\"/api/d/:id\").handler(this::_delete);\n\n // Create the HTTP server and pass the \"accept\" method to the request handler.\n vertx.createHttpServer().requestHandler(router).listen(8888, next);\n }",
"public static void main(String... args) throws IOException {\r\n\r\n checkDatabaseConnectivity();\r\n checkServerProperties();\r\n checkSchedulerProperties();\r\n server = new Server(port);\r\n\r\n try {\r\n ServletContextHandler context = new ServletContextHandler(\r\n ServletContextHandler.SESSIONS\r\n | ServletContextHandler.SECURITY);\r\n\r\n context.setInitParameter(\r\n \"org.eclipse.jetty.servlet.SessionIdPathParameterName\",\r\n \"none\");\r\n\r\n context.setContextPath(\"/\");\r\n context.setSecurityHandler(setUpSecurityHandler());\r\n AppServlet.getInstance().setLoginService(\r\n (HashLoginService) context.getSecurityHandler()\r\n .getLoginService());\r\n\r\n context.addServlet(new ServletHolder(AppServlet.getInstance()),\r\n \"/*\");\r\n context.addServlet(new ServletHolder(UserServlet.getInstance()),\r\n \"/users/*\");\r\n context.addServlet(new ServletHolder(ModuleServlet.getInstance()),\r\n \"/modules/*\");\r\n context.addServlet(new ServletHolder(RoomServlet.getInstance()),\r\n \"/rooms/*\");\r\n context.addServlet(\r\n new ServletHolder(EquipmentServlet.getInstance()),\r\n \"/equipment/*\");\r\n context.addServlet(\r\n new ServletHolder(TimeframeServlet.getInstance()),\r\n \"/timeframe/*\");\r\n context.addServlet(\r\n new ServletHolder(SchedulerServlet.getInstance()),\r\n \"/scheduler/*\");\r\n\r\n ContextHandler fileHandler = new ContextHandler();\r\n fileHandler.setContextPath(\"/resources\");\r\n ResourceHandler resourceHandler = new ResourceHandler();\r\n resourceHandler.setResourceBase(\"site/resources\");\r\n fileHandler.setHandler(resourceHandler);\r\n\r\n ContextHandlerCollection contexts = new ContextHandlerCollection();\r\n contexts.setHandlers(new Handler[] { context, fileHandler });\r\n server.setHandler(contexts);\r\n\r\n server.start();\r\n\r\n } catch (Exception e) {\r\n System.err.println(\"Server failed to start.\");\r\n e.printStackTrace();\r\n }\r\n }",
"private static void startWebSocketServer() {\n\n Server webSocketServer = new Server();\n ServerConnector connector = new ServerConnector(webSocketServer);\n connector.setPort(PORT);\n webSocketServer.addConnector(connector);\n log.info(\"Connector added\");\n\n // Setup the basic application \"context\" for this application at \"/\"\n // This is also known as the handler tree (in jetty speak)\n ServletContextHandler webSocketContext = new ServletContextHandler(\n ServletContextHandler.SESSIONS);\n webSocketContext.setContextPath(\"/\");\n webSocketServer.setHandler(webSocketContext);\n log.info(\"Context handler set\");\n\n try {\n ServerContainer serverContainer = WebSocketServerContainerInitializer\n .configureContext(webSocketContext);\n log.info(\"Initialize javax.websocket layer\");\n\n serverContainer.addEndpoint(GreeterEndpoint.class);\n log.info(\"Endpoint added\");\n\n webSocketServer.start();\n log.info(\"Server started\");\n\n webSocketServer.join();\n log.info(\"Server joined\");\n\n } catch (Throwable t) {\n log.error(\"Error startWebSocketServer {0}\", t);\n }\n }",
"@BeforeClass\n public static void startEmbeddedJetty_9_1_1() throws Exception {\n server = new Server( 8080 );\n \n WebAppContext webapp = new WebAppContext();\n webapp.setContextPath( \"/websock-webapp\" );\n //But the .war should already have WebSocketServerEndpoint.class in it \n webapp.setWar( new File( \".\", \"../webapp/target/\" + WebAppConstants.WEBSOCKET_WEBAPP_NAME + \".war\" ).getPath() );\n server.setHandler( webapp );\n // Initialize the WebSocket Server Container\n WebSocketServerContainerInitializer.configureContext( webapp ); \n server.start();\n \n // After Jetty started and WebSocket Server Container was initialized, obtain it\n webSocketServerContainer = ( ServerContainer ) webapp.getServletContext().getAttribute( \n javax.websocket.server.ServerContainer.class.getName() );\n assertNotNull( webSocketServerContainer );\n System.out.println( \"--->> webSocketServerContainer [\" + webSocketServerContainer + \"] of class [\" + \n ( webSocketServerContainer == null ? null : webSocketServerContainer.getClass().getName() ) + \"]\" );\n \n //This should really NOT be needed since WebSocketServerEndpoint is in the .war and should be\n //picked up via annotation. PLUS this requires refactoring WebSocketServerEndpoint from out of the\n // /webapp child module into /common which is really unnecessary at this point.\n // webSocketServerContainer.addEndpoint( WebSocketServerEndpoint.class );\n \n WebSocketContainer container = ContainerProvider.getWebSocketContainer();\n assertNotNull( \"Jetty WebSockets Container is null\", container );\n container.connectToServer( WebSocketClientEndpoint.class,\n// // \"ws://localhost:8080/websock-webapp/echo\"\n new URI( WebAppConstants.WEBSOCKET_FULL_URL ) );\n \n/* This still throws the same damn, exception\n \nCaused by: org.eclipse.jetty.websocket.api.UpgradeException: Didn't switch protocols\n\tat org.eclipse.jetty.websocket.client.io.UpgradeConnection.validateResponse(UpgradeConnection.java:272)\n\tat org.eclipse.jetty.websocket.client.io.UpgradeConnection.read(UpgradeConnection.java:203)\n\tat org.eclipse.jetty.websocket.client.io.UpgradeConnection.onFillable(UpgradeConnection.java:148) \n*/ \n \n /* \n Running server as standalone and client as standalone via Spring work though.\n \n final ServletHolder servletHolder = new ServletHolder( new DefaultServlet() );\n final ServletContextHandler context = new ServletContextHandler();\n\n context.setContextPath( \"/\" );\n context.addServlet( servletHolder, \"/*\" );\n context.addEventListener( new ContextLoaderListener() ); \n context.setInitParameter( \"contextClass\", AnnotationConfigWebApplicationContext.class.getName() );\n context.setInitParameter( \"contextConfigLocation\", AppConfig.class.getName() );\n */\n \n }",
"@Bean\n public ServletWebServerFactory servletContainer() {\n TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory();\n\n if (httpPort > 0) {\n tomcat.addAdditionalTomcatConnectors(getHttpConnector(httpPort));\n }\n return tomcat;\n }",
"@Override\n\tpublic void onStartup(ServletContext servletContext)\n\t\t\tthrows ServletException {\n\t\tsuper.onStartup(servletContext);//master line where whole framework works\n\t\t//configure global objects/tasks if required\n\t}",
"private void enableEmbeddedJspSupport(ServletContextHandler servletContextHandler) throws IOException {\n // Establish Scratch directory for the servlet context (used by JSP compilation)\n File tempDir = new File(System.getProperty(\"java.io.tmpdir\"));\n File scratchDir = new File(tempDir.toString(), \"embedded-jetty-jsp\");\n\n if (!scratchDir.exists()) {\n if (!scratchDir.mkdirs()) {\n throw new IOException(\"Unable to create scratch directory: \" + scratchDir);\n }\n }\n servletContextHandler.setAttribute(\"javax.servlet.context.tempdir\", scratchDir);\n\n // Set Classloader of Context to be sane (needed for JSTL)\n // JSP requires a non-System classloader, this simply wraps the\n // embedded System classloader in a way that makes it suitable\n // for JSP to use\n ClassLoader jspClassLoader = new URLClassLoader(new URL[0], this.getClass().getClassLoader());\n servletContextHandler.setClassLoader(jspClassLoader);\n\n // Manually call JettyJasperInitializer on context startup\n servletContextHandler.addBean(new JspStarter(servletContextHandler));\n\n // Create / Register JSP Servlet (must be named \"jsp\" per spec)\n ServletHolder holderJsp = new ServletHolder(\"jsp\", JettyJspServlet.class);\n holderJsp.setInitOrder(0);\n holderJsp.setInitParameter(\"logVerbosityLevel\", \"DEBUG\");\n holderJsp.setInitParameter(\"fork\", \"false\");\n holderJsp.setInitParameter(\"xpoweredBy\", \"false\");\n holderJsp.setInitParameter(\"compilerTargetVM\", \"1.8\");\n holderJsp.setInitParameter(\"compilerSourceVM\", \"1.8\");\n holderJsp.setInitParameter(\"keepgenerated\", \"true\");\n servletContextHandler.addServlet(holderJsp, \"*.jsp\");\n }",
"public void startServer() {\n URLClassLoader loader = createClasspath(opts);\n X_Process.runInClassloader(loader, appServer\n .map(DevAppServer::doStartServer, getAppName() + \"Server\", getPort())\n .ignoreOut1().unsafe());\n }",
"public void startServer() {\n System.out.println(\"Inicie\");\n httpServer = new HttpServer();\n httpServer.registerProessor(\"/App\", this);\n try {\n httpServer.start();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"void setServletContext(ServletContext servletContext);",
"void setServletContext(ServletContext servletContext);",
"public static void main(String args[]) throws Exception {\n SLF4JBridgeHandler.install();\n\n try {\n JettyServer server = new JettyServer(8080);\n server.start();\n log.info(\"Server started\");\n server.join();\n } catch (Exception e) {\n log.error(\"Failed to start server.\", e);\n }\n }",
"public void init(final ServletConfig config) {\r\n\t\tSystem.out.println(\"---> Entering init() MainServlet\");\r\n\t\tmySQLdb = new MySQLdb();\r\n\t\tSystem.out.println(\"---> Exiting init() MainServlet\");\r\n\t}",
"@Override\n public void contextInitialized(ServletContextEvent servletContextEvent) {\n super.contextInitialized(servletContextEvent);\n\n try {\n ServletContext servletContext = servletContextEvent.getServletContext();\n RemotingServlet remotingServlet = new RemotingServlet();\n try {\n remotingServlet.init(new CubaServletConfig(\"remoting\", servletContext));\n } catch (ServletException e) {\n throw new RuntimeException(\"An error occurred while initializing remoting servlet\", e);\n }\n ServletRegistration.Dynamic remotingReg = servletContext.addServlet(\"remoting\", remotingServlet);\n remotingReg.addMapping(\"/remoting/*\");\n remotingReg.setLoadOnStartup(0);\n\n FilterRegistration.Dynamic filterReg = servletContext.addFilter(\"CoreSingleWarHttpFilter\", new SetClassLoaderFilter());\n filterReg.addMappingForUrlPatterns(EnumSet.of(DispatcherType.REQUEST), false, \"/remoting/*\");\n\n } catch (RuntimeException e) {\n log.error(\"Error initializing core servlets\", e);\n\n try {\n ApplicationContext springContext = AppContext.getApplicationContext();\n if (springContext != null) {\n ((ConfigurableApplicationContext) springContext).close();\n }\n } catch (Exception e1) {\n log.debug(\"Error closing application context: {}\", e1.toString());\n }\n\n throw e;\n }\n }",
"public void init(ServletConfig config) throws ServletException {\n\t\t// System.out.println(\"[Ouptut from log4j] XPathServlet started!\");\n\t}",
"public Server(int port, mainViewController viewController, LogViewController consoleViewController){\n isRunningOnCLI = false;\n this.viewController = viewController;\n this.port = port;\n this.consoleViewController = consoleViewController;\n viewController.serverStarting();\n log = new LoggingSystem(this.getClass().getCanonicalName(),consoleViewController);\n log.infoMessage(\"New server instance.\");\n try{\n this.serverSocket = new ServerSocket(port);\n //this.http = new PersonServlet();\n log.infoMessage(\"main.Server successfully initialised.\");\n clients = Collections.synchronizedList(new ArrayList<>());\n ServerOn = true;\n log.infoMessage(\"Connecting to datastore...\");\n //mainStore = new DataStore();\n jettyServer = new org.eclipse.jetty.server.Server(8080);\n jettyContextHandler = new ServletContextHandler(jettyServer, \"/\");\n jettyContextHandler.addServlet(servlets.PersonServlet.class, \"/person/*\");\n jettyContextHandler.addServlet(servlets.LoginServlet.class, \"/login/*\");\n jettyContextHandler.addServlet(servlets.HomeServlet.class, \"/home/*\");\n jettyContextHandler.addServlet(servlets.DashboardServlet.class, \"/dashboard/*\");\n jettyContextHandler.addServlet(servlets.UserServlet.class, \"/user/*\");\n jettyContextHandler.addServlet(servlets.JobServlet.class, \"/job/*\");\n jettyContextHandler.addServlet(servlets.AssetServlet.class, \"/assets/*\");\n jettyContextHandler.addServlet(servlets.UtilityServlet.class, \"/utilities/*\");\n jettyContextHandler.addServlet(servlets.EventServlet.class, \"/events/*\");\n //this.run();\n } catch (IOException e) {\n viewController.showAlert(\"Error initialising server\", e.getMessage());\n viewController.serverStopped();\n log.errorMessage(e.getMessage());\n }\n }",
"@Override\n public final void contextInitialized(final ServletContextEvent sce) {\n context = sce.getServletContext();\n\n String apiSrvDaemonPath = context.getRealPath(PS);\n System.setProperty(\"APISrvDaemonPath\", context.getRealPath(\"/\"));\n System.setProperty(\"APISrvDaemonVersion\",\n \"v.0.0.2-22-g2338f25-2338f25-40\");\n\n // Notify execution\n System.out.println(\"--- \" + \"Starting APIServerDaemon \"\n + System.getProperty(\"APISrvDaemonVersion\") + \" ---\");\n System.out.println(\"Java vendor : '\" + VN + \"'\");\n System.out.println(\"Java vertion: '\" + VR + \"'\");\n System.out.println(\"Running as : '\" + US + \"' username\");\n System.out.println(\"Servlet path: '\" + apiSrvDaemonPath + \"'\");\n\n // Initialize log4j logging\n String log4jPropPath =\n apiSrvDaemonPath + \"WEB-INF\" + PS + \"log4j.properties\";\n File log4PropFile = new File(log4jPropPath);\n\n if (log4PropFile.exists()) {\n System.out.println(\"Initializing log4j with: \" + log4jPropPath);\n PropertyConfigurator.configure(log4jPropPath);\n } else {\n System.err.println(\n \"WARNING: '\" + log4jPropPath\n + \" 'file not found, so initializing log4j \"\n + \"with BasicConfigurator\");\n BasicConfigurator.configure();\n }\n\n // Make a test with jdbc/geApiServerPool\n // jdbc/UserTrackingPool\n // jdbc/gehibernatepool connection pools\n String currentPool = \"not yet defined!\";\n String poolPrefix = \"java:/comp/env/\";\n String[] pools = {\"jdbc/fgApiServerPool\",\n \"jdbc/UserTrackingPool\",\n \"jdbc/gehibernatepool\"};\n Connection[] connPools = new Connection[pools.length];\n\n for (int i = 0; i < pools.length; i++) {\n try {\n Context initContext = new InitialContext();\n Context envContext =\n (Context) initContext.lookup(\"java:comp/env\");\n\n currentPool = pools[i];\n\n // DataSource ds =\n // (DataSource)initContext.lookup(poolPrefix+currentPool);\n DataSource ds = (DataSource) envContext.lookup(currentPool);\n\n connPools[i] = ds.getConnection();\n System.out.println(\"PERFECT: \" + currentPool + \" was ok\");\n } catch (Exception e) {\n System.err.println(\"WARNING: \" + currentPool + \" failed\" + LS\n + e.toString());\n } finally {\n try {\n connPools[i].close();\n } catch (Exception e) {\n System.err.println(\"WARNING: \" + currentPool\n + \" failed to close\" + LS + e.toString());\n }\n }\n }\n\n // Register MySQL driver\n APIServerDaemonDB.registerDriver();\n\n // Initializing the daemon\n if (asDaemon == null) {\n asDaemon = new APIServerDaemon();\n }\n\n asDaemon.startup();\n }",
"@Override\n\tpublic void contextInitialized(ServletContextEvent arg0) {\n\t\tserverAPP.start();\n\t}",
"public void init(ServletConfig config) throws ServletException {\n\t\tcontext = config.getServletContext();\n\t}",
"public interface MyWebInitializer {\n void onStartup(ServletContext servletContext) throws ServletException;\n}",
"public void onStartup(ServletContext servletContext) throws ServletException {\n\t\tSystem.out.println(\"Inside onStartup method\");\n\t\t\n\t\tXmlWebApplicationContext webApplicationContext = new XmlWebApplicationContext();\n\t\twebApplicationContext.setConfigLocation(\"classpath:ApplicationConfig.xml\");\n\t\t\n\t\tDispatcherServlet dispatherServlet = new DispatcherServlet();\n\t\t//Register dispatcher servlet with servlet context\n\t\tservletContext.addServlet(\"myDispatcherServlet\", dispatherServlet);\n\t}",
"@Bean\n public ServletWebServerFactory servletContainer() {\n TomcatServletWebServerFactory tomcatServer = new TomcatServletWebServerFactory() {\n @Override\n protected void postProcessContext(Context context) {\n SecurityConstraint securityConstraint = new SecurityConstraint();\n securityConstraint.setUserConstraint(\"CONFIDENTIAL\");\n SecurityCollection collection = new SecurityCollection();\n collection.addPattern(\"/*\");\n securityConstraint.addCollection(collection);\n context.addConstraint(securityConstraint);\n }\n };\n\n tomcatServer.addAdditionalTomcatConnectors(initiateHttpConnector());\n return tomcatServer;\n }",
"public HttpServlet createServlet(String servletname, Context con){\n\t\t\n\t\tHttpServlet servlet = null;\n\t\tConfig config = new Config(servletname,con);\n\t\tHashMap<String,String> servletClassMap = handler.getServletClass();\n\t\t\n\t//get servlet class name through servletClass map\n\t\t\n\t\tString classname = servletClassMap.get(servletname);\n\t\t\n\t//get the exact servlet when we know servlet name\n\t\tClass servletEmptyClass = null;\n\t\ttry{\n\t\t\tlog.info(\"ServletContainer: classname is \"+classname);\n\t\t\t\n\t\t\tservletEmptyClass = Class.forName(\"edu.upenn.cis.cis455.webserver.\"+classname); // must contain the path in class\n\t\t\t\n\t\t\tservlet = (HttpServlet) servletEmptyClass.newInstance();\n\t\t\t\n\t\t\t\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\tlog.info(\"ServletContainer: cannot create a servlet\");\n\t\t}\n\t\n\t//set init data in config\n\t\tHashMap<String, String> initParamsConfigMap = handler.getInitParams();\n\t\tSet<String> set = initParamsConfigMap.keySet();\n\t\tfor(String key : set){\n\t\t\tString value = initParamsConfigMap.get(key);\n\t\t\tconfig.setInitParameter(key, value);\t\t\t\n\t\t}\n\t\t\n\t// init servlet\t\n\t\ttry{\n\t\t\tservlet.init(config);\n\t\t\t\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\tlog.info(\"ServletContainer: cannot init servlet\");\n\t\t}\n\t\t\n\t\treturn servlet;\n\t\t\t\n\t}",
"@Singleton\n\t@Provides\n\tServer provideServer(final Injector injector, final ExecutorService execService) {\n\t\tfinal Server server = new Server(port);\n\t\tServletContextHandler sch = new ServletContextHandler(server, \"/jfunk\");\n\t\tsch.addEventListener(new JFunkServletContextListener(injector));\n\t\tsch.addFilter(GuiceFilter.class, \"/*\", null);\n\t\tsch.addServlet(DefaultServlet.class, \"/\");\n\n\t\tRuntime.getRuntime().addShutdownHook(new Thread() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\texecService.shutdown();\n\t\t\t\t\texecService.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS);\n\t\t\t\t} catch (InterruptedException ex) {\n\t\t\t\t\tThread.currentThread().interrupt();\n\t\t\t\t\tlog.error(ex.getMessage(), ex);\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tserver.stop();\n\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\tlog.error(\"Error stopping Jetty.\", ex);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn server;\n\t}",
"@Override protected void configureServlets() {\n serveRegex(\"^/(?!_ah).*\").with(HandlerServlet.class);\n // serves xmpp urls\n serveRegex(\"/_ah/xmpp/.*\").with(HandlerServlet.class);\n }",
"public HttpServlet() {\r\n\t\tsuper();\r\n\t}",
"@Override\n\tpublic void init() throws ServletException {\n\t\tSystem.out.println(\"Servlet initializing\");\n\t}",
"void init(ServletConfig config) throws ServletException;",
"public void init() throws ServletException {\n }",
"public void startServer() {\n // configure the server properties\n int maxThreads = 20;\n int minThreads = 2;\n int timeOutMillis = 30000;\n\n // once routes are configured, the server automatically begins\n threadPool(maxThreads, minThreads, timeOutMillis);\n port(Integer.parseInt(this.port));\n this.configureRoutesAndExceptions();\n }",
"public EntryServlet()\n {\n super();\n }",
"@Bean\n public TomcatServletWebServerFactory servletWebServerFactory() {\n return new TomcatServletWebServerFactory() {\n\n @Override\n protected void prepareContext(Host host,\n ServletContextInitializer[] initializers) {\n super.prepareContext(host, initializers);\n StandardContext child = new StandardContext();\n child.addLifecycleListener(new Tomcat.FixContextListener());\n child.setPath(\"/cloudfoundryapplication\");\n ServletContainerInitializer initializer = getServletContextInitializer(\n getContextPath());\n child.addServletContainerInitializer(initializer, Collections.emptySet());\n child.setCrossContext(true);\n host.addChild(child);\n }\n\n };\n }",
"public void init() {\n\n\t\tString rootdir = null;\n\t\ttry {\n\t\t\trootdir = ServletActionContext.getServletContext().getRealPath(\"/\");\n\t\t} catch (Exception ex) {\n\n\t\t}\n\n\t\tif (rootdir == null) {\n\t\t\trootdir = \"/Users/huangic/Documents/jetty-6.1.22/webapps/TransWeb\";\n\t\t}\n\n\t\tlogger.debug(rootdir);\n\t\tString classesdir = rootdir + \"/WEB-INF/classes/\";\n\t\tthis.xmlBatchRule = ReadXML(classesdir\n\t\t\t\t+ \"applicationContext-BatchRule.xml\");\n\t\tthis.xmlDB = ReadXML(classesdir + \"applicationContext-DB.xml\");\n\t\tthis.xmlSystem = ReadXML(classesdir + \"applicationContext-system.xml\");\n\n\t}",
"@Override\n public void onStartup(ServletContext servletContext) throws ServletException {\n\tAnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext();\n\trootContext.register(HealthCheckRootConfig.class);\n\n\t// Manage the lifecycle of the root application context\n\tservletContext.addListener(new ContextLoaderListener(rootContext));\n\n\t// Create the dispatcher servlet's Spring application context\n\tAnnotationConfigWebApplicationContext dispatcherContext = new AnnotationConfigWebApplicationContext();\n\tdispatcherContext.register(HealthCheckServletContext.class);\n\n\t// Register and map the dispatcher servlet\n\tServletRegistration.Dynamic dispatcher = servletContext.addServlet(\"dispatcher\",\n\t\tnew DispatcherServlet(dispatcherContext));\n\tdispatcher.setLoadOnStartup(1);\n\tdispatcher.addMapping(\"/\");\n\n\tservletContext.addFilter(\"CharacterEncodingFilter\", CharacterEncodingFilter.class)\n\t\t.addMappingForUrlPatterns(null, true, \"/*\");\n\tMap<String, String> charEncodingFilterInitParams = new HashMap<>();\n\tcharEncodingFilterInitParams.put(\"encoding\", \"UTF-8\");\n\tcharEncodingFilterInitParams.put(\"forceEncoding\", \"true\");\n\tservletContext.getFilterRegistration(\"CharacterEncodingFilter\").setInitParameters(charEncodingFilterInitParams);\n\n }",
"public AddServlet() {\n\t\tsuper();\n\t}",
"public static void main(String[] args) {\n\t\tif (args != null && args.length > 0) {\n\t\t\tport = Integer.parseInt(args[0]);\n\t\t}\n\t\tlog.info(\"i am the main for JServer\");\n\t\tlog.info(\"Server will use port: \" + port);\n\t\ttry {\n\t\t\twebServer = new WebServer(port);\n\t\t\t\n\t\t\tjsystem = new JSystemServer();\n\t\t\t\n\t\t\t//create the instances of handlers in server\n\t\t\tapplicationHandler = new JApplicationHandler();\n\t\t\tscenarioHandler = new JScenarioHandler();\n\t\t\t\n\t\t\t\n\t\t\tlogsHandler = new JReporterHandler();\n\t\t\t//register handlers in server\n\t\t\twebServer.addHandler(JServerHandlers.SCENARIO.getHandlerClassName(),scenarioHandler);\n\t\t\twebServer.addHandler(JServerHandlers.APPLICATION.getHandlerClassName(),applicationHandler);\n\t\t\twebServer.addHandler(\"jsystem\", jsystem);\n\t\t\twebServer.addHandler(JServerHandlers.REPORTER.getHandlerClassName(), logsHandler);\n\t\t\twebServer.start();\n\t\t\tSystem.out.println(\"webserver successfully started!!! + listening on port \" + port);\n\t\t} catch (Exception e) {\n\t\t\tlog.warning(\"failed in webserver handler adding or creation on port= \"+port + \"\\n\\n\"+StringUtils.getStackTrace(e));\n\t\t}\n\t}",
"public static void main(String[] args) {\n\t\ttry { NetworkServerControl server = new NetworkServerControl(InetAddress.getByName(\"localhost\"),1527);\n\t\tserver.start(null);\n\t\tSystem.out.println(\"DB Server Started!\");\n\t\t//server.shutdown();\n\t\t//cn = DriverManager.getConnection(dbURL);\n\t\t} catch(Exception e) {System.out.println(\"Cannot Start DB Server!\"); }\n\t\t\n\t\tfinal JettyServer jettyServer = new JettyServer();\n\t\tString jetty_home = System.getProperty(\"jetty.home\",\".\");\n Server server = new Server(8080);\n WebAppContext webapp = new WebAppContext();\n webapp.setContextPath(\"/\");\n //webapp.setWar(jetty_home+\"/target/vrscloud-1.war\");\n webapp.setWar(\"ROOT.war\");\n server.setHandler(webapp);\n // server.start();\t\n\t\t\n\t\t\n jettyServer.setHandler(webapp);\t\n\t\t\n\t\tRunnable runner = new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tnew ServerRunner(jettyServer);\n\t\t\t}\n\t\t};\n\t\tEventQueue.invokeLater(runner);\n\t}",
"public static HttpServer startServer() {\n // create a resource config that scans for JAX-RS resources and providers\n // in com.example.rest package\n final ResourceConfig rc = new ResourceConfig().packages(\"com.assignment.backend\");\n rc.register(org.glassfish.jersey.moxy.json.MoxyJsonFeature.class);\n rc.register(getAbstractBinder());\n rc.property(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, true);\n rc.property(ServerProperties.BV_DISABLE_VALIDATE_ON_EXECUTABLE_OVERRIDE_CHECK, true);\n\n // create and start a new instance of grizzly http server\n // exposing the Jersey application at BASE_URI\n return GrizzlyHttpServerFactory.createHttpServer(URI.create(BASE_URI), rc);\n }",
"public void start() {\n system = ActorSystem.create(\"http-server\", config);\n\n Settings settings = SettingsExtension.SettingsExtensionProvider.get(system);\n\n vHostHandlers = settings.vHostConfigs()\n .stream()\n .map(vc -> new AkkaTcpHandler(system, vc))\n .collect(Collectors.toList());\n\n vHostHandlers.forEach(VHostHandler::start);\n\n Runtime.getRuntime().addShutdownHook(new Thread(this::terminate));\n }",
"protected void registerServlets(ServletContextHandler handler) {\n\t}",
"public interface JettyConnectorFactory {\n\n\t/**\n\t * Build and configure a connector for our web server.\n\t */\n\tpublic Connector buildConnector(Server server, int serverPort);\n}",
"@Override\r\n\tpublic void init(ServletConfig config) throws ServletException {\r\n\t\t//初始化定时任务\r\n//\t\tinitSysTask();\r\n\r\n\t\tsuper.init(config);\r\n\t\ttry {\r\n\t\t\tServiceBeanContext.getInstance().loadContext(Constants.Env.BASE_HOME+\"applicationContext.xml\");\r\n\t\t\t//启动代理服务器\r\n\t\t\t//ProxyServer.startProxy();\r\n\r\n\t\t\t//initReve.init();\r\n\t\t} catch (Exception e) {\r\n\t\t\tlog.error(\"启动初始化applicationContext.xml失败\", e);\r\n\t\t}\r\n\r\n\t}",
"public void testLoadOnStartup() throws Exception {\n WebXMLString wxs = new WebXMLString();\n wxs.addServlet( \"servlet1\", \"one\", Servlet1.class );\n wxs.setLoadOnStartup( \"servlet1\" );\n wxs.addServlet( \"servlet2\", \"two\", Servlet2.class );\n wxs.addServlet( \"servlet3\", \"three\", Servlet3.class );\n \n ServletRunner sr = new ServletRunner( toInputStream( wxs.asText() ) );\n ServletUnitClient wc = sr.newClient();\n InvocationContext ic = wc.newInvocation( \"http://localhost/three\" );\n assertEquals( \"Initialized servlets\", \"Servlet1,Servlet3\", ic.getServlet().getServletConfig().getServletContext().getAttribute( \"initialized\" ) );\n }",
"@Override\n\tpublic void contextInitialized(ServletContextEvent sce) {\n\t\tstartupEvt.fire(new ContainerStartupEvent());\n\t}",
"@Override\n public void init(ServletConfig servletConfig) throws ServletException {\n }",
"public static void main(String[] args) {\n \tEmbeddedServers.add(EmbeddedServers.Identifiers.JETTY, (Routes routeMatcher, StaticFilesConfiguration staticFilesConfiguration, boolean hasMultipleHandler) -> {\r\n JettyHandler handler = setupHandler(routeMatcher, staticFilesConfiguration, hasMultipleHandler);\r\n customJettyServerFactory serv = new customJettyServerFactory();\r\n return new EmbeddedJettyServer(serv, handler);\r\n });\r\n \t\r\n \tport(80);\r\n \t\r\n \tOptions op = new Options();\r\n \top.setOptions(args);\r\n \t//LabelCreator labels = new LabelCreator(op);\r\n\r\n \t\r\n \tstaticFiles.location(\"/public\"); // Static (web accessible) files (e.g. CSS files etc.) can be placed in src/main/resources/public \r\n \tstaticFiles.header(\"Access-Control-Allow-Origin\", \"*\"); // static files can be accessed from anywhere\r\n \tstaticFiles.header(\"Access-Control-Allow-Headers\", \"*\"); // static files can be accessed from anywhere\r\n \t\r\n \t// any empty action will be redirected to the API documentation\r\n \tredirect.any(\"/\", \"/labels/\"+API_VERSION+\"/\");\r\n \tredirect.any(\"/labels\", \"/labels/\"+API_VERSION+\"/\");\r\n \tredirect.any(\"/labels/\", \"/labels/\"+API_VERSION+\"/\");\t\r\n \tredirect.any(\"/labels/\"+API_VERSION, \"/labels/\"+API_VERSION+\"/\");\r\n \t\r\n \toptions(\"/*\", (req, res) -> {\r\n \t\tString accessControlRequestHeaders = req.headers(\"Access-Control-Request-Headers\");\r\n \t\tif (accessControlRequestHeaders != null) {\r\n \t\t\tres.header(\"Access-Control-Allow-Headers\", accessControlRequestHeaders);\r\n \t\t}\r\n\r\n \t\tString accessControlRequestMethod = req.headers(\"Access-Control-Request-Method\");\r\n \t\tif (accessControlRequestMethod != null) {\r\n \t\t\tres.header(\"Access-Control-Allow-Methods\", accessControlRequestMethod);\r\n \t\t}\r\n\r\n return \"OK\";\r\n \t});\r\n \t\r\n \ttry {\r\n\t\t\t// Build swagger json description\r\n\t\t\tfinal String swaggerJson = SwaggerParser.getSwaggerJson(APP_PACKAGE);\r\n\t\t\tget(\"/labels/\"+API_VERSION+\"/\", (req, res) -> { // TODO: redirect the Swagger JSON to a Swagger UI instance instead of returning it e.g. redirect.any(\"/test\", \"http://petstore.swagger.io\");\r\n\t\t\t\tres.header(\"Content-Type\", \"application/json\");\r\n\t\t\t\treturn swaggerJson;//.replace(oldChar, newChar);\r\n\t\t\t});\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.err.println(e);\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n \t\r\n \t// Routes other than default Swagger documentation\r\n \tpath(\"/labels\", () -> {\r\n \t\tpath(\"/\"+API_VERSION, () -> {\r\n\t \t\t\r\n \t\t\tget(\"/static/*\", (req, res) -> {\r\n \t \t\t\r\n \t\t\t\t AccessStatic c = new AccessStatic(op, req, res);\r\n \t\t return c.result();\r\n \t\t\t});\r\n \t\t\t\r\n \t\t\tpost(\"/\", (req, res) -> {\r\n \t\t\t\t\r\n \t\t\t\tif(req.queryParams(\"template\")==null || req.queryParams(\"template\").isEmpty())\r\n \t\t\t\t{\t\r\n \t\t\t\t\t//res.redirect(\"/labels/\"+API_VERSION+\"/template/choose\", 303);\r\n \t\t\t\t\tTemplateCreator tmpl = new TemplateCreator(op);\r\n\t\t\t \t//tmpl.baseURL = \"http://\"+req.host();\r\n\t\t\t \ttmpl.target = tmpl.baseURL+ req.pathInfo();\r\n\t\t\t \ttmpl.origReq = req;\r\n\t\t\t \t\r\n\t\t\t \treturn tmpl.chooseTemplateForm();\r\n \t\t\t\t}\r\n \t\t\t\telse {\r\n \t\t\t\t\tString format = req.queryParams(\"format\");\r\n \t\t\t\t\tString data = req.queryParams(\"data\");\r\n \t\t\t\t\t//op.baseURL = \"http://\"+req.host() + req.pathInfo();\r\n \t\t\t\t\t//op.baseURL = op.baseURL + req.pathInfo();\r\n \t\t\t\t\t\r\n \t\t\t\t\tif(format==null || format.isEmpty())\r\n \t\t\t\t\t\tformat=\"html\";\r\n \t\t\t\t\t\r\n\t \t\t\t\tif(format.equalsIgnoreCase(\"html\"))\r\n\t \t\t\t\t\ttry {\r\n\t \t\t\t\t\t\t CreateHTML c = new CreateHTML(op, req, res);\r\n\t \t\t\t\t String re = c.result();\r\n\t \t\t\t\t return re;\r\n\t \t\t\t\t\t} catch (Exception e) {\r\n\t \t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t \t\t\t\t\t\te.printStackTrace();\r\n\t \t\t\t\t\t}\r\n\t \t\t\t\t \r\n\t \t\t\t\tif(format.equalsIgnoreCase(\"pdf\"))\r\n\t \t\t\t\t\ttry {\r\n\t \t\t\t\t\t\tCreatePDF c = new CreatePDF(op, req, res);\r\n\t \t\t\t\t return c.result();\r\n\t \t\t\t\t\t} catch (Exception e) {\r\n\t \t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t \t\t\t\t\t\te.printStackTrace();\r\n\t \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t\t\treturn \"3rror\";\r\n \t\t\t});\r\n \t\t\t\r\n \t\t\tget(\"/tmp\", (req, res) -> {\r\n \t \t\t\r\n \t\t\t\t AccessTmp c = new AccessTmp(op, req, res);\r\n \t\t return c.result();\r\n \t\t });\r\n \t\t\t\r\n \t\t\ttry {\r\n\t\t\t\t\tCreatePDFRoute.route(op);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t \r\n \t\t\ttry {\r\n\t\t\t\t\tCreateHTMLRoute.route(op);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t \r\n \t\t\ttry {\r\n\t\t\t\t\tAccessTmpRoute.route(op);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t \r\n\t\t // TODO: Metadata about existing templates\r\n\t\t // @route /templates/ \t\t=> get a list of all existing templates\r\n\t\t // @route /template/{id} \t\t=> get a specific template with unique list of included placeholders and path to html file\r\n\t\t \r\n \t\t\tpath(\"/template\", () -> {\r\n\t\t\t get(\"/show\", (req, res) -> {\r\n\t\t\t\t\t \r\n\t\t\t \tres.header(\"Content-Type\", \"text/html\");\r\n\t\t\t \t\r\n\t\t\t if(req.queryParams(\"template\")!=null)\r\n\t\t\t\t\t\t\top.templateFile = op.templateDir+\"/\"+req.queryParams(\"template\");\r\n\t\t\t \r\n\t\t\t String html = \"\";\r\n\t\t\t File file = new File(op.templateFile);\r\n\t\t\t\t\t FileInputStream fis;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t if(file.exists()) {\r\n\t\t\t\t\t\t\tfis = new FileInputStream(file);\r\n\t\t\t\t\t\t byte[] data = new byte[(int) file.length()];\r\n\t\t\t\t\t\t\tfis.read(data);\r\n\t\t\t\t\t\t fis.close();\r\n\t\t\t\t\t\t html = new String(data, \"UTF-8\");\r\n\t\t\t\t\t };\r\n\t\t\t\t\t res.body(html);\r\n\t\t\t\t\t \r\n\t\t\t\t\t return res.body();\r\n\t\t\t });\r\n\t\t\t \r\n\t\t\t get(\"/show/all\", (req, res) -> {\r\n\t\t\t \t\r\n\t\t\t \tres.header(\"Content-Type\", \"application/json\");\r\n\t\t\t \tres.body(new TemplateCreator(op).getTemplates().toString());\r\n\t\t\t \treturn res.body();\r\n\t\t\t });\r\n\t\t\t \r\n\t\t\t \r\n \t\t\t});\r\n\t\t \r\n\t\t get(\"/check\", (req, res)-> {\r\n\t\t \t\r\n\t\t \t byte[] bytes = Files.readAllBytes(Paths.get(\"templates/submit.html\")); \r\n\t\t\t HttpServletResponse raw = res.raw();\r\n\t\t\t\r\n\t\t\t raw.getOutputStream().write(bytes);\r\n\t\t\t raw.getOutputStream().flush();\r\n\t\t\t raw.getOutputStream().close();\r\n\t\t\t \r\n\t\t\t return res.raw();\r\n\t\t \t\r\n\t\t });\r\n\t\t \r\n\t\t // TODO: set option for configuring Allow-Origin through config.ini\r\n\t\t\t\tbefore((req, res) -> {\r\n\t\t\t\t\tres.header(\"Access-Control-Allow-Origin\", \"*\");\r\n\t\t\t\t\tres.header(\"Access-Control-Allow-Headers\", \"Content-Type,Authorization,X-Requested-With,Content-Length,Accept,Origin,\");\r\n\t\t\t\t});\r\n\t\t \r\n\t\t // TODO: make template editable (e.g. with (static) implementation of WYSIWYG Aloha Editor (http://alohoeditor.org))\r\n\t\t // get(\"/template/edit\", (req, res) -> {\r\n\t\t //\t\t@param Sting template: name of the template\r\n\t\t // }\r\n\t\t \r\n\t\t // TODO: save template (e.g. by sending the (full) DOM of the template edited by Aloha Editor (http://alohoeditor.org))\r\n\t\t // get(\"/template/save\", (req, res) -> {\r\n\t\t //\t\t@param String template: name of the (new) template\r\n\t\t //\t\t@param Boolean overwrite: what to do if template name already exists \r\n\t\t // }\r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t /* get(\"/json\", (req, res) -> {\r\n\t\t \r\n\t\t byte[] bytes = Files.readAllBytes(Paths.get(\"templates/data.json\")); \r\n\t\t HttpServletResponse raw = res.raw();\r\n\t\t\r\n\t\t raw.addHeader(\"Content-Type\", \"application/json\");\r\n\t\t raw.getOutputStream().write(bytes);\r\n\t\t raw.getOutputStream().flush();\r\n\t\t raw.getOutputStream().close();\r\n\t\t\r\n\t\t return res.raw();\r\n\t\t \r\n\t\t \t });\r\n\t\t */\r\n\t \t});\r\n \t});\r\n \t\r\n \tif(op.debug)\r\n \t\tenableDebugScreen(); \r\n }",
"@Override\r\n public void setServletContext(ServletContext arg0) {\n \r\n }",
"public EchoServlet()\n {\n super();\n\n // Create a logging instance\n this.log = Logger.getLogger(EchoServlet.class.getName());\n\n log.info(\"Constructed new EchoServlet\");\n }",
"@Override\n protected void setUp() throws Exception {\n super.setUp();\n if (container == null) {\n String resource = System.getProperty(\"jest.web.xml\", DEFAULT_WEB_XML);\n System.err.println(\"Starting Servlet Container from \" + resource);\n InputStream wdesc = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource);\n assertNotNull(resource + \" not loadable at thread context classpath\", wdesc);\n container = new ServletRunner(wdesc);\n assertNotNull(\"Servlet engine could not be started\", container);\n\n baseURI = System.getProperty(\"jest.base.uri\", DEFAULT_BASE_URI);\n System.err.println(\"Base URI \" + baseURI);\n\n _xmlParser = DocumentBuilderFactory.newInstance().newDocumentBuilder();\n _xpathFactory = XPathFactory.newInstance();\n }\n HttpUnitOptions.setExceptionsThrownOnErrorStatus(true);\n HttpUnitOptions.setScriptingEnabled(false);\n HttpUnitOptions.setExceptionsThrownOnScriptError(false);\n }",
"public PreRepackServlet() {\n\t\tsuper();\n\t}",
"private static void setupOsgi() {\r\n FrameworkStarter.getInstance().start();\r\n }",
"public static void main(String[] args) {\n new HttpService(getHttpServiceDefinition(8080)).start();\n }",
"public WebServer()\n {\n if (!Variables.exists(\"w_DebugLog\"))\n Variables.setVariable(\"w_DebugLog\", true);\n\n if (!Variables.exists(\"w_Port\"))\n Variables.setVariable(\"w_Port\", 80);\n\n if (!Variables.exists(\"w_NetworkBufferSize\"))\n Variables.setVariable(\"w_NetworkBufferSize\", 2048);\n\n PORT = Variables.getInt(\"w_Port\");\n DEBUG = Variables.getBoolean(\"w_DebugLog\");\n BUFFER_SIZE = Variables.getInt(\"w_NetworkBufferSize\");\n }",
"@Override\n public void onStartup(Set<Class<?>> classes, ServletContext servletContext) throws ServletException {\n Logger.getLogger(getClass().getName()).info(\"Starting up\");\n\n configureSessionListener(servletContext);\n try {\n addService(DataSource.class, DBInitializer.initializeDatasource(\"jdbc:derby://localhost:1527/blogdb;create=true\"), servletContext);\n } catch (IOException ioex) {\n throw new ServletException(\"Failed initializing database\", ioex);\n }\n addService(BlogDao.class, new BlogDao(getService(DataSource.class, servletContext)), servletContext);\n addService(BlogPostDao.class, new BlogPostDao(getService(DataSource.class, servletContext)), servletContext);\n addService(BlogPostCommentDao.class, new BlogPostCommentDao(getService(DataSource.class, servletContext)), servletContext);\n configureCharEncFilter(servletContext);\n configureErrorFilter(servletContext);\n configureStats(servletContext);\n }",
"@Override\n public void onStartup(Set<Class<?>> c, ServletContext ctx) throws ServletException {\n \n CDI<Object> cdi;\n try {\n cdi = CDI.current();\n \n if (logger.isLoggable(INFO)) {\n String version = getClass().getPackage().getImplementationVersion();\n logger.log(INFO, \"Initializing Soteria {0} for context ''{1}''\", new Object[]{version, ctx.getContextPath()});\n }\n \n } catch (IllegalStateException e) {\n // On GlassFish 4.1.1/Payara 4.1.1.161 CDI is not initialized (org.jboss.weld.Container#initialize is not called), \n // and calling CDI.current() will throw an exception. It's no use to continue then.\n // TODO: Do we need to find out *why* the default module does not have CDI initialized?\n logger.log(FINEST, \"CDI not available for app context id: \" + Jaspic.getAppContextID(ctx), e);\n \n return;\n }\n \n CdiExtension cdiExtension = cdi.select(CdiExtension.class).get();\n\n if (cdiExtension.isHttpAuthenticationMechanismFound()) {\n\n // A SAM must be registered at this point, since the programmatically added\n // Listener is for some reason restricted (not allow) from calling\n // getVirtualServerName. At this point we're still allowed to call this.\n \n // TODO: Ask the Servlet EG to address this? Is there any ground for this restriction???\n \n CDIPerRequestInitializer cdiPerRequestInitializer = null;\n \n if (!isEmpty(System.getProperty(\"wlp.server.name\"))) {\n // Hardcode server check for now. TODO: design/implement proper service loader/SPI for this\n cdiPerRequestInitializer = new LibertyCDIPerRequestInitializer();\n logger.log(INFO, \"Running on Liberty - installing CDI request scope activator\");\n }\n \n registerServerAuthModule(new HttpBridgeServerAuthModule(cdiPerRequestInitializer), ctx);\n \n // Add a listener so we can process the context destroyed event, which is needed\n // to de-register the SAM correctly.\n ctx.addListener(this);\n }\n\n }",
"protected void setUpServletObjects() throws Exception\n {\n servletContext = new MockServletContext();\n config = new MockServletConfig(servletContext);\n session = new MockHttpSession();\n session.setServletContext(servletContext);\n request = new MockHttpServletRequest(session);\n request.setServletContext(servletContext);\n response = new MockHttpServletResponse();\n }",
"void startServer(String name, Config.ServerConfig config);",
"public void init() throws ServletException {\n\t\t\n\t}",
"@Override\n public void start() throws WebServerException {\n }",
"public void init(ServletConfig config) throws ServletException {\n\t\t \n\t}",
"public void init() throws ServletException {\r\n\r\n\t}",
"public void init() throws ServletException {\n\t}",
"public void init() throws ServletException {\n\t}",
"public void init() throws ServletException {\n\t}",
"public void init() throws ServletException {\n\t}",
"public void init() throws ServletException {\n\t}",
"public void init() throws ServletException {\n\t}",
"public void init() throws ServletException {\n\t}",
"public void init() throws ServletException {\n\t}",
"public void init() throws ServletException {\n\t}",
"public void init() throws ServletException {\n\t}",
"public void init() throws ServletException {\n\t}",
"public void init() throws ServletException {\n\t}",
"public void init() throws ServletException {\n\t}",
"public void init() throws ServletException {\n\t}",
"public void init() throws ServletException {\n\t}",
"public void init(ServletConfig config) throws ServletException {\n\n\t}",
"public void init(ServletConfig config) throws ServletException {\r\n\t}",
"public void init() {\n ServletContext context = getServletContext();\r\n host = context.getInitParameter(\"host\");\r\n port = context.getInitParameter(\"port\");\r\n user = context.getInitParameter(\"user\");\r\n pass = context.getInitParameter(\"pass\");\r\n }",
"public static void main(final String[] args) throws Exception {\n\t\tServer server = new Server(8181);\n\n\t\t// Register and map the dispatcher servlet\n\t\tfinal ServletHolder servletHolder = new ServletHolder(new CXFServlet());\n\t\tfinal ServletContextHandler context = new ServletContextHandler();\n\t\tcontext.setContextPath(\"/\");\n\t\tcontext.addServlet(servletHolder, \"/rest/*\");\n\t\tcontext.addEventListener(new ContextLoaderListener());\n\t\tcontext.setInitParameter(\"contextClass\", AnnotationConfigWebApplicationContext.class.getName());\n\t\tcontext.setInitParameter(\"contextConfigLocation\", AppConfig.class.getName());\n\n\t\tfinal ResourceHandler resource_handler = new ResourceHandler();\n\t\tresource_handler.setDirectoriesListed(true);\n\t\tresource_handler.setWelcomeFiles(new String[] { \"index.html\" });\n\n\t\t// Try to find the webapp files in source\n\t\tFile basePath = new File(\"./src/main/webapp/logiclodge-webapp/\");\n\t\tif (basePath.exists()) {\n\t\t\tresource_handler.setBaseResource(new PathResource(basePath));\n\t\t} else {\n\t\t\t// Otherwise grab them from the classpath (usually inside the jar)\n\t\t\tresource_handler.setResourceBase(new ClassPathResource(\"logiclodge-webapp\").getURI().toString());\n\t\t}\n\n\t\tfinal HandlerList handlers = new HandlerList();\n\t\thandlers.setHandlers(new Handler[] { resource_handler, context });\n\t\tserver.setHandler(handlers);\n\t\tserver.start();\n\t\tserver.join();\n\t}",
"public static void main(String[] args) throws Exception {\n\t\tServer server = new Server();\n\n\t\tServerConnector http = new ServerConnector(server);\n\n\t\thttp.setHost(\"127.0.0.1\");\n\n\t\thttp.setPort(8080);\n\n\t\tserver.addConnector(http);\n\n\t\tServletHandler servletHandler = new ServletHandler();\n\n\t\tservletHandler.addServletWithMapping(CreateServlet.class, \"/CREATE/*\");\n\t\tservletHandler.addServletWithMapping(MyServlet.class, \"/*\");\n\n\t\tserver.setHandler(servletHandler);\n\n\t\tserver.start();\n\t\tserver.join();\n\t}",
"public void init() throws ServletException {\n\t\t\r\n\t\tString file = this.getServletContext().getRealPath( this.getInitParameter( \"config1\" ) );\r\n\t\tSystem.out.println( \"actionServlet..file:\"+file );\r\n\t\r\n\t\tIParseXML parser = new ParseXML();\r\n\t\tIActionConfig config = parser.parser(file);\r\n\t\tSystem.out.println( \"config:\"+config );\r\n\t\t\r\n\t\t//获取tomcat中的数据源\r\n\t\ttry {\r\n\t\t\tClass.forName( \"com.commons.ConnTools\" );\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t//实例化业务派发控制器,\r\n\t\tprocessor = new RequestProcessor( config );\r\n\t\t\r\n\t}",
"private void startServer(String ip, int port, String contentFolder) throws IOException{\n HttpServer server = HttpServer.create(new InetSocketAddress(ip, port), 0);\n \n //Making / the root directory of the webserver\n server.createContext(\"/\", new Handler(contentFolder));\n //Making /log a dynamic page that uses LogHandler\n server.createContext(\"/log\", new LogHandler());\n //Making /online a dynamic page that uses OnlineUsersHandler\n server.createContext(\"/online\", new OnlineUsersHandler());\n server.setExecutor(null);\n server.start();\n \n //Needing loggin info here!\n }",
"@Override\r\n\tpublic void init(ServletConfig config) throws ServletException {\n\t\tsuper.init(config);\r\n\t\tcontext = config.getServletContext();\r\n\t\tputDataSource(config.getServletContext(), \"jdbc/gdaDB\");\r\n//\t\tpublisher = new Publisher();\r\n\r\n\t}",
"public static void main(String [] args) {\n context = new AnnotationConfigApplicationContext(Config.class);\n // For the destroy method to work.\n context.registerShutdownHook();\n\n\n //TestService service = (TestService) context.getBean(\"test_service\");\n //PollingConsumer consumer = (PollingConsumer) context.getBean(\"test_consumer\");\n\n // Start tcp and flash servers\n Map<String, Initializer> initializers = context.getBeansOfType(Initializer.class);\n if (initializers != null) {\n for(Initializer initializer : initializers.values()) {\n initializer.initialize();\n }\n }\n\n NettyManager manager = context.getBean(NettyManager.class);\n try\n {\n manager.startServer();\n }\n catch (Exception e)\n {\n e.printStackTrace();\n }\n }",
"public void init() throws ServletException {\n\t\tSystem.out.println(\"=====start loginServler=========\");\n\t}"
] | [
"0.682322",
"0.66335326",
"0.66194975",
"0.66139126",
"0.65873164",
"0.64432454",
"0.63634396",
"0.63060325",
"0.6190762",
"0.615131",
"0.6142651",
"0.6134122",
"0.6111622",
"0.61002827",
"0.6060891",
"0.60601807",
"0.6016291",
"0.5997577",
"0.59437263",
"0.5936013",
"0.59341246",
"0.5920261",
"0.59125453",
"0.59091145",
"0.59091145",
"0.5893132",
"0.58770543",
"0.5858434",
"0.58490086",
"0.58071727",
"0.579803",
"0.5774906",
"0.5714352",
"0.56799334",
"0.5662176",
"0.56617856",
"0.56549543",
"0.5654131",
"0.5652575",
"0.5649795",
"0.56312114",
"0.56278735",
"0.5619416",
"0.56016535",
"0.5599952",
"0.5598369",
"0.5592404",
"0.5576709",
"0.5576447",
"0.55708265",
"0.5570415",
"0.55544686",
"0.55230045",
"0.5519774",
"0.5517839",
"0.55140626",
"0.5504242",
"0.5495812",
"0.5487275",
"0.5483996",
"0.547398",
"0.54702795",
"0.54640675",
"0.54616016",
"0.54575753",
"0.54565006",
"0.54416263",
"0.5438237",
"0.5433619",
"0.54261065",
"0.5398721",
"0.53960645",
"0.5390336",
"0.5385653",
"0.5385466",
"0.53831124",
"0.53831124",
"0.53831124",
"0.53831124",
"0.53831124",
"0.53831124",
"0.53831124",
"0.53831124",
"0.53831124",
"0.53831124",
"0.53831124",
"0.53831124",
"0.53831124",
"0.53831124",
"0.53831124",
"0.5383068",
"0.5359938",
"0.53522086",
"0.53517896",
"0.53488547",
"0.5329184",
"0.532887",
"0.532475",
"0.53159577",
"0.53135985"
] | 0.6670549 | 1 |
Starting point for the PhatData Stream server | public static void main(String args[]){
String configFile=null;
if(args.length==1){ // The only argument accepted for now is the path to a config file
configFile=args[0];
}else if(args.length==0){
}else{
System.out.println("ERROR! Phat Aggregates must be started with either one or zero configuration files");
System.out.println("java -jar process.jar <configuration file>");
System.exit(1);
}
new AggregatesServer(configFile);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void start() {\n \t\tinit();\n\t\tif(!checkBackend()){\n\t\t\tvertx.createHttpServer().requestHandler(new Handler<HttpServerRequest>() {\n\t\t\t\tpublic void handle(HttpServerRequest req) {\n\t\t\t\t String query_type = req.path();\t\t\n\t\t\t\t req.response().headers().set(\"Content-Type\", \"text/plain\");\n\t\t\t\t\n\t\t\t\t if(query_type.equals(\"/target\")){\n\t\t\t\t\t String key = req.params().get(\"targetID\");\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tprocessRequest(key,req);\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t else {\n\t\t\t\t\t String key = \"1\";\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tprocessRequestRange(key,req);\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t } \n\t\t\t}).listen(80);\n\t\t} else {\n\t\t\tSystem.out.println(\"Please make sure that both your DCI are up and running\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t}",
"@Override\n @SuppressWarnings(\"CallToPrintStackTrace\")\n public void simpleInitApp() {\n \n\n try {\n System.out.println(\"Using port \" + port);\n // create the server by opening a port\n server = Network.createServer(port);\n server.start(); // start the server, so it starts using the port\n } catch (IOException ex) {\n ex.printStackTrace();\n destroy();\n this.stop();\n }\n System.out.println(\"Server started\");\n // create a separat thread for sending \"heartbeats\" every now and then\n new Thread(new NetWrite()).start();\n server.addMessageListener(new ServerListener(), ChangeVelocityMessage.class);\n // add a listener that reacts on incoming network packets\n \n }",
"@Override\r\n\tpublic void startup() {\n\t\t\r\n\t\tString wechatID = \"gh_f49bb9a333b3\";\r\n\t\tString Token = \"spotlight-wechat\";\r\n\t\t\r\n\t\tNoIOClient client = new NoIOClient(\"mg.protel.com.hk\",5010);\r\n\t\tclient.addCRouter(wechatID, Token,null,null);\r\n\t\t\r\n\t\tclient.startup();\r\n\r\n\t}",
"@Override\n public void start(){\n // Retrieve the configuration, and init the verticle.\n JsonObject config = config();\n init(config);\n // Every `period` ms, the given Handler is called.\n vertx.setPeriodic(period, l -> {\n mining();\n send();\n });\n }",
"@Override\n public void onStart() {\n this.dataGenerator = new DataGenerator(this.dataSize, this.dataValues, this.dataValuesBalancing);\n this.dataStream = new DataStream();\n if (this.flowRate != 0)\n this.sleepTime = dataStream.convertToInterval(this.flowRate);\n this.count = 0L;\n// this.me = this.me + \"_\" + getRuntimeContext().getIndexOfThisSubtask();\n new Thread(this::receive).start();\n }",
"public void start() {\n\t\tstartFilesConfig(true);\n\t\tstartSpamFilterTest(false);\n\t}",
"private static void setupServerStreams(ProjectType project) throws IOException{\r\n serverObjectOutputStream = new ObjectOutputStream(socket.getOutputStream());\r\n serverObjectOutputStream.flush();\r\n serverObjectInputStream = new ObjectInputStream(socket.getInputStream());\r\n System.out.println(\"Server: Streams were configured properly!\");\r\n prepareInstructionPacket(project);\r\n }",
"@Override\n\tpublic void run(){\n\t\t//int port = Integer.parseInt(Config.getKey(\"frontPort\"));\n\t\tlog.info(\"启动蓝斯出租车设备数据采集\");\n\t\t//int port=20011;\n\t\tint port=39990;\n\t\tCCSocketServer frontLZss=new CCSocketServer(port,new LZTAXI_Front_IChannelPipeline());\n\t\ttry {\n\t\t\tfrontLZss.run();\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public void setupStreams() throws IOException{\n\t\t\n\t\toutput = new ObjectOutputStream(connection.getOutputStream());\n\t\toutput.flush();\n\t\tinput = new ObjectInputStream(connection.getInputStream());\n\t\tshowMessage(\"All streams are set up and ready to go!\");\n\t\t\n\t\t\t\t\n\t}",
"public void startServer()\n\t{\n\t\twhile(true)\n\t\t{\n\t\t\tSystem.out.println(\"Listen\");\n\t\t\tif(listenInitialValuesRequest)\n\t\t\t{\n\t\t\t\tlistenInitialValuesRequest();\n\t\t\t}\n\t\t}\n\t}",
"public void startData()\n\t\t\t{\n\t\t\t\tsend(\"<data>\", false);\n\t\t\t}",
"public void startServer() {\n System.out.println(\"Inicie\");\n httpServer = new HttpServer();\n httpServer.registerProessor(\"/App\", this);\n try {\n httpServer.start();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public void start() {\n\t\tconnection.start((sender, message) -> message.accept(new Visitor(sender)));\n\t\tloadData();\n\t}",
"protected void serverStarted()\n {\n // System.out.println\n // (\"Server listening for connections on port \" + getPort());\n }",
"private void setupStreams() throws IOException {\n\t\toutput = new ObjectOutputStream(Connection.getOutputStream());\n\t\toutput.flush();\n\t\tinput = new ObjectInputStream(Connection.getInputStream()); \n\t\tshowMessage(\"\\n Streams have successfully connected.\");\n\t}",
"private void startStreams() {\n InputStream inputStream = process.getInputStream();\n bufferedInputStream = new BufferedReader(new InputStreamReader(inputStream));\n InputStream errorStream = process.getErrorStream();\n bufferedErrorStream = new BufferedReader(new InputStreamReader(errorStream));\n }",
"@Override\n\t\tpublic void run() {\n\t\t\tIndexServer is = new IndexServer(3002,\"/src/P2Pfile/Peer2/filefolder\" );\n\t\t\tSystem.out.println(\"Peer2Server Start\");\n\t\t\tis.ConnectionAccept();\n\t\t\t\n\t\t\n\t\t\t\n\t\t}",
"public static void main(String[] args) {\n\t\tEndpoint.publish(\"http://127.0.0.1:1111/cs\", new Calculator());\r\n\t\tSystem.out.println(\"Server has started\");\r\n\r\n\t}",
"public RunMe() throws IOException {\n\n\t\t// Load data\n\t\tloadDataMap();\n\t\t\n\t\t// Start server\n\t\tcfg = createFreemarkerConfiguration();\n\t\tsetPort(8081);\n\t\tinitializeRoutes();\n\t}",
"@Override\n\tpublic void streamingServiceStarted(int arg0) {\n\t\t\n\t}",
"public void run() {\n ServerSocketChannelFactory acceptorFactory = new OioServerSocketChannelFactory();\n ServerBootstrap server = new ServerBootstrap(acceptorFactory);\n\n // The pipelines string together handlers, we set a factory to create\n // pipelines( handlers ) to handle events.\n // For Netty is using the reactor pattern to react to data coming in\n // from the open connections.\n server.setPipelineFactory(new EchoServerPipelineFactory());\n\n server.bind(new InetSocketAddress(port));\n }",
"public static void main(String[] args) {\n PingPongServerFactory factory = new RealFactory();\n Skeleton<PingPongServerFactory> skeleton = null;\n\n\n try {\n // take the localHost's hostname and create the skeleton at port 80\n InetSocketAddress inet = new InetSocketAddress(InetAddress.getLocalHost().getHostName(), 80);\n\n skeleton = new Skeleton<PingPongServerFactory>(PingPongServerFactory.class, factory, inet);\n // start the skeleton and wait for requests\n skeleton.start();\n\n } catch (Exception e) {\n e.printStackTrace();\n try {\n skeleton.stop();\n } catch (NullPointerException e1) {\n e1.printStackTrace();\n }\n }\n }",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\tSystem.out.println(\" ThriftServer start ing ....\");\n\t\t\t\ttry { \n\t\t\t\t\tif (!server.isServing()) {\n\t\t\t\t\t\tserver.serve();\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} finally {\n\t\t\t\t\tif (transport != null) {\n\t\t\t\t\t\ttransport.close();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}",
"public void startServer() {\n // configure the server properties\n int maxThreads = 20;\n int minThreads = 2;\n int timeOutMillis = 30000;\n\n // once routes are configured, the server automatically begins\n threadPool(maxThreads, minThreads, timeOutMillis);\n port(Integer.parseInt(this.port));\n this.configureRoutesAndExceptions();\n }",
"public void startup() {\n\t\tstart();\n }",
"public static void start() {\n enableIncomingMessages(true);\n }",
"private static void startServer(){\n try{\n MMServer server=new MMServer(50000);\n }catch (IOException ioe){\n System.exit(0);\n }\n \n }",
"public void start() {}",
"public void start() {}",
"public void start() {\n System.out.println(\"server started\");\n mTerminalNetwork.listen(mTerminalConfig.port);\n }",
"public void startRunning(){\n\t\ttry{\n\t\t\tserver = new ServerSocket(6789, 100);\n\t\t\t//int Port Number int 100 connections max (backlog / queue link)\n\t\t\twhile(true){\n\t\t\t\ttry{\n\t\t\t\t\twaitForConnection();\n\t\t\t\t\tsetupStreams();\n\t\t\t\t\twhileChatting();\n\t\t\t\t\t//connect and have conversation\n\t\t\t\t}catch(EOFException eofe){\n\t\t\t\t\tshowMessage(\"\\n Punk Ass Bitch.\");\n\t\t\t\t}finally{\n\t\t\t\t\tcloseChat();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}catch(IOException ioe){\n\t\t\tioe.printStackTrace();\n\t\t\t\n\t\t}\n\t}",
"public void onStart() {\n\t\tnew Thread() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tinitConnection();\n\t\t\t\treceive();\n\t\t\t}\n\t\t}.start();\n\t}",
"@Override\n protected void initiateStream() {\n // Execute the test by calling its processStream() entry point\n // and recording how long it takes to run.\n List<List<SearchResults>> results = RunTimer\n .timeRun(this::processStream, TAG);\n\n // Print the results of the test.\n printResults(TAG, results);\n }",
"public void start() throws IOException {\n\t\tserverSocket = new ServerSocket(port);\n\t\tserverCallbacks.forEach(c -> c.onServerStarted(this, port));\n\t}",
"public void initTransport() {\n JDE.signal(procID, MESSAGE, \"Debugger connected to standard I/O socket.\", QUOTE);\n\n final Process process = m_debugger.getVM().process();\n standardInputProcessor = new StandardInputProcessor(process.getOutputStream());\n standardInputProcessor.start();\n\n standardOutputWriter = new StandardOutputWriter(m_sioSocket);\n standardOutputWriter.println(\"*** Process Standard I/O ***\");\n\n standardOutputProcessor = new StandardOutputProcessor(process.getInputStream());\n standardOutputProcessor.start();\n\n standardErrorProcessor = new StandardErrorProcessor(process.getErrorStream());\n standardErrorProcessor.start();\n\n }",
"private void start() {\n\n\t}",
"public void start() {\n system = ActorSystem.create(\"http-server\", config);\n\n Settings settings = SettingsExtension.SettingsExtensionProvider.get(system);\n\n vHostHandlers = settings.vHostConfigs()\n .stream()\n .map(vc -> new AkkaTcpHandler(system, vc))\n .collect(Collectors.toList());\n\n vHostHandlers.forEach(VHostHandler::start);\n\n Runtime.getRuntime().addShutdownHook(new Thread(this::terminate));\n }",
"@Override\n public void startup() {\n }",
"public synchronized boolean start(){\n \n\t\t/**\n\t\t * CONNECT TO SERVER\n\t\t */\n\t\tboolean connection = connectToServer(oml_server);\n \n\t\t/**\n\t\t * CREATE THE HEADER\n\t\t */\n\t\tcreate_head();\n \n\t\t/**\n\t\t * SEND THE HEADER\n\t\t */\n\t\tboolean injection = inject_head();\n\t\t\n\t\tif( connection && injection ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"@Override\r\n\tpublic void initial() {\n\t\ttry {\r\n\t\t\tserverSocket = new ServerSocket(port);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t// System.out.println(\"LocalProxy run on \" + port);\r\n\t}",
"protected void serverStarted()\n {\n System.out.println(\"Server listening for connections on port \" + getPort());\n }",
"public static void main(String[] args) throws Exception {\n final BiStreamServer node = new BiStreamServer(Integer.parseInt(args[0]), args[1], args[2]);\n node.startFiles(args[1]);\n //node.print();\n node.startGrpc();\n node.print();\n node.blockUntilShutdown();\n }",
"public void run(){\r\n\t\tSystem.out.println(\"Launching Server\");\r\n\t\tServer srv = new Server(log);\r\n\t\tnew CollectorServer(srv).start();\r\n\t\ttry {\r\n\t\t\tnew ServerUDPThread(srv).start();\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.err.println(\"Error in ServerUDP Broadcast\");\r\n\t\t}\r\n\t}",
"public void startServer() {\n server.start();\n }",
"public void processStart(){\n initWorkerQueue();\n DataBean serverArgs = new DataBean();\n serverArgs.setValue(\"mode\",\"server\");\n serverArgs.setValue(\"messagekey\",\"72999\");\n serverArgs.setValue(\"user\",\"auth\");\n serverArgs.setValue(\"messagechannel\",\"/esb/system\");\n messageClient = new MessageClient(this,serverArgs);\n Helper.writeLog(1,\"starting message server\");\n messageClient.addHandler(this);\n \n }",
"public void run() {\n Runtime.getRuntime().addShutdownHook(new MNOSManagerShutdownHook(this));\n\n OFNiciraVendorExtensions.initialize();\n\n this.startDatabase();\n\n try {\n final ServerBootstrap switchServerBootStrap = this\n .createServerBootStrap();\n\n this.setServerBootStrapParams(switchServerBootStrap);\n\n switchServerBootStrap.setPipelineFactory(this.pfact);\n final InetSocketAddress sa = this.ofHost == null ? new InetSocketAddress(\n this.ofPort) : new InetSocketAddress(this.ofHost,\n this.ofPort);\n this.sg.add(switchServerBootStrap.bind(sa));\n }catch (final Exception e){\n throw new RuntimeException(e);\n }\n\n }",
"public void startup(){}",
"public void startup() throws AMPException;",
"public void run(){\n\t\tstartServer();\n\t}",
"public void start() {\n\n\t}",
"public void start() {\n\t\t\n\t\ttry {\n\t\t\tmainSocket = new DatagramSocket(PORT_NUMBER);\n\t\t}\n\t\tcatch(SocketException ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t\t\n\t\t//Lambda expression to shorten the run method\n\t\tThread serverThread = new Thread( () -> {\n\t\t\tlisten();\n\t\t});\n\t\t\n\t\tserverThread.start();\n\t}",
"public void start()\n {\n }",
"private void setupStreams() {\n\t\ttry {\n\t\t\tthis.out = new ObjectOutputStream(this.sock.getOutputStream());\n\t\t\tthis.out.flush();\n\t\t\tthis.in = new ObjectInputStream(this.sock.getInputStream());\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public static void main(String[] args) {\n\n try (ServerSocket ss = new ServerSocket(PORT)) {\n System.out.println(\"chat.Server is started...\");\n System.out.println(\"Server address: \" + getCurrentIP() + \":\" + PORT);\n\n while (true) {\n Socket socket = ss.accept();\n new Handler(socket).start();\n }\n\n } catch (IOException e) {\n System.out.println(\"chat.Server error.\");\n }\n }",
"@Override\n public void start(){\n final ChannelProcessor channel = getChannelProcessor();\n\n final Map<String, String> headers = new HashMap<String, String>();\n\n // The StatusListener is a twitter4j API, which can be added to a Twitter\n // stream, and will execute methods every time a message comes in through\n // the stream.\n StatusListener statusListener = new StatusListener() {\n // The onStatus method is executed every time a new tweet comes in.\n @Override\n public void onStatus(Status status) {\n // The EventBuilder is used to build an event using the headers and\n // the raw JSON of a tweet\n // shouldn't log possibly sensitive customer data\n //logger.debug(\"tweet arrived\");\n\n headers.put(\"timestamp\",String.valueOf(status.getCreatedAt().getTime()));\n\n Event event1;\n event1 = EventBuilder.withBody(TwitterObjectFactory.getRawJSON(status).getBytes(),headers);\n //event2 = EventBuilder.withBody(Integer.toString(status.getRetweetCount()),(Charset)headers);\n //event3 = EventBuilder.withBody(status.getText().getBytes(), headers);\n channel.processEvent(event1);\n //channel.processEvent(event2);\n\n }\n\n @Override public void onDeletionNotice(StatusDeletionNotice statusDeletionNotice) {\n\n }\n @Override public void onTrackLimitationNotice(int i) {\n\n }\n @Override public void onScrubGeo(long l, long l1) {\n\n }\n @Override public void onStallWarning(StallWarning stallWarning) {\n\n }\n @Override public void onException(Exception e) {\n\n }\n };\n\n twitterStream.addListener(statusListener);\n\n if(keywords.length != 0){\n FilterQuery filterQuery = new FilterQuery().track(keywords);\n twitterStream.filter(filterQuery);\n }else{\n twitterStream.sample();\n }\n super.start();\n }",
"@Override\r\n\tpublic void start() {\n\t\t\r\n\t}",
"@Override\n\tpublic void preServe() {\n\n\t}",
"protected void serverStarted()\r\n {\r\n System.out.println\r\n (\"Server listening for connections on port \" + getPort());\r\n }",
"public static void main(String[] args) throws Exception {\n\t\tfinal StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();\n\n\n /* if you would like to use runtime configuration properties, uncomment the lines below\n * DataStream<String> input = createSourceFromApplicationProperties(env);\n */\n\n\t\tDataStream<String> input = createSourceFromStaticConfig(env);\n\n\t\t// Kinesis Firehose sink\n\t\tinput.addSink(createFirehoseSinkFromStaticConfig());\n\n\t\t// If you would like to use runtime configuration properties, uncomment the lines below\n\t\t// input.addSink(createFirehoseSinkFromApplicationProperties());\n\n\t\tenv.execute(\"Flink Streaming Java API Skeleton\");\n\t}",
"public SocketServer() {\n \n super();\n start();\n\n }",
"void onServerStarted();",
"@Override\n\tpublic void start() {\n\n\t}",
"public abstract void stream(int port);",
"public void run() {\n \t\ttry {\n \t\t\tout.setHeader(init(in.getHeader()));\n \t\t\tsetSampleProcessed(0); // set the number of samples being processed\n \t\t\t\t\t\t\t\t\t// as zero\n \t\t\twhile (true) {\n \t\t\t\tStreamFrame sf = process(in.recvFrame());\n \t\t\t\tif (sf != null)\n \t\t\t\t\tout.sendFrame(sf);\n \t\t\t}\n \t\t} catch (Exception e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t}",
"protected void start() {\n }",
"public void start() {\n System.err.println(\"Server will listen on \" + server.getAddress());\n server.start();\n }",
"@Override\n public void start() {}",
"public void startRunning() {\n\t\t\t\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\tserver = new ServerSocket(6789, 100); //6789 is the port number for docking(Where to connect). 100 is backlog no, i.e how many people can wait to access it.\n\t\t\t\twhile (true) {\n\t\t\t\t\t//This will run forever.\n\t\t\t\t\t\n\t\t\t\t\ttry{\n\t\t\t\t\t\t\n\t\t\t\t\t\twaitForConnection();\n\t\t\t\t\t\tsetupStreams();\n\t\t\t\t\t\twhileChatting();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tcatch(EOFException eofException) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tshowMessage(\"\\n The server has ended the connection!\");\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tfinally {\n\t\t\t\t\t\t\n\t\t\t\t\t\tcloseAll();\n\t\t\t\t\t\t//Housekeeping.\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tcatch(IOException ioException ) {\n\t\t\t\t\n\t\t\t\tioException.printStackTrace();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}",
"@Override\n public void initialize() {\n\n try {\n /* Bring up the API server */\n logger.info(\"loading API server\");\n apiServer.start();\n logger.info(\"API server started. Say Hello!\");\n /* Bring up the Dashboard server */\n logger.info(\"Loading Dashboard Server\");\n if (dashboardServer.isStopped()) { // it may have been started when Flux is run in COMBINED mode\n dashboardServer.start();\n }\n logger.info(\"Dashboard server has started. Say Hello!\");\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n }",
"public void startServer() {\n URLClassLoader loader = createClasspath(opts);\n X_Process.runInClassloader(loader, appServer\n .map(DevAppServer::doStartServer, getAppName() + \"Server\", getPort())\n .ignoreOut1().unsafe());\n }",
"@Override public void start() {\n }",
"public void runServer() throws IOException {\n runServer(0);\n }",
"public void start()\n throws IOException, StunException\n {\n localSocket = new IceUdpSocketWrapper(\n new SafeCloseDatagramSocket(serverAddress));\n\n stunStack.addSocket(localSocket);\n stunStack.addRequestListener(serverAddress, this);\n\n }",
"private void processStart() {\n // broadcast HELLO to every neighbors\n for(int i = 0; i < this.nextAvailPort; i++) {\n if(this.ports[i].getRemoteRouterDesc() == null) {\n continue;\n }\n\n SOSPFPacket helloPak = SOSPFPacket.createHelloPak(this.routerDesc, this.ports[i].getRemoteRouterDesc());\n this.ports[i].send(helloPak);\n\n this.ports[i].initializeHeartbeat();\n }\n }",
"public void start()\n/* 354: */ {\n/* 355:434 */ onStartup();\n/* 356: */ }",
"public static void main(String[] args) {\n\t\t ServerSocket servidor;\n\t\t Socket sock;\n\t\t Scanner sc = new Scanner(System.in);\n\t\t Boolean parar = true;\n\t\t int puerto;\n\t\t DataInputStream entrada;\n\t\t \n\t\t/* System.out.println(\"En que puerto quieres trabajar?\");\n\t\t puerto = sc.nextInt();\n\t\t sc.nextLine();*/\n\t\t \n\t\t try {\n\t\t\tservidor = new ServerSocket(5555);\n\t\t\t\n\t\t\twhile(true) {\n\t\t\t\tsock = servidor.accept();\n\t\t\t\tHilo h1 = new Hilo(sock);\n\t\t\t\th1.start();\n\t\t\t}\n\t\t\t/*Thread hilo = new Thread(h1);\n\t\t\thilo.start();*/\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t \n\t}",
"@Override\r\n public void start() {\r\n }",
"public void start() {\n\t\t\n\t}",
"public void start() {\n\t\t\n\t}",
"public void run()\n {\n try\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tInputStream inStream = incoming.getInputStream();\n\t\t\t\tOutputStream outStream = incoming.getOutputStream();\n\n\t\t\t\tScanner in = new Scanner(inStream);\n\t\t\t\tPrintWriter out = new PrintWriter(outStream,true);\n\n\t\t\t\tout.println(\"Hello this is Somesh SERVER. Your count is : \" + counter + \" Enter BYE to exit\");\n\n\t\t\t\tout.println(\"Avilable Processors :- \" + Runtime.getRuntime().availableProcessors());\n out.println(\" Max Memory : \" + Runtime.getRuntime().maxMemory());\n \n // Runtime.getRuntime().exec(\"shutdown -i\");\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n // out.println(\"OOPS! You did something wrong.\");\n\t\t\t\tincoming.close();\n\t\t\t}\n\t\t}\n\t\tcatch(IOException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"private void initStreams() throws IOException {\n OutputStream os = socket.getOutputStream();\n InputStream is = socket.getInputStream();\n dos = new DataOutputStream(new BufferedOutputStream(os));\n dis = new DataInputStream(new BufferedInputStream(is));\n }",
"public void streamSubscriberStart(ISubscriberStream stream);",
"@Override\n\tpublic void start() {\n\t\t\n\t}",
"@Override\n\tpublic void start() {\n\t\t\n\t}",
"@Override\n\tpublic void start() {\n\t\t\n\t}",
"@Override\n\tpublic void start() {\n\t\t\n\t}",
"private void startServer() {\n\t\ttry {\n//\t\t\tserver = new Server();\n//\t\t\tserver.start();\n\t\t} catch (Exception e) {\n\t\t\t// TODO: add message in UI for user\n\t\t}\n\t}",
"@Override\n\tpublic void start() {\n\t}",
"@Override\n\tpublic void start() {\n\t}",
"@Override\n public void start() { }",
"public static void main (String[] args){\n AudioServer main = new AudioServer(args);\n }",
"@Override\n public void run() {\n try {\n //create a socket using sever name or IP and port\n socket = new Socket(serverName, serverPort);\n // set up stream\n start();\n //if everything is good, enable controls on GUI\n send.setEnabled(true); // setup buttons\n tf.setEnabled(true);\n connect.setEnabled(false);\n //catch execeptions if any\n } catch (UnknownHostException uhe) {\n display(\"Host unknown: \" + uhe.getMessage()); // Alert not the right host/ IP\n } catch (IOException ioe) {\n display(\"Unexpected exception: \" + ioe.getMessage());\n }\n //keep listening to incoming messages\n while (true) { // the infinite loop\n try {\n while (!bufferInput.ready()) { // when steam ready to read\n }\n String output = bufferInput.readLine(); // Received the data from socket\n while (output != null) \n {append(output + \"\\n\");\n output = bufferInput.readLine();} } \n catch (IOException ioe) {ioe.getMessage();}\t\n \t\t\t}\t\t }",
"@Override\n public void start() {\n }",
"@Override\n public void start() {\n }",
"@Override\n public void start() {\n }",
"@Override\n public void start() {\n }",
"@Override\n public void start() {\n }",
"@Override\n public void start() {\n }",
"@Override\n public void start() {\n }",
"public static void setupClientStreams() throws IOException{\r\n clientObjectOutputStream = new ObjectOutputStream(socket.getOutputStream());\r\n clientObjectOutputStream.flush();\r\n clientObjectInputStream = new ObjectInputStream(socket.getInputStream());\r\n System.out.println(\"Client: streams are now configured!\");\r\n //sendProfilingPacket();\r\n }",
"public static void main(String[] args) {\n Server server = new Server(1234);\n server.listen();\n \n // YOUR CODE HERE\n // It is not required (or recommended) to implement the server in\n // this runner class.\n }"
] | [
"0.6240193",
"0.6211901",
"0.6204902",
"0.6166464",
"0.61233175",
"0.6122444",
"0.61040866",
"0.60628414",
"0.60279864",
"0.6026268",
"0.59960407",
"0.5988505",
"0.5961334",
"0.5953284",
"0.5929988",
"0.59182715",
"0.59165967",
"0.5907937",
"0.5902318",
"0.58982414",
"0.5886427",
"0.5861856",
"0.5848923",
"0.58348674",
"0.58277535",
"0.5826641",
"0.58224297",
"0.5821812",
"0.5821812",
"0.5812287",
"0.5809088",
"0.57846427",
"0.5773153",
"0.5772092",
"0.57587564",
"0.57505685",
"0.57427466",
"0.5739014",
"0.5731014",
"0.5727535",
"0.5716692",
"0.57062256",
"0.57033926",
"0.57027185",
"0.56877786",
"0.56870663",
"0.5684219",
"0.5676492",
"0.56744754",
"0.5668549",
"0.5667132",
"0.5660604",
"0.5657403",
"0.56435657",
"0.56399024",
"0.56387705",
"0.5638088",
"0.5635588",
"0.56318164",
"0.5626053",
"0.5624901",
"0.5617177",
"0.5616211",
"0.56146324",
"0.56144726",
"0.561445",
"0.56041944",
"0.56029063",
"0.5601311",
"0.55993265",
"0.55990064",
"0.559848",
"0.5593613",
"0.5590169",
"0.55891883",
"0.558578",
"0.5580784",
"0.55778766",
"0.55778766",
"0.55774784",
"0.55760795",
"0.5571658",
"0.5566146",
"0.5566146",
"0.5566146",
"0.5566146",
"0.5557184",
"0.55565333",
"0.55565333",
"0.5552454",
"0.5547313",
"0.5541248",
"0.55267966",
"0.55267966",
"0.55267966",
"0.55267966",
"0.55267966",
"0.55267966",
"0.55267966",
"0.5524857",
"0.55171525"
] | 0.0 | -1 |
/ 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();
long[] ar = new long[n];
for(int ar_r=0; ar_r<n; ar_r++){
ar[ar_r] = in.nextLong();
}
double[] result = findPlusMinus(n, ar);
System.out.println(result[0]);
System.out.println(result[1]);
System.out.println(result[2]);
} | {
"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 |
Inflate the menu; this adds items to the action bar if it is present. | @Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_create_shopping_list, menu);
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.actions, menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tgetMenuInflater().inflate(R.menu.actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.actions_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main_actions, menu);\n\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n\t\tinflater.inflate(R.menu.action_bar_menu, menu);\r\n\t\tmMenu = menu;\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.act_bar_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_actions, menu);\r\n\t\treturn true;\r\n //return super.onCreateOptionsMenu(menu);\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\r\n\t inflater.inflate(R.menu.action_bar_all, menu);\r\n\t return super.onCreateOptionsMenu(menu);\r\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\t super.onCreateOptionsMenu(menu);\n\t\tMenuInflater muu= getMenuInflater();\n\t\tmuu.inflate(R.menu.cool_menu, menu);\n\t\treturn true;\n\t\t\n\t\t\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.adventure_archive, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.archive_menu, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n \tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n \t\tinflater.inflate(R.menu.main, menu);\n \t\tsuper.onCreateOptionsMenu(menu, inflater);\n \t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.action_menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater bow=getMenuInflater();\n\t\tbow.inflate(R.menu.menu, menu);\n\t\treturn true;\n\t\t}",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.action_menu, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\t\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\t\t\n\t\t/* Inflate the menu; this adds items to the action bar if it is present */\n\t\tgetMenuInflater().inflate(R.menu.act_main, menu);\t\t\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflate = getMenuInflater();\n inflate.inflate(R.menu.menu, ApplicationData.amvMenu.getMenu());\n return true;\n }",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.menu, menu);\n\t\t\treturn true; \n\t\t\t\t\t\n\t\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.main, menu);\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) \n {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_bar, menu);\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_item, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.menu, menu);\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t \n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\t//menu.clear();\n\t\tinflater.inflate(R.menu.soon_to_be, menu);\n\t\t//getActivity().getActionBar().show();\n\t\t//getActivity().getActionBar().setBackgroundDrawable(\n\t\t\t\t//new ColorDrawable(Color.rgb(223, 160, 23)));\n\t\t//return true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n this.getMenuInflater().inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.main, menu);\n }",
"@Override\n\tpublic void onCreateOptionsMenu( Menu menu, MenuInflater inflater )\n\t{\n\t\tsuper.onCreateOptionsMenu( menu, inflater );\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}",
"@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\r\n \t// We must call through to the base implementation.\r\n \tsuper.onCreateOptionsMenu(menu);\r\n \t\r\n MenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_menu, menu);\r\n\r\n return true;\r\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.inter_main, menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.action, menu);\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu (Menu menu){\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.custom_action_bar, menu);\n\t\treturn true;\n\t}",
"public void initMenubar() {\n\t\tremoveAll();\n\n\t\t// \"File\"\n\t\tfileMenu = new FileMenuD(app);\n\t\tadd(fileMenu);\n\n\t\t// \"Edit\"\n\t\teditMenu = new EditMenuD(app);\n\t\tadd(editMenu);\n\n\t\t// \"View\"\n\t\t// #3711 viewMenu = app.isApplet()? new ViewMenu(app, layout) : new\n\t\t// ViewMenuApplicationD(app, layout);\n\t\tviewMenu = new ViewMenuApplicationD(app, layout);\n\t\tadd(viewMenu);\n\n\t\t// \"Perspectives\"\n\t\t// if(!app.isApplet()) {\n\t\t// perspectivesMenu = new PerspectivesMenu(app, layout);\n\t\t// add(perspectivesMenu);\n\t\t// }\n\n\t\t// \"Options\"\n\t\toptionsMenu = new OptionsMenuD(app);\n\t\tadd(optionsMenu);\n\n\t\t// \"Tools\"\n\t\ttoolsMenu = new ToolsMenuD(app);\n\t\tadd(toolsMenu);\n\n\t\t// \"Window\"\n\t\twindowMenu = new WindowMenuD(app);\n\n\t\tadd(windowMenu);\n\n\t\t// \"Help\"\n\t\thelpMenu = new HelpMenuD(app);\n\t\tadd(helpMenu);\n\n\t\t// support for right-to-left languages\n\t\tapp.setComponentOrientation(this);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.listing, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp=getMenuInflater();\n\t\tblowUp.inflate(R.menu.welcome_menu, menu);\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.item, menu);\n return true;\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.resource, menu);\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu,menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.home_action_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.template, menu);\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n Log.d(\"onCreateOptionsMenu\", \"create menu\");\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.socket_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_menu, menu);//Menu Resource, Menu\n\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actionbar, menu);\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(toolbar_res, menu);\n updateMenuItemsVisibility(menu);\n return true;\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t// \n\t\tMenuInflater mi = getMenuInflater();\n\t\tmi.inflate(R.menu.thumb_actv_menu, menu);\n\t\t\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n }",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.swag_list_activity_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\n\t\treturn true;\n\t}",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.jarvi, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"public void onCreateOptionsMenu(Menu menu, MenuInflater inflater){\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {\n menuInflater.inflate(R.menu.main, menu);\n\n }",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.add__listing, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actmain, menu);\r\n return true;\r\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.buat_menu, menu);\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.layout.menu, menu);\n\t\treturn true;\n\t}",
"@Override\npublic boolean onCreateOptionsMenu(Menu menu) {\n\n\t\n\t\n\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\n\treturn super.onCreateOptionsMenu(menu);\n}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ichat, menu);\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater)\n\t{\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\tinflater.inflate(R.menu.expenses_menu, menu);\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.action_bar, menu);\n return true;\n }",
"@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}",
"@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}",
"@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp = getMenuInflater();\n\t\tblowUp.inflate(R.menu.status, menu);\n\t\treturn true;\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.menu, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn true;\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ui_main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_activity_actions, menu);\n return true;\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }"
] | [
"0.72461367",
"0.7201596",
"0.7195268",
"0.7177002",
"0.71069986",
"0.7039653",
"0.70384306",
"0.70115715",
"0.7010647",
"0.69803435",
"0.6945406",
"0.69389313",
"0.6933442",
"0.69172275",
"0.69172275",
"0.6890826",
"0.6883689",
"0.687515",
"0.6874831",
"0.68615955",
"0.68615955",
"0.68615955",
"0.68615955",
"0.68522274",
"0.6846375",
"0.68189865",
"0.68165565",
"0.68124795",
"0.6812267",
"0.6812267",
"0.68056566",
"0.6800461",
"0.6797465",
"0.6790805",
"0.6789039",
"0.6787885",
"0.6782993",
"0.67597246",
"0.67570525",
"0.6747535",
"0.6743268",
"0.6743268",
"0.6740546",
"0.67395175",
"0.67256093",
"0.6723954",
"0.6722248",
"0.6722248",
"0.6720444",
"0.67118156",
"0.6706721",
"0.6704184",
"0.66993994",
"0.66988564",
"0.669681",
"0.66943884",
"0.66860807",
"0.668306",
"0.668306",
"0.6682587",
"0.668012",
"0.6678661",
"0.6676379",
"0.6668044",
"0.66669863",
"0.66628903",
"0.6657356",
"0.6657356",
"0.6657356",
"0.66565585",
"0.665397",
"0.665397",
"0.665397",
"0.66525495",
"0.66518986",
"0.66496557",
"0.6648199",
"0.6646489",
"0.66462386",
"0.6646177",
"0.6645531",
"0.66453475",
"0.66446036",
"0.66438025",
"0.6642411",
"0.6641632",
"0.6638948",
"0.6634394",
"0.66336566",
"0.6632082",
"0.66315377",
"0.66315377",
"0.66315377",
"0.6628936",
"0.6627818",
"0.6627061",
"0.66256744",
"0.6623986",
"0.661993",
"0.6618369",
"0.6618369"
] | 0.0 | -1 |
Handle action bar item clicks here. The action bar will automatically handle clicks on the Home/Up button, so long as you specify a parent activity in AndroidManifest.xml. | @Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public boolean onOptionsItemSelected(MenuItem item) { Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n\n //\n // HANDLE BACK BUTTON\n //\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // Back button clicked\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // app icon in action bar clicked; goto parent activity.\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n switch (id) {\r\n case android.R.id.home:\r\n // app icon in action bar clicked; go home\r\n this.finish();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // app icon in action bar clicked; go home\n finish();\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n Log.e(\"clik\", \"action bar clicked\");\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n\t public boolean onOptionsItemSelected(MenuItem item) {\n\t int id = item.getItemId();\n\t \n\t\t\tif (id == android.R.id.home) {\n\t\t\t\t// Respond to the action bar's Up/Home button\n\t\t\t\t// NavUtils.navigateUpFromSameTask(this);\n\t\t\t\tonBackPressed();\n\t\t\t\treturn true;\n\t\t\t}\n\t \n\t \n\t return super.onOptionsItemSelected(item);\n\t }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n switch (item.getItemId()) {\r\n // Respond to the action bar's Up/Home button\r\n case android.R.id.home:\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n\n switch (item.getItemId()) {\n case android.R.id.home:\n\n // app icon in action bar clicked; goto parent activity.\n this.finish();\n return true;\n default:\n\n return super.onOptionsItemSelected(item);\n\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n\n switch (item.getItemId()) {\n case android.R.id.home:\n\n // app icon in action bar clicked; goto parent activity.\n this.finish();\n return true;\n default:\n\n return super.onOptionsItemSelected(item);\n\n }\n }",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tonBackPressed();\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Handle presses on the action bar items\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n case R.id.action_clear:\n return true;\n case R.id.action_done:\n\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n onActionHomePressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n switch (item.getItemId())\n {\n case android.R.id.home :\n super.onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId ()) {\n case android.R.id.home:\n onBackPressed ();\n return true;\n\n default:\n break;\n }\n return super.onOptionsItemSelected ( item );\n }",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t switch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\t// app icon in action bar clicked; go home \n\t\t\tIntent intent = new Intent(this, Kelutral.class); \n\t\t\tintent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); \n\t\t\tstartActivity(intent); \n\t\t\treturn true;\t\t\n\t case R.id.Search:\n\t \treturn onSearchRequested();\n\t\tcase R.id.AppInfo:\n\t\t\t// Place holder menu item\n\t\t\tIntent newIntent = new Intent(Intent.ACTION_VIEW,\n\t\t\t\t\tUri.parse(\"http://forum.learnnavi.org/mobile-apps/\"));\n\t\t\tstartActivity(newIntent);\n\t\t\treturn true;\n\t\tcase R.id.Preferences:\n\t\t\tnewIntent = new Intent(getBaseContext(), Preferences.class);\n\t\t\tstartActivity(newIntent);\n\t\t\treturn true;\t\n\t }\n\t return false;\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n\n case android.R.id.home:\n onBackPressed();\n return true;\n\n }\n return super.onOptionsItemSelected(item);\n\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // Intent homeIntent = new Intent(this, MainActivity.class);\n // homeIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n // startActivity(homeIntent);\n finish();\n return true;\n default:\n return (super.onOptionsItemSelected(item));\n }\n\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // setResult and close the activity when Action Bar Up Button clicked.\n if (item.getItemId() == android.R.id.home) {\n setResult(RESULT_CANCELED);\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // This ID represents the Home or Up button. In the case of this\n // activity, the Up button is shown. Use NavUtils to allow users\n // to navigate up one level in the application structure. For\n // more details, see the Navigation pattern on Android Design:\n //\n // http://developer.android.com/design/patterns/navigation.html#up-vs-back\n //\n \tgetActionBar().setDisplayHomeAsUpEnabled(false);\n \tgetFragmentManager().popBackStack();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n switch (item.getItemId()) {\n case android.R.id.home:\n super.onBackPressed();\n return true;\n\n default:\n // If we got here, the user's action was not recognized.\n // Invoke the superclass to handle it.\n return super.onOptionsItemSelected(item);\n\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if(id == android.R.id.home){\n onBackPressed();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n\n }\n\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@RequiresApi(api = Build.VERSION_CODES.M)\n @Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tif(item.getItemId()==android.R.id.home)\r\n\t\t{\r\n\t\t\tgetActivity().onBackPressed();\r\n\t\t}\r\n\t\treturn super.onOptionsItemSelected(item);\r\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if(item.getItemId()==android.R.id.home){\n super.onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n return false;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n //Back arrow\n case android.R.id.home:\n onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // android.R.id.home是Android内置home按钮的id\n finish();\n break;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n super.onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n this.onBackPressed();\n return false;\n }\n return false;\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n int id = item.getItemId();\n\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n switch (item.getItemId()) {\r\n\r\n case android.R.id.home:\r\n /*Intent i= new Intent(getApplication(), MainActivity.class);\r\n i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);\r\n startActivity(i);*/\r\n onBackPressed();\r\n finish();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case android.R.id.home:\n this.finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n NavUtils.navigateUpFromSameTask(getActivity());\n return true;\n case R.id.action_settings:\n Intent i = new Intent(getActivity(), SettingsActivity.class);\n startActivity(i);\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Pass the event to ActionBarDrawerToggle, if it returns\n // true, then it has handled the app icon touch event\n if (mDrawerToggle.onOptionsItemSelected(item)) {\n return true;\n }\n\n // Handle your other action bar items...\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n //Fixes the Up Button\n if(id == android.R.id.home) {\n BuildRoute.this.finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()){\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return true;\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n if (id == android.R.id.home) {\n NavUtils.navigateUpFromSameTask(this);\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\r\n case android.R.id.home:\r\n onBackPressed();\r\n break;\r\n }\r\n return true;\r\n }",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tif (item.getItemId() == android.R.id.home) {\n\t\t\tfinish();\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n onBackPressed();\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n if ( id == android.R.id.home ) {\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.home) {\r\n NavUtils.navigateUpFromSameTask(this);\r\n return true;\r\n }\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.action_about) {\r\n AboutDialog();\r\n return true;\r\n }\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.action_exit) {\r\n finish();\r\n return true;\r\n }\r\n\r\n\r\n return super.onOptionsItemSelected(item);\r\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n//noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n// finish the activity\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item)\n {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if( id == android.R.id.home ) // Back button of the actionbar\n {\n finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\r\n\t\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\t\tswitch (item.getItemId()) {\r\n\t\t\tcase android.R.id.home:\r\n\t\t\t\tfinish();\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 super.onOptionsItemSelected(item);\r\n\t\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n\n this.finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if (item.getItemId() == android.R.id.home) {\n onBackPressed();\n return true;\n }\n return false;\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n if(id == android.R.id.home){\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n if (item.getItemId() == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\r\n\t\tcase android.R.id.home:\r\n\t\t\tsetResult(RESULT_OK, getIntent());\r\n\t\t\tfinish();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n finish();\n return true;\n default:\n // If we got here, the user's action was not recognized.\n // Invoke the superclass to handle it.\n return super.onOptionsItemSelected(item);\n\n }\n }",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\tbreak;\n\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n\n case android.R.id.home:\n this.finish();\n return true;\n }\n return true;\n }",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tint id = item.getItemId();\n\t\tif (id == android.R.id.home) {\n\t\t\tfinish();\n\t\t\treturn true;\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n if (id == android.R.id.home) {\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n //NavUtils.navigateUpFromSameTask(this);\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // todo: goto back activity from here\n finish();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n // Handle item selection\r\n switch (item.getItemId()) {\r\n case android.R.id.home:\r\n onBackPressed();\r\n return true;\r\n\r\n case me.cchiang.lookforthings.R.id.action_sample:\r\n// Snackbar.make(parent_view, item.getTitle() + \" Clicked \", Snackbar.LENGTH_SHORT).show();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n\n\n }",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tonBackPressed();\n\t\t\treturn true;\n\t\tcase R.id.scan_menu:\n\t\t\tonScan();\n\t\t\tbreak;\n\t\tcase R.id.opt_about:\n\t\t\t//onAbout();\n\t\t\tbreak;\n\t\tcase R.id.opt_exit:\n\t\t\tfinish();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t\treturn true;\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n super.onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n this.finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\n public boolean onOptionsItemSelected(@NonNull MenuItem item) {\n if (item.getItemId() == android.R.id.home) {\n onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n\n case android.R.id.home:\n finish();\n return true;\n\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\r\n\t switch (item.getItemId()) {\r\n\t \t// back to previous page\r\n\t case android.R.id.home:\r\n\t finish();\r\n\t return true;\r\n\t }\r\n\t return super.onOptionsItemSelected(item);\r\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if(id==android.R.id.home){\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == android.R.id.home) {\r\n // finish the activity\r\n onBackPressed();\r\n return true;\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == android.R.id.home) {\r\n // finish the activity\r\n onBackPressed();\r\n return true;\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId())\n {\n case android.R.id.home:\n this.finish();\n return (true);\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case R.id.home:{\n NavUtils.navigateUpFromSameTask(this);\n return true;\n }\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n switch(item.getItemId())\n {\n case android.R.id.home:\n super.onBackPressed();\n break;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\treturn true;\n\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t}",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n\r\n int id = item.getItemId();\r\n if(id==android.R.id.home){\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }"
] | [
"0.7904066",
"0.7804976",
"0.7766218",
"0.7726716",
"0.7631313",
"0.76221544",
"0.7584775",
"0.7530617",
"0.74878734",
"0.7457033",
"0.7457033",
"0.74380976",
"0.7421477",
"0.7402898",
"0.7391322",
"0.7386477",
"0.73788774",
"0.7370012",
"0.7362617",
"0.73555875",
"0.73451835",
"0.73418057",
"0.73298967",
"0.73283297",
"0.7325109",
"0.7318501",
"0.73162323",
"0.7313179",
"0.7303658",
"0.7303658",
"0.7301155",
"0.7297718",
"0.7292956",
"0.7286341",
"0.72828627",
"0.72805357",
"0.7278157",
"0.72596914",
"0.72593665",
"0.72593665",
"0.72593665",
"0.7259005",
"0.724937",
"0.72248167",
"0.7219095",
"0.7217289",
"0.72042423",
"0.7200424",
"0.72000813",
"0.71935385",
"0.71848804",
"0.7178161",
"0.71682125",
"0.71670973",
"0.7153767",
"0.71535325",
"0.7136499",
"0.71345866",
"0.71345866",
"0.7129392",
"0.7128763",
"0.71239245",
"0.7122973",
"0.7122687",
"0.7122104",
"0.71169454",
"0.7116821",
"0.71165425",
"0.71165425",
"0.71165425",
"0.71165425",
"0.71160954",
"0.711461",
"0.711215",
"0.71094537",
"0.71084976",
"0.7105594",
"0.70996004",
"0.7098039",
"0.7095679",
"0.70935696",
"0.70935696",
"0.70862824",
"0.70829386",
"0.70803833",
"0.70799434",
"0.7073132",
"0.70682305",
"0.7061713",
"0.7060338",
"0.7060053",
"0.70512676",
"0.7037155",
"0.7037155",
"0.7035636",
"0.70352966",
"0.70352966",
"0.70329386",
"0.70302224",
"0.7029258",
"0.70191014"
] | 0.0 | -1 |
getItem is called to instantiate the fragment for the given page. Return a PlaceholderFragment (defined as a static inner class below). | @Override
public Fragment getItem(int position) {
switch(position){
case 0:
return ShoppingListSettings.newInstance(position + 1);
default:
return ShoppingListView.newInstance(position + 1);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public Fragment getItem(int position) {\n return PlaceholderFragment.newInstance(position);\n }",
"@Override\n public Fragment getItem(int position) {\n return WebPageFragment.newInstance(position);\n }",
"@NonNull\n\t\t@Override\n\t\tpublic androidx.fragment.app.Fragment getItem(int position) {\n\t\t\treturn PlaceholderFragment.newInstance(position + 1);\n\t\t}",
"@Override\n\t\tpublic Fragment getItem(int position) {\n\t\t\tFragment fragment;\n\t\t\tif (fragments.isEmpty() || fragments.size() <= position) {\n\t\t\t\tfragment = new PlaceholderFragment(position);\n\t\t\t\tBundle args = new Bundle();\n\t\t\t\targs.putInt(PlaceholderFragment.ARG_SECTION_NUMBER, position);\n\t\t\t\tfragment.setArguments(args);\n\n\t\t\t\tfragments.add(position, fragment);\n\t\t\t} else {\n\t\t\t\tfragment = fragments.get(position);\n\t\t\t}\n\n\t\t\treturn fragment;\n\t\t}",
"@Override\n public Fragment getItem(int position) {\n return PlaceholderFragment.newInstance(position + 1);\n }",
"@Override\n public Fragment getItem(int position) {\n return PlaceholderFragment.newInstance(position + 1);\n }",
"@Override\n public Fragment getItem(int position) {\n return PlaceholderFragment.newInstance(position + 1);\n }",
"@Override\n public Fragment getItem(int position) {\n return PlaceholderFragment.newInstance(position + 1);\n }",
"@Override\n public Fragment getItem(int position) {\n return PlaceholderFragment.newInstance(position + 1);\n }",
"@Override\n public Fragment getItem(int position) {\n return PlaceholderFragment.newInstance(position + 1);\n }",
"@Override\n public Fragment getItem(int position) {\n return PlaceholderFragment.newInstance(position + 1);\n }",
"@Override\n public Fragment getItem(int position) {\n return PlaceholderFragment.newInstance(position + 1);\n }",
"@Override\n public Fragment getItem(int position) {\n return PlaceholderFragment.newInstance(position + 1);\n }",
"@Override\n public Fragment getItem(int position) {\n return PlaceholderFragment.newInstance(position + 1);\n }",
"@Override\n public Fragment getItem(int position) {\n return PlaceholderFragment.newInstance(position + 1);\n }",
"@Override\n public Fragment getItem(int position) {\n return PlaceholderFragment.newInstance(position + 1);\n }",
"@Override\n public Fragment getItem(int position) {\n return PlaceholderFragment.newInstance(position + 1);\n }",
"@Override\n public Fragment getItem(int position) {\n return PlaceholderFragment.newInstance(position + 1);\n }",
"@Override\n public Fragment getItem(int position) {\n return PlaceholderFragment.newInstance(position + 1);\n }",
"@Override\r\n public Fragment getItem(int position) {\n return PlaceholderFragment.newInstance(position + 1);\r\n }",
"@Override\n public Fragment getItem(int position) {\n \t mFragment[position] = PlaceholderFragment.newInstance(position);\n return mFragment[position];\n }",
"@Override\n public Fragment getItem(int position) {\n return PlaceholderFragment.newInstance(position + 1);\n\n }",
"@Override\n public Fragment getItem(int position) {\n return PlaceholderFragment.newInstance(position + 1);\n }",
"@NonNull\n public abstract Fragment getItem(int position);",
"@NonNull\r\n @Override\r\n public Fragment getItem(int position) {\n switch (position) {\r\n case 0:\r\n return new SubmitFragment();\r\n\r\n case 1:\r\n return new SearchFragment();\r\n }\r\n throw new RuntimeException(\"Can not get item.\");\r\n }",
"public static FavViewPagerItemFragment getInstance(String pageTitle){\n\n FavViewPagerItemFragment fragment = new FavViewPagerItemFragment();\n\n Bundle args = new Bundle();\n args.putString(PAGE_TITLE, pageTitle);\n fragment.setArguments(args);\n //System.out.println(\"ViewPagerItemFragment getInstance--------------\" + fragment);\n //System.out.println(\"receive x from activity\" + fragment);\n return fragment;\n }",
"@Override\n public Fragment getItem(int position) {\n switch (position){\n case 0:\n recogidaFragment = RecogidaFragment.newInstance(\"Nombre\", \"Apellidos\");\n return recogidaFragment;\n case 1:\n entregaFragment = EntregaFragment.newInstance(\"Nombre\",\"Apellidos\");\n return entregaFragment;\n }\n return null;\n // Return a PlaceholderFragment (defined as a static inner class below).\n }",
"@Override\n public Fragment getItem(int position) {\n switch (position) {\n case 0:\n return PageFragment.newInstance(0);\n case 1:\n return MentionFragment.newInstance(0);\n\n default:\n return null;\n }\n }",
"public abstract @NonNull\n Fragment getItem(int position);",
"@Override\n public Fragment getItem(int curent_page){\n switch (curent_page){\n case 0:\n WeatherAndForecastFragment fragment1 = new WeatherAndForecastFragment();\n return fragment1;\n case 1:\n WeatherAndForecastFragment fragment2 = new WeatherAndForecastFragment();\n return fragment2;\n case 2:\n WeatherAndForecastFragment fragment3 = new WeatherAndForecastFragment();\n return fragment3;\n\n default:\n return null;\n }\n }",
"@Override\n public Fragment getItem(int position) {\n int imageId = imgs.getResourceId(position, -1);\n return PlaceholderFragment.newInstance(position + 1, premium_title_green[position], premium_title_black[position], premium_messages[position], imageId);\n }",
"@Override\n public Fragment getItem(int position) {\n Fragment fragment = new Fragment();\n switch (position)\n {\n case 0:\n fragment = carCheckBasicInfoFragment;\n break;\n case 1:\n fragment = carCheckFrameFragment;\n break;\n case 2:\n fragment = carCheckIntegratedFragment;\n break;\n }\n return fragment;\n }",
"@Override\n public Fragment getItem(int position) {\n switch (position) {\n case 0:\n return AddPlaceholderFragment.newInstance();\n case 1:\n return mChange;\n case 2:\n return mDelete;\n }\n return null;\n }",
"@Override\n public Fragment getItem(int position) {\n if (position == 0)\n return new RootFragment();\n else\n return new StaticFragment();\n }",
"@Override\n public Fragment getItem(int position) {\n switch (position){\n case 0:\n return new ItemAuctionFragment();\n case 1:\n return new ItemBidsFragment();\n default:\n return null;\n }\n }",
"@Override\n public Fragment getItem(int position) {\n //Fragment frag = new HomeScreenFragment();\n //return frag;\n switch (position)\n {\n case 0:\n return new HomeScreenFragment();\n case 2:\n return new AddRestaurantFragment();\n default:\n return new Fragment();\n }\n }",
"@Override\r\n public Fragment getItem(int position) {\r\n\r\n switch (position) {\r\n case 0:\r\n\r\n hFragment = createClientFragment(\"Homme\");\r\n return hFragment;\r\n\r\n case 1:\r\n\r\n fFragment = createClientFragment(\"Femme\");\r\n return fFragment;\r\n\r\n\r\n case 2:\r\n eFragment = createClientFragment(\"Enfant\");\r\n return eFragment;\r\n default:\r\n return null;\r\n }\r\n }",
"@Override\n public Fragment getItem(int position) {\n // Create a new fragment according to the position of the ViewPager\n if (position == 0) {\n return new BlogFragment();\n } else if (position == 1) {\n return new MapFragment();\n }\n return null;\n }",
"@Override\n public Fragment getItem(int position) {\n switch (position) {\n case 0:\n return DetailsFragment.newInstance(position);\n case 1:\n return MapsFragment.newInstance(position);\n }\n return null;\n }",
"@Override\n\t\tpublic Fragment getItem(int position) {\n\t\t\tswitch (position) {\n\t\t\tcase 0 :\n\t\t\t\t// Home fragment\n\t\t\t\treturn new HomeFragment();\n\t\t\tcase 1 :\n\t\t\t\t// Exercises fragment\n\t\t\t\treturn new ExercisesFragment();\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}",
"@Override\n public Fragment getItem(int position) {\n switch (position) {\n case 0:\n return pageHome;\n case 1:\n return pageJava;\n case 2:\n return pageAndroid;\n default:\n return pageHome;\n }\n }",
"@Override\r\n\t\tpublic Fragment getItem(int position) {\r\n\t\t\tTabInfo info = getTabs().get(position);\r\n\t\t\treturn Fragment.instantiate(getContext(), info.clss.getName(), info.args);\r\n\t\t}",
"@Override\n\tpublic Fragment getItem(int position) {\n\t\tif(this.getRegisteredFragment(position)!=null){\n\t\t\treturn getRegisteredFragment(position);\n\t\t}else{\n\t\t\t//return FavFragment.newInstance();//QiangContentFragment.newInstance(position);\n\t\t\treturn QiangContentFragment.newInstance(position);\n\t\t}\n//\t\treturn MenuContentFragment.newInstance(\"pager\" + position);\n\t}",
"@Override\n public Fragment getItem(int position) {\n MainFragment fragment=new MainFragment();\n fragment.setType(position);\n return fragment;\n }",
"@Override\n\t\tpublic Fragment getItem(int position) {\n\t\t\tFragment fragment;\n\t\t\tswitch (position) {\n\t\t\tcase 0:\n\t\t\t\tfragment = ToDoFragment.newInstance(userId, userName);\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tfragment = ToGoFragment.newInstance();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tfragment = ToDoFragment.newInstance(userId, userName);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn fragment;\n\t\t}",
"@Override\r\n public Fragment getItem(int position) {\r\n try {\r\n switch (position) {\r\n case 0:\r\n return new HomeInfoFragment();\r\n case 1:\r\n return new BlogsFragment();\r\n case 2:\r\n return new HomeFeedsFragment();\r\n case 3:\r\n return new NetworkingOptionFragment();\r\n }\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n return null;\r\n }",
"@Override\n public Fragment getItem(int position) {\n Light light = ambiance.lights.get(position);\n PlaceholderFragment pf = PlaceholderFragment.newInstance(position);\n pf.ambiance = ambiance;\n pf.lights = light;\n return pf;\n }",
"@Override\n public Fragment getItem(int position) {\n\n if (position == 0) {\n return new HotelFragment();\n } else if (position == 1) {\n return new MallFragment();\n } else if (position == 2) {\n return new RestaurentFragment();\n } else {\n return new HistoricalSiteFragment();\n }\n }",
"@Override\n\tpublic Fragment getItem(int position) {\n\t\treturn ContentFragment.newInstance(contents.getChapterFile(position));\n\t}",
"@Override\n public Fragment getItem(int position) {\n switch (position) {\n case 0:\n return MainFragment.newInstance();\n case 1:\n return LoginFragment.newInstance();\n default:\n return null;\n }\n }",
"@Override\n public Object instantiateItem(ViewGroup container, int position) {\n Fragment fragment = (Fragment) super.instantiateItem(container, position);\n registeredFragments.put(position, fragment);\n return fragment;\n }",
"@Override\n public Fragment getItem(int position) {\n switch (position)\n {\n case 0:\n return new Test();\n case 1:\n return new Facility_manager();\n }\n return null;\n }",
"@Override\n public Fragment getItem(int position) {\n if (position == 0) {\n return new FieldSearchFragment();\n } else {\n return new MatchSearchFragment();\n }\n }",
"public FindItemFragment() {\n }",
"@Override\n public Fragment getItem(int position) {\n if(articlesList != null && articlesList.size() > position) {\n return PlaceholderFragment.newInstance(articlesList.get(position),category);\n }\n return PlaceholderFragment.newInstance(null,null);\n }",
"@NonNull\n @Override\n public Fragment getItem(int position) {\n if (position == 0){\n return new AccommodationFragment();\n }else if (position == 1){\n return new FoodFragment();\n }else if(position == 2){\n return new DrinkFragment();\n }else {\n return new FunFragment();\n }\n }",
"@Override\n public Fragment getItem(int position) {\n switch (position) {\n case 0: // Fragment # 0 - This will show FirstFragment\n return Alarm_Fragment_1.newInstance(0, \"Page #1\");\n case 1: // Fragment # 0 - This will show FirstFragment different title\n return Alarm_Fragment_2.newInstance(1, \"Page # 2\");\n case 2: // Fragment # 1 - This will show SecondFragment\n return Alarm_Fragment_3.newInstance(2, \"Page # 3\");\n case 3 : return Alarm_Fragment_4.newInstance(3, \"Page # 4\");\n case 4 : return Alarm_Fragment_5.newInstance(5, \"Page # 5\");\n //return Frag5.newInstance(4, \"Page # 5\");\n case 5 : return Alarm_Fragment_6.newInstance(6, \"Page # 6\");\n default:\n return null;\n }\n }",
"@Override\n\t\tpublic Fragment getItem(int position) {\n\t\t\tswitch (position) {\n\t\t\t\t//case 0:return PlaceholderFragment.newInstance(position + 1);//defaultFragment();\n\t\t\t\tcase MANAGE_RECORDINGS:\n\t\t\t\t\treturn ManageRecordingsFrame.newInstance(position);\n\t\t\t\tcase SEARCH_FOR_STATIONS:\n\t\t\t\t\treturn SearchForStationsFrame.newInstance(position);\n\t\t\t\tcase MANAGE_STATIONS:\n\t\t\t\t\treturn ManageFavoriteStationsFrame.newInstance(position);\n\t\t\t\tcase FAVORITE_STATIONS:\n\t\t\t\tdefault:\n\t\t\t\t\treturn FavoriteStationsFrame.newInstance(0);//\n\t\t\t}\n\t\t}",
"@Override\n public Fragment getItem(int position) {\n\n Fragment fragment = null;\n Bundle bundle = new Bundle();\n bundle.putString(\"e\", \"test\");\n switch (position) {\n case 0:\n fragment = new OriginalFragment();\n // fragment.setArguments(bundle);\n break;\n\n case 1:\n fragment = new DecodedFragment();\n fragment.setArguments(bundle);\n }\n return fragment;\n }",
"@Override\n public Fragment getItem(int position) {\n\n switch (position) {\n case 0:\n\n return MainFragment.newInstance(position + 1);\n\n case 1:\n\n return NewContactFragment.newInstance(\"\", \"\");\n\n case 2:\n\n return CallLogFragment.newInstance(1);\n }\n return null;\n }",
"@NonNull\n @Override\n public Fragment getItem(int position) {\n switch (position) {\n case 0:\n return FragmentA.newInstance(\"This is First Fragment\");\n case 1:\n return FragmentB.newInstance(\"This is second Fragment\");\n case 2:\n return FragmentC.newInstance(\"This is Third Fragment\");\n }\n return FragmentA.newInstance(\"This is Default Fragment\");\n }",
"@Override\n public Object instantiateItem(ViewGroup container, int position) {\n Fragment fragment = (Fragment) super.instantiateItem(container, position);\n registeredFragments.put(position, fragment);\n return fragment;\n }",
"@Override\n public Fragment getItem(int position) {\n\n Fragment fragment = null;\n\n switch (position) {\n case 0:\n fragment = new PublicTabFragment();\n break;\n case 1:\n if (Utilities.isUser()) {\n fragment = new MeTabFragment();\n } else {\n fragment = new PromptLoginFragment();\n }\n break;\n default:\n fragment = new PublicTabFragment();\n break;\n }\n\n return fragment;\n }",
"@Override\n public Fragment getItem(int position) {\n //To do\n //return the corresponded fragment according to position\n //remember that the position can not be out of [0, 2]\n\n switch (position) {\n case 0:\n return CollectionFragment.newInstance(0, \"\");\n case 1:\n return CollectionFragment.newInstance(1, \"\");\n default:\n return null;\n }\n\n //To do closed\n }",
"@Override\n public Fragment getItem(int position) {\n Log.d(\"DEBUG\", \"Position : \" + position);\n //return PlaceholderFragment.newInstance(position + 1);\n\n\n switch (position) {\n case 0:\n return SectionsFragment1.newInstance(position + 1);\n case 1:\n return SectionsFragment2.newInstance(position + 1);\n case 2:\n return SectionsFragment3.newInstance(position + 1);\n }\n\n return null;\n\n }",
"@Override\n public Fragment getItem(int position) {\n switch (position){\n case 0:\n return FirstFragment.newInstance(\"\",\"\");\n case 1:\n return ATMFragment.newInstance(\"\",\"\");\n default:\n return FirstFragment.newInstance(\"\",\"\");\n }\n }",
"@Override\n public Fragment getItem(int position) {\n switch (position) {\n case 0:\n return FirstFragment.newInstance();\n case 1:\n return SecondFragment.newInstance();\n case 2:\n return ThirdFragment.newInstance();\n default:\n return null;\n }\n }",
"@Override\r\n\tpublic Fragment getItem(int position) {\n\t\tswitch(position) {\r\n\t\t\tcase 2:\t\t\r\n\t\t\t\treturn new FriendsFragment();\r\n\t\t\tcase 0: \r\n\t\t\t\treturn new LibraryFragment();\r\n\t\t\tcase 3:\r\n\t\t\t\treturn new InboxFragment();\r\n\t\t\tcase 1:\r\n\t\t\t\treturn new BorrowedFragment();\r\n\t\t}\r\n\t\t\r\n\t\treturn null;\r\n\t}",
"@Override\n public Fragment getItem(int position) {\n switch (position) {\n case 0:\n FirstFragment firstFragment = new FirstFragment();\n return firstFragment;\n case 1:\n SecondFragment secondFragment = new SecondFragment();\n return secondFragment;\n case 2:\n ThirdFragment thirdFragment = new ThirdFragment();\n return thirdFragment;\n default:\n return null;\n }\n }",
"@Override\n public Fragment getItem(int position) {\n switch (position) {\n case 0: // Fragment # 0 - This will show FirstFragment\n return FootprintMineFragment.newInstance();\n case 1: // Fragment # 0 - This will show FirstFragment different title\n return FootprintAllFragment.newInstance();\n default:\n return null;\n }\n }",
"@NonNull\n @Override\n public Fragment getItem(int position) {\n return fragments.get(position);\n }",
"@NonNull\n @Override\n public Fragment getItem(int position) {\n return pagerFragments.get(position);\n }",
"@Override\n\tpublic Fragment getItem(int position) {\n\t\t\n\t\t\n\t\tFragment fragment=new EmojiFragment(this.activity);\n\t\treturn fragment;\n\t\t\n//\t\tFragment fragment = new DummySectionFragment();\n//\t\tBundle args = new Bundle();\n//\t\targs.putInt(DummySectionFragment.ARG_SECTION_NUMBER, position + 1);\n//\t\tfragment.setArguments(args);\n//\t\treturn fragment;\n\t}",
"@Override\n public Fragment getItem(int position) {\n Bundle bundle = new Bundle();\n bundle.putString(\"placeid\",placeid);\n bundle.putString(\"data\",jsonData);\n switch (position){\n case 0:\n InfoFragment fragment = new InfoFragment();\n fragment.setArguments(bundle);\n return fragment;\n case 1:\n PhotosFragment fragment1 = new PhotosFragment();\n fragment1.setArguments(bundle);\n return fragment1;\n case 2:\n MapFragment fragment2 = new MapFragment();\n fragment2.setArguments(bundle);\n return fragment2;\n case 3:\n ReviewFragment fragment3 = new ReviewFragment();\n fragment3.setArguments(bundle);\n return fragment3;\n }\n return null;\n }",
"@Override\n public Fragment getItem(int position) {\n switch (position) {\n case 0:\n return new FastFoodFragmentFaisal();\n case 1:\n return new PorotaFragmentFaisal();\n case 2:\n return new PithaFragmentFaisal();\n case 3:\n return new POMFragmentFaisal();\n default:\n return null;\n }\n }",
"@Override\n public Fragment getItem(int position) {\n if (position == 0){\n return MainFragment.newInstance();\n } else {\n return RepositoryFragment.newInstance();\n }\n }",
"@Override\n public Fragment getItem(int position) {\n switch (position) {\n case 0:\n FragmentAboutUs aboutFragment = new FragmentAboutUs();\n\n return aboutFragment;\n case 1:\n FragmentContactUs contactUsFragment = new FragmentContactUs();\n return contactUsFragment;\n case 2:\n FragmentDonate donateFragment = new FragmentDonate();\n return donateFragment;\n case 3:\n FragmentHelp helpFragment = new FragmentHelp();\n return helpFragment;\n default:\n return null;\n }\n }",
"@Override\n\tpublic Fragment getItem(int position) \n\t{\n if (position == SimpleCarouselTest.FIRST_PAGE)\n \tscale = SimpleCarouselTest.BIG_SCALE;\n else\n \tscale = SimpleCarouselTest.SMALL_SCALE;\n \n position = position % SimpleCarouselTest.PAGES;\n return MyFragment.newInstance(context, position, scale);\n\t}",
"@Override\n public Fragment getItem(int position) {\n switch (position) {\n case 0:\n return new About();\n case 1:\n return new play();\n case 2:\n return new Rules();\n default:\n return new play();\n }\n }",
"@Override\n public Fragment getItem(int position) {\n switch (position) {\n case 0: // Fragment # 0 - This will show FirstFragment\n System.out.println(\"ana fl case 0:\" + song.coverURL);\n return result_fragment.newInstance(song.coverURL, song.title, song.artist, song.album);\n\n case 1: // Fragment # 1 - This will show FirstFragment different title\n return LyricsFragment.newInstance(song.lyrics);\n default:\n return null;\n }\n }",
"@Override\n public Fragment getItem(int arg0) {\n return mFragments.get(arg0);\n }",
"@Override\n public Fragment getItem(int position) {\n\n switch (position) {\n case 0: // Fragment # 0 - This will show WelcomeActivity\n Context context;\n return WelcomeActivity.newInstance(0, R.string.page0);\n case 1: // Fragment # 1 - This will show FirstFragment\n return FirstFragment.newInstance(1, R.string.page1);\n case 2: // Fragment # 2 - This will show SecondFragment\n return SecondFragment.newInstance(2, R.string.page2);\n case 3: // Fragment # 1 - This will show ThirdFragment\n return ThirdFragment.newInstance(3, R.string.page3);\n case 4:// Fragment # 1 - This will show FourthFragment\n return FourthFragment.newInstance(4,R.string.page4);\n default:\n return null;\n }\n }",
"@Override\n public Fragment getItem(int position) {\n switch (position) {\n case 0:\n ToursFragment toursFragment = new ToursFragment();\n return toursFragment;\n case 1:\n MapFragment mapFragment = new MapFragment();\n return mapFragment;\n case 2:\n LandmarkCardsFragment cardsFragment = new LandmarkCardsFragment();\n return cardsFragment;\n default:\n return null;\n }\n }",
"@Override\n\t\tpublic Fragment getItem(int position) {\n\t\t\tFragment fragment = new SectionFragment(); \n\t\t\tBundle args = new Bundle();\n\t\t\targs.putInt(SectionFragment.ARG_SECTION_NUMBER, position + 1);\n\t\t\tfragment.setArguments(args);\n\t\t\t\n\t\t\t\n\t\t\treturn fragment;\n\t\t\t\n\t\t}",
"@Override\n public Fragment getItem(int position) {\n Bundle args = new Bundle();\n AttVFragment fragment = new AttVFragment();\n args.putInt(AttVFragment.ARG_SECTION_NUMBER, position);\n fragment.setArguments(args);\n return fragment;\n }",
"@Override\n public Fragment getItem(int position) {\n if(position==0){\n return new TabItemFragment();\n }else{\n return new AnotherTabItemFragment();\n }\n\n }",
"@Override\n public Fragment getItem(int position) {\n switch (position) {\n case 0:\n uiManageParty tab1 = new uiManageParty();\n return tab1;\n\n case 1:\n uiHostPlayLists tab2 = new uiHostPlayLists();\n return tab2;\n\n case 2:\n uiHostNowPlaying tab3 = new uiHostNowPlaying();\n return tab3;\n\n default:\n return null;\n }\n }",
"@Override\n public android.support.v4.app.Fragment getItem(int position) {\n if (position == 0) {\n return new TouristSpots();\n } else if (position == 1) {\n return new Hotels();\n } else if (position == 2) {\n return new Restaurant();\n } else {\n return new Beaches();\n }\n }",
"@Override\n public Fragment getItem(int position) {\n switch (position) {\n case 0: // Fragment # 0 - This will show FirstFragment\n return DishListFragment.newInstance(0);\n case 1:\n return DishListFragment.newInstance(1);\n case 2:\n return DishListFragment.newInstance(2);\n default:\n return null;\n }\n }",
"@Override\r\n\tpublic Fragment getItem(int arg0) {\n\t\t\r\n\t\tswitch (arg0) {\r\n\t\t\r\n case 0:\r\n \t \r\n \t return new MyTasks();\r\n \t \r\n \t \r\n case 1:\r\n \t \r\n \t return new PlannedActivities();\r\n \t \r\n \t \r\n /* case 2:\r\n \t \r\n \t return new MOPWheatHome();*/\r\n \t \r\n case 2:\r\n \t return new MyRetailers();\r\n \t // return new ExpensesHome();\r\n \r\n case 3:\r\n \t return new FarmerHome();\r\n case 4:\r\n \t return new Stock();\r\n case 5:\r\n \t return new UpcomingDemoHome();\r\n case 6:\r\n \t return new Reports_FA();\r\n /* case 4:\r\n \t \r\n \t return new MOPMustardHome();\r\n \t \r\n case 5:\r\n \t \r\n \t return new RetailerHomeScreen();*/\r\n \t \r\n /*case 6:\r\n \t \r\n \t return new PotashContent();\r\n \t */\r\n\t\t}\r\n\t\t\r\n\t\treturn null;\r\n\t}",
"public static Fragment selectFragment(int itemId) {\n switch (itemId){\n case R.id.menu_home: {\n return new HomeFragment();\n }\n case R.id.menu_search: {\n return new SearchFragment();\n }\n case R.id.menu_profile: {\n return new ProfileFragment();\n }\n default:\n return null;\n }\n }",
"@Override\n public Fragment getItem(int position) {\n switch (position) {\n case 0: // Fragment # 0 - This will show FirstFragment\n return new ListFragment();\n case 1: // Fragment # 0 - This will show FirstFragment different title\n return new GridFragment();\n\n default:\n return null;\n }\n }",
"@Override\n\tpublic Fragment getItem(int position) {\n\t\treturn fragments.get(position);\n\t}",
"@Override\n public Fragment getItem(int position) {\n return fragments.get(position);\n }",
"@Override\n public Fragment getItem(int position) {\n return fragments.get(position);\n }",
"@Override\r\n\t\tpublic Fragment getItem(int arg0) {\n\t\t\treturn (fragments == null || fragments.size() == 0) ? null\r\n\t\t\t\t\t: fragments.get(arg0);\r\n\t\t}",
"@Override\n public Fragment getItem(int position) {\n switch (position){\n case 0:\n FgFollow fgFollow = new FgFollow();\n return fgFollow;\n case 1:\n FgMySimulation fgMySimulation = new FgMySimulation();\n return fgMySimulation;\n default:\n return null;\n }\n }",
"@Override\n public Fragment getItem(int position) {\n Fragment fragment = null;\n switch (position){\n case 0:\n fragment = new FragmentTrailer();\n break;\n case 1:\n fragment = new FragmentReviews();\n break;\n default:\n fragment = null;\n break;\n }\n\n return fragment;\n }",
"@Override\n public Fragment getItem(int position) {\n return ListFragment.newInstance(context.getResources().getString(pageTitles[position]), darkTheme);\n }",
"public ItemFragment() {\n }",
"@Override\n public Fragment getItem(int position) {\n return NewsFragment.newInstance(position, newsModelArrayList.get(position));\n\n }"
] | [
"0.72919405",
"0.71684223",
"0.7127443",
"0.70753",
"0.7005576",
"0.7005576",
"0.7005576",
"0.7005576",
"0.7005576",
"0.7005576",
"0.7005576",
"0.7005576",
"0.7005576",
"0.7005576",
"0.7005576",
"0.7005576",
"0.7005576",
"0.7005576",
"0.6994497",
"0.6977012",
"0.6955742",
"0.69320095",
"0.6914859",
"0.6794996",
"0.6776744",
"0.6727436",
"0.6712751",
"0.6681511",
"0.6657108",
"0.6613559",
"0.6604032",
"0.65767413",
"0.6553636",
"0.64801115",
"0.6475211",
"0.6450498",
"0.64061654",
"0.63978314",
"0.6368691",
"0.6359723",
"0.63587713",
"0.6355121",
"0.6350108",
"0.6341756",
"0.6334175",
"0.6302196",
"0.6285721",
"0.62838304",
"0.62773514",
"0.6264539",
"0.62512124",
"0.62434685",
"0.62412214",
"0.6236256",
"0.6229988",
"0.62296504",
"0.6219737",
"0.6219583",
"0.6216078",
"0.619658",
"0.61961365",
"0.6194807",
"0.61857605",
"0.61754256",
"0.6171085",
"0.6169131",
"0.6138944",
"0.61385304",
"0.613822",
"0.61380816",
"0.6137722",
"0.61320436",
"0.6130034",
"0.6123893",
"0.61069894",
"0.61062616",
"0.60983455",
"0.6098245",
"0.6090433",
"0.6087301",
"0.60836804",
"0.60691166",
"0.6064317",
"0.60557634",
"0.6052215",
"0.6037165",
"0.60368323",
"0.6036116",
"0.6033474",
"0.602005",
"0.6018123",
"0.60165054",
"0.60101354",
"0.6005554",
"0.6005554",
"0.59842956",
"0.59836906",
"0.59829676",
"0.5982453",
"0.5976347",
"0.597616"
] | 0.0 | -1 |
Show 2 total pages. | @Override
public int getCount() {
return 2;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"int getPagesAmount();",
"long getAmountPage();",
"@Test\n\tpublic void shouldReturnSecondPageSortedByOriginalAmountAsc()\n\t{\n\n\t\tfinal SearchPageData<B2BDocumentModel> result = pagedB2BDocumentDao.getAllPagedDocuments(\n\t\t\t\tcreatePageableData(1, 2, \"byOriginalAmountAsc\"), Collections.singletonList(AccountSummaryAddonUtils\n\t\t\t\t\t\t.createFilterByCriteriaObject(StringUtils.EMPTY, StringUtils.EMPTY)));\n\n\t\tTestCase.assertEquals(2, result.getResults().size());\n\n\t\tTestCase.assertEquals(AMOUNT_75_31, result.getResults().get(0).getAmount().toString());\n\t\tTestCase.assertEquals(AMOUNT_85_20, result.getResults().get(1).getAmount().toString());\n\t}",
"public Integer getPerPage();",
"int getPageSize();",
"int getPageSize();",
"int getPageSize();",
"int getPageSize();",
"@Test\n public void getListingsPages_2() throws IOException {\n List<String> listingsPages = imobiParser.getListingPages(TEST_URL_PAGINATION_2);\n\n Assert.assertThat(listingsPages, notNullValue());\n Assert.assertThat(listingsPages.size(), is(16));\n Assert.assertThat(listingsPages, hasItem(is(TEST_URL_PAGINATION_2.replaceFirst(\"\\\\{pageNumber\\\\}\", String.valueOf(1)))));\n Assert.assertThat(listingsPages, hasItem(is(TEST_URL_PAGINATION_2.replaceFirst(\"\\\\{pageNumber\\\\}\", String.valueOf(5)))));\n Assert.assertThat(listingsPages, hasItem(is(TEST_URL_PAGINATION_2.replaceFirst(\"\\\\{pageNumber\\\\}\", String.valueOf(10)))));\n Assert.assertThat(listingsPages, hasItem(is(TEST_URL_PAGINATION_2.replaceFirst(\"\\\\{pageNumber\\\\}\", String.valueOf(16)))));\n }",
"int getPagesize();",
"int getPage();",
"long getPageSize();",
"long getPageSize();",
"long getPageSize();",
"public int getPages() {\n return pages;\n }",
"@Override\n\t\tpublic int getCount() {\n\t\t\t// Show 3 total pages.\n\t\t\treturn 3;\n\t\t}",
"public int getPages(){\n return pages;\n }",
"@Override\n public int getCount() {\n int TOTAL_PAGES = totalPages;\n return TOTAL_PAGES;\n }",
"public int getPageCount() { return _pages.size(); }",
"@Override\n public int getNumOfPageRows() {\n return 10;\n }",
"public int getRowsPerPage();",
"public int getPages()\n {\n return pages;\n }",
"public Integer getPageCount();",
"@Override\n public int numberOfPages() {\n // TODO Auto-generated method stub\n throw new UnsupportedOperationException(\"Unsupported operation\");\n }",
"public void setPages(int pages) {\n this.pages = pages;\n }",
"int getNumPages();",
"Integer getPage();",
"private void updateTotalPageNumbers() {\n totalPageNumbers = rows.size() / NUM_ROWS_PER_PAGE;\n }",
"@Override\n\tpublic Page showChargeCarByPage() {\n\t\tList<CarInfoDto> carInfolist = chargeCarMapper.selectCarInfoByPage();\n//\t\tint count = chargeCarMapper.selectCarInfoCount();\n\t\t\n\t\tString count = chargeCarMapper.selectCarInfoCount();\n\t\t//要有一个查询总数的sql\n\t\tSystem.out.println(\"----count----\"+count);\n\t\tPage page = new Page(Integer.parseInt(count), 10,\n\t\t\t\t1);\n\t\tpage.setList(carInfolist);\n\t\tSystem.out.println(carInfolist);\n\t\treturn page;\n\t}",
"private void show(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tInteger page = request.getParameter(\"page\") == \"\" || request.getParameter(\"page\") == null ? 1\r\n\t\t\t\t: Integer.valueOf(request.getParameter(\"page\"));\r\n\t\tint count = service.selectCount();\r\n\t\trequest.setAttribute(\"page\", page);\r\n\t\trequest.setAttribute(\"count\", count);\r\n\t\tList<Notice> list = service.selectAll((page - 1) * 5, 5);\r\n\t\trequest.setAttribute(\"list\", list);\r\n\r\n\t\trequest.getRequestDispatcher(\"/WEB-INF/jsp/GongGaoGuanLi.jsp\").forward(request, response);\r\n\t}",
"public Integer getCurrentPageSize();",
"Pages getPages();",
"public int getPages() {\n return pages;\n }",
"public int getPages() {\n return pages;\n }",
"public void setPages(int pages) {\n this.pages = pages;\n }",
"boolean hasPagesize();",
"private int getResultsPerPage()\n {\n final int RESULTS_0 = 16;\n final int RESULTS_1 = 32;\n final int RESULTS_2 = 46;\n \n int index = filterNumResults.getSelectedIndex();\n switch(index)\n {\n case 0: return RESULTS_0;\n case 1: return RESULTS_1;\n case 2: return RESULTS_2;\n default: return 0;\n }\n }",
"default Integer getPageSize() {\n return 10;\n }",
"int getPageNumber();",
"@Override\n public int getCount() {\n return PAGE_COUNT;\n }",
"public abstract void onLoadMore(int page, int totalItemsCount);",
"public abstract void onLoadMore(int page, int totalItemsCount);",
"@Test\r\n\tpublic void test_getAllEmployeesPage2() {\r\n\t\tgiven()\r\n\t\t\t\t.contentType(ContentType.JSON)//\r\n\t\t\t\t.queryParam(\"page\", \"2\")//\r\n\t\t\t\t.when()//\r\n\t\t\t\t.get(\"/api/v1/employees\")//\r\n\t\t\t\t.then()//\r\n\t\t\t\t.log()//\r\n\t\t\t\t.body()//\r\n\t\t\t\t.statusCode(200)//\r\n\t\t\t\t.body(\"number\", equalTo(2))//\r\n\t\t\t\t.body(\"content.size()\", equalTo(10));\r\n\r\n\t}",
"@Override\n public int getCount() {\n return PAGE_COUNT;\n }",
"@Override\r\n\tpublic int nombrePage() {\n\t\treturn 0;\r\n\t}",
"public int getTotalPages() {\r\n return totalPages;\r\n }",
"boolean hasPagination();",
"boolean hasPagination();",
"boolean hasPagination();",
"boolean hasPagination();",
"boolean hasPagination();",
"boolean hasPagination();",
"public int getTotalPages()\r\n {\r\n return pageNames.size()-1;\r\n }",
"private void pagination()\n {\n if (value==0)\n {\n aBoolean=true;\n setAdapter(postModels);\n value=1;\n count=count+10;\n }\n else if (value==1)\n {\n if (count<page_count)\n {\n aBoolean=true;\n count=count+10;\n temp_list.addAll(postModels);\n adapter.notifyDataSetChanged();\n }\n }\n }",
"@Override\n public void onPageChanged(int page, int pageCount) {\n }",
"@Test\n public void getListingsPages_1() throws IOException {\n List<String> listingsPages = imobiParser.getListingPages(TEST_URL_PAGINATION_1);\n\n Assert.assertThat(listingsPages, notNullValue());\n Assert.assertThat(listingsPages.size(), is(10));\n Assert.assertThat(listingsPages, hasItem(is(TEST_URL_PAGINATION_1.replaceFirst(\"\\\\{pageNumber\\\\}\", String.valueOf(1)))));\n Assert.assertThat(listingsPages, hasItem(is(TEST_URL_PAGINATION_1.replaceFirst(\"\\\\{pageNumber\\\\}\", String.valueOf(5)))));\n Assert.assertThat(listingsPages, hasItem(is(TEST_URL_PAGINATION_1.replaceFirst(\"\\\\{pageNumber\\\\}\", String.valueOf(10)))));\n }",
"public static void take() {\r\n\t\t\r\n\t\tif (ths.page == 4) {\r\n\t\t\tths.page++;\r\n\t\t}\r\n\t}",
"@Override\n public int doStartTag() throws JspException {\n\n int pageCount = (this.recordCount + this.pageSize - 1) / this.pageSize;\n StringBuilder sb = new StringBuilder();\n\n if (this.recordCount != 0 && this.recordCount > this.pageSize) {\n sb.append(\"<ol class=\\\"paginator\\\">\");\n if (this.pageNo > pageCount) {\n this.pageNo = pageCount;\n }\n if (this.pageNo < 1) {\n this.pageNo = 1;\n }\n HttpServletRequest request = (HttpServletRequest) this.pageContext.getRequest();\n\n url = request.getAttribute(\"originalUrl\").toString();\n url += \"?\";\n if (StringUtil.isNotEmpty(request.getQueryString())) {\n String queryString = request.getQueryString();\n url += queryString.replaceAll(\"page=[0-9]*\", \"\");\n if (!url.endsWith(\"&\") && !url.endsWith(\"?\")) {\n url += \"&\";\n }\n }\n\n if (this.pageNo > 1) {\n sb.append(\"<li class=\\\"paginator__item paginator__item--prev\\\"><a class=\\\"paginator__item__text\\\" href='\" + this.url + \"page=\" + (this.pageNo - 1) + \"'><span class=\\\"paginator__item__text__icon\\\"></span></a></li>\");\n }\n int start = 1;\n if (this.pageNo > 4) {\n start = this.pageNo - 1;\n sb.append(\"<li class=\\\"paginator__item paginator__item--number\\\"><a class=\\\"paginator__item__text\\\" href='\" + this.url + \"page=1'>1</a></li>\");\n sb.append(\"<li class=\\\"paginator__item paginator__item--number\\\"><a class=\\\"paginator__item__text\\\" href='\" + this.url + \"page=2'>2</a></li>\");\n sb.append(\"<li class=\\\"paginator__item paginator__item--ellipsis\\\"><span class=\\\"paginator__item__text\\\"><span class=\\\"paginator__item__text__icon\\\"></span></span></li>\");\n }\n int end = this.pageNo + 1;\n if (end > pageCount) {\n end = pageCount;\n }\n for (int i = start; i <= end; i++) {\n if (this.pageNo == i) {\n sb.append(\"<li class=\\\"paginator__item paginator__item--number paginator__item--current\\\"><span class=\\\"paginator__item__text\\\">\" + i + \"</span></li>\");\n } else {\n sb.append(\"<li class=\\\"paginator__item paginator__item--number\\\"><a class=\\\"paginator__item__text\\\" href='\" + this.url + \"page=\" + i + \"'>\").append(i).append(\"</a></li>\");\n }\n }\n if (end < pageCount - 2) {\n sb.append(\"<li class=\\\"paginator__item paginator__item--ellipsis\\\"><span class=\\\"paginator__item__text\\\"><span class=\\\"paginator__item__text__icon\\\"></span></span></li>\");\n }\n if (end < pageCount - 1) {\n sb.append(\"<li class=\\\"paginator__item paginator__item--number\\\"><a class=\\\"paginator__item__text\\\" href='\" + this.url + \"page=\" + (pageCount - 1) + \"'>\").append((pageCount - 1) + \"</a></li>\");\n }\n if (end < pageCount) {\n sb.append(\"<li class=\\\"paginator__item paginator__item--number\\\"><a class=\\\"paginator__item__text\\\" href='\" + this.url + \"page=\" + pageCount + \"'>\").append(pageCount + \"</a></li>\");\n }\n if (this.pageNo != pageCount) {\n sb.append(\"<li class=\\\"paginator__item paginator__item--next\\\"><a class=\\\"paginator__item__text\\\" href='\" + this.url + \"page=\" + (this.pageNo + 1) + \"'><span class=\\\"paginator__item__text__icon\\\"></span></a></li>\");\n }\n }\n if (anchor != null) {\n sb.append(\"<script type='text/javascript'>$('.paginator a').each(function(){var href=$(this).attr('href');$(this).attr('href',href+'\" + anchor + \"')});</script>\");\n }\n sb.append(\"</ol>\");\n try {\n this.pageContext.getOut().println(sb.toString());\n } catch (IOException e) {\n // TODO Auto-generated catch block\n\n e.printStackTrace();\n }\n return 0;\n }",
"@Override\r\n\tpublic int getPaging() {\n\t\treturn 0;\r\n\t}",
"public void setPage(int value) {\n this.page = value;\n }",
"protected int getTotalPages(FacesContext context) {\n String forValue = (String) getAttributes().get(\"for\");\n UIData uiData = (UIData) getForm(context).findComponent(forValue);\n if (uiData == null) {\n return 0;\n }\n int rowsPerPage = uiData.getRows(); \n int totalRows = uiData.getRowCount();\n int result = totalRows / rowsPerPage;\n if (0 != (totalRows % rowsPerPage)) {\n result++;\n }\n return result;\n }",
"public void page()\n {\n com.jayway.restassured.response.Response response= given().relaxedHTTPSValidation().when().get(\"http://18.222.188.206:3333/accounts?_page=3\");\n response.then().assertThat().statusCode(200);\n System.out.println(\"The list of accounts in the page 3 is displayed below:\");\n response.prettyPrint();\n }",
"@Test\n public void pageSizeTest() {\n // TODO: test pageSize\n }",
"public static int getTotalPage() {\n List<WebElement> PAGINATION = findElements(pagination);\n int size = PAGINATION.size() - 1;\n //Get the number of the second-last item which next to the \">\" icon\n WebElement lastPage = findElement(By.xpath(String.format(last_page, size)));\n return Integer.parseInt(lastPage.getText());\n }",
"public String getTotalPage() {\r\n return totalPage;\r\n }",
"@Test\n public void getListingsPages_3() throws IOException {\n List<String> listingsPages = imobiParser.getListingPages(TEST_URL_PAGINATION_ABSENT);\n\n Assert.assertThat(listingsPages, notNullValue());\n Assert.assertThat(listingsPages.size(), is(1));\n Assert.assertThat(listingsPages, hasItem(is(TEST_URL_PAGINATION_ABSENT.replaceFirst(\"\\\\{pageNumber\\\\}\", String.valueOf(1)))));\n }",
"public int getPageTotalNumber(int totalNumber) {\n/* 70 */ int fullPage = totalNumber / 25;\n/* 71 */ return (totalNumber % 25 > 0) ? (fullPage + 1) : ((fullPage == 0) ? 1 : fullPage);\n/* */ }",
"PageInfo list(Date beginDate, Date endDate, List<Integer> resources, int pageNo, int pageSize);",
"private void nextButtonActionPerformed(ActionEvent e) {\n // TODO add your code here\n int remainItem = this.list.size() - 6 * (this.page + 1);\n\n if(remainItem <= 0){\n Warning.run(\"No more page here.\");\n }\n else{\n this.page++;\n this.update();\n }\n }",
"private void nextPage()\n {\n if(currentPage + 1 <= maxPage)\n {\n prevPageButton.setEnabled(true);\n if(currentPage + 2 > maxPage)\n nextPageButton.setEnabled(false);\n \n paginate(++currentPage, getResultsPerPage());\n updatePageLabel(currentPage, maxPage);\n }\n }",
"public void setPageInfo(){\n\t\tif(AllP>=1){\n\t\t\tPageInfo=\"<table border='0' cellpadding='3'><tr><td>\";\n\t\t\tPageInfo+=\"Show: \"+PerR+\"/\"+AllR+\" Records! \";\n\t\t\tPageInfo+=\"Current page: \"+CurrentP+\"/\"+AllP;\n\t\t\tPageInfo+=\"</td></tr></table>\";\t\t\t\n\t\t}\t\t\t\t\n\t}",
"private void paginate() {\n List<ItemModel> old = adapter.getItems();\n List<ItemModel> New = new ArrayList<>(addList());\n CardStackCallback callback = new CardStackCallback(old, New);\n DiffUtil.DiffResult result = DiffUtil.calculateDiff(callback);\n adapter.setItems(New);\n result.dispatchUpdatesTo(adapter);\n }",
"void showPage1(){\n displayPage();\n up.setVisible(false);\n if(page != maxPage){\n down.setVisible(true);\n }\n back.setVisible(true);\n next.setVisible(true);\n go.setVisible(true);\n txtPage.setVisible(true);\n for(int i = 0; i < lbl.size() && i < max;i++){\n lbl.get(i).setVisible(true);\n select.get(i).setVisible(true);\n deselect.get(i).setVisible(true);\n if(chars.contains(i)){\n select.get(i).setEnabled(false);\n deselect.get(i).setEnabled(true);\n }else{\n select.get(i).setEnabled(true);\n deselect.get(i).setEnabled(false);\n }\n }\n }",
"private int getPageEnd() {\n if(itemrow==0)\n return 1;\n if(itemrow%displaylimit!=0)\n return itemrow / displaylimit + 1;\n else\n return itemrow / displaylimit;\n }",
"public static String paginate(HttpServletRequest request, HttpServletResponse response) {\n List page = FastList.newInstance();\n Paginator paginator = PaginatorFactory.getPaginator(request);\n String action = UtilCommon.getParameter(request, \"action\");\n String pageNumberString = UtilCommon.getParameter(request, \"pageNumber\");\n \n if (paginator != null) {\n try {\n if (pageNumberString != null) {\n try {\n long pageNumber = Long.parseLong(pageNumberString);\n page = paginator.getPageNumber(pageNumber);\n }\n catch (NumberFormatException e) {\n Debug.logWarning(\"Failed to get page numer [\" + pageNumberString + \"] to to format error: \" + e.getMessage(), module);\n page = paginator.getCurrentPage();\n }\n }\n else if (action == null || \"getCurrentPage\".equals(action)) {\n page = paginator.getCurrentPage();\n }\n else if (\"getNextPage\".equals(action)) {\n page = paginator.getNextPage();\n }\n else if (\"getPreviousPage\".equals(action)) {\n page = paginator.getPreviousPage();\n }\n else if (\"getFirstPage\".equals(action)) {\n page = paginator.getFirstPage();\n }\n else if (\"getLastPage\".equals(action)) {\n page = paginator.getLastPage();\n }\n else {\n Debug.logWarning(\"Paginate action [\" + action + \"] not supported.\", module);\n page = paginator.getCurrentPage();\n }\n }\n catch (ListBuilderException e) {\n return doListBuilderExceptionResponse(request, response, paginator, e);\n }\n }\n return doPaginationResponse(request, response, paginator, page);\n }",
"@RequestMapping(value=\"/main1\") \n public String main(Model model,Integer start){\n int count=allpageService.getCount();\n System.out.println(count);\n //List<page> pages1=allpageService.getOne((start-1)*8, 8);//start是页数\n model.addAttribute(\"count\",count);//总数\n //model.addAttribute(\"pages\",pages);\n // model.addAttribute(\"pages1\",pages1);//一页\n return \"main\"; \n }",
"private int retornaPerPageEsperado(int page) {\n return given().\n param(\"page\",page).\n when().\n get(LISTA_USUARIOS_ENDPOINT).\n then().\n // faz de novo a requisicao pra checar se realmente bateu no endpoint\n statusCode(HttpStatus.SC_OK).\n // extrai o valor do campo per_page e atribui a variavel\n extract().\n path(\"per_page\");\n }",
"public static void main(String[] args) throws Exception {\n PdfDocument doc = new PdfDocument();\r\n //Set margin\r\n PdfUnitConvertor unitCvtr = new PdfUnitConvertor();\r\n PdfMargins margin = new PdfMargins();\r\n margin.setTop(unitCvtr.convertUnits(2.54f, PdfGraphicsUnit.Centimeter, PdfGraphicsUnit.Point));\r\n margin.setBottom(margin.getTop());\r\n margin.setLeft(unitCvtr.convertUnits(3.17f, PdfGraphicsUnit.Centimeter, PdfGraphicsUnit.Point));\r\n margin.setRight(margin.getLeft());\r\n\r\n drawCover(doc.getSections().add(), margin);\r\n drawContent(doc.getSections().add(), margin);\r\n drawPageNumber(doc.getSections().get(1), margin, 1, doc.getSections().get(1).getCount());\r\n\r\n //Save pdf file.\r\n doc.saveToFile(\"output/pagination.pdf\");\r\n doc.close();\r\n }",
"public int getNumberOfPages(HttpServletRequest request,\n SubmissionInfo subInfo) throws ServletException\n {\n // always just one page of initial questions\n return 1;\n }",
"public static void printAll() {\n\t\tint i=0;\n\t\twhile(i%2==0) {\n\t\t\ti+=2;\n\t\t\tSystem.out.print(i+\" \");\n\t\t\tif(i==100) break;\n\t\t}\n\t}",
"private void updatePageLabel(int current, int max)\n {\n String info = MessageFormat.format(\"Page {0}/{1}\", current, max);\n pageInfoLabel.setText(info);\n }",
"public void checkCountforButtonNextandPrevious() {\n Cursor coo = SQLAbsensi.fetchDatabaseAll();\n\n //Page Next\n if (firstDigit != 0) {\n pageCountStartAt = firstDigit * 10;\n int save = coo.getCount() / 10;\n if (save < firstDigit) {\n pageCountEndAt = (firstDigit + 1) * 10;\n } else {\n pageCountEndAt = firstDigit * 10 + (coo.getCount() % 10);\n myButton = (Button) findViewById(R.id.nextpagebutton);\n myButton.setVisibility(View.INVISIBLE);\n }\n } else {\n pageCountStartAt = 0;\n if (coo.getCount() > 10) {\n pageCountEndAt = 10;\n myButton = (Button) findViewById(R.id.nextpagebutton);\n myButton.setVisibility(View.VISIBLE);\n } else {\n pageCountEndAt = coo.getCount();\n }\n }\n\n //Page Previous\n if (firstDigit > 0) {\n myButton = (Button) findViewById(R.id.previouspagebutton);\n myButton.setVisibility(View.VISIBLE);\n } else {\n myButton = (Button) findViewById(R.id.previouspagebutton);\n myButton.setVisibility(View.INVISIBLE);\n }\n Refresh();\n\n }",
"@Override\n public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {\n System.out.println(\"load more\" + totalItemsCount);\n loadMore(totalItemsCount);\n }",
"private void setShowPageSizeEntries(BoundwithForm boundwithForm) {\n List<Integer> pageSizes = documentSearchConfig.getPageSizes();\n if (org.apache.commons.collections.CollectionUtils.isEmpty(pageSizes)) {\n pageSizes.add(10);\n pageSizes.add(25);\n pageSizes.add(50);\n pageSizes.add(100);\n }\n boundwithForm.setShowPageSize(pageSizes.toString());\n }",
"void nextPage() throws IndexOutOfBoundsException;",
"PagingLink(int pageNumber) {\n setText(String.valueOf(pageNumber));\n }",
"boolean hasPageNo();",
"boolean hasPageNo();",
"@ImageOptions(flipRtl = true)\r\n\t\tImageResource simplePagerNextPage();",
"protected void loadNextPage(){\n\n if(!isShowingSearchedVotes) {\n setLoadingMoreItems(true);\n RikdagskollenApp.getInstance().getRiksdagenAPIManager().getVotes(new VoteCallback() {\n\n @Override\n public void onVotesFetched(List<Vote> votes) {\n setShowLoadingView(false);\n voteList.addAll(votes);\n getAdapter().notifyDataSetChanged();\n setLoadingMoreItems(false);\n }\n\n @Override\n public void onFail(VolleyError error) {\n setLoadingMoreItems(false);\n decrementPage();\n }\n }, getPageToLoad());\n\n incrementPage();\n }\n }",
"@Override\n\t\tpublic void onLoadMore() {\n\t\t\tpageIndex++;\n\t\t\tloadInfo(pageIndex, 1);\n\t\t\tif (DzqcStu.isDebug) {\n\t\t\t\tLog.i(\"pageIndex------\", pageIndex+\"\");\n\t\t\t}\n\t\t}",
"public void addPages() {\t\t\n\t\tpage1 = new Opera2ActionsTransformationWizardPage1(selection, operaModel);\n\t\taddPage(page1);\t\n\t}",
"@Override\n\t\tpublic void onLoadMore(int page, int totalItemsCount) {\n\t\t\tpresenter.loadRecordsPage(page);\n\t\t}",
"@Test\n\tpublic void testGetAllElementsUsingPaginationOfSecondPage() throws Exception {\n\t\tint size = 100;\n\t\tIntStream.range(1, size + 1).mapToObj(i -> \"element\" + i).map(ElementEntity::new)\n\t\t\t\t.forEach(this.elementDao::create);\n\n\t\t// WHEN I get elements of the page 1 and size 90\n\t\tElementBoundary[] result = this.restTemplate.getForObject(this.baseUrl + \"?page={page}&size={size}\",\n\t\t\t\tElementBoundary[].class, this.userEntity.getUserSmartspace(),\n\t\t\t\tthis.userEntity.getUserEmail(), 1, 90);\n\n\t\t// THEN I receive 10 elements\n\t\tassertThat(result).hasSize(10);\n\t\t\n\t\t\n\t}",
"public static void look() {\r\n\t\t\r\n\t\tif (ths.page == 2) {\r\n\t\t\tths.page++;\r\n\t\t}\r\n\t}",
"public int getGatheredPages() {\r\n return gatheredPages;\r\n }",
"@Override\n\tpublic void loadNextPage() {\n\t\tif(curr_content.isLastPage){\n\t\t\tPigAndroidUtil.showToast(mContext, \"以是最后一页:\", 3000);\n\t\t}else{\n\t\t\texchangeNext(m_bookFactory.getNextPageContent(next_content));\n\t\t}\n\t}",
"LiveData<PagedList<Response>> pagedList();",
"private int countPaging(final int commonCount, final int offsetLine) {\n\t\tint result = commonCount % offsetLine > 0 ? Math.floorDiv(commonCount, offsetLine) + 1\n\t\t\t\t: Math.floorDiv(commonCount, offsetLine);\n\t\treturn result;\n\t}",
"@Override\n\t\t\tpublic void onPageSelected(int position2) {\n\t\t\t\tnextPosition2 = position2;\n\t\t\t}",
"void showResults() throws IOException{\n\t\tCountService cs = CountService.getInstance();\n\t\t\n\t\tout.write(\"/------------------------Resultado Final------------------------/\" + \"\\n\" );\n\t\tout.write(\"O número total de links pesquisados é:\" + cs.getCount() + \"\\n\");\n\t\tout.write(\"O número de links Quebrados é:\" + cs.getCountQueb() + \"\\n\");\n\t\tout.write(\"O número de links ok é:\" + cs.getCountOk() + \"\\n\");\n\t\tout.write(\"O número de links Proibidos é:\" + cs.getCountProibido()+ \"\\n\");\n\t\tout.write(\"O número de métodos impedidos é:\" + cs.getCountImpedido()+ \"\\n\");\n\t\tout.write(\"O número de redirecionados é:\" + cs.getCountRedirecionado()+ \"\\n\");\n\t\tout.write(\"Erro Server:\" + cs.getCountErroServer()+ \"\\n\");\n\t\tout.write(\"Unknown Host Name:\" + cs.getCountUnknownHost()+ \"\\n\");\n\t\tout.write(\"Bad Gatway:\" + cs.getCount502()+ \"\\n\");\n\t\tout.write(\"O número resposta diferente de 4.. e 200 é:\" + cs.getCountPesq() + \"\\n\");\n\t\tout.write(\"/------------------------------------------------------------------/\" + \"\\n\");\n\t\tString dateTime = new SimpleDateFormat(\"dd/MM/yyyy HH:mm\").format(new Date()); \n\t\tout.write(\"Fim dos testes: \" + dateTime + \"\\n\");\n\t\tSystem.out.println(\"Teste finalizado\");\n\t}"
] | [
"0.66394883",
"0.6310845",
"0.6247585",
"0.61983025",
"0.61640596",
"0.61640596",
"0.61640596",
"0.61640596",
"0.61383164",
"0.6091821",
"0.5991357",
"0.5966327",
"0.5966327",
"0.5966327",
"0.5889809",
"0.58841777",
"0.5883868",
"0.586598",
"0.5829298",
"0.5827352",
"0.57951015",
"0.57908714",
"0.5780314",
"0.577099",
"0.5766914",
"0.5730893",
"0.57247216",
"0.57233757",
"0.5708504",
"0.5704697",
"0.56806695",
"0.5679879",
"0.566676",
"0.566676",
"0.56452703",
"0.5638047",
"0.5630627",
"0.56188864",
"0.56101614",
"0.55798686",
"0.5577108",
"0.5577108",
"0.5564818",
"0.55513513",
"0.55378515",
"0.54934156",
"0.5484387",
"0.5484387",
"0.5484387",
"0.5484387",
"0.5484387",
"0.5484387",
"0.54747206",
"0.5474592",
"0.544965",
"0.54324317",
"0.5422923",
"0.54110724",
"0.5400033",
"0.53992814",
"0.5389569",
"0.53816843",
"0.5378062",
"0.5377893",
"0.5373948",
"0.53616273",
"0.53540957",
"0.5350993",
"0.53432333",
"0.53404325",
"0.53377277",
"0.5333893",
"0.53248626",
"0.5323717",
"0.5319273",
"0.53169906",
"0.53005487",
"0.529459",
"0.5271312",
"0.5268514",
"0.52623874",
"0.5257511",
"0.5250412",
"0.52415",
"0.52366525",
"0.5234549",
"0.5233792",
"0.5233792",
"0.5229702",
"0.52225554",
"0.5217761",
"0.52175826",
"0.5210386",
"0.52045214",
"0.5204441",
"0.5204346",
"0.5204204",
"0.52028424",
"0.5185601",
"0.51826614",
"0.5180661"
] | 0.0 | -1 |
Returns a new instance of this fragment for the given section number. | public static ShoppingListSettings newInstance(int sectionNumber) {
ShoppingListSettings fragment = new ShoppingListSettings();
Bundle args = new Bundle();
args.putInt(ARG_SECTION_NUMBER, sectionNumber);
fragment.setArguments(args);
return fragment;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static MainFragment newInstance(int sectionNumber) {\n MainFragment fragment = new MainFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static CurrentInfoFragment newInstance(int sectionNumber) {\n CurrentInfoFragment fragment = new CurrentInfoFragment();\n Bundle args = new Bundle();\n args.putInt(ZooGate.ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static Fragment newInstance(int sectionNumber) {\n Fragment fragment=null;\n switch (sectionNumber){\n case 1:fragment=new ContactosFragment();\n break;\n case 2:fragment=new SeriesFragment();\n break;\n case 3:fragment=new FavoritosFragment();\n break;\n }\n return fragment;\n }",
"public static LibraryFragment newInstance(int sectionNumber) {\n LibraryFragment fragment = new LibraryFragment();\n Bundle args = new Bundle();\n return fragment;\n }",
"public static ItemFragment newInstance(int section_number){\n ItemFragment fragment = new ItemFragment();\n Bundle args = new Bundle();\n args.putInt(\"SECTION_NUMBER\",section_number);\n fragment.setArguments(args);\n return fragment;\n }",
"public static HistoryFragment newInstance(int sectionNumber) {\n\n //System.out.println(\"INFOs:: new_instance HISTORY...\");\n HistoryFragment fragment = new HistoryFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n\n return fragment;\n }",
"public static MatchmakingFragment newInstance(int sectionNumber) {\n MatchmakingFragment fragment = new MatchmakingFragment();\n fragment.currentMatchCount = 0;\n fragment.getUser_type();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\r\n\r\n PlaceholderFragment fragment = new PlaceholderFragment();\r\n Bundle args = new Bundle();\r\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\r\n fragment.setArguments(args);\r\n return fragment;\r\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\r\n PlaceholderFragment fragment = new PlaceholderFragment();\r\n Bundle args = new Bundle();\r\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\r\n fragment.setArguments(args);\r\n return fragment;\r\n }",
"public static BannerFragment newInstance(int sectionNumber) {\r\n BannerFragment fragment = new BannerFragment();\r\n Bundle args = new Bundle();\r\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\r\n fragment.setArguments(args);\r\n return fragment;\r\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n\t\t\tPlaceholderFragment fragment = new PlaceholderFragment();\n\t\t\tBundle args = new Bundle();\n\t\t\targs.putInt(ARG_SECTION_NUMBER, sectionNumber);\n\t\t\tfragment.setArguments(args);\n\t\t\treturn fragment;\n\t\t}",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n\t\t\tPlaceholderFragment fragment = new PlaceholderFragment();\n\t\t\tBundle args = new Bundle();\n\t\t\targs.putInt(ARG_SECTION_NUMBER, sectionNumber);\n\t\t\tfragment.setArguments(args);\n\t\t\treturn fragment;\n\t\t}",
"public static FragmentNearMe newInstance(int sectionNumber) {\n\t\tFragmentNearMe fragment = new FragmentNearMe();\n\t\tBundle args = new Bundle();\n\t\targs.putInt(ARG_SECTION_NUMBER, sectionNumber);\n\t\tfragment.setArguments(args);\n\t\treturn fragment;\n\t}",
"public static MapFragment newInstance(int sectionNumber) {\n MapFragment fragment = new MapFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\r\n\t\t\tPlaceholderFragment fragment = new PlaceholderFragment();\r\n\t\t\tBundle args = new Bundle();\r\n\t\t\targs.putInt(ARG_SECTION_NUMBER, sectionNumber);\r\n\t\t\tfragment.setArguments(args);\r\n\t\t\treturn fragment;\r\n\t\t}",
"public static PlaceholderFragment newInstance(int sectionNumber) {\r\n\t\t\tPlaceholderFragment fragment = new PlaceholderFragment();\r\n\t\t\tBundle args = new Bundle();\r\n\t\t\targs.putInt(ARG_SECTION_NUMBER, sectionNumber);\r\n\t\t\tfragment.setArguments(args);\r\n\t\t\treturn fragment;\r\n\t\t}",
"public static FriendsFragment newInstance(int sectionNumber) {\n \tFriendsFragment fragment = new FriendsFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static MyAccountFragment newInstance(int sectionNumber) {\n MyAccountFragment fragment = new MyAccountFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static FindItemFragment newInstance(int sectionNumber) {\n FindItemFragment fragment = new FindItemFragment();\n Bundle args = new Bundle();\n /*args.putString(ARG_PARAM1, param1);\n args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);*/\n\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static DishesFragment newInstance(int sectionNumber) {\n DishesFragment fragment = new DishesFragment();\n Bundle args = new Bundle();\n args.putInt(PAGE, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber, MainActivity activity) {\n PlaceholderFragment fragment = new PlaceholderFragment(activity);\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static ArticlesFragment newInstance(int sectionNumber) {\n \tArticlesFragment fragment = new ArticlesFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static NewsfeedFragment newInstance(int sectionNumber) {\n NewsfeedFragment fragment = new NewsfeedFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\r\n PlaceholderFragment fragment = new PlaceholderFragment();\r\n Bundle args = new Bundle();\r\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\r\n args.putString(\"alb_post\",inte.getStringExtra(\"detailJSON\"));\r\n fragment.setArguments(args);\r\n return fragment;\r\n }",
"public static Favourite newInstance(int sectionNumber) {\n Favourite fragment = new Favourite();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static CalendarViewFragment newInstance(int sectionNumber) {\n CalendarViewFragment fragment = new CalendarViewFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment;\n if (sectionNumber == 1) {\n fragment = new WaitListFragment();\n }\n else {\n fragment = new PlaceholderFragment();\n }\n\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static ShoppingListView newInstance(int sectionNumber) {\n ShoppingListView fragment = new ShoppingListView();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static TaskHistoryFragment newInstance(int sectionNumber) {\n TaskHistoryFragment fragment = new TaskHistoryFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static SalaryFragment newInstance(int sectionNumber) {\n SalaryFragment fragment = new SalaryFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(USER_NAME, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static FragmentClientTourPage7 newInstance(int sectionNumber) {\n\t\tFragmentClientTourPage7 fragment = new FragmentClientTourPage7();\n\t\tBundle args = new Bundle();\n\t\targs.putInt(ARG_SECTION_NUMBER, sectionNumber);\n\t\tfragment.setArguments(args);\n\t\treturn fragment;\n\t}",
"public static LoginFragment newInstance(int section_number) {\n LoginFragment fragment = new LoginFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, section_number);\n fragment.setArguments(args);\n return fragment;\n }",
"public static CharacterCreationFragment newInstance(int sectionNumber, Bundle args) {\n CharacterCreationFragment fragment = new CharacterCreationFragment();\n// Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n\t\t// We need to set arguments of this fragment. That's why I've added Bundle object as an\n\t\t// argument.\n fragment.setArguments(args);\n return fragment;\n }",
"public static AuthorizeFragment newInstance(int sectionNumber) {\n\t\tAuthorizeFragment fragment = new AuthorizeFragment();\n\t\tBundle args = new Bundle();\n\t\targs.putInt(ARG_SECTION_NUMBER, sectionNumber);\n\t\tfragment.setArguments(args);\n\t\treturn fragment;\n\n\t}",
"public static EndGameTabFragment newInstance(int sectionNumber) {\n EndGameTabFragment fragment = new EndGameTabFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static ProjectScreen newInstance(int sectionNumber) {\n ProjectScreen fragment = new ProjectScreen();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static BandLocationDistanceFragment newInstance(int sectionNumber) {\n BandLocationDistanceFragment fragment = new BandLocationDistanceFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static HomeFragment newInstance(int sectionNumber, JSONObject userInfoJson) {\n HomeFragment fragment = new HomeFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n fragment.setUserInfoJson(userInfoJson);\n return fragment;\n }",
"public static SubmitPromptFragment newInstance(int sectionNumber) {\n SubmitPromptFragment fragment = new SubmitPromptFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n\n fragment.setArguments(args);\n return fragment;\n }",
"public static ChangesViewFragment newInstance() {\n\t\tChangesViewFragment fragment = new ChangesViewFragment();\n\t\tBundle args = new Bundle();\n\t\targs.putInt(HomeViewActivity.ARG_SECTION_NUMBER, 2);\n\t\tfragment.setArguments(args);\n\t\treturn fragment;\n\t}",
"public static HiPingFragment newInstance(int index) {\n HiPingFragment fragment = new HiPingFragment();\n Bundle bundle = new Bundle();\n bundle.putInt(ARG_SECTION_NUMBER, index);\n fragment.setArguments(bundle);\n return fragment;\n }",
"@Override\n\t\tpublic Fragment getItem(int position) {\n\t\t\tFragment fragment = new SectionFragment(); \n\t\t\tBundle args = new Bundle();\n\t\t\targs.putInt(SectionFragment.ARG_SECTION_NUMBER, position + 1);\n\t\t\tfragment.setArguments(args);\n\t\t\t\n\t\t\t\n\t\t\treturn fragment;\n\t\t\t\n\t\t}",
"public ScanFragment(int sectionNumber) {\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n scanListener = new MyButtonScanListener(this);\n searchListener = new MyButtonSearchListener();\n setArguments(args);\n }",
"public Section newSection() {\n\t\tSection page = new Section();\r\n\t\tpage.setWpPublished(DateUtils.now());\r\n\t\treturn page;\r\n\t}",
"public static EventsOrStatesFragment newInstance(int sectionNumber, boolean showEvents) {\n EventsOrStatesFragment fragment = new EventsOrStatesFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n args.putBoolean(ARG_SHOW_EVENTS, showEvents);\n fragment.setArguments(args);\n return fragment;\n }",
"public SummaryFragment newInstance()\n {\n return new SummaryFragment();\n }",
"void create(Section section);",
"public static PlaceholderFragment newInstance(int sectionNumber, String title_green, String title_black, String message, int imageId) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n args.putString(ARG_SECTION_TITLE_GREEN, title_green);\n args.putString(ARG_SECTION_TITLE_BLACK, title_black);\n args.putString(ARG_SECTION_MESSAGE, message);\n args.putInt(ARG_SECTION_IMAGE, imageId);\n fragment.setArguments(args);\n return fragment;\n }",
"public static Fragment Home_Tab_start(String Id, String section) {\n BodyTab_Sub fragment = new BodyTab_Sub();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, Id);\n args.putString(ARG_PARAM2, section);\n fragment.setArguments(args);\n return fragment;\n }",
"public static FragmentTousWanted newInstance() {\n FragmentTousWanted fragment = new FragmentTousWanted();\n Bundle args = new Bundle();\n fragment.setArguments(args);\n return fragment;\n }",
"Section createSection();",
"public static SummaryFragment newInstance() {\n SummaryFragment fragment = new SummaryFragment();\n return fragment;\n }",
"@Override\n public Fragment getItem(int position) {\n Bundle args = new Bundle();\n AttVFragment fragment = new AttVFragment();\n args.putInt(AttVFragment.ARG_SECTION_NUMBER, position);\n fragment.setArguments(args);\n return fragment;\n }",
"public final SectionsBottomFragment invoke() {\n return new SectionsBottomFragment();\n }",
"public static SelectionFragment newInstance() {\n SelectionFragment fragment = new SelectionFragment();\n return fragment;\n }",
"@Override\n public Fragment getItem(int position) {\n if (position == 0) {\n return new SectionFragment();\n } else if (position == 1) {\n return new SectionFragment();\n }\n else if (position == 2) {\n return new SectionFragment();\n }\n else if (position == 3) {\n return new SectionFragment();\n }\n\n return null;\n }",
"public static PurchaseFragment newInstance(int position) {\n PurchaseFragment f = new PurchaseFragment();\n // Supply index input as an argument.\n Bundle args = new Bundle();\n f.setArguments(args);\n return f;\n }",
"public static CommentFragment newInstance() {\n CommentFragment fragment = new CommentFragment();\n\n return fragment;\n }",
"public static Fragment3 newInstance() {\n Fragment3 fragment = new Fragment3();\n return fragment;\n }",
"public static BitFragment newInstance() {\n BitFragment fragment = new BitFragment();\n return fragment;\n }",
"public static MyCourseFragment newInstance() {\n MyCourseFragment fragment = new MyCourseFragment();\r\n// fragment.setArguments(args);\r\n return fragment;\r\n }",
"public static CategoryFragment newInstance() {\n CategoryFragment categoryFragment = new CategoryFragment();\n return categoryFragment;\n\n }",
"public static NewGameFragment newInstance() {\n return new NewGameFragment();\n }",
"public static DetailsFragment newInstance(@IntRange(from = 1, to = 3) int kittenNumber) {\n Bundle args = new Bundle();\n args.putInt(ARG_KITTEN_NUMBER, kittenNumber);\n\n DetailsFragment fragment = new DetailsFragment();\n fragment.setArguments(args);\n\n return fragment;\n }",
"public static MyFragment getInstance(int position) {\n\n //Construct the fragment\n MyFragment myFragment = new MyFragment();\n\n //New bundle instance\n Bundle args = new Bundle();\n\n //Passing in the Integer position of the fragment into the argument\n args.putInt(\"position\", position);\n\n //Setting the argument of the fragment to be the position\n myFragment.setArguments(args);\n\n //Return the fragment\n return myFragment;\n }",
"public static FootprintFragment newInstance() {\n FootprintFragment fragment = new FootprintFragment();\n\n return fragment;\n }",
"public static AmountFragment newInstance() {\n return new AmountFragment();\n }",
"public static CVFragment newInstance(int i) {\n CVFragment myFragment = new CVFragment();\n\n Bundle args = new Bundle();\n args.putInt(\"pageInt\", i);\n myFragment.setArguments(args);\n\n return myFragment;\n }"
] | [
"0.7838247",
"0.77156085",
"0.7709555",
"0.7696671",
"0.7683662",
"0.7610332",
"0.75958824",
"0.7568688",
"0.7568688",
"0.7568688",
"0.7568688",
"0.7568688",
"0.7568688",
"0.7568688",
"0.7568688",
"0.7568688",
"0.7568688",
"0.7568688",
"0.7568688",
"0.7568688",
"0.7568688",
"0.7568688",
"0.7568688",
"0.7568688",
"0.7568688",
"0.7568688",
"0.7568688",
"0.7568688",
"0.7568688",
"0.7568688",
"0.7568688",
"0.7568688",
"0.7568688",
"0.7568688",
"0.7568688",
"0.7568688",
"0.75668603",
"0.7556759",
"0.75511664",
"0.7513243",
"0.7513243",
"0.749958",
"0.749958",
"0.7497363",
"0.7477808",
"0.74592596",
"0.74592596",
"0.74491405",
"0.7446887",
"0.73993045",
"0.73877466",
"0.73859394",
"0.73772246",
"0.7371424",
"0.7341214",
"0.72738254",
"0.72538507",
"0.71898645",
"0.71760345",
"0.7166882",
"0.7160888",
"0.7080211",
"0.7060987",
"0.70301616",
"0.70085424",
"0.6923502",
"0.68997025",
"0.68961287",
"0.6889023",
"0.6319024",
"0.6299834",
"0.6176146",
"0.61705345",
"0.606207",
"0.6060967",
"0.5983392",
"0.5886941",
"0.58504933",
"0.5823986",
"0.5819948",
"0.5814158",
"0.56869537",
"0.56797755",
"0.56270236",
"0.5596472",
"0.5543555",
"0.5528985",
"0.55271155",
"0.5494502",
"0.54932475",
"0.54930353",
"0.54533505",
"0.5433067",
"0.54276323",
"0.5399235",
"0.53949183",
"0.5391802",
"0.5368518",
"0.5358875",
"0.53553295"
] | 0.693593 | 65 |
Returns a new instance of this fragment for the given section number. | public static ShoppingListView newInstance(int sectionNumber) {
ShoppingListView fragment = new ShoppingListView();
Bundle args = new Bundle();
args.putInt(ARG_SECTION_NUMBER, sectionNumber);
fragment.setArguments(args);
return fragment;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static MainFragment newInstance(int sectionNumber) {\n MainFragment fragment = new MainFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static CurrentInfoFragment newInstance(int sectionNumber) {\n CurrentInfoFragment fragment = new CurrentInfoFragment();\n Bundle args = new Bundle();\n args.putInt(ZooGate.ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static Fragment newInstance(int sectionNumber) {\n Fragment fragment=null;\n switch (sectionNumber){\n case 1:fragment=new ContactosFragment();\n break;\n case 2:fragment=new SeriesFragment();\n break;\n case 3:fragment=new FavoritosFragment();\n break;\n }\n return fragment;\n }",
"public static LibraryFragment newInstance(int sectionNumber) {\n LibraryFragment fragment = new LibraryFragment();\n Bundle args = new Bundle();\n return fragment;\n }",
"public static ItemFragment newInstance(int section_number){\n ItemFragment fragment = new ItemFragment();\n Bundle args = new Bundle();\n args.putInt(\"SECTION_NUMBER\",section_number);\n fragment.setArguments(args);\n return fragment;\n }",
"public static HistoryFragment newInstance(int sectionNumber) {\n\n //System.out.println(\"INFOs:: new_instance HISTORY...\");\n HistoryFragment fragment = new HistoryFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n\n return fragment;\n }",
"public static MatchmakingFragment newInstance(int sectionNumber) {\n MatchmakingFragment fragment = new MatchmakingFragment();\n fragment.currentMatchCount = 0;\n fragment.getUser_type();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\r\n\r\n PlaceholderFragment fragment = new PlaceholderFragment();\r\n Bundle args = new Bundle();\r\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\r\n fragment.setArguments(args);\r\n return fragment;\r\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\r\n PlaceholderFragment fragment = new PlaceholderFragment();\r\n Bundle args = new Bundle();\r\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\r\n fragment.setArguments(args);\r\n return fragment;\r\n }",
"public static BannerFragment newInstance(int sectionNumber) {\r\n BannerFragment fragment = new BannerFragment();\r\n Bundle args = new Bundle();\r\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\r\n fragment.setArguments(args);\r\n return fragment;\r\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n\t\t\tPlaceholderFragment fragment = new PlaceholderFragment();\n\t\t\tBundle args = new Bundle();\n\t\t\targs.putInt(ARG_SECTION_NUMBER, sectionNumber);\n\t\t\tfragment.setArguments(args);\n\t\t\treturn fragment;\n\t\t}",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n\t\t\tPlaceholderFragment fragment = new PlaceholderFragment();\n\t\t\tBundle args = new Bundle();\n\t\t\targs.putInt(ARG_SECTION_NUMBER, sectionNumber);\n\t\t\tfragment.setArguments(args);\n\t\t\treturn fragment;\n\t\t}",
"public static FragmentNearMe newInstance(int sectionNumber) {\n\t\tFragmentNearMe fragment = new FragmentNearMe();\n\t\tBundle args = new Bundle();\n\t\targs.putInt(ARG_SECTION_NUMBER, sectionNumber);\n\t\tfragment.setArguments(args);\n\t\treturn fragment;\n\t}",
"public static MapFragment newInstance(int sectionNumber) {\n MapFragment fragment = new MapFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\r\n\t\t\tPlaceholderFragment fragment = new PlaceholderFragment();\r\n\t\t\tBundle args = new Bundle();\r\n\t\t\targs.putInt(ARG_SECTION_NUMBER, sectionNumber);\r\n\t\t\tfragment.setArguments(args);\r\n\t\t\treturn fragment;\r\n\t\t}",
"public static PlaceholderFragment newInstance(int sectionNumber) {\r\n\t\t\tPlaceholderFragment fragment = new PlaceholderFragment();\r\n\t\t\tBundle args = new Bundle();\r\n\t\t\targs.putInt(ARG_SECTION_NUMBER, sectionNumber);\r\n\t\t\tfragment.setArguments(args);\r\n\t\t\treturn fragment;\r\n\t\t}",
"public static FriendsFragment newInstance(int sectionNumber) {\n \tFriendsFragment fragment = new FriendsFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static MyAccountFragment newInstance(int sectionNumber) {\n MyAccountFragment fragment = new MyAccountFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static FindItemFragment newInstance(int sectionNumber) {\n FindItemFragment fragment = new FindItemFragment();\n Bundle args = new Bundle();\n /*args.putString(ARG_PARAM1, param1);\n args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);*/\n\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static DishesFragment newInstance(int sectionNumber) {\n DishesFragment fragment = new DishesFragment();\n Bundle args = new Bundle();\n args.putInt(PAGE, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber, MainActivity activity) {\n PlaceholderFragment fragment = new PlaceholderFragment(activity);\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static ArticlesFragment newInstance(int sectionNumber) {\n \tArticlesFragment fragment = new ArticlesFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static NewsfeedFragment newInstance(int sectionNumber) {\n NewsfeedFragment fragment = new NewsfeedFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\r\n PlaceholderFragment fragment = new PlaceholderFragment();\r\n Bundle args = new Bundle();\r\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\r\n args.putString(\"alb_post\",inte.getStringExtra(\"detailJSON\"));\r\n fragment.setArguments(args);\r\n return fragment;\r\n }",
"public static Favourite newInstance(int sectionNumber) {\n Favourite fragment = new Favourite();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static CalendarViewFragment newInstance(int sectionNumber) {\n CalendarViewFragment fragment = new CalendarViewFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment;\n if (sectionNumber == 1) {\n fragment = new WaitListFragment();\n }\n else {\n fragment = new PlaceholderFragment();\n }\n\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static TaskHistoryFragment newInstance(int sectionNumber) {\n TaskHistoryFragment fragment = new TaskHistoryFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static SalaryFragment newInstance(int sectionNumber) {\n SalaryFragment fragment = new SalaryFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(USER_NAME, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static FragmentClientTourPage7 newInstance(int sectionNumber) {\n\t\tFragmentClientTourPage7 fragment = new FragmentClientTourPage7();\n\t\tBundle args = new Bundle();\n\t\targs.putInt(ARG_SECTION_NUMBER, sectionNumber);\n\t\tfragment.setArguments(args);\n\t\treturn fragment;\n\t}",
"public static LoginFragment newInstance(int section_number) {\n LoginFragment fragment = new LoginFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, section_number);\n fragment.setArguments(args);\n return fragment;\n }",
"public static CharacterCreationFragment newInstance(int sectionNumber, Bundle args) {\n CharacterCreationFragment fragment = new CharacterCreationFragment();\n// Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n\t\t// We need to set arguments of this fragment. That's why I've added Bundle object as an\n\t\t// argument.\n fragment.setArguments(args);\n return fragment;\n }",
"public static ShoppingListSettings newInstance(int sectionNumber) {\n ShoppingListSettings fragment = new ShoppingListSettings();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static AuthorizeFragment newInstance(int sectionNumber) {\n\t\tAuthorizeFragment fragment = new AuthorizeFragment();\n\t\tBundle args = new Bundle();\n\t\targs.putInt(ARG_SECTION_NUMBER, sectionNumber);\n\t\tfragment.setArguments(args);\n\t\treturn fragment;\n\n\t}",
"public static EndGameTabFragment newInstance(int sectionNumber) {\n EndGameTabFragment fragment = new EndGameTabFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static ProjectScreen newInstance(int sectionNumber) {\n ProjectScreen fragment = new ProjectScreen();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static BandLocationDistanceFragment newInstance(int sectionNumber) {\n BandLocationDistanceFragment fragment = new BandLocationDistanceFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public static HomeFragment newInstance(int sectionNumber, JSONObject userInfoJson) {\n HomeFragment fragment = new HomeFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n fragment.setUserInfoJson(userInfoJson);\n return fragment;\n }",
"public static SubmitPromptFragment newInstance(int sectionNumber) {\n SubmitPromptFragment fragment = new SubmitPromptFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n\n fragment.setArguments(args);\n return fragment;\n }",
"public static ChangesViewFragment newInstance() {\n\t\tChangesViewFragment fragment = new ChangesViewFragment();\n\t\tBundle args = new Bundle();\n\t\targs.putInt(HomeViewActivity.ARG_SECTION_NUMBER, 2);\n\t\tfragment.setArguments(args);\n\t\treturn fragment;\n\t}",
"public static HiPingFragment newInstance(int index) {\n HiPingFragment fragment = new HiPingFragment();\n Bundle bundle = new Bundle();\n bundle.putInt(ARG_SECTION_NUMBER, index);\n fragment.setArguments(bundle);\n return fragment;\n }",
"@Override\n\t\tpublic Fragment getItem(int position) {\n\t\t\tFragment fragment = new SectionFragment(); \n\t\t\tBundle args = new Bundle();\n\t\t\targs.putInt(SectionFragment.ARG_SECTION_NUMBER, position + 1);\n\t\t\tfragment.setArguments(args);\n\t\t\t\n\t\t\t\n\t\t\treturn fragment;\n\t\t\t\n\t\t}",
"public ScanFragment(int sectionNumber) {\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n scanListener = new MyButtonScanListener(this);\n searchListener = new MyButtonSearchListener();\n setArguments(args);\n }",
"public Section newSection() {\n\t\tSection page = new Section();\r\n\t\tpage.setWpPublished(DateUtils.now());\r\n\t\treturn page;\r\n\t}",
"public static EventsOrStatesFragment newInstance(int sectionNumber, boolean showEvents) {\n EventsOrStatesFragment fragment = new EventsOrStatesFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n args.putBoolean(ARG_SHOW_EVENTS, showEvents);\n fragment.setArguments(args);\n return fragment;\n }",
"public SummaryFragment newInstance()\n {\n return new SummaryFragment();\n }",
"void create(Section section);",
"public static PlaceholderFragment newInstance(int sectionNumber, String title_green, String title_black, String message, int imageId) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n args.putString(ARG_SECTION_TITLE_GREEN, title_green);\n args.putString(ARG_SECTION_TITLE_BLACK, title_black);\n args.putString(ARG_SECTION_MESSAGE, message);\n args.putInt(ARG_SECTION_IMAGE, imageId);\n fragment.setArguments(args);\n return fragment;\n }",
"public static Fragment Home_Tab_start(String Id, String section) {\n BodyTab_Sub fragment = new BodyTab_Sub();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, Id);\n args.putString(ARG_PARAM2, section);\n fragment.setArguments(args);\n return fragment;\n }",
"public static FragmentTousWanted newInstance() {\n FragmentTousWanted fragment = new FragmentTousWanted();\n Bundle args = new Bundle();\n fragment.setArguments(args);\n return fragment;\n }",
"Section createSection();",
"public static SummaryFragment newInstance() {\n SummaryFragment fragment = new SummaryFragment();\n return fragment;\n }",
"@Override\n public Fragment getItem(int position) {\n Bundle args = new Bundle();\n AttVFragment fragment = new AttVFragment();\n args.putInt(AttVFragment.ARG_SECTION_NUMBER, position);\n fragment.setArguments(args);\n return fragment;\n }",
"public final SectionsBottomFragment invoke() {\n return new SectionsBottomFragment();\n }",
"public static SelectionFragment newInstance() {\n SelectionFragment fragment = new SelectionFragment();\n return fragment;\n }",
"@Override\n public Fragment getItem(int position) {\n if (position == 0) {\n return new SectionFragment();\n } else if (position == 1) {\n return new SectionFragment();\n }\n else if (position == 2) {\n return new SectionFragment();\n }\n else if (position == 3) {\n return new SectionFragment();\n }\n\n return null;\n }",
"public static PurchaseFragment newInstance(int position) {\n PurchaseFragment f = new PurchaseFragment();\n // Supply index input as an argument.\n Bundle args = new Bundle();\n f.setArguments(args);\n return f;\n }",
"public static Fragment3 newInstance() {\n Fragment3 fragment = new Fragment3();\n return fragment;\n }",
"public static CommentFragment newInstance() {\n CommentFragment fragment = new CommentFragment();\n\n return fragment;\n }",
"public static BitFragment newInstance() {\n BitFragment fragment = new BitFragment();\n return fragment;\n }",
"public static MyCourseFragment newInstance() {\n MyCourseFragment fragment = new MyCourseFragment();\r\n// fragment.setArguments(args);\r\n return fragment;\r\n }",
"public static CategoryFragment newInstance() {\n CategoryFragment categoryFragment = new CategoryFragment();\n return categoryFragment;\n\n }",
"public static NewGameFragment newInstance() {\n return new NewGameFragment();\n }",
"public static DetailsFragment newInstance(@IntRange(from = 1, to = 3) int kittenNumber) {\n Bundle args = new Bundle();\n args.putInt(ARG_KITTEN_NUMBER, kittenNumber);\n\n DetailsFragment fragment = new DetailsFragment();\n fragment.setArguments(args);\n\n return fragment;\n }",
"public static MyFragment getInstance(int position) {\n\n //Construct the fragment\n MyFragment myFragment = new MyFragment();\n\n //New bundle instance\n Bundle args = new Bundle();\n\n //Passing in the Integer position of the fragment into the argument\n args.putInt(\"position\", position);\n\n //Setting the argument of the fragment to be the position\n myFragment.setArguments(args);\n\n //Return the fragment\n return myFragment;\n }",
"public static FootprintFragment newInstance() {\n FootprintFragment fragment = new FootprintFragment();\n\n return fragment;\n }",
"public static AmountFragment newInstance() {\n return new AmountFragment();\n }",
"public static CVFragment newInstance(int i) {\n CVFragment myFragment = new CVFragment();\n\n Bundle args = new Bundle();\n args.putInt(\"pageInt\", i);\n myFragment.setArguments(args);\n\n return myFragment;\n }"
] | [
"0.78372097",
"0.7714463",
"0.77098584",
"0.7696848",
"0.7682352",
"0.7609775",
"0.7595413",
"0.7567707",
"0.7567707",
"0.7567707",
"0.7567707",
"0.7567707",
"0.7567707",
"0.7567707",
"0.7567707",
"0.7567707",
"0.7567707",
"0.7567707",
"0.7567707",
"0.7567707",
"0.7567707",
"0.7567707",
"0.7567707",
"0.7567707",
"0.7567707",
"0.7567707",
"0.7567707",
"0.7567707",
"0.7567707",
"0.7567707",
"0.7567707",
"0.7567707",
"0.7567707",
"0.7567707",
"0.7567707",
"0.7567707",
"0.75659424",
"0.7555789",
"0.7550618",
"0.7512138",
"0.7512138",
"0.74984485",
"0.74984485",
"0.74971724",
"0.7476576",
"0.74580914",
"0.74580914",
"0.7448941",
"0.74465543",
"0.73990864",
"0.7387205",
"0.738536",
"0.7376287",
"0.7370683",
"0.7340481",
"0.72742003",
"0.7252615",
"0.71891",
"0.71660286",
"0.71603835",
"0.7079425",
"0.7061086",
"0.7029471",
"0.70093876",
"0.6935994",
"0.69229335",
"0.68994045",
"0.6895407",
"0.68875086",
"0.6320279",
"0.6299572",
"0.6175721",
"0.61696106",
"0.60625327",
"0.6060087",
"0.59844905",
"0.58862495",
"0.5849053",
"0.5827445",
"0.5819668",
"0.5814801",
"0.5685852",
"0.56829536",
"0.5625638",
"0.5595611",
"0.5544674",
"0.5528172",
"0.5527565",
"0.54934746",
"0.5492439",
"0.5491573",
"0.5451516",
"0.54323405",
"0.5427884",
"0.5398273",
"0.5393979",
"0.5391176",
"0.53684366",
"0.53570664",
"0.5354018"
] | 0.7176293 | 58 |
For each bit position 132 in a 32bit integer, we count the number of integers in the array which have that bit set. Then, if there are n integers in the array and k of them have a particular bit set and (nk) do not, then that bit contributes k(nk) hamming distance to the total. | public int totalHammingDistance(int[] nums) {
int total = 0, n = nums.length;
for (int j = 0; j < 32; j++) {
int bitCount = 0;
for (int i = 0; i < n; i++)
bitCount += (nums[i] >> j) & 1;
total += bitCount * (n - bitCount);
}
return total;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int totalHammingDistance(int[] nums) {\n int result = 0;\n for(int i = 0; i <= 31; i++){\n int count = 0;\n for(int j = 0; j < nums.length; j++){\n count = count + ((nums[j] >> i) & 1);\n }\n //for each position, it contributes to this many number combinations.\n result += count * (nums.length - count);\n }\n return result;\n }",
"public int hamming() {\n if (this.hamming >= 0) return this.hamming;\n int result = 0;\n for (int i = 0; i < N; i++) {\n for (int j = 0; j < N; j++) {\n int idx = (i * N) + (j + 1);\n if (tiles[i][j] == idx) {\n result += 0;\n } else if (tiles[i][j] == 0) {\n continue;\n } else { \n result += 1;\n }\n }\n }\n this.hamming = result;\n return result;\n }",
"public int totalHammingDistance(int[] nums) {\n\t int hamming = 0;\n\t for (int i=0; i<nums.length; i++) {\n\t for (int j=i+1; j<nums.length; j++) {\n\t int xor = nums[i] ^ nums[j];\n\t while (xor != 0) {\n\t hamming += (xor & 1);\n\t xor = xor >>> 1;\n\t }\n\t }\n\t }\n\t \n\t return hamming;\n\t }",
"public int hamming() {\n int count = 0;\n for (int i = 0; i < N; i++) {\n for (int j = 0; j < N && i+j < 2*N-2; j++) {\n if (blocks[i][j] != i*N + j + 1) {\n count++;\n }\n }\n }\n return count;\n }",
"public static int countBits(int[] data) {\n\t\tint sum = 0;\n\t\tfor (int d : data) {\n\t\t\tfor (int i = 0; i < 32; i++) {\n\t\t\t\tsum += (d & (1 << i)) > 0 ? 1 : 0;\n\t\t\t}\n\t\t}\n\t\treturn sum;\n\t}",
"public int hamming() {\n int c = 0;\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < n; j++) {\n int x = tiles[i][j];\n if (x == 0) continue;\n if (x != i*n + j + 1) c++;\n }\n }\n return c;\n }",
"public int hamming() {\n int ham = 0;\n for (int i = 0; i < this.tiles.length; i++) {\n int n = this.tiles[i];\n if (n != i+1 && n > 0) {\n ham++;\n }\n }\n return ham;\n }",
"public int hamming() { \n int total = 0;\n for (int n = 0; n < state.length; n++) \n if (state[n] != 0 && state[n] != n) total++;\n return total;\n }",
"public int hammingDistance(final List<Integer> A) {\n int length = A.size(), sum = 0;\n if(length < Integer.MAX_VALUE){\n int[][] T = new int[length][length];\n int i = 0, j = 0, start = 0;\n while(i < length && j < length){\n if(i == j)\n T[i][j] = 0;\n else{\n T[i][j] = Integer.bitCount(A.get(i) ^ A.get(j));\n sum += T[i][j];\n }\n if(j == length - 1){\n i = 0;\n start++;\n j = start;\n }\n else{\n i++;\n j++;\n }\n }\n }\n return sum*2;\n }",
"public int hamming() {\n int hammingDis = 0;\n for (int i = 0; i < N; i++) {\n for (int j = 0; j < N; j++) {\n if (matrix[i][j] == 0) continue;\n if (i*N+j+1 != matrix[i][j]) hammingDis++;\n }\n }\n return hammingDis;\n }",
"public int hamming() {\r\n\t\tint n = dimension();\r\n\t\tint[] tmp = IntStream.rangeClosed(1, n * n - 1).toArray();\r\n\t\tint[] tmp2 = new int[n * n - 1];\r\n\t\tint k = 0;\r\n\t\tfor (int i = 0; i < n; i++) {\r\n\t\t\tfor (int j = 0; j < n; j++) {\r\n\t\t\t\tif (k < tmp2.length) {\r\n\t\t\t\t\ttmp2[k] = this.blocks[i][j];\r\n\t\t\t\t}\r\n\t\t\t\tk++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tint hamming = IntStream.rangeClosed(0, tmp.length - 1).map(i -> tmp[i] == tmp2[i] ? 0 : 1).reduce(0,\r\n\t\t\t\t(x, y) -> x + y);\r\n\t\treturn hamming;\r\n\t}",
"int count_bit_short( int [] ix, int start, int end, int table ) {\n\t\tint i, sum;\n\t\tint x,y;\n\n\t\tif(table < 0 || table > 34)\n\t\t\treturn 0;\n\n\t\tsum = 0;\n\n\t\tint ylen = this.ylen[table];\n\t\tint linbits = this.linbits[table];\n\n\t\tfor ( int line = start; line < end; line += 2 ) {\n\t\t\tfor ( int window = 0; window < 3; window++ ){\n\t\t\t\tx = Math.abs(ix[line * 3 + window ]);\n\t\t\t\ty = Math.abs(ix[(line + 1) * 3 + window]);\n\n\t\t\t\tif(table > 15){\n\n\t\t\t\t\tif(x > 14) {\n\t\t\t\t\t\tx = 15;\n\t\t\t\t\t\tsum += linbits;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(y > 14) {\n\t\t\t\t\t\ty = 15;\n\t\t\t\t\t\tsum += linbits;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tsum += hlen[table][(x*ylen)+y];\n\t\t\t\tif(x!=0) sum++;\n\t\t\t\tif(y!=0) sum++;\n\t\t\t}\n\t\t}\n\t\treturn sum;\n\t}",
"public static int singleNumber(int[] nums, int k) {\n int len = nums.length, result = 0;\n int[] countBits = new int[32];\n\n for (int i = 0; i < 32; i++) {\n for (int j = 0; j < len; j++) {\n // if the bit position at i is set, we increment countBits[i] by 1.\n if (((nums[j] >> i) & 1) == 1)\n countBits[i]++;\n }\n\n result |= ((countBits[i] % k) << i);\n }\n return result;\n }",
"public static int[] countbits(int n) {\n // res[i] denotes set bits in i\n int[] res = new int[n + 1];\n // set bits in 0 is 0\n res[0] = 0;\n\n // we fill up the table in bottom up manner\n for (int i = 1; i <= n; i++) {\n // if the number is odd then the no. of set bits in it will be 1 + no. of set\n // bits in i/2;\n if (i % 2 != 0) {\n res[i] = 1 + res[i / 2];\n }\n // if the no. is even then the number of set bits will be equal to set in in i/2\n else {\n res[i] = res[i / 2];\n }\n }\n\n // return the final array\n return res;\n }",
"static int numberOfWays(int[] arr, int k) {\n\n Map<Integer, Integer> map = new HashMap<>();\n for (int i = 0; i < arr.length; i++) {\n if (!map.containsKey(arr[i])) {\n map.put(arr[i], 1);\n } else {\n map.put(arr[i], map.get(arr[i]) + 1);\n }\n }\n int result = 0;\n Iterator<Map.Entry<Integer, Integer>> iter = map.entrySet().iterator();\n while (iter.hasNext()) {\n Map.Entry<Integer, Integer> e = iter.next();\n int curNum = (int) e.getKey();\n int countOfOccurance = (int) e.getValue();\n int complement = k - curNum;\n\n if (map.containsKey(complement)) {\n // found target value\n if (curNum == complement) {\n // 3 + 3 = 6\n // add combination of them. count choose 2. For example [3, 3, 3, 3] = 4 choose 2\n result += getCombinationCount(countOfOccurance, 2);\n } else {\n // 1 + 5 = 6\n result += countOfOccurance;\n }\n }\n iter.remove();\n }\n\n return result;\n }",
"public int hamming() \n {\n int hamming = 0; \n for (int i = 0; i < SIZE; i++)\n {\n if (i + 1 != (int) (blocks[i]) && (int) blocks[i] != 0) \n { \n hamming++;\n }\n }\n return hamming;\n }",
"static int countSetBits(int n)\r\n {\r\n int count = 0;\r\n while (n > 0) {\r\n count += n & 1;\r\n n >>= 1;\r\n }\r\n return count;\r\n }",
"private static int getCountOfSetBit(int num){\n int c =0;\n while(num>0){\n c += (num & 1);\n num >>=1;\n }\n return c;\n }",
"public int hamming() {\n int wrong = 0;\n for (int row = 0; row < N; ++row) {\n for (int col = 0; col < N; ++col) {\n int goalValue = N * row + col + 1;\n if (tiles[row][col] != 0 && tiles[row][col] != goalValue) {\n wrong++;\n }\n }\n }\n\n return wrong;\n }",
"public int hamming() {\n int hamming = 0;\n for (int i = 0; i < dimension; i++)\n for (int j = 0; j < dimension; j++)\n if (isWrongPosition(i, j)) hamming++;\n\n return hamming;\n }",
"public int hammingWeight(int n) {\n int count = 0;\n for (int i = 0; i < 32; i++) {\n count += (n & 1);\n n = n >> 1;\n }\n return count;\n }",
"public int hamming() {\n int numIncorrect = -1;\n int index = 1;\n\n for (int[] row : tiles) {\n for (int tile : row) {\n if (tile != index)\n numIncorrect++;\n index++;\n }\n }\n return numIncorrect;\n }",
"public int hammingWeight(int n) {\r\n /*\r\n Bit Manipulation\r\n loop and shift\r\n for each bit over the 32 bits, we check if last bit\r\n if it is one, we add one to the count\r\n then shift the n to the right by one, until finish 32 bits\r\n */ \r\n // int count = 0;\r\n // for (int i = 0; i < 32; ++i) {\r\n // //System.out.println(Integer.toBinaryString(n));\r\n // if ((n & 1) == 1) count++;\r\n // n = n >> 1;\r\n // }\r\n // return count;\r\n /*\r\n Bit manipulation\r\n flip the last significant one by using AND\r\n n & (n - 1) will flip the least significant one to zero\r\n by using this fact we can check if the n is zero, if not, flip the least significant one to zero\r\n until n is zero\r\n */\r\n int count = 0;\r\n while (n != 0) {\r\n count++;\r\n n &= (n - 1);\r\n }\r\n return count;\r\n }",
"public int hamming() {\n int distance = 0;\n for (int i = 0; i < _N; i++) {\n for (int j = 0; j < _N; j++) {\n if (_tiles[i][j] != _goal[i][j]) {\n distance++;\n }\n }\n }\n return distance;\n }",
"public static int count(int[] a) {\n sort(a);\n int N = a.length;\n // print out the sorted array\n System.out.print(\"Sorted array: \");\n for (int i = 0; i < N; i++) {\n System.out.print(a[i] + \" \");\n }\n System.out.println();\n int count = 0;\n for (int i = 0; i < N; i++) {\n int j = i + 1;\n int k = N - 1;\n while (j < k) {\n if (a[i] + a[j] + a[k] == 0) {\n System.out.println(i + \",\" + j + \",\" + k);\n count++;\n j++;\n } else if (a[i] + a[j] + a[k] > 0) {\n k--;\n } else {\n j++;\n }\n }\n }\n return count;\n }",
"public static int bitCount(long i) {\r\n // HD, Figure 5-14\r\n\t\ti = i - ((i >>> 1) & 0x5555555555555555L);\r\n\t\ti = (i & 0x3333333333333333L) + ((i >>> 2) & 0x3333333333333333L);\r\n\t\ti = (i + (i >>> 4)) & 0x0f0f0f0f0f0f0f0fL;\r\n\t\ti = i + (i >>> 8);\r\n\t\ti = i + (i >>> 16);\r\n\t\ti = i + (i >>> 32);\r\n\t\treturn (int)i & 0x7f;\r\n }",
"@Override\n\tpublic int hashCode() {\n\t\tint karprabin = 0;\n\t\tfinal int B = 31;\n\t\tfor (int k = 0; k < this.actualsizeinwords; ++k) {\n\t\t\tkarprabin += B * karprabin + (this.buffer[k] & ((1l << 32) - 1));\n\t\t\tkarprabin += B * karprabin + (this.buffer[k] >>> 32);\n\t\t}\n\t\treturn this.sizeinbits ^ karprabin;\n\t}",
"public static int countPairs(List<Integer> arr, long k) {\n arr = arr.stream().sorted().collect(Collectors.toList());\n Map<String, Long> map = new HashMap<>();\n for (Integer i : arr) {\n if (i <= k && i <= (k - i) && arr.contains((int) k - i)) {\n map.put(i + \"_\" + (k - i), (long) (i + (i + 1)));\n }\n }\n return map.size();\n }",
"public int hammingWeight(int n) {\n int temp = n;\n int count = 0;\n while (temp != 0) {\n temp = temp & (temp - 1);//n=n&(n-1) trick to clear the least significant bit\n count++;\n }\n return count;\n }",
"public int findPairs(int[] nums, int k) {\n if (k < 0) {\n return 0;\n }\n Set<Integer> unique = new HashSet<>();\n Set<Integer> duplicate = new HashSet<>();\n for (int n : nums) {\n if (!unique.add(n)) {\n duplicate.add(n);\n }\n }\n if (k == 0) {\n return duplicate.size();\n }\n int count = 0;\n for (int v : unique) {\n if (unique.contains(v + k)) {\n count += 1;\n }\n }\n return count;\n }",
"private int count1_bitcount(int [] ix, EChannel cod_info) {\n\t\tint p, i, k;\n\t\tint signbits;\n\t\tint sum0 = 0, sum1 = 0;\n\t\tint count1End = bigvalues_region + count1_region;\n\n\t\tfor(i = bigvalues_region, k=0; k < count1End; i+=4, k++) {\n\t\t\tv = Math.abs(ix[i]);\n\t\t\tw = Math.abs(ix[i+1]);\n\t\t\tx = Math.abs(ix[i+2]);\n\t\t\ty = Math.abs(ix[i+3]);\n\n\t\t\tp = signbits = 0;\n\t\t\tif(v!=0) { signbits++; p |= 1; }\n\t\t\tif(w!=0) { signbits++; p |= 2; }\n\t\t\tif(x!=0) { signbits++; p |= 4; }\n\t\t\tif(y!=0) { signbits++; p |= 8; }\n\n\t\t\tsum0 += signbits;\n\t\t\tsum1 += signbits;\n\n\t\t\tsum0 += hlen[32][p];\n\t\t\tsum1 += hlen[33][p];\n\t\t}\n\n\t\tif(sum0 < sum1) {\n\t\t\tcod_info.count1table_select = 0;\n\t\t\treturn sum0;\n\t\t} else {\n\t\t\tcod_info.count1table_select = 1;\n\t\t\treturn sum1;\n\t\t}\n\t}",
"public int hammingWeight(int n) {\r\n int ans=0;\r\n int mask=1;\r\n for(int i=0;i<32;i++){\r\n if((mask&n)!=0) ans++;\r\n mask=mask<<1;\r\n }\r\n return ans;\r\n }",
"public int hammingWeight(int n) {\n int count = 0;\n while (n != 0) {\n n = (n - 1) & n;\n ++count;\n }\n return count;\n }",
"public int hamming() {\n int count = 1;\n int hamming = 0;\n for (int row = 0; row < dimension(); row++) {\n for (int column = 0; column < dimension(); column++) {\n if (row == dimension() - 1 && column == dimension()-1) break; // Skip last value of the board\n if (blocks[row][column] != count) hamming++;\n count++;\n }\n } \n return hamming;\n }",
"int sizeOfScansArray();",
"public int hammingWeight(int n) {\n int count = 0;\n while (n != 0) {\n count += n & 1;\n n = n >>> 1;\n }\n return count;\n }",
"static void countDistinct(int arr[], int k) \n {\n HashMap<Integer, Integer> hM = new HashMap<Integer, Integer>(); \n \n // Traverse the first window and store count \n // of every element in hash map \n for (int i = 0; i < k; i++) \n hM.put(arr[i], hM.getOrDefault(arr[i], 0) + 1); \n \n // Print count of first window \n System.out.println(hM.size()); \n \n // Traverse through the remaining array \n for (int i = k; i < arr.length; i++) { \n \n // Remove first element of previous window \n // If there was only one occurrence \n if (hM.get(arr[i - k]) == 1) { \n hM.remove(arr[i - k]); \n } \n \n else // reduce count of the removed element \n hM.put(arr[i - k], hM.get(arr[i - k]) - 1); \n \n // Add new element of current window \n // If this element appears first time, \n // set its count as 1, \n hM.put(arr[i], hM.getOrDefault(arr[i], 0) + 1); \n \n // Print count of current window \n System.out.println(hM.size()); \n } \n }",
"public int hammingDistance(int x, int y) {\r\n\t int xor = x ^ y, count = 0;\r\n\t /*\r\n\t * xor = x ^ y 3 ^ 1\r\n\t * x | y | o | i\r\n\t * ---------------\r\n\t * 0 0 0 0\r\n\t * 0 0 0 1\r\n\t * 1 0 1 2\r\n\t * 1 0 1 3\r\n\t */\r\n\t for (int i=0;i<32;i++)\r\n\t /* xor / i & 1 will return the matching bits */\r\n\t count += (xor >> i) & 1;\r\n\t \r\n\t return count;\r\n\t}",
"public static int numberOfPairs(int[] a, long k) {\n\t\t\n\t\tArrayList<Integer> list = new ArrayList<>();\n\t\t\n\t\tfor(int x : a) {\n\t\t\tlist.add(x);\n\t\t}\n\n\t\tArrayList<String> distinct = new ArrayList<>();\n\t\t\n\t\tfor(Integer curr : list) {\n\t\t\t\n\t\t\tint indexCurr = list.indexOf(curr);\n\t\t\t\n\t\t\tint anotherOne = (int) (k - curr);\n\t\t\t\n\t\t\tlist.set(indexCurr, curr*(-1));\n\t\t\t\n\t\t\tif(list.contains(anotherOne)) {\n\t\t\t\t\n\t\t\t\tint indexAnotherOne = list.indexOf(anotherOne);\n\t\t\t\t\n\t\t\t\tif(indexAnotherOne!=indexCurr) {\n\t\t\t\t\tString Way1 = curr+\"\"+anotherOne;\n\t\t\t\t\tString Way2 = anotherOne+\"\"+curr;\n\t\t\t\t\tif(!distinct.contains(Way1) && !distinct.contains(Way2)) {\n\t\t\t\t\t\tdistinct.add(Way1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlist.set(indexCurr, curr);\n\t\t\n\t\t}\n\t\t\n\t\treturn distinct.size();\n\t\t\n }",
"static int countSubarrWithEqualZeroAndOne(int arr[], int n)\n {\n int count=0;\n int currentSum=0;\n HashMap<Integer,Integer> mp=new HashMap<>();\n for(int i=0;i<arr.length;i++)\n {\n if(arr[i]==0)\n arr[i]=-1;\n currentSum+=arr[i];\n \n if(currentSum==0)\n count++;\n if(mp.containsKey(currentSum))\n count+=mp.get(currentSum);\n if(!mp.containsKey(currentSum))\n mp.put(currentSum,1);\n else\n mp.put(currentSum,mp.get(currentSum)+1);\n \n \n }\n return count;\n }",
"public int hammingWeight(int n) {\n int count = 0;\n for (int i = n; i != 0; i >>>= 1) {\n count += (i & 1);\n }\n return count;\n }",
"public int hammingWeight2(int n) {\n int count = 0;\n for (int i = n; i != 0; i &= (i - 1)) {\n count++;\n }\n return count;\n }",
"public static int countShifts(int[] ar) {\n int count = 0;\n for(int i = 1; i < ar.length; i++){\n int j = i -1;\n int index = i;\n while(j >=0){\n if(ar[j] > ar[index]){\n int tmp = ar[index];\n ar[index] = ar[j];\n ar[j] = tmp;\n count++;\n index = j;\n }\n j--;\n }\n }\n// printArray(ar);\n return count;\n }",
"public static int val(int[] a) {\n\n\t\tint count = 0;\n\t\tHashSet<Integer> set = new HashSet<Integer>();\n\t\tfor (int i = 0; i < a.length; i++)\n\t\t\tset.add(a[i]);\n\n\t\tHashMap<Integer, Integer> map = new HashMap<Integer, Integer>();\n\t\tfor (int i = 0, j = 0; i < a.length && j < a.length;) {\n\t\t\twhile (map.size() != set.size()) {\n\t\t\t\tmap.put(a[j], map.getOrDefault(a[j], 0) + 1);\n\t\t\t\tj++;\n\t\t\t\tif (j == a.length)\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\twhile (map.size() == set.size()) {\n\t\t\t\tcount += a.length - j + 1;\n\t\t\t\tif (map.get(a[i]) == 1)\n\t\t\t\t\tmap.remove(a[i]);\n\t\t\t\telse\n\t\t\t\t\tmap.put(a[i], map.get(a[i]) - 1);\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\n\t\treturn count;\n\t}",
"public int sumCount(int number){\n int sum=0;\n for(int i=1; i<=number; i++){\n sum=sum+countSetBits(i);\n }\n return sum;\n }",
"private int bigv_bitcount(int [] ix, EChannel gi) {\n\t\tint bits = 0;\n\n\t\tif ( gi.window_switching_flag != 0 && gi.block_type == 2 ) {\n\t\t\t/*\n Within each scalefactor band, data is given for successive\n time windows, beginning with window 0 and ending with window 2.\n Within each window, the quantized values are then arranged in\n order of increasing frequency...\n\t\t\t */\n\t\t\tint sfb = 0, window, line, start, end;\n\n\t\t\tif ( gi.mixed_block_flag != 0 ) {\n\t\t\t\tint tableindex;\n\n\t\t\t\tif ( (tableindex = gi.table_select[0]) != 0 )\n\t\t\t\t\tbits += count_bit( ix, 0, gi.address1, tableindex );\n\t\t\t\tsfb = 2;\n\t\t\t}\n\n\t\t\tfor ( ; sfb < 13; sfb++ ) {\n\t\t\t\tint tableindex = 100;\n\n\t\t\t\tstart = scalefac_band_short[ sfb ];\n\t\t\t\tend = scalefac_band_short[ sfb+1 ];\n\n\t\t\t\tif ( start < 12 )\n\t\t\t\t\ttableindex = gi.table_select[ 0 ];\n\t\t\t\telse\n\t\t\t\t\ttableindex = gi.table_select[ 1 ];\n\n\t\t\t\tbits += count_bit_short(ix, start, end, tableindex);/*\n for ( line = start; line < end; line += 2 ) {\n for ( window = 0; window < 3; window++ ){\n x = (ix[line * 3 + window ]);\n y = (ix[(line + 1) * 3 + window]);\n\n // x = (i192_3[ line ][ window ]);\n // y = (i192_3[ line + 1 ][ window]);\n\n bits += HuffmanCode( tableindex, x, y );\n }\n }*/\n\t\t\t}\n\t\t} else {\n\n\t\t\tint table;\n\n\t\t\tif( (table = gi.table_select[0] )>=0) // region0\n\t\t\tbits += count_bit(ix, 0, gi.address1, table );\n\t\t\tif( (table = gi.table_select[1])>=0) // region1\n\t\t\t\tbits += count_bit(ix, gi.address1, gi.address2, table );\n\t\t\tif( (table = gi.table_select[2])>=0) // region2\n\t\t\t\tbits += count_bit(ix, gi.address2, gi.address3, table );\n\t\t}\n\n\t\treturn bits;\n\t}",
"public int digitCounts(int k, int n) {\n if (k <= 0 || n < 0) {\n return 0;\n }\n if (n == 0) {\n return 1;\n }\n// int res=0;\n ArrayList<Integer> arrayList = new ArrayList<>();\n for (int i = 0; i <= k; i++) {\n\n if ((i + \"\").indexOf(n + \"\") != -1) {\n arrayList.add(i);\n }\n }\n System.out.println(Arrays.asList(arrayList) + \" have \" + (arrayList.toString().length() - arrayList.toString().replace(n + \"\", \"\").length()) + \" n ( n = \" + n + \" )\");\n return arrayList.size();\n }",
"static int distributeCandy(int[] score) {\n java.util.TreeMap<Integer,Integer> candcalmap=new java.util.TreeMap<Integer,Integer>();\n int totcand=0,numcan=1;\n /* for(int indx=1;indx<score.length;indx++)\n {\n while(score[indx-1]<(indx<score.length?score[indx]:Integer.MAX_VALUE))\n {\n numcan++;\n indx++;\n totcand+=numcan;\n //System.out.println(numcan+\"-\"+indx+\":\"+totcand);\n if(indx==score.length)\n break;\n }\n numcan=1;\n totcand+=numcan;\n \n }\n*/\tfor(int sc:score)\n {\n candcalmap.put(sc,candcalmap.get(sc)==null?1:candcalmap.get(sc)+1);\n }\n for(Map.Entry<Integer,Integer> e:candcalmap.entrySet())\n {\n totcand+=numcan*e.getValue();\n// System.out.println(e.getValue()+\"-\"+e.getKey()+\":\"+numcan+\" \"+totcand);\n numcan++;\n }\n return totcand;\n }",
"static void zerosumarr(long[] arr) {\r\n\t \t // Write your code here\r\n\t\t HashMap<Long,Long> map = new HashMap<>();\r\n\t\t int count=0;\r\n\t\t Long psum=(long) 0;\r\n\t\t map.put(psum,(long)1);\r\n\t\t for(int i=0;i<arr.length;i++) {\r\n\t\t\t psum+=arr[i];\r\n\t\t\t if(map.containsKey(psum)) {\r\n\t\t\t\t count+=map.get(psum);\r\n\t\t\t\t map.put(psum,map.get(psum)+1);\r\n\t\t\t }\r\n\t\t\t else {\r\n\t\t\t\t map.put(psum, (long)1);\r\n\t\t\t }\r\n\t\t\t \r\n\t\t }\r\n\t\t System.out.println(count);\r\n\t }",
"public int[] countBits(int num) {\n int[] m = new int[num+1];\n for (int i = 1; i <= num; i++) {\n m[i] = m[i/2] + (i & 1);\n }\n return m;\n }",
"public int hammingWeight(int n) {\n return Integer.bitCount(n);\n }",
"static int printpairs(int arr[],int k)\n {\n\t\tint count = 0; // Initialize count\n\t\tint size = arr.length;\n\t\t // Declares and initializes the whole array as false\n boolean[] binmap = new boolean[MAX];\n\n // Insert array elements to hashmap\n for(int i=0; i<size; i++)\n \t binmap[arr[i]] = true;\n \n for(int i=0; i<size; i++)\n {\n \t int temp = arr[i]- k;\n \t\n \t if (temp >= 0 && binmap[temp])\n \t {\n \t\t System.out.println(\"Pair with given diff \" + k + \" is (\" + arr[i] + \", \"+temp+\")\");\n \t\t count++;\n \t }\n \n \t temp = arr[i]+ k;\n if (temp < MAX && binmap[temp])\n {\n \t\t System.out.println(\"Pair with given diff \" + k + \" is (\" + arr[i] + \", \"+temp+\")\");\n \t\t count++;\n \t }\n binmap[temp] = false;\n }\n \n return count++;\n }",
"public static int sizeBits_offset_cmp() {\n return 32;\n }",
"private static int findPairs(int[] nums, int k) {\n if(nums == null || nums.length == 0 || k < 0)\n return 0;\n\n int count = 0;\n Map<Integer, Integer> map = new HashMap<>();\n for(int i : nums)\n map.put(i, map.getOrDefault(i, 0) + 1);\n\n for(Map.Entry<Integer, Integer> entry : map.entrySet()) {\n if(k == 0) {\n if(entry.getValue() >= 2)\n count++;\n } else {\n if(map.containsKey(entry.getKey() + k))\n count++;\n }\n }\n return count;\n }",
"static long countInversions(int[] arr) {\n long ans = 0;\n int n = Arrays.stream(arr).max().getAsInt();\n BIT bit = new BIT(n);\n for (int i = 0; i < arr.length; i++) {\n ans += bit.sum(n) - bit.sum(arr[i]);\n bit.add(arr[i], 1);\n }\n return ans;\n }",
"public int findIntegers(int n) {\n int[][]template=new int[32][2];\n\n //when the max length the array is one, we know that whether the max bit is one or zero, the arr value is 1\n template[1][0]=1;\n template[1][1]=1;\n\n for (int i = 2; i < 32; i++) {\n template[i][0]=template[i-1][0]+template[i-1][1];\n template[i][1]=template[i-1][0];\n }\n\n int answ=0;\n int pre=0;\n\n //we need to change n to binary expression\n List<Integer>binaryExpression=new ArrayList<>();\n int current=n;\n while (current!=0)\n {\n binaryExpression.add(current&1);\n current=current>>1;\n }\n for (int i = binaryExpression.size()-1; i>=0; i--) {\n Integer currentBit = binaryExpression.get(i);\n for (int j = 0; j < currentBit; j++) {\n answ+=template[i+1][j];\n }\n if (currentBit==1&&pre==1)\n {\n break;\n }\n pre=currentBit;\n if (i==0)\n {\n answ++;\n }\n }\n return answ;\n }",
"private static int getSmallerThanOrEqualToKCount(int[] a, int k){\n int left=0, right=a.length-1;\n while(left<right){\n int mid=left+(right+1-left)/2;\n if(a[mid]>k){\n right=mid-1;\n } else{\n left=mid;\n }\n }\n return left-0+1;\n }",
"private static int computeNumberOfBandsForThreshold(int nHashes, double jaccardThreshold) {\n int bands = nHashes;\n while (bands > 1) {\n if ((nHashes % bands) == 0) {\n double threshold = Math.pow((double) 1.0 / bands, (double) bands / nHashes);\n if (threshold > jaccardThreshold) {\n break;\n }\n }\n bands--;\n }\n return bands;\n }",
"private static void findMultipleMissing(int[] arr, int count) {\n int missingCount = count - arr.length;\n BitSet bitSet = new BitSet(count);\n\n for (int i : arr) {\n bitSet.set(i - 1);\n }\n\n int lastMissingIndex = 0;\n for (int i = 0; i < missingCount; i++) {\n lastMissingIndex = bitSet.nextClearBit(lastMissingIndex);\n System.out.println(++lastMissingIndex);\n }\n }",
"static int[] countBits(int num){\n\t\t\n\t\tint[] result = new int[num+1];\n\t\t\n\t\tfor(int i = 0 ; i <= num; i++){\n\t\t\tresult[i] = countEach(i);\n\t\t\tSystem.out.print(result[i]+\" \");\n\t\t}\n\t\treturn result;\n\t}",
"static int sockMerchant(int[] ar) {\n int counter = 0;\n Map<Integer, Integer> map = new HashMap<>();\n for(int i = 0; i < ar.length; i++) {\n Integer val = map.get(ar[i]);\n val = val != null? val + 1 : 1;\n map.put(ar[i], val);\n if(val > 0 && val % 2 == 0) counter++;\n }\n return counter;\n }",
"public int hammingWeight(int n) {\n String unsignedString = Integer.toUnsignedString(n, 2);\n int sum = 0;\n for (int i = 0; i < unsignedString.length(); i++) {\n if (unsignedString.substring(i, i + 1).equals(\"1\"))\n sum++;\n }\n return sum;\n }",
"public int hammingWeight3(int n) {\n n = (n & 0x55555555) + (n >>> 1 & 0x55555555); // put count of each 2 bits into those 2 bits\n n = (n & 0x33333333) + (n >>> 2 & 0x33333333);// put count of each 4 bits into those 4 bits\n n = (n & 0x0F0F0F0F) + (n >>> 4 & 0x0F0F0F0F);// put count of each 8 bits into those 8 bits\n n = (n & 0x00FF00FF) + (n >>> 8 & 0x00FF00FF);// put count of each 16 bits into those 16 bits\n n = (n & 0x0000FFFF) + (n >>> 16 & 0x0000FFFF); // put count of each 32 bits into those 32 bits\n return n;\n }",
"public static void countingSort(int[] array, int k) {\r\n int[] workStorage = new int[k + 1];\r\n int[] result = new int[array.length];\r\n for (int i = 0; i < array.length; i++) {\r\n workStorage[array[i]] = workStorage[array[i]] + 1;\r\n }\r\n for (int i = 0; i < k; i++) {\r\n workStorage[i + 1] = workStorage[i + 1] + workStorage[i];\r\n }\r\n for (int i = array.length - 1; i >= 0; i--) {\r\n result[workStorage[array[i]] - 1] = array[i];\r\n workStorage[array[i]] = workStorage[array[i]] - 1;\r\n }\r\n for (int i = 0; i < array.length; i++) {\r\n array[i] = result[i];\r\n }\r\n }",
"public static int findPairs(int[] nums, int k) {\n \tif(k<0){\n \t\treturn 0;\n \t}\n \t\n int re=0;\n Map<Integer, Integer> map=new HashMap<Integer, Integer>();\n for(int num: nums){\n \tif(map.containsKey(num)){\n \t\tif(k==0&&map.get(num)==1){\n \t\t\tre++;\n \t\t\tmap.put(num, 0);\n \t\t}\n \t\tcontinue;\n \t}\n \tif(map.containsKey(num+k)){\n \t\tre++;\n \t}\n \tif(map.containsKey(num-k)){\n \t\tre++;\n \t}\n \tmap.put(num, 1);\n }\n return re;\n }",
"static int countWaysUtil(int n, int m) \n\t { \n\t int res[] = new int[n]; \n\t res[0] = 1; res[1] = 1; \n\t for (int i=2; i<n; i++) \n\t { \n\t res[i] = 0; \n\t for (int j=1; j<=m && j<=i; j++) \n\t res[i] += res[i-j]; \n\t } \n\t return res[n-1]; \n\t }",
"public int getLength(int[] arr, int k) {\n int winStart = 0, maxFreq = 0, maxLength = 0, numberOfOne = 0;\n for (int winEnd = 0; winEnd < arr.length; winEnd++) {\n if (arr[winEnd] == 1) {\n numberOfOne++;\n }\n if (winEnd - winStart + 1 > k + numberOfOne) {\n if (arr[winStart++] == 1) {\n numberOfOne--;\n }\n }\n maxLength = Math.max(maxLength, winEnd - winStart + 1);\n }\n return maxLength;\n }",
"public static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\r\n\t\t//System.out.println(Integer.toBinaryString(31));\r\n\t\tint n = in.nextInt();\r\n\t\tint[] arr = new int[n];\r\n\t\tfor(int i = 0 ;i < n; i++) {\r\n\t\t\tarr[i] = in.nextInt();\r\n\t\t}\r\n\t\tArrays.sort(arr);\r\n\t\tint[] arr1 = new int[n];\r\n\t\tint co = 0;\r\n\t\tfor(int i = n- 1; i >= 0; i--) {\r\n\t\t\tarr1[co++] = arr[i];\r\n\t\t}\r\n\t\tString[] str = new String[n];\r\n\t\tfor(int i = 0; i < n; i++) {\r\n\t\t\tstr[i] = Integer.toBinaryString(arr1[i]);\r\n\t\t}\r\n\t\tint[] countArr = new int[n];\r\n\t\tint[] countArr1 = new int[n];\r\n\t\tTreeSet<Integer> set = new TreeSet<Integer>(); \r\n\t\tfor(int i = 0; i < n; i++) {\r\n\t\t\tcountArr[i] = 0;\r\n\t\t\tfor(int j = 0; j < str[i].length(); j++) {\r\n\t\t\t\tif(String.valueOf(str[i].charAt(j)).equals(\"1\")) {\r\n\t\t\t\t\tcountArr[i]++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tset.add(countArr[i]);\r\n\t\t}\r\n\t\tint[] arrCpy = new int[set.size()];\r\n\t\tint ct = set.size() - 1;\r\n\t\tIterator<Integer> it = set.iterator();\r\n\t\twhile(it.hasNext()) {\r\n\t\t\tarrCpy[ct--] = it.next();\r\n\t\t}\r\n\t\tfor(int i = 0; i < arrCpy.length; i++) {\r\n\t\t\tfor(int j = 0; j < n; j++) {\r\n\t\t\t\tif(arrCpy[i] == countArr[j]) {\r\n\t\t\t\t\tSystem.out.println(arr1[j]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public int manhattan() {\n int count = 0;\n for (int i = 0; i < N; i++) {\n for (int j = 0; j < N; j++) {\n if (blocks[i][j] != 0) {\n int row = (blocks[i][j] - 1) / N;\n int col = (blocks[i][j] - 1) % N;\n count += (Math.abs(row - i) + Math.abs(col - j));\n }\n }\n }\n return count;\n }",
"static int migratoryBirds(List<Integer> arr) {\n int count=1;\n int max=arr.get(0);\n HashMap<Integer,Integer> map=new HashMap<>();\n for(int i=0;i<arr.size();i++) {\n \tif(map.containsKey(arr.get(i))) {\n \t\tmap.replace(arr.get(i), map.get(arr.get(i))+1);\n \t}else {\n \t\tmap.put(arr.get(i), count);\n \t}\n }\n \n int ans=0;\n for(Integer i:map.keySet()) {\n \t int n=map.get(i);\n \t if(n>max) {\n \t\t max=n;\n \t\t \tans=i;\n\n \t }\n }\n /*int comp[]=new int[256];\n for(int i=0;i<arr.size();i++){\n comp[arr.get(i)]++;\n }\n for(int i=0;i<comp.length;i++){\n if(comp[i]>max)\n max=comp[i];\n }*/\n return ans;\n }",
"public int[] countBits(int num) {\n int[] dp = new int[num + 1];\n int offset = 1;\n \n for (int i = 1; i < num + 1; i++) {\n if (i == 2 * offset) {\n offset *= 2;\n }\n dp[i] = dp[i - offset] + 1;\n }\n \n return dp;\n }",
"@Override\n public long[ ][ ] count() {\n // precompute common nodes\n for (int x = 0; x < n; x++) {\n for (int n1 = 0; n1 < deg[x]; n1++) {\n int a = adj[x][n1];\n for (int n2 = n1 + 1; n2 < deg[x]; n2++) {\n int b = adj[x][n2];\n Tuple ab = createTuple(a, b);\n common2.put(ab, common2.getOrDefault(ab, 0) + 1);\n for (int n3 = n2 + 1; n3 < deg[x]; n3++) {\n int c = adj[x][n3];\n boolean st = adjacent(adj[a], b) ? (adjacent(adj[a], c) || adjacent(adj[b], c)) :\n (adjacent(adj[a], c) && adjacent(adj[b], c));\n if (!st) continue;\n Tuple abc = createTuple(a, b, c);\n common3.put(abc, common3.getOrDefault(abc, 0) + 1);\n }\n }\n }\n }\n\n // precompute triangles that span over edges\n int[ ] tri = countTriangles();\n\n // count full graphlets\n long[ ] C5 = new long[n];\n int[ ] neigh = new int[n];\n int[ ] neigh2 = new int[n];\n int nn, nn2;\n for (int x = 0; x < n; x++) {\n for (int nx = 0; nx < deg[x]; nx++) {\n int y = adj[x][nx];\n if (y >= x) break;\n nn = 0;\n for (int ny = 0; ny < deg[y]; ny++) {\n int z = adj[y][ny];\n if (z >= y) break;\n if (adjacent(adj[x], z)) {\n neigh[nn++] = z;\n }\n }\n for (int i = 0; i < nn; i++) {\n int z = neigh[i];\n nn2 = 0;\n for (int j = i + 1; j < nn; j++) {\n int zz = neigh[j];\n if (adjacent(adj[z], zz)) {\n neigh2[nn2++] = zz;\n }\n }\n for (int i2 = 0; i2 < nn2; i2++) {\n int zz = neigh2[i2];\n for (int j2 = i2 + 1; j2 < nn2; j2++) {\n int zzz = neigh2[j2];\n if (adjacent(adj[zz], zzz)) {\n C5[x]++;\n C5[y]++;\n C5[z]++;\n C5[zz]++;\n C5[zzz]++;\n }\n }\n }\n }\n }\n }\n\n int[ ] common_x = new int[n];\n int[ ] common_x_list = new int[n];\n int ncx = 0;\n int[ ] common_a = new int[n];\n int[ ] common_a_list = new int[n];\n int nca = 0;\n\n // set up a system of equations relating orbit counts\n for (int x = 0; x < n; x++) {\n for (int i = 0; i < ncx; i++) common_x[common_x_list[i]] = 0;\n ncx = 0;\n\n // smaller graphlets\n orbit[x][0] = deg[x];\n for (int nx1 = 0; nx1 < deg[x]; nx1++) {\n int a = adj[x][nx1];\n for (int nx2 = nx1 + 1; nx2 < deg[x]; nx2++) {\n int b = adj[x][nx2];\n if (adjacent(adj[a], b)) orbit[x][3]++;\n else orbit[x][2]++;\n }\n for (int na = 0; na < deg[a]; na++) {\n int b = adj[a][na];\n if (b != x && !adjacent(adj[x], b)) {\n orbit[x][1]++;\n if (common_x[b] == 0) common_x_list[ncx++] = b;\n common_x[b]++;\n }\n }\n }\n\n long f_71 = 0, f_70 = 0, f_67 = 0, f_66 = 0, f_58 = 0, f_57 = 0; // 14\n long f_69 = 0, f_68 = 0, f_64 = 0, f_61 = 0, f_60 = 0, f_55 = 0, f_48 = 0, f_42 = 0, f_41 = 0; // 13\n long f_65 = 0, f_63 = 0, f_59 = 0, f_54 = 0, f_47 = 0, f_46 = 0, f_40 = 0; // 12\n long f_62 = 0, f_53 = 0, f_51 = 0, f_50 = 0, f_49 = 0, f_38 = 0, f_37 = 0, f_36 = 0; // 8\n long f_44 = 0, f_33 = 0, f_30 = 0, f_26 = 0; // 11\n long f_52 = 0, f_43 = 0, f_32 = 0, f_29 = 0, f_25 = 0; // 10\n long f_56 = 0, f_45 = 0, f_39 = 0, f_31 = 0, f_28 = 0, f_24 = 0; // 9\n long f_35 = 0, f_34 = 0, f_27 = 0, f_18 = 0, f_16 = 0, f_15 = 0; // 4\n long f_17 = 0; // 5\n long f_22 = 0, f_20 = 0, f_19 = 0; // 6\n long f_23 = 0, f_21 = 0; // 7\n\n for (int nx1 = 0; nx1 < deg[x]; nx1++) {\n int a = inc[x][nx1]._1, xa = inc[x][nx1]._2;\n\n for (int i = 0; i < nca; i++) common_a[common_a_list[i]] = 0;\n nca = 0;\n for (int na = 0; na < deg[a]; na++) {\n int b = adj[a][na];\n for (int nb = 0; nb < deg[b]; nb++) {\n int c = adj[b][nb];\n if (c == a || adjacent(adj[a], c)) continue;\n if (common_a[c] == 0) common_a_list[nca++] = c;\n common_a[c]++;\n }\n }\n\n // x = orbit-14 (tetrahedron)\n for (int nx2 = nx1 + 1; nx2 < deg[x]; nx2++) {\n int b = inc[x][nx2]._1, xb = inc[x][nx2]._2;\n if (!adjacent(adj[a], b)) continue;\n for (int nx3 = nx2 + 1; nx3 < deg[x]; nx3++) {\n int c = inc[x][nx3]._1, xc = inc[x][nx3]._2;\n if (!adjacent(adj[a], c) || !adjacent(adj[b], c)) continue;\n orbit[x][14]++;\n f_70 += common3.getOrDefault(createTuple(a, b, c), 0) - 1;\n f_71 += (tri[xa] > 2 && tri[xb] > 2) ? (common3.getOrDefault(createTuple(x, a, b), 0) - 1) : 0;\n f_71 += (tri[xa] > 2 && tri[xc] > 2) ? (common3.getOrDefault(createTuple(x, a, c), 0) - 1) : 0;\n f_71 += (tri[xb] > 2 && tri[xc] > 2) ? (common3.getOrDefault(createTuple(x, b, c), 0) - 1) : 0;\n f_67 += tri[xa] - 2 + tri[xb] - 2 + tri[xc] - 2;\n f_66 += common2.getOrDefault(createTuple(a, b), 0) - 2;\n f_66 += common2.getOrDefault(createTuple(a, c), 0) - 2;\n f_66 += common2.getOrDefault(createTuple(b, c), 0) - 2;\n f_58 += deg[x] - 3;\n f_57 += deg[a] - 3 + deg[b] - 3 + deg[c] - 3;\n }\n }\n\n // x = orbit-13 (diamond)\n for (int nx2 = 0; nx2 < deg[x]; nx2++) {\n int b = inc[x][nx2]._1, xb = inc[x][nx2]._2;\n if (!adjacent(adj[a], b)) continue;\n for (int nx3 = nx2 + 1; nx3 < deg[x]; nx3++) {\n int c = inc[x][nx3]._1, xc = inc[x][nx3]._2;\n if (!adjacent(adj[a], c) || adjacent(adj[b], c)) continue;\n orbit[x][13]++;\n f_69 += (tri[xb] > 1 && tri[xc] > 1) ? (common3.getOrDefault(createTuple(x, b, c), 0) - 1) : 0;\n f_68 += common3.getOrDefault(createTuple(a, b, c), 0) - 1;\n f_64 += common2.getOrDefault(createTuple(b, c), 0) - 2;\n f_61 += tri[xb] - 1 + tri[xc] - 1;\n f_60 += common2.getOrDefault(createTuple(a, b), 0) - 1;\n f_60 += common2.getOrDefault(createTuple(a, c), 0) - 1;\n f_55 += tri[xa] - 2;\n f_48 += deg[b] - 2 + deg[c] - 2;\n f_42 += deg[x] - 3;\n f_41 += deg[a] - 3;\n }\n }\n\n // x = orbit-12 (diamond)\n for (int nx2 = nx1 + 1; nx2 < deg[x]; nx2++) {\n int b = inc[x][nx2]._1, xb = inc[x][nx2]._2;\n if (!adjacent(adj[a], b)) continue;\n for (int na = 0; na < deg[a]; na++) {\n int c = inc[a][na]._1, ac = inc[a][na]._2;\n if (c == x || adjacent(adj[x], c) || !adjacent(adj[b], c)) continue;\n orbit[x][12]++;\n f_65 += (tri[ac] > 1) ? common3.getOrDefault(createTuple(a, b, c), 0) : 0;\n f_63 += common_x[c] - 2;\n f_59 += tri[ac] - 1 + common2.getOrDefault(createTuple(b, c), 0) - 1;\n f_54 += common2.getOrDefault(createTuple(a, b), 0) - 2;\n f_47 += deg[x] - 2;\n f_46 += deg[c] - 2;\n f_40 += deg[a] - 3 + deg[b] - 3;\n }\n }\n\n // x = orbit-8 (cycle)\n for (int nx2 = nx1 + 1; nx2 < deg[x]; nx2++) {\n int b = inc[x][nx2]._1, xb = inc[x][nx2]._2;\n if (adjacent(adj[a], b)) continue;\n for (int na = 0; na < deg[a]; na++) {\n int c = inc[a][na]._1, ac = inc[a][na]._2;\n if (c == x || adjacent(adj[x], c) || !adjacent(adj[b], c)) continue;\n orbit[x][8]++;\n f_62 += (tri[ac] > 0) ? common3.getOrDefault(createTuple(a, b, c), 0) : 0;\n f_53 += tri[xa] + tri[xb];\n f_51 += tri[ac] + common2.getOrDefault(createTuple(c, b), 0);\n f_50 += common_x[c] - 2;\n f_49 += common_a[b] - 2;\n f_38 += deg[x] - 2;\n f_37 += deg[a] - 2 + deg[b] - 2;\n f_36 += deg[c] - 2;\n }\n }\n\n // x = orbit-11 (paw)\n for (int nx2 = nx1 + 1; nx2 < deg[x]; nx2++) {\n int b = inc[x][nx2]._1, xb = inc[x][nx2]._2;\n if (!adjacent(adj[a], b)) continue;\n for (int nx3 = 0; nx3 < deg[x]; nx3++) {\n int c = inc[x][nx3]._1, xc = inc[x][nx3]._2;\n if (c == a || c == b || adjacent(adj[a], c) || adjacent(adj[b], c)) continue;\n orbit[x][11]++;\n f_44 += tri[xc];\n f_33 += deg[x] - 3;\n f_30 += deg[c] - 1;\n f_26 += deg[a] - 2 + deg[b] - 2;\n }\n }\n\n // x = orbit-10 (paw)\n for (int nx2 = 0; nx2 < deg[x]; nx2++) {\n int b = inc[x][nx2]._1, xb = inc[x][nx2]._2;\n if (!adjacent(adj[a], b)) continue;\n for (int nb = 0; nb < deg[b]; nb++) {\n int c = inc[b][nb]._1, bc = inc[b][nb]._2;\n if (c == x || c == a || adjacent(adj[a], c) || adjacent(adj[x], c)) continue;\n orbit[x][10]++;\n f_52 += common_a[c] - 1;\n f_43 += tri[bc];\n f_32 += deg[b] - 3;\n f_29 += deg[c] - 1;\n f_25 += deg[a] - 2;\n }\n }\n\n // x = orbit-9 (paw)\n for (int na1 = 0; na1 < deg[a]; na1++) {\n int b = inc[a][na1]._1, ab = inc[a][na1]._2;\n if (b == x || adjacent(adj[x], b)) continue;\n for (int na2 = na1 + 1; na2 < deg[a]; na2++) {\n int c = inc[a][na2]._1, ac = inc[a][na2]._2;\n if (c == x || !adjacent(adj[b], c) || adjacent(adj[x], c)) continue;\n orbit[x][9]++;\n f_56 += (tri[ab] > 1 && tri[ac] > 1) ? common3.getOrDefault(createTuple(a, b, c), 0) : 0;\n f_45 += common2.getOrDefault(createTuple(b, c), 0) - 1;\n f_39 += tri[ab] - 1 + tri[ac] - 1;\n f_31 += deg[a] - 3;\n f_28 += deg[x] - 1;\n f_24 += deg[b] - 2 + deg[c] - 2;\n }\n }\n\n // x = orbit-4 (path)\n for (int na = 0; na < deg[a]; na++) {\n int b = inc[a][na]._1, ab = inc[a][na]._2;\n if (b == x || adjacent(adj[x], b)) continue;\n for (int nb = 0; nb < deg[b]; nb++) {\n int c = inc[b][nb]._1, bc = inc[b][nb]._2;\n if (c == a || adjacent(adj[a], c) || adjacent(adj[x], c)) continue;\n orbit[x][4]++;\n f_35 += common_a[c] - 1;\n f_34 += common_x[c];\n f_27 += tri[bc];\n f_18 += deg[b] - 2;\n f_16 += deg[x] - 1;\n f_15 += deg[c] - 1;\n }\n }\n\n // x = orbit-5 (path)\n for (int nx2 = 0; nx2 < deg[x]; nx2++) {\n int b = inc[x][nx2]._1, xb = inc[x][nx2]._2;\n if (b == a || adjacent(adj[a], b)) continue;\n for (int nb = 0; nb < deg[b]; nb++) {\n int c = inc[b][nb]._1, bc = inc[b][nb]._2;\n if (c == x || adjacent(adj[a], c) || adjacent(adj[x], c)) continue;\n orbit[x][5]++;\n f_17 += deg[a] - 1;\n }\n }\n\n // x = orbit-6 (claw)\n for (int na1 = 0; na1 < deg[a]; na1++) {\n int b = inc[a][na1]._1, ab = inc[a][na1]._2;\n if (b == x || adjacent(adj[x], b)) continue;\n for (int na2 = na1 + 1; na2 < deg[a]; na2++) {\n int c = inc[a][na2]._1, ac = inc[a][na2]._2;\n if (c == x || adjacent(adj[x], c) || adjacent(adj[b], c)) continue;\n orbit[x][6]++;\n f_22 += deg[a] - 3;\n f_20 += deg[x] - 1;\n f_19 += deg[b] - 1 + deg[c] - 1;\n }\n }\n\n // x = orbit-7 (claw)\n for (int nx2 = nx1 + 1; nx2 < deg[x]; nx2++) {\n int b = inc[x][nx2]._1, xb = inc[x][nx2]._2;\n if (adjacent(adj[a], b)) continue;\n for (int nx3 = nx2 + 1; nx3 < deg[x]; nx3++) {\n int c = inc[x][nx3]._1, xc = inc[x][nx3]._2;\n if (adjacent(adj[a], c) || adjacent(adj[b], c)) continue;\n orbit[x][7]++;\n f_23 += deg[x] - 3;\n f_21 += deg[a] - 1 + deg[b] - 1 + deg[c] - 1;\n }\n }\n }\n\n // solve equations\n orbit[x][72] = C5[x];\n orbit[x][71] = (f_71 - 12 * orbit[x][72]) / 2;\n orbit[x][70] = (f_70 - 4 * orbit[x][72]);\n orbit[x][69] = (f_69 - 2 * orbit[x][71]) / 4;\n orbit[x][68] = (f_68 - 2 * orbit[x][71]);\n orbit[x][67] = (f_67 - 12 * orbit[x][72] - 4 * orbit[x][71]);\n orbit[x][66] = (f_66 - 12 * orbit[x][72] - 2 * orbit[x][71] - 3 * orbit[x][70]);\n orbit[x][65] = (f_65 - 3 * orbit[x][70]) / 2;\n orbit[x][64] = (f_64 - 2 * orbit[x][71] - 4 * orbit[x][69] - 1 * orbit[x][68]);\n orbit[x][63] = (f_63 - 3 * orbit[x][70] - 2 * orbit[x][68]);\n orbit[x][62] = (f_62 - 1 * orbit[x][68]) / 2;\n orbit[x][61] = (f_61 - 4 * orbit[x][71] - 8 * orbit[x][69] - 2 * orbit[x][67]) / 2;\n orbit[x][60] = (f_60 - 4 * orbit[x][71] - 2 * orbit[x][68] - 2 * orbit[x][67]);\n orbit[x][59] = (f_59 - 6 * orbit[x][70] - 2 * orbit[x][68] - 4 * orbit[x][65]);\n orbit[x][58] = (f_58 - 4 * orbit[x][72] - 2 * orbit[x][71] - 1 * orbit[x][67]);\n orbit[x][57] = (f_57 - 12 * orbit[x][72] - 4 * orbit[x][71] - 3 * orbit[x][70] - 1 * orbit[x][67] - 2 * orbit[x][66]);\n orbit[x][56] = (f_56 - 2 * orbit[x][65]) / 3;\n orbit[x][55] = (f_55 - 2 * orbit[x][71] - 2 * orbit[x][67]) / 3;\n orbit[x][54] = (f_54 - 3 * orbit[x][70] - 1 * orbit[x][66] - 2 * orbit[x][65]) / 2;\n orbit[x][53] = (f_53 - 2 * orbit[x][68] - 2 * orbit[x][64] - 2 * orbit[x][63]);\n orbit[x][52] = (f_52 - 2 * orbit[x][66] - 2 * orbit[x][64] - 1 * orbit[x][59]) / 2;\n orbit[x][51] = (f_51 - 2 * orbit[x][68] - 2 * orbit[x][63] - 4 * orbit[x][62]);\n orbit[x][50] = (f_50 - 1 * orbit[x][68] - 2 * orbit[x][63]) / 3;\n orbit[x][49] = (f_49 - 1 * orbit[x][68] - 1 * orbit[x][64] - 2 * orbit[x][62]) / 2;\n orbit[x][48] = (f_48 - 4 * orbit[x][71] - 8 * orbit[x][69] - 2 * orbit[x][68] - 2 * orbit[x][67] - 2 * orbit[x][64] - 2 * orbit[x][61] - 1 * orbit[x][60]);\n orbit[x][47] = (f_47 - 3 * orbit[x][70] - 2 * orbit[x][68] - 1 * orbit[x][66] - 1 * orbit[x][63] - 1 * orbit[x][60]);\n orbit[x][46] = (f_46 - 3 * orbit[x][70] - 2 * orbit[x][68] - 2 * orbit[x][65] - 1 * orbit[x][63] - 1 * orbit[x][59]);\n orbit[x][45] = (f_45 - 2 * orbit[x][65] - 2 * orbit[x][62] - 3 * orbit[x][56]);\n orbit[x][44] = (f_44 - 1 * orbit[x][67] - 2 * orbit[x][61]) / 4;\n orbit[x][43] = (f_43 - 2 * orbit[x][66] - 1 * orbit[x][60] - 1 * orbit[x][59]) / 2;\n orbit[x][42] = (f_42 - 2 * orbit[x][71] - 4 * orbit[x][69] - 2 * orbit[x][67] - 2 * orbit[x][61] - 3 * orbit[x][55]);\n orbit[x][41] = (f_41 - 2 * orbit[x][71] - 1 * orbit[x][68] - 2 * orbit[x][67] - 1 * orbit[x][60] - 3 * orbit[x][55]);\n orbit[x][40] = (f_40 - 6 * orbit[x][70] - 2 * orbit[x][68] - 2 * orbit[x][66] - 4 * orbit[x][65] - 1 * orbit[x][60] - 1 * orbit[x][59] - 4 * orbit[x][54]);\n orbit[x][39] = (f_39 - 4 * orbit[x][65] - 1 * orbit[x][59] - 6 * orbit[x][56]) / 2;\n orbit[x][38] = (f_38 - 1 * orbit[x][68] - 1 * orbit[x][64] - 2 * orbit[x][63] - 1 * orbit[x][53] - 3 * orbit[x][50]);\n orbit[x][37] = (f_37 - 2 * orbit[x][68] - 2 * orbit[x][64] - 2 * orbit[x][63] - 4 * orbit[x][62] - 1 * orbit[x][53] - 1 * orbit[x][51] - 4 * orbit[x][49]);\n orbit[x][36] = (f_36 - 1 * orbit[x][68] - 2 * orbit[x][63] - 2 * orbit[x][62] - 1 * orbit[x][51] - 3 * orbit[x][50]);\n orbit[x][35] = (f_35 - 1 * orbit[x][59] - 2 * orbit[x][52] - 2 * orbit[x][45]) / 2;\n orbit[x][34] = (f_34 - 1 * orbit[x][59] - 2 * orbit[x][52] - 1 * orbit[x][51]) / 2;\n orbit[x][33] = (f_33 - 1 * orbit[x][67] - 2 * orbit[x][61] - 3 * orbit[x][58] - 4 * orbit[x][44] - 2 * orbit[x][42]) / 2;\n orbit[x][32] = (f_32 - 2 * orbit[x][66] - 1 * orbit[x][60] - 1 * orbit[x][59] - 2 * orbit[x][57] - 2 * orbit[x][43] - 2 * orbit[x][41] - 1 * orbit[x][40]) / 2;\n orbit[x][31] = (f_31 - 2 * orbit[x][65] - 1 * orbit[x][59] - 3 * orbit[x][56] - 1 * orbit[x][43] - 2 * orbit[x][39]);\n orbit[x][30] = (f_30 - 1 * orbit[x][67] - 1 * orbit[x][63] - 2 * orbit[x][61] - 1 * orbit[x][53] - 4 * orbit[x][44]);\n orbit[x][29] = (f_29 - 2 * orbit[x][66] - 2 * orbit[x][64] - 1 * orbit[x][60] - 1 * orbit[x][59] - 1 * orbit[x][53] - 2 * orbit[x][52] - 2 * orbit[x][43]);\n orbit[x][28] = (f_28 - 2 * orbit[x][65] - 2 * orbit[x][62] - 1 * orbit[x][59] - 1 * orbit[x][51] - 1 * orbit[x][43]);\n orbit[x][27] = (f_27 - 1 * orbit[x][59] - 1 * orbit[x][51] - 2 * orbit[x][45]) / 2;\n orbit[x][26] = (f_26 - 2 * orbit[x][67] - 2 * orbit[x][63] - 2 * orbit[x][61] - 6 * orbit[x][58] - 1 * orbit[x][53] - 2 * orbit[x][47] - 2 * orbit[x][42]);\n orbit[x][25] = (f_25 - 2 * orbit[x][66] - 2 * orbit[x][64] - 1 * orbit[x][59] - 2 * orbit[x][57] - 2 * orbit[x][52] - 1 * orbit[x][48] - 1 * orbit[x][40]) / 2;\n orbit[x][24] = (f_24 - 4 * orbit[x][65] - 4 * orbit[x][62] - 1 * orbit[x][59] - 6 * orbit[x][56] - 1 * orbit[x][51] - 2 * orbit[x][45] - 2 * orbit[x][39]);\n orbit[x][23] = (f_23 - 1 * orbit[x][55] - 1 * orbit[x][42] - 2 * orbit[x][33]) / 4;\n orbit[x][22] = (f_22 - 2 * orbit[x][54] - 1 * orbit[x][40] - 1 * orbit[x][39] - 1 * orbit[x][32] - 2 * orbit[x][31]) / 3;\n orbit[x][21] = (f_21 - 3 * orbit[x][55] - 3 * orbit[x][50] - 2 * orbit[x][42] - 2 * orbit[x][38] - 2 * orbit[x][33]);\n orbit[x][20] = (f_20 - 2 * orbit[x][54] - 2 * orbit[x][49] - 1 * orbit[x][40] - 1 * orbit[x][37] - 1 * orbit[x][32]);\n orbit[x][19] = (f_19 - 4 * orbit[x][54] - 4 * orbit[x][49] - 1 * orbit[x][40] - 2 * orbit[x][39] - 1 * orbit[x][37] - 2 * orbit[x][35] - 2 * orbit[x][31]);\n orbit[x][18] = (f_18 - 1 * orbit[x][59] - 1 * orbit[x][51] - 2 * orbit[x][46] - 2 * orbit[x][45] - 2 * orbit[x][36] - 2 * orbit[x][27] - 1 * orbit[x][24]) / 2;\n orbit[x][17] = (f_17 - 1 * orbit[x][60] - 1 * orbit[x][53] - 1 * orbit[x][51] - 1 * orbit[x][48] - 1 * orbit[x][37] - 2 * orbit[x][34] - 2 * orbit[x][30]) / 2;\n orbit[x][16] = (f_16 - 1 * orbit[x][59] - 2 * orbit[x][52] - 1 * orbit[x][51] - 2 * orbit[x][46] - 2 * orbit[x][36] - 2 * orbit[x][34] - 1 * orbit[x][29]);\n orbit[x][15] = (f_15 - 1 * orbit[x][59] - 2 * orbit[x][52] - 1 * orbit[x][51] - 2 * orbit[x][45] - 2 * orbit[x][35] - 2 * orbit[x][34] - 2 * orbit[x][27]);\n }\n\n return orbit;\n }",
"public static int count(int[] arr){\n\t\tint[] remCounts = {0,0,0}; \n\t\tfor(int i=0; i<arr.length; i++)\n\t\t\tremCounts[arr[i]%3]++; \n\t\t\n\t\tint total = 0; \n\t\t/**\n\t\t * Count the group of size 2, two possibilities:\n\t\t * (1) both elements have remainder of 0 \n\t\t * => select 2 values from group 0 \n\t\t * (2) one has remainder of 1, and the other has 2 \n\t\t * => select 1 from group 1 and the other from group 2 \n\t\t */\n\t\ttotal += calcCombinations(remCounts[0], 2); \n\t\ttotal += (remCounts[1] * remCounts[2]); \n\t\t\n\t\t/**\n\t\t * count the group of size 3: \n\t\t * \n\t\t * (1) all of them are from group 0 \n\t\t * (2) all of them are from group 1 \n\t\t * (3) all of them are from group 2 \n\t\t * (4) each of them are from group 0, 1, and 2 respectively\n\t\t */\n\t\ttotal += calcCombinations(remCounts[0], 3);\n\t\ttotal += calcCombinations(remCounts[1], 3);\n\t\ttotal += calcCombinations(remCounts[2], 3);\n\t\ttotal += remCounts[0] * remCounts[1] * remCounts[2];\n\t\t\n\t\treturn total ; \n\t}",
"public int count(){\n\tboolean val = false;\n\tint cont = 0;\n\tfor(int i =0;i<arch.length && !val;i++){\n\t\tif(arch[i]!=null){\n\t\t\tcont++;\n\t\t}\n\t\telse{\n\t\t\tval=true;\n\t\t}\n\t}\n\treturn cont;\n}",
"public static void main(String[] args) {\n int[][] bn = new int[127][];\n \n for(int i = 1; i <128; i++)\n {\n int m = (int) (Math.log10(i)/Math.log10(2));\n \n int l = i, j = 2*m; int[] b = new int[2*m+1]; \n \n while(l >= 1)\n {\n int k = l;\n l = l/2;\n \n b[j] = k - l*2; j--;\n }\n \n bn[i-1] = b;\n }\n \n /*int[] ds = new int[255*255*8];*/ int[] df = new int[14]; Arrays.fill(df, 0);\n //int l = 0;\n \n for(int i = 0; i <127; i++)\n {\n for(int j = 0; j<127; j++)\n {\n int k, d = 0;\n for(k = 0; k < bn[i].length; k++)\n { \n if(bn[i][k] == 0)\n {\n d++;\n }\n else if(d > 0)\n {\n //System.out.print(d+\",\");\n df[d-1]++; d = 0;\n }\n }\n \n for(k = 0; k < bn[j].length; k++)\n {\n if(bn[j][k] == 0)\n {\n d++;\n }\n else if(d > 0)\n {\n //System.out.print(d+\",\");\n df[d-1]++; d = 0;\n }\n }\n \n if(d > 0)\n {\n //System.out.print(d+\",\");\n df[d-1]++; d = 0;\n }\n }\n }\n double sum = sum(df); int[] numb = {1,3,3,5,5,5,5,7,7,7,7,7,7,7,7}; int tb = 0;\n \n for(int i = 0; i < 14; i++)\n {\n tb = tb + (int)((df[i]*100/sum) + 0.5)*numb[i];\n \n System.out.print((int)((df[i]*100/sum) + 0.5)+\",\");\n }\n System.out.println();\n System.out.println(tb);\n }",
"static int beautifulTriplets(int d, int[] arr) {\n int l = arr.length;\n int count = 0;\n for (int i = 0; i < l; i++) {\n int ei = arr[i];\n for (int j = i+1; j < l; j++) {\n int ej = arr[j];\n int diffij = Math.abs(ej-ei);\n if(diffij == d){\n for (int k = j+1; k < l; k++) {\n int ek = arr[k];\n int diffjk = Math.abs(ek-ej);\n if(diffjk == d){\n count++;\n }\n }\n }\n }\n }\n return count;\n\n }",
"static int solution(int[] c) {\n \n int count = 0, i = 0;\n \n while (i < c.length - 1) {\n if (c[i] == 0) {\n if (i + 2 < c.length && c[i + 2] == 0) {\n count++;\n i = i + 2;\n } else if (c[i + 1] == 0) {\n count++;\n i = i + 1;\n }\n }\n }\n return count;\n }",
"public int getHeuristic(){\n\t\tint count = 0;\n\t\tfor (int i = 0; i < getRows(); i++) {\n\t\t\tfor (int j = 0; j < getColumns(); j++) {\n\t\t\t\tif (cells[i][j].getSand() != getK()) \n\t\t\t\t\tcount++;\n\t\t\t}\n\t\t} \n\t\treturn count;\n\t}",
"static long numWays(int index, int m, int n, int[] arr) {\n long count = 0;\n\n\n if (n == 0 || index == (m - 1)) {\n if (index == (m - 1)) {\n arr[index] = n;\n }\n// for (int x : arr) {\n// System.out.print(x + \",\");\n// }\n// System.out.println();\n return 1;\n }\n\n if (n < 0 || index >= m) {\n return 0;\n }\n\n\n String key = index(arr, index, m, n);\n if (dp.containsKey(key)) {\n return dp.get(key);\n }\n\n\n for (int i = 0; i <= n; i++) {\n arr[index] = i;\n count += numWays(index + 1, m, n - i, arr);\n// for (int j = index + 1; j < arr.length; j++) {\n// arr[j] = 0;\n// }\n }\n\n dp.put(key, count % prime);\n return count % prime;\n }",
"public int getNumBitsSet()\n \t{\n \t\tint count = 0;\n \n \t\tfor (int index = getLength() - 1; index >= 0; index--)\n \t\t{\n \t\t\tif (isSet(index))\n \t\t\t{\n \t\t\t\tcount++;\n \t\t\t}\n \t\t}\n \n \t\treturn count;\n \t}",
"int count() {\n\t\tArrayList<Integer> checked = new ArrayList<Integer>();\r\n\t\tint count = 0;\r\n\t\tfor (int x = 0; x < idNode.length; x++) {// Order of N2\r\n\t\t\tint rootX = getRoot(x);\r\n\t\t\tif (!checked.contains(rootX)) {// Order of N Access of Array\r\n\r\n\t\t\t\tSystem.out.println(\"root x is \" + rootX);\r\n\t\t\t\tcount++;\r\n\t\t\t\tchecked.add(rootX);// N Access of Array\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn count;\r\n\t}",
"private long sortAndCount(int[] arr) {\r\n\r\n\t\t// compare permuted array and the actual.\r\n\t\t// count offers O(n log n)\r\n\t\tint n = arr.length;\r\n\t\tif (n == 1) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\r\n\t\tsort(arr);\r\n\t\t\r\n\t\treturn counter;\r\n\t}",
"static int beautifulTriplets(int d, int[] arr) {\n int result = 0;\n\n for (int i = 0; i < arr.length; i++) {\n int prev = arr[i];\n int arrCount = 1;\n\n for (int j = i+1; j < arr.length; j++) {\n if (prev + d == arr[j]) {\n arrCount++;\n prev = arr[j];\n if (arrCount == 3) {\n result++;\n break;\n }\n }\n }\n }\n\n return result;\n }",
"static int bitLengthForInt(int n) {\n return 32 - Integer.numberOfLeadingZeros(n);\n }",
"int getBlockNumbersCount();",
"private static int findCollision(int[][] matrix, int n) {\n int count = 0;\n for (int i = 0; i <= n - 1; i++) {\n for (int j = 0; j <= n - 1; j++) {\n if (matrix[i][j] == 1) {\n // left row\n for (int k = j - 1; k >= 0; k--) {\n if (matrix[i][k] == 2) {\n break;\n }\n if (matrix[i][k] == 1) {\n count++;\n }\n }\n // right row\n for (int k = j + 1; k <= n - 1; k++) {\n if (matrix[i][k] == 2) {\n break;\n }\n if (matrix[i][k] == 1) {\n count++;\n }\n }\n // up col\n for (int k = i - 1; k >= 0; k--) {\n if (matrix[k][j] == 2) {\n break;\n }\n if (matrix[k][j] == 1) {\n count++;\n }\n }\n // down col\n for (int k = i + 1; k <= n - 1; k++) {\n if (matrix[k][j] == 2) {\n break;\n }\n if (matrix[k][j] == 1) {\n count++;\n }\n }\n // up left\n for (int k = i - 1, l = j - 1; k >= 0 && l >= 0; k--, l--) {\n if (matrix[k][l] == 2) {\n break;\n }\n if (matrix[k][l] == 1) {\n count++;\n }\n }\n // down left\n for (int k = i + 1, l = j - 1; k <= n - 1 && l >= 0; k++, l--) {\n if (matrix[k][l] == 2) {\n break;\n }\n if (matrix[k][l] == 1) {\n count++;\n }\n }\n // up right\n for (int k = i - 1, l = j + 1; k >= 0 && l <= n - 1; k--, l++) {\n if (matrix[k][l] == 2) {\n break;\n }\n if (matrix[k][l] == 1) {\n count++;\n }\n }\n // down right\n for (int k = i + 1, l = j + 1; k <= n - 1 && l <= n - 1; k++, l++) {\n if (matrix[k][l] == 2) {\n break;\n }\n if (matrix[k][l] == 1) {\n count++;\n }\n }\n }\n }\n }\n return count / 2;\n }",
"public static void findDups(int[] arr)\n {\n BitSet bs = new BitSet(32000);\n for(int i=0; i < bs.length(); i++)\n System.out.print(bs.get(i));\n\n for(int i = 0; i < arr.length; i++)\n {\n int num0 = arr[i] - 1;\n if(bs.get(num0))\n System.out.print(arr[i]);\n else\n bs.set(num0);\n }\n }",
"static int sockMerchant(int n, int[] ar) {\n int count = 0;\n for (int i = 0; i < ar.length; i++) {\n if (ar[i] == 0) {\n continue;\n }\n for (int j = i + 1; j < ar.length; j++) {\n if (ar[j] == 0) {\n continue;\n }\n if (ar[i] == ar[j]) {\n ar[i] = 0;\n ar[j] = 0;\n count++;\n }\n }\n }\n return count;\n }",
"public static int sizeBits_counter() {\n return 32;\n }",
"private int d(@Nullable K ☃) {\r\n/* 127 */ return (xq.f(System.identityHashCode(☃)) & Integer.MAX_VALUE) % this.b.length;\r\n/* */ }\r\n/* */ private int b(@Nullable K ☃, int i) {\r\n/* */ int j;\r\n/* 131 */ for (j = i; j < this.b.length; j++) {\r\n/* 132 */ if (this.b[j] == ☃) {\r\n/* 133 */ return j;\r\n/* */ }\r\n/* 135 */ if (this.b[j] == a) {\r\n/* 136 */ return -1;\r\n/* */ }\r\n/* */ }",
"public int reversePairs4(int[] nums) {\n int count = 0;\n Map<Long, Integer> bit = new HashMap<>();\n final long shift = 1L << 32;\n final long max = shift << 1;\n for (int i = nums.length - 1; i >= 0; i--) {\n for (long j = nums[i] - 1 + shift; j > 0; j -= (j & -j)) {\n count += bit.getOrDefault(j, 0);\n }\n for (long j = (long)nums[i] * 2 + shift; j < max; j += (j & -j)) {\n bit.put(j, bit.getOrDefault(j, 0) + 1);\n }\n }\n return count;\n }",
"int countPairs(int[] X, int[] Y, int m, int n){\n int out = 0;\n\n // System.out.println(Arrays.toString(X));\n // System.out.println(Arrays.toString(Y));\n // System.out.println(m);\n // System.out.println(n);\n\n\n \n\n int[] NoOfY = new int[m+n]; \n\n for (int i = 0; i < n; i++){\n if (Y[i] < 5){\n NoOfY[Y[i]]++; \n } \n }\n\n Arrays.sort(Y);\n\n // Take every element of X and count pairs with it \n for (int i=0; i<m; i++) {\n out += count(X[i], Y, n, NoOfY); \n }\n\n\n\n return out;\n }",
"public static int intersectArrayIntoBitmap(long[] bitmap, CharBuffer array, int length) {\n int lastWordIndex = 0;\n int wordIndex = 0;\n long word = 0L;\n int cardinality = 0;\n for (int i = 0; i < length; ++i) {\n wordIndex = array.get(i) >>> 6;\n if (wordIndex != lastWordIndex) {\n bitmap[lastWordIndex] &= word;\n cardinality += Long.bitCount(bitmap[lastWordIndex]);\n word = 0L;\n Arrays.fill(bitmap, lastWordIndex + 1, wordIndex, 0L);\n lastWordIndex = wordIndex;\n }\n word |= 1L << array.get(i);\n }\n if (word != 0L) {\n bitmap[wordIndex] &= word;\n cardinality += Long.bitCount(bitmap[lastWordIndex]);\n }\n if (wordIndex < bitmap.length) {\n Arrays.fill(bitmap, wordIndex + 1, bitmap.length, 0L);\n }\n return cardinality;\n }",
"public int count(int n, int k)\n {\n\n long MOD = 1000000007;\n long res;\n\n res = (long)Math.pow(k, n);\n Map<Integer, Integer> divisor = new HashMap<>();\n\n long count = 0;\n for(int i = 2; i <= k; i++) {\n if(!(i % 2 == 0 && divisor.containsKey(i / 2))) {\n int div = divisorCount(i);\n divisor.put(i, div);\n count += div - 1;\n }\n else{\n int log2 = 31 - Integer.numberOfLeadingZeros(i);\n int div;\n if(Math.pow(2, log2) == i){\n div = divisor.get(i / 2) + 1;\n\n }\n else\n div = divisor.get(i / 2) * 2;\n\n divisor.put(i, div);\n count += div - 1;\n\n }\n\n }\n\n res -= (n - 1) * Math.pow(k, n - 2) * count;\n return (int)(res % MOD);\n }",
"public void countCollisions() {\n int col2 = 0;\n int col3 = 0;\n int col4 = 0;\n int col5OrMore = 0;\n \n for (int x = 0; x < buckets.length; x++) {\n SList chain = (SList) buckets[x];\n if (chain.length() == 2) {\n col2++;\n }\n if (chain.length() == 3) {\n col3++;\n }\n if (chain.length() == 4) {\n col4++;\n }\n if (chain.length() >= 5) {\n col5OrMore++;\n }\n }\n System.out.println(\"=========HASHTABLE================\");\n System.out.println(\"# of entries: \" + size);\n System.out.println(\"Number of single collisions: \"+col2);\n System.out.println(\"Number of double collisions: \"+col3);\n System.out.println(\"Number of triple collisions: \"+col4);\n System.out.println(\"Number of 5 or more collisions: \"+col5OrMore);\n }",
"static public int solution(int[] A) {\n HashSet <Integer> newDistList = new HashSet<Integer>();\n for (int s = 0; s<A.length; s++){\n newDistList.add(A[s]);\n }\n return newDistList.size();\n }",
"public int countOnes(int[] a) {\n int tot = 0;\n for (int i=0; i<a.length; i++) {\n tot += a[i];\n }\n return tot;\n }",
"public static int sizeBits_sum_a() {\n return 32;\n }",
"BigInteger getCount();",
"public int countClumps(int[] arr)\n\t{\n\t\tif(arr.length==0)\n\t\t\tthrow new AssertionError(\"Array is Empty\");\n\t\tint clumps=0;\n\t\tfor(int i=0;i<arr.length-1;i++){\n\t\t\tint flag=0;\n\t\t\twhile(i<arr.length-1 && arr[i]==arr[i+1]){\n\t\t\t\tflag=1;\n\t\t\t\ti++;\n\t\t\t}\n\t\t\tif(flag==1)\n\t\t\t\tclumps++;\n\t\t}\n\t\treturn clumps;\n\t}"
] | [
"0.7352295",
"0.7000838",
"0.6812607",
"0.67206466",
"0.66597795",
"0.6628123",
"0.660448",
"0.6579854",
"0.6545326",
"0.652761",
"0.628459",
"0.6245521",
"0.62314326",
"0.62306064",
"0.62289673",
"0.6188799",
"0.6168517",
"0.614092",
"0.61020344",
"0.6086361",
"0.605165",
"0.603577",
"0.60349095",
"0.6007923",
"0.5972752",
"0.5959668",
"0.594737",
"0.5942275",
"0.59374815",
"0.5935044",
"0.59060556",
"0.5899276",
"0.5892998",
"0.58924115",
"0.5883154",
"0.58465797",
"0.58427453",
"0.58344716",
"0.5818021",
"0.58132815",
"0.57855123",
"0.5773088",
"0.57703364",
"0.57697845",
"0.5762069",
"0.57336366",
"0.57299846",
"0.57167006",
"0.57141244",
"0.56990796",
"0.56851214",
"0.56725913",
"0.56544703",
"0.5648746",
"0.5645311",
"0.5641378",
"0.56332576",
"0.562808",
"0.5624011",
"0.5599922",
"0.55990875",
"0.5597225",
"0.5586166",
"0.55778265",
"0.55643815",
"0.55639195",
"0.5563421",
"0.55602115",
"0.555837",
"0.5549452",
"0.5546814",
"0.55448544",
"0.55366987",
"0.552488",
"0.5521688",
"0.5519375",
"0.55153203",
"0.5502515",
"0.5500076",
"0.54959744",
"0.54934967",
"0.54859674",
"0.5483245",
"0.54802537",
"0.54742277",
"0.5469105",
"0.54675657",
"0.54672855",
"0.54650325",
"0.54620165",
"0.545982",
"0.54589486",
"0.5454533",
"0.54524744",
"0.5438953",
"0.5435696",
"0.54344755",
"0.5434451",
"0.54316664",
"0.54304105"
] | 0.7471814 | 0 |
Created by ANKUR on 20072016. | public interface Updater
{
public void updateDate(InfoOfMessage[] message, InfoOfFriends[] friends, InfoOfFriends[] unApprovedFriends, String userKey);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"public final void mo51373a() {\n }",
"@Override\n public void perish() {\n \n }",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"private stendhal() {\n\t}",
"protected boolean func_70814_o() { return true; }",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tprotected void getExras() {\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\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"private void m50366E() {\n }",
"@Override\n public void init() {\n\n }",
"private void init() {\n\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tpublic void anular() {\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 sacrifier() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"private void kk12() {\n\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\n protected void init() {\n }",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"private static void cajas() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"private void poetries() {\n\n\t}",
"@Override\n public void init() {\n }",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public int describeContents() { return 0; }",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"@Override\n\tpublic void init()\n\t{\n\n\t}",
"@Override\n protected void getExras() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n public void init() {\n\n }",
"@Override\n public void init() {\n\n }",
"@Override\n public void init() {}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t}",
"@Override\n void init() {\n }",
"public void mo12628c() {\n }",
"private Rekenhulp()\n\t{\n\t}",
"@Override\n\t\tpublic void init() {\n\t\t}",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"public void mo6081a() {\n }",
"@Override\n\tpublic void nghe() {\n\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\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"public void m23075a() {\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"private void init() {\n\n\n\n }",
"protected void mo6255a() {\n }",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\r\n\tpublic final void init() {\r\n\r\n\t}",
"protected boolean func_70041_e_() { return false; }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"public void skystonePos4() {\n }",
"private void initialize() {\n\t\t\n\t}",
"protected MetadataUGWD() {/* intentionally empty block */}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}"
] | [
"0.59966314",
"0.59965855",
"0.5981421",
"0.58925474",
"0.58759946",
"0.5839179",
"0.5822678",
"0.58113015",
"0.58113015",
"0.5807731",
"0.5794981",
"0.57880265",
"0.57880265",
"0.57880265",
"0.57880265",
"0.57880265",
"0.57597804",
"0.5756298",
"0.5744667",
"0.57271975",
"0.57177913",
"0.5715429",
"0.57039243",
"0.56734246",
"0.56695163",
"0.5661023",
"0.566058",
"0.56520456",
"0.56520456",
"0.56519103",
"0.56496954",
"0.56496954",
"0.56496954",
"0.56437904",
"0.56351286",
"0.5632319",
"0.5625713",
"0.5625713",
"0.5625713",
"0.56225055",
"0.56180656",
"0.5617393",
"0.5617393",
"0.5617393",
"0.5606904",
"0.5600391",
"0.559996",
"0.5597143",
"0.55894476",
"0.558887",
"0.5586828",
"0.5582421",
"0.5573409",
"0.55712616",
"0.55621177",
"0.55525416",
"0.55524004",
"0.5548904",
"0.5548904",
"0.5548904",
"0.5548904",
"0.5548904",
"0.5548904",
"0.5548904",
"0.5548114",
"0.5548114",
"0.5541938",
"0.55356276",
"0.5530606",
"0.5530118",
"0.55285877",
"0.5505011",
"0.55001116",
"0.54896593",
"0.54896593",
"0.54896593",
"0.54896593",
"0.54896593",
"0.54896593",
"0.54860115",
"0.54807526",
"0.54728544",
"0.5468458",
"0.5466473",
"0.5456096",
"0.54548675",
"0.54548675",
"0.54542977",
"0.5450439",
"0.5447948",
"0.54448235",
"0.5441865",
"0.5438855",
"0.54360175",
"0.5425198",
"0.5422082",
"0.5421962",
"0.541705",
"0.5414669",
"0.54089975",
"0.5406221"
] | 0.0 | -1 |
Instantiate and add the three components. | private void init() {
setDefaultCloseOperation(EXIT_ON_CLOSE);
controlPanel = new ControlPanel(this);
canvas = new DrawingPanel(this);
shapeController = ShapeController.getInstance();
shapeController.setFactory(new RegularPolygonShapeFactory(6, 50));
optionsPanel = new RegularPolygonOptionsPanel(this, 6, 50);
toolPanel = new ToolPanel(this);
add(optionsPanel, BorderLayout.NORTH);
add(canvas, BorderLayout.CENTER);
add(controlPanel, BorderLayout.SOUTH);
add(toolPanel, BorderLayout.EAST);
pack();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void createComponents() {\n\n add(createSetDataPanel(), BorderLayout.NORTH);\n add(createResourcesListAndButtonsPanel(), BorderLayout.CENTER);\n }",
"private void addComponents() {\n\t\tadd(newGame);\n\t\tadd(nameLabel);\n\t\tadd(nameField);\n\t\tadd(addPlayer);\n\t\tadd(gameTextPane);\n\t\tadd(playGame);\t\n\t\tadd(takeTurn);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//v0.1.1 change\n\t}",
"void addComponents();",
"private void creatingElements() {\n\t\ttf1 = new JTextField(20);\n\t\ttf2 = new JTextField(20);\n\t\ttf3 = new JTextField(20);\n\t\tJButton btn = new JButton(\"Add\");\n\t\tbtn.addActionListener(control);\n\t\tbtn.setActionCommand(\"add\");\n\t\t\n\t\tJPanel panel = new JPanel();\n\t\tpanel.add(tf1);\n\t\tpanel.add(tf2);\n\t\tpanel.add(btn);\n\t\tpanel.add(tf3);\n\t\t\n\t\tthis.add(panel);\n\t\t\n\t\tthis.validate();\n\t\tthis.repaint();\t\t\n\t\t\n\t}",
"void instantiateComponents();",
"private void addComponents() {\n //this.getContentPane().add(new ViewDeckComputer(), BorderLayout.NORTH);\n createTopPanel();\n createCentralPanel();\n createBottomPanel();\n }",
"private void createComponents() {\n\t\tbuttons = new Button[9];\r\n\t\tfor (int i = 0; i < 9; i++) {\r\n\t\t\tbuttons[i] = new Button();\r\n\t\t}\r\n\r\n\t\t// Initialize components\r\n\t\tplayAgainButton = new Button(\"Play Again\");\r\n\t\tquitButton = new Button(\"Quit\");\r\n\r\n\t\t// Initialize layouts\r\n\t\tgameButtonGrid = new GridPane();\r\n\t\tgameButtonGrid.setStyle(\"-fx-background-color:Aquamarine;\");\r\n\t\tbottomButtonsHBox = new HBox();\r\n\t\tbottomButtonsHBox.setStyle(\"-fx-background-color:LightSlateGray;\");\r\n\t\tsceneVBox = new VBox();\r\n\t\t\r\n\t\t//Game components\r\n\t\tgameInfo = new GameInfo();\r\n\t}",
"private void instanciarComponentes() {\n\t\t\n\t\tpainelTopo = new JPanel(new FlowLayout());\n\t\tpainelTopo.setBackground(Color.LIGHT_GRAY);\n\t\tlbInicial = new JLabel(\"De: \");\n\t\tlbFinal = new JLabel(\"Até: \");\n\t\tlabelTabuadoDo = new JLabel(\"Tabuada do: \");\n\t\ttxtInicial = new JTextField(10);\n\t\ttxtFinal = new JTextField(10);\n\t\ttxtNumero = new JTextField(10);\n\t\tbuttonCalcular = new JButton(\"Calcular\");\n\t\tpainelCentro = new JPanel(new FlowLayout());\n\t}",
"private void createdComponent() {\r\n\r\n\t\tloadImage();\r\n\t\tresizeImage();\r\n\t\ttry {\r\n\t\t\tif (customFont == null) {\r\n\t\t\t\tcustomFont = FontLoader.getInstance().getXenipa();\r\n\t\t\t\tif (customFont == null) {\r\n\t\t\t\t\tcustomFont = new FontLoader().importFont();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (FontFormatException e1) {\r\n\t\t\te1.printStackTrace();\r\n\t\t} catch (IOException e1) {\r\n\t\t\te1.printStackTrace();\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\tUIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (InstantiationException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IllegalAccessException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (UnsupportedLookAndFeelException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tthis.init();\r\n\t\tthis.createpanel1();\r\n\t\tthis.createpanel2();\r\n\t\tthis.createpanel3();\r\n\t\tthis.createpanel4();\r\n\t\tthis.revalidate();\r\n\t}",
"@SuppressWarnings(\"unchecked\")\n private void create() {\n components.clear();\n\n if (content != null) {\n content.clearChildren();\n }\n else {\n content = new Container();\n content.setInsets(INSETS);\n }\n\n GuiComponent guiComponent = (GuiComponent) getReflectedItem().getValue();\n\n // let the user choose which type of backgroundComponent they want.\n Label label = content.addChild(new Label(\"Type\"), 0, 0);\n label.setTextHAlignment(HAlignment.Right);\n label.setInsets(INSETS);\n Container backgroundTypeContainer = content.addChild(new Container(), 0, 1);\n\n ColorRGBA oldColor = BackgroundUtils.getBackgroundColor(guiComponent);\n\n Button colorOnlyBgButton = backgroundTypeContainer.addChild(new Button(\"Color Only\"), 0, 0);\n colorOnlyBgButton.addClickCommands(source -> {\n if (!(guiComponent instanceof QuadBackgroundComponent)) {\n setValue(new QuadBackgroundComponent(oldColor));\n create();\n }\n });\n\n Button colorAndImageBgButton = backgroundTypeContainer.addChild(new Button(\"Color and Image\"), 0, 1);\n colorAndImageBgButton.addClickCommands(source -> {\n if (!(guiComponent instanceof TbtQuadBackgroundComponent)) {\n setValue(BackgroundComponents.gradient(oldColor));\n create();\n }\n });\n\n if (guiComponent instanceof QuadBackgroundComponent) {\n\n try {\n\n Method getter = QuadBackgroundComponent.class.getDeclaredMethod(\"getColor\");\n Method setter = QuadBackgroundComponent.class.getDeclaredMethod(\"setColor\", ColorRGBA.class);\n\n label = content.addChild(new Label(\"Color\"), 1, 0);\n label.setTextHAlignment(HAlignment.Right);\n label.setInsets(INSETS);\n\n ColorRGBAComponent bgColorComponent = new ColorRGBAComponent(guiComponent, getter, setter);\n content.addChild(bgColorComponent.getPanel(), 1, 1);\n components.add(bgColorComponent);\n\n // margin\n getter = QuadBackgroundComponent.class.getDeclaredMethod(\"getMargin\");\n setter = QuadBackgroundComponent.class.getDeclaredMethod(\"setMargin\", Vector2f.class);\n\n label = content.addChild(new Label(\"Margin\"), 2, 0);\n Vector2fComponent marginComponent = new Vector2fComponent(guiComponent, getter, setter);\n content.addChild(marginComponent.getPanel(), 2, 1);\n components.add(marginComponent);\n\n } catch (NoSuchMethodException e) {\n e.printStackTrace();\n }\n\n }\n else if (guiComponent instanceof TbtQuadBackgroundComponent) {\n\n TbtQuadBackgroundComponent backgroundComponent = (TbtQuadBackgroundComponent) guiComponent;\n\n try {\n Method getter = TbtQuadBackgroundComponent.class.getDeclaredMethod(\"getColor\");\n Method setter = TbtQuadBackgroundComponent.class.getDeclaredMethod(\"setColor\", ColorRGBA.class);\n\n label = content.addChild(new Label(\"Color\"), 1, 0);\n label.setTextHAlignment(HAlignment.Right);\n label.setInsets(INSETS);\n\n ColorRGBAComponent bgColorComponent = new ColorRGBAComponent(guiComponent, getter, setter);\n content.addChild(bgColorComponent.getPanel(), 1, 1);\n components.add(bgColorComponent);\n\n label = content.addChild(new Label(\"Image\"), 2, 0);\n label.setTextHAlignment(HAlignment.Right);\n label.setInsets(INSETS);\n\n Button browseImageButton = content.addChild(new Button(\"Select Background Image...\"), 2, 1);\n browseImageButton.setTextVAlignment(VAlignment.Center);\n browseImageButton.addClickCommands(source -> {\n\n JFileChooser jfc = new JFileChooser(FileSystemView.getFileSystemView().getHomeDirectory());\n jfc.setDialogTitle(\"Select a Background Image...\");\n jfc.setMultiSelectionEnabled(false);\n jfc.setFileSelectionMode(JFileChooser.FILES_ONLY);\n jfc.setAcceptAllFileFilterUsed(false);\n FileNameExtensionFilter filter = new FileNameExtensionFilter(\"PNG Images\", \"png\");\n jfc.addChoosableFileFilter(filter);\n int returnValue = jfc.showOpenDialog(null);\n\n if (returnValue == JFileChooser.APPROVE_OPTION) {\n\n File file = jfc.getSelectedFile();\n\n\n try {\n\n byte[] imageData = Files.readAllBytes(file.toPath());\n byte[] stringData = Base64.getEncoder().encode(imageData);\n\n String imageString = new String(stringData);\n\n // PanelBackground panelBackground = (PanelBackground) getReflectedProperty().getValue();\n // panelBackground.setBase64Image(imageString);\n\n Texture texture = new TextureUtils().fromBase64(imageString);\n\n backgroundComponent.setTexture(texture);\n\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n });\n\n // margin\n getter = TbtQuadBackgroundComponent.class.getDeclaredMethod(\"getMargin\");\n setter = TbtQuadBackgroundComponent.class.getDeclaredMethod(\"setMargin\", Vector2f.class);\n\n label = content.addChild(new Label(\"Margin\"), 3, 0);\n Vector2fComponent marginComponent = new Vector2fComponent(guiComponent, getter, setter);\n content.addChild(marginComponent.getPanel(), 3, 1);\n components.add(marginComponent);\n\n\n } catch (NoSuchMethodException e) {\n e.printStackTrace();\n }\n\n }\n\n//\n// this.content = new RollupPanel(\"\", contentContainer, null);\n// this.content.setOpen(false);\n//\n// // background Image\n// Container bgImageContainer = contentContainer.addChild(new Container(new SpringGridLayout(Axis.Y, Axis.X, FillMode.Last, FillMode.Last)), 0, 0);\n// Label bgImageLabel = bgImageContainer.addChild(new Label(\"Background Image\"), 0, 0);\n// bgImageLabel.setTextVAlignment(VAlignment.Center);\n// bgImageLabel.setInsets(new Insets3f(0.0F, 2.0F, 0.0F, 5.0F));\n// Button browseImageButton = bgImageContainer.addChild(new Button(\"Browse...\"), 0, 1);\n// Button removeImageButton = bgImageContainer.addChild(new Button(\"Remove\"), 0, 2);\n// bgImageContainer.addChild(new Container(), 0, 3);\n//\n// browseImageButton.addClickCommands(source -> {\n//\n// JFileChooser jfc = new JFileChooser(FileSystemView.getFileSystemView().getHomeDirectory());\n// jfc.setDialogTitle(\"Select a Background Image...\");\n// jfc.setMultiSelectionEnabled(false);\n// jfc.setFileSelectionMode(JFileChooser.FILES_ONLY);\n// jfc.setAcceptAllFileFilterUsed(false);\n// FileNameExtensionFilter filter = new FileNameExtensionFilter(\"PNG Images\", \"png\");\n// jfc.addChoosableFileFilter(filter);\n// int returnValue = jfc.showOpenDialog(null);\n//\n// if (returnValue == JFileChooser.APPROVE_OPTION) {\n//\n// File file = jfc.getSelectedFile();\n//\n// try {\n// byte[] imageData = Files.readAllBytes(file.toPath());\n// byte[] stringData = Base64.getEncoder().encode(imageData);\n//\n// String imageString = new String(stringData);\n//\n// PanelBackground panelBackground = (PanelBackground) getReflectedProperty().getValue();\n// panelBackground.setBase64Image(imageString);\n//\n// } catch (IOException e) {\n// e.printStackTrace();\n// }\n// }\n//\n// });\n//\n// removeImageButton.addClickCommands(source -> {\n// PanelBackground panelBackground = (PanelBackground) getReflectedProperty().getValue();\n// panelBackground.setBase64Image(\"\");\n// });\n//\n//\n// try {\n//\n// // color\n// Method get = PanelBackground.class.getMethod(\"getColor\");\n// Method set = PanelBackground.class.getMethod(\"setColor\", ColorRGBA.class);\n//\n// ColorRGBAComponent bgColorComponent = new ColorRGBAComponent(getReflectedProperty().getValue(), get, set);\n// bgColorComponent.setPropertyName(\"Color\");\n// contentContainer.addChild(bgColorComponent.getPanel());\n// components.add(bgColorComponent);\n//\n// // insetTop\n// get = PanelBackground.class.getMethod(\"getInsetTop\");\n// set = PanelBackground.class.getMethod(\"setInsetTop\", int.class);\n//\n// IntComponent insetTopComponent = new IntComponent(getReflectedProperty().getValue(), get, set);\n// insetTopComponent.setPropertyName(\"Inset Top\");\n// contentContainer.addChild(insetTopComponent.getPanel());\n// components.add(insetTopComponent);\n//\n// // insetLeft\n// get = PanelBackground.class.getMethod(\"getInsetLeft\");\n// set = PanelBackground.class.getMethod(\"setInsetLeft\", int.class);\n//\n// IntComponent insetLeftComponent = new IntComponent(getReflectedProperty().getValue(), get, set);\n// insetLeftComponent.setPropertyName(\"Inset Left\");\n// contentContainer.addChild(insetLeftComponent.getPanel());\n// components.add(insetLeftComponent);\n//\n// // insetBottom\n// get = PanelBackground.class.getMethod(\"getInsetBottom\");\n// set = PanelBackground.class.getMethod(\"setInsetBottom\", int.class);\n//\n// IntComponent insetBottomComponent = new IntComponent(getReflectedProperty().getValue(), get, set);\n// insetBottomComponent.setPropertyName(\"Inset Bottom\");\n// contentContainer.addChild(insetBottomComponent.getPanel());\n// components.add(insetBottomComponent);\n//\n// // insetRight\n// get = PanelBackground.class.getMethod(\"getInsetRight\");\n// set = PanelBackground.class.getMethod(\"setInsetRight\", int.class);\n//\n// IntComponent insetRightComponent = new IntComponent(getReflectedProperty().getValue(), get, set);\n// insetRightComponent.setPropertyName(\"Inset Right\");\n// contentContainer.addChild(insetRightComponent.getPanel());\n// components.add(insetRightComponent);\n//\n// // zOffset\n// get = PanelBackground.class.getMethod(\"getzOffset\");\n// set = PanelBackground.class.getMethod(\"setzOffset\", float.class);\n//\n// FloatComponent zOffsetComponent = new FloatComponent(getReflectedProperty().getValue(), get, set);\n// zOffsetComponent.setPropertyName(\"Z-Offset\");\n// contentContainer.addChild(zOffsetComponent.getPanel());\n// components.add(zOffsetComponent);\n//\n// } catch (NoSuchMethodException e) {\n// e.printStackTrace();\n// }\n\n\n }",
"private void createComponents() {\n view = new JPanel(new GridBagLayout());\n\n GridBagConstraints constraints = new GridBagConstraints();\n constraints.gridx = 0;\n constraints.gridy = 0;\n constraints.weightx = 1;\n constraints.weighty = 1;\n constraints.fill = GridBagConstraints.BOTH;\n\n view.add(new JPanel(), constraints);\n\n constraints.gridy = 1;\n view.add(new JPanel(), constraints);\n\n constraints.gridx = 1;\n constraints.weighty = 4;\n constraints.weightx = 6;\n view.add(renderMain(), constraints);\n\n constraints.gridx = 2;\n constraints.weightx = 1;\n constraints.weighty = 1;\n view.add(new JPanel(), constraints);\n\n constraints.gridx = 0;\n constraints.gridy = 2;\n view.add(renderBottom(), constraints);\n\n registerEvents();\n }",
"private void criarComponentes() {\n\n add(criarPainelNorte(), BorderLayout.NORTH);\n add(criarPainelCentro(), BorderLayout.CENTER);\n add(criarPainelSul(), BorderLayout.SOUTH);\n }",
"private void addComponents() {\n gbc.anchor = GridBagConstraints.EAST;\n addComponent(lblName, 0, 0, 1);\n addComponent(lblDay, 0, 1, 1);\n addComponent(lblMonth, 0, 2, 1);\n addComponent(lblTime, 0, 5, 1);\n addComponent(lblDuration, 0, 6, 1);\n gbc.anchor = GridBagConstraints.WEST;\n addComponent(txtName, 1, 0, 1);\n addComponent(cmbDay, 1, 1, 1);\n addComponent(cmbMonth, 1, 2, 1);\n addComponent(radSelectTime, 1, 3, 1);\n addComponent(radAutoTime, 1, 4, 1);\n addComponent(cmbTime, 1, 5, 1);\n addComponent(cmbDuration, 1, 6, 1);\n gbc.anchor = GridBagConstraints.CENTER;\n addComponent(btnSubmit, 0, 7, 2);\n }",
"public void addComponents(){\n add(spelerIDLabel);\n add(typeLabel);\n add(codeLabel);\n add(heeftBetaaldLabel);\n\n add(spelerIDField);\n add(typeField);\n add(codeField);\n add(heeftBetaaldField);\n\n add(klaarButton);\n add(terugButton);\n\n }",
"private void addComponents() {\n\t\t\n\t\t// prima riga di lettere\n\t\tfor (int i = 0; i < 10; i++)\n\t\t\tadd(letterLabel(i));\n\t\t\t\n\t\t/* la scacchiera ha l'oringine 0,0 in basso a sinistra\n\t\t * mentre la griglia si riempie di elementi dall'alto\n\t\t * percio' il for delle x (j) cresce mentre popoliamo le celle (bottoni)\n\t\t * mentre il for delle y (i) decresce man mano che passiamo di riga in riga */\n\t\tfor (int i = 7; i >= 0; i--)\n\t\t\tfor (int j = 0; j < 10; j++) {\n\t\t\t\tif (j == 0 || j == 9)\n\t\t\t\t\tadd(numberLabel(i + 1));\n\t\t\t\telse\n\t\t\t\t\tadd(buttons[j - 1][i]);\n\t\t\t}\n\t\t\n\t\t// ultima riga (uguale alla prima)\n\t\tfor (int i = 0; i < 10; i++)\n\t\t\tadd(letterLabel(i));\n\t}",
"private void addComponents() {\r\n\t\t// initialize properties and add.\r\n\t\tthis.add(initializeChatArea(), BorderLayout.CENTER);\r\n\t\tthis.add(initializeSubPanel(), BorderLayout.SOUTH);\r\n\t}",
"protected void addComponents() {\n JPanel contentPanel = new JPanel();\n contentPanel.setLayout(new GridBagLayout());\n GridBagConstraints c = new GridBagConstraints();\n c.insets = new Insets(5, 5, 5, 5);\n\n addFront(contentPanel, c);\n addBack(contentPanel, c);\n addTag(contentPanel, c);\n\n addButtons(contentPanel, c);\n\n add(contentPanel);\n }",
"protected void createComponents() {\n sampleText = new JTextField(20);\n displayArea = new JLabel(\"\");\n displayArea.setPreferredSize(new Dimension(200, 75));\n displayArea.setMinimumSize(new Dimension(200, 75));\n }",
"public void addComponents()\r\n\t{\n\t\tSteveTechFarming.fruit = new BlockFruit(SteveTechFarming.config.getBlockID(1202, \"Fruit\", null)).setBlockName(\"WiduX-SteveTech-Farm-Fruit\");\r\n\t\tSteveTechFarming.crops = new BlockCrops(SteveTechFarming.config.getBlockID(1203, \"Crops\", null)).setBlockName(\"WiduX-SteveTech-Farm-Crops\");\r\n\t\t\r\n\t\tSteveTechFarming.seeds = new ItemSeeds(SteveTechFarming.config.getItemID(11000, \"Seeds\", null)).setItemName(\"WiduX-SteveTech-Farm-Seeds\");\r\n\t\tSteveTechFarming.harvestedItems = new ItemHarvest(SteveTechFarming.config.getItemID(11002, \"Harvest\", null)).setItemName(\"WiduX-SteveTech-Farm-Harvest\");\r\n\t\tSteveTechFarming.creativeTools = new ItemCreativeTools(SteveTechFarming.config.getItemID(11001, \"Creative Tools\", null)).setItemName(\"WiduX-SteveTech-Farm-CTools\");\r\n\t\tSteveTechFarming.foods = new Item[EnumFood.getNumberFoods()];\r\n\t\tint firstFoodItemID = SteveTechFarming.config.getItemID(11003, \"Foods Array\", \"This is the first item ID in the list of foods. Item IDs used will start here, and use the next \" + EnumFood.getNumberFoods() + \" IDs. Make sure they are all available.\");\r\n\t\tfor(int idOffset = 0; idOffset < SteveTechFarming.foods.length; idOffset++)\r\n\t\t{\r\n\t\t\tEnumFood food = EnumFood.getFood(idOffset);\r\n\t\t\tSteveTechFarming.foods[idOffset] = new ItemSTFood(firstFoodItemID + idOffset, food).setItemName(\"WiduX-SteveTech-Farm-Foods-Food\" + idOffset);\r\n\t\t}\r\n\t}",
"private void construct(){\n TriangleMesh mesh;\n\n mesh = ObjImporter.loadMesh(\"data/aufgabe3/bunny.obj\");\n mesh.setMaterial(new MaterialNode(0.1f, 0.1f, .5f, 1));\n mesh.getRenderer().setShadingType(ShadingType.GOURAUD);\n scene.addNode(mesh);\n\n mesh = ObjImporter.loadMesh(\"data/aufgabe3/cube.obj\");\n mesh.addTransformation(new TransformationNode(TransformationType.TRANSLATE, 1, 0, 0));\n scene.addNode(mesh);\n\n mesh = ObjImporter.loadMesh(\"data/aufgabe3/teddy.obj\");\n mesh.addTransformation(new TransformationNode(TransformationType.TRANSLATE, 0, 1, 0));\n mesh.setMaterial(new MaterialNode(0.1f, .5f, 0.1f, 1));\n mesh.getRenderer().setShadingType(ShadingType.GOURAUD);\n scene.addNode(mesh);\n\n mesh = ObjImporter.loadMesh(\"data/aufgabe3/sphere.obj\");\n mesh.addTransformation(new TransformationNode(TransformationType.TRANSLATE, 1, 1, 0));\n mesh.setMaterial(new MaterialNode(1, 0, 0, 1));\n mesh.getRenderer().setShadingType(ShadingType.GOURAUD);\n scene.addNode(mesh);\n\n scene.calculateNormals();\n scene.setupRendering();\n }",
"private void addComponents() {\n LOOGER.info(\"Get add Components Entry\");\n // Adding loadButton to first row.\n this.add(loadButton);\n\n // Adding fillButton to first row.\n this.add(fillButton);\n\n // Adding deleteButton to first row.\n this.add(deleteButton);\n LOOGER.info(\"add Components exit\");\n }",
"protected void addComponentsToPane() {\n mainPanel = new JPanel(new GridBagLayout());\n GridBagConstraints c = new GridBagConstraints();\n\n\n gameField = new GameField(this);\n gameField.setPreferredSize(new Dimension(screenWidth / 3, screenHeight / 2));\n gameField.setBorder(BorderFactory.createLineBorder(Color.black));\n\n gameFieldPanel = new JPanel();\n LayoutManager overlay = new OverlayLayout(gameFieldPanel);\n gameFieldPanel.setLayout(overlay);\n gameFieldPanel.add(gameField);\n\n// gameCharsFieldPanel.setOpaque(true);\n// gameCharsFieldPanel.setPreferredSize(new Dimension(screenWidth/3, screenHeight/3));\n// gameFieldPanel.add(gameCharsFieldPanel);\n\n drawX = new DrawX();\n gameFieldPanel.add(drawX);\n\n drawO = new DrawO();\n gameFieldPanel.add(drawO);\n\n c.fill = GridBagConstraints.HORIZONTAL;\n c.gridwidth = 3;\n c.gridx = 0;\n c.gridy = 0;\n mainPanel.add(gameFieldPanel, c);\n\n// addLinesButton = new JButton(\"Draw Lines\");\n// c.fill = GridBagConstraints.HORIZONTAL;\n//// c.gridwidth = 3;\n// c.gridx = 0;\n// c.gridy = 1;\n// mainPanel.add(addLinesButton, c);\n//\n frame.add(mainPanel);\n }",
"public void addComponents(){\r\n\r\n\t\t\tfor(int i=0; i < fieldNum ; i++){ \r\n\t\t\t\tadd(labels[i]);\r\n\t\t\t\tif(i==3){\r\n\t\t\t\t\tadd(fields[i]);\r\n\t\t\t\t\tfor(int k=1;k<ingredientFields.size();k++)\r\n\t\t\t\t\t\tadd(ingredientFields.get(k));\r\n\t\t\t\t}\r\n\t\t\t\telse \r\n\t\t\t\t\tadd(fields[i]);\r\n\t\t\t}\r\n\r\n\t\t}",
"private void initAuxComponent() {\n\t\tauxComponent.setPickable(false);\n\t\tauxComponent.addChild(unitDiscComponent);\n\t\tauxComponent.addChild(circlesComponent);\n\t\tauxComponent.addChild(hyperboloidComponent);\n\t\tauxComponent.addChild(paraboloidComponent);\n\t\tauxComponent.addChild(poincareGeodesicsComponent);\n\t}",
"public Project3() {\n\t\tcreateComponent();\n\t\twireComponent();\n\t}",
"private void InitComponents() {\n apanel = new AbsolutePanel();\n FocusPanel focus = new FocusPanel();\n DockPanel panel = new DockPanel();\n\n lastPosition[0] = 0;\n\t\tlastPosition[1] = 0;\n\n\t\tisMovable = false;\n isTransformable = false;\n\n transformPoints = new VirtualGroup();\n\t\ttransformPointers = new GraphicObject[9];\n\n currRotation = 0.0;\n\n this.currentFontFamily = new ListBox();\n this.currentFontFamily.setMultipleSelect(false);\n this.currentFontFamily.insertItem(\"Arial\", 0);\n this.currentFontFamily.insertItem(\"Courier\", 1);\n this.currentFontFamily.insertItem(\"Times New Roman\", 2);\n this.currentFontFamily.insertItem(\"Verdana\", 3);\n this.currentFontFamily.insertItem(\"Georgia\", 4);\n this.currentFontFamily.setSelectedIndex(0);\n this.currentFontFamily.addChangeListener(this);\n\n this.currentFontSize = new ListBox();\n this.currentFontSize.setMultipleSelect(false);\n this.currentFontSize.insertItem(\"8\", 0);\n this.currentFontSize.insertItem(\"10\", 1);\n this.currentFontSize.insertItem(\"12\", 2);\n this.currentFontSize.insertItem(\"14\", 3);\n this.currentFontSize.insertItem(\"16\", 4);\n this.currentFontSize.insertItem(\"18\", 5);\n this.currentFontSize.insertItem(\"20\", 6);\n this.currentFontSize.insertItem(\"24\", 7);\n this.currentFontSize.insertItem(\"28\", 8);\n this.currentFontSize.insertItem(\"36\", 9);\n this.currentFontSize.insertItem(\"48\", 10);\n this.currentFontSize.insertItem(\"72\", 11);\n this.currentFontSize.setSelectedIndex(2);\n this.currentFontSize.addChangeListener(this);\n\n this.currentFontStyle = new ListBox();\n this.currentFontStyle.setMultipleSelect(false);\n this.currentFontStyle.insertItem(\"normal\", 0);\n this.currentFontStyle.insertItem(\"italic\", 1);\n this.currentFontStyle.setSelectedIndex(0);\n this.currentFontStyle.addChangeListener(this);\n\n this.currentFontWeight = new ListBox();\n this.currentFontWeight.setMultipleSelect(false);\n this.currentFontWeight.insertItem(\"normal\",0);\n this.currentFontWeight.insertItem(\"bold\", 1);\n this.currentFontWeight.setSelectedIndex(0);\n this.currentFontWeight.addChangeListener(this);\n\n this.updateFont();\n\n canvas = new GraphicCanvas();\n\t\tcanvas.setStyleName(\"drawboard\");\n\t\tcanvas.setPixelSize(width, height);\n\t\tcanvas.addGraphicObjectListener(this);\n\n saver = new SVGFormatter(\"1.1\", \"http://www.w3.org/2000/svg\", \"demo\", width, height);\n\n buttonPanel = new VerticalPanel();\n\t\tbuttonPanel.setSpacing(0);\n\n Grid gridShape = new Grid(4, 2);\n\t\tgridShape.setCellSpacing(2);\n\t\tgridShape.setCellPadding(2);\n\n Grid gridTransform = new Grid(3, 2);\n\t\tgridTransform.setCellPadding(2);\n\t\tgridTransform.setCellSpacing(2);\n\n fill = new HTML(\" \");\n\t\tDOM.setStyleAttribute(fill.getElement(), \"backgroundColor\", this.currentFillColor.toHex());\n\t\tDOM.setStyleAttribute(fill.getElement(), \"border\", \"solid\");\n\t\tDOM.setStyleAttribute(fill.getElement(), \"borderWidth\", \"thin\");\n\t\tDOM.setStyleAttribute(fill.getElement(), \"borderColor\", \"#000000\");\n\t\tfill.setSize(\"30px\", \"30px\");\n\t\tfill.addClickListener(this);\n\n stroke = new HTML(\" \");\n DOM.setStyleAttribute(stroke.getElement(), \"backgroundColor\", this.currentStrokeColor.toHex());\n DOM.setStyleAttribute(stroke.getElement(), \"border\", \"solid\");\n DOM.setStyleAttribute(stroke.getElement(), \"borderWidth\", \"thin\");\n DOM.setStyleAttribute(stroke.getElement(), \"borderColor\", \"#000000\");\n stroke.setSize(\"30px\",\"30px\");\n stroke.addClickListener(this);\n\n HTML fake = new HTML(\" \");\n DOM.setStyleAttribute(fake.getElement(), \"backgroundColor\", \"#FFFFFF\");\n fake.setSize(\"30px\", \"30px\");\n\n HTML fake2 = new HTML(\" \");\n DOM.setStyleAttribute(fake2.getElement(), \"backgroundColor\", \"#FFFFFF\");\n fake2.setSize(\"30px\", \"30px\");\n\n buttonPanel.add(gridShape);\n buttonPanel.add(fake);\n buttonPanel.add(fake2);\n\n this.strokeButton = new Image(\"gfx/color.gif\");\n this.strokeButton.setTitle(\"Choose the stroke\");\n this.strokeButton.setSize(\"34px\", \"34px\");\n this.strokeButton.addClickListener(this);\n\n buttonPanel.add(this.strokeButton);\n buttonPanel.setCellHorizontalAlignment(this.strokeButton, VerticalPanel.ALIGN_CENTER);\n\n\t\tbuttonPanel.add(gridTransform);\n\n fillOpacity = new Slider(Slider.HORIZONTAL, 0, 255, 255, true);\n\t\tfillOpacity.addChangeListener(this);\n\n strokeOpacity = new Slider(Slider.HORIZONTAL, 0, 255, 255, true);\n\t\tstrokeOpacity.addChangeListener(this);\n\n currentStrokeSize = new Slider(Slider.HORIZONTAL, 0, 50, 1, true);\n currentStrokeSize.addChangeListener(this);\n\n /** This adds the buttons to the two grids */\n selectButton = addToGrid(gridShape, 0, 0, \"Select object\", \"gfx/select.gif\");\n\t\tpencilButton = addToGrid(gridShape, 0, 1, \"Draw with Pencil\", \"gfx/pencil.gif\");\n\t\tlineButton = addToGrid(gridShape, 1, 0, \"Draw a Line\", \"gfx/line.gif\");\n\t\trectButton = addToGrid(gridShape, 1, 1, \"Draw a Rect\", \"gfx/rect.gif\");\n\t\tcircleButton = addToGrid(gridShape, 2, 0, \"Draw a Circle\", \"gfx/circle.gif\");\n\t\tellipseButton = addToGrid(gridShape, 2, 1, \"Draw a Ellipse\", \"gfx/ellipse.gif\");\n\t\tpolylineButton = addToGrid(gridShape, 3, 0, \"Draw a Path\", \"gfx/polyline.gif\");\n textButton = addToGrid(gridShape, 3, 1, \"Write Text\", \"gfx/text.gif\");\n\n\t\tdeleteButton = addToGrid(gridTransform, 0, 0, \"Delete object\",\"gfx/delete.gif\");\n saveButton = addToGrid(gridTransform, 0, 1, \"Save SVG to page\",\"gfx/save.gif\");\n backButton = addToGrid(gridTransform, 1, 0, \"Send object Back\",\"gfx/back.gif\");\n\t\tfrontButton = addToGrid(gridTransform, 1, 1, \"Send object Front\",\"gfx/front.gif\");\n\n apanel.add(focus);\n\n focus.add(panel);\n panel.add(this.canvas, DockPanel.CENTER);\n\t\tpanel.add(this.buttonPanel, DockPanel.WEST);\n panel.add(this.currentFontFamily, DockPanel.SOUTH);\n panel.add(this.currentFontSize, DockPanel.SOUTH);\n panel.add(this.currentFontStyle, DockPanel.SOUTH);\n panel.add(this.currentFontWeight, DockPanel.SOUTH);\n this.apanel.setSize(\"100%\", \"100%\");\n focus.addKeyboardListener(this);\n focus.setSize(\"100%\", \"100%\");\n }",
"private void initComponents() {\n\t\t\n\t}",
"private void initComponents() {\n\t\t\n\t}",
"private void addComponents() {\n\t\tthis.add(btn_pause);\n\t\tthis.add(btn_continue);\n\t\tthis.add(btn_restart);\n\t\tthis.add(btn_rank);\n\t\tif(Config.user.getUsername().equals(\"root\")) {\n\t\t\tthis.add(btn_admin);\n\t\t}\n\t\n\t\t\n\t}",
"public void addComponentsToContainer()\n {\n\t container.add(welcome);\n container.add(amountLabel);\n container.add(amountText);\n container.add(depositButton);\n }",
"private void initComponents() {\n\n scenePanel = new javax.swing.JPanel();\n\n setLayout(new javax.swing.BoxLayout(this, javax.swing.BoxLayout.PAGE_AXIS));\n\n scenePanel.setLayout(new javax.swing.BoxLayout(scenePanel, javax.swing.BoxLayout.LINE_AXIS));\n add(scenePanel);\n }",
"private void initComposants() {\r\n\t\tselectionMatierePanel = new SelectionMatierePanel(1);\r\n\t\ttableauPanel = new TableauPanel(1);\r\n\t\tadd(selectionMatierePanel, BorderLayout.NORTH);\r\n\t\tadd(tableauPanel, BorderLayout.SOUTH);\r\n\t\t\r\n\t}",
"private void addComponents(){\n GridBagConstraints constraints = new GridBagConstraints();\n constraints.anchor = GridBagConstraints.WEST;\n constraints.insets = new Insets(5, 5, 5, 5);\n constraints.fill = GridBagConstraints.BOTH;\n \n // Add components to the panel\n // Note>> the constraints are applied to both panels\n constraints.gridx = 0;\n constraints.gridy = 0; \n subPanel1.add(onDo1, constraints); // Add button to pane 1\n\n constraints.gridx = 1;\n subPanel1.add(onDo2, constraints); // Add button to pane 1\n \n constraints.gridx = 0;\n constraints.gridy = 1; \n subPanel1.add(onDo3, constraints); // Add button to pane 1\n subPanel2.add(l1, constraints); // Add button to pane 2\n \n constraints.gridx = 1;\n constraints.gridy = 1;\n subPanel1.add(onDo4, constraints); // Add button to pane 1\n \n\n // Set border for sub panel 1 \n subPanel1.setBorder(BorderFactory.createTitledBorder(\n BorderFactory.createEtchedBorder(), \"Events\"));\n \n // Set border for sub panel 2 \n subPanel2.setBorder(BorderFactory.createTitledBorder(\n BorderFactory.createEtchedBorder(), \"Debug\"));\n }",
"private void crearComponentes() {\n setTitle(\"Nueva Persona\");\r\n setDefaultLookAndFeelDecorated(true);\r\n try {\r\n //UIManager.setLookAndFeel(\"javax.swing.plat.metal.MetalLookAndFeel\");\r\n UIManager.setLookAndFeel(\"javax.swing.plaf.nimbus.NimbusLookAndFeel\");\r\n } catch (ClassNotFoundException | IllegalAccessException | InstantiationException | UnsupportedLookAndFeelException e) {\r\n System.out.println(e.getMessage());\r\n }\r\n\r\n int numBorder;\r\n numBorder = 20;\r\n\r\n jPrincipal = new JPanel(new BorderLayout());\r\n jPrincipal.setBorder(new EmptyBorder(numBorder, numBorder, numBorder, numBorder));\r\n add(jPrincipal);\r\n\r\n JPcontent = new JPanel();\r\n JPcontent.setLayout(new BoxLayout(JPcontent, BoxLayout.PAGE_AXIS));\r\n numBorder = 10;\r\n\r\n JPanel nom = new JPanel();\r\n JPcontent.add(nom);\r\n nom.add(new JLabel(\"Nom: \"));\r\n JTxtFldNom = new JTextField(28);\r\n JTxtFldNom.addComponentListener(null);\r\n nom.add(JTxtFldNom);\r\n\r\n JPanel primerCognom = new JPanel();\r\n JPcontent.add(primerCognom);\r\n primerCognom.add(new JLabel(\"Primer cognom: \"));\r\n JTxtFldPrimerCognom = new JTextField(22);\r\n JTxtFldPrimerCognom.addComponentListener(null);\r\n primerCognom.add(JTxtFldPrimerCognom);\r\n\r\n JPanel segonCognom = new JPanel();\r\n JPcontent.add(segonCognom);\r\n segonCognom.add(new JLabel(\"Segon cognom: \"));\r\n JTxtFldSegonCognom = new JTextField(22);\r\n JTxtFldSegonCognom.addComponentListener(null);\r\n segonCognom.add(JTxtFldSegonCognom);\r\n\r\n JPanel nif = new JPanel();\r\n JPcontent.add(nif);\r\n nif.add(new JLabel(\"NIF: \"));\r\n JTxtFldNIF = new JTextField(28);\r\n JTxtFldNIF.addComponentListener(null);\r\n nif.add(JTxtFldNIF);\r\n\r\n JPanel numeroSS = new JPanel();\r\n JPcontent.add(numeroSS);\r\n numeroSS.add(new JLabel(\"Número SS: \"));\r\n JTxtFldNumeroSS = new JTextField(24);\r\n JTxtFldNumeroSS.addComponentListener(null);\r\n numeroSS.add(JTxtFldNumeroSS);\r\n\r\n JPanel telf = new JPanel();\r\n JPcontent.add(telf);\r\n telf.add(new JLabel(\"Teléfon: \"));\r\n JTxtFldTelf = new JTextField(26);\r\n JTxtFldTelf.addComponentListener(null);\r\n telf.add(JTxtFldTelf);\r\n\r\n JPanel ciutat = new JPanel();\r\n JPcontent.add(ciutat);\r\n ciutat.add(new JLabel(\"Ciutat: \"));\r\n JTxtFldCiutat = new JTextField(27);\r\n JTxtFldCiutat.addComponentListener(null);\r\n ciutat.add(JTxtFldCiutat);\r\n\r\n JPanel codiPostal = new JPanel();\r\n JPcontent.add(codiPostal);\r\n codiPostal.add(new JLabel(\"Codi postal: \"));\r\n JTxtFldCodiPostal = new JTextField(24);\r\n JTxtFldCodiPostal.addComponentListener(null);\r\n codiPostal.add(JTxtFldCodiPostal);\r\n\r\n JPanel carrer = new JPanel();\r\n JPcontent.add(carrer);\r\n carrer.add(new JLabel(\"Direcció: \"));\r\n JTxtFldCarrer = new JTextField(27);\r\n JTxtFldCarrer.addComponentListener(null);\r\n carrer.add(JTxtFldCarrer);\r\n\r\n if (clase == 0) {\r\n metge();\r\n }\r\n\r\n JPanel boto = new JPanel();\r\n boto.setBorder(new EmptyBorder(0, 0, 8, 0));\r\n JPcontent.add(boto);\r\n\r\n// jBtnCancelar = new JButton(\"Cancelar\");\r\n// boto.add(jBtnCancelar);\r\n// jBtnCancelar.addActionListener(new BotonesCrearPersona(clase));\r\n JBtnCrea = new JButton(\"Crear\");\r\n boto.add(JBtnCrea);\r\n JBtnCrea.addActionListener(new BotonesCrearPersona(clase));\r\n\r\n jPrincipal.add(JPcontent, BorderLayout.CENTER);\r\n\r\n pack();\r\n Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();\r\n this.setLocation(dim.width / 2 - this.getSize().width / 2, dim.height / 2 - this.getSize().height / 2);\r\n }",
"public void manageComponent() {\n menu = new JMenuBar();\n mainbox = new JScrollPane();\n toolbox = new JPanel();\n paintBox = new JPanel();\n optionbox = new JPanel();\n statusbar = new JPanel();\n paintModule = new PaintModule();\n\n // component setting\n createToolBox(toolbox);\n createMenu(menu);\n createOptionBox(optionbox);\n createStatusBar(statusbar);\n this.setLayout(new BorderLayout());\n\n // add component to container\n paintBox.add(paintModule);\n mainbox.setViewportView(paintBox);\n\n\n this.add(menu, BorderLayout.NORTH);\n this.add(mainbox, BorderLayout.CENTER);\n this.add(toolbox, BorderLayout.WEST);\n this.add(optionbox, BorderLayout.EAST);\n this.add(statusbar, BorderLayout.SOUTH);\n\n }",
"private void makeComponents() {\n Font font = new Font(\"Open Sans\", Font.PLAIN, 14);\n\n //Create The buttons and configure their visual design.\n searchArea.setFont(font);\n searchArea.setBorder(new CompoundBorder(BorderFactory.createMatteBorder(4, 7, 4, 7, DrawAttribute.lightblue), BorderFactory.createRaisedBevelBorder()));\n searchArea.setBounds(20, 20, 300, 37);\n searchArea.setActionCommand(\"searchAreaInput\");\n\n makeFrontGUIButtons();\n }",
"private void addComponents()\n\t{\n\t\tint x = 10;\n\t\tint y = 10;\n\t\tint stepY = 25;\n\t\taddFrequencyRouter(x,y);\n\t\ty = y + stepY;\n\t\taddFrequencyIpInput(x,y);\n\t\ty = y + stepY;\n\t\taddFrequencyIpOutput(x,y);\n\t\ty = y + stepY;\n\t\taddOk(x+80,y);\n\t}",
"private void createUIComponents() {\n editor = createEditor(project, document);\n splitter = new JBSplitter(0.4f);\n ((JBSplitter) splitter).setFirstComponent(editor.getComponent());\n// ((JBSplitter) splitter).setSecondComponent();\n }",
"public P2() {\n \n initComponents();\n grupo1.add(rb1);\n grupo1.add(rb2);\n grupo1.add(rb3);\n }",
"private void createUIComponents() {\n }",
"private void initComponent() {\n\t\taddGrid();\n\t\taddToolBars();\n\t}",
"public void addComponentsToContainer() {\n container.add(userLabel);\n container.add(passwordLabel);\n container.add(userTextField);\n container.add(passwordField);\n container.add(loginButton);\n container.add(exitButton);\n\n }",
"private void initComponents()\n {\n //LAYOUT\n initLayoutComponents();\n \n //TRANSITION COMPONENTS\n initTransitionComponents();\n \n //SEARCH PANE COMPONENTS\n initSearchComponents();\n \n //RESULTS PANE COMPONENTS\n initResultComponents();\n \n // CRAWLER CONTROLS\n initCrawlerControlsComponents();\n \n // KEYWORD BAR\n initKeywordBarComponents();\n \n //WORKER CONTROLS\n initWorkerComponents();\n \n //URL COMPONENTS\n initURLMenuComponents();\n\n //BASE LAYOUT COMPONENTS\n initBaseLayout();\n }",
"private void createUIComponents() {\n bt1 = new JButton(\"Hola\");\n }",
"public void createComponents()\n {\n VBox col = new VBox(SPACING);\n\n Label lblStatus = new Label(\"Machine Status\");\n lblStatus.getStyleClass().add(\"bordered-titled-title\");\n\n lblCurrFile = new Label(\"No File Currently Loaded\");\n lblConnection = new Label(\"Not Connected\");\n\n btnConnect = new Button(\"Connect to Machine\");\n btnConnect.setOnAction(new ConnectEventHandler());\n //btnConnect.getStyleClass().add(\"glass-grey\");\n\n ivConnection = new ImageView(\n new Image(getClass().getResourceAsStream(\"/Resources/Not Connected.png\")));\n\n lblMachineStatus = new Label(\"Status: Good\");\n HBox r1 = new HBox(SPACING);\n r1.getChildren().addAll(lblConnection, ivConnection);\n\n col.getChildren().addAll(btnConnect, r1, lblCurrFile, lblMachineStatus);\n getChildren().addAll(lblStatus, col);\n\n }",
"private void createUIComponents() {\n }",
"private void createUIComponents() {\n }",
"private void createUIComponents() {\n }",
"private void createUIComponents() {\n }",
"private void createUIComponents() {\n }",
"private void createUIComponents() {\n }",
"private void createUIComponents() {\n }",
"private void createUIComponents() {\n }",
"private void createUIComponents() {\n }",
"private void createUIComponents() {\n }",
"private void createUIComponents() {\n }",
"private void createUIComponents() {\n }",
"private void createUIComponents() {\n }",
"private void createUIComponents() {\n }",
"private void createUIComponents() {\n }",
"private void createUIComponents() {\n }",
"private void createUIComponents() {\n }",
"private void createUIComponents() {\n }",
"private void createComponents() {\n \n Dimension thisSize = this.getSize();\n \n this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS));\n \n ArrayList<Integer> numbers = new ArrayList<>();\n for (int i = 0; i < recordCount; ++i) {\n numbers.add(i);\n }\n \n recordList = new JList(numbers.toArray());\n recordList.addListSelectionListener(selectionListener);\n JScrollPane listPane = new JScrollPane(recordList);\n listPane.setPreferredSize(new Dimension(thisSize.width / 3, thisSize.height));\n \n select(0, 0);\n \n this.add(listPane);\n \n recordForm = new RecordForm(fields, thisSize);\n entryForm = new JScrollPane(recordForm);\n \n this.add(entryForm);\n \n selectionAction = WAITING_ON_SELECTION;\n \n }",
"public RegisterComponents()\n\t{\n\t\tsetLayout(new BorderLayout(0, 20));\n\n\t\t/*\n\t\tdocumentation on gridBagConstraint: \n\t\thttps://docs.oracle.com/javase/tutorial/uiswing/layout/gridbag.html\n\t\t*/\n\n\t\t// following methos add the labels and textfields to the panel\n\n\t\tdispCompFirstName();\n\t\tdispCompLastName();\n\t\tdispCompRoomNo();\n\t\tdispCompPhone();\n\t\tdispCompStudentID();\n\t\tdispCompCreatePass();\n\t\tdispCompConfirmPass();\n\n\t\t// the textfield added from above methods are resized via method componentResized()\n\n\t\t// this listens for resize events\n\t\taddComponentListener(this);\n add(compPanel, \"North\");\n\t}",
"public HW3() {\n initComponents();\n }",
"private void geometry()\n\t\t{\n\t\t\t// JComponent : Instanciation\n\t\tthis.jPanelAction = new JPanelAction();\n\t\tthis.jPanelCommande = new JPanelCommande(jPanelAction);\n\n\t\t\t// Layout : Specification\n\t\t\t{\n\t\t\tBorderLayout borderLayout = new BorderLayout();\n\t\t\tsetLayout(borderLayout);\n\n\t\t\t// flowlayout.setHgap(20);\n\t\t\t// flowlayout.setVgap(20);\n\t\t\t}\n\n\t\t// JComponent : add\n\t\tthis.add(this.jPanelAction, BorderLayout.CENTER);\n\t\tthis.add(this.jPanelCommande, BorderLayout.SOUTH);\n\t\t}",
"private void crearComponentes(){\n\tjdpFondo.setSize(942,592);\n\t\n\tjtpcContenedor.setSize(230,592);\n\t\n\tjtpPanel.setTitle(\"Opciones\");\n\tjtpPanel2.setTitle(\"Volver\");\n \n jpnlPanelPrincilal.setBounds(240, 10 ,685, 540);\n \n }",
"public static void addComponents(){\n navBar.add(heading);\n navBar.add(logoutBtn);\n navBar.setLayout(new BorderLayout());\n panel.add(navBar);\n panel.add(industrys);\n panel.setLayout(new BorderLayout());\n }",
"public void add(Component c){}",
"public void addComponents(Component... components);",
"private void addComponentsToLayers() {\n JLayeredPane layer = getLayeredPane();\n layer.add(canvas, new Integer(1));\n layer.add(searchArea, new Integer(2));\n layer.add(searchButton, new Integer(2));\n layer.add(zoomInButton, new Integer(2));\n layer.add(zoomOutButton, new Integer(2));\n layer.add(fullscreenButton, new Integer(2));\n layer.add(showRoutePanelButton, new Integer(2));\n layer.add(routePanel, new Integer(2));\n layer.add(optionsButton, new Integer(2));\n layer.add(mapTypeButton, new Integer(2));\n layer.add(mapTypePanel, new Integer(2));\n layer.add(resultPane, new Integer(3));\n layer.add(resultStartPane, new Integer(3));\n layer.add(resultEndPane, new Integer(3));\n layer.add(iconPanel, new Integer(3));\n layer.add(optionsPanel, new Integer(2));\n layer.add(directionPane, new Integer(2));\n layer.add(closeDirectionList, new Integer(2));\n layer.add(travelTimePanel, new Integer(3));\n\n }",
"public void addComponent(Component c);",
"@Override\n\t\tpublic void create() {\n\t\t\tcannon = new CannonLogic();\n\t\t\tlines = new LineLogic();\n\t\t\tboxes = new BoxLogic();\n\t\t\tcontroller = new PlayerController();\n\t\t\tshapeList = new ArrayList<Shape>();\n\t\t\t\n\t\t\tGdx.gl11.glEnableClientState(GL11.GL_VERTEX_ARRAY);\n\t\t\tGdx.gl11.glClearColor(0.4f, 0.6f, 1.0f, 1.0f);\n\t\t\tvertexBuffer = BufferUtils.newFloatBuffer(8);\n\t\t\tvertexBuffer.put(new float[] {-50,-50, -50,50, 50,-50, 50,50});\n\t\t\tvertexBuffer.rewind();\n\t\t}",
"private void initilize()\n\t{\n\t\tdimXNet = project.getNoC().getNumRotX();\n\t\tdimYNet = project.getNoC().getNumRotY();\n\t\t\n\t\taddProperties();\n\t\taddComponents();\n\t\tsetVisible(true);\n\t}",
"private void initMyComponents() {\n this.jPanel1.setLayout(new BoxLayout(this.jPanel1, BoxLayout.Y_AXIS));\n this.jPanel1.add(controller.getPressureController().getEMeasureBasicView());\n this.jPanel1.add(controller.getTemperatureController().getEMeasureBasicView());\n this.controller.getPressureController().getListeners().add(this);\n this.controller.getTemperatureController().getListeners().add(this);\n this.jComboBox1.setModel(new DefaultComboBoxModel(FluidKind.values()));\n this.changeResponce();\n }",
"private void createComponents()\n\t{\n\t\t// Create search results' table header\n\t\tm_ResultHeader = new PrinterLabel(1,MenuWindow.FRAME_WIDTH , MenuWindow.FRAME_HEIGHT,\n\t\t\t\t\"PRINTER\",\"VENDOR\",\"TENSION (ksi)\",\"COMPRESSION (ksi)\",\"IMPACT (lb-ft)\",\"MATERIALS\",\"TOLERANCE (in)\",\"FINISH (\\u00B5in)\", false);\n\t\tm_ResultHeader.setBackground(Color.lightGray);\n\t\t// Add tool tips for long header categories before adding to GUI\n\t\tm_ResultHeader.getMaterials().setToolTipText(\"Range of Materials\");\n\t\tm_PrinterList = ToolBox.generatePrinterList();\n\t}",
"private void geometry()\n\t\t{\n\t\tgridLayout = new GridLayout(2, -1);\n\n\t\tthis.setLayout(gridLayout);\n\n\t\tadd(component1);\n\t\tadd(component2);\n\t\t}",
"private void addComponents()\n\t{\n\t\theaderPanel = new JPanel();\n\t\tfooterPanel = new JPanel();\n\t\tfunctionPanel = new JPanel();\n\t\ttextPanel = new JPanel();\n\t\t\t\t\t\t\n\t\teToPower = new JButton(\"\\u212F\\u207F\");\n\t\ttwoPower = new JButton(\"2\\u207F\");\n\t\tln = new JButton(\"ln\");\n\t\txCube = new JButton(\"x\\u00B3\");\n\t\txSquare = new JButton(\"x\\u00B2\");\n\t\tdel = new JButton(\"\\u2190\");\n\t\tcubeRoot = new JButton(\"\\u221B\");\n\t\tC = new JButton(\"c\");\n\t\tnegate = new JButton(\"\\u00B1\");\n\t\tsquareRoot = new JButton(\"\\u221A\");\n\t\tnine = new JButton(\"9\");\n\t\teight = new JButton(\"8\");\n\t\tseven = new JButton(\"7\");\n\t\tsix = new JButton(\"6\");\n\t\tfive = new JButton(\"5\");\n\t\tfour = new JButton(\"4\");\n\t\tthree = new JButton(\"3\");\n\t\ttwo = new JButton(\"2\");\n\t\tone = new JButton(\"1\");\n\t\tzero = new JButton(\"0\");\n\t\tdivide = new JButton(\"/\");\n\t\tmultiply = new JButton(\"*\");\n\t\tpercent = new JButton(\"%\");\n\t\treciprocal = new JButton(\"1/x\");\n\t\tsubtract = new JButton(\"-\");\n\t\tadd = new JButton(\"+\");\n\t\tdecimalPoint = new JButton(\".\");\n\t\tequals = new JButton(\"=\");\n\t\tPI = new JButton(\"\\u03C0\");\n\t\te = new JButton(\"\\u212F\");\n\t\t\n\t\tdefaultButtonBackground = C.getBackground ( );\n\t\tdefaultButtonForeground = C.getForeground ( );\n\t\t\n\t\tbuttonFont = new Font(\"SansSerif\", Font.PLAIN, BUTTONFONTSIZE);\n\t\tentryFont = new Font(\"SansSerif\", Font.PLAIN, ENTRYFONTSIZE);\n\t\titalicButtonFont = new Font (\"SanSerif\", Font.ITALIC, BUTTONFONTSIZE);\n\t\tentry = new JTextField(\"0\", 1);\n\t\t\t\t\n\t\tadd.setFont(buttonFont);\n\t\tsubtract.setFont(buttonFont);\n\t\tequals.setFont(buttonFont);\n\t\tdecimalPoint.setFont(buttonFont);\n\t\tmultiply.setFont(buttonFont);\n\t\tdivide.setFont(buttonFont);\n\t\tnegate.setFont(buttonFont);\n\t\tpercent.setFont(buttonFont);\n\t\tdel.setFont(buttonFont);\n\t\tsquareRoot.setFont(buttonFont);\n\t\teToPower.setFont(buttonFont);\n\t\ttwoPower.setFont(buttonFont);\n\t\tln.setFont(buttonFont);\n\t\txCube.setFont(buttonFont);\n\t\txSquare.setFont(buttonFont);\n\t\tC.setFont(buttonFont);\n\t\tcubeRoot.setFont(buttonFont);\n\t\treciprocal.setFont(buttonFont);\n\t\tnine.setFont(buttonFont);\n\t\teight.setFont(buttonFont);\n\t\tseven.setFont(buttonFont);\n\t\tsix.setFont(buttonFont);\n\t\tfive.setFont(buttonFont);\n\t\tfour.setFont(buttonFont);\n\t\tthree.setFont(buttonFont);\n\t\ttwo.setFont(buttonFont);\n\t\tone.setFont(buttonFont);\n\t\tzero.setFont(buttonFont);\n\t\tPI.setFont(buttonFont);\n\t\te.setFont(italicButtonFont);\n\t\t\n\t\t\n\t\tentry.setFont(entryFont);\n\t\tentry.setHorizontalAlignment (JTextField.RIGHT);\n\t\tentry.grabFocus ( );\n\t\tentry.setHighlighter(null);\n\t\tentry.selectAll ( );\n\t\t\n\t\tincognito = false;\n\t}",
"private void buildComponents() {\r\n buildJMenuBar();\r\n setJMenuBar( gameBar );\r\n\r\n buildScorePanel();\r\n buildInfoPanel();\r\n\r\n getContentPane().add( scorePanel, \"North\" );\r\n getContentPane().add( infoPanel, \"South\" );\r\n }",
"public void addComponentsToPanel() {\n\t\tpanel.add(backBtn);\n\t\tpanel.add(forgotPassword);\n\t\tpanel.add(txtPass);\n\t\tpanel.add(txtSendEmail);\n\t\tpanel.add(remindMeBtn);\n\n\t\tpanel.add(backgroundLabel);\n\t}",
"public void add(String stg1, JComponent componente1, String stg2, JComponent componente2, JComponent componente3){\n\t\tGridBagConstraints cons = new GridBagConstraints();\n\t\tcons.fill = GridBagConstraints.BOTH; \n\t\tcons.insets = new Insets(4,4,4,4); \n\n\t\tcons.fill = GridBagConstraints.NONE;\n\t\tcons.anchor = GridBagConstraints.NORTHWEST;\n\t\tcons.weightx = 0; \n\t\tcons.gridwidth = 1; \n\t\tthis.getContentPane().add(new JLabel(stg1), cons); \n\n\t\tcons.weightx = 1; \n\t\tcons.gridwidth = 1; \n\t\tcons.fill = GridBagConstraints.BOTH; \n\t\tthis.getContentPane().add(componente1, cons); \n\n\t\tcons.fill = GridBagConstraints.NONE; \n\t\tcons.weightx = 0; \n\t\tcons.gridwidth = 1; \n\t\tthis.getContentPane().add(new JLabel(stg2), cons); \n\n\t\tcons.weightx = 1; \n\t\tcons.gridwidth = 1; \n\t\tcons.fill = GridBagConstraints.BOTH; \n\t\tthis.getContentPane().add(componente2, cons); \n\n\t\tcons.weightx = 0; \n\t\tcons.fill = GridBagConstraints.BOTH; \n\t\tcons.gridwidth = GridBagConstraints.REMAINDER; \n\t\tthis.getContentPane().add(componente3, cons); \n\t}",
"private void createUIComponents() {\n valueTextField = new JTextField();\n FixedService f = new FixedService();\n valueTextField.setText(\"£ \" + f.getPrice(\"Fixed\"));\n valueTextField.setBorder(new EmptyBorder(0, 0, 0, 0));\n }",
"private void initializeGUIComponents() {\n\t\tmyScene = new Scene(myRoot);\n ButtonConditionManager.getInstance().beginListeningToScene(myScene);\n\t\tmyStage.setTitle(\"MY PLAYER VIEW\");\n\t\tmyStage.setScene(myScene);\n\t\tmyStage.show();\n\t\tmyCanvas = new GameCanvas();\n\t\tmyRoot.getChildren().add(myCanvas.getNode());\n\t\tmyCanvas.getNode().toBack();\n\t}",
"protected void initializeComponents() {\n\t\t/* Create fonts for information nodes */\n\t\tFont titleFont = Font.font(\"Arial\", FontWeight.BOLD, 18);\n\t\tFont descriptionFont = Font.font(\"Arial\", 14);\n\t\t/* Configure information nodes */\n\t\tconfigureTitle(titleFont);\n\t\tconfigureDescription(descriptionFont);\n\t\tconfigureIconContainer();\n\t\tconfigureWindow();\n\t\t/* set scene */\n\n\t\tgetContent().add(notificationContainer);\n\t}",
"private void geometry()\n\t\t{\n\t\t// JComponent : Instanciation\n\t\tpanel = new JPanelVideo(video);\n\t\t// Layout : Specification\n\t\t\t{\n\t\t\tBorderLayout borderLayout = new BorderLayout();\n\t\t\tsetLayout(borderLayout);\n\n\t\t\t// borderLayout.setHgap(20);\n\t\t\t// borderLayout.setVgap(20);\n\t\t\t}\n\n\t\t// JComponent : add\n\t\tadd(panel);\n\t\t}",
"private void buildUI() {\n initComponents();\n\n FormLayout layout = new FormLayout(\"3dlu, pref:grow, 3dlu\",\n \"3dlu, pref, 3dlu, pref, 3dlu, fill:0:grow\");\n\n PanelBuilder builder = new PanelBuilder(layout);\n CellConstraints cc = new CellConstraints();\n\n // Toolbar\n JPanel toolbar = createToolBar();\n toolbar.setOpaque(false);\n builder.add(toolbar, cc.xy(2, 2));\n builder.addSeparator(null, cc.xyw(1, 4, 2));\n\n // Main panel in scroll pane\n JPanel mainPanel = buildMainPanel();\n mainPanel.setOpaque(false);\n JScrollPane scrollPane = new JScrollPane(mainPanel);\n scrollPane.setOpaque(false);\n scrollPane.getVerticalScrollBar().setUnitIncrement(10);\n UIUtil.removeBorder(scrollPane);\n builder.add(scrollPane, cc.xyw(1, 6, 2));\n\n uiComponent = builder.getPanel();\n }",
"private void createComponentBox() {\r\n\t\tthis.componentBox = new Vector<String>();\r\n\t\tthis.componentBox.add(\"Sword\");\r\n\t\tthis.componentBox.add(\"Two-handed Sword\");\r\n\t\tthis.componentBox.add(\"Staff\");\r\n\t\tthis.componentBox.add(\"Axe\");\r\n\t\tthis.componentBox.add(\"Hammer\");\r\n\t\tthis.componentBox.add(\"Bow\");\r\n\t\tthis.componentBox.add(\"Crossbow\");\r\n\t\tthis.componentBox.add(\"Wand\");\r\n\t\tthis.componentBox.add(\"Spear\");\r\n\t\tthis.componentBox.add(\"Bottle\");\r\n\t}",
"private void startComponents(){\n\n if(isAllowed(sentinel)){\n SentinelComponent sentinelComponent = new SentinelComponent(getInstance());\n sentinelComponent.getCanonicalName();\n }\n\n if(isAllowed(\"fileserver\")){\n FileServer fileServer = new FileServer(getInstance());\n fileServer.getCanonicalName();\n }\n\n if(isAllowed(\"manager\")){\n ManagerComponent Manager = new ManagerComponent(getInstance());\n Manager.getCanonicalName();\n }\n\n// if(isAllowed(\"sdk\")){\n// SDK sdk = new SDK(getInstance());\n// sdk.getCanonicalName();\n// }\n\n if(isAllowed(\"centrum\")){\n CentrumComponent centrum1 = new CentrumComponent(getInstance(), null);\n centrum1.getCanonicalName();\n }\n\n }",
"public VehiclesPanel() throws IOException {\n\t\tsuper(new GridLayout(4,3));\n \n\t\t// Frame and title the panel\n\t\tthis.setBorder(BorderFactory.createTitledBorder(\"Vehicles fleet\"));\n\t\t\n\t\t// Fill the nbVehicles combo box with possible fleet sizes\n\t\tthis.nbVBox.addItem(1);\n\t\tthis.nbVBox.addItem(2);\n\t\tthis.nbVBox.addItem(5);\n\t\tthis.nbVBox.addItem(10);\n\t\tthis.nbVBox.addItem(30);\n\t\t\n\t\t// Add the check box that chooses between a limited or infinite number of vehicles\n\t\tthis.add(new JLabel(\"Number of vehicles\"));\n\t\tthis.nbVCheck = new JCheckBox(\"Unlimited\", true);\n\t\tthis.nbVCheck.addItemListener(this);\n\t\tthis.add(this.nbVCheck);\n\t\tthis.nbVCheck.setMnemonic(KeyEvent.VK_C);\n\t\tthis.add(new JPanel());\n\t\tthis.add(new JPanel());\n\t\tthis.add(this.nbVBox);\n\t\tthis.nbVBox.setVisible(false);\n\t\tthis.add(new JPanel());\n\t\t\n\t\t// Fill the capacities combo box with possible capacities\n\t\tthis.capaBox.addItem(1);\n\t\tthis.capaBox.addItem(3);\n\t\tthis.capaBox.addItem(10);\n\t\tthis.capaBox.addItem(30);\n\t\t// Add the check box that chooses between a finite or infinite capacity for each vehicle\n\t\tthis.add(new JLabel(\"Capacity of vehicles\"));\n\t\tthis.capaCheck = new JCheckBox(\"Unlimited\", true);\n\t\tthis.capaCheck.addItemListener(this);\n\t\tthis.add(this.capaCheck);\n\t\tthis.capaCheck.setMnemonic(KeyEvent.VK_G);\n\t\tthis.add(new JPanel());\n\t\tthis.add(new JPanel());\n\t\tthis.add(this.capaBox);\n\t\tthis.capaBox.setVisible(false);\n\t\tthis.add(this.capaExplain);\n\t\tthis.capaExplain.setVisible(false);\n\t}",
"private void init() {\n setBackground(LIGHT_GRAY);\n Box layout = new Box(BoxLayout.Y_AXIS);\n\n jump = createButton(\"Jump\", null);\n exit = createButton(\"Exit!\", null);\n fly = createButton(\"Fly\", null);\n Jfloat = createButton(\"Float\", null);\n layout.add(Box.createRigidArea(new Dimension(0, 150)));\n layout.add(jump);\n layout.add(Box.createRigidArea(new Dimension(0, 25)));\n layout.add(Jfloat);\n layout.add(Box.createRigidArea(new Dimension(0, 25)));\n layout.add(fly);\n layout.add(Box.createRigidArea(new Dimension(0, 25)));\n layout.add(exit);\n add(layout);\n }",
"public void createComponents(JComponent panel) {\r\n\t\t// Array display\r\n\t\tpanel.setLayout(new FlowLayout());\r\n\t\tpanel1.setLayout(new BorderLayout());\r\n\t\tcanvas.addMouseListener(aml);\r\n\t\tcanvas.addMouseMotionListener(aml);\r\n\t\tpanel1.add(canvas);\r\n\t\tpanel1.add(instr, BorderLayout.NORTH);\r\n\t\t\r\n\t\tpanel.add(panel1);\r\n\r\n\t\t// Controls\r\n\t\tpanel2.setLayout(new GridLayout(5, 2));\t\r\n\t\t\r\n\t\tJButton createArrayButton = new JButton(\"Create Customized Array\");\r\n\t\tpanel2.add(createArrayButton);\r\n\t\tcreateArrayButton.addActionListener(new createArrayListener());\r\n\r\n\t\tJButton changeValueButton = new JButton(\"Change Element Value\");\r\n\t\tpanel2.add(changeValueButton);\r\n\t\tchangeValueButton.addActionListener(new changeValueListener());\r\n\r\n\t\tJButton accessButton = new JButton(\"Access Element\");\r\n\t\tpanel2.add(accessButton);\r\n\t\taccessButton.addActionListener(new accessListener());\r\n\t\t\r\n\t\tJButton findButton = new JButton(\"Search Element\");\r\n\t\tpanel2.add(findButton);\r\n\t\tfindButton.addActionListener(new findListener());\r\n\t\t\r\n\t\tJButton clearButton = new JButton(\"Clear Previous Content\");\r\n\t\tpanel2.add(clearButton);\r\n\t\tclearButton.addActionListener(new ClearListener());\t\r\n\t\t\r\n\t\tpanel.add(panel2);\t\r\n\t}",
"private void initComponents() {\n rootLayout = new Grid();\n rootLayout.setWidth(new Extent(100, Extent.PERCENT));\n rootLayout.setSize(2);\n add(rootLayout);\n Empsn_Label= new nextapp.echo2.app.Label();\n Empsn_Label.setText(\"N_TIME_BEAR.EMPSN\");\n rootLayout.add(Empsn_Label);\n \n Empsn_DscField = new dsc.echo2app.component.DscField();\n Empsn_DscField.setId(\"Empsn_DscField\");\n Empsn_DscField.setWidth(new Extent(4, Extent.CM));\n rootLayout.add(Empsn_DscField);\n \n\t}",
"public void init() {\n\t\t//initializing graphics area\n \tcanvas = new FacePamphletCanvas();\n \tadd(canvas);\n \t\n\t\taddInteractors();\n\t\taddActionListeners();\n }",
"private void addGUIComponents() {\n\t\t\n\t\t/*length panel*/\n\t\tJPanel lengthPanel = new JPanel();\n\t\tlengthPanel.setBackground(new Color(109,109,109));\n\t\tGridLayout layout = new GridLayout(1,2);\n\t\tlayout.setHgap(20);\n\t\tlengthPanel.setLayout(layout);\n\n\t\tJPanel lengthLeftPan = new JPanel();\n\t\tlengthLeftPan.setBackground(new Color(109,109,109));\n\t\tlengthLeftPan.setLayout(new GridLayout(9,2));\n\t\tlengthLeftPan.add(_X_A0_lb);\n\t\tlengthLeftPan.add(_X_A0);\n\t\tlengthLeftPan.add(_Y_A0_lb);\n\t\tlengthLeftPan.add(_Y_A0);\n\t\tlengthLeftPan.add(_X_d_lb);\n\t\tlengthLeftPan.add(_X_d);\n\t\tlengthLeftPan.add(_Y_d_lb);\n\t\tlengthLeftPan.add(_Y_d);\n\t\tlengthLeftPan.add(_X_s_lb);\n\t\tlengthLeftPan.add(_X_s);\n\t\tlengthLeftPan.add(_Y_s_lb);\n\t\tlengthLeftPan.add(_Y_s);\n\t\tlengthLeftPan.add(_ro_min_lb);\n\t\tlengthLeftPan.add(_ro_min);\n\t\tlengthLeftPan.add(new JLabel(\"\"));\n\t\tlengthLeftPan.add(new JLabel(\"\"));\n\t\tlengthLeftPan.add(new JLabel(\"\"));\n\t\tlengthLeftPan.add(new JLabel(\"\"));\n\n\t\tJPanel lengthRightPan = new JPanel(new GridLayout(10,2));\n\t\tlengthRightPan.setBackground(new Color(109,109,109));\n\t\tlengthRightPan.add(_L3_lb);\n\t\tlengthRightPan.add(_L3);\n\t\tlengthRightPan.add(_L31_lb);\n\t\tlengthRightPan.add(_L31);\n\t\tlengthRightPan.add(_L3p_lb);\n\t\tlengthRightPan.add(_L3p);\n\t\tlengthRightPan.add(_L4_lb);\n\t\tlengthRightPan.add(_L4);\n\t\tlengthRightPan.add(_L5_lb);\n\t\tlengthRightPan.add(_L5);\n\t\tlengthRightPan.add(_L1_lb);\n\t\tlengthRightPan.add(_L1);\n\t\tlengthRightPan.add(_rR_lb);\n\t\tlengthRightPan.add(_rR);\n\t\tlengthRightPan.add(_rG_lb);\n\t\tlengthRightPan.add(_rG);\n\t\tlengthRightPan.add(_ep_lb);\n\t\tlengthRightPan.add(_ep);\n\t\tlengthRightPan.add(_y_lb);\n\t\tlengthRightPan.add(_y);\n\t\t\n\t\tlengthPanel.add(lengthLeftPan);\n\t\tlengthPanel.add(lengthRightPan);\n\t\t\n\t\t/*angle panel*/\n\t\tJPanel anglePanel = new JPanel(new GridLayout(5,2));\n\t\tanglePanel.setBackground(new Color(109,109,109));\n\t\tanglePanel.add(_delta_lb);\n\t\tanglePanel.add(_delta);\n\t\tanglePanel.add(_gama_lb);\n\t\tanglePanel.add(_gama);\n\t\tanglePanel.add(_miu_an_min_lb);\n\t\tanglePanel.add(_miu_an_min);\n\t\tanglePanel.add(_miu_ab_min_lb);\n\t\tanglePanel.add(_miu_ab_min);\n\t\tanglePanel.add(_n_lb);\n\t\tanglePanel.add(_n);\n\t\t\n\t\t\n\t\t/*Title label for the length panel*/\n\t\tJLabel lengthPanelTitle = new JLabel(LanguageFactory.getInstance().getExpresion(LENGTH_TITLE_NAME));\n\t\t/*Title label for the angle panel*/\n\t\tJLabel anglePanelTitle = new JLabel(LanguageFactory.getInstance().getExpresion(ANGLE_TITLE_NAME));\n\t\t\n\t\t/*Wave radius textbox label*/\n\t\tJLabel waveRadius = new JLabel(LanguageFactory.getInstance().getExpresion(WAVE_RADIUS_LABEL_NAME));\n\t\t/*Seiben (???) radius textbox label*/\n\t\tJLabel seibenRadius = new JLabel(LanguageFactory.getInstance().getExpresion(SEIBEN_RADIUS_LABEL_NAME));\n\t\t\n\t\t\n\t\tJPanel radiusPan = new JPanel(new GridLayout(2,2));\n\t\tradiusPan.setBackground(new Color(109,109,109));\n\t\tradiusPan.add(waveRadius);\n\t\tradiusPan.add(_waveRad);\n\t\tradiusPan.add(seibenRadius);\n\t\tradiusPan.add(_siebenRad);\n\t\t\n\t\t\n\t\tJPanel leftPan = new JPanel(new GridBagLayout());\n\t\tleftPan.setBorder(BorderFactory.createRaisedBevelBorder());\n\t\tleftPan.setBackground(new Color(109,109,109));\n\t\tleftPan.add(lengthPanelTitle, new GBC(0,0).setFill(GBC.NONE).setAnchor(GBC.NORTH).setInsets(0,10,50,10));\n\t\tleftPan.add(lengthPanel, new GBC(0,1).setFill(GBC.NONE).setAnchor(GBC.NORTH).setInsets(0, 10, 0, 10));\n\t\tleftPan.add(radiusPan, new GBC(0,2).setFill(GBC.NONE).setAnchor(GBC.NORTHWEST).setInsets(20, 10, 0, 10));\n\t\t\n\t\tJPanel rightPan = new JPanel(new GridBagLayout());\n\t\trightPan.setBorder(BorderFactory.createRaisedBevelBorder());\n\t\trightPan.setBackground(new Color(109,109,109));\n\t\trightPan.add(anglePanelTitle, new GBC(1,0).setFill(GBC.NONE).setAnchor(GBC.NORTH).setInsets(0,10,50,10));\n\t\trightPan.add(anglePanel, new GBC(1,1).setFill(GBC.NONE).setAnchor(GBC.NORTH).setInsets(0, 10, 0, 10));\n\t\t\n\t\t/*adding the two panels to the layout*/\n\t\tJPanel mainPan = new JPanel(new GridBagLayout());\n\t\tmainPan.add(leftPan, new GBC(0, 0).setFill(GBC.VERTICAL).setAnchor(GBC.NORTH).setInsets(0, 0, 0, 20).setWeight(100, 100));\n\t\tmainPan.add(rightPan, new GBC(1, 0).setFill(GBC.VERTICAL).setAnchor(GBC.NORTH).setInsets(0, 20, 0, 0).setWeight(100, 100));\n\t\tmainPan.add(_drawing_btn, new GBC(2, 0, 1, 2).setFill(GBC.NONE).setAnchor(GBC.NORTH));\n\t\t\n\t\tsetLayout(new BorderLayout());\n\t\tadd(mainPan, BorderLayout.CENTER);\n\t\tsetPreferredSize(new Dimension(800, 400));\n\t\tsetSize(getPreferredSize());\n\n\t}",
"private void initComponents() {\n LOOGER.info(\"Get init components\");\n this.loadButton = new JButton(\"Load\");\n this.fillButton = new JButton(\"Fill\");\n this.deleteButton = new JButton(\"Delete\");\n this.setLayout(new FlowLayout());\n LOOGER.info(\"components exit\");\n }",
"private void createUIComponents() {\n this.removeAll();\n this.setLayout(new GridBagLayout());\n\n selectionListener = e -> update();\n\n categorySet_panel = new DataObject_DisplayList<>(database.getSchema(), CategorySet.class, new Full_Set<>(database, CategorySet.class), false, this);\n categorySet_panel.addControlButtons(new CategorySet_ElementController(database, this));\n categorySet_panel.getMainPanel().getListSelectionModel().addListSelectionListener(selectionListener);\n\n virtualCategory_set = new OneParent_Children_Set<>(VirtualCategory.class, null);\n virtualCategory_elementController = new VirtualCategory_ElementController(database, this);\n virtualCategory_panel = new DataObject_DisplayList<>(database.getSchema(), VirtualCategory.class, virtualCategory_set, false, this);\n virtualCategory_panel.addControlButtons(virtualCategory_elementController);\n virtualCategory_panel.getMainPanel().getListSelectionModel().addListSelectionListener(selectionListener);\n\n categoryToCategorySet_set = new OneParent_Children_Set<>(CategoryToCategorySet.class, null);\n categoryToCategorySet_elementController = new CategoryToCategorySet_ElementController(database, this);\n categoryToCategorySet_panel = new DataObject_DisplayList<>(database.getSchema(), CategoryToCategorySet.class, categoryToCategorySet_set, false, this);\n categoryToCategorySet_panel.addControlButtons(categoryToCategorySet_elementController);\n\n categoryToVirtualCategory_set = new OneParent_Children_Set<>(CategoryToVirtualCategory.class, null);\n categoryToVirtualCategory_elementController = new CategoryToVirtualCategory_ElementController(database, this);\n categoryToVirtualCategory_panel = new DataObject_DisplayList<>(database.getSchema(), CategoryToVirtualCategory.class, categoryToVirtualCategory_set, false, this);\n categoryToVirtualCategory_panel.addControlButtons(categoryToVirtualCategory_elementController);\n\n GridBagConstraints gridBagConstraints = new GridBagConstraints();\n gridBagConstraints.fill = GridBagConstraints.BOTH;\n gridBagConstraints.weightx = 1;\n gridBagConstraints.weighty = 1;\n gridBagConstraints.gridheight = 2;\n\n gridBagConstraints.gridx = 0;\n this.add(categorySet_panel, gridBagConstraints);\n\n gridBagConstraints.gridheight = 1;\n gridBagConstraints.gridx = 1;\n this.add(virtualCategory_panel, gridBagConstraints);\n\n gridBagConstraints.weighty = 2;\n this.add(categoryToCategorySet_panel, gridBagConstraints);\n\n gridBagConstraints.gridheight = 2;\n gridBagConstraints.weighty = 1;\n gridBagConstraints.gridx = 2;\n this.add(categoryToVirtualCategory_panel, gridBagConstraints);\n }",
"private void createElements() {\n\n\t\tBorderLayout manager = new BorderLayout();\n\t\tthis.setLayout(manager);\n\t\tthis.manager = manager;\n\t\tJLabel title = new JLabel(\"Welcome!\"); //change to display customer name\n\t\ttitle.setFont(new Font(title.getName(), Font.BOLD, 24));\n\t\ttitle.setHorizontalAlignment(SwingConstants.CENTER);\n\t\tthis.add(title, BorderLayout.PAGE_START);\n\n\t\t//left Option panel\n\t\tJPanel optPanel = new JPanel();\n\t\toptPanel.setBorder(BorderFactory.createLineBorder(Color.black));\n\t\toptPanel.setPreferredSize(new Dimension (200,500));\n\t\toptPanel.setLayout(new GridBagLayout());\n\t\tGridBagConstraints c = new GridBagConstraints();\n\t\tJButton newApt = new JButton(\"Check Rented Media\");\n\t\tnewApt.addActionListener(controller);\n\t\tnewApt.setActionCommand(\"rented\");\n\t\tJButton viewApt = new JButton(\"Rent Media\");\n\t\tviewApt.addActionListener(controller);\n\t\tviewApt.setActionCommand(\"newRent\");\n\t\tJButton close = new JButton(\"Exit Program\");\n\t\tclose.addActionListener(controller);\n\t\tclose.setActionCommand(\"close\");\n\t\tc.weighty = 1;\n\t\tc.fill = GridBagConstraints.HORIZONTAL;\n\t\tc.ipady = 10;\n\t\tc.insets = new Insets(20,0,0,0);\n\t\tc.gridy = 0;\n\t\toptPanel.add(newApt, c);\n\t\tc.gridy = 1;\n\t\toptPanel.add(viewApt, c);\n\t\tc.gridy = 2;\n\t\toptPanel.add(close, c);\n\t\tthis.add(optPanel, BorderLayout.LINE_START);\n\n\t\tJPanel placeHolder = new JPanel();\n\t\tthis.add(placeHolder, BorderLayout.CENTER);\n\n\t\tJLabel pointsLbl = new JLabel (\"The customer has \" + controller.getCustomerPoints() +\n\t\t\t\t\" loyalty points.\");\n\t\tthis.pointsLbl = pointsLbl;\n\t\tpointsLbl.setHorizontalAlignment(SwingConstants.CENTER);\n\t\tthis.add(pointsLbl, BorderLayout.PAGE_END);\n\t\tthis.validate();\n\t\tthis.repaint();\n\n\t}",
"private void initPanels() {\r\n\t\r\n\tpanel = new JPanel();\r\n\tpanel.setBounds(0, 0, ScreenSize.WIDTH + 25, ScreenSize.HEIGHT + 50);\r\n\tpanel.setLayout(new BorderLayout());\r\n\tpanel.addComponentListener(this);\r\n\r\n\tbord = new BordPanel();\r\n\tbord.setBounds(0 ,0 ,ScreenSize.WIDTH, ScreenSize.HEIGHT);\r\n\tbord.setOpaque(true);\r\n\r\n\tlabel = new JLabel();\r\n\tlabel.setText(\"Text\");\r\n\r\n\tpanel.add(label, BorderLayout.SOUTH);\r\n\tpanel.add(bord, BorderLayout.CENTER);\r\n\t\r\n\tframe.add(panel);\r\n }",
"void addComponent(Component component);",
"public ADD() {\n initComponents();\n }"
] | [
"0.709369",
"0.70657325",
"0.7056586",
"0.6898017",
"0.68294",
"0.6785829",
"0.6749771",
"0.6668065",
"0.6666552",
"0.6589314",
"0.65670127",
"0.6558332",
"0.64927995",
"0.6456568",
"0.6439989",
"0.64344186",
"0.6419747",
"0.6386218",
"0.6367513",
"0.6365596",
"0.63545495",
"0.6326825",
"0.6315109",
"0.6264753",
"0.62309015",
"0.6203656",
"0.6198793",
"0.6198793",
"0.61599624",
"0.6133538",
"0.6133298",
"0.61299586",
"0.6124913",
"0.61221075",
"0.6119098",
"0.6109419",
"0.6103492",
"0.6102272",
"0.60719645",
"0.6070649",
"0.6052514",
"0.60418886",
"0.6031081",
"0.60288286",
"0.60254216",
"0.60200685",
"0.60200685",
"0.60200685",
"0.60200685",
"0.60200685",
"0.60200685",
"0.60200685",
"0.60200685",
"0.60200685",
"0.60200685",
"0.60200685",
"0.60200685",
"0.60200685",
"0.60200685",
"0.60200685",
"0.60200685",
"0.60200685",
"0.60200685",
"0.6010551",
"0.59942347",
"0.59815806",
"0.5981208",
"0.59726727",
"0.5964134",
"0.5963492",
"0.5936745",
"0.5935776",
"0.59356886",
"0.5932022",
"0.59105015",
"0.5906249",
"0.5899669",
"0.5891494",
"0.58827287",
"0.58810735",
"0.5879185",
"0.5878484",
"0.58711696",
"0.58682036",
"0.58493626",
"0.584527",
"0.5843446",
"0.58395475",
"0.583159",
"0.58264387",
"0.582453",
"0.58228445",
"0.58203536",
"0.5811054",
"0.5810896",
"0.5802016",
"0.579056",
"0.57875997",
"0.57860965",
"0.5785686",
"0.57849854"
] | 0.0 | -1 |
System.out.println(SingetonDemo.getInstance() == singetonDemo.getInstance()); System.out.println(SingetonDemo.getInstance() == singetonDemo.getInstance()); System.out.println(SingetonDemo.getInstance() == singetonDemo.getInstance()); | public static void main(String[] args) {
// System.out.println(SingetonDemo.getInstance() == singetonDemo.getInstance());
// System.out.println(SingetonDemo.getInstance() == singetonDemo.getInstance());
for (int i = 0; i < 10; i++) {
new Thread(()->{
SingetonDemo.getInstance();
},String.valueOf(i)).start();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void testGetInstance() {\n\t\tREDFinder finder = REDFinder.getInstance();\n\t\tassertSame(\"getInstance returned not the same object.\", finder,\n\t\t\t\tREDFinder.getInstance());\n\t}",
"@Test\n public void testGetInstance() {\n\n // singleton\n assertSame(GestionnaireRaccourcis.getInstance(), GestionnaireRaccourcis.getInstance());\n }",
"public static void main(String args[]){\n \n SingletonObject object = SingletonObject.getInstance();\n \n object.showMessage();\n \n SingletonObject object2 = SingletonObject.getInstance();\n System.out.println(object==object2);\n \n }",
"public static void main(String[] args) {\n\t\tSingleton s = Singleton.getInstance();\n\t\tSystem.out.println(s == Singleton.getInstance());\n\t\tSystem.out.println(s.value);\n\t\ts.value = 12;\n\t\tSystem.out.println(Singleton.getInstance().value);\n\t}",
"public boolean isSingleton()\n\t{\n\t\treturn true;\n\t}",
"@Test\n public void TestSingletonInitialization() {\n\t\tassertSame(SingletonClass.getInstance(), SingletonClass.getInstance());\n }",
"static void useSingleton(){\n\t\tSingleton singleton = Singleton.getInstance();\n\t\tprint(\"singleton\", singleton);\n\t}",
"@Override\n public boolean isSingleton() {\n return false;\n }",
"public boolean isSingleton() {\n\t\treturn false;\r\n\t}",
"@Test\n public void testGetInstance() {\n System.out.println(\"getInstance\");\n Fabrica expResult = Fabrica.getInstance();\n Fabrica result = Fabrica.getInstance();\n assertEquals(expResult, result);\n \n }",
"public boolean isSingleton() {\n\t\treturn false;\n\t}",
"@Test\n\tpublic void testSingleton()\n\t{\n\t\tChatManager cm1 = ChatManager.getSingleton();\n\t\tassertSame(cm1, ChatManager.getSingleton());\n\t\tChatManager.resetSingleton();\n\t\tassertNotSame(cm1, ChatManager.getSingleton());\n\t}",
"@Test\r\n\tpublic final void testGetInstance() {\r\n\t\tComparatorFacade facade = ComparatorFacade.getInstance();\r\n\t\tAssert.assertSame(singleton, facade);\r\n\t}",
"public static void main(String[] args) {\n Student s1 = Student.getSingletonStudent();\n Student s2 = Student.getSingletonStudent();\n System.out.println(s1 == s2);\n }",
"public static Boolean getSingleton() {\r\n\t\treturn singleton;\r\n\t}",
"protected static void demoMethod( ) {\n System.out.println(\"demoMethod for singleton\");\n }",
"@Test\n public void testMultipleCallsReturnTheSameObjectInSameThread() {\n // Create several instances in the same calling thread\n S instance1 = this.singletonInstanceMethod.get();\n S instance2 = this.singletonInstanceMethod.get();\n S instance3 = this.singletonInstanceMethod.get();\n // now check they are equal\n assertSame(instance1, instance2);\n assertSame(instance1, instance3);\n assertSame(instance2, instance3);\n }",
"@Test\n public void testGetInstance() {\n System.out.println(\"getInstance test ---\");\n ChannelController expResult = ChannelController.getInstance();\n ChannelController result = ChannelController.getInstance();\n assertTrue(expResult == result);\n }",
"public static void main(String[] args){\n\n DbSingleton instance = DbSingleton.getInstance();\n\n //DbSingleton test = new DbSingleton();\n DbSingleton instance2 = DbSingleton.getInstance();\n\n System.out.println(instance);\n System.out.println(instance2);\n\n }",
"@Test\r\n\tpublic void test5() {\n\t\t\r\n\t\tObject object3=ad.getBean(\"myFactoryBeanImpl\");\r\n\t\tObject object4=ad.getBean(\"myFactoryBeanImpl\");\r\n\t\tSystem.out.println(object3==object4);\r\n\t\t\r\n\t}",
"public boolean isSingleton () throws java.io.IOException, com.linar.jintegra.AutomationException;",
"@Test\r\n\tpublic void test_singletonLink_compareByHashCode_reflectionAPI() throws Exception {\r\n\t\tObject ref1HashCode = Singleton.getInstance().hashCode();\r\n\t\t@SuppressWarnings(\"rawtypes\")\r\n\t\tClass clazz = Class.forName(\"com.bridgeLabz.designPattern.creationalDesignPattern.singleton.eagerInitialization.Singleton\");\r\n\t\t@SuppressWarnings(\"unchecked\")\r\n\t\tConstructor<Singleton> ctor = clazz.getDeclaredConstructor();\r\n\t\tctor.setAccessible(true);\r\n\t\tint ref2HashCode = ctor.newInstance().hashCode();\r\n\r\n\t\tassertNotEquals(ref1HashCode, ref2HashCode);\r\n\r\n\t}",
"private static void createSingletonObject() {\n\t\tSingleton s1 = Singleton.getInstance();\n\t\tSingleton s2 = Singleton.getInstance();\n\n\t\tprint(\"S1\", s1);\n\t\tprint(\"S2\", s2);\n\t}",
"private MySingleton() {\r\n\t\tSystem.out.println(\"Only 1 object will be created\");\r\n\t}",
"@Test\n public void testGetInstance() {\n System.out.println(\"getInstance\");\n ConnectionManager result = ConnectionManager.getInstance();\n assertNotNull(result);\n assertEquals(instance,result);\n }",
"@Test\n public void testGetInstance() throws Exception {\n HealthRecordController copy1 = HealthRecordController.getInstance();\n assert(HealthRecordController.getInstance() != null);\n assert(copy1 == HealthRecordController.getInstance());\n }",
"public static void main(String[] args) {\n\t\tSigleton s=Sigleton.getInstance();\r\n\t\t\r\n\t\tSystem.out.println(s);\r\n\t\t\r\n\t\tSigleton s1=Sigleton.getInstance();\r\n\t\tSystem.out.println(s1);\r\n\t\t\r\n\t\t\r\n\t\tSigleton s2=Sigleton.getInstance();\r\n\t\tSystem.out.println(s2);\r\n\t\t\r\n\t}",
"@Test\n public void testGetInstance()\n {\n System.out.println(\"TEST: getInstance\");\n TomTomReader result = TomTomReader.getInstance();\n assertNotEquals(null, result);\n }",
"boolean hasInstance();",
"public static void main(String[] args) {\n\n\t\tSystem.out.println(Singleton.getInstance());\n\t\tSystem.out.println(Singleton.getInstance());\n\t\tSystem.out.println(Singleton.getInstance());\n\t\tSystem.out.println(Singleton.getInstance());\n\t\tSystem.out.println(Singleton.getInstance());\n\n\t}",
"@Test\n public void equalsSameTest() {\n Device device2 = new Device(deviceID, token);\n assertEquals(device, device2);\n }",
"public static void main(String[] args) {\n ClassicSingleton singleton = ClassicSingleton.getInstance();\n ClassicSingleton singleton1 = ClassicSingleton.getInstance();\n\n }",
"public static void main(String[] args) {\n\n System.out.println(SingletonExample.getInstance());\n System.out.println(SingletonExample.getInstance());\n }",
"public static void main(String [] args) throws ClassNotFoundException, NoSuchMethodException, SecurityException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException{\n\t\tSingleton2A obj1 = Singleton2A.getInstance();\n\t\tSingleton2A obj2 = Singleton2A.getInstance();\n\t\t\n\t\tprintme(\"obj1\", obj1); // \tobj1, 2018699554\n\t\tprintme(\"obj2\", obj2); // \tobj2, 2018699554\n\t\t\n\t\tSystem.out.println(obj1.equals(obj2)); // true\n\t\t\n\t\t\n\t\t//Breaking singleton code using reflection:\n\t\tClass cls = Class.forName(\"advjava.Singleton2\");\n\t\tConstructor<Singleton2A> constr = cls.getDeclaredConstructor();\t\n\t\tconstr.setAccessible(true); // call constructor\n\t\t\n\t\tSingleton2A obj3 = constr.newInstance(); // new object created\n\t\tprintme(\"obj3\", obj3); // obj3, 1311053135\n\t\t\n\t\tSystem.out.println(obj1.equals(obj3)); // false\n\t\t\n\t}",
"public static void main(String[] args) throws IOException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {\n\n Class objectClass = LazyMethodSingleton.class;\n\n Constructor constructor = objectClass.getDeclaredConstructor();\n constructor.setAccessible(true);\n\n LazyMethodSingleton instance = LazyMethodSingleton.getInstance();\n LazyMethodSingleton newInstance = (LazyMethodSingleton) constructor.newInstance();\n\n// HungrySingleton instance = HungrySingleton.getInstance();\n// HungrySingleton newInstance = (HungrySingleton) constructor.newInstance();\n\n// LazyStaticInnerClassSingleton instance = LazyStaticInnerClassSingleton.getInstance();\n// LazyStaticInnerClassSingleton newInstance = (LazyStaticInnerClassSingleton) constructor.newInstance();\n\n System.out.println(instance);\n System.out.println(newInstance);\n System.out.println(instance == newInstance);\n\n\n\n\n }",
"@Test\n public void testEquals() {\n System.out.println(\"equals\");\n Commissioner instance = new Commissioner();\n Commissioner instance2 = new Commissioner();\n instance.setLogin(\"genie\");\n instance2.setLogin(\"genie\");\n boolean expResult = true;\n boolean result = instance.equals(instance2);\n assertEquals(expResult, result);\n }",
"@org.testng.annotations.Test\n public void testGetInstance() throws Exception {\n System.out.println(\"getInstance\");\n Store result = Store.getInstance();\n assertEquals(result, Store.getInstance());\n assertTrue(result instanceof Store);\n }",
"@Test\n public void testEquals() throws StoreException {\n System.out.println(\"equals\");\n boolean expResult = false;\n boolean result = instance.equals(new Object());\n assertEquals(result, expResult);\n\n assertEquals(instance.equals(Store.getInstance()), true);\n }",
"@Test\r\n public void testGetInstance() {\r\n System.out.println(\"getInstance\");\r\n assertNotNull(sm);\r\n \r\n SessionManager instance = SessionManager.getInstance();\r\n assertEquals(instance, sm);\r\n }",
"private SingletonDoubleCheck() {}",
"public static void equalsDemo() {\n\n//\t\tSystem.out.printf(\"demo1 == demo2 = %s%n\", demo1 == demo2);\n//\t\tSystem.out.printf(\"demo2 == demo3 = %s%n\", demo2 == demo3);\n//\t\tSystem.out.printf(\"demo2.equals(demo3) = %s%n\", demo2.equals(demo3));\n//\t\tSystem.out.printf(\"%n\");\n\t}",
"public static test5 getinstance(){\r\n\t\t return instance;\r\n\t }",
"public static void main(String[] args) {\n SingletonClass singletonClass = SingletonClass.getInstance();\n System.out.println(\"SingletonClass instance Created.Having value of x : \" + singletonClass.getX());\n// Setting the value of private variable of SingletonClass\n singletonClass.setX(11);\n// Getting the another instance of SingletonClass.This will return the same instance used before.\n SingletonClass singletonClass1 = SingletonClass.getInstance();\n System.out.println(\"SingletonClass instance used Having value of x : \" + singletonClass.getX());\n }",
"private SingletonSample() {}",
"@Test public void singletonResolutionInFunctions() {\n fail( \"Not yet implemented\" );\n }",
"@Test\n public void testEquals() {\n System.out.println(\"equals\");\n Setting s = Setting.factory();\n Setting s1 = Setting.factory();\n Setting s2 = Setting.factory();\n Setting s3 = Setting.getSetting(\"test1\");\n Setting s4 = Setting.getSetting(\"test1\");\n\n Object o = null;\n Setting instance = s;\n assertFalse(s.equals(o));\n o = new Object();\n assertFalse(s.equals(o));\n assertFalse(s.equals(s1));\n assertEquals(s3, s4);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype. need more tests\");\n }",
"public static void main(String[] args) throws Exception {\n\n Singleton3 ins = Singleton3.getInstance();\n Constructor constructor = Singleton3.class.getDeclaredConstructor();\n constructor.setAccessible(true);\n Singleton3 ins1 = (Singleton3)constructor.newInstance();\n System.out.println(ins == ins1);\n }",
"public static void main(String... args) {\n Singletone singletone = Singletone.getInstance();\n try {\n // create obj for Singletone by Accessing private Constructor of\n Class clazz = Class.forName(\"com.krushidj.singletone.Singletone\");\n // get All consturctors of the class\n Constructor[] cons = clazz.getDeclaredConstructors();\n // provide access to private constructor\n cons[0].setAccessible(true);\n Field f = (Singletone.class).getDeclaredField(\"isInstantiated\");\n f.setAccessible(true);\n f.set(true, false);\n // creating obj using the Accessed constructor\n Singletone singletone1 = (Singletone) cons[0].newInstance(null);\n System.out.println(\"singletone hashCode:::\" + singletone.hashCode());\n System.out.println(\"singletone1 hashCode:::\" + singletone1.hashCode());\n } // try\n catch (Exception e) {\n e.printStackTrace();\n }\n\n }",
"public static SingleObject getInstance(){\n return instance;\n }",
"public void displaySingleton() {\r\n Log.logInfo(\"Singleton object was already created for {0}\",\r\n Thread.currentThread().getStackTrace()[1].getClassName());\r\n }",
"public static boolean getInsta() {\n return insta;\n }",
"public void testGetInstance(){\r\n assertNotNull(this.lm);\r\n }",
"@Test\n public void testEquals() {\n System.out.println(\"equals\");\n Receta instance = new Receta();\n instance.setNombre(\"nom1\");\n Receta instance2 = new Receta();\n instance.setNombre(\"nom2\");\n boolean expResult = false;\n boolean result = instance.equals(instance2);\n assertEquals(expResult, result);\n }",
"public boolean isSingleUse() {\r\n return singleUse;\r\n }",
"@Test\n public void equals2() throws Exception {\n SmartPlayer x = new SmartPlayer(0, 1);\n SmartPlayer y = new SmartPlayer(0, 2);\n assertFalse(x.equals(y));\n }",
"public static void main(String[] args) {\n\t\t\n\t\tMultitonV2 instance1 = MultitonV2.getInstance();\n\t\tMultitonV2 instance2 = MultitonV2.getInstance(); \n\t\tMultitonV2 instance3 = MultitonV2.getInstance();\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tMultitonV2 instance4 = MultitonV2.getInstance(); \n\t\tMultitonV2 instance5 = MultitonV2.getInstance();\n\t\t\n\t\t\n\t\t\n\t\tif(instance1==instance4) System.out.println(\"올바르게 동작중\");\n\t\tif(instance2==instance5) System.out.println(\"올바르게 동작중2\");\n\n\t}",
"public static void main(String[] args) {\n SingleTon ton1 = SingleTon.getInstance();\n SingleTon ton2 = SingleTon.getInstance();\n }",
"public static SingleObject getInstance(){\n\t\treturn instance;\n\t}",
"public static Singleton getInstance() {\n return mSing;\n }",
"public static void main(String[] args) {\n\t\tSingleton tmp = Singleton.getInstance();\n\t\ttmp.demoMethod();\n\t\t\n\t/*\tClassicSingleton tmp = ClassicSingleton.getInstance();\n\t\ttmp.getInstance();*/\n\t}",
"@Test\n public void equals() throws Exception {\n SmartPlayer x = new SmartPlayer(0, 0);\n SmartPlayer y = new SmartPlayer(0, 0);\n assertTrue(x.equals(y));\n }",
"private void initInstance() {\n init$Instance(true);\n }",
"@Test\n\tpublic void testSampleEquals() {\n\n\t\tassertTrue(square.equals(squareRotate));\n\t\t\n\t\tassertTrue(pyr1.equals(pyr5));\n\t\t\n\t\tassertTrue(s.equals(sInitial));\n\t\tassertFalse(stick.equals(stickRotated));\n\t\tassertFalse(s.equals(sRotated));\n\n\n\t}",
"public boolean isNetworkSingleton() {\n return isNetworkSingleton;\n }",
"@Test\n @DisplayName(\"Spring Container and songleton\")\n void springContainer(){\n\n ApplicationContext ac = new AnnotationConfigApplicationContext(AppConfig.class);\n\n //1. access: create object when gets called\n MemberService memberService1 = ac.getBean(\"memberService\", MemberService.class);\n\n //2 access: create object whenever gets called\n MemberService memberService2 = ac.getBean(\"memberService\", MemberService.class);\n\n //check the references\n System.out.println(\"memberService1 = \" + memberService1);\n System.out.println(\"memberService2 = \" + memberService2);\n\n //memberService1 !== memberService2\n Assertions.assertThat(memberService1).isSameAs(memberService2);\n\n //as you could see all the objects are created everytime we request for it when calling allConfig.memberService()\n }",
"public static Singleton getInstance() {\n return SingletonHolder.SINGLETON_INSTANCE;\n }",
"public static boolean hasInstance() {\n return instance != null;\n }",
"@Test\n void equals1() {\n Student s1=new Student(\"emina\",\"milanovic\",18231);\n Student s2=new Student(\"emina\",\"milanovic\",18231);\n assertEquals(true,s1.equals(s2));\n }",
"synchronized public static SampletypeManager getInstance()\n {\n return singleton;\n }",
"public static void main(String[] args)\r\n\t{\n\t\tSingleton obj1 = Singleton.getInstance(); // new instance created\r\n\t\tSingleton obj2 = Singleton.getInstance(); // reference for previously created object\r\n\t\tSingleton obj3 = Singleton.getInstance(); // same\r\n\r\n\t\tobj2.str = obj2.str.toUpperCase();\r\n\t\tSystem.out.println(\"str in obj1 is \" + obj1.str); // Capitalized\r\n\t\tSystem.out.println(\"str in obj2 is \" + obj2.str); // Capitalized\r\n\t\tSystem.out.println(\"str in obj3 is \" + obj3.str); // Capitalized\r\n\r\n\t\tSystem.out.println(\"Addr of obj1 is \" + obj1); // Address\r\n\t\tSystem.out.println(\"Addr of obj2 is \" + obj2); // Address\r\n\t\tSystem.out.println(\"Addr of obj3 is \" + obj3); // Address\r\n\r\n\t\t/* Some developers prefer to print hashcode of objs to ensure that it is the same object. Actually,\r\n\t\t hashcode is not the address of object in memory and is unreliable. It is some integer value which\r\n\t\t collections like hashmap or hashtable use to hash or calc hash addr of objs while inserting them\r\n\t\t into the collection. Hashcode is same if Object's class equals() returns true. Same hashcode may be\r\n\t\t returned for unequal objects.\r\n\t\t */\r\n\r\n\t\tSystem.out.println(\"Hashcode of obj1 is \" + obj1.hashCode());\r\n\t\tSystem.out.println(\"Hashcode of obj2 is \" + obj2.hashCode());\r\n\t\tSystem.out.println(\"Hashcode of obj3 is \" + obj3.hashCode());\r\n\r\n\t}",
"@Test\n\tpublic void test_equals1() {\n\tTvShow t1 = new TvShow(\"Sherlock\",\"BBC\");\n\tTvShow t2 = new TvShow(\"Sherlock\",\"BBC\");\n\tassertTrue(t1.equals(t2));\n }",
"String getInstance()\n {\n return instance;\n }",
"public static SingleObject getInstance()\r\n {\r\n return instance;\r\n }",
"private SingleTon() {\n\t}",
"@Test\n public void equalsSelfTest() {\n assertEquals(device, device);\n }",
"public void beanScope() {\n\t\tPhone singleton1 = (Phone) appContext.getBean(\"singleton\"), singleton2 = (Phone) appContext.getBean(\"singleton\");\n\t\tPhone prototype1 = (Phone) appContext.getBean(\"prototype\"), prototype2 = (Phone) appContext.getBean(\"prototype\");\n\n\t\tSystem.out.println();\n\t\tSystem.out.println(String.format(\"Testing singleton on init: .equals() = %b\", singleton1.equals(singleton2)));\n\n\t\tsingleton1.setName(\"Galaxy Note 10\");\n\t\tsingleton1.setManufacture(\"Samsung\");\n\t\tSystem.out.println(\n\t\t\t\tString.format(\"Testing singleton bean after changing props: .equals() = %b\", singleton1.equals(singleton2)));\n\n\t\tSystem.out.println();\n\t\tSystem.out\n\t\t\t\t.println(String.format(\"Testing prototype bean after init: .equals() = %b\", singleton1.equals(singleton2)));\n\n\t\tprototype1.setName(\"Galaxy Note 10\");\n\t\tprototype1.setManufacture(\"Samsung\");\n\t\tSystem.out.println(\n\t\t\t\tString.format(\"Testing prototype bean after changing props: .equals() = %b\", prototype1.equals(prototype2)));\n\t}",
"public static void main (String[] args) {\n\n\n Thread t1= new Thread(new Runnable() {\n @Override\n public void run() {\n System.out.println(\"Output: \"+Singleton.getInstance());\n Singleton.setObjName(\"Meow!!\");\n System.out.println(\"t1 Name: \"+Singleton.getName());\n }\n });\n\n Thread t2 = new Thread(new Runnable() {\n @Override\n public void run() {\n\n System.out.println(\"Output: \"+Singleton.getInstance());\n System.out.println(\"t2 Name: \"+Singleton.getName());\n\n }\n });\n\n Thread t3 = new Thread(new Runnable() {\n @Override\n public void run() {\n\n System.out.println(\"Output: \"+Singleton.getInstance());\n Singleton.setObjName(\"WolWol\");\n System.out.println(\"t3 Name: \"+Singleton.getName());\n\n }\n });\n\n Thread t4 = new Thread(new Runnable() {\n @Override\n public void run() {\n\n System.out.println(\"Output: \"+Singleton.getInstance());\n System.out.println(\"t4 Name: \"+Singleton.getName());\n\n }\n });\n\n// t1.start();\n// t2.start();\n// t3.start();\n// t4.start();\n\n \n }",
"public static void main(String args[])\n {\n SingletonClass x = SingletonClass.gt_instance();\n\n // Instantiating Singleton class with variable y\n SingletonClass y = SingletonClass.gt_instance();\n\n // Instantiating Singleton class with variable z\n SingletonClass z = SingletonClass.gt_instance();\n\n // Printing the hash code for above variable as\n // declared\n System.out.println(\"Hashcode of x is \"\n + x.hashCode());\n System.out.println(\"Hashcode of y is \"\n + y.hashCode());\n System.out.println(\"Hashcode of z is \"\n + z.hashCode());\n\n // Condition check\n if (x == y && y == z) {\n\n // Print statement\n System.out.println(\n \"Three objects point to the same memory location on the heap i.e, to the same object\");\n }\n\n else {\n // Print statement\n System.out.println(\n \"Three objects DO NOT point to the same memory location on the heap\");\n }\n }",
"@Test\n public void testGetDefault() {\n System.out.println(\"getDefault\");\n\n final LayersViewController instance1 = LayersViewController.getDefault();\n final LayersViewController instance2 = LayersViewController.getDefault();\n assertEquals(instance1, instance2);\n }",
"boolean hasSameAs();",
"private static void multiThreading(){\n\t\tSystem.out.println(\"\\nCreating new two separate instances of Singleton using Multi threading\");\n\t\tExecutorService service = Executors.newFixedThreadPool(2);\n\t\tservice.submit(TestSingleton::useSingleton);\n\t\tservice.submit(TestSingleton::useSingleton);\n\t\tservice.shutdown();\n\t}",
"public static boolean instantiated() {\n\treturn (coreNLP != null);\n }",
"synchronized public static void setInstance(SampletypeManager instance)\n {\n singleton = instance;\n }",
"public static boolean isSingleton(long ts) {\n\t\treturn ((ts & LOCAL_MASK) != 0);\n\t}",
"@Test\n\tpublic void testDeckEqualsAgain() {\n\t\t\n\t\tStandardDeckClass oneDeck = new StandardDeckClass();\n\t\tVegasDeckClass testDeck = new VegasDeckClass();\n\t\t\n\t\tboolean isSame = oneDeck.equals(testDeck);\n\t\t\n\t\tassertEquals(\"equals method not working as expected\", false, isSame);\n\t}",
"public static SingletonTextureFactory getInstance(){\n\t\treturn instance;\n\t}",
"public void run() {\n\t\tSystem.out.println(Singleton.getInstance());\n\t}",
"public static utilitys getInstance(){\n\r\n\t\treturn instance;\r\n\t}",
"void testSingleTone(){\n\t\t\n\t\tSingleTone s =SingleTone.getSingleTone();\n\t\ts.f();\n\t}",
"@Test\n\tpublic void equalsSimilarObjects() {\n\t\tProductScanImageURIKey key1 = this.getDefaultKey();\n\t\tProductScanImageURIKey key2 = this.getDefaultKey();\n\t\tboolean equals = key1.equals(key2);\n\t\tSystem.out.println();\n\t\tAssert.assertTrue(equals);\n\t}",
"@Test\n public void testEquals() {\n \n Beneficiaire instance = ben2;\n Beneficiaire unAutreBeneficiaire = ben3;\n boolean expResult = false;\n boolean result = instance.equals(unAutreBeneficiaire);\n assertEquals(expResult, result);\n\n unAutreBeneficiaire = ben2;\n expResult = true;\n result = instance.equals(unAutreBeneficiaire);\n assertEquals(expResult, result);\n }",
"public SingletonVerifier() {\n }",
"String getSingletonName();",
"public static AccountVerificationSingleton getInstance()\n {\n if (uniqueInstance == null)\n {\n uniqueInstance = new AccountVerificationSingleton();\n }\n \n return uniqueInstance;\n }",
"@Test\n\tpublic void testFileSystemSingleton() {\n\t\ttry {\n\t\t\tFileSystem f1 = FileSystem.getFileSystem();\n\t\t\tFileSystem f2 = FileSystem.getFileSystem();\n\t\t\tassertSame(f1, f2);\n\t\t}\n\t\tcatch (RuntimeException e) {\n\t\t\tfail();\n\t\t}\n\t}",
"@Test\n public void testEquals02() {\n System.out.println(\"equals\");\n Object otherObject = new SocialNetwork();\n boolean result = sn10.equals(otherObject);\n assertFalse(result);\n }",
"public static synchronized Singleton getInstanceTS() {\n\t\tif (_instance == null) {\n\t\t\t_instance = new Singleton();\n\t\t}\n\t\treturn _instance;\n\t}",
"private SingletonSigar(){}",
"public static IndicieSeznam getInstance() {\n\n return ourInstance;\n }",
"public static void main(String args[]){\n\t\tOlive empty = new Olive();\n\t\tOlive notEmpty = new Olive(\"notEmpty\",new Money(1,1),300);\n\t\tOlive notEmpty2 = new Olive(\"notEmpty\",new Money(1,1),300);\n\t\tSystem.out.println(empty.toString()+\"\\n\"+notEmpty.toString()+\"\\n\" +notEmpty2.toString()+\"\\n\" );\n\t\tSystem.out.println(empty.equals(notEmpty)+\"\\n\" +notEmpty.equals(notEmpty2));\n\t}"
] | [
"0.6959372",
"0.6918613",
"0.69077015",
"0.68884677",
"0.6665492",
"0.66227293",
"0.6596189",
"0.6584481",
"0.65577203",
"0.6534206",
"0.65130657",
"0.6427749",
"0.63874555",
"0.6344015",
"0.62366164",
"0.6219468",
"0.6209083",
"0.61799127",
"0.6175554",
"0.6145117",
"0.6106593",
"0.610525",
"0.6073489",
"0.60695004",
"0.6045394",
"0.60224056",
"0.6010453",
"0.5983949",
"0.59786814",
"0.5973324",
"0.59724754",
"0.5965362",
"0.5958802",
"0.5949733",
"0.5945099",
"0.5937041",
"0.59011555",
"0.5861273",
"0.5856617",
"0.58470285",
"0.5844802",
"0.58426034",
"0.5839053",
"0.5824604",
"0.5815399",
"0.5813507",
"0.57984453",
"0.5780304",
"0.57344747",
"0.5727567",
"0.57093006",
"0.56867254",
"0.56637204",
"0.5663221",
"0.5662174",
"0.5645074",
"0.56422186",
"0.56282157",
"0.5626908",
"0.5615858",
"0.56105626",
"0.5583813",
"0.5581025",
"0.5577107",
"0.557191",
"0.55707836",
"0.55707395",
"0.55671585",
"0.5556309",
"0.55480915",
"0.5536034",
"0.55347127",
"0.5531188",
"0.5523752",
"0.55233884",
"0.55228657",
"0.552119",
"0.5515601",
"0.55136997",
"0.5502562",
"0.54849404",
"0.54842293",
"0.5482818",
"0.5477347",
"0.54741853",
"0.5467613",
"0.5466107",
"0.5458418",
"0.5458035",
"0.54560286",
"0.54455966",
"0.5444247",
"0.54363036",
"0.5421257",
"0.5411797",
"0.5408586",
"0.5403687",
"0.54019064",
"0.53948843",
"0.53897715"
] | 0.69486076 | 1 |
TODO Autogenerated method stub | @Override
public int hashCode() {
return id;
} | {
"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 boolean equals(Object arg0) {
Student s=(Student)arg0;
return this.id==s.id;
} | {
"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 int compareTo(Object ob) {
Student s=(Student)ob;
return (int)((this.marks-s.marks )*(1000));
} | {
"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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.